common.bundle.js 2.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["common"],{
  2. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/chart.js":
  3. /*!******************************************************************************!*\
  4. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/chart.js ***!
  5. \******************************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. eval("/**\n * @namespace Chart\n */\nvar Chart = __webpack_require__(/*! ./core/core */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.js\")();\n\nChart.helpers = __webpack_require__(/*! ./helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\n// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!\n__webpack_require__(/*! ./core/core.helpers */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.helpers.js\")(Chart);\n\nChart.defaults = __webpack_require__(/*! ./core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nChart.Element = __webpack_require__(/*! ./core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nChart.elements = __webpack_require__(/*! ./elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nChart.Interaction = __webpack_require__(/*! ./core/core.interaction */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.interaction.js\");\nChart.layouts = __webpack_require__(/*! ./core/core.layouts */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js\");\nChart.platform = __webpack_require__(/*! ./platforms/platform */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.js\");\nChart.plugins = __webpack_require__(/*! ./core/core.plugins */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.plugins.js\");\nChart.Ticks = __webpack_require__(/*! ./core/core.ticks */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js\");\n\n__webpack_require__(/*! ./core/core.animation */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.animation.js\")(Chart);\n__webpack_require__(/*! ./core/core.controller */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.controller.js\")(Chart);\n__webpack_require__(/*! ./core/core.datasetController */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.datasetController.js\")(Chart);\n__webpack_require__(/*! ./core/core.scaleService */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scaleService.js\")(Chart);\n__webpack_require__(/*! ./core/core.scale */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scale.js\")(Chart);\n__webpack_require__(/*! ./core/core.tooltip */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.tooltip.js\")(Chart);\n\n__webpack_require__(/*! ./scales/scale.linearbase */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linearbase.js\")(Chart);\n__webpack_require__(/*! ./scales/scale.category */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.category.js\")(Chart);\n__webpack_require__(/*! ./scales/scale.linear */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linear.js\")(Chart);\n__webpack_require__(/*! ./scales/scale.logarithmic */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.logarithmic.js\")(Chart);\n__webpack_require__(/*! ./scales/scale.radialLinear */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.radialLinear.js\")(Chart);\n__webpack_require__(/*! ./scales/scale.time */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.time.js\")(Chart);\n\n// Controllers must be loaded after elements\n// See Chart.core.datasetController.dataElementType\n__webpack_require__(/*! ./controllers/controller.bar */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bar.js\")(Chart);\n__webpack_require__(/*! ./controllers/controller.bubble */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bubble.js\")(Chart);\n__webpack_require__(/*! ./controllers/controller.doughnut */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.doughnut.js\")(Chart);\n__webpack_require__(/*! ./controllers/controller.line */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.line.js\")(Chart);\n__webpack_require__(/*! ./controllers/controller.polarArea */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.polarArea.js\")(Chart);\n__webpack_require__(/*! ./controllers/controller.radar */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.radar.js\")(Chart);\n__webpack_require__(/*! ./controllers/controller.scatter */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.scatter.js\")(Chart);\n\n__webpack_require__(/*! ./charts/Chart.Bar */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bar.js\")(Chart);\n__webpack_require__(/*! ./charts/Chart.Bubble */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bubble.js\")(Chart);\n__webpack_require__(/*! ./charts/Chart.Doughnut */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Doughnut.js\")(Chart);\n__webpack_require__(/*! ./charts/Chart.Line */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Line.js\")(Chart);\n__webpack_require__(/*! ./charts/Chart.PolarArea */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.PolarArea.js\")(Chart);\n__webpack_require__(/*! ./charts/Chart.Radar */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Radar.js\")(Chart);\n__webpack_require__(/*! ./charts/Chart.Scatter */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Scatter.js\")(Chart);\n\n// Loading built-it plugins\nvar plugins = __webpack_require__(/*! ./plugins */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/index.js\");\nfor (var k in plugins) {\n\tif (plugins.hasOwnProperty(k)) {\n\t\tChart.plugins.register(plugins[k]);\n\t}\n}\n\nChart.platform.initialize();\n\nmodule.exports = Chart;\nif (typeof window !== 'undefined') {\n\twindow.Chart = Chart;\n}\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, not available anymore\n * @namespace Chart.Legend\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\nChart.Legend = plugins.legend._element;\n\n/**\n * Provided for backward compatibility, not available anymore\n * @namespace Chart.Title\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\nChart.Title = plugins.title._element;\n\n/**\n * Provided for backward compatibility, use Chart.plugins instead\n * @namespace Chart.pluginService\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\nChart.pluginService = Chart.plugins;\n\n/**\n * Provided for backward compatibility, inheriting from Chart.PlugingBase has no\n * effect, instead simply create/register plugins via plain JavaScript objects.\n * @interface Chart.PluginBase\n * @deprecated since version 2.5.0\n * @todo remove at version 3\n * @private\n */\nChart.PluginBase = Chart.Element.extend({});\n\n/**\n * Provided for backward compatibility, use Chart.helpers.canvas instead.\n * @namespace Chart.canvasHelpers\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\nChart.canvasHelpers = Chart.helpers.canvas;\n\n/**\n * Provided for backward compatibility, use Chart.layouts instead.\n * @namespace Chart.layoutService\n * @deprecated since version 2.8.0\n * @todo remove at version 3\n * @private\n */\nChart.layoutService = Chart.layouts;\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/chart.js?");
  9. /***/ }),
  10. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bar.js":
  11. /*!*****************************************************************************************!*\
  12. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bar.js ***!
  13. \*****************************************************************************************/
  14. /*! no static exports found */
  15. /***/ (function(module, exports, __webpack_require__) {
  16. "use strict";
  17. eval("\n\nmodule.exports = function(Chart) {\n\n\tChart.Bar = function(context, config) {\n\t\tconfig.type = 'bar';\n\n\t\treturn new Chart(context, config);\n\t};\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bar.js?");
  18. /***/ }),
  19. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bubble.js":
  20. /*!********************************************************************************************!*\
  21. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bubble.js ***!
  22. \********************************************************************************************/
  23. /*! no static exports found */
  24. /***/ (function(module, exports, __webpack_require__) {
  25. "use strict";
  26. eval("\n\nmodule.exports = function(Chart) {\n\n\tChart.Bubble = function(context, config) {\n\t\tconfig.type = 'bubble';\n\t\treturn new Chart(context, config);\n\t};\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Bubble.js?");
  27. /***/ }),
  28. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Doughnut.js":
  29. /*!**********************************************************************************************!*\
  30. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Doughnut.js ***!
  31. \**********************************************************************************************/
  32. /*! no static exports found */
  33. /***/ (function(module, exports, __webpack_require__) {
  34. "use strict";
  35. eval("\n\nmodule.exports = function(Chart) {\n\n\tChart.Doughnut = function(context, config) {\n\t\tconfig.type = 'doughnut';\n\n\t\treturn new Chart(context, config);\n\t};\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Doughnut.js?");
  36. /***/ }),
  37. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Line.js":
  38. /*!******************************************************************************************!*\
  39. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Line.js ***!
  40. \******************************************************************************************/
  41. /*! no static exports found */
  42. /***/ (function(module, exports, __webpack_require__) {
  43. "use strict";
  44. eval("\n\nmodule.exports = function(Chart) {\n\n\tChart.Line = function(context, config) {\n\t\tconfig.type = 'line';\n\n\t\treturn new Chart(context, config);\n\t};\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Line.js?");
  45. /***/ }),
  46. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.PolarArea.js":
  47. /*!***********************************************************************************************!*\
  48. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.PolarArea.js ***!
  49. \***********************************************************************************************/
  50. /*! no static exports found */
  51. /***/ (function(module, exports, __webpack_require__) {
  52. "use strict";
  53. eval("\n\nmodule.exports = function(Chart) {\n\n\tChart.PolarArea = function(context, config) {\n\t\tconfig.type = 'polarArea';\n\n\t\treturn new Chart(context, config);\n\t};\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.PolarArea.js?");
  54. /***/ }),
  55. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Radar.js":
  56. /*!*******************************************************************************************!*\
  57. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Radar.js ***!
  58. \*******************************************************************************************/
  59. /*! no static exports found */
  60. /***/ (function(module, exports, __webpack_require__) {
  61. "use strict";
  62. eval("\n\nmodule.exports = function(Chart) {\n\n\tChart.Radar = function(context, config) {\n\t\tconfig.type = 'radar';\n\n\t\treturn new Chart(context, config);\n\t};\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Radar.js?");
  63. /***/ }),
  64. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Scatter.js":
  65. /*!*********************************************************************************************!*\
  66. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Scatter.js ***!
  67. \*********************************************************************************************/
  68. /*! no static exports found */
  69. /***/ (function(module, exports, __webpack_require__) {
  70. "use strict";
  71. eval("\n\nmodule.exports = function(Chart) {\n\tChart.Scatter = function(context, config) {\n\t\tconfig.type = 'scatter';\n\t\treturn new Chart(context, config);\n\t};\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/charts/Chart.Scatter.js?");
  72. /***/ }),
  73. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bar.js":
  74. /*!***************************************************************************************************!*\
  75. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bar.js ***!
  76. \***************************************************************************************************/
  77. /*! no static exports found */
  78. /***/ (function(module, exports, __webpack_require__) {
  79. "use strict";
  80. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('bar', {\n\thover: {\n\t\tmode: 'label'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'category',\n\n\t\t\t// Specific to Bar Controller\n\t\t\tcategoryPercentage: 0.8,\n\t\t\tbarPercentage: 0.9,\n\n\t\t\t// offset settings\n\t\t\toffset: true,\n\n\t\t\t// grid line settings\n\t\t\tgridLines: {\n\t\t\t\toffsetGridLines: true\n\t\t\t}\n\t\t}],\n\n\t\tyAxes: [{\n\t\t\ttype: 'linear'\n\t\t}]\n\t}\n});\n\ndefaults._set('horizontalBar', {\n\thover: {\n\t\tmode: 'index',\n\t\taxis: 'y'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'linear',\n\t\t\tposition: 'bottom'\n\t\t}],\n\n\t\tyAxes: [{\n\t\t\tposition: 'left',\n\t\t\ttype: 'category',\n\n\t\t\t// Specific to Horizontal Bar Controller\n\t\t\tcategoryPercentage: 0.8,\n\t\t\tbarPercentage: 0.9,\n\n\t\t\t// offset settings\n\t\t\toffset: true,\n\n\t\t\t// grid line settings\n\t\t\tgridLines: {\n\t\t\t\toffsetGridLines: true\n\t\t\t}\n\t\t}]\n\t},\n\n\telements: {\n\t\trectangle: {\n\t\t\tborderSkipped: 'left'\n\t\t}\n\t},\n\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function(item, data) {\n\t\t\t\t// Pick first xLabel for now\n\t\t\t\tvar title = '';\n\n\t\t\t\tif (item.length > 0) {\n\t\t\t\t\tif (item[0].yLabel) {\n\t\t\t\t\t\ttitle = item[0].yLabel;\n\t\t\t\t\t} else if (data.labels.length > 0 && item[0].index < data.labels.length) {\n\t\t\t\t\t\ttitle = data.labels[item[0].index];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn title;\n\t\t\t},\n\n\t\t\tlabel: function(item, data) {\n\t\t\t\tvar datasetLabel = data.datasets[item.datasetIndex].label || '';\n\t\t\t\treturn datasetLabel + ': ' + item.xLabel;\n\t\t\t}\n\t\t},\n\t\tmode: 'index',\n\t\taxis: 'y'\n\t}\n});\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(scale, pixels) {\n\tvar min = scale.isHorizontal() ? scale.width : scale.height;\n\tvar ticks = scale.getTicks();\n\tvar prev, curr, i, ilen;\n\n\tfor (i = 1, ilen = pixels.length; i < ilen; ++i) {\n\t\tmin = Math.min(min, pixels[i] - pixels[i - 1]);\n\t}\n\n\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\n\t\tcurr = scale.getPixelForTick(i);\n\t\tmin = i > 0 ? Math.min(min, curr - prev) : min;\n\t\tprev = curr;\n\t}\n\n\treturn min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}\n\nmodule.exports = function(Chart) {\n\n\tChart.controllers.bar = Chart.DatasetController.extend({\n\n\t\tdataElementType: elements.Rectangle,\n\n\t\tinitialize: function() {\n\t\t\tvar me = this;\n\t\t\tvar meta;\n\n\t\t\tChart.DatasetController.prototype.initialize.apply(me, arguments);\n\n\t\t\tmeta = me.getMeta();\n\t\t\tmeta.stack = me.getDataset().stack;\n\t\t\tmeta.bar = true;\n\t\t},\n\n\t\tupdate: function(reset) {\n\t\t\tvar me = this;\n\t\t\tvar rects = me.getMeta().data;\n\t\t\tvar i, ilen;\n\n\t\t\tme._ruler = me.getRuler();\n\n\t\t\tfor (i = 0, ilen = rects.length; i < ilen; ++i) {\n\t\t\t\tme.updateElement(rects[i], i, reset);\n\t\t\t}\n\t\t},\n\n\t\tupdateElement: function(rectangle, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar custom = rectangle.custom || {};\n\t\t\tvar rectangleOptions = chart.options.elements.rectangle;\n\n\t\t\trectangle._xScale = me.getScaleForId(meta.xAxisID);\n\t\t\trectangle._yScale = me.getScaleForId(meta.yAxisID);\n\t\t\trectangle._datasetIndex = me.index;\n\t\t\trectangle._index = index;\n\n\t\t\trectangle._model = {\n\t\t\t\tdatasetLabel: dataset.label,\n\t\t\t\tlabel: chart.data.labels[index],\n\t\t\t\tborderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleOptions.borderSkipped,\n\t\t\t\tbackgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleOptions.backgroundColor),\n\t\t\t\tborderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleOptions.borderColor),\n\t\t\t\tborderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleOptions.borderWidth)\n\t\t\t};\n\n\t\t\tme.updateElementGeometry(rectangle, index, reset);\n\n\t\t\trectangle.pivot();\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tupdateElementGeometry: function(rectangle, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar model = rectangle._model;\n\t\t\tvar vscale = me.getValueScale();\n\t\t\tvar base = vscale.getBasePixel();\n\t\t\tvar horizontal = vscale.isHorizontal();\n\t\t\tvar ruler = me._ruler || me.getRuler();\n\t\t\tvar vpixels = me.calculateBarValuePixels(me.index, index);\n\t\t\tvar ipixels = me.calculateBarIndexPixels(me.index, index, ruler);\n\n\t\t\tmodel.horizontal = horizontal;\n\t\t\tmodel.base = reset ? base : vpixels.base;\n\t\t\tmodel.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\n\t\t\tmodel.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\n\t\t\tmodel.height = horizontal ? ipixels.size : undefined;\n\t\t\tmodel.width = horizontal ? undefined : ipixels.size;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetValueScaleId: function() {\n\t\t\treturn this.getMeta().yAxisID;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetIndexScaleId: function() {\n\t\t\treturn this.getMeta().xAxisID;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetValueScale: function() {\n\t\t\treturn this.getScaleForId(this.getValueScaleId());\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetIndexScale: function() {\n\t\t\treturn this.getScaleForId(this.getIndexScaleId());\n\t\t},\n\n\t\t/**\n\t\t * Returns the stacks based on groups and bar visibility.\n\t\t * @param {Number} [last] - The dataset index\n\t\t * @returns {Array} The stack list\n\t\t * @private\n\t\t */\n\t\t_getStacks: function(last) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar scale = me.getIndexScale();\n\t\t\tvar stacked = scale.options.stacked;\n\t\t\tvar ilen = last === undefined ? chart.data.datasets.length : last + 1;\n\t\t\tvar stacks = [];\n\t\t\tvar i, meta;\n\n\t\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\tif (meta.bar && chart.isDatasetVisible(i) &&\n\t\t\t\t\t(stacked === false ||\n\t\t\t\t\t(stacked === true && stacks.indexOf(meta.stack) === -1) ||\n\t\t\t\t\t(stacked === undefined && (meta.stack === undefined || stacks.indexOf(meta.stack) === -1)))) {\n\t\t\t\t\tstacks.push(meta.stack);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn stacks;\n\t\t},\n\n\t\t/**\n\t\t * Returns the effective number of stacks based on groups and bar visibility.\n\t\t * @private\n\t\t */\n\t\tgetStackCount: function() {\n\t\t\treturn this._getStacks().length;\n\t\t},\n\n\t\t/**\n\t\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t\t * @param {Number} [datasetIndex] - The dataset index\n\t\t * @param {String} [name] - The stack name to find\n\t\t * @returns {Number} The stack index\n\t\t * @private\n\t\t */\n\t\tgetStackIndex: function(datasetIndex, name) {\n\t\t\tvar stacks = this._getStacks(datasetIndex);\n\t\t\tvar index = (name !== undefined)\n\t\t\t\t? stacks.indexOf(name)\n\t\t\t\t: -1; // indexOf returns -1 if element is not present\n\n\t\t\treturn (index === -1)\n\t\t\t\t? stacks.length - 1\n\t\t\t\t: index;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetRuler: function() {\n\t\t\tvar me = this;\n\t\t\tvar scale = me.getIndexScale();\n\t\t\tvar stackCount = me.getStackCount();\n\t\t\tvar datasetIndex = me.index;\n\t\t\tvar isHorizontal = scale.isHorizontal();\n\t\t\tvar start = isHorizontal ? scale.left : scale.top;\n\t\t\tvar end = start + (isHorizontal ? scale.width : scale.height);\n\t\t\tvar pixels = [];\n\t\t\tvar i, ilen, min;\n\n\t\t\tfor (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\n\t\t\t\tpixels.push(scale.getPixelForValue(null, i, datasetIndex));\n\t\t\t}\n\n\t\t\tmin = helpers.isNullOrUndef(scale.options.barThickness)\n\t\t\t\t? computeMinSampleSize(scale, pixels)\n\t\t\t\t: -1;\n\n\t\t\treturn {\n\t\t\t\tmin: min,\n\t\t\t\tpixels: pixels,\n\t\t\t\tstart: start,\n\t\t\t\tend: end,\n\t\t\t\tstackCount: stackCount,\n\t\t\t\tscale: scale\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Note: pixel values are not clamped to the scale area.\n\t\t * @private\n\t\t */\n\t\tcalculateBarValuePixels: function(datasetIndex, index) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar scale = me.getValueScale();\n\t\t\tvar datasets = chart.data.datasets;\n\t\t\tvar value = scale.getRightValue(datasets[datasetIndex].data[index]);\n\t\t\tvar stacked = scale.options.stacked;\n\t\t\tvar stack = meta.stack;\n\t\t\tvar start = 0;\n\t\t\tvar i, imeta, ivalue, base, head, size;\n\n\t\t\tif (stacked || (stacked === undefined && stack !== undefined)) {\n\t\t\t\tfor (i = 0; i < datasetIndex; ++i) {\n\t\t\t\t\timeta = chart.getDatasetMeta(i);\n\n\t\t\t\t\tif (imeta.bar &&\n\t\t\t\t\t\timeta.stack === stack &&\n\t\t\t\t\t\timeta.controller.getValueScaleId() === scale.id &&\n\t\t\t\t\t\tchart.isDatasetVisible(i)) {\n\n\t\t\t\t\t\tivalue = scale.getRightValue(datasets[i].data[index]);\n\t\t\t\t\t\tif ((value < 0 && ivalue < 0) || (value >= 0 && ivalue > 0)) {\n\t\t\t\t\t\t\tstart += ivalue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase = scale.getPixelForValue(start);\n\t\t\thead = scale.getPixelForValue(start + value);\n\t\t\tsize = (head - base) / 2;\n\n\t\t\treturn {\n\t\t\t\tsize: size,\n\t\t\t\tbase: base,\n\t\t\t\thead: head,\n\t\t\t\tcenter: head + size / 2\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tcalculateBarIndexPixels: function(datasetIndex, index, ruler) {\n\t\t\tvar me = this;\n\t\t\tvar options = ruler.scale.options;\n\t\t\tvar range = options.barThickness === 'flex'\n\t\t\t\t? computeFlexCategoryTraits(index, ruler, options)\n\t\t\t\t: computeFitCategoryTraits(index, ruler, options);\n\n\t\t\tvar stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack);\n\t\t\tvar center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n\t\t\tvar size = Math.min(\n\t\t\t\thelpers.valueOrDefault(options.maxBarThickness, Infinity),\n\t\t\t\trange.chunk * range.ratio);\n\n\t\t\treturn {\n\t\t\t\tbase: center - size / 2,\n\t\t\t\thead: center + size / 2,\n\t\t\t\tcenter: center,\n\t\t\t\tsize: size\n\t\t\t};\n\t\t},\n\n\t\tdraw: function() {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar scale = me.getValueScale();\n\t\t\tvar rects = me.getMeta().data;\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar ilen = rects.length;\n\t\t\tvar i = 0;\n\n\t\t\thelpers.canvas.clipArea(chart.ctx, chart.chartArea);\n\n\t\t\tfor (; i < ilen; ++i) {\n\t\t\t\tif (!isNaN(scale.getRightValue(dataset.data[i]))) {\n\t\t\t\t\trects[i].draw();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thelpers.canvas.unclipArea(chart.ctx);\n\t\t},\n\n\t\tsetHoverStyle: function(rectangle) {\n\t\t\tvar dataset = this.chart.data.datasets[rectangle._datasetIndex];\n\t\t\tvar index = rectangle._index;\n\t\t\tvar custom = rectangle.custom || {};\n\t\t\tvar model = rectangle._model;\n\n\t\t\tmodel.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n\t\t\tmodel.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n\t\t\tmodel.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);\n\t\t},\n\n\t\tremoveHoverStyle: function(rectangle) {\n\t\t\tvar dataset = this.chart.data.datasets[rectangle._datasetIndex];\n\t\t\tvar index = rectangle._index;\n\t\t\tvar custom = rectangle.custom || {};\n\t\t\tvar model = rectangle._model;\n\t\t\tvar rectangleElementOptions = this.chart.options.elements.rectangle;\n\n\t\t\tmodel.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);\n\t\t\tmodel.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);\n\t\t\tmodel.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);\n\t\t}\n\t});\n\n\tChart.controllers.horizontalBar = Chart.controllers.bar.extend({\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetValueScaleId: function() {\n\t\t\treturn this.getMeta().xAxisID;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetIndexScaleId: function() {\n\t\t\treturn this.getMeta().yAxisID;\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bar.js?");
  81. /***/ }),
  82. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bubble.js":
  83. /*!******************************************************************************************************!*\
  84. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bubble.js ***!
  85. \******************************************************************************************************/
  86. /*! no static exports found */
  87. /***/ (function(module, exports, __webpack_require__) {
  88. "use strict";
  89. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('bubble', {\n\thover: {\n\t\tmode: 'single'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'linear', // bubble should probably use a linear scale by default\n\t\t\tposition: 'bottom',\n\t\t\tid: 'x-axis-0' // need an ID so datasets can reference the scale\n\t\t}],\n\t\tyAxes: [{\n\t\t\ttype: 'linear',\n\t\t\tposition: 'left',\n\t\t\tid: 'y-axis-0'\n\t\t}]\n\t},\n\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\t// Title doesn't make sense for scatter since we format the data as a point\n\t\t\t\treturn '';\n\t\t\t},\n\t\t\tlabel: function(item, data) {\n\t\t\t\tvar datasetLabel = data.datasets[item.datasetIndex].label || '';\n\t\t\t\tvar dataPoint = data.datasets[item.datasetIndex].data[item.index];\n\t\t\t\treturn datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\n\t\t\t}\n\t\t}\n\t}\n});\n\n\nmodule.exports = function(Chart) {\n\n\tChart.controllers.bubble = Chart.DatasetController.extend({\n\t\t/**\n\t\t * @protected\n\t\t */\n\t\tdataElementType: elements.Point,\n\n\t\t/**\n\t\t * @protected\n\t\t */\n\t\tupdate: function(reset) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar points = meta.data;\n\n\t\t\t// Update Points\n\t\t\thelpers.each(points, function(point, index) {\n\t\t\t\tme.updateElement(point, index, reset);\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * @protected\n\t\t */\n\t\tupdateElement: function(point, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar xScale = me.getScaleForId(meta.xAxisID);\n\t\t\tvar yScale = me.getScaleForId(meta.yAxisID);\n\t\t\tvar options = me._resolveElementOptions(point, index);\n\t\t\tvar data = me.getDataset().data[index];\n\t\t\tvar dsIndex = me.index;\n\n\t\t\tvar x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\n\t\t\tvar y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\n\n\t\t\tpoint._xScale = xScale;\n\t\t\tpoint._yScale = yScale;\n\t\t\tpoint._options = options;\n\t\t\tpoint._datasetIndex = dsIndex;\n\t\t\tpoint._index = index;\n\t\t\tpoint._model = {\n\t\t\t\tbackgroundColor: options.backgroundColor,\n\t\t\t\tborderColor: options.borderColor,\n\t\t\t\tborderWidth: options.borderWidth,\n\t\t\t\thitRadius: options.hitRadius,\n\t\t\t\tpointStyle: options.pointStyle,\n\t\t\t\tradius: reset ? 0 : options.radius,\n\t\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t};\n\n\t\t\tpoint.pivot();\n\t\t},\n\n\t\t/**\n\t\t * @protected\n\t\t */\n\t\tsetHoverStyle: function(point) {\n\t\t\tvar model = point._model;\n\t\t\tvar options = point._options;\n\n\t\t\tmodel.backgroundColor = helpers.valueOrDefault(options.hoverBackgroundColor, helpers.getHoverColor(options.backgroundColor));\n\t\t\tmodel.borderColor = helpers.valueOrDefault(options.hoverBorderColor, helpers.getHoverColor(options.borderColor));\n\t\t\tmodel.borderWidth = helpers.valueOrDefault(options.hoverBorderWidth, options.borderWidth);\n\t\t\tmodel.radius = options.radius + options.hoverRadius;\n\t\t},\n\n\t\t/**\n\t\t * @protected\n\t\t */\n\t\tremoveHoverStyle: function(point) {\n\t\t\tvar model = point._model;\n\t\t\tvar options = point._options;\n\n\t\t\tmodel.backgroundColor = options.backgroundColor;\n\t\t\tmodel.borderColor = options.borderColor;\n\t\t\tmodel.borderWidth = options.borderWidth;\n\t\t\tmodel.radius = options.radius;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t_resolveElementOptions: function(point, index) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar datasets = chart.data.datasets;\n\t\t\tvar dataset = datasets[me.index];\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar options = chart.options.elements.point;\n\t\t\tvar resolve = helpers.options.resolve;\n\t\t\tvar data = dataset.data[index];\n\t\t\tvar values = {};\n\t\t\tvar i, ilen, key;\n\n\t\t\t// Scriptable options\n\t\t\tvar context = {\n\t\t\t\tchart: chart,\n\t\t\t\tdataIndex: index,\n\t\t\t\tdataset: dataset,\n\t\t\t\tdatasetIndex: me.index\n\t\t\t};\n\n\t\t\tvar keys = [\n\t\t\t\t'backgroundColor',\n\t\t\t\t'borderColor',\n\t\t\t\t'borderWidth',\n\t\t\t\t'hoverBackgroundColor',\n\t\t\t\t'hoverBorderColor',\n\t\t\t\t'hoverBorderWidth',\n\t\t\t\t'hoverRadius',\n\t\t\t\t'hitRadius',\n\t\t\t\t'pointStyle'\n\t\t\t];\n\n\t\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\t\t\tkey = keys[i];\n\t\t\t\tvalues[key] = resolve([\n\t\t\t\t\tcustom[key],\n\t\t\t\t\tdataset[key],\n\t\t\t\t\toptions[key]\n\t\t\t\t], context, index);\n\t\t\t}\n\n\t\t\t// Custom radius resolution\n\t\t\tvalues.radius = resolve([\n\t\t\t\tcustom.radius,\n\t\t\t\tdata ? data.r : undefined,\n\t\t\t\tdataset.radius,\n\t\t\t\toptions.radius\n\t\t\t], context, index);\n\n\t\t\treturn values;\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.bubble.js?");
  90. /***/ }),
  91. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.doughnut.js":
  92. /*!********************************************************************************************************!*\
  93. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.doughnut.js ***!
  94. \********************************************************************************************************/
  95. /*! no static exports found */
  96. /***/ (function(module, exports, __webpack_require__) {
  97. "use strict";
  98. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('doughnut', {\n\tanimation: {\n\t\t// Boolean - Whether we animate the rotation of the Doughnut\n\t\tanimateRotate: true,\n\t\t// Boolean - Whether we animate scaling the Doughnut from the centre\n\t\tanimateScale: false\n\t},\n\thover: {\n\t\tmode: 'single'\n\t},\n\tlegendCallback: function(chart) {\n\t\tvar text = [];\n\t\ttext.push('<ul class=\"' + chart.id + '-legend\">');\n\n\t\tvar data = chart.data;\n\t\tvar datasets = data.datasets;\n\t\tvar labels = data.labels;\n\n\t\tif (datasets.length) {\n\t\t\tfor (var i = 0; i < datasets[0].data.length; ++i) {\n\t\t\t\ttext.push('<li><span style=\"background-color:' + datasets[0].backgroundColor[i] + '\"></span>');\n\t\t\t\tif (labels[i]) {\n\t\t\t\t\ttext.push(labels[i]);\n\t\t\t\t}\n\t\t\t\ttext.push('</li>');\n\t\t\t}\n\t\t}\n\n\t\ttext.push('</ul>');\n\t\treturn text.join('');\n\t},\n\tlegend: {\n\t\tlabels: {\n\t\t\tgenerateLabels: function(chart) {\n\t\t\t\tvar data = chart.data;\n\t\t\t\tif (data.labels.length && data.datasets.length) {\n\t\t\t\t\treturn data.labels.map(function(label, i) {\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\n\t\t\t\t\t\tvar ds = data.datasets[0];\n\t\t\t\t\t\tvar arc = meta.data[i];\n\t\t\t\t\t\tvar custom = arc && arc.custom || {};\n\t\t\t\t\t\tvar valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\t\t\t\t\t\tvar arcOpts = chart.options.elements.arc;\n\t\t\t\t\t\tvar fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);\n\t\t\t\t\t\tvar stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);\n\t\t\t\t\t\tvar bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttext: label,\n\t\t\t\t\t\t\tfillStyle: fill,\n\t\t\t\t\t\t\tstrokeStyle: stroke,\n\t\t\t\t\t\t\tlineWidth: bw,\n\t\t\t\t\t\t\thidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\n\t\t\t\t\t\t\tindex: i\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\n\t\tonClick: function(e, legendItem) {\n\t\t\tvar index = legendItem.index;\n\t\t\tvar chart = this.chart;\n\t\t\tvar i, ilen, meta;\n\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\t// toggle visibility of index if exists\n\t\t\t\tif (meta.data[index]) {\n\t\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchart.update();\n\t\t}\n\t},\n\n\t// The percentage of the chart that we cut out of the middle.\n\tcutoutPercentage: 50,\n\n\t// The rotation of the chart, where the first data arc begins.\n\trotation: Math.PI * -0.5,\n\n\t// The total circumference of the chart.\n\tcircumference: Math.PI * 2.0,\n\n\t// Need to override these to give a nice default\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\treturn '';\n\t\t\t},\n\t\t\tlabel: function(tooltipItem, data) {\n\t\t\t\tvar dataLabel = data.labels[tooltipItem.index];\n\t\t\t\tvar value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\n\n\t\t\t\tif (helpers.isArray(dataLabel)) {\n\t\t\t\t\t// show value on first line of multiline label\n\t\t\t\t\t// need to clone because we are changing the value\n\t\t\t\t\tdataLabel = dataLabel.slice();\n\t\t\t\t\tdataLabel[0] += value;\n\t\t\t\t} else {\n\t\t\t\t\tdataLabel += value;\n\t\t\t\t}\n\n\t\t\t\treturn dataLabel;\n\t\t\t}\n\t\t}\n\t}\n});\n\ndefaults._set('pie', helpers.clone(defaults.doughnut));\ndefaults._set('pie', {\n\tcutoutPercentage: 0\n});\n\nmodule.exports = function(Chart) {\n\n\tChart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({\n\n\t\tdataElementType: elements.Arc,\n\n\t\tlinkScales: helpers.noop,\n\n\t\t// Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\n\t\tgetRingIndex: function(datasetIndex) {\n\t\t\tvar ringIndex = 0;\n\n\t\t\tfor (var j = 0; j < datasetIndex; ++j) {\n\t\t\t\tif (this.chart.isDatasetVisible(j)) {\n\t\t\t\t\t++ringIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ringIndex;\n\t\t},\n\n\t\tupdate: function(reset) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar chartArea = chart.chartArea;\n\t\t\tvar opts = chart.options;\n\t\t\tvar arcOpts = opts.elements.arc;\n\t\t\tvar availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth;\n\t\t\tvar availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth;\n\t\t\tvar minSize = Math.min(availableWidth, availableHeight);\n\t\t\tvar offset = {x: 0, y: 0};\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar cutoutPercentage = opts.cutoutPercentage;\n\t\t\tvar circumference = opts.circumference;\n\n\t\t\t// If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc\n\t\t\tif (circumference < Math.PI * 2.0) {\n\t\t\t\tvar startAngle = opts.rotation % (Math.PI * 2.0);\n\t\t\t\tstartAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);\n\t\t\t\tvar endAngle = startAngle + circumference;\n\t\t\t\tvar start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};\n\t\t\t\tvar end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};\n\t\t\t\tvar contains0 = (startAngle <= 0 && endAngle >= 0) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);\n\t\t\t\tvar contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);\n\t\t\t\tvar contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);\n\t\t\t\tvar contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);\n\t\t\t\tvar cutout = cutoutPercentage / 100.0;\n\t\t\t\tvar min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))};\n\t\t\t\tvar max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))};\n\t\t\t\tvar size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};\n\t\t\t\tminSize = Math.min(availableWidth / size.width, availableHeight / size.height);\n\t\t\t\toffset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};\n\t\t\t}\n\n\t\t\tchart.borderWidth = me.getMaxBorderWidth(meta.data);\n\t\t\tchart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);\n\t\t\tchart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);\n\t\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n\t\t\tchart.offsetX = offset.x * chart.outerRadius;\n\t\t\tchart.offsetY = offset.y * chart.outerRadius;\n\n\t\t\tmeta.total = me.calculateTotal();\n\n\t\t\tme.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index));\n\t\t\tme.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0);\n\n\t\t\thelpers.each(meta.data, function(arc, index) {\n\t\t\t\tme.updateElement(arc, index, reset);\n\t\t\t});\n\t\t},\n\n\t\tupdateElement: function(arc, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar chartArea = chart.chartArea;\n\t\t\tvar opts = chart.options;\n\t\t\tvar animationOpts = opts.animation;\n\t\t\tvar centerX = (chartArea.left + chartArea.right) / 2;\n\t\t\tvar centerY = (chartArea.top + chartArea.bottom) / 2;\n\t\t\tvar startAngle = opts.rotation; // non reset case handled later\n\t\t\tvar endAngle = opts.rotation; // non reset case handled later\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI));\n\t\t\tvar innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\n\t\t\tvar outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\n\t\t\tvar valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n\t\t\thelpers.extend(arc, {\n\t\t\t\t// Utility\n\t\t\t\t_datasetIndex: me.index,\n\t\t\t\t_index: index,\n\n\t\t\t\t// Desired view properties\n\t\t\t\t_model: {\n\t\t\t\t\tx: centerX + chart.offsetX,\n\t\t\t\t\ty: centerY + chart.offsetY,\n\t\t\t\t\tstartAngle: startAngle,\n\t\t\t\t\tendAngle: endAngle,\n\t\t\t\t\tcircumference: circumference,\n\t\t\t\t\touterRadius: outerRadius,\n\t\t\t\t\tinnerRadius: innerRadius,\n\t\t\t\t\tlabel: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar model = arc._model;\n\t\t\t// Resets the visual styles\n\t\t\tthis.removeHoverStyle(arc);\n\n\t\t\t// Set correct angles if not resetting\n\t\t\tif (!reset || !animationOpts.animateRotate) {\n\t\t\t\tif (index === 0) {\n\t\t\t\t\tmodel.startAngle = opts.rotation;\n\t\t\t\t} else {\n\t\t\t\t\tmodel.startAngle = me.getMeta().data[index - 1]._model.endAngle;\n\t\t\t\t}\n\n\t\t\t\tmodel.endAngle = model.startAngle + model.circumference;\n\t\t\t}\n\n\t\t\tarc.pivot();\n\t\t},\n\n\t\tremoveHoverStyle: function(arc) {\n\t\t\tChart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);\n\t\t},\n\n\t\tcalculateTotal: function() {\n\t\t\tvar dataset = this.getDataset();\n\t\t\tvar meta = this.getMeta();\n\t\t\tvar total = 0;\n\t\t\tvar value;\n\n\t\t\thelpers.each(meta.data, function(element, index) {\n\t\t\t\tvalue = dataset.data[index];\n\t\t\t\tif (!isNaN(value) && !element.hidden) {\n\t\t\t\t\ttotal += Math.abs(value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t/* if (total === 0) {\n\t\t\t\ttotal = NaN;\n\t\t\t}*/\n\n\t\t\treturn total;\n\t\t},\n\n\t\tcalculateCircumference: function(value) {\n\t\t\tvar total = this.getMeta().total;\n\t\t\tif (total > 0 && !isNaN(value)) {\n\t\t\t\treturn (Math.PI * 2.0) * (Math.abs(value) / total);\n\t\t\t}\n\t\t\treturn 0;\n\t\t},\n\n\t\t// gets the max border or hover width to properly scale pie charts\n\t\tgetMaxBorderWidth: function(arcs) {\n\t\t\tvar max = 0;\n\t\t\tvar index = this.index;\n\t\t\tvar length = arcs.length;\n\t\t\tvar borderWidth;\n\t\t\tvar hoverWidth;\n\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tborderWidth = arcs[i]._model ? arcs[i]._model.borderWidth : 0;\n\t\t\t\thoverWidth = arcs[i]._chart ? arcs[i]._chart.config.data.datasets[index].hoverBorderWidth : 0;\n\n\t\t\t\tmax = borderWidth > max ? borderWidth : max;\n\t\t\t\tmax = hoverWidth > max ? hoverWidth : max;\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.doughnut.js?");
  99. /***/ }),
  100. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.line.js":
  101. /*!****************************************************************************************************!*\
  102. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.line.js ***!
  103. \****************************************************************************************************/
  104. /*! no static exports found */
  105. /***/ (function(module, exports, __webpack_require__) {
  106. "use strict";
  107. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('line', {\n\tshowLines: true,\n\tspanGaps: false,\n\n\thover: {\n\t\tmode: 'label'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\ttype: 'category',\n\t\t\tid: 'x-axis-0'\n\t\t}],\n\t\tyAxes: [{\n\t\t\ttype: 'linear',\n\t\t\tid: 'y-axis-0'\n\t\t}]\n\t}\n});\n\nmodule.exports = function(Chart) {\n\n\tfunction lineEnabled(dataset, options) {\n\t\treturn helpers.valueOrDefault(dataset.showLine, options.showLines);\n\t}\n\n\tChart.controllers.line = Chart.DatasetController.extend({\n\n\t\tdatasetElementType: elements.Line,\n\n\t\tdataElementType: elements.Point,\n\n\t\tupdate: function(reset) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar line = meta.dataset;\n\t\t\tvar points = meta.data || [];\n\t\t\tvar options = me.chart.options;\n\t\t\tvar lineElementOptions = options.elements.line;\n\t\t\tvar scale = me.getScaleForId(meta.yAxisID);\n\t\t\tvar i, ilen, custom;\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar showLine = lineEnabled(dataset, options);\n\n\t\t\t// Update Line\n\t\t\tif (showLine) {\n\t\t\t\tcustom = line.custom || {};\n\n\t\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\t\t\tif ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n\t\t\t\t\tdataset.lineTension = dataset.tension;\n\t\t\t\t}\n\n\t\t\t\t// Utility\n\t\t\t\tline._scale = scale;\n\t\t\t\tline._datasetIndex = me.index;\n\t\t\t\t// Data\n\t\t\t\tline._children = points;\n\t\t\t\t// Model\n\t\t\t\tline._model = {\n\t\t\t\t\t// Appearance\n\t\t\t\t\t// The default behavior of lines is to break at null values, according\n\t\t\t\t\t// to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\n\t\t\t\t\t// This option gives lines the ability to span gaps\n\t\t\t\t\tspanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps,\n\t\t\t\t\ttension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension),\n\t\t\t\t\tbackgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),\n\t\t\t\t\tborderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),\n\t\t\t\t\tborderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),\n\t\t\t\t\tborderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),\n\t\t\t\t\tborderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),\n\t\t\t\t\tborderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),\n\t\t\t\t\tborderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),\n\t\t\t\t\tfill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),\n\t\t\t\t\tsteppedLine: custom.steppedLine ? custom.steppedLine : helpers.valueOrDefault(dataset.steppedLine, lineElementOptions.stepped),\n\t\t\t\t\tcubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.valueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode),\n\t\t\t\t};\n\n\t\t\t\tline.pivot();\n\t\t\t}\n\n\t\t\t// Update Points\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\t\tme.updateElement(points[i], i, reset);\n\t\t\t}\n\n\t\t\tif (showLine && line._model.tension !== 0) {\n\t\t\t\tme.updateBezierControlPoints();\n\t\t\t}\n\n\t\t\t// Now pivot the point for animation\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\t\tpoints[i].pivot();\n\t\t\t}\n\t\t},\n\n\t\tgetPointBackgroundColor: function(point, index) {\n\t\t\tvar backgroundColor = this.chart.options.elements.point.backgroundColor;\n\t\t\tvar dataset = this.getDataset();\n\t\t\tvar custom = point.custom || {};\n\n\t\t\tif (custom.backgroundColor) {\n\t\t\t\tbackgroundColor = custom.backgroundColor;\n\t\t\t} else if (dataset.pointBackgroundColor) {\n\t\t\t\tbackgroundColor = helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor);\n\t\t\t} else if (dataset.backgroundColor) {\n\t\t\t\tbackgroundColor = dataset.backgroundColor;\n\t\t\t}\n\n\t\t\treturn backgroundColor;\n\t\t},\n\n\t\tgetPointBorderColor: function(point, index) {\n\t\t\tvar borderColor = this.chart.options.elements.point.borderColor;\n\t\t\tvar dataset = this.getDataset();\n\t\t\tvar custom = point.custom || {};\n\n\t\t\tif (custom.borderColor) {\n\t\t\t\tborderColor = custom.borderColor;\n\t\t\t} else if (dataset.pointBorderColor) {\n\t\t\t\tborderColor = helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor);\n\t\t\t} else if (dataset.borderColor) {\n\t\t\t\tborderColor = dataset.borderColor;\n\t\t\t}\n\n\t\t\treturn borderColor;\n\t\t},\n\n\t\tgetPointBorderWidth: function(point, index) {\n\t\t\tvar borderWidth = this.chart.options.elements.point.borderWidth;\n\t\t\tvar dataset = this.getDataset();\n\t\t\tvar custom = point.custom || {};\n\n\t\t\tif (!isNaN(custom.borderWidth)) {\n\t\t\t\tborderWidth = custom.borderWidth;\n\t\t\t} else if (!isNaN(dataset.pointBorderWidth) || helpers.isArray(dataset.pointBorderWidth)) {\n\t\t\t\tborderWidth = helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);\n\t\t\t} else if (!isNaN(dataset.borderWidth)) {\n\t\t\t\tborderWidth = dataset.borderWidth;\n\t\t\t}\n\n\t\t\treturn borderWidth;\n\t\t},\n\n\t\tupdateElement: function(point, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar datasetIndex = me.index;\n\t\t\tvar value = dataset.data[index];\n\t\t\tvar yScale = me.getScaleForId(meta.yAxisID);\n\t\t\tvar xScale = me.getScaleForId(meta.xAxisID);\n\t\t\tvar pointOptions = me.chart.options.elements.point;\n\t\t\tvar x, y;\n\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\t\tif ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n\t\t\t\tdataset.pointRadius = dataset.radius;\n\t\t\t}\n\t\t\tif ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {\n\t\t\t\tdataset.pointHitRadius = dataset.hitRadius;\n\t\t\t}\n\n\t\t\tx = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\n\t\t\ty = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\n\n\t\t\t// Utility\n\t\t\tpoint._xScale = xScale;\n\t\t\tpoint._yScale = yScale;\n\t\t\tpoint._datasetIndex = datasetIndex;\n\t\t\tpoint._index = index;\n\n\t\t\t// Desired view properties\n\t\t\tpoint._model = {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\n\t\t\t\t// Appearance\n\t\t\t\tradius: custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius),\n\t\t\t\tpointStyle: custom.pointStyle || helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle),\n\t\t\t\tbackgroundColor: me.getPointBackgroundColor(point, index),\n\t\t\t\tborderColor: me.getPointBorderColor(point, index),\n\t\t\t\tborderWidth: me.getPointBorderWidth(point, index),\n\t\t\t\ttension: meta.dataset._model ? meta.dataset._model.tension : 0,\n\t\t\t\tsteppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false,\n\t\t\t\t// Tooltip\n\t\t\t\thitRadius: custom.hitRadius || helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius)\n\t\t\t};\n\t\t},\n\n\t\tcalculatePointY: function(value, index, datasetIndex) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar yScale = me.getScaleForId(meta.yAxisID);\n\t\t\tvar sumPos = 0;\n\t\t\tvar sumNeg = 0;\n\t\t\tvar i, ds, dsMeta;\n\n\t\t\tif (yScale.options.stacked) {\n\t\t\t\tfor (i = 0; i < datasetIndex; i++) {\n\t\t\t\t\tds = chart.data.datasets[i];\n\t\t\t\t\tdsMeta = chart.getDatasetMeta(i);\n\t\t\t\t\tif (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {\n\t\t\t\t\t\tvar stackedRightValue = Number(yScale.getRightValue(ds.data[index]));\n\t\t\t\t\t\tif (stackedRightValue < 0) {\n\t\t\t\t\t\t\tsumNeg += stackedRightValue || 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsumPos += stackedRightValue || 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar rightValue = Number(yScale.getRightValue(value));\n\t\t\t\tif (rightValue < 0) {\n\t\t\t\t\treturn yScale.getPixelForValue(sumNeg + rightValue);\n\t\t\t\t}\n\t\t\t\treturn yScale.getPixelForValue(sumPos + rightValue);\n\t\t\t}\n\n\t\t\treturn yScale.getPixelForValue(value);\n\t\t},\n\n\t\tupdateBezierControlPoints: function() {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar area = me.chart.chartArea;\n\t\t\tvar points = (meta.data || []);\n\t\t\tvar i, ilen, point, model, controlPoints;\n\n\t\t\t// Only consider points that are drawn in case the spanGaps option is used\n\t\t\tif (meta.dataset._model.spanGaps) {\n\t\t\t\tpoints = points.filter(function(pt) {\n\t\t\t\t\treturn !pt._model.skip;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction capControlPoint(pt, min, max) {\n\t\t\t\treturn Math.max(Math.min(pt, max), min);\n\t\t\t}\n\n\t\t\tif (meta.dataset._model.cubicInterpolationMode === 'monotone') {\n\t\t\t\thelpers.splineCurveMonotone(points);\n\t\t\t} else {\n\t\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\t\t\tpoint = points[i];\n\t\t\t\t\tmodel = point._model;\n\t\t\t\t\tcontrolPoints = helpers.splineCurve(\n\t\t\t\t\t\thelpers.previousItem(points, i)._model,\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t\thelpers.nextItem(points, i)._model,\n\t\t\t\t\t\tmeta.dataset._model.tension\n\t\t\t\t\t);\n\t\t\t\t\tmodel.controlPointPreviousX = controlPoints.previous.x;\n\t\t\t\t\tmodel.controlPointPreviousY = controlPoints.previous.y;\n\t\t\t\t\tmodel.controlPointNextX = controlPoints.next.x;\n\t\t\t\t\tmodel.controlPointNextY = controlPoints.next.y;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (me.chart.options.elements.line.capBezierPoints) {\n\t\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\n\t\t\t\t\tmodel = points[i]._model;\n\t\t\t\t\tmodel.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\n\t\t\t\t\tmodel.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\n\t\t\t\t\tmodel.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\n\t\t\t\t\tmodel.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tdraw: function() {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar points = meta.data || [];\n\t\t\tvar area = chart.chartArea;\n\t\t\tvar ilen = points.length;\n\t\t\tvar i = 0;\n\n\t\t\thelpers.canvas.clipArea(chart.ctx, area);\n\n\t\t\tif (lineEnabled(me.getDataset(), chart.options)) {\n\t\t\t\tmeta.dataset.draw();\n\t\t\t}\n\n\t\t\thelpers.canvas.unclipArea(chart.ctx);\n\n\t\t\t// Draw the points\n\t\t\tfor (; i < ilen; ++i) {\n\t\t\t\tpoints[i].draw(area);\n\t\t\t}\n\t\t},\n\n\t\tsetHoverStyle: function(point) {\n\t\t\t// Point\n\t\t\tvar dataset = this.chart.data.datasets[point._datasetIndex];\n\t\t\tvar index = point._index;\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar model = point._model;\n\n\t\t\tmodel.radius = custom.hoverRadius || helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);\n\t\t\tmodel.backgroundColor = custom.hoverBackgroundColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n\t\t\tmodel.borderColor = custom.hoverBorderColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n\t\t\tmodel.borderWidth = custom.hoverBorderWidth || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);\n\t\t},\n\n\t\tremoveHoverStyle: function(point) {\n\t\t\tvar me = this;\n\t\t\tvar dataset = me.chart.data.datasets[point._datasetIndex];\n\t\t\tvar index = point._index;\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar model = point._model;\n\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\t\tif ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n\t\t\t\tdataset.pointRadius = dataset.radius;\n\t\t\t}\n\n\t\t\tmodel.radius = custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius);\n\t\t\tmodel.backgroundColor = me.getPointBackgroundColor(point, index);\n\t\t\tmodel.borderColor = me.getPointBorderColor(point, index);\n\t\t\tmodel.borderWidth = me.getPointBorderWidth(point, index);\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.line.js?");
  108. /***/ }),
  109. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.polarArea.js":
  110. /*!*********************************************************************************************************!*\
  111. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.polarArea.js ***!
  112. \*********************************************************************************************************/
  113. /*! no static exports found */
  114. /***/ (function(module, exports, __webpack_require__) {
  115. "use strict";
  116. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('polarArea', {\n\tscale: {\n\t\ttype: 'radialLinear',\n\t\tangleLines: {\n\t\t\tdisplay: false\n\t\t},\n\t\tgridLines: {\n\t\t\tcircular: true\n\t\t},\n\t\tpointLabels: {\n\t\t\tdisplay: false\n\t\t},\n\t\tticks: {\n\t\t\tbeginAtZero: true\n\t\t}\n\t},\n\n\t// Boolean - Whether to animate the rotation of the chart\n\tanimation: {\n\t\tanimateRotate: true,\n\t\tanimateScale: true\n\t},\n\n\tstartAngle: -0.5 * Math.PI,\n\tlegendCallback: function(chart) {\n\t\tvar text = [];\n\t\ttext.push('<ul class=\"' + chart.id + '-legend\">');\n\n\t\tvar data = chart.data;\n\t\tvar datasets = data.datasets;\n\t\tvar labels = data.labels;\n\n\t\tif (datasets.length) {\n\t\t\tfor (var i = 0; i < datasets[0].data.length; ++i) {\n\t\t\t\ttext.push('<li><span style=\"background-color:' + datasets[0].backgroundColor[i] + '\"></span>');\n\t\t\t\tif (labels[i]) {\n\t\t\t\t\ttext.push(labels[i]);\n\t\t\t\t}\n\t\t\t\ttext.push('</li>');\n\t\t\t}\n\t\t}\n\n\t\ttext.push('</ul>');\n\t\treturn text.join('');\n\t},\n\tlegend: {\n\t\tlabels: {\n\t\t\tgenerateLabels: function(chart) {\n\t\t\t\tvar data = chart.data;\n\t\t\t\tif (data.labels.length && data.datasets.length) {\n\t\t\t\t\treturn data.labels.map(function(label, i) {\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\n\t\t\t\t\t\tvar ds = data.datasets[0];\n\t\t\t\t\t\tvar arc = meta.data[i];\n\t\t\t\t\t\tvar custom = arc.custom || {};\n\t\t\t\t\t\tvar valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\t\t\t\t\t\tvar arcOpts = chart.options.elements.arc;\n\t\t\t\t\t\tvar fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);\n\t\t\t\t\t\tvar stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);\n\t\t\t\t\t\tvar bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttext: label,\n\t\t\t\t\t\t\tfillStyle: fill,\n\t\t\t\t\t\t\tstrokeStyle: stroke,\n\t\t\t\t\t\t\tlineWidth: bw,\n\t\t\t\t\t\t\thidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\n\t\t\t\t\t\t\tindex: i\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\n\t\tonClick: function(e, legendItem) {\n\t\t\tvar index = legendItem.index;\n\t\t\tvar chart = this.chart;\n\t\t\tvar i, ilen, meta;\n\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n\t\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\n\t\t\t}\n\n\t\t\tchart.update();\n\t\t}\n\t},\n\n\t// Need to override these to give a nice default\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\treturn '';\n\t\t\t},\n\t\t\tlabel: function(item, data) {\n\t\t\t\treturn data.labels[item.index] + ': ' + item.yLabel;\n\t\t\t}\n\t\t}\n\t}\n});\n\nmodule.exports = function(Chart) {\n\n\tChart.controllers.polarArea = Chart.DatasetController.extend({\n\n\t\tdataElementType: elements.Arc,\n\n\t\tlinkScales: helpers.noop,\n\n\t\tupdate: function(reset) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar chartArea = chart.chartArea;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar opts = chart.options;\n\t\t\tvar arcOpts = opts.elements.arc;\n\t\t\tvar minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\t\t\tchart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0);\n\t\t\tchart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n\t\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n\n\t\t\tme.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\n\t\t\tme.innerRadius = me.outerRadius - chart.radiusLength;\n\n\t\t\tmeta.count = me.countVisibleElements();\n\n\t\t\thelpers.each(meta.data, function(arc, index) {\n\t\t\t\tme.updateElement(arc, index, reset);\n\t\t\t});\n\t\t},\n\n\t\tupdateElement: function(arc, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar opts = chart.options;\n\t\t\tvar animationOpts = opts.animation;\n\t\t\tvar scale = chart.scale;\n\t\t\tvar labels = chart.data.labels;\n\n\t\t\tvar circumference = me.calculateCircumference(dataset.data[index]);\n\t\t\tvar centerX = scale.xCenter;\n\t\t\tvar centerY = scale.yCenter;\n\n\t\t\t// If there is NaN data before us, we need to calculate the starting angle correctly.\n\t\t\t// We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data\n\t\t\tvar visibleCount = 0;\n\t\t\tvar meta = me.getMeta();\n\t\t\tfor (var i = 0; i < index; ++i) {\n\t\t\t\tif (!isNaN(dataset.data[i]) && !meta.data[i].hidden) {\n\t\t\t\t\t++visibleCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// var negHalfPI = -0.5 * Math.PI;\n\t\t\tvar datasetStartAngle = opts.startAngle;\n\t\t\tvar distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n\t\t\tvar startAngle = datasetStartAngle + (circumference * visibleCount);\n\t\t\tvar endAngle = startAngle + (arc.hidden ? 0 : circumference);\n\n\t\t\tvar resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n\n\t\t\thelpers.extend(arc, {\n\t\t\t\t// Utility\n\t\t\t\t_datasetIndex: me.index,\n\t\t\t\t_index: index,\n\t\t\t\t_scale: scale,\n\n\t\t\t\t// Desired view properties\n\t\t\t\t_model: {\n\t\t\t\t\tx: centerX,\n\t\t\t\t\ty: centerY,\n\t\t\t\t\tinnerRadius: 0,\n\t\t\t\t\touterRadius: reset ? resetRadius : distance,\n\t\t\t\t\tstartAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\n\t\t\t\t\tendAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\n\t\t\t\t\tlabel: helpers.valueAtIndexOrDefault(labels, index, labels[index])\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Apply border and fill style\n\t\t\tme.removeHoverStyle(arc);\n\n\t\t\tarc.pivot();\n\t\t},\n\n\t\tremoveHoverStyle: function(arc) {\n\t\t\tChart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);\n\t\t},\n\n\t\tcountVisibleElements: function() {\n\t\t\tvar dataset = this.getDataset();\n\t\t\tvar meta = this.getMeta();\n\t\t\tvar count = 0;\n\n\t\t\thelpers.each(meta.data, function(element, index) {\n\t\t\t\tif (!isNaN(dataset.data[index]) && !element.hidden) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn count;\n\t\t},\n\n\t\tcalculateCircumference: function(value) {\n\t\t\tvar count = this.getMeta().count;\n\t\t\tif (count > 0 && !isNaN(value)) {\n\t\t\t\treturn (2 * Math.PI) / count;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.polarArea.js?");
  117. /***/ }),
  118. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.radar.js":
  119. /*!*****************************************************************************************************!*\
  120. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.radar.js ***!
  121. \*****************************************************************************************************/
  122. /*! no static exports found */
  123. /***/ (function(module, exports, __webpack_require__) {
  124. "use strict";
  125. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('radar', {\n\tscale: {\n\t\ttype: 'radialLinear'\n\t},\n\telements: {\n\t\tline: {\n\t\t\ttension: 0 // no bezier in radar\n\t\t}\n\t}\n});\n\nmodule.exports = function(Chart) {\n\n\tChart.controllers.radar = Chart.DatasetController.extend({\n\n\t\tdatasetElementType: elements.Line,\n\n\t\tdataElementType: elements.Point,\n\n\t\tlinkScales: helpers.noop,\n\n\t\tupdate: function(reset) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar line = meta.dataset;\n\t\t\tvar points = meta.data;\n\t\t\tvar custom = line.custom || {};\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar lineElementOptions = me.chart.options.elements.line;\n\t\t\tvar scale = me.chart.scale;\n\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\t\tif ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n\t\t\t\tdataset.lineTension = dataset.tension;\n\t\t\t}\n\n\t\t\thelpers.extend(meta.dataset, {\n\t\t\t\t// Utility\n\t\t\t\t_datasetIndex: me.index,\n\t\t\t\t_scale: scale,\n\t\t\t\t// Data\n\t\t\t\t_children: points,\n\t\t\t\t_loop: true,\n\t\t\t\t// Model\n\t\t\t\t_model: {\n\t\t\t\t\t// Appearance\n\t\t\t\t\ttension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension),\n\t\t\t\t\tbackgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),\n\t\t\t\t\tborderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),\n\t\t\t\t\tborderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),\n\t\t\t\t\tfill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),\n\t\t\t\t\tborderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),\n\t\t\t\t\tborderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),\n\t\t\t\t\tborderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),\n\t\t\t\t\tborderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmeta.dataset.pivot();\n\n\t\t\t// Update Points\n\t\t\thelpers.each(points, function(point, index) {\n\t\t\t\tme.updateElement(point, index, reset);\n\t\t\t}, me);\n\n\t\t\t// Update bezier control points\n\t\t\tme.updateBezierControlPoints();\n\t\t},\n\t\tupdateElement: function(point, index, reset) {\n\t\t\tvar me = this;\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar scale = me.chart.scale;\n\t\t\tvar pointElementOptions = me.chart.options.elements.point;\n\t\t\tvar pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\n\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\n\t\t\tif ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n\t\t\t\tdataset.pointRadius = dataset.radius;\n\t\t\t}\n\t\t\tif ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {\n\t\t\t\tdataset.pointHitRadius = dataset.hitRadius;\n\t\t\t}\n\n\t\t\thelpers.extend(point, {\n\t\t\t\t// Utility\n\t\t\t\t_datasetIndex: me.index,\n\t\t\t\t_index: index,\n\t\t\t\t_scale: scale,\n\n\t\t\t\t// Desired view properties\n\t\t\t\t_model: {\n\t\t\t\t\tx: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales\n\t\t\t\t\ty: reset ? scale.yCenter : pointPosition.y,\n\n\t\t\t\t\t// Appearance\n\t\t\t\t\ttension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension),\n\t\t\t\t\tradius: custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius),\n\t\t\t\t\tbackgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor),\n\t\t\t\t\tborderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor),\n\t\t\t\t\tborderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth),\n\t\t\t\t\tpointStyle: custom.pointStyle ? custom.pointStyle : helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle),\n\n\t\t\t\t\t// Tooltip\n\t\t\t\t\thitRadius: custom.hitRadius ? custom.hitRadius : helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointElementOptions.hitRadius)\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tpoint._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y));\n\t\t},\n\t\tupdateBezierControlPoints: function() {\n\t\t\tvar chartArea = this.chart.chartArea;\n\t\t\tvar meta = this.getMeta();\n\n\t\t\thelpers.each(meta.data, function(point, index) {\n\t\t\t\tvar model = point._model;\n\t\t\t\tvar controlPoints = helpers.splineCurve(\n\t\t\t\t\thelpers.previousItem(meta.data, index, true)._model,\n\t\t\t\t\tmodel,\n\t\t\t\t\thelpers.nextItem(meta.data, index, true)._model,\n\t\t\t\t\tmodel.tension\n\t\t\t\t);\n\n\t\t\t\t// Prevent the bezier going outside of the bounds of the graph\n\t\t\t\tmodel.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left);\n\t\t\t\tmodel.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top);\n\n\t\t\t\tmodel.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left);\n\t\t\t\tmodel.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top);\n\n\t\t\t\t// Now pivot the point for animation\n\t\t\t\tpoint.pivot();\n\t\t\t});\n\t\t},\n\n\t\tsetHoverStyle: function(point) {\n\t\t\t// Point\n\t\t\tvar dataset = this.chart.data.datasets[point._datasetIndex];\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar index = point._index;\n\t\t\tvar model = point._model;\n\n\t\t\tmodel.radius = custom.hoverRadius ? custom.hoverRadius : helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);\n\t\t\tmodel.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n\t\t\tmodel.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n\t\t\tmodel.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);\n\t\t},\n\n\t\tremoveHoverStyle: function(point) {\n\t\t\tvar dataset = this.chart.data.datasets[point._datasetIndex];\n\t\t\tvar custom = point.custom || {};\n\t\t\tvar index = point._index;\n\t\t\tvar model = point._model;\n\t\t\tvar pointElementOptions = this.chart.options.elements.point;\n\n\t\t\tmodel.radius = custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius);\n\t\t\tmodel.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor);\n\t\t\tmodel.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor);\n\t\t\tmodel.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth);\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.radar.js?");
  126. /***/ }),
  127. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.scatter.js":
  128. /*!*******************************************************************************************************!*\
  129. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.scatter.js ***!
  130. \*******************************************************************************************************/
  131. /*! no static exports found */
  132. /***/ (function(module, exports, __webpack_require__) {
  133. "use strict";
  134. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\n\ndefaults._set('scatter', {\n\thover: {\n\t\tmode: 'single'\n\t},\n\n\tscales: {\n\t\txAxes: [{\n\t\t\tid: 'x-axis-1', // need an ID so datasets can reference the scale\n\t\t\ttype: 'linear', // scatter should not use a category axis\n\t\t\tposition: 'bottom'\n\t\t}],\n\t\tyAxes: [{\n\t\t\tid: 'y-axis-1',\n\t\t\ttype: 'linear',\n\t\t\tposition: 'left'\n\t\t}]\n\t},\n\n\tshowLines: false,\n\n\ttooltips: {\n\t\tcallbacks: {\n\t\t\ttitle: function() {\n\t\t\t\treturn ''; // doesn't make sense for scatter since data are formatted as a point\n\t\t\t},\n\t\t\tlabel: function(item) {\n\t\t\t\treturn '(' + item.xLabel + ', ' + item.yLabel + ')';\n\t\t\t}\n\t\t}\n\t}\n});\n\nmodule.exports = function(Chart) {\n\n\t// Scatter charts use line controllers\n\tChart.controllers.scatter = Chart.controllers.line;\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/controllers/controller.scatter.js?");
  135. /***/ }),
  136. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.animation.js":
  137. /*!********************************************************************************************!*\
  138. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.animation.js ***!
  139. \********************************************************************************************/
  140. /*! no static exports found */
  141. /***/ (function(module, exports, __webpack_require__) {
  142. "use strict";
  143. eval("/* global window: false */\n\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ./core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('global', {\n\tanimation: {\n\t\tduration: 1000,\n\t\teasing: 'easeOutQuart',\n\t\tonProgress: helpers.noop,\n\t\tonComplete: helpers.noop\n\t}\n});\n\nmodule.exports = function(Chart) {\n\n\tChart.Animation = Element.extend({\n\t\tchart: null, // the animation associated chart instance\n\t\tcurrentStep: 0, // the current animation step\n\t\tnumSteps: 60, // default number of steps\n\t\teasing: '', // the easing to use for this animation\n\t\trender: null, // render function used by the animation service\n\n\t\tonAnimationProgress: null, // user specified callback to fire on each step of the animation\n\t\tonAnimationComplete: null, // user specified callback to fire when the animation finishes\n\t});\n\n\tChart.animationService = {\n\t\tframeDuration: 17,\n\t\tanimations: [],\n\t\tdropFrames: 0,\n\t\trequest: null,\n\n\t\t/**\n\t\t * @param {Chart} chart - The chart to animate.\n\t\t * @param {Chart.Animation} animation - The animation that we will animate.\n\t\t * @param {Number} duration - The animation duration in ms.\n\t\t * @param {Boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\n\t\t */\n\t\taddAnimation: function(chart, animation, duration, lazy) {\n\t\t\tvar animations = this.animations;\n\t\t\tvar i, ilen;\n\n\t\t\tanimation.chart = chart;\n\n\t\t\tif (!lazy) {\n\t\t\t\tchart.animating = true;\n\t\t\t}\n\n\t\t\tfor (i = 0, ilen = animations.length; i < ilen; ++i) {\n\t\t\t\tif (animations[i].chart === chart) {\n\t\t\t\t\tanimations[i] = animation;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tanimations.push(animation);\n\n\t\t\t// If there are no animations queued, manually kickstart a digest, for lack of a better word\n\t\t\tif (animations.length === 1) {\n\t\t\t\tthis.requestAnimationFrame();\n\t\t\t}\n\t\t},\n\n\t\tcancelAnimation: function(chart) {\n\t\t\tvar index = helpers.findIndex(this.animations, function(animation) {\n\t\t\t\treturn animation.chart === chart;\n\t\t\t});\n\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.animations.splice(index, 1);\n\t\t\t\tchart.animating = false;\n\t\t\t}\n\t\t},\n\n\t\trequestAnimationFrame: function() {\n\t\t\tvar me = this;\n\t\t\tif (me.request === null) {\n\t\t\t\t// Skip animation frame requests until the active one is executed.\n\t\t\t\t// This can happen when processing mouse events, e.g. 'mousemove'\n\t\t\t\t// and 'mouseout' events will trigger multiple renders.\n\t\t\t\tme.request = helpers.requestAnimFrame.call(window, function() {\n\t\t\t\t\tme.request = null;\n\t\t\t\t\tme.startDigest();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tstartDigest: function() {\n\t\t\tvar me = this;\n\t\t\tvar startTime = Date.now();\n\t\t\tvar framesToDrop = 0;\n\n\t\t\tif (me.dropFrames > 1) {\n\t\t\t\tframesToDrop = Math.floor(me.dropFrames);\n\t\t\t\tme.dropFrames = me.dropFrames % 1;\n\t\t\t}\n\n\t\t\tme.advance(1 + framesToDrop);\n\n\t\t\tvar endTime = Date.now();\n\n\t\t\tme.dropFrames += (endTime - startTime) / me.frameDuration;\n\n\t\t\t// Do we have more stuff to animate?\n\t\t\tif (me.animations.length > 0) {\n\t\t\t\tme.requestAnimationFrame();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tadvance: function(count) {\n\t\t\tvar animations = this.animations;\n\t\t\tvar animation, chart;\n\t\t\tvar i = 0;\n\n\t\t\twhile (i < animations.length) {\n\t\t\t\tanimation = animations[i];\n\t\t\t\tchart = animation.chart;\n\n\t\t\t\tanimation.currentStep = (animation.currentStep || 0) + count;\n\t\t\t\tanimation.currentStep = Math.min(animation.currentStep, animation.numSteps);\n\n\t\t\t\thelpers.callback(animation.render, [chart, animation], chart);\n\t\t\t\thelpers.callback(animation.onAnimationProgress, [animation], chart);\n\n\t\t\t\tif (animation.currentStep >= animation.numSteps) {\n\t\t\t\t\thelpers.callback(animation.onAnimationComplete, [animation], chart);\n\t\t\t\t\tchart.animating = false;\n\t\t\t\t\tanimations.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Provided for backward compatibility, use Chart.Animation instead\n\t * @prop Chart.Animation#animationObject\n\t * @deprecated since version 2.6.0\n\t * @todo remove at version 3\n\t */\n\tObject.defineProperty(Chart.Animation.prototype, 'animationObject', {\n\t\tget: function() {\n\t\t\treturn this;\n\t\t}\n\t});\n\n\t/**\n\t * Provided for backward compatibility, use Chart.Animation#chart instead\n\t * @prop Chart.Animation#chartInstance\n\t * @deprecated since version 2.6.0\n\t * @todo remove at version 3\n\t */\n\tObject.defineProperty(Chart.Animation.prototype, 'chartInstance', {\n\t\tget: function() {\n\t\t\treturn this.chart;\n\t\t},\n\t\tset: function(value) {\n\t\t\tthis.chart = value;\n\t\t}\n\t});\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.animation.js?");
  144. /***/ }),
  145. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.controller.js":
  146. /*!*********************************************************************************************!*\
  147. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.controller.js ***!
  148. \*********************************************************************************************/
  149. /*! no static exports found */
  150. /***/ (function(module, exports, __webpack_require__) {
  151. "use strict";
  152. eval("\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar Interaction = __webpack_require__(/*! ./core.interaction */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.interaction.js\");\nvar layouts = __webpack_require__(/*! ./core.layouts */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js\");\nvar platform = __webpack_require__(/*! ../platforms/platform */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.js\");\nvar plugins = __webpack_require__(/*! ./core.plugins */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.plugins.js\");\n\nmodule.exports = function(Chart) {\n\n\t// Create a dictionary of chart types, to allow for extension of existing types\n\tChart.types = {};\n\n\t// Store a reference to each instance - allowing us to globally resize chart instances on window resize.\n\t// Destroy method on the chart will remove the instance of the chart from this reference.\n\tChart.instances = {};\n\n\t// Controllers available for dataset visualization eg. bar, line, slice, etc.\n\tChart.controllers = {};\n\n\t/**\n\t * Initializes the given config with global and chart default values.\n\t */\n\tfunction initConfig(config) {\n\t\tconfig = config || {};\n\n\t\t// Do NOT use configMerge() for the data object because this method merges arrays\n\t\t// and so would change references to labels and datasets, preventing data updates.\n\t\tvar data = config.data = config.data || {};\n\t\tdata.datasets = data.datasets || [];\n\t\tdata.labels = data.labels || [];\n\n\t\tconfig.options = helpers.configMerge(\n\t\t\tdefaults.global,\n\t\t\tdefaults[config.type],\n\t\t\tconfig.options || {});\n\n\t\treturn config;\n\t}\n\n\t/**\n\t * Updates the config of the chart\n\t * @param chart {Chart} chart to update the options for\n\t */\n\tfunction updateConfig(chart) {\n\t\tvar newOptions = chart.options;\n\n\t\thelpers.each(chart.scales, function(scale) {\n\t\t\tlayouts.removeBox(chart, scale);\n\t\t});\n\n\t\tnewOptions = helpers.configMerge(\n\t\t\tChart.defaults.global,\n\t\t\tChart.defaults[chart.config.type],\n\t\t\tnewOptions);\n\n\t\tchart.options = chart.config.options = newOptions;\n\t\tchart.ensureScalesHaveIDs();\n\t\tchart.buildOrUpdateScales();\n\t\t// Tooltip\n\t\tchart.tooltip._options = newOptions.tooltips;\n\t\tchart.tooltip.initialize();\n\t}\n\n\tfunction positionIsHorizontal(position) {\n\t\treturn position === 'top' || position === 'bottom';\n\t}\n\n\thelpers.extend(Chart.prototype, /** @lends Chart */ {\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tconstruct: function(item, config) {\n\t\t\tvar me = this;\n\n\t\t\tconfig = initConfig(config);\n\n\t\t\tvar context = platform.acquireContext(item, config);\n\t\t\tvar canvas = context && context.canvas;\n\t\t\tvar height = canvas && canvas.height;\n\t\t\tvar width = canvas && canvas.width;\n\n\t\t\tme.id = helpers.uid();\n\t\t\tme.ctx = context;\n\t\t\tme.canvas = canvas;\n\t\t\tme.config = config;\n\t\t\tme.width = width;\n\t\t\tme.height = height;\n\t\t\tme.aspectRatio = height ? width / height : null;\n\t\t\tme.options = config.options;\n\t\t\tme._bufferedRender = false;\n\n\t\t\t/**\n\t\t\t * Provided for backward compatibility, Chart and Chart.Controller have been merged,\n\t\t\t * the \"instance\" still need to be defined since it might be called from plugins.\n\t\t\t * @prop Chart#chart\n\t\t\t * @deprecated since version 2.6.0\n\t\t\t * @todo remove at version 3\n\t\t\t * @private\n\t\t\t */\n\t\t\tme.chart = me;\n\t\t\tme.controller = me; // chart.chart.controller #inception\n\n\t\t\t// Add the chart instance to the global namespace\n\t\t\tChart.instances[me.id] = me;\n\n\t\t\t// Define alias to the config data: `chart.data === chart.config.data`\n\t\t\tObject.defineProperty(me, 'data', {\n\t\t\t\tget: function() {\n\t\t\t\t\treturn me.config.data;\n\t\t\t\t},\n\t\t\t\tset: function(value) {\n\t\t\t\t\tme.config.data = value;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (!context || !canvas) {\n\t\t\t\t// The given item is not a compatible context2d element, let's return before finalizing\n\t\t\t\t// the chart initialization but after setting basic chart / controller properties that\n\t\t\t\t// can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n\t\t\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\t\t\tconsole.error(\"Failed to create chart: can't acquire context from the given item\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tme.initialize();\n\t\t\tme.update();\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tinitialize: function() {\n\t\t\tvar me = this;\n\n\t\t\t// Before init plugin notification\n\t\t\tplugins.notify(me, 'beforeInit');\n\n\t\t\thelpers.retinaScale(me, me.options.devicePixelRatio);\n\n\t\t\tme.bindEvents();\n\n\t\t\tif (me.options.responsive) {\n\t\t\t\t// Initial resize before chart draws (must be silent to preserve initial animations).\n\t\t\t\tme.resize(true);\n\t\t\t}\n\n\t\t\t// Make sure scales have IDs and are built before we build any controllers.\n\t\t\tme.ensureScalesHaveIDs();\n\t\t\tme.buildOrUpdateScales();\n\t\t\tme.initToolTip();\n\n\t\t\t// After init plugin notification\n\t\t\tplugins.notify(me, 'afterInit');\n\n\t\t\treturn me;\n\t\t},\n\n\t\tclear: function() {\n\t\t\thelpers.canvas.clear(this);\n\t\t\treturn this;\n\t\t},\n\n\t\tstop: function() {\n\t\t\t// Stops any current animation loop occurring\n\t\t\tChart.animationService.cancelAnimation(this);\n\t\t\treturn this;\n\t\t},\n\n\t\tresize: function(silent) {\n\t\t\tvar me = this;\n\t\t\tvar options = me.options;\n\t\t\tvar canvas = me.canvas;\n\t\t\tvar aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;\n\n\t\t\t// the canvas render width and height will be casted to integers so make sure that\n\t\t\t// the canvas display style uses the same integer values to avoid blurring effect.\n\n\t\t\t// Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collased\n\t\t\tvar newWidth = Math.max(0, Math.floor(helpers.getMaximumWidth(canvas)));\n\t\t\tvar newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers.getMaximumHeight(canvas)));\n\n\t\t\tif (me.width === newWidth && me.height === newHeight) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcanvas.width = me.width = newWidth;\n\t\t\tcanvas.height = me.height = newHeight;\n\t\t\tcanvas.style.width = newWidth + 'px';\n\t\t\tcanvas.style.height = newHeight + 'px';\n\n\t\t\thelpers.retinaScale(me, options.devicePixelRatio);\n\n\t\t\tif (!silent) {\n\t\t\t\t// Notify any plugins about the resize\n\t\t\t\tvar newSize = {width: newWidth, height: newHeight};\n\t\t\t\tplugins.notify(me, 'resize', [newSize]);\n\n\t\t\t\t// Notify of resize\n\t\t\t\tif (me.options.onResize) {\n\t\t\t\t\tme.options.onResize(me, newSize);\n\t\t\t\t}\n\n\t\t\t\tme.stop();\n\t\t\t\tme.update(me.options.responsiveAnimationDuration);\n\t\t\t}\n\t\t},\n\n\t\tensureScalesHaveIDs: function() {\n\t\t\tvar options = this.options;\n\t\t\tvar scalesOptions = options.scales || {};\n\t\t\tvar scaleOptions = options.scale;\n\n\t\t\thelpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {\n\t\t\t\txAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);\n\t\t\t});\n\n\t\t\thelpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {\n\t\t\t\tyAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);\n\t\t\t});\n\n\t\t\tif (scaleOptions) {\n\t\t\t\tscaleOptions.id = scaleOptions.id || 'scale';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Builds a map of scale ID to scale object for future lookup.\n\t\t */\n\t\tbuildOrUpdateScales: function() {\n\t\t\tvar me = this;\n\t\t\tvar options = me.options;\n\t\t\tvar scales = me.scales || {};\n\t\t\tvar items = [];\n\t\t\tvar updated = Object.keys(scales).reduce(function(obj, id) {\n\t\t\t\tobj[id] = false;\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\n\t\t\tif (options.scales) {\n\t\t\t\titems = items.concat(\n\t\t\t\t\t(options.scales.xAxes || []).map(function(xAxisOptions) {\n\t\t\t\t\t\treturn {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};\n\t\t\t\t\t}),\n\t\t\t\t\t(options.scales.yAxes || []).map(function(yAxisOptions) {\n\t\t\t\t\t\treturn {options: yAxisOptions, dtype: 'linear', dposition: 'left'};\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (options.scale) {\n\t\t\t\titems.push({\n\t\t\t\t\toptions: options.scale,\n\t\t\t\t\tdtype: 'radialLinear',\n\t\t\t\t\tisDefault: true,\n\t\t\t\t\tdposition: 'chartArea'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thelpers.each(items, function(item) {\n\t\t\t\tvar scaleOptions = item.options;\n\t\t\t\tvar id = scaleOptions.id;\n\t\t\t\tvar scaleType = helpers.valueOrDefault(scaleOptions.type, item.dtype);\n\n\t\t\t\tif (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {\n\t\t\t\t\tscaleOptions.position = item.dposition;\n\t\t\t\t}\n\n\t\t\t\tupdated[id] = true;\n\t\t\t\tvar scale = null;\n\t\t\t\tif (id in scales && scales[id].type === scaleType) {\n\t\t\t\t\tscale = scales[id];\n\t\t\t\t\tscale.options = scaleOptions;\n\t\t\t\t\tscale.ctx = me.ctx;\n\t\t\t\t\tscale.chart = me;\n\t\t\t\t} else {\n\t\t\t\t\tvar scaleClass = Chart.scaleService.getScaleConstructor(scaleType);\n\t\t\t\t\tif (!scaleClass) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tscale = new scaleClass({\n\t\t\t\t\t\tid: id,\n\t\t\t\t\t\ttype: scaleType,\n\t\t\t\t\t\toptions: scaleOptions,\n\t\t\t\t\t\tctx: me.ctx,\n\t\t\t\t\t\tchart: me\n\t\t\t\t\t});\n\t\t\t\t\tscales[scale.id] = scale;\n\t\t\t\t}\n\n\t\t\t\tscale.mergeTicksOptions();\n\n\t\t\t\t// TODO(SB): I think we should be able to remove this custom case (options.scale)\n\t\t\t\t// and consider it as a regular scale part of the \"scales\"\" map only! This would\n\t\t\t\t// make the logic easier and remove some useless? custom code.\n\t\t\t\tif (item.isDefault) {\n\t\t\t\t\tme.scale = scale;\n\t\t\t\t}\n\t\t\t});\n\t\t\t// clear up discarded scales\n\t\t\thelpers.each(updated, function(hasUpdated, id) {\n\t\t\t\tif (!hasUpdated) {\n\t\t\t\t\tdelete scales[id];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tme.scales = scales;\n\n\t\t\tChart.scaleService.addScalesToLayout(this);\n\t\t},\n\n\t\tbuildOrUpdateControllers: function() {\n\t\t\tvar me = this;\n\t\t\tvar types = [];\n\t\t\tvar newControllers = [];\n\n\t\t\thelpers.each(me.data.datasets, function(dataset, datasetIndex) {\n\t\t\t\tvar meta = me.getDatasetMeta(datasetIndex);\n\t\t\t\tvar type = dataset.type || me.config.type;\n\n\t\t\t\tif (meta.type && meta.type !== type) {\n\t\t\t\t\tme.destroyDatasetMeta(datasetIndex);\n\t\t\t\t\tmeta = me.getDatasetMeta(datasetIndex);\n\t\t\t\t}\n\t\t\t\tmeta.type = type;\n\n\t\t\t\ttypes.push(meta.type);\n\n\t\t\t\tif (meta.controller) {\n\t\t\t\t\tmeta.controller.updateIndex(datasetIndex);\n\t\t\t\t\tmeta.controller.linkScales();\n\t\t\t\t} else {\n\t\t\t\t\tvar ControllerClass = Chart.controllers[meta.type];\n\t\t\t\t\tif (ControllerClass === undefined) {\n\t\t\t\t\t\tthrow new Error('\"' + meta.type + '\" is not a chart type.');\n\t\t\t\t\t}\n\n\t\t\t\t\tmeta.controller = new ControllerClass(me, datasetIndex);\n\t\t\t\t\tnewControllers.push(meta.controller);\n\t\t\t\t}\n\t\t\t}, me);\n\n\t\t\treturn newControllers;\n\t\t},\n\n\t\t/**\n\t\t * Reset the elements of all datasets\n\t\t * @private\n\t\t */\n\t\tresetElements: function() {\n\t\t\tvar me = this;\n\t\t\thelpers.each(me.data.datasets, function(dataset, datasetIndex) {\n\t\t\t\tme.getDatasetMeta(datasetIndex).controller.reset();\n\t\t\t}, me);\n\t\t},\n\n\t\t/**\n\t\t* Resets the chart back to it's state before the initial animation\n\t\t*/\n\t\treset: function() {\n\t\t\tthis.resetElements();\n\t\t\tthis.tooltip.initialize();\n\t\t},\n\n\t\tupdate: function(config) {\n\t\t\tvar me = this;\n\n\t\t\tif (!config || typeof config !== 'object') {\n\t\t\t\t// backwards compatibility\n\t\t\t\tconfig = {\n\t\t\t\t\tduration: config,\n\t\t\t\t\tlazy: arguments[1]\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tupdateConfig(me);\n\n\t\t\t// plugins options references might have change, let's invalidate the cache\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n\t\t\tplugins._invalidate(me);\n\n\t\t\tif (plugins.notify(me, 'beforeUpdate') === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In case the entire data object changed\n\t\t\tme.tooltip._data = me.data;\n\n\t\t\t// Make sure dataset controllers are updated and new controllers are reset\n\t\t\tvar newControllers = me.buildOrUpdateControllers();\n\n\t\t\t// Make sure all dataset controllers have correct meta data counts\n\t\t\thelpers.each(me.data.datasets, function(dataset, datasetIndex) {\n\t\t\t\tme.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();\n\t\t\t}, me);\n\n\t\t\tme.updateLayout();\n\n\t\t\t// Can only reset the new controllers after the scales have been updated\n\t\t\tif (me.options.animation && me.options.animation.duration) {\n\t\t\t\thelpers.each(newControllers, function(controller) {\n\t\t\t\t\tcontroller.reset();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tme.updateDatasets();\n\n\t\t\t// Need to reset tooltip in case it is displayed with elements that are removed\n\t\t\t// after update.\n\t\t\tme.tooltip.initialize();\n\n\t\t\t// Last active contains items that were previously in the tooltip.\n\t\t\t// When we reset the tooltip, we need to clear it\n\t\t\tme.lastActive = [];\n\n\t\t\t// Do this before render so that any plugins that need final scale updates can use it\n\t\t\tplugins.notify(me, 'afterUpdate');\n\n\t\t\tif (me._bufferedRender) {\n\t\t\t\tme._bufferedRequest = {\n\t\t\t\t\tduration: config.duration,\n\t\t\t\t\teasing: config.easing,\n\t\t\t\t\tlazy: config.lazy\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tme.render(config);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t\t * @private\n\t\t */\n\t\tupdateLayout: function() {\n\t\t\tvar me = this;\n\n\t\t\tif (plugins.notify(me, 'beforeLayout') === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlayouts.update(this, this.width, this.height);\n\n\t\t\t/**\n\t\t\t * Provided for backward compatibility, use `afterLayout` instead.\n\t\t\t * @method IPlugin#afterScaleUpdate\n\t\t\t * @deprecated since version 2.5.0\n\t\t\t * @todo remove at version 3\n\t\t\t * @private\n\t\t\t */\n\t\t\tplugins.notify(me, 'afterScaleUpdate');\n\t\t\tplugins.notify(me, 'afterLayout');\n\t\t},\n\n\t\t/**\n\t\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t\t * @private\n\t\t */\n\t\tupdateDatasets: function() {\n\t\t\tvar me = this;\n\n\t\t\tif (plugins.notify(me, 'beforeDatasetsUpdate') === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n\t\t\t\tme.updateDataset(i);\n\t\t\t}\n\n\t\t\tplugins.notify(me, 'afterDatasetsUpdate');\n\t\t},\n\n\t\t/**\n\t\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t\t * @private\n\t\t */\n\t\tupdateDataset: function(index) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getDatasetMeta(index);\n\t\t\tvar args = {\n\t\t\t\tmeta: meta,\n\t\t\t\tindex: index\n\t\t\t};\n\n\t\t\tif (plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmeta.controller.update();\n\n\t\t\tplugins.notify(me, 'afterDatasetUpdate', [args]);\n\t\t},\n\n\t\trender: function(config) {\n\t\t\tvar me = this;\n\n\t\t\tif (!config || typeof config !== 'object') {\n\t\t\t\t// backwards compatibility\n\t\t\t\tconfig = {\n\t\t\t\t\tduration: config,\n\t\t\t\t\tlazy: arguments[1]\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvar duration = config.duration;\n\t\t\tvar lazy = config.lazy;\n\n\t\t\tif (plugins.notify(me, 'beforeRender') === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar animationOptions = me.options.animation;\n\t\t\tvar onComplete = function(animation) {\n\t\t\t\tplugins.notify(me, 'afterRender');\n\t\t\t\thelpers.callback(animationOptions && animationOptions.onComplete, [animation], me);\n\t\t\t};\n\n\t\t\tif (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {\n\t\t\t\tvar animation = new Chart.Animation({\n\t\t\t\t\tnumSteps: (duration || animationOptions.duration) / 16.66, // 60 fps\n\t\t\t\t\teasing: config.easing || animationOptions.easing,\n\n\t\t\t\t\trender: function(chart, animationObject) {\n\t\t\t\t\t\tvar easingFunction = helpers.easing.effects[animationObject.easing];\n\t\t\t\t\t\tvar currentStep = animationObject.currentStep;\n\t\t\t\t\t\tvar stepDecimal = currentStep / animationObject.numSteps;\n\n\t\t\t\t\t\tchart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);\n\t\t\t\t\t},\n\n\t\t\t\t\tonAnimationProgress: animationOptions.onProgress,\n\t\t\t\t\tonAnimationComplete: onComplete\n\t\t\t\t});\n\n\t\t\t\tChart.animationService.addAnimation(me, animation, duration, lazy);\n\t\t\t} else {\n\t\t\t\tme.draw();\n\n\t\t\t\t// See https://github.com/chartjs/Chart.js/issues/3781\n\t\t\t\tonComplete(new Chart.Animation({numSteps: 0, chart: me}));\n\t\t\t}\n\n\t\t\treturn me;\n\t\t},\n\n\t\tdraw: function(easingValue) {\n\t\t\tvar me = this;\n\n\t\t\tme.clear();\n\n\t\t\tif (helpers.isNullOrUndef(easingValue)) {\n\t\t\t\teasingValue = 1;\n\t\t\t}\n\n\t\t\tme.transition(easingValue);\n\n\t\t\tif (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Draw all the scales\n\t\t\thelpers.each(me.boxes, function(box) {\n\t\t\t\tbox.draw(me.chartArea);\n\t\t\t}, me);\n\n\t\t\tif (me.scale) {\n\t\t\t\tme.scale.draw();\n\t\t\t}\n\n\t\t\tme.drawDatasets(easingValue);\n\t\t\tme._drawTooltip(easingValue);\n\n\t\t\tplugins.notify(me, 'afterDraw', [easingValue]);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\ttransition: function(easingValue) {\n\t\t\tvar me = this;\n\n\t\t\tfor (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {\n\t\t\t\tif (me.isDatasetVisible(i)) {\n\t\t\t\t\tme.getDatasetMeta(i).controller.transition(easingValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tme.tooltip.transition(easingValue);\n\t\t},\n\n\t\t/**\n\t\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t\t * @private\n\t\t */\n\t\tdrawDatasets: function(easingValue) {\n\t\t\tvar me = this;\n\n\t\t\tif (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Draw datasets reversed to support proper line stacking\n\t\t\tfor (var i = (me.data.datasets || []).length - 1; i >= 0; --i) {\n\t\t\t\tif (me.isDatasetVisible(i)) {\n\t\t\t\t\tme.drawDataset(i, easingValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tplugins.notify(me, 'afterDatasetsDraw', [easingValue]);\n\t\t},\n\n\t\t/**\n\t\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t\t * @private\n\t\t */\n\t\tdrawDataset: function(index, easingValue) {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getDatasetMeta(index);\n\t\t\tvar args = {\n\t\t\t\tmeta: meta,\n\t\t\t\tindex: index,\n\t\t\t\teasingValue: easingValue\n\t\t\t};\n\n\t\t\tif (plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmeta.controller.draw(easingValue);\n\n\t\t\tplugins.notify(me, 'afterDatasetDraw', [args]);\n\t\t},\n\n\t\t/**\n\t\t * Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw`\n\t\t * hook, in which case, plugins will not be called on `afterTooltipDraw`.\n\t\t * @private\n\t\t */\n\t\t_drawTooltip: function(easingValue) {\n\t\t\tvar me = this;\n\t\t\tvar tooltip = me.tooltip;\n\t\t\tvar args = {\n\t\t\t\ttooltip: tooltip,\n\t\t\t\teasingValue: easingValue\n\t\t\t};\n\n\t\t\tif (plugins.notify(me, 'beforeTooltipDraw', [args]) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttooltip.draw();\n\n\t\t\tplugins.notify(me, 'afterTooltipDraw', [args]);\n\t\t},\n\n\t\t// Get the single element that was clicked on\n\t\t// @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw\n\t\tgetElementAtEvent: function(e) {\n\t\t\treturn Interaction.modes.single(this, e);\n\t\t},\n\n\t\tgetElementsAtEvent: function(e) {\n\t\t\treturn Interaction.modes.label(this, e, {intersect: true});\n\t\t},\n\n\t\tgetElementsAtXAxis: function(e) {\n\t\t\treturn Interaction.modes['x-axis'](this, e, {intersect: true});\n\t\t},\n\n\t\tgetElementsAtEventForMode: function(e, mode, options) {\n\t\t\tvar method = Interaction.modes[mode];\n\t\t\tif (typeof method === 'function') {\n\t\t\t\treturn method(this, e, options);\n\t\t\t}\n\n\t\t\treturn [];\n\t\t},\n\n\t\tgetDatasetAtEvent: function(e) {\n\t\t\treturn Interaction.modes.dataset(this, e, {intersect: true});\n\t\t},\n\n\t\tgetDatasetMeta: function(datasetIndex) {\n\t\t\tvar me = this;\n\t\t\tvar dataset = me.data.datasets[datasetIndex];\n\t\t\tif (!dataset._meta) {\n\t\t\t\tdataset._meta = {};\n\t\t\t}\n\n\t\t\tvar meta = dataset._meta[me.id];\n\t\t\tif (!meta) {\n\t\t\t\tmeta = dataset._meta[me.id] = {\n\t\t\t\t\ttype: null,\n\t\t\t\t\tdata: [],\n\t\t\t\t\tdataset: null,\n\t\t\t\t\tcontroller: null,\n\t\t\t\t\thidden: null,\t\t\t// See isDatasetVisible() comment\n\t\t\t\t\txAxisID: null,\n\t\t\t\t\tyAxisID: null\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn meta;\n\t\t},\n\n\t\tgetVisibleDatasetCount: function() {\n\t\t\tvar count = 0;\n\t\t\tfor (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n\t\t\t\tif (this.isDatasetVisible(i)) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t},\n\n\t\tisDatasetVisible: function(datasetIndex) {\n\t\t\tvar meta = this.getDatasetMeta(datasetIndex);\n\n\t\t\t// meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n\t\t\t// the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n\t\t\treturn typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;\n\t\t},\n\n\t\tgenerateLegend: function() {\n\t\t\treturn this.options.legendCallback(this);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tdestroyDatasetMeta: function(datasetIndex) {\n\t\t\tvar id = this.id;\n\t\t\tvar dataset = this.data.datasets[datasetIndex];\n\t\t\tvar meta = dataset._meta && dataset._meta[id];\n\n\t\t\tif (meta) {\n\t\t\t\tmeta.controller.destroy();\n\t\t\t\tdelete dataset._meta[id];\n\t\t\t}\n\t\t},\n\n\t\tdestroy: function() {\n\t\t\tvar me = this;\n\t\t\tvar canvas = me.canvas;\n\t\t\tvar i, ilen;\n\n\t\t\tme.stop();\n\n\t\t\t// dataset controllers need to cleanup associated data\n\t\t\tfor (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n\t\t\t\tme.destroyDatasetMeta(i);\n\t\t\t}\n\n\t\t\tif (canvas) {\n\t\t\t\tme.unbindEvents();\n\t\t\t\thelpers.canvas.clear(me);\n\t\t\t\tplatform.releaseContext(me.ctx);\n\t\t\t\tme.canvas = null;\n\t\t\t\tme.ctx = null;\n\t\t\t}\n\n\t\t\tplugins.notify(me, 'destroy');\n\n\t\t\tdelete Chart.instances[me.id];\n\t\t},\n\n\t\ttoBase64Image: function() {\n\t\t\treturn this.canvas.toDataURL.apply(this.canvas, arguments);\n\t\t},\n\n\t\tinitToolTip: function() {\n\t\t\tvar me = this;\n\t\t\tme.tooltip = new Chart.Tooltip({\n\t\t\t\t_chart: me,\n\t\t\t\t_chartInstance: me, // deprecated, backward compatibility\n\t\t\t\t_data: me.data,\n\t\t\t\t_options: me.options.tooltips\n\t\t\t}, me);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tbindEvents: function() {\n\t\t\tvar me = this;\n\t\t\tvar listeners = me._listeners = {};\n\t\t\tvar listener = function() {\n\t\t\t\tme.eventHandler.apply(me, arguments);\n\t\t\t};\n\n\t\t\thelpers.each(me.options.events, function(type) {\n\t\t\t\tplatform.addEventListener(me, type, listener);\n\t\t\t\tlisteners[type] = listener;\n\t\t\t});\n\n\t\t\t// Elements used to detect size change should not be injected for non responsive charts.\n\t\t\t// See https://github.com/chartjs/Chart.js/issues/2210\n\t\t\tif (me.options.responsive) {\n\t\t\t\tlistener = function() {\n\t\t\t\t\tme.resize();\n\t\t\t\t};\n\n\t\t\t\tplatform.addEventListener(me, 'resize', listener);\n\t\t\t\tlisteners.resize = listener;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tunbindEvents: function() {\n\t\t\tvar me = this;\n\t\t\tvar listeners = me._listeners;\n\t\t\tif (!listeners) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdelete me._listeners;\n\t\t\thelpers.each(listeners, function(listener, type) {\n\t\t\t\tplatform.removeEventListener(me, type, listener);\n\t\t\t});\n\t\t},\n\n\t\tupdateHoverStyle: function(elements, mode, enabled) {\n\t\t\tvar method = enabled ? 'setHoverStyle' : 'removeHoverStyle';\n\t\t\tvar element, i, ilen;\n\n\t\t\tfor (i = 0, ilen = elements.length; i < ilen; ++i) {\n\t\t\t\telement = elements[i];\n\t\t\t\tif (element) {\n\t\t\t\t\tthis.getDatasetMeta(element._datasetIndex).controller[method](element);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\teventHandler: function(e) {\n\t\t\tvar me = this;\n\t\t\tvar tooltip = me.tooltip;\n\n\t\t\tif (plugins.notify(me, 'beforeEvent', [e]) === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Buffer any update calls so that renders do not occur\n\t\t\tme._bufferedRender = true;\n\t\t\tme._bufferedRequest = null;\n\n\t\t\tvar changed = me.handleEvent(e);\n\t\t\t// for smooth tooltip animations issue #4989\n\t\t\t// the tooltip should be the source of change\n\t\t\t// Animation check workaround:\n\t\t\t// tooltip._start will be null when tooltip isn't animating\n\t\t\tif (tooltip) {\n\t\t\t\tchanged = tooltip._start\n\t\t\t\t\t? tooltip.handleEvent(e)\n\t\t\t\t\t: changed | tooltip.handleEvent(e);\n\t\t\t}\n\n\t\t\tplugins.notify(me, 'afterEvent', [e]);\n\n\t\t\tvar bufferedRequest = me._bufferedRequest;\n\t\t\tif (bufferedRequest) {\n\t\t\t\t// If we have an update that was triggered, we need to do a normal render\n\t\t\t\tme.render(bufferedRequest);\n\t\t\t} else if (changed && !me.animating) {\n\t\t\t\t// If entering, leaving, or changing elements, animate the change via pivot\n\t\t\t\tme.stop();\n\n\t\t\t\t// We only need to render at this point. Updating will cause scales to be\n\t\t\t\t// recomputed generating flicker & using more memory than necessary.\n\t\t\t\tme.render(me.options.hover.animationDuration, true);\n\t\t\t}\n\n\t\t\tme._bufferedRender = false;\n\t\t\tme._bufferedRequest = null;\n\n\t\t\treturn me;\n\t\t},\n\n\t\t/**\n\t\t * Handle an event\n\t\t * @private\n\t\t * @param {IEvent} event the event to handle\n\t\t * @return {Boolean} true if the chart needs to re-render\n\t\t */\n\t\thandleEvent: function(e) {\n\t\t\tvar me = this;\n\t\t\tvar options = me.options || {};\n\t\t\tvar hoverOptions = options.hover;\n\t\t\tvar changed = false;\n\n\t\t\tme.lastActive = me.lastActive || [];\n\n\t\t\t// Find Active Elements for hover and tooltips\n\t\t\tif (e.type === 'mouseout') {\n\t\t\t\tme.active = [];\n\t\t\t} else {\n\t\t\t\tme.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);\n\t\t\t}\n\n\t\t\t// Invoke onHover hook\n\t\t\t// Need to call with native event here to not break backwards compatibility\n\t\t\thelpers.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);\n\n\t\t\tif (e.type === 'mouseup' || e.type === 'click') {\n\t\t\t\tif (options.onClick) {\n\t\t\t\t\t// Use e.native here for backwards compatibility\n\t\t\t\t\toptions.onClick.call(me, e.native, me.active);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove styling for last active (even if it may still be active)\n\t\t\tif (me.lastActive.length) {\n\t\t\t\tme.updateHoverStyle(me.lastActive, hoverOptions.mode, false);\n\t\t\t}\n\n\t\t\t// Built in hover styling\n\t\t\tif (me.active.length && hoverOptions.mode) {\n\t\t\t\tme.updateHoverStyle(me.active, hoverOptions.mode, true);\n\t\t\t}\n\n\t\t\tchanged = !helpers.arrayEquals(me.active, me.lastActive);\n\n\t\t\t// Remember Last Actives\n\t\t\tme.lastActive = me.active;\n\n\t\t\treturn changed;\n\t\t}\n\t});\n\n\t/**\n\t * Provided for backward compatibility, use Chart instead.\n\t * @class Chart.Controller\n\t * @deprecated since version 2.6.0\n\t * @todo remove at version 3\n\t * @private\n\t */\n\tChart.Controller = Chart;\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.controller.js?");
  153. /***/ }),
  154. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.datasetController.js":
  155. /*!****************************************************************************************************!*\
  156. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.datasetController.js ***!
  157. \****************************************************************************************************/
  158. /*! no static exports found */
  159. /***/ (function(module, exports, __webpack_require__) {
  160. "use strict";
  161. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nmodule.exports = function(Chart) {\n\n\tvar arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\n\n\t/**\n\t * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n\t * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n\t * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\n\t */\n\tfunction listenArrayEvents(array, listener) {\n\t\tif (array._chartjs) {\n\t\t\tarray._chartjs.listeners.push(listener);\n\t\t\treturn;\n\t\t}\n\n\t\tObject.defineProperty(array, '_chartjs', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: {\n\t\t\t\tlisteners: [listener]\n\t\t\t}\n\t\t});\n\n\t\tarrayEvents.forEach(function(key) {\n\t\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n\t\t\tvar base = array[key];\n\n\t\t\tObject.defineProperty(array, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: function() {\n\t\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\t\tvar res = base.apply(this, args);\n\n\t\t\t\t\thelpers.each(array._chartjs.listeners, function(object) {\n\t\t\t\t\t\tif (typeof object[method] === 'function') {\n\t\t\t\t\t\t\tobject[method].apply(object, args);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Removes the given array event listener and cleanup extra attached properties (such as\n\t * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n\t */\n\tfunction unlistenArrayEvents(array, listener) {\n\t\tvar stub = array._chartjs;\n\t\tif (!stub) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar listeners = stub.listeners;\n\t\tvar index = listeners.indexOf(listener);\n\t\tif (index !== -1) {\n\t\t\tlisteners.splice(index, 1);\n\t\t}\n\n\t\tif (listeners.length > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tarrayEvents.forEach(function(key) {\n\t\t\tdelete array[key];\n\t\t});\n\n\t\tdelete array._chartjs;\n\t}\n\n\t// Base class for all dataset controllers (line, bar, etc)\n\tChart.DatasetController = function(chart, datasetIndex) {\n\t\tthis.initialize(chart, datasetIndex);\n\t};\n\n\thelpers.extend(Chart.DatasetController.prototype, {\n\n\t\t/**\n\t\t * Element type used to generate a meta dataset (e.g. Chart.element.Line).\n\t\t * @type {Chart.core.element}\n\t\t */\n\t\tdatasetElementType: null,\n\n\t\t/**\n\t\t * Element type used to generate a meta data (e.g. Chart.element.Point).\n\t\t * @type {Chart.core.element}\n\t\t */\n\t\tdataElementType: null,\n\n\t\tinitialize: function(chart, datasetIndex) {\n\t\t\tvar me = this;\n\t\t\tme.chart = chart;\n\t\t\tme.index = datasetIndex;\n\t\t\tme.linkScales();\n\t\t\tme.addElements();\n\t\t},\n\n\t\tupdateIndex: function(datasetIndex) {\n\t\t\tthis.index = datasetIndex;\n\t\t},\n\n\t\tlinkScales: function() {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar dataset = me.getDataset();\n\n\t\t\tif (meta.xAxisID === null || !(meta.xAxisID in me.chart.scales)) {\n\t\t\t\tmeta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;\n\t\t\t}\n\t\t\tif (meta.yAxisID === null || !(meta.yAxisID in me.chart.scales)) {\n\t\t\t\tmeta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;\n\t\t\t}\n\t\t},\n\n\t\tgetDataset: function() {\n\t\t\treturn this.chart.data.datasets[this.index];\n\t\t},\n\n\t\tgetMeta: function() {\n\t\t\treturn this.chart.getDatasetMeta(this.index);\n\t\t},\n\n\t\tgetScaleForId: function(scaleID) {\n\t\t\treturn this.chart.scales[scaleID];\n\t\t},\n\n\t\treset: function() {\n\t\t\tthis.update(true);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tdestroy: function() {\n\t\t\tif (this._data) {\n\t\t\t\tunlistenArrayEvents(this._data, this);\n\t\t\t}\n\t\t},\n\n\t\tcreateMetaDataset: function() {\n\t\t\tvar me = this;\n\t\t\tvar type = me.datasetElementType;\n\t\t\treturn type && new type({\n\t\t\t\t_chart: me.chart,\n\t\t\t\t_datasetIndex: me.index\n\t\t\t});\n\t\t},\n\n\t\tcreateMetaData: function(index) {\n\t\t\tvar me = this;\n\t\t\tvar type = me.dataElementType;\n\t\t\treturn type && new type({\n\t\t\t\t_chart: me.chart,\n\t\t\t\t_datasetIndex: me.index,\n\t\t\t\t_index: index\n\t\t\t});\n\t\t},\n\n\t\taddElements: function() {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar data = me.getDataset().data || [];\n\t\t\tvar metaData = meta.data;\n\t\t\tvar i, ilen;\n\n\t\t\tfor (i = 0, ilen = data.length; i < ilen; ++i) {\n\t\t\t\tmetaData[i] = metaData[i] || me.createMetaData(i);\n\t\t\t}\n\n\t\t\tmeta.dataset = meta.dataset || me.createMetaDataset();\n\t\t},\n\n\t\taddElementAndReset: function(index) {\n\t\t\tvar element = this.createMetaData(index);\n\t\t\tthis.getMeta().data.splice(index, 0, element);\n\t\t\tthis.updateElement(element, index, true);\n\t\t},\n\n\t\tbuildOrUpdateElements: function() {\n\t\t\tvar me = this;\n\t\t\tvar dataset = me.getDataset();\n\t\t\tvar data = dataset.data || (dataset.data = []);\n\n\t\t\t// In order to correctly handle data addition/deletion animation (an thus simulate\n\t\t\t// real-time charts), we need to monitor these data modifications and synchronize\n\t\t\t// the internal meta data accordingly.\n\t\t\tif (me._data !== data) {\n\t\t\t\tif (me._data) {\n\t\t\t\t\t// This case happens when the user replaced the data array instance.\n\t\t\t\t\tunlistenArrayEvents(me._data, me);\n\t\t\t\t}\n\n\t\t\t\tlistenArrayEvents(data, me);\n\t\t\t\tme._data = data;\n\t\t\t}\n\n\t\t\t// Re-sync meta data in case the user replaced the data array or if we missed\n\t\t\t// any updates and so make sure that we handle number of datapoints changing.\n\t\t\tme.resyncElements();\n\t\t},\n\n\t\tupdate: helpers.noop,\n\n\t\ttransition: function(easingValue) {\n\t\t\tvar meta = this.getMeta();\n\t\t\tvar elements = meta.data || [];\n\t\t\tvar ilen = elements.length;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < ilen; ++i) {\n\t\t\t\telements[i].transition(easingValue);\n\t\t\t}\n\n\t\t\tif (meta.dataset) {\n\t\t\t\tmeta.dataset.transition(easingValue);\n\t\t\t}\n\t\t},\n\n\t\tdraw: function() {\n\t\t\tvar meta = this.getMeta();\n\t\t\tvar elements = meta.data || [];\n\t\t\tvar ilen = elements.length;\n\t\t\tvar i = 0;\n\n\t\t\tif (meta.dataset) {\n\t\t\t\tmeta.dataset.draw();\n\t\t\t}\n\n\t\t\tfor (; i < ilen; ++i) {\n\t\t\t\telements[i].draw();\n\t\t\t}\n\t\t},\n\n\t\tremoveHoverStyle: function(element, elementOpts) {\n\t\t\tvar dataset = this.chart.data.datasets[element._datasetIndex];\n\t\t\tvar index = element._index;\n\t\t\tvar custom = element.custom || {};\n\t\t\tvar valueOrDefault = helpers.valueAtIndexOrDefault;\n\t\t\tvar model = element._model;\n\n\t\t\tmodel.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);\n\t\t\tmodel.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);\n\t\t\tmodel.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);\n\t\t},\n\n\t\tsetHoverStyle: function(element) {\n\t\t\tvar dataset = this.chart.data.datasets[element._datasetIndex];\n\t\t\tvar index = element._index;\n\t\t\tvar custom = element.custom || {};\n\t\t\tvar valueOrDefault = helpers.valueAtIndexOrDefault;\n\t\t\tvar getHoverColor = helpers.getHoverColor;\n\t\t\tvar model = element._model;\n\n\t\t\tmodel.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));\n\t\t\tmodel.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));\n\t\t\tmodel.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tresyncElements: function() {\n\t\t\tvar me = this;\n\t\t\tvar meta = me.getMeta();\n\t\t\tvar data = me.getDataset().data;\n\t\t\tvar numMeta = meta.data.length;\n\t\t\tvar numData = data.length;\n\n\t\t\tif (numData < numMeta) {\n\t\t\t\tmeta.data.splice(numData, numMeta - numData);\n\t\t\t} else if (numData > numMeta) {\n\t\t\t\tme.insertElements(numMeta, numData - numMeta);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tinsertElements: function(start, count) {\n\t\t\tfor (var i = 0; i < count; ++i) {\n\t\t\t\tthis.addElementAndReset(start + i);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tonDataPush: function() {\n\t\t\tthis.insertElements(this.getDataset().data.length - 1, arguments.length);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tonDataPop: function() {\n\t\t\tthis.getMeta().data.pop();\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tonDataShift: function() {\n\t\t\tthis.getMeta().data.shift();\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tonDataSplice: function(start, count) {\n\t\t\tthis.getMeta().data.splice(start, count);\n\t\t\tthis.insertElements(start, arguments.length - 2);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tonDataUnshift: function() {\n\t\t\tthis.insertElements(0, arguments.length);\n\t\t}\n\t});\n\n\tChart.DatasetController.extend = helpers.inherits;\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.datasetController.js?");
  162. /***/ }),
  163. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js":
  164. /*!*******************************************************************************************!*\
  165. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js ***!
  166. \*******************************************************************************************/
  167. /*! no static exports found */
  168. /***/ (function(module, exports, __webpack_require__) {
  169. "use strict";
  170. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nmodule.exports = {\n\t/**\n\t * @private\n\t */\n\t_set: function(scope, values) {\n\t\treturn helpers.merge(this[scope] || (this[scope] = {}), values);\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js?");
  171. /***/ }),
  172. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js":
  173. /*!******************************************************************************************!*\
  174. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js ***!
  175. \******************************************************************************************/
  176. /*! no static exports found */
  177. /***/ (function(module, exports, __webpack_require__) {
  178. "use strict";
  179. eval("\n\nvar color = __webpack_require__(/*! chartjs-color */ \"./node_modules/.pnpm/chartjs-color@2.4.1/node_modules/chartjs-color/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nfunction interpolate(start, view, model, ease) {\n\tvar keys = Object.keys(model);\n\tvar i, ilen, key, actual, origin, target, type, c0, c1;\n\n\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\n\t\tkey = keys[i];\n\n\t\ttarget = model[key];\n\n\t\t// if a value is added to the model after pivot() has been called, the view\n\t\t// doesn't contain it, so let's initialize the view to the target value.\n\t\tif (!view.hasOwnProperty(key)) {\n\t\t\tview[key] = target;\n\t\t}\n\n\t\tactual = view[key];\n\n\t\tif (actual === target || key[0] === '_') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!start.hasOwnProperty(key)) {\n\t\t\tstart[key] = actual;\n\t\t}\n\n\t\torigin = start[key];\n\n\t\ttype = typeof target;\n\n\t\tif (type === typeof origin) {\n\t\t\tif (type === 'string') {\n\t\t\t\tc0 = color(origin);\n\t\t\t\tif (c0.valid) {\n\t\t\t\t\tc1 = color(target);\n\t\t\t\t\tif (c1.valid) {\n\t\t\t\t\t\tview[key] = c1.mix(c0, ease).rgbString();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (type === 'number' && isFinite(origin) && isFinite(target)) {\n\t\t\t\tview[key] = origin + (target - origin) * ease;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tview[key] = target;\n\t}\n}\n\nvar Element = function(configuration) {\n\thelpers.extend(this, configuration);\n\tthis.initialize.apply(this, arguments);\n};\n\nhelpers.extend(Element.prototype, {\n\n\tinitialize: function() {\n\t\tthis.hidden = false;\n\t},\n\n\tpivot: function() {\n\t\tvar me = this;\n\t\tif (!me._view) {\n\t\t\tme._view = helpers.clone(me._model);\n\t\t}\n\t\tme._start = {};\n\t\treturn me;\n\t},\n\n\ttransition: function(ease) {\n\t\tvar me = this;\n\t\tvar model = me._model;\n\t\tvar start = me._start;\n\t\tvar view = me._view;\n\n\t\t// No animation -> No Transition\n\t\tif (!model || ease === 1) {\n\t\t\tme._view = model;\n\t\t\tme._start = null;\n\t\t\treturn me;\n\t\t}\n\n\t\tif (!view) {\n\t\t\tview = me._view = {};\n\t\t}\n\n\t\tif (!start) {\n\t\t\tstart = me._start = {};\n\t\t}\n\n\t\tinterpolate(start, view, model, ease);\n\n\t\treturn me;\n\t},\n\n\ttooltipPosition: function() {\n\t\treturn {\n\t\t\tx: this._model.x,\n\t\t\ty: this._model.y\n\t\t};\n\t},\n\n\thasValue: function() {\n\t\treturn helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y);\n\t}\n});\n\nElement.extend = helpers.inherits;\n\nmodule.exports = Element;\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js?");
  180. /***/ }),
  181. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.helpers.js":
  182. /*!******************************************************************************************!*\
  183. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.helpers.js ***!
  184. \******************************************************************************************/
  185. /*! no static exports found */
  186. /***/ (function(module, exports, __webpack_require__) {
  187. "use strict";
  188. eval("/* global window: false */\n/* global document: false */\n\n\nvar color = __webpack_require__(/*! chartjs-color */ \"./node_modules/.pnpm/chartjs-color@2.4.1/node_modules/chartjs-color/index.js\");\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nmodule.exports = function(Chart) {\n\n\t// -- Basic js utility methods\n\n\thelpers.configMerge = function(/* objects ... */) {\n\t\treturn helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), {\n\t\t\tmerger: function(key, target, source, options) {\n\t\t\t\tvar tval = target[key] || {};\n\t\t\t\tvar sval = source[key];\n\n\t\t\t\tif (key === 'scales') {\n\t\t\t\t\t// scale config merging is complex. Add our own function here for that\n\t\t\t\t\ttarget[key] = helpers.scaleMerge(tval, sval);\n\t\t\t\t} else if (key === 'scale') {\n\t\t\t\t\t// used in polar area & radar charts since there is only one scale\n\t\t\t\t\ttarget[key] = helpers.merge(tval, [Chart.scaleService.getScaleDefaults(sval.type), sval]);\n\t\t\t\t} else {\n\t\t\t\t\thelpers._merger(key, target, source, options);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\thelpers.scaleMerge = function(/* objects ... */) {\n\t\treturn helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), {\n\t\t\tmerger: function(key, target, source, options) {\n\t\t\t\tif (key === 'xAxes' || key === 'yAxes') {\n\t\t\t\t\tvar slen = source[key].length;\n\t\t\t\t\tvar i, type, scale;\n\n\t\t\t\t\tif (!target[key]) {\n\t\t\t\t\t\ttarget[key] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (i = 0; i < slen; ++i) {\n\t\t\t\t\t\tscale = source[key][i];\n\t\t\t\t\t\ttype = helpers.valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');\n\n\t\t\t\t\t\tif (i >= target[key].length) {\n\t\t\t\t\t\t\ttarget[key].push({});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {\n\t\t\t\t\t\t\t// new/untyped scale or type changed: let's apply the new defaults\n\t\t\t\t\t\t\t// then merge source scale to correctly overwrite the defaults.\n\t\t\t\t\t\t\thelpers.merge(target[key][i], [Chart.scaleService.getScaleDefaults(type), scale]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// scales type are the same\n\t\t\t\t\t\t\thelpers.merge(target[key][i], scale);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thelpers._merger(key, target, source, options);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\thelpers.where = function(collection, filterCallback) {\n\t\tif (helpers.isArray(collection) && Array.prototype.filter) {\n\t\t\treturn collection.filter(filterCallback);\n\t\t}\n\t\tvar filtered = [];\n\n\t\thelpers.each(collection, function(item) {\n\t\t\tif (filterCallback(item)) {\n\t\t\t\tfiltered.push(item);\n\t\t\t}\n\t\t});\n\n\t\treturn filtered;\n\t};\n\thelpers.findIndex = Array.prototype.findIndex ?\n\t\tfunction(array, callback, scope) {\n\t\t\treturn array.findIndex(callback, scope);\n\t\t} :\n\t\tfunction(array, callback, scope) {\n\t\t\tscope = scope === undefined ? array : scope;\n\t\t\tfor (var i = 0, ilen = array.length; i < ilen; ++i) {\n\t\t\t\tif (callback.call(scope, array[i], i, array)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t};\n\thelpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {\n\t\t// Default to start of the array\n\t\tif (helpers.isNullOrUndef(startIndex)) {\n\t\t\tstartIndex = -1;\n\t\t}\n\t\tfor (var i = startIndex + 1; i < arrayToSearch.length; i++) {\n\t\t\tvar currentItem = arrayToSearch[i];\n\t\t\tif (filterCallback(currentItem)) {\n\t\t\t\treturn currentItem;\n\t\t\t}\n\t\t}\n\t};\n\thelpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {\n\t\t// Default to end of the array\n\t\tif (helpers.isNullOrUndef(startIndex)) {\n\t\t\tstartIndex = arrayToSearch.length;\n\t\t}\n\t\tfor (var i = startIndex - 1; i >= 0; i--) {\n\t\t\tvar currentItem = arrayToSearch[i];\n\t\t\tif (filterCallback(currentItem)) {\n\t\t\t\treturn currentItem;\n\t\t\t}\n\t\t}\n\t};\n\n\t// -- Math methods\n\thelpers.isNumber = function(n) {\n\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\n\t};\n\thelpers.almostEquals = function(x, y, epsilon) {\n\t\treturn Math.abs(x - y) < epsilon;\n\t};\n\thelpers.almostWhole = function(x, epsilon) {\n\t\tvar rounded = Math.round(x);\n\t\treturn (((rounded - epsilon) < x) && ((rounded + epsilon) > x));\n\t};\n\thelpers.max = function(array) {\n\t\treturn array.reduce(function(max, value) {\n\t\t\tif (!isNaN(value)) {\n\t\t\t\treturn Math.max(max, value);\n\t\t\t}\n\t\t\treturn max;\n\t\t}, Number.NEGATIVE_INFINITY);\n\t};\n\thelpers.min = function(array) {\n\t\treturn array.reduce(function(min, value) {\n\t\t\tif (!isNaN(value)) {\n\t\t\t\treturn Math.min(min, value);\n\t\t\t}\n\t\t\treturn min;\n\t\t}, Number.POSITIVE_INFINITY);\n\t};\n\thelpers.sign = Math.sign ?\n\t\tfunction(x) {\n\t\t\treturn Math.sign(x);\n\t\t} :\n\t\tfunction(x) {\n\t\t\tx = +x; // convert to a number\n\t\t\tif (x === 0 || isNaN(x)) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\treturn x > 0 ? 1 : -1;\n\t\t};\n\thelpers.log10 = Math.log10 ?\n\t\tfunction(x) {\n\t\t\treturn Math.log10(x);\n\t\t} :\n\t\tfunction(x) {\n\t\t\tvar exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.\n\t\t\t// Check for whole powers of 10,\n\t\t\t// which due to floating point rounding error should be corrected.\n\t\t\tvar powerOf10 = Math.round(exponent);\n\t\t\tvar isPowerOf10 = x === Math.pow(10, powerOf10);\n\n\t\t\treturn isPowerOf10 ? powerOf10 : exponent;\n\t\t};\n\thelpers.toRadians = function(degrees) {\n\t\treturn degrees * (Math.PI / 180);\n\t};\n\thelpers.toDegrees = function(radians) {\n\t\treturn radians * (180 / Math.PI);\n\t};\n\t// Gets the angle from vertical upright to the point about a centre.\n\thelpers.getAngleFromPoint = function(centrePoint, anglePoint) {\n\t\tvar distanceFromXCenter = anglePoint.x - centrePoint.x;\n\t\tvar distanceFromYCenter = anglePoint.y - centrePoint.y;\n\t\tvar radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n\t\tvar angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n\t\tif (angle < (-0.5 * Math.PI)) {\n\t\t\tangle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n\t\t}\n\n\t\treturn {\n\t\t\tangle: angle,\n\t\t\tdistance: radialDistanceFromCenter\n\t\t};\n\t};\n\thelpers.distanceBetweenPoints = function(pt1, pt2) {\n\t\treturn Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n\t};\n\thelpers.aliasPixel = function(pixelWidth) {\n\t\treturn (pixelWidth % 2 === 0) ? 0 : 0.5;\n\t};\n\thelpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {\n\t\t// Props to Rob Spencer at scaled innovation for his post on splining between points\n\t\t// http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n\t\t// This function must also respect \"skipped\" points\n\n\t\tvar previous = firstPoint.skip ? middlePoint : firstPoint;\n\t\tvar current = middlePoint;\n\t\tvar next = afterPoint.skip ? middlePoint : afterPoint;\n\n\t\tvar d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));\n\t\tvar d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));\n\n\t\tvar s01 = d01 / (d01 + d12);\n\t\tvar s12 = d12 / (d01 + d12);\n\n\t\t// If all points are the same, s01 & s02 will be inf\n\t\ts01 = isNaN(s01) ? 0 : s01;\n\t\ts12 = isNaN(s12) ? 0 : s12;\n\n\t\tvar fa = t * s01; // scaling factor for triangle Ta\n\t\tvar fb = t * s12;\n\n\t\treturn {\n\t\t\tprevious: {\n\t\t\t\tx: current.x - fa * (next.x - previous.x),\n\t\t\t\ty: current.y - fa * (next.y - previous.y)\n\t\t\t},\n\t\t\tnext: {\n\t\t\t\tx: current.x + fb * (next.x - previous.x),\n\t\t\t\ty: current.y + fb * (next.y - previous.y)\n\t\t\t}\n\t\t};\n\t};\n\thelpers.EPSILON = Number.EPSILON || 1e-14;\n\thelpers.splineCurveMonotone = function(points) {\n\t\t// This function calculates Bézier control points in a similar way than |splineCurve|,\n\t\t// but preserves monotonicity of the provided data and ensures no local extremums are added\n\t\t// between the dataset discrete points due to the interpolation.\n\t\t// See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n\n\t\tvar pointsWithTangents = (points || []).map(function(point) {\n\t\t\treturn {\n\t\t\t\tmodel: point._model,\n\t\t\t\tdeltaK: 0,\n\t\t\t\tmK: 0\n\t\t\t};\n\t\t});\n\n\t\t// Calculate slopes (deltaK) and initialize tangents (mK)\n\t\tvar pointsLen = pointsWithTangents.length;\n\t\tvar i, pointBefore, pointCurrent, pointAfter;\n\t\tfor (i = 0; i < pointsLen; ++i) {\n\t\t\tpointCurrent = pointsWithTangents[i];\n\t\t\tif (pointCurrent.model.skip) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n\t\t\tpointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n\t\t\tif (pointAfter && !pointAfter.model.skip) {\n\t\t\t\tvar slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);\n\n\t\t\t\t// In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n\t\t\t\tpointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;\n\t\t\t}\n\n\t\t\tif (!pointBefore || pointBefore.model.skip) {\n\t\t\t\tpointCurrent.mK = pointCurrent.deltaK;\n\t\t\t} else if (!pointAfter || pointAfter.model.skip) {\n\t\t\t\tpointCurrent.mK = pointBefore.deltaK;\n\t\t\t} else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {\n\t\t\t\tpointCurrent.mK = 0;\n\t\t\t} else {\n\t\t\t\tpointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;\n\t\t\t}\n\t\t}\n\n\t\t// Adjust tangents to ensure monotonic properties\n\t\tvar alphaK, betaK, tauK, squaredMagnitude;\n\t\tfor (i = 0; i < pointsLen - 1; ++i) {\n\t\t\tpointCurrent = pointsWithTangents[i];\n\t\t\tpointAfter = pointsWithTangents[i + 1];\n\t\t\tif (pointCurrent.model.skip || pointAfter.model.skip) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (helpers.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {\n\t\t\t\tpointCurrent.mK = pointAfter.mK = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\talphaK = pointCurrent.mK / pointCurrent.deltaK;\n\t\t\tbetaK = pointAfter.mK / pointCurrent.deltaK;\n\t\t\tsquaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n\t\t\tif (squaredMagnitude <= 9) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttauK = 3 / Math.sqrt(squaredMagnitude);\n\t\t\tpointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;\n\t\t\tpointAfter.mK = betaK * tauK * pointCurrent.deltaK;\n\t\t}\n\n\t\t// Compute control points\n\t\tvar deltaX;\n\t\tfor (i = 0; i < pointsLen; ++i) {\n\t\t\tpointCurrent = pointsWithTangents[i];\n\t\t\tif (pointCurrent.model.skip) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n\t\t\tpointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n\t\t\tif (pointBefore && !pointBefore.model.skip) {\n\t\t\t\tdeltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;\n\t\t\t\tpointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;\n\t\t\t\tpointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;\n\t\t\t}\n\t\t\tif (pointAfter && !pointAfter.model.skip) {\n\t\t\t\tdeltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;\n\t\t\t\tpointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;\n\t\t\t\tpointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;\n\t\t\t}\n\t\t}\n\t};\n\thelpers.nextItem = function(collection, index, loop) {\n\t\tif (loop) {\n\t\t\treturn index >= collection.length - 1 ? collection[0] : collection[index + 1];\n\t\t}\n\t\treturn index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];\n\t};\n\thelpers.previousItem = function(collection, index, loop) {\n\t\tif (loop) {\n\t\t\treturn index <= 0 ? collection[collection.length - 1] : collection[index - 1];\n\t\t}\n\t\treturn index <= 0 ? collection[0] : collection[index - 1];\n\t};\n\t// Implementation of the nice number algorithm used in determining where axis labels will go\n\thelpers.niceNum = function(range, round) {\n\t\tvar exponent = Math.floor(helpers.log10(range));\n\t\tvar fraction = range / Math.pow(10, exponent);\n\t\tvar niceFraction;\n\n\t\tif (round) {\n\t\t\tif (fraction < 1.5) {\n\t\t\t\tniceFraction = 1;\n\t\t\t} else if (fraction < 3) {\n\t\t\t\tniceFraction = 2;\n\t\t\t} else if (fraction < 7) {\n\t\t\t\tniceFraction = 5;\n\t\t\t} else {\n\t\t\t\tniceFraction = 10;\n\t\t\t}\n\t\t} else if (fraction <= 1.0) {\n\t\t\tniceFraction = 1;\n\t\t} else if (fraction <= 2) {\n\t\t\tniceFraction = 2;\n\t\t} else if (fraction <= 5) {\n\t\t\tniceFraction = 5;\n\t\t} else {\n\t\t\tniceFraction = 10;\n\t\t}\n\n\t\treturn niceFraction * Math.pow(10, exponent);\n\t};\n\t// Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n\thelpers.requestAnimFrame = (function() {\n\t\tif (typeof window === 'undefined') {\n\t\t\treturn function(callback) {\n\t\t\t\tcallback();\n\t\t\t};\n\t\t}\n\t\treturn window.requestAnimationFrame ||\n\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\twindow.oRequestAnimationFrame ||\n\t\t\twindow.msRequestAnimationFrame ||\n\t\t\tfunction(callback) {\n\t\t\t\treturn window.setTimeout(callback, 1000 / 60);\n\t\t\t};\n\t}());\n\t// -- DOM methods\n\thelpers.getRelativePosition = function(evt, chart) {\n\t\tvar mouseX, mouseY;\n\t\tvar e = evt.originalEvent || evt;\n\t\tvar canvas = evt.currentTarget || evt.srcElement;\n\t\tvar boundingRect = canvas.getBoundingClientRect();\n\n\t\tvar touches = e.touches;\n\t\tif (touches && touches.length > 0) {\n\t\t\tmouseX = touches[0].clientX;\n\t\t\tmouseY = touches[0].clientY;\n\n\t\t} else {\n\t\t\tmouseX = e.clientX;\n\t\t\tmouseY = e.clientY;\n\t\t}\n\n\t\t// Scale mouse coordinates into canvas coordinates\n\t\t// by following the pattern laid out by 'jerryj' in the comments of\n\t\t// http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/\n\t\tvar paddingLeft = parseFloat(helpers.getStyle(canvas, 'padding-left'));\n\t\tvar paddingTop = parseFloat(helpers.getStyle(canvas, 'padding-top'));\n\t\tvar paddingRight = parseFloat(helpers.getStyle(canvas, 'padding-right'));\n\t\tvar paddingBottom = parseFloat(helpers.getStyle(canvas, 'padding-bottom'));\n\t\tvar width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;\n\t\tvar height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;\n\n\t\t// We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However\n\t\t// the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here\n\t\tmouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);\n\t\tmouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);\n\n\t\treturn {\n\t\t\tx: mouseX,\n\t\t\ty: mouseY\n\t\t};\n\n\t};\n\n\t// Private helper function to convert max-width/max-height values that may be percentages into a number\n\tfunction parseMaxStyle(styleValue, node, parentProperty) {\n\t\tvar valueInPixels;\n\t\tif (typeof styleValue === 'string') {\n\t\t\tvalueInPixels = parseInt(styleValue, 10);\n\n\t\t\tif (styleValue.indexOf('%') !== -1) {\n\t\t\t\t// percentage * size in dimension\n\t\t\t\tvalueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n\t\t\t}\n\t\t} else {\n\t\t\tvalueInPixels = styleValue;\n\t\t}\n\n\t\treturn valueInPixels;\n\t}\n\n\t/**\n\t * Returns if the given value contains an effective constraint.\n\t * @private\n\t */\n\tfunction isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}\n\n\t// Private helper to get a constraint dimension\n\t// @param domNode : the node to check the constraint on\n\t// @param maxStyle : the style that defines the maximum for the direction we are using (maxWidth / maxHeight)\n\t// @param percentageProperty : property of parent to use when calculating width as a percentage\n\t// @see http://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser\n\tfunction getConstraintDimension(domNode, maxStyle, percentageProperty) {\n\t\tvar view = document.defaultView;\n\t\tvar parentNode = domNode.parentNode;\n\t\tvar constrainedNode = view.getComputedStyle(domNode)[maxStyle];\n\t\tvar constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];\n\t\tvar hasCNode = isConstrainedValue(constrainedNode);\n\t\tvar hasCContainer = isConstrainedValue(constrainedContainer);\n\t\tvar infinity = Number.POSITIVE_INFINITY;\n\n\t\tif (hasCNode || hasCContainer) {\n\t\t\treturn Math.min(\n\t\t\t\thasCNode ? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,\n\t\t\t\thasCContainer ? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);\n\t\t}\n\n\t\treturn 'none';\n\t}\n\t// returns Number or undefined if no constraint\n\thelpers.getConstraintWidth = function(domNode) {\n\t\treturn getConstraintDimension(domNode, 'max-width', 'clientWidth');\n\t};\n\t// returns Number or undefined if no constraint\n\thelpers.getConstraintHeight = function(domNode) {\n\t\treturn getConstraintDimension(domNode, 'max-height', 'clientHeight');\n\t};\n\thelpers.getMaximumWidth = function(domNode) {\n\t\tvar container = domNode.parentNode;\n\t\tif (!container) {\n\t\t\treturn domNode.clientWidth;\n\t\t}\n\n\t\tvar paddingLeft = parseInt(helpers.getStyle(container, 'padding-left'), 10);\n\t\tvar paddingRight = parseInt(helpers.getStyle(container, 'padding-right'), 10);\n\t\tvar w = container.clientWidth - paddingLeft - paddingRight;\n\t\tvar cw = helpers.getConstraintWidth(domNode);\n\t\treturn isNaN(cw) ? w : Math.min(w, cw);\n\t};\n\thelpers.getMaximumHeight = function(domNode) {\n\t\tvar container = domNode.parentNode;\n\t\tif (!container) {\n\t\t\treturn domNode.clientHeight;\n\t\t}\n\n\t\tvar paddingTop = parseInt(helpers.getStyle(container, 'padding-top'), 10);\n\t\tvar paddingBottom = parseInt(helpers.getStyle(container, 'padding-bottom'), 10);\n\t\tvar h = container.clientHeight - paddingTop - paddingBottom;\n\t\tvar ch = helpers.getConstraintHeight(domNode);\n\t\treturn isNaN(ch) ? h : Math.min(h, ch);\n\t};\n\thelpers.getStyle = function(el, property) {\n\t\treturn el.currentStyle ?\n\t\t\tel.currentStyle[property] :\n\t\t\tdocument.defaultView.getComputedStyle(el, null).getPropertyValue(property);\n\t};\n\thelpers.retinaScale = function(chart, forceRatio) {\n\t\tvar pixelRatio = chart.currentDevicePixelRatio = forceRatio || window.devicePixelRatio || 1;\n\t\tif (pixelRatio === 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar canvas = chart.canvas;\n\t\tvar height = chart.height;\n\t\tvar width = chart.width;\n\n\t\tcanvas.height = height * pixelRatio;\n\t\tcanvas.width = width * pixelRatio;\n\t\tchart.ctx.scale(pixelRatio, pixelRatio);\n\n\t\t// If no style has been set on the canvas, the render size is used as display size,\n\t\t// making the chart visually bigger, so let's enforce it to the \"correct\" values.\n\t\t// See https://github.com/chartjs/Chart.js/issues/3575\n\t\tif (!canvas.style.height && !canvas.style.width) {\n\t\t\tcanvas.style.height = height + 'px';\n\t\t\tcanvas.style.width = width + 'px';\n\t\t}\n\t};\n\t// -- Canvas methods\n\thelpers.fontString = function(pixelSize, fontStyle, fontFamily) {\n\t\treturn fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n\t};\n\thelpers.longestText = function(ctx, font, arrayOfThings, cache) {\n\t\tcache = cache || {};\n\t\tvar data = cache.data = cache.data || {};\n\t\tvar gc = cache.garbageCollect = cache.garbageCollect || [];\n\n\t\tif (cache.font !== font) {\n\t\t\tdata = cache.data = {};\n\t\t\tgc = cache.garbageCollect = [];\n\t\t\tcache.font = font;\n\t\t}\n\n\t\tctx.font = font;\n\t\tvar longest = 0;\n\t\thelpers.each(arrayOfThings, function(thing) {\n\t\t\t// Undefined strings and arrays should not be measured\n\t\t\tif (thing !== undefined && thing !== null && helpers.isArray(thing) !== true) {\n\t\t\t\tlongest = helpers.measureText(ctx, data, gc, longest, thing);\n\t\t\t} else if (helpers.isArray(thing)) {\n\t\t\t\t// if it is an array lets measure each element\n\t\t\t\t// to do maybe simplify this function a bit so we can do this more recursively?\n\t\t\t\thelpers.each(thing, function(nestedThing) {\n\t\t\t\t\t// Undefined strings and arrays should not be measured\n\t\t\t\t\tif (nestedThing !== undefined && nestedThing !== null && !helpers.isArray(nestedThing)) {\n\t\t\t\t\t\tlongest = helpers.measureText(ctx, data, gc, longest, nestedThing);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tvar gcLen = gc.length / 2;\n\t\tif (gcLen > arrayOfThings.length) {\n\t\t\tfor (var i = 0; i < gcLen; i++) {\n\t\t\t\tdelete data[gc[i]];\n\t\t\t}\n\t\t\tgc.splice(0, gcLen);\n\t\t}\n\t\treturn longest;\n\t};\n\thelpers.measureText = function(ctx, data, gc, longest, string) {\n\t\tvar textWidth = data[string];\n\t\tif (!textWidth) {\n\t\t\ttextWidth = data[string] = ctx.measureText(string).width;\n\t\t\tgc.push(string);\n\t\t}\n\t\tif (textWidth > longest) {\n\t\t\tlongest = textWidth;\n\t\t}\n\t\treturn longest;\n\t};\n\thelpers.numberOfLabelLines = function(arrayOfThings) {\n\t\tvar numberOfLines = 1;\n\t\thelpers.each(arrayOfThings, function(thing) {\n\t\t\tif (helpers.isArray(thing)) {\n\t\t\t\tif (thing.length > numberOfLines) {\n\t\t\t\t\tnumberOfLines = thing.length;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn numberOfLines;\n\t};\n\n\thelpers.color = !color ?\n\t\tfunction(value) {\n\t\t\tconsole.error('Color.js not found!');\n\t\t\treturn value;\n\t\t} :\n\t\tfunction(value) {\n\t\t\t/* global CanvasGradient */\n\t\t\tif (value instanceof CanvasGradient) {\n\t\t\t\tvalue = defaults.global.defaultColor;\n\t\t\t}\n\n\t\t\treturn color(value);\n\t\t};\n\n\thelpers.getHoverColor = function(colorValue) {\n\t\t/* global CanvasPattern */\n\t\treturn (colorValue instanceof CanvasPattern) ?\n\t\t\tcolorValue :\n\t\t\thelpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();\n\t};\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.helpers.js?");
  189. /***/ }),
  190. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.interaction.js":
  191. /*!**********************************************************************************************!*\
  192. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.interaction.js ***!
  193. \**********************************************************************************************/
  194. /*! no static exports found */
  195. /***/ (function(module, exports, __webpack_require__) {
  196. "use strict";
  197. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\n/**\n * Helper function to get relative position for an event\n * @param {Event|IEvent} event - The event to get the position for\n * @param {Chart} chart - The chart\n * @returns {Point} the event position\n */\nfunction getRelativePosition(e, chart) {\n\tif (e.native) {\n\t\treturn {\n\t\t\tx: e.x,\n\t\t\ty: e.y\n\t\t};\n\t}\n\n\treturn helpers.getRelativePosition(e, chart);\n}\n\n/**\n * Helper function to traverse all of the visible elements in the chart\n * @param chart {chart} the chart\n * @param handler {Function} the callback to execute for each visible item\n */\nfunction parseVisibleItems(chart, handler) {\n\tvar datasets = chart.data.datasets;\n\tvar meta, i, j, ilen, jlen;\n\n\tfor (i = 0, ilen = datasets.length; i < ilen; ++i) {\n\t\tif (!chart.isDatasetVisible(i)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tmeta = chart.getDatasetMeta(i);\n\t\tfor (j = 0, jlen = meta.data.length; j < jlen; ++j) {\n\t\t\tvar element = meta.data[j];\n\t\t\tif (!element._view.skip) {\n\t\t\t\thandler(element);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param items {ChartElement[]} elements to filter\n * @param position {Point} the point to be nearest to\n * @return {ChartElement[]} the nearest items\n */\nfunction getIntersectItems(chart, position) {\n\tvar elements = [];\n\n\tparseVisibleItems(chart, function(element) {\n\t\tif (element.inRange(position.x, position.y)) {\n\t\t\telements.push(element);\n\t\t}\n\t});\n\n\treturn elements;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\n * @param chart {Chart} the chart to look at elements from\n * @param position {Point} the point to be nearest to\n * @param intersect {Boolean} if true, only consider items that intersect the position\n * @param distanceMetric {Function} function to provide the distance between points\n * @return {ChartElement[]} the nearest items\n */\nfunction getNearestItems(chart, position, intersect, distanceMetric) {\n\tvar minDistance = Number.POSITIVE_INFINITY;\n\tvar nearestItems = [];\n\n\tparseVisibleItems(chart, function(element) {\n\t\tif (intersect && !element.inRange(position.x, position.y)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar center = element.getCenterPoint();\n\t\tvar distance = distanceMetric(position, center);\n\n\t\tif (distance < minDistance) {\n\t\t\tnearestItems = [element];\n\t\t\tminDistance = distance;\n\t\t} else if (distance === minDistance) {\n\t\t\t// Can have multiple items at the same distance in which case we sort by size\n\t\t\tnearestItems.push(element);\n\t\t}\n\t});\n\n\treturn nearestItems;\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {String} axis the axis mode. x|y|xy\n */\nfunction getDistanceMetricForAxis(axis) {\n\tvar useX = axis.indexOf('x') !== -1;\n\tvar useY = axis.indexOf('y') !== -1;\n\n\treturn function(pt1, pt2) {\n\t\tvar deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n\t\tvar deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n\t\treturn Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n\t};\n}\n\nfunction indexMode(chart, e, options) {\n\tvar position = getRelativePosition(e, chart);\n\t// Default axis for index mode is 'x' to match old behaviour\n\toptions.axis = options.axis || 'x';\n\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\n\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n\tvar elements = [];\n\n\tif (!items.length) {\n\t\treturn [];\n\t}\n\n\tchart.data.datasets.forEach(function(dataset, datasetIndex) {\n\t\tif (chart.isDatasetVisible(datasetIndex)) {\n\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\tvar element = meta.data[items[0]._index];\n\n\t\t\t// don't count items that are skipped (null data)\n\t\t\tif (element && !element._view.skip) {\n\t\t\t\telements.push(element);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn elements;\n}\n\n/**\n * @interface IInteractionOptions\n */\n/**\n * If true, only consider items that intersect the point\n * @name IInterfaceOptions#boolean\n * @type Boolean\n */\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nmodule.exports = {\n\t// Helper function for different modes\n\tmodes: {\n\t\tsingle: function(chart, e) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\tvar elements = [];\n\n\t\t\tparseVisibleItems(chart, function(element) {\n\t\t\t\tif (element.inRange(position.x, position.y)) {\n\t\t\t\t\telements.push(element);\n\t\t\t\t\treturn elements;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn elements.slice(0, 1);\n\t\t},\n\n\t\t/**\n\t\t * @function Chart.Interaction.modes.label\n\t\t * @deprecated since version 2.4.0\n\t\t * @todo remove at version 3\n\t\t * @private\n\t\t */\n\t\tlabel: indexMode,\n\n\t\t/**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param chart {chart} the chart we are returning items from\n\t\t * @param e {Event} the event we are find things at\n\t\t * @param options {IInteractionOptions} options to use during interaction\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tindex: indexMode,\n\n\t\t/**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param chart {chart} the chart we are returning items from\n\t\t * @param e {Event} the event we are find things at\n\t\t * @param options {IInteractionOptions} options to use during interaction\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tdataset: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\toptions.axis = options.axis || 'xy';\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\n\t\t\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n\n\t\t\tif (items.length > 0) {\n\t\t\t\titems = chart.getDatasetMeta(items[0]._datasetIndex).data;\n\t\t\t}\n\n\t\t\treturn items;\n\t\t},\n\n\t\t/**\n\t\t * @function Chart.Interaction.modes.x-axis\n\t\t * @deprecated since version 2.4.0. Use index mode and intersect == true\n\t\t * @todo remove at version 3\n\t\t * @private\n\t\t */\n\t\t'x-axis': function(chart, e) {\n\t\t\treturn indexMode(chart, e, {intersect: false});\n\t\t},\n\n\t\t/**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param chart {chart} the chart we are returning items from\n\t\t * @param e {Event} the event we are find things at\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tpoint: function(chart, e) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\treturn getIntersectItems(chart, position);\n\t\t},\n\n\t\t/**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param chart {chart} the chart we are returning items from\n\t\t * @param e {Event} the event we are find things at\n\t\t * @param options {IInteractionOptions} options to use\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tnearest: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\toptions.axis = options.axis || 'xy';\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\n\t\t\tvar nearestItems = getNearestItems(chart, position, options.intersect, distanceMetric);\n\n\t\t\t// We have multiple items at the same distance from the event. Now sort by smallest\n\t\t\tif (nearestItems.length > 1) {\n\t\t\t\tnearestItems.sort(function(a, b) {\n\t\t\t\t\tvar sizeA = a.getArea();\n\t\t\t\t\tvar sizeB = b.getArea();\n\t\t\t\t\tvar ret = sizeA - sizeB;\n\n\t\t\t\t\tif (ret === 0) {\n\t\t\t\t\t\t// if equal sort by dataset index\n\t\t\t\t\t\tret = a._datasetIndex - b._datasetIndex;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ret;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Return only 1 item\n\t\t\treturn nearestItems.slice(0, 1);\n\t\t},\n\n\t\t/**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param chart {chart} the chart we are returning items from\n\t\t * @param e {Event} the event we are find things at\n\t\t * @param options {IInteractionOptions} options to use\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\tx: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\tvar items = [];\n\t\t\tvar intersectsItem = false;\n\n\t\t\tparseVisibleItems(chart, function(element) {\n\t\t\t\tif (element.inXRange(position.x)) {\n\t\t\t\t\titems.push(element);\n\t\t\t\t}\n\n\t\t\t\tif (element.inRange(position.x, position.y)) {\n\t\t\t\t\tintersectsItem = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// If we want to trigger on an intersect and we don't have any items\n\t\t\t// that intersect the position, return nothing\n\t\t\tif (options.intersect && !intersectsItem) {\n\t\t\t\titems = [];\n\t\t\t}\n\t\t\treturn items;\n\t\t},\n\n\t\t/**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param chart {chart} the chart we are returning items from\n\t\t * @param e {Event} the event we are find things at\n\t\t * @param options {IInteractionOptions} options to use\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n\t\t */\n\t\ty: function(chart, e, options) {\n\t\t\tvar position = getRelativePosition(e, chart);\n\t\t\tvar items = [];\n\t\t\tvar intersectsItem = false;\n\n\t\t\tparseVisibleItems(chart, function(element) {\n\t\t\t\tif (element.inYRange(position.y)) {\n\t\t\t\t\titems.push(element);\n\t\t\t\t}\n\n\t\t\t\tif (element.inRange(position.x, position.y)) {\n\t\t\t\t\tintersectsItem = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// If we want to trigger on an intersect and we don't have any items\n\t\t\t// that intersect the position, return nothing\n\t\t\tif (options.intersect && !intersectsItem) {\n\t\t\t\titems = [];\n\t\t\t}\n\t\t\treturn items;\n\t\t}\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.interaction.js?");
  198. /***/ }),
  199. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.js":
  200. /*!**********************************************************************************!*\
  201. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.js ***!
  202. \**********************************************************************************/
  203. /*! no static exports found */
  204. /***/ (function(module, exports, __webpack_require__) {
  205. "use strict";
  206. eval("\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\n\ndefaults._set('global', {\n\tresponsive: true,\n\tresponsiveAnimationDuration: 0,\n\tmaintainAspectRatio: true,\n\tevents: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],\n\thover: {\n\t\tonHover: null,\n\t\tmode: 'nearest',\n\t\tintersect: true,\n\t\tanimationDuration: 400\n\t},\n\tonClick: null,\n\tdefaultColor: 'rgba(0,0,0,0.1)',\n\tdefaultFontColor: '#666',\n\tdefaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n\tdefaultFontSize: 12,\n\tdefaultFontStyle: 'normal',\n\tshowLines: true,\n\n\t// Element defaults defined in element extensions\n\telements: {},\n\n\t// Layout options such as padding\n\tlayout: {\n\t\tpadding: {\n\t\t\ttop: 0,\n\t\t\tright: 0,\n\t\t\tbottom: 0,\n\t\t\tleft: 0\n\t\t}\n\t}\n});\n\nmodule.exports = function() {\n\n\t// Occupy the global variable of Chart, and create a simple base class\n\tvar Chart = function(item, config) {\n\t\tthis.construct(item, config);\n\t\treturn this;\n\t};\n\n\tChart.Chart = Chart;\n\n\treturn Chart;\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.js?");
  207. /***/ }),
  208. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js":
  209. /*!******************************************************************************************!*\
  210. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js ***!
  211. \******************************************************************************************/
  212. /*! no static exports found */
  213. /***/ (function(module, exports, __webpack_require__) {
  214. "use strict";
  215. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nfunction filterByPosition(array, position) {\n\treturn helpers.where(array, function(v) {\n\t\treturn v.position === position;\n\t});\n}\n\nfunction sortByWeight(array, reverse) {\n\tarray.forEach(function(v, i) {\n\t\tv._tmpIndex_ = i;\n\t\treturn v;\n\t});\n\tarray.sort(function(a, b) {\n\t\tvar v0 = reverse ? b : a;\n\t\tvar v1 = reverse ? a : b;\n\t\treturn v0.weight === v1.weight ?\n\t\t\tv0._tmpIndex_ - v1._tmpIndex_ :\n\t\t\tv0.weight - v1.weight;\n\t});\n\tarray.forEach(function(v) {\n\t\tdelete v._tmpIndex_;\n\t});\n}\n\n/**\n * @interface ILayoutItem\n * @prop {String} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {Number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {Boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\n * @prop {Function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {Function} update - Takes two parameters: width and height. Returns size of item\n * @prop {Function} getPadding - Returns an object with padding on the edges\n * @prop {Number} width - Width of item. Must be valid after update()\n * @prop {Number} height - Height of item. Must be valid after update()\n * @prop {Number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nmodule.exports = {\n\tdefaults: {},\n\n\t/**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {ILayoutItem} item - the item to add to be layed out\n\t */\n\taddBox: function(chart, item) {\n\t\tif (!chart.boxes) {\n\t\t\tchart.boxes = [];\n\t\t}\n\n\t\t// initialize item with default values\n\t\titem.fullWidth = item.fullWidth || false;\n\t\titem.position = item.position || 'top';\n\t\titem.weight = item.weight || 0;\n\n\t\tchart.boxes.push(item);\n\t},\n\n\t/**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {Object} layoutItem - the item to remove from the layout\n\t */\n\tremoveBox: function(chart, layoutItem) {\n\t\tvar index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n\t\tif (index !== -1) {\n\t\t\tchart.boxes.splice(index, 1);\n\t\t}\n\t},\n\n\t/**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {Object} item - the item to configure with the given options\n\t * @param {Object} options - the new item options.\n\t */\n\tconfigure: function(chart, item, options) {\n\t\tvar props = ['fullWidth', 'position', 'weight'];\n\t\tvar ilen = props.length;\n\t\tvar i = 0;\n\t\tvar prop;\n\n\t\tfor (; i < ilen; ++i) {\n\t\t\tprop = props[i];\n\t\t\tif (options.hasOwnProperty(prop)) {\n\t\t\t\titem[prop] = options[prop];\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {Number} width - the width to fit into\n\t * @param {Number} height - the height to fit into\n\t */\n\tupdate: function(chart, width, height) {\n\t\tif (!chart) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar layoutOptions = chart.options.layout || {};\n\t\tvar padding = helpers.options.toPadding(layoutOptions.padding);\n\t\tvar leftPadding = padding.left;\n\t\tvar rightPadding = padding.right;\n\t\tvar topPadding = padding.top;\n\t\tvar bottomPadding = padding.bottom;\n\n\t\tvar leftBoxes = filterByPosition(chart.boxes, 'left');\n\t\tvar rightBoxes = filterByPosition(chart.boxes, 'right');\n\t\tvar topBoxes = filterByPosition(chart.boxes, 'top');\n\t\tvar bottomBoxes = filterByPosition(chart.boxes, 'bottom');\n\t\tvar chartAreaBoxes = filterByPosition(chart.boxes, 'chartArea');\n\n\t\t// Sort boxes by weight. A higher weight is further away from the chart area\n\t\tsortByWeight(leftBoxes, true);\n\t\tsortByWeight(rightBoxes, false);\n\t\tsortByWeight(topBoxes, true);\n\t\tsortByWeight(bottomBoxes, false);\n\n\t\t// Essentially we now have any number of boxes on each of the 4 sides.\n\t\t// Our canvas looks like the following.\n\t\t// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n\t\t// B1 is the bottom axis\n\t\t// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n\t\t// These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n\t\t// an error will be thrown.\n\t\t//\n\t\t// |----------------------------------------------------|\n\t\t// | T1 (Full Width) |\n\t\t// |----------------------------------------------------|\n\t\t// | | | T2 | |\n\t\t// | |----|-------------------------------------|----|\n\t\t// | | | C1 | | C2 | |\n\t\t// | | |----| |----| |\n\t\t// | | | | |\n\t\t// | L1 | L2 | ChartArea (C0) | R1 |\n\t\t// | | | | |\n\t\t// | | |----| |----| |\n\t\t// | | | C3 | | C4 | |\n\t\t// | |----|-------------------------------------|----|\n\t\t// | | | B1 | |\n\t\t// |----------------------------------------------------|\n\t\t// | B2 (Full Width) |\n\t\t// |----------------------------------------------------|\n\t\t//\n\t\t// What we do to find the best sizing, we do the following\n\t\t// 1. Determine the minimum size of the chart area.\n\t\t// 2. Split the remaining width equally between each vertical axis\n\t\t// 3. Split the remaining height equally between each horizontal axis\n\t\t// 4. Give each layout the maximum size it can be. The layout will return it's minimum size\n\t\t// 5. Adjust the sizes of each axis based on it's minimum reported size.\n\t\t// 6. Refit each axis\n\t\t// 7. Position each axis in the final location\n\t\t// 8. Tell the chart the final location of the chart area\n\t\t// 9. Tell any axes that overlay the chart area the positions of the chart area\n\n\t\t// Step 1\n\t\tvar chartWidth = width - leftPadding - rightPadding;\n\t\tvar chartHeight = height - topPadding - bottomPadding;\n\t\tvar chartAreaWidth = chartWidth / 2; // min 50%\n\t\tvar chartAreaHeight = chartHeight / 2; // min 50%\n\n\t\t// Step 2\n\t\tvar verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);\n\n\t\t// Step 3\n\t\tvar horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);\n\n\t\t// Step 4\n\t\tvar maxChartAreaWidth = chartWidth;\n\t\tvar maxChartAreaHeight = chartHeight;\n\t\tvar minBoxSizes = [];\n\n\t\tfunction getMinimumBoxSize(box) {\n\t\t\tvar minSize;\n\t\t\tvar isHorizontal = box.isHorizontal();\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tminSize = box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);\n\t\t\t\tmaxChartAreaHeight -= minSize.height;\n\t\t\t} else {\n\t\t\t\tminSize = box.update(verticalBoxWidth, maxChartAreaHeight);\n\t\t\t\tmaxChartAreaWidth -= minSize.width;\n\t\t\t}\n\n\t\t\tminBoxSizes.push({\n\t\t\t\thorizontal: isHorizontal,\n\t\t\t\tminSize: minSize,\n\t\t\t\tbox: box,\n\t\t\t});\n\t\t}\n\n\t\thelpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);\n\n\t\t// If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)\n\t\tvar maxHorizontalLeftPadding = 0;\n\t\tvar maxHorizontalRightPadding = 0;\n\t\tvar maxVerticalTopPadding = 0;\n\t\tvar maxVerticalBottomPadding = 0;\n\n\t\thelpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {\n\t\t\tif (horizontalBox.getPadding) {\n\t\t\t\tvar boxPadding = horizontalBox.getPadding();\n\t\t\t\tmaxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);\n\t\t\t\tmaxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);\n\t\t\t}\n\t\t});\n\n\t\thelpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {\n\t\t\tif (verticalBox.getPadding) {\n\t\t\t\tvar boxPadding = verticalBox.getPadding();\n\t\t\t\tmaxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);\n\t\t\t\tmaxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);\n\t\t\t}\n\t\t});\n\n\t\t// At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could\n\t\t// be if the axes are drawn at their minimum sizes.\n\t\t// Steps 5 & 6\n\t\tvar totalLeftBoxesWidth = leftPadding;\n\t\tvar totalRightBoxesWidth = rightPadding;\n\t\tvar totalTopBoxesHeight = topPadding;\n\t\tvar totalBottomBoxesHeight = bottomPadding;\n\n\t\t// Function to fit a box\n\t\tfunction fitBox(box) {\n\t\t\tvar minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {\n\t\t\t\treturn minBox.box === box;\n\t\t\t});\n\n\t\t\tif (minBoxSize) {\n\t\t\t\tif (box.isHorizontal()) {\n\t\t\t\t\tvar scaleMargin = {\n\t\t\t\t\t\tleft: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),\n\t\t\t\t\t\tright: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tbottom: 0\n\t\t\t\t\t};\n\n\t\t\t\t\t// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends\n\t\t\t\t\t// on the margin. Sometimes they need to increase in size slightly\n\t\t\t\t\tbox.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);\n\t\t\t\t} else {\n\t\t\t\t\tbox.update(minBoxSize.minSize.width, maxChartAreaHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update, and calculate the left and right margins for the horizontal boxes\n\t\thelpers.each(leftBoxes.concat(rightBoxes), fitBox);\n\n\t\thelpers.each(leftBoxes, function(box) {\n\t\t\ttotalLeftBoxesWidth += box.width;\n\t\t});\n\n\t\thelpers.each(rightBoxes, function(box) {\n\t\t\ttotalRightBoxesWidth += box.width;\n\t\t});\n\n\t\t// Set the Left and Right margins for the horizontal boxes\n\t\thelpers.each(topBoxes.concat(bottomBoxes), fitBox);\n\n\t\t// Figure out how much margin is on the top and bottom of the vertical boxes\n\t\thelpers.each(topBoxes, function(box) {\n\t\t\ttotalTopBoxesHeight += box.height;\n\t\t});\n\n\t\thelpers.each(bottomBoxes, function(box) {\n\t\t\ttotalBottomBoxesHeight += box.height;\n\t\t});\n\n\t\tfunction finalFitVerticalBox(box) {\n\t\t\tvar minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {\n\t\t\t\treturn minSize.box === box;\n\t\t\t});\n\n\t\t\tvar scaleMargin = {\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\ttop: totalTopBoxesHeight,\n\t\t\t\tbottom: totalBottomBoxesHeight\n\t\t\t};\n\n\t\t\tif (minBoxSize) {\n\t\t\t\tbox.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);\n\t\t\t}\n\t\t}\n\n\t\t// Let the left layout know the final margin\n\t\thelpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);\n\n\t\t// Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)\n\t\ttotalLeftBoxesWidth = leftPadding;\n\t\ttotalRightBoxesWidth = rightPadding;\n\t\ttotalTopBoxesHeight = topPadding;\n\t\ttotalBottomBoxesHeight = bottomPadding;\n\n\t\thelpers.each(leftBoxes, function(box) {\n\t\t\ttotalLeftBoxesWidth += box.width;\n\t\t});\n\n\t\thelpers.each(rightBoxes, function(box) {\n\t\t\ttotalRightBoxesWidth += box.width;\n\t\t});\n\n\t\thelpers.each(topBoxes, function(box) {\n\t\t\ttotalTopBoxesHeight += box.height;\n\t\t});\n\t\thelpers.each(bottomBoxes, function(box) {\n\t\t\ttotalBottomBoxesHeight += box.height;\n\t\t});\n\n\t\t// We may be adding some padding to account for rotated x axis labels\n\t\tvar leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);\n\t\ttotalLeftBoxesWidth += leftPaddingAddition;\n\t\ttotalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);\n\n\t\tvar topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);\n\t\ttotalTopBoxesHeight += topPaddingAddition;\n\t\ttotalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);\n\n\t\t// Figure out if our chart area changed. This would occur if the dataset layout label rotation\n\t\t// changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do\n\t\t// without calling `fit` again\n\t\tvar newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;\n\t\tvar newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;\n\n\t\tif (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {\n\t\t\thelpers.each(leftBoxes, function(box) {\n\t\t\t\tbox.height = newMaxChartAreaHeight;\n\t\t\t});\n\n\t\t\thelpers.each(rightBoxes, function(box) {\n\t\t\t\tbox.height = newMaxChartAreaHeight;\n\t\t\t});\n\n\t\t\thelpers.each(topBoxes, function(box) {\n\t\t\t\tif (!box.fullWidth) {\n\t\t\t\t\tbox.width = newMaxChartAreaWidth;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\thelpers.each(bottomBoxes, function(box) {\n\t\t\t\tif (!box.fullWidth) {\n\t\t\t\t\tbox.width = newMaxChartAreaWidth;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmaxChartAreaHeight = newMaxChartAreaHeight;\n\t\t\tmaxChartAreaWidth = newMaxChartAreaWidth;\n\t\t}\n\n\t\t// Step 7 - Position the boxes\n\t\tvar left = leftPadding + leftPaddingAddition;\n\t\tvar top = topPadding + topPaddingAddition;\n\n\t\tfunction placeBox(box) {\n\t\t\tif (box.isHorizontal()) {\n\t\t\t\tbox.left = box.fullWidth ? leftPadding : totalLeftBoxesWidth;\n\t\t\t\tbox.right = box.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;\n\t\t\t\tbox.top = top;\n\t\t\t\tbox.bottom = top + box.height;\n\n\t\t\t\t// Move to next point\n\t\t\t\ttop = box.bottom;\n\n\t\t\t} else {\n\n\t\t\t\tbox.left = left;\n\t\t\t\tbox.right = left + box.width;\n\t\t\t\tbox.top = totalTopBoxesHeight;\n\t\t\t\tbox.bottom = totalTopBoxesHeight + maxChartAreaHeight;\n\n\t\t\t\t// Move to next point\n\t\t\t\tleft = box.right;\n\t\t\t}\n\t\t}\n\n\t\thelpers.each(leftBoxes.concat(topBoxes), placeBox);\n\n\t\t// Account for chart width and height\n\t\tleft += maxChartAreaWidth;\n\t\ttop += maxChartAreaHeight;\n\n\t\thelpers.each(rightBoxes, placeBox);\n\t\thelpers.each(bottomBoxes, placeBox);\n\n\t\t// Step 8\n\t\tchart.chartArea = {\n\t\t\tleft: totalLeftBoxesWidth,\n\t\t\ttop: totalTopBoxesHeight,\n\t\t\tright: totalLeftBoxesWidth + maxChartAreaWidth,\n\t\t\tbottom: totalTopBoxesHeight + maxChartAreaHeight\n\t\t};\n\n\t\t// Step 9\n\t\thelpers.each(chartAreaBoxes, function(box) {\n\t\t\tbox.left = chart.chartArea.left;\n\t\t\tbox.top = chart.chartArea.top;\n\t\t\tbox.right = chart.chartArea.right;\n\t\t\tbox.bottom = chart.chartArea.bottom;\n\n\t\t\tbox.update(maxChartAreaWidth, maxChartAreaHeight);\n\t\t});\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js?");
  216. /***/ }),
  217. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.plugins.js":
  218. /*!******************************************************************************************!*\
  219. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.plugins.js ***!
  220. \******************************************************************************************/
  221. /*! no static exports found */
  222. /***/ (function(module, exports, __webpack_require__) {
  223. "use strict";
  224. eval("\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('global', {\n\tplugins: {}\n});\n\n/**\n * The plugin service singleton\n * @namespace Chart.plugins\n * @since 2.1.0\n */\nmodule.exports = {\n\t/**\n\t * Globally registered plugins.\n\t * @private\n\t */\n\t_plugins: [],\n\n\t/**\n\t * This identifier is used to invalidate the descriptors cache attached to each chart\n\t * when a global plugin is registered or unregistered. In this case, the cache ID is\n\t * incremented and descriptors are regenerated during following API calls.\n\t * @private\n\t */\n\t_cacheId: 0,\n\n\t/**\n\t * Registers the given plugin(s) if not already registered.\n\t * @param {Array|Object} plugins plugin instance(s).\n\t */\n\tregister: function(plugins) {\n\t\tvar p = this._plugins;\n\t\t([]).concat(plugins).forEach(function(plugin) {\n\t\t\tif (p.indexOf(plugin) === -1) {\n\t\t\t\tp.push(plugin);\n\t\t\t}\n\t\t});\n\n\t\tthis._cacheId++;\n\t},\n\n\t/**\n\t * Unregisters the given plugin(s) only if registered.\n\t * @param {Array|Object} plugins plugin instance(s).\n\t */\n\tunregister: function(plugins) {\n\t\tvar p = this._plugins;\n\t\t([]).concat(plugins).forEach(function(plugin) {\n\t\t\tvar idx = p.indexOf(plugin);\n\t\t\tif (idx !== -1) {\n\t\t\t\tp.splice(idx, 1);\n\t\t\t}\n\t\t});\n\n\t\tthis._cacheId++;\n\t},\n\n\t/**\n\t * Remove all registered plugins.\n\t * @since 2.1.5\n\t */\n\tclear: function() {\n\t\tthis._plugins = [];\n\t\tthis._cacheId++;\n\t},\n\n\t/**\n\t * Returns the number of registered plugins?\n\t * @returns {Number}\n\t * @since 2.1.5\n\t */\n\tcount: function() {\n\t\treturn this._plugins.length;\n\t},\n\n\t/**\n\t * Returns all registered plugin instances.\n\t * @returns {Array} array of plugin objects.\n\t * @since 2.1.5\n\t */\n\tgetAll: function() {\n\t\treturn this._plugins;\n\t},\n\n\t/**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Object} chart - The chart instance for which plugins should be called.\n\t * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Array} [args] - Extra arguments to apply to the hook call.\n\t * @returns {Boolean} false if any of the plugins return false, else returns true.\n\t */\n\tnotify: function(chart, hook, args) {\n\t\tvar descriptors = this.descriptors(chart);\n\t\tvar ilen = descriptors.length;\n\t\tvar i, descriptor, plugin, params, method;\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\tdescriptor = descriptors[i];\n\t\t\tplugin = descriptor.plugin;\n\t\t\tmethod = plugin[hook];\n\t\t\tif (typeof method === 'function') {\n\t\t\t\tparams = [chart].concat(args || []);\n\t\t\t\tparams.push(descriptor.options);\n\t\t\t\tif (method.apply(plugin, params) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Returns descriptors of enabled plugins for the given chart.\n\t * @returns {Array} [{ plugin, options }]\n\t * @private\n\t */\n\tdescriptors: function(chart) {\n\t\tvar cache = chart.$plugins || (chart.$plugins = {});\n\t\tif (cache.id === this._cacheId) {\n\t\t\treturn cache.descriptors;\n\t\t}\n\n\t\tvar plugins = [];\n\t\tvar descriptors = [];\n\t\tvar config = (chart && chart.config) || {};\n\t\tvar options = (config.options && config.options.plugins) || {};\n\n\t\tthis._plugins.concat(config.plugins || []).forEach(function(plugin) {\n\t\t\tvar idx = plugins.indexOf(plugin);\n\t\t\tif (idx !== -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar id = plugin.id;\n\t\t\tvar opts = options[id];\n\t\t\tif (opts === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (opts === true) {\n\t\t\t\topts = helpers.clone(defaults.global.plugins[id]);\n\t\t\t}\n\n\t\t\tplugins.push(plugin);\n\t\t\tdescriptors.push({\n\t\t\t\tplugin: plugin,\n\t\t\t\toptions: opts || {}\n\t\t\t});\n\t\t});\n\n\t\tcache.descriptors = descriptors;\n\t\tcache.id = this._cacheId;\n\t\treturn descriptors;\n\t},\n\n\t/**\n\t * Invalidates cache for the given chart: descriptors hold a reference on plugin option,\n\t * but in some cases, this reference can be changed by the user when updating options.\n\t * https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n\t * @private\n\t */\n\t_invalidate: function(chart) {\n\t\tdelete chart.$plugins;\n\t}\n};\n\n/**\n * Plugin extension hooks.\n * @interface IPlugin\n * @since 2.1.0\n */\n/**\n * @method IPlugin#beforeInit\n * @desc Called before initializing `chart`.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#afterInit\n * @desc Called after `chart` has been initialized and before the first update.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeUpdate\n * @desc Called before updating `chart`. If any plugin returns `false`, the update\n * is cancelled (and thus subsequent render(s)) until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart update.\n */\n/**\n * @method IPlugin#afterUpdate\n * @desc Called after `chart` has been updated and before rendering. Note that this\n * hook will not be called if the chart update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeDatasetsUpdate\n * @desc Called before updating the `chart` datasets. If any plugin returns `false`,\n * the datasets update is cancelled until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} false to cancel the datasets update.\n * @since version 2.1.5\n*/\n/**\n * @method IPlugin#afterDatasetsUpdate\n * @desc Called after the `chart` datasets have been updated. Note that this hook\n * will not be called if the datasets update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @since version 2.1.5\n */\n/**\n * @method IPlugin#beforeDatasetUpdate\n * @desc Called before updating the `chart` dataset at the given `args.index`. If any plugin\n * returns `false`, the datasets update is cancelled until another `update` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n/**\n * @method IPlugin#afterDatasetUpdate\n * @desc Called after the `chart` datasets at the given `args.index` has been updated. Note\n * that this hook will not be called if the datasets update has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeLayout\n * @desc Called before laying out `chart`. If any plugin returns `false`,\n * the layout update is cancelled until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart layout.\n */\n/**\n * @method IPlugin#afterLayout\n * @desc Called after the `chart` has been layed out. Note that this hook will not\n * be called if the layout update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeRender\n * @desc Called before rendering `chart`. If any plugin returns `false`,\n * the rendering is cancelled until another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart rendering.\n */\n/**\n * @method IPlugin#afterRender\n * @desc Called after the `chart` has been fully rendered (and animation completed). Note\n * that this hook will not be called if the rendering has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeDraw\n * @desc Called before drawing `chart` at every animation frame specified by the given\n * easing value. If any plugin returns `false`, the frame drawing is cancelled until\n * another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart drawing.\n */\n/**\n * @method IPlugin#afterDraw\n * @desc Called after the `chart` has been drawn for the specific easing value. Note\n * that this hook will not be called if the drawing has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeDatasetsDraw\n * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,\n * the datasets drawing is cancelled until another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n/**\n * @method IPlugin#afterDatasetsDraw\n * @desc Called after the `chart` datasets have been drawn. Note that this hook\n * will not be called if the datasets drawing has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeDatasetDraw\n * @desc Called before drawing the `chart` dataset at the given `args.index` (datasets\n * are drawn in the reverse order). If any plugin returns `false`, the datasets drawing\n * is cancelled until another `render` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n/**\n * @method IPlugin#afterDatasetDraw\n * @desc Called after the `chart` datasets at the given `args.index` have been drawn\n * (datasets are drawn in the reverse order). Note that this hook will not be called\n * if the datasets drawing has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeTooltipDraw\n * @desc Called before drawing the `tooltip`. If any plugin returns `false`,\n * the tooltip drawing is cancelled until another `render` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Object} args.tooltip - The tooltip.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart tooltip drawing.\n */\n/**\n * @method IPlugin#afterTooltipDraw\n * @desc Called after drawing the `tooltip`. Note that this hook will not\n * be called if the tooltip drawing has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Object} args.tooltip - The tooltip.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#beforeEvent\n * @desc Called before processing the specified `event`. If any plugin returns `false`,\n * the event will be discarded.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {IEvent} event - The event object.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#afterEvent\n * @desc Called after the `event` has been consumed. Note that this hook\n * will not be called if the `event` has been previously discarded.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {IEvent} event - The event object.\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#resize\n * @desc Called after the chart as been resized.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} size - The new canvas display size (eq. canvas.style width & height).\n * @param {Object} options - The plugin options.\n */\n/**\n * @method IPlugin#destroy\n * @desc Called after the chart as been destroyed.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.plugins.js?");
  225. /***/ }),
  226. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scale.js":
  227. /*!****************************************************************************************!*\
  228. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scale.js ***!
  229. \****************************************************************************************/
  230. /*! no static exports found */
  231. /***/ (function(module, exports, __webpack_require__) {
  232. "use strict";
  233. eval("\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ./core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar Ticks = __webpack_require__(/*! ./core.ticks */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js\");\n\ndefaults._set('scale', {\n\tdisplay: true,\n\tposition: 'left',\n\toffset: false,\n\n\t// grid line settings\n\tgridLines: {\n\t\tdisplay: true,\n\t\tcolor: 'rgba(0, 0, 0, 0.1)',\n\t\tlineWidth: 1,\n\t\tdrawBorder: true,\n\t\tdrawOnChartArea: true,\n\t\tdrawTicks: true,\n\t\ttickMarkLength: 10,\n\t\tzeroLineWidth: 1,\n\t\tzeroLineColor: 'rgba(0,0,0,0.25)',\n\t\tzeroLineBorderDash: [],\n\t\tzeroLineBorderDashOffset: 0.0,\n\t\toffsetGridLines: false,\n\t\tborderDash: [],\n\t\tborderDashOffset: 0.0\n\t},\n\n\t// scale label\n\tscaleLabel: {\n\t\t// display property\n\t\tdisplay: false,\n\n\t\t// actual label\n\t\tlabelString: '',\n\n\t\t// line height\n\t\tlineHeight: 1.2,\n\n\t\t// top/bottom padding\n\t\tpadding: {\n\t\t\ttop: 4,\n\t\t\tbottom: 4\n\t\t}\n\t},\n\n\t// label settings\n\tticks: {\n\t\tbeginAtZero: false,\n\t\tminRotation: 0,\n\t\tmaxRotation: 50,\n\t\tmirror: false,\n\t\tpadding: 0,\n\t\treverse: false,\n\t\tdisplay: true,\n\t\tautoSkip: true,\n\t\tautoSkipPadding: 0,\n\t\tlabelOffset: 0,\n\t\t// We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n\t\tcallback: Ticks.formatters.values,\n\t\tminor: {},\n\t\tmajor: {}\n\t}\n});\n\nfunction labelsFromTicks(ticks) {\n\tvar labels = [];\n\tvar i, ilen;\n\n\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\n\t\tlabels.push(ticks[i].label);\n\t}\n\n\treturn labels;\n}\n\nfunction getLineValue(scale, index, offsetGridLines) {\n\tvar lineValue = scale.getPixelForTick(index);\n\n\tif (offsetGridLines) {\n\t\tif (index === 0) {\n\t\t\tlineValue -= (scale.getPixelForTick(1) - lineValue) / 2;\n\t\t} else {\n\t\t\tlineValue -= (lineValue - scale.getPixelForTick(index - 1)) / 2;\n\t\t}\n\t}\n\treturn lineValue;\n}\n\nmodule.exports = function(Chart) {\n\n\tfunction computeTextSize(context, tick, font) {\n\t\treturn helpers.isArray(tick) ?\n\t\t\thelpers.longestText(context, font, tick) :\n\t\t\tcontext.measureText(tick).width;\n\t}\n\n\tfunction parseFontOptions(options) {\n\t\tvar valueOrDefault = helpers.valueOrDefault;\n\t\tvar globalDefaults = defaults.global;\n\t\tvar size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\n\t\tvar style = valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle);\n\t\tvar family = valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily);\n\n\t\treturn {\n\t\t\tsize: size,\n\t\t\tstyle: style,\n\t\t\tfamily: family,\n\t\t\tfont: helpers.fontString(size, style, family)\n\t\t};\n\t}\n\n\tfunction parseLineHeight(options) {\n\t\treturn helpers.options.toLineHeight(\n\t\t\thelpers.valueOrDefault(options.lineHeight, 1.2),\n\t\t\thelpers.valueOrDefault(options.fontSize, defaults.global.defaultFontSize));\n\t}\n\n\tChart.Scale = Element.extend({\n\t\t/**\n\t\t * Get the padding needed for the scale\n\t\t * @method getPadding\n\t\t * @private\n\t\t * @returns {Padding} the necessary padding\n\t\t */\n\t\tgetPadding: function() {\n\t\t\tvar me = this;\n\t\t\treturn {\n\t\t\t\tleft: me.paddingLeft || 0,\n\t\t\t\ttop: me.paddingTop || 0,\n\t\t\t\tright: me.paddingRight || 0,\n\t\t\t\tbottom: me.paddingBottom || 0\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Returns the scale tick objects ({label, major})\n\t\t * @since 2.7\n\t\t */\n\t\tgetTicks: function() {\n\t\t\treturn this._ticks;\n\t\t},\n\n\t\t// These methods are ordered by lifecyle. Utilities then follow.\n\t\t// Any function defined here is inherited by all scale types.\n\t\t// Any function can be extended by the scale type\n\n\t\tmergeTicksOptions: function() {\n\t\t\tvar ticks = this.options.ticks;\n\t\t\tif (ticks.minor === false) {\n\t\t\t\tticks.minor = {\n\t\t\t\t\tdisplay: false\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (ticks.major === false) {\n\t\t\t\tticks.major = {\n\t\t\t\t\tdisplay: false\n\t\t\t\t};\n\t\t\t}\n\t\t\tfor (var key in ticks) {\n\t\t\t\tif (key !== 'major' && key !== 'minor') {\n\t\t\t\t\tif (typeof ticks.minor[key] === 'undefined') {\n\t\t\t\t\t\tticks.minor[key] = ticks[key];\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof ticks.major[key] === 'undefined') {\n\t\t\t\t\t\tticks.major[key] = ticks[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tbeforeUpdate: function() {\n\t\t\thelpers.callback(this.options.beforeUpdate, [this]);\n\t\t},\n\t\tupdate: function(maxWidth, maxHeight, margins) {\n\t\t\tvar me = this;\n\t\t\tvar i, ilen, labels, label, ticks, tick;\n\n\t\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n\t\t\tme.beforeUpdate();\n\n\t\t\t// Absorb the master measurements\n\t\t\tme.maxWidth = maxWidth;\n\t\t\tme.maxHeight = maxHeight;\n\t\t\tme.margins = helpers.extend({\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\ttop: 0,\n\t\t\t\tbottom: 0\n\t\t\t}, margins);\n\t\t\tme.longestTextCache = me.longestTextCache || {};\n\n\t\t\t// Dimensions\n\t\t\tme.beforeSetDimensions();\n\t\t\tme.setDimensions();\n\t\t\tme.afterSetDimensions();\n\n\t\t\t// Data min/max\n\t\t\tme.beforeDataLimits();\n\t\t\tme.determineDataLimits();\n\t\t\tme.afterDataLimits();\n\n\t\t\t// Ticks - `this.ticks` is now DEPRECATED!\n\t\t\t// Internal ticks are now stored as objects in the PRIVATE `this._ticks` member\n\t\t\t// and must not be accessed directly from outside this class. `this.ticks` being\n\t\t\t// around for long time and not marked as private, we can't change its structure\n\t\t\t// without unexpected breaking changes. If you need to access the scale ticks,\n\t\t\t// use scale.getTicks() instead.\n\n\t\t\tme.beforeBuildTicks();\n\n\t\t\t// New implementations should return an array of objects but for BACKWARD COMPAT,\n\t\t\t// we still support no return (`this.ticks` internally set by calling this method).\n\t\t\tticks = me.buildTicks() || [];\n\n\t\t\tme.afterBuildTicks();\n\n\t\t\tme.beforeTickToLabelConversion();\n\n\t\t\t// New implementations should return the formatted tick labels but for BACKWARD\n\t\t\t// COMPAT, we still support no return (`this.ticks` internally changed by calling\n\t\t\t// this method and supposed to contain only string values).\n\t\t\tlabels = me.convertTicksToLabels(ticks) || me.ticks;\n\n\t\t\tme.afterTickToLabelConversion();\n\n\t\t\tme.ticks = labels; // BACKWARD COMPATIBILITY\n\n\t\t\t// IMPORTANT: from this point, we consider that `this.ticks` will NEVER change!\n\n\t\t\t// BACKWARD COMPAT: synchronize `_ticks` with labels (so potentially `this.ticks`)\n\t\t\tfor (i = 0, ilen = labels.length; i < ilen; ++i) {\n\t\t\t\tlabel = labels[i];\n\t\t\t\ttick = ticks[i];\n\t\t\t\tif (!tick) {\n\t\t\t\t\tticks.push(tick = {\n\t\t\t\t\t\tlabel: label,\n\t\t\t\t\t\tmajor: false\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\ttick.label = label;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tme._ticks = ticks;\n\n\t\t\t// Tick Rotation\n\t\t\tme.beforeCalculateTickRotation();\n\t\t\tme.calculateTickRotation();\n\t\t\tme.afterCalculateTickRotation();\n\t\t\t// Fit\n\t\t\tme.beforeFit();\n\t\t\tme.fit();\n\t\t\tme.afterFit();\n\t\t\t//\n\t\t\tme.afterUpdate();\n\n\t\t\treturn me.minSize;\n\n\t\t},\n\t\tafterUpdate: function() {\n\t\t\thelpers.callback(this.options.afterUpdate, [this]);\n\t\t},\n\n\t\t//\n\n\t\tbeforeSetDimensions: function() {\n\t\t\thelpers.callback(this.options.beforeSetDimensions, [this]);\n\t\t},\n\t\tsetDimensions: function() {\n\t\t\tvar me = this;\n\t\t\t// Set the unconstrained dimension before label rotation\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\t// Reset position before calculating rotation\n\t\t\t\tme.width = me.maxWidth;\n\t\t\t\tme.left = 0;\n\t\t\t\tme.right = me.width;\n\t\t\t} else {\n\t\t\t\tme.height = me.maxHeight;\n\n\t\t\t\t// Reset position before calculating rotation\n\t\t\t\tme.top = 0;\n\t\t\t\tme.bottom = me.height;\n\t\t\t}\n\n\t\t\t// Reset padding\n\t\t\tme.paddingLeft = 0;\n\t\t\tme.paddingTop = 0;\n\t\t\tme.paddingRight = 0;\n\t\t\tme.paddingBottom = 0;\n\t\t},\n\t\tafterSetDimensions: function() {\n\t\t\thelpers.callback(this.options.afterSetDimensions, [this]);\n\t\t},\n\n\t\t// Data limits\n\t\tbeforeDataLimits: function() {\n\t\t\thelpers.callback(this.options.beforeDataLimits, [this]);\n\t\t},\n\t\tdetermineDataLimits: helpers.noop,\n\t\tafterDataLimits: function() {\n\t\t\thelpers.callback(this.options.afterDataLimits, [this]);\n\t\t},\n\n\t\t//\n\t\tbeforeBuildTicks: function() {\n\t\t\thelpers.callback(this.options.beforeBuildTicks, [this]);\n\t\t},\n\t\tbuildTicks: helpers.noop,\n\t\tafterBuildTicks: function() {\n\t\t\thelpers.callback(this.options.afterBuildTicks, [this]);\n\t\t},\n\n\t\tbeforeTickToLabelConversion: function() {\n\t\t\thelpers.callback(this.options.beforeTickToLabelConversion, [this]);\n\t\t},\n\t\tconvertTicksToLabels: function() {\n\t\t\tvar me = this;\n\t\t\t// Convert ticks to strings\n\t\t\tvar tickOpts = me.options.ticks;\n\t\t\tme.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback, this);\n\t\t},\n\t\tafterTickToLabelConversion: function() {\n\t\t\thelpers.callback(this.options.afterTickToLabelConversion, [this]);\n\t\t},\n\n\t\t//\n\n\t\tbeforeCalculateTickRotation: function() {\n\t\t\thelpers.callback(this.options.beforeCalculateTickRotation, [this]);\n\t\t},\n\t\tcalculateTickRotation: function() {\n\t\t\tvar me = this;\n\t\t\tvar context = me.ctx;\n\t\t\tvar tickOpts = me.options.ticks;\n\t\t\tvar labels = labelsFromTicks(me._ticks);\n\n\t\t\t// Get the width of each grid by calculating the difference\n\t\t\t// between x offsets between 0 and 1.\n\t\t\tvar tickFont = parseFontOptions(tickOpts);\n\t\t\tcontext.font = tickFont.font;\n\n\t\t\tvar labelRotation = tickOpts.minRotation || 0;\n\n\t\t\tif (labels.length && me.options.display && me.isHorizontal()) {\n\t\t\t\tvar originalLabelWidth = helpers.longestText(context, tickFont.font, labels, me.longestTextCache);\n\t\t\t\tvar labelWidth = originalLabelWidth;\n\t\t\t\tvar cosRotation, sinRotation;\n\n\t\t\t\t// Allow 3 pixels x2 padding either side for label readability\n\t\t\t\tvar tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;\n\n\t\t\t\t// Max label rotation can be set or default to 90 - also act as a loop counter\n\t\t\t\twhile (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {\n\t\t\t\t\tvar angleRadians = helpers.toRadians(labelRotation);\n\t\t\t\t\tcosRotation = Math.cos(angleRadians);\n\t\t\t\t\tsinRotation = Math.sin(angleRadians);\n\n\t\t\t\t\tif (sinRotation * originalLabelWidth > me.maxHeight) {\n\t\t\t\t\t\t// go back one step\n\t\t\t\t\t\tlabelRotation--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlabelRotation++;\n\t\t\t\t\tlabelWidth = cosRotation * originalLabelWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tme.labelRotation = labelRotation;\n\t\t},\n\t\tafterCalculateTickRotation: function() {\n\t\t\thelpers.callback(this.options.afterCalculateTickRotation, [this]);\n\t\t},\n\n\t\t//\n\n\t\tbeforeFit: function() {\n\t\t\thelpers.callback(this.options.beforeFit, [this]);\n\t\t},\n\t\tfit: function() {\n\t\t\tvar me = this;\n\t\t\t// Reset\n\t\t\tvar minSize = me.minSize = {\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t};\n\n\t\t\tvar labels = labelsFromTicks(me._ticks);\n\n\t\t\tvar opts = me.options;\n\t\t\tvar tickOpts = opts.ticks;\n\t\t\tvar scaleLabelOpts = opts.scaleLabel;\n\t\t\tvar gridLineOpts = opts.gridLines;\n\t\t\tvar display = opts.display;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\n\t\t\tvar tickFont = parseFontOptions(tickOpts);\n\t\t\tvar tickMarkLength = opts.gridLines.tickMarkLength;\n\n\t\t\t// Width\n\t\t\tif (isHorizontal) {\n\t\t\t\t// subtract the margins to line up with the chartArea if we are a full width scale\n\t\t\t\tminSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;\n\t\t\t} else {\n\t\t\t\tminSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n\t\t\t}\n\n\t\t\t// height\n\t\t\tif (isHorizontal) {\n\t\t\t\tminSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n\t\t\t} else {\n\t\t\t\tminSize.height = me.maxHeight; // fill all the height\n\t\t\t}\n\n\t\t\t// Are we showing a title for the scale?\n\t\t\tif (scaleLabelOpts.display && display) {\n\t\t\t\tvar scaleLabelLineHeight = parseLineHeight(scaleLabelOpts);\n\t\t\t\tvar scaleLabelPadding = helpers.options.toPadding(scaleLabelOpts.padding);\n\t\t\t\tvar deltaHeight = scaleLabelLineHeight + scaleLabelPadding.height;\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tminSize.height += deltaHeight;\n\t\t\t\t} else {\n\t\t\t\t\tminSize.width += deltaHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Don't bother fitting the ticks if we are not showing them\n\t\t\tif (tickOpts.display && display) {\n\t\t\t\tvar largestTextWidth = helpers.longestText(me.ctx, tickFont.font, labels, me.longestTextCache);\n\t\t\t\tvar tallestLabelHeightInLines = helpers.numberOfLabelLines(labels);\n\t\t\t\tvar lineSpace = tickFont.size * 0.5;\n\t\t\t\tvar tickPadding = me.options.ticks.padding;\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\t// A horizontal axis is more constrained by the height.\n\t\t\t\t\tme.longestLabelWidth = largestTextWidth;\n\n\t\t\t\t\tvar angleRadians = helpers.toRadians(me.labelRotation);\n\t\t\t\t\tvar cosRotation = Math.cos(angleRadians);\n\t\t\t\t\tvar sinRotation = Math.sin(angleRadians);\n\n\t\t\t\t\t// TODO - improve this calculation\n\t\t\t\t\tvar labelHeight = (sinRotation * largestTextWidth)\n\t\t\t\t\t\t+ (tickFont.size * tallestLabelHeightInLines)\n\t\t\t\t\t\t+ (lineSpace * (tallestLabelHeightInLines - 1))\n\t\t\t\t\t\t+ lineSpace; // padding\n\n\t\t\t\t\tminSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);\n\n\t\t\t\t\tme.ctx.font = tickFont.font;\n\t\t\t\t\tvar firstLabelWidth = computeTextSize(me.ctx, labels[0], tickFont.font);\n\t\t\t\t\tvar lastLabelWidth = computeTextSize(me.ctx, labels[labels.length - 1], tickFont.font);\n\n\t\t\t\t\t// Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n\t\t\t\t\t// which means that the right padding is dominated by the font height\n\t\t\t\t\tif (me.labelRotation !== 0) {\n\t\t\t\t\t\tme.paddingLeft = opts.position === 'bottom' ? (cosRotation * firstLabelWidth) + 3 : (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges\n\t\t\t\t\t\tme.paddingRight = opts.position === 'bottom' ? (cosRotation * lineSpace) + 3 : (cosRotation * lastLabelWidth) + 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tme.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges\n\t\t\t\t\t\tme.paddingRight = lastLabelWidth / 2 + 3;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// A vertical axis is more constrained by the width. Labels are the\n\t\t\t\t\t// dominant factor here, so get that length first and account for padding\n\t\t\t\t\tif (tickOpts.mirror) {\n\t\t\t\t\t\tlargestTextWidth = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// use lineSpace for consistency with horizontal axis\n\t\t\t\t\t\t// tickPadding is not implemented for horizontal\n\t\t\t\t\t\tlargestTextWidth += tickPadding + lineSpace;\n\t\t\t\t\t}\n\n\t\t\t\t\tminSize.width = Math.min(me.maxWidth, minSize.width + largestTextWidth);\n\n\t\t\t\t\tme.paddingTop = tickFont.size / 2;\n\t\t\t\t\tme.paddingBottom = tickFont.size / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tme.handleMargins();\n\n\t\t\tme.width = minSize.width;\n\t\t\tme.height = minSize.height;\n\t\t},\n\n\t\t/**\n\t\t * Handle margins and padding interactions\n\t\t * @private\n\t\t */\n\t\thandleMargins: function() {\n\t\t\tvar me = this;\n\t\t\tif (me.margins) {\n\t\t\t\tme.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);\n\t\t\t\tme.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);\n\t\t\t\tme.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);\n\t\t\t\tme.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);\n\t\t\t}\n\t\t},\n\n\t\tafterFit: function() {\n\t\t\thelpers.callback(this.options.afterFit, [this]);\n\t\t},\n\n\t\t// Shared Methods\n\t\tisHorizontal: function() {\n\t\t\treturn this.options.position === 'top' || this.options.position === 'bottom';\n\t\t},\n\t\tisFullWidth: function() {\n\t\t\treturn (this.options.fullWidth);\n\t\t},\n\n\t\t// Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not\n\t\tgetRightValue: function(rawValue) {\n\t\t\t// Null and undefined values first\n\t\t\tif (helpers.isNullOrUndef(rawValue)) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\t\t\t// isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values\n\t\t\tif (typeof rawValue === 'number' && !isFinite(rawValue)) {\n\t\t\t\treturn NaN;\n\t\t\t}\n\t\t\t// If it is in fact an object, dive in one more level\n\t\t\tif (rawValue) {\n\t\t\t\tif (this.isHorizontal()) {\n\t\t\t\t\tif (rawValue.x !== undefined) {\n\t\t\t\t\t\treturn this.getRightValue(rawValue.x);\n\t\t\t\t\t}\n\t\t\t\t} else if (rawValue.y !== undefined) {\n\t\t\t\t\treturn this.getRightValue(rawValue.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Value is good, return it\n\t\t\treturn rawValue;\n\t\t},\n\n\t\t/**\n\t\t * Used to get the value to display in the tooltip for the data at the given index\n\t\t * @param index\n\t\t * @param datasetIndex\n\t\t */\n\t\tgetLabelForIndex: helpers.noop,\n\n\t\t/**\n\t\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t\t * @param value\n\t\t * @param index\n\t\t * @param datasetIndex\n\t\t */\n\t\tgetPixelForValue: helpers.noop,\n\n\t\t/**\n\t\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t\t * @param pixel\n\t\t */\n\t\tgetValueForPixel: helpers.noop,\n\n\t\t/**\n\t\t * Returns the location of the tick at the given index\n\t\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t\t */\n\t\tgetPixelForTick: function(index) {\n\t\t\tvar me = this;\n\t\t\tvar offset = me.options.offset;\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tvar innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n\t\t\t\tvar tickWidth = innerWidth / Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n\t\t\t\tvar pixel = (tickWidth * index) + me.paddingLeft;\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tpixel += tickWidth / 2;\n\t\t\t\t}\n\n\t\t\t\tvar finalVal = me.left + Math.round(pixel);\n\t\t\t\tfinalVal += me.isFullWidth() ? me.margins.left : 0;\n\t\t\t\treturn finalVal;\n\t\t\t}\n\t\t\tvar innerHeight = me.height - (me.paddingTop + me.paddingBottom);\n\t\t\treturn me.top + (index * (innerHeight / (me._ticks.length - 1)));\n\t\t},\n\n\t\t/**\n\t\t * Utility for getting the pixel location of a percentage of scale\n\t\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t\t */\n\t\tgetPixelForDecimal: function(decimal) {\n\t\t\tvar me = this;\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tvar innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n\t\t\t\tvar valueOffset = (innerWidth * decimal) + me.paddingLeft;\n\n\t\t\t\tvar finalVal = me.left + Math.round(valueOffset);\n\t\t\t\tfinalVal += me.isFullWidth() ? me.margins.left : 0;\n\t\t\t\treturn finalVal;\n\t\t\t}\n\t\t\treturn me.top + (decimal * me.height);\n\t\t},\n\n\t\t/**\n\t\t * Returns the pixel for the minimum chart value\n\t\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t\t */\n\t\tgetBasePixel: function() {\n\t\t\treturn this.getPixelForValue(this.getBaseValue());\n\t\t},\n\n\t\tgetBaseValue: function() {\n\t\t\tvar me = this;\n\t\t\tvar min = me.min;\n\t\t\tvar max = me.max;\n\n\t\t\treturn me.beginAtZero ? 0 :\n\t\t\t\tmin < 0 && max < 0 ? max :\n\t\t\t\tmin > 0 && max > 0 ? min :\n\t\t\t\t0;\n\t\t},\n\n\t\t/**\n\t\t * Returns a subset of ticks to be plotted to avoid overlapping labels.\n\t\t * @private\n\t\t */\n\t\t_autoSkip: function(ticks) {\n\t\t\tvar skipRatio;\n\t\t\tvar me = this;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\t\t\tvar optionTicks = me.options.ticks.minor;\n\t\t\tvar tickCount = ticks.length;\n\t\t\tvar labelRotationRadians = helpers.toRadians(me.labelRotation);\n\t\t\tvar cosRotation = Math.cos(labelRotationRadians);\n\t\t\tvar longestRotatedLabel = me.longestLabelWidth * cosRotation;\n\t\t\tvar result = [];\n\t\t\tvar i, tick, shouldSkip;\n\n\t\t\t// figure out the maximum number of gridlines to show\n\t\t\tvar maxTicks;\n\t\t\tif (optionTicks.maxTicksLimit) {\n\t\t\t\tmaxTicks = optionTicks.maxTicksLimit;\n\t\t\t}\n\n\t\t\tif (isHorizontal) {\n\t\t\t\tskipRatio = false;\n\n\t\t\t\tif ((longestRotatedLabel + optionTicks.autoSkipPadding) * tickCount > (me.width - (me.paddingLeft + me.paddingRight))) {\n\t\t\t\t\tskipRatio = 1 + Math.floor(((longestRotatedLabel + optionTicks.autoSkipPadding) * tickCount) / (me.width - (me.paddingLeft + me.paddingRight)));\n\t\t\t\t}\n\n\t\t\t\t// if they defined a max number of optionTicks,\n\t\t\t\t// increase skipRatio until that number is met\n\t\t\t\tif (maxTicks && tickCount > maxTicks) {\n\t\t\t\t\tskipRatio = Math.max(skipRatio, Math.floor(tickCount / maxTicks));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = 0; i < tickCount; i++) {\n\t\t\t\ttick = ticks[i];\n\n\t\t\t\t// Since we always show the last tick,we need may need to hide the last shown one before\n\t\t\t\tshouldSkip = (skipRatio > 1 && i % skipRatio > 0) || (i % skipRatio === 0 && i + skipRatio >= tickCount);\n\t\t\t\tif (shouldSkip && i !== tickCount - 1) {\n\t\t\t\t\t// leave tick in place but make sure it's not displayed (#4635)\n\t\t\t\t\tdelete tick.label;\n\t\t\t\t}\n\t\t\t\tresult.push(tick);\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\n\t\t// Actually draw the scale on the canvas\n\t\t// @param {rectangle} chartArea : the area of the chart to draw full grid lines on\n\t\tdraw: function(chartArea) {\n\t\t\tvar me = this;\n\t\t\tvar options = me.options;\n\t\t\tif (!options.display) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar context = me.ctx;\n\t\t\tvar globalDefaults = defaults.global;\n\t\t\tvar optionTicks = options.ticks.minor;\n\t\t\tvar optionMajorTicks = options.ticks.major || optionTicks;\n\t\t\tvar gridLines = options.gridLines;\n\t\t\tvar scaleLabel = options.scaleLabel;\n\n\t\t\tvar isRotated = me.labelRotation !== 0;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\n\t\t\tvar ticks = optionTicks.autoSkip ? me._autoSkip(me.getTicks()) : me.getTicks();\n\t\t\tvar tickFontColor = helpers.valueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor);\n\t\t\tvar tickFont = parseFontOptions(optionTicks);\n\t\t\tvar majorTickFontColor = helpers.valueOrDefault(optionMajorTicks.fontColor, globalDefaults.defaultFontColor);\n\t\t\tvar majorTickFont = parseFontOptions(optionMajorTicks);\n\n\t\t\tvar tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;\n\n\t\t\tvar scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor);\n\t\t\tvar scaleLabelFont = parseFontOptions(scaleLabel);\n\t\t\tvar scaleLabelPadding = helpers.options.toPadding(scaleLabel.padding);\n\t\t\tvar labelRotationRadians = helpers.toRadians(me.labelRotation);\n\n\t\t\tvar itemsToDraw = [];\n\n\t\t\tvar axisWidth = me.options.gridLines.lineWidth;\n\t\t\tvar xTickStart = options.position === 'right' ? me.right : me.right - axisWidth - tl;\n\t\t\tvar xTickEnd = options.position === 'right' ? me.right + tl : me.right;\n\t\t\tvar yTickStart = options.position === 'bottom' ? me.top + axisWidth : me.bottom - tl - axisWidth;\n\t\t\tvar yTickEnd = options.position === 'bottom' ? me.top + axisWidth + tl : me.bottom + axisWidth;\n\n\t\t\thelpers.each(ticks, function(tick, index) {\n\t\t\t\t// autoskipper skipped this tick (#4635)\n\t\t\t\tif (helpers.isNullOrUndef(tick.label)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar label = tick.label;\n\t\t\t\tvar lineWidth, lineColor, borderDash, borderDashOffset;\n\t\t\t\tif (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {\n\t\t\t\t\t// Draw the first index specially\n\t\t\t\t\tlineWidth = gridLines.zeroLineWidth;\n\t\t\t\t\tlineColor = gridLines.zeroLineColor;\n\t\t\t\t\tborderDash = gridLines.zeroLineBorderDash;\n\t\t\t\t\tborderDashOffset = gridLines.zeroLineBorderDashOffset;\n\t\t\t\t} else {\n\t\t\t\t\tlineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, index);\n\t\t\t\t\tlineColor = helpers.valueAtIndexOrDefault(gridLines.color, index);\n\t\t\t\t\tborderDash = helpers.valueOrDefault(gridLines.borderDash, globalDefaults.borderDash);\n\t\t\t\t\tborderDashOffset = helpers.valueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset);\n\t\t\t\t}\n\n\t\t\t\t// Common properties\n\t\t\t\tvar tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY;\n\t\t\t\tvar textAlign = 'middle';\n\t\t\t\tvar textBaseline = 'middle';\n\t\t\t\tvar tickPadding = optionTicks.padding;\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tvar labelYOffset = tl + tickPadding;\n\n\t\t\t\t\tif (options.position === 'bottom') {\n\t\t\t\t\t\t// bottom\n\t\t\t\t\t\ttextBaseline = !isRotated ? 'top' : 'middle';\n\t\t\t\t\t\ttextAlign = !isRotated ? 'center' : 'right';\n\t\t\t\t\t\tlabelY = me.top + labelYOffset;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// top\n\t\t\t\t\t\ttextBaseline = !isRotated ? 'bottom' : 'middle';\n\t\t\t\t\t\ttextAlign = !isRotated ? 'center' : 'left';\n\t\t\t\t\t\tlabelY = me.bottom - labelYOffset;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar xLineValue = getLineValue(me, index, gridLines.offsetGridLines && ticks.length > 1);\n\t\t\t\t\tif (xLineValue < me.left) {\n\t\t\t\t\t\tlineColor = 'rgba(0,0,0,0)';\n\t\t\t\t\t}\n\t\t\t\t\txLineValue += helpers.aliasPixel(lineWidth);\n\n\t\t\t\t\tlabelX = me.getPixelForTick(index) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option)\n\n\t\t\t\t\ttx1 = tx2 = x1 = x2 = xLineValue;\n\t\t\t\t\tty1 = yTickStart;\n\t\t\t\t\tty2 = yTickEnd;\n\t\t\t\t\ty1 = chartArea.top;\n\t\t\t\t\ty2 = chartArea.bottom + axisWidth;\n\t\t\t\t} else {\n\t\t\t\t\tvar isLeft = options.position === 'left';\n\t\t\t\t\tvar labelXOffset;\n\n\t\t\t\t\tif (optionTicks.mirror) {\n\t\t\t\t\t\ttextAlign = isLeft ? 'left' : 'right';\n\t\t\t\t\t\tlabelXOffset = tickPadding;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttextAlign = isLeft ? 'right' : 'left';\n\t\t\t\t\t\tlabelXOffset = tl + tickPadding;\n\t\t\t\t\t}\n\n\t\t\t\t\tlabelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset;\n\n\t\t\t\t\tvar yLineValue = getLineValue(me, index, gridLines.offsetGridLines && ticks.length > 1);\n\t\t\t\t\tif (yLineValue < me.top) {\n\t\t\t\t\t\tlineColor = 'rgba(0,0,0,0)';\n\t\t\t\t\t}\n\t\t\t\t\tyLineValue += helpers.aliasPixel(lineWidth);\n\n\t\t\t\t\tlabelY = me.getPixelForTick(index) + optionTicks.labelOffset;\n\n\t\t\t\t\ttx1 = xTickStart;\n\t\t\t\t\ttx2 = xTickEnd;\n\t\t\t\t\tx1 = chartArea.left;\n\t\t\t\t\tx2 = chartArea.right + axisWidth;\n\t\t\t\t\tty1 = ty2 = y1 = y2 = yLineValue;\n\t\t\t\t}\n\n\t\t\t\titemsToDraw.push({\n\t\t\t\t\ttx1: tx1,\n\t\t\t\t\tty1: ty1,\n\t\t\t\t\ttx2: tx2,\n\t\t\t\t\tty2: ty2,\n\t\t\t\t\tx1: x1,\n\t\t\t\t\ty1: y1,\n\t\t\t\t\tx2: x2,\n\t\t\t\t\ty2: y2,\n\t\t\t\t\tlabelX: labelX,\n\t\t\t\t\tlabelY: labelY,\n\t\t\t\t\tglWidth: lineWidth,\n\t\t\t\t\tglColor: lineColor,\n\t\t\t\t\tglBorderDash: borderDash,\n\t\t\t\t\tglBorderDashOffset: borderDashOffset,\n\t\t\t\t\trotation: -1 * labelRotationRadians,\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tmajor: tick.major,\n\t\t\t\t\ttextBaseline: textBaseline,\n\t\t\t\t\ttextAlign: textAlign\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Draw all of the tick labels, tick marks, and grid lines at the correct places\n\t\t\thelpers.each(itemsToDraw, function(itemToDraw) {\n\t\t\t\tif (gridLines.display) {\n\t\t\t\t\tcontext.save();\n\t\t\t\t\tcontext.lineWidth = itemToDraw.glWidth;\n\t\t\t\t\tcontext.strokeStyle = itemToDraw.glColor;\n\t\t\t\t\tif (context.setLineDash) {\n\t\t\t\t\t\tcontext.setLineDash(itemToDraw.glBorderDash);\n\t\t\t\t\t\tcontext.lineDashOffset = itemToDraw.glBorderDashOffset;\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext.beginPath();\n\n\t\t\t\t\tif (gridLines.drawTicks) {\n\t\t\t\t\t\tcontext.moveTo(itemToDraw.tx1, itemToDraw.ty1);\n\t\t\t\t\t\tcontext.lineTo(itemToDraw.tx2, itemToDraw.ty2);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (gridLines.drawOnChartArea) {\n\t\t\t\t\t\tcontext.moveTo(itemToDraw.x1, itemToDraw.y1);\n\t\t\t\t\t\tcontext.lineTo(itemToDraw.x2, itemToDraw.y2);\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.restore();\n\t\t\t\t}\n\n\t\t\t\tif (optionTicks.display) {\n\t\t\t\t\t// Make sure we draw text in the correct color and font\n\t\t\t\t\tcontext.save();\n\t\t\t\t\tcontext.translate(itemToDraw.labelX, itemToDraw.labelY);\n\t\t\t\t\tcontext.rotate(itemToDraw.rotation);\n\t\t\t\t\tcontext.font = itemToDraw.major ? majorTickFont.font : tickFont.font;\n\t\t\t\t\tcontext.fillStyle = itemToDraw.major ? majorTickFontColor : tickFontColor;\n\t\t\t\t\tcontext.textBaseline = itemToDraw.textBaseline;\n\t\t\t\t\tcontext.textAlign = itemToDraw.textAlign;\n\n\t\t\t\t\tvar label = itemToDraw.label;\n\t\t\t\t\tif (helpers.isArray(label)) {\n\t\t\t\t\t\tvar lineCount = label.length;\n\t\t\t\t\t\tvar lineHeight = tickFont.size * 1.5;\n\t\t\t\t\t\tvar y = me.isHorizontal() ? 0 : -lineHeight * (lineCount - 1) / 2;\n\n\t\t\t\t\t\tfor (var i = 0; i < lineCount; ++i) {\n\t\t\t\t\t\t\t// We just make sure the multiline element is a string here..\n\t\t\t\t\t\t\tcontext.fillText('' + label[i], 0, y);\n\t\t\t\t\t\t\t// apply same lineSpacing as calculated @ L#320\n\t\t\t\t\t\t\ty += lineHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.fillText(label, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t\tcontext.restore();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (scaleLabel.display) {\n\t\t\t\t// Draw the scale label\n\t\t\t\tvar scaleLabelX;\n\t\t\t\tvar scaleLabelY;\n\t\t\t\tvar rotation = 0;\n\t\t\t\tvar halfLineHeight = parseLineHeight(scaleLabel) / 2;\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tscaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width\n\t\t\t\t\tscaleLabelY = options.position === 'bottom'\n\t\t\t\t\t\t? me.bottom - halfLineHeight - scaleLabelPadding.bottom\n\t\t\t\t\t\t: me.top + halfLineHeight + scaleLabelPadding.top;\n\t\t\t\t} else {\n\t\t\t\t\tvar isLeft = options.position === 'left';\n\t\t\t\t\tscaleLabelX = isLeft\n\t\t\t\t\t\t? me.left + halfLineHeight + scaleLabelPadding.top\n\t\t\t\t\t\t: me.right - halfLineHeight - scaleLabelPadding.top;\n\t\t\t\t\tscaleLabelY = me.top + ((me.bottom - me.top) / 2);\n\t\t\t\t\trotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;\n\t\t\t\t}\n\n\t\t\t\tcontext.save();\n\t\t\t\tcontext.translate(scaleLabelX, scaleLabelY);\n\t\t\t\tcontext.rotate(rotation);\n\t\t\t\tcontext.textAlign = 'center';\n\t\t\t\tcontext.textBaseline = 'middle';\n\t\t\t\tcontext.fillStyle = scaleLabelFontColor; // render in correct colour\n\t\t\t\tcontext.font = scaleLabelFont.font;\n\t\t\t\tcontext.fillText(scaleLabel.labelString, 0, 0);\n\t\t\t\tcontext.restore();\n\t\t\t}\n\n\t\t\tif (gridLines.drawBorder) {\n\t\t\t\t// Draw the line at the edge of the axis\n\t\t\t\tcontext.lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, 0);\n\t\t\t\tcontext.strokeStyle = helpers.valueAtIndexOrDefault(gridLines.color, 0);\n\t\t\t\tvar x1 = me.left;\n\t\t\t\tvar x2 = me.right + axisWidth;\n\t\t\t\tvar y1 = me.top;\n\t\t\t\tvar y2 = me.bottom + axisWidth;\n\n\t\t\t\tvar aliasPixel = helpers.aliasPixel(context.lineWidth);\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\ty1 = y2 = options.position === 'top' ? me.bottom : me.top;\n\t\t\t\t\ty1 += aliasPixel;\n\t\t\t\t\ty2 += aliasPixel;\n\t\t\t\t} else {\n\t\t\t\t\tx1 = x2 = options.position === 'left' ? me.right : me.left;\n\t\t\t\t\tx1 += aliasPixel;\n\t\t\t\t\tx2 += aliasPixel;\n\t\t\t\t}\n\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(x1, y1);\n\t\t\t\tcontext.lineTo(x2, y2);\n\t\t\t\tcontext.stroke();\n\t\t\t}\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scale.js?");
  234. /***/ }),
  235. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scaleService.js":
  236. /*!***********************************************************************************************!*\
  237. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scaleService.js ***!
  238. \***********************************************************************************************/
  239. /*! no static exports found */
  240. /***/ (function(module, exports, __webpack_require__) {
  241. "use strict";
  242. eval("\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar layouts = __webpack_require__(/*! ./core.layouts */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js\");\n\nmodule.exports = function(Chart) {\n\n\tChart.scaleService = {\n\t\t// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then\n\t\t// use the new chart options to grab the correct scale\n\t\tconstructors: {},\n\t\t// Use a registration function so that we can move to an ES6 map when we no longer need to support\n\t\t// old browsers\n\n\t\t// Scale config defaults\n\t\tdefaults: {},\n\t\tregisterScaleType: function(type, scaleConstructor, scaleDefaults) {\n\t\t\tthis.constructors[type] = scaleConstructor;\n\t\t\tthis.defaults[type] = helpers.clone(scaleDefaults);\n\t\t},\n\t\tgetScaleConstructor: function(type) {\n\t\t\treturn this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;\n\t\t},\n\t\tgetScaleDefaults: function(type) {\n\t\t\t// Return the scale defaults merged with the global settings so that we always use the latest ones\n\t\t\treturn this.defaults.hasOwnProperty(type) ? helpers.merge({}, [defaults.scale, this.defaults[type]]) : {};\n\t\t},\n\t\tupdateScaleDefaults: function(type, additions) {\n\t\t\tvar me = this;\n\t\t\tif (me.defaults.hasOwnProperty(type)) {\n\t\t\t\tme.defaults[type] = helpers.extend(me.defaults[type], additions);\n\t\t\t}\n\t\t},\n\t\taddScalesToLayout: function(chart) {\n\t\t\t// Adds each scale to the chart.boxes array to be sized accordingly\n\t\t\thelpers.each(chart.scales, function(scale) {\n\t\t\t\t// Set ILayoutItem parameters for backwards compatibility\n\t\t\t\tscale.fullWidth = scale.options.fullWidth;\n\t\t\t\tscale.position = scale.options.position;\n\t\t\t\tscale.weight = scale.options.weight;\n\t\t\t\tlayouts.addBox(chart, scale);\n\t\t\t});\n\t\t}\n\t};\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.scaleService.js?");
  243. /***/ }),
  244. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js":
  245. /*!****************************************************************************************!*\
  246. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js ***!
  247. \****************************************************************************************/
  248. /*! no static exports found */
  249. /***/ (function(module, exports, __webpack_require__) {
  250. "use strict";
  251. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nmodule.exports = {\n\t/**\n\t * Namespace to hold formatters for different types of ticks\n\t * @namespace Chart.Ticks.formatters\n\t */\n\tformatters: {\n\t\t/**\n\t\t * Formatter for value labels\n\t\t * @method Chart.Ticks.formatters.values\n\t\t * @param value the value to display\n\t\t * @return {String|Array} the label to display\n\t\t */\n\t\tvalues: function(value) {\n\t\t\treturn helpers.isArray(value) ? value : '' + value;\n\t\t},\n\n\t\t/**\n\t\t * Formatter for linear numeric ticks\n\t\t * @method Chart.Ticks.formatters.linear\n\t\t * @param tickValue {Number} the value to be formatted\n\t\t * @param index {Number} the position of the tickValue parameter in the ticks array\n\t\t * @param ticks {Array<Number>} the list of ticks being converted\n\t\t * @return {String} string representation of the tickValue parameter\n\t\t */\n\t\tlinear: function(tickValue, index, ticks) {\n\t\t\t// If we have lots of ticks, don't use the ones\n\t\t\tvar delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];\n\n\t\t\t// If we have a number like 2.5 as the delta, figure out how many decimal places we need\n\t\t\tif (Math.abs(delta) > 1) {\n\t\t\t\tif (tickValue !== Math.floor(tickValue)) {\n\t\t\t\t\t// not an integer\n\t\t\t\t\tdelta = tickValue - Math.floor(tickValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar logDelta = helpers.log10(Math.abs(delta));\n\t\t\tvar tickString = '';\n\n\t\t\tif (tickValue !== 0) {\n\t\t\t\tvar numDecimal = -1 * Math.floor(logDelta);\n\t\t\t\tnumDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places\n\t\t\t\ttickString = tickValue.toFixed(numDecimal);\n\t\t\t} else {\n\t\t\t\ttickString = '0'; // never show decimal places for 0\n\t\t\t}\n\n\t\t\treturn tickString;\n\t\t},\n\n\t\tlogarithmic: function(tickValue, index, ticks) {\n\t\t\tvar remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));\n\n\t\t\tif (tickValue === 0) {\n\t\t\t\treturn '0';\n\t\t\t} else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {\n\t\t\t\treturn tickValue.toExponential();\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js?");
  252. /***/ }),
  253. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.tooltip.js":
  254. /*!******************************************************************************************!*\
  255. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.tooltip.js ***!
  256. \******************************************************************************************/
  257. /*! no static exports found */
  258. /***/ (function(module, exports, __webpack_require__) {
  259. "use strict";
  260. eval("\n\nvar defaults = __webpack_require__(/*! ./core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ./core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('global', {\n\ttooltips: {\n\t\tenabled: true,\n\t\tcustom: null,\n\t\tmode: 'nearest',\n\t\tposition: 'average',\n\t\tintersect: true,\n\t\tbackgroundColor: 'rgba(0,0,0,0.8)',\n\t\ttitleFontStyle: 'bold',\n\t\ttitleSpacing: 2,\n\t\ttitleMarginBottom: 6,\n\t\ttitleFontColor: '#fff',\n\t\ttitleAlign: 'left',\n\t\tbodySpacing: 2,\n\t\tbodyFontColor: '#fff',\n\t\tbodyAlign: 'left',\n\t\tfooterFontStyle: 'bold',\n\t\tfooterSpacing: 2,\n\t\tfooterMarginTop: 6,\n\t\tfooterFontColor: '#fff',\n\t\tfooterAlign: 'left',\n\t\tyPadding: 6,\n\t\txPadding: 6,\n\t\tcaretPadding: 2,\n\t\tcaretSize: 5,\n\t\tcornerRadius: 6,\n\t\tmultiKeyBackground: '#fff',\n\t\tdisplayColors: true,\n\t\tborderColor: 'rgba(0,0,0,0)',\n\t\tborderWidth: 0,\n\t\tcallbacks: {\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tbeforeTitle: helpers.noop,\n\t\t\ttitle: function(tooltipItems, data) {\n\t\t\t\t// Pick first xLabel for now\n\t\t\t\tvar title = '';\n\t\t\t\tvar labels = data.labels;\n\t\t\t\tvar labelCount = labels ? labels.length : 0;\n\n\t\t\t\tif (tooltipItems.length > 0) {\n\t\t\t\t\tvar item = tooltipItems[0];\n\n\t\t\t\t\tif (item.xLabel) {\n\t\t\t\t\t\ttitle = item.xLabel;\n\t\t\t\t\t} else if (labelCount > 0 && item.index < labelCount) {\n\t\t\t\t\t\ttitle = labels[item.index];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn title;\n\t\t\t},\n\t\t\tafterTitle: helpers.noop,\n\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tbeforeBody: helpers.noop,\n\n\t\t\t// Args are: (tooltipItem, data)\n\t\t\tbeforeLabel: helpers.noop,\n\t\t\tlabel: function(tooltipItem, data) {\n\t\t\t\tvar label = data.datasets[tooltipItem.datasetIndex].label || '';\n\n\t\t\t\tif (label) {\n\t\t\t\t\tlabel += ': ';\n\t\t\t\t}\n\t\t\t\tlabel += tooltipItem.yLabel;\n\t\t\t\treturn label;\n\t\t\t},\n\t\t\tlabelColor: function(tooltipItem, chart) {\n\t\t\t\tvar meta = chart.getDatasetMeta(tooltipItem.datasetIndex);\n\t\t\t\tvar activeElement = meta.data[tooltipItem.index];\n\t\t\t\tvar view = activeElement._view;\n\t\t\t\treturn {\n\t\t\t\t\tborderColor: view.borderColor,\n\t\t\t\t\tbackgroundColor: view.backgroundColor\n\t\t\t\t};\n\t\t\t},\n\t\t\tlabelTextColor: function() {\n\t\t\t\treturn this._options.bodyFontColor;\n\t\t\t},\n\t\t\tafterLabel: helpers.noop,\n\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tafterBody: helpers.noop,\n\n\t\t\t// Args are: (tooltipItems, data)\n\t\t\tbeforeFooter: helpers.noop,\n\t\t\tfooter: helpers.noop,\n\t\t\tafterFooter: helpers.noop\n\t\t}\n\t}\n});\n\nmodule.exports = function(Chart) {\n\n\t/**\n \t * Helper method to merge the opacity into a color\n \t */\n\tfunction mergeOpacity(colorString, opacity) {\n\t\tvar color = helpers.color(colorString);\n\t\treturn color.alpha(opacity * color.alpha()).rgbaString();\n\t}\n\n\t// Helper to push or concat based on if the 2nd parameter is an array or not\n\tfunction pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}\n\n\t// Private helper to create a tooltip item model\n\t// @param element : the chart element (point, arc, bar) to create the tooltip item for\n\t// @return : new tooltip item\n\tfunction createTooltipItem(element) {\n\t\tvar xScale = element._xScale;\n\t\tvar yScale = element._yScale || element._scale; // handle radar || polarArea charts\n\t\tvar index = element._index;\n\t\tvar datasetIndex = element._datasetIndex;\n\n\t\treturn {\n\t\t\txLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',\n\t\t\tyLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',\n\t\t\tindex: index,\n\t\t\tdatasetIndex: datasetIndex,\n\t\t\tx: element._model.x,\n\t\t\ty: element._model.y\n\t\t};\n\t}\n\n\t/**\n\t * Helper to get the reset model for the tooltip\n\t * @param tooltipOpts {Object} the tooltip options\n\t */\n\tfunction getBaseModel(tooltipOpts) {\n\t\tvar globalDefaults = defaults.global;\n\t\tvar valueOrDefault = helpers.valueOrDefault;\n\n\t\treturn {\n\t\t\t// Positioning\n\t\t\txPadding: tooltipOpts.xPadding,\n\t\t\tyPadding: tooltipOpts.yPadding,\n\t\t\txAlign: tooltipOpts.xAlign,\n\t\t\tyAlign: tooltipOpts.yAlign,\n\n\t\t\t// Body\n\t\t\tbodyFontColor: tooltipOpts.bodyFontColor,\n\t\t\t_bodyFontFamily: valueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),\n\t\t\t_bodyFontStyle: valueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),\n\t\t\t_bodyAlign: tooltipOpts.bodyAlign,\n\t\t\tbodyFontSize: valueOrDefault(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),\n\t\t\tbodySpacing: tooltipOpts.bodySpacing,\n\n\t\t\t// Title\n\t\t\ttitleFontColor: tooltipOpts.titleFontColor,\n\t\t\t_titleFontFamily: valueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),\n\t\t\t_titleFontStyle: valueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),\n\t\t\ttitleFontSize: valueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),\n\t\t\t_titleAlign: tooltipOpts.titleAlign,\n\t\t\ttitleSpacing: tooltipOpts.titleSpacing,\n\t\t\ttitleMarginBottom: tooltipOpts.titleMarginBottom,\n\n\t\t\t// Footer\n\t\t\tfooterFontColor: tooltipOpts.footerFontColor,\n\t\t\t_footerFontFamily: valueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),\n\t\t\t_footerFontStyle: valueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),\n\t\t\tfooterFontSize: valueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),\n\t\t\t_footerAlign: tooltipOpts.footerAlign,\n\t\t\tfooterSpacing: tooltipOpts.footerSpacing,\n\t\t\tfooterMarginTop: tooltipOpts.footerMarginTop,\n\n\t\t\t// Appearance\n\t\t\tcaretSize: tooltipOpts.caretSize,\n\t\t\tcornerRadius: tooltipOpts.cornerRadius,\n\t\t\tbackgroundColor: tooltipOpts.backgroundColor,\n\t\t\topacity: 0,\n\t\t\tlegendColorBackground: tooltipOpts.multiKeyBackground,\n\t\t\tdisplayColors: tooltipOpts.displayColors,\n\t\t\tborderColor: tooltipOpts.borderColor,\n\t\t\tborderWidth: tooltipOpts.borderWidth\n\t\t};\n\t}\n\n\t/**\n\t * Get the size of the tooltip\n\t */\n\tfunction getTooltipSize(tooltip, model) {\n\t\tvar ctx = tooltip._chart.ctx;\n\n\t\tvar height = model.yPadding * 2; // Tooltip Padding\n\t\tvar width = 0;\n\n\t\t// Count of all lines in the body\n\t\tvar body = model.body;\n\t\tvar combinedBodyLength = body.reduce(function(count, bodyItem) {\n\t\t\treturn count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;\n\t\t}, 0);\n\t\tcombinedBodyLength += model.beforeBody.length + model.afterBody.length;\n\n\t\tvar titleLineCount = model.title.length;\n\t\tvar footerLineCount = model.footer.length;\n\t\tvar titleFontSize = model.titleFontSize;\n\t\tvar bodyFontSize = model.bodyFontSize;\n\t\tvar footerFontSize = model.footerFontSize;\n\n\t\theight += titleLineCount * titleFontSize; // Title Lines\n\t\theight += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing\n\t\theight += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin\n\t\theight += combinedBodyLength * bodyFontSize; // Body Lines\n\t\theight += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing\n\t\theight += footerLineCount ? model.footerMarginTop : 0; // Footer Margin\n\t\theight += footerLineCount * (footerFontSize); // Footer Lines\n\t\theight += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing\n\n\t\t// Title width\n\t\tvar widthPadding = 0;\n\t\tvar maxLineWidth = function(line) {\n\t\t\twidth = Math.max(width, ctx.measureText(line).width + widthPadding);\n\t\t};\n\n\t\tctx.font = helpers.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);\n\t\thelpers.each(model.title, maxLineWidth);\n\n\t\t// Body width\n\t\tctx.font = helpers.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);\n\t\thelpers.each(model.beforeBody.concat(model.afterBody), maxLineWidth);\n\n\t\t// Body lines may include some extra width due to the color box\n\t\twidthPadding = model.displayColors ? (bodyFontSize + 2) : 0;\n\t\thelpers.each(body, function(bodyItem) {\n\t\t\thelpers.each(bodyItem.before, maxLineWidth);\n\t\t\thelpers.each(bodyItem.lines, maxLineWidth);\n\t\t\thelpers.each(bodyItem.after, maxLineWidth);\n\t\t});\n\n\t\t// Reset back to 0\n\t\twidthPadding = 0;\n\n\t\t// Footer width\n\t\tctx.font = helpers.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);\n\t\thelpers.each(model.footer, maxLineWidth);\n\n\t\t// Add padding\n\t\twidth += 2 * model.xPadding;\n\n\t\treturn {\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t};\n\t}\n\n\t/**\n\t * Helper to get the alignment of a tooltip given the size\n\t */\n\tfunction determineAlignment(tooltip, size) {\n\t\tvar model = tooltip._model;\n\t\tvar chart = tooltip._chart;\n\t\tvar chartArea = tooltip._chart.chartArea;\n\t\tvar xAlign = 'center';\n\t\tvar yAlign = 'center';\n\n\t\tif (model.y < size.height) {\n\t\t\tyAlign = 'top';\n\t\t} else if (model.y > (chart.height - size.height)) {\n\t\t\tyAlign = 'bottom';\n\t\t}\n\n\t\tvar lf, rf; // functions to determine left, right alignment\n\t\tvar olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart\n\t\tvar yf; // function to get the y alignment if the tooltip goes outside of the left or right edges\n\t\tvar midX = (chartArea.left + chartArea.right) / 2;\n\t\tvar midY = (chartArea.top + chartArea.bottom) / 2;\n\n\t\tif (yAlign === 'center') {\n\t\t\tlf = function(x) {\n\t\t\t\treturn x <= midX;\n\t\t\t};\n\t\t\trf = function(x) {\n\t\t\t\treturn x > midX;\n\t\t\t};\n\t\t} else {\n\t\t\tlf = function(x) {\n\t\t\t\treturn x <= (size.width / 2);\n\t\t\t};\n\t\t\trf = function(x) {\n\t\t\t\treturn x >= (chart.width - (size.width / 2));\n\t\t\t};\n\t\t}\n\n\t\tolf = function(x) {\n\t\t\treturn x + size.width + model.caretSize + model.caretPadding > chart.width;\n\t\t};\n\t\torf = function(x) {\n\t\t\treturn x - size.width - model.caretSize - model.caretPadding < 0;\n\t\t};\n\t\tyf = function(y) {\n\t\t\treturn y <= midY ? 'top' : 'bottom';\n\t\t};\n\n\t\tif (lf(model.x)) {\n\t\t\txAlign = 'left';\n\n\t\t\t// Is tooltip too wide and goes over the right side of the chart.?\n\t\t\tif (olf(model.x)) {\n\t\t\t\txAlign = 'center';\n\t\t\t\tyAlign = yf(model.y);\n\t\t\t}\n\t\t} else if (rf(model.x)) {\n\t\t\txAlign = 'right';\n\n\t\t\t// Is tooltip too wide and goes outside left edge of canvas?\n\t\t\tif (orf(model.x)) {\n\t\t\t\txAlign = 'center';\n\t\t\t\tyAlign = yf(model.y);\n\t\t\t}\n\t\t}\n\n\t\tvar opts = tooltip._options;\n\t\treturn {\n\t\t\txAlign: opts.xAlign ? opts.xAlign : xAlign,\n\t\t\tyAlign: opts.yAlign ? opts.yAlign : yAlign\n\t\t};\n\t}\n\n\t/**\n\t * @Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n\t */\n\tfunction getBackgroundPoint(vm, size, alignment, chart) {\n\t\t// Background Position\n\t\tvar x = vm.x;\n\t\tvar y = vm.y;\n\n\t\tvar caretSize = vm.caretSize;\n\t\tvar caretPadding = vm.caretPadding;\n\t\tvar cornerRadius = vm.cornerRadius;\n\t\tvar xAlign = alignment.xAlign;\n\t\tvar yAlign = alignment.yAlign;\n\t\tvar paddingAndSize = caretSize + caretPadding;\n\t\tvar radiusAndPadding = cornerRadius + caretPadding;\n\n\t\tif (xAlign === 'right') {\n\t\t\tx -= size.width;\n\t\t} else if (xAlign === 'center') {\n\t\t\tx -= (size.width / 2);\n\t\t\tif (x + size.width > chart.width) {\n\t\t\t\tx = chart.width - size.width;\n\t\t\t}\n\t\t\tif (x < 0) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (yAlign === 'top') {\n\t\t\ty += paddingAndSize;\n\t\t} else if (yAlign === 'bottom') {\n\t\t\ty -= size.height + paddingAndSize;\n\t\t} else {\n\t\t\ty -= (size.height / 2);\n\t\t}\n\n\t\tif (yAlign === 'center') {\n\t\t\tif (xAlign === 'left') {\n\t\t\t\tx += paddingAndSize;\n\t\t\t} else if (xAlign === 'right') {\n\t\t\t\tx -= paddingAndSize;\n\t\t\t}\n\t\t} else if (xAlign === 'left') {\n\t\t\tx -= radiusAndPadding;\n\t\t} else if (xAlign === 'right') {\n\t\t\tx += radiusAndPadding;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\t}\n\n\tChart.Tooltip = Element.extend({\n\t\tinitialize: function() {\n\t\t\tthis._model = getBaseModel(this._options);\n\t\t\tthis._lastActive = [];\n\t\t},\n\n\t\t// Get the title\n\t\t// Args are: (tooltipItem, data)\n\t\tgetTitle: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me._options;\n\t\t\tvar callbacks = opts.callbacks;\n\n\t\t\tvar beforeTitle = callbacks.beforeTitle.apply(me, arguments);\n\t\t\tvar title = callbacks.title.apply(me, arguments);\n\t\t\tvar afterTitle = callbacks.afterTitle.apply(me, arguments);\n\n\t\t\tvar lines = [];\n\t\t\tlines = pushOrConcat(lines, beforeTitle);\n\t\t\tlines = pushOrConcat(lines, title);\n\t\t\tlines = pushOrConcat(lines, afterTitle);\n\n\t\t\treturn lines;\n\t\t},\n\n\t\t// Args are: (tooltipItem, data)\n\t\tgetBeforeBody: function() {\n\t\t\tvar lines = this._options.callbacks.beforeBody.apply(this, arguments);\n\t\t\treturn helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];\n\t\t},\n\n\t\t// Args are: (tooltipItem, data)\n\t\tgetBody: function(tooltipItems, data) {\n\t\t\tvar me = this;\n\t\t\tvar callbacks = me._options.callbacks;\n\t\t\tvar bodyItems = [];\n\n\t\t\thelpers.each(tooltipItems, function(tooltipItem) {\n\t\t\t\tvar bodyItem = {\n\t\t\t\t\tbefore: [],\n\t\t\t\t\tlines: [],\n\t\t\t\t\tafter: []\n\t\t\t\t};\n\t\t\t\tpushOrConcat(bodyItem.before, callbacks.beforeLabel.call(me, tooltipItem, data));\n\t\t\t\tpushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));\n\t\t\t\tpushOrConcat(bodyItem.after, callbacks.afterLabel.call(me, tooltipItem, data));\n\n\t\t\t\tbodyItems.push(bodyItem);\n\t\t\t});\n\n\t\t\treturn bodyItems;\n\t\t},\n\n\t\t// Args are: (tooltipItem, data)\n\t\tgetAfterBody: function() {\n\t\t\tvar lines = this._options.callbacks.afterBody.apply(this, arguments);\n\t\t\treturn helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];\n\t\t},\n\n\t\t// Get the footer and beforeFooter and afterFooter lines\n\t\t// Args are: (tooltipItem, data)\n\t\tgetFooter: function() {\n\t\t\tvar me = this;\n\t\t\tvar callbacks = me._options.callbacks;\n\n\t\t\tvar beforeFooter = callbacks.beforeFooter.apply(me, arguments);\n\t\t\tvar footer = callbacks.footer.apply(me, arguments);\n\t\t\tvar afterFooter = callbacks.afterFooter.apply(me, arguments);\n\n\t\t\tvar lines = [];\n\t\t\tlines = pushOrConcat(lines, beforeFooter);\n\t\t\tlines = pushOrConcat(lines, footer);\n\t\t\tlines = pushOrConcat(lines, afterFooter);\n\n\t\t\treturn lines;\n\t\t},\n\n\t\tupdate: function(changed) {\n\t\t\tvar me = this;\n\t\t\tvar opts = me._options;\n\n\t\t\t// Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition\n\t\t\t// that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time\n\t\t\t// which breaks any animations.\n\t\t\tvar existingModel = me._model;\n\t\t\tvar model = me._model = getBaseModel(opts);\n\t\t\tvar active = me._active;\n\n\t\t\tvar data = me._data;\n\n\t\t\t// In the case where active.length === 0 we need to keep these at existing values for good animations\n\t\t\tvar alignment = {\n\t\t\t\txAlign: existingModel.xAlign,\n\t\t\t\tyAlign: existingModel.yAlign\n\t\t\t};\n\t\t\tvar backgroundPoint = {\n\t\t\t\tx: existingModel.x,\n\t\t\t\ty: existingModel.y\n\t\t\t};\n\t\t\tvar tooltipSize = {\n\t\t\t\twidth: existingModel.width,\n\t\t\t\theight: existingModel.height\n\t\t\t};\n\t\t\tvar tooltipPosition = {\n\t\t\t\tx: existingModel.caretX,\n\t\t\t\ty: existingModel.caretY\n\t\t\t};\n\n\t\t\tvar i, len;\n\n\t\t\tif (active.length) {\n\t\t\t\tmodel.opacity = 1;\n\n\t\t\t\tvar labelColors = [];\n\t\t\t\tvar labelTextColors = [];\n\t\t\t\ttooltipPosition = Chart.Tooltip.positioners[opts.position].call(me, active, me._eventPosition);\n\n\t\t\t\tvar tooltipItems = [];\n\t\t\t\tfor (i = 0, len = active.length; i < len; ++i) {\n\t\t\t\t\ttooltipItems.push(createTooltipItem(active[i]));\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a filter function, use it to modify the tooltip items\n\t\t\t\tif (opts.filter) {\n\t\t\t\t\ttooltipItems = tooltipItems.filter(function(a) {\n\t\t\t\t\t\treturn opts.filter(a, data);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// If the user provided a sorting function, use it to modify the tooltip items\n\t\t\t\tif (opts.itemSort) {\n\t\t\t\t\ttooltipItems = tooltipItems.sort(function(a, b) {\n\t\t\t\t\t\treturn opts.itemSort(a, b, data);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Determine colors for boxes\n\t\t\t\thelpers.each(tooltipItems, function(tooltipItem) {\n\t\t\t\t\tlabelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, me._chart));\n\t\t\t\t\tlabelTextColors.push(opts.callbacks.labelTextColor.call(me, tooltipItem, me._chart));\n\t\t\t\t});\n\n\n\t\t\t\t// Build the Text Lines\n\t\t\t\tmodel.title = me.getTitle(tooltipItems, data);\n\t\t\t\tmodel.beforeBody = me.getBeforeBody(tooltipItems, data);\n\t\t\t\tmodel.body = me.getBody(tooltipItems, data);\n\t\t\t\tmodel.afterBody = me.getAfterBody(tooltipItems, data);\n\t\t\t\tmodel.footer = me.getFooter(tooltipItems, data);\n\n\t\t\t\t// Initial positioning and colors\n\t\t\t\tmodel.x = Math.round(tooltipPosition.x);\n\t\t\t\tmodel.y = Math.round(tooltipPosition.y);\n\t\t\t\tmodel.caretPadding = opts.caretPadding;\n\t\t\t\tmodel.labelColors = labelColors;\n\t\t\t\tmodel.labelTextColors = labelTextColors;\n\n\t\t\t\t// data points\n\t\t\t\tmodel.dataPoints = tooltipItems;\n\n\t\t\t\t// We need to determine alignment of the tooltip\n\t\t\t\ttooltipSize = getTooltipSize(this, model);\n\t\t\t\talignment = determineAlignment(this, tooltipSize);\n\t\t\t\t// Final Size and Position\n\t\t\t\tbackgroundPoint = getBackgroundPoint(model, tooltipSize, alignment, me._chart);\n\t\t\t} else {\n\t\t\t\tmodel.opacity = 0;\n\t\t\t}\n\n\t\t\tmodel.xAlign = alignment.xAlign;\n\t\t\tmodel.yAlign = alignment.yAlign;\n\t\t\tmodel.x = backgroundPoint.x;\n\t\t\tmodel.y = backgroundPoint.y;\n\t\t\tmodel.width = tooltipSize.width;\n\t\t\tmodel.height = tooltipSize.height;\n\n\t\t\t// Point where the caret on the tooltip points to\n\t\t\tmodel.caretX = tooltipPosition.x;\n\t\t\tmodel.caretY = tooltipPosition.y;\n\n\t\t\tme._model = model;\n\n\t\t\tif (changed && opts.custom) {\n\t\t\t\topts.custom.call(me, model);\n\t\t\t}\n\n\t\t\treturn me;\n\t\t},\n\t\tdrawCaret: function(tooltipPoint, size) {\n\t\t\tvar ctx = this._chart.ctx;\n\t\t\tvar vm = this._view;\n\t\t\tvar caretPosition = this.getCaretPosition(tooltipPoint, size, vm);\n\n\t\t\tctx.lineTo(caretPosition.x1, caretPosition.y1);\n\t\t\tctx.lineTo(caretPosition.x2, caretPosition.y2);\n\t\t\tctx.lineTo(caretPosition.x3, caretPosition.y3);\n\t\t},\n\t\tgetCaretPosition: function(tooltipPoint, size, vm) {\n\t\t\tvar x1, x2, x3, y1, y2, y3;\n\t\t\tvar caretSize = vm.caretSize;\n\t\t\tvar cornerRadius = vm.cornerRadius;\n\t\t\tvar xAlign = vm.xAlign;\n\t\t\tvar yAlign = vm.yAlign;\n\t\t\tvar ptX = tooltipPoint.x;\n\t\t\tvar ptY = tooltipPoint.y;\n\t\t\tvar width = size.width;\n\t\t\tvar height = size.height;\n\n\t\t\tif (yAlign === 'center') {\n\t\t\t\ty2 = ptY + (height / 2);\n\n\t\t\t\tif (xAlign === 'left') {\n\t\t\t\t\tx1 = ptX;\n\t\t\t\t\tx2 = x1 - caretSize;\n\t\t\t\t\tx3 = x1;\n\n\t\t\t\t\ty1 = y2 + caretSize;\n\t\t\t\t\ty3 = y2 - caretSize;\n\t\t\t\t} else {\n\t\t\t\t\tx1 = ptX + width;\n\t\t\t\t\tx2 = x1 + caretSize;\n\t\t\t\t\tx3 = x1;\n\n\t\t\t\t\ty1 = y2 - caretSize;\n\t\t\t\t\ty3 = y2 + caretSize;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (xAlign === 'left') {\n\t\t\t\t\tx2 = ptX + cornerRadius + (caretSize);\n\t\t\t\t\tx1 = x2 - caretSize;\n\t\t\t\t\tx3 = x2 + caretSize;\n\t\t\t\t} else if (xAlign === 'right') {\n\t\t\t\t\tx2 = ptX + width - cornerRadius - caretSize;\n\t\t\t\t\tx1 = x2 - caretSize;\n\t\t\t\t\tx3 = x2 + caretSize;\n\t\t\t\t} else {\n\t\t\t\t\tx2 = vm.caretX;\n\t\t\t\t\tx1 = x2 - caretSize;\n\t\t\t\t\tx3 = x2 + caretSize;\n\t\t\t\t}\n\t\t\t\tif (yAlign === 'top') {\n\t\t\t\t\ty1 = ptY;\n\t\t\t\t\ty2 = y1 - caretSize;\n\t\t\t\t\ty3 = y1;\n\t\t\t\t} else {\n\t\t\t\t\ty1 = ptY + height;\n\t\t\t\t\ty2 = y1 + caretSize;\n\t\t\t\t\ty3 = y1;\n\t\t\t\t\t// invert drawing order\n\t\t\t\t\tvar tmp = x3;\n\t\t\t\t\tx3 = x1;\n\t\t\t\t\tx1 = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3};\n\t\t},\n\t\tdrawTitle: function(pt, vm, ctx, opacity) {\n\t\t\tvar title = vm.title;\n\n\t\t\tif (title.length) {\n\t\t\t\tctx.textAlign = vm._titleAlign;\n\t\t\t\tctx.textBaseline = 'top';\n\n\t\t\t\tvar titleFontSize = vm.titleFontSize;\n\t\t\t\tvar titleSpacing = vm.titleSpacing;\n\n\t\t\t\tctx.fillStyle = mergeOpacity(vm.titleFontColor, opacity);\n\t\t\t\tctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);\n\n\t\t\t\tvar i, len;\n\t\t\t\tfor (i = 0, len = title.length; i < len; ++i) {\n\t\t\t\t\tctx.fillText(title[i], pt.x, pt.y);\n\t\t\t\t\tpt.y += titleFontSize + titleSpacing; // Line Height and spacing\n\n\t\t\t\t\tif (i + 1 === title.length) {\n\t\t\t\t\t\tpt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdrawBody: function(pt, vm, ctx, opacity) {\n\t\t\tvar bodyFontSize = vm.bodyFontSize;\n\t\t\tvar bodySpacing = vm.bodySpacing;\n\t\t\tvar body = vm.body;\n\n\t\t\tctx.textAlign = vm._bodyAlign;\n\t\t\tctx.textBaseline = 'top';\n\t\t\tctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);\n\n\t\t\t// Before Body\n\t\t\tvar xLinePadding = 0;\n\t\t\tvar fillLineOfText = function(line) {\n\t\t\t\tctx.fillText(line, pt.x + xLinePadding, pt.y);\n\t\t\t\tpt.y += bodyFontSize + bodySpacing;\n\t\t\t};\n\n\t\t\t// Before body lines\n\t\t\tctx.fillStyle = mergeOpacity(vm.bodyFontColor, opacity);\n\t\t\thelpers.each(vm.beforeBody, fillLineOfText);\n\n\t\t\tvar drawColorBoxes = vm.displayColors;\n\t\t\txLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;\n\n\t\t\t// Draw body lines now\n\t\t\thelpers.each(body, function(bodyItem, i) {\n\t\t\t\tvar textColor = mergeOpacity(vm.labelTextColors[i], opacity);\n\t\t\t\tctx.fillStyle = textColor;\n\t\t\t\thelpers.each(bodyItem.before, fillLineOfText);\n\n\t\t\t\thelpers.each(bodyItem.lines, function(line) {\n\t\t\t\t\t// Draw Legend-like boxes if needed\n\t\t\t\t\tif (drawColorBoxes) {\n\t\t\t\t\t\t// Fill a white rect so that colours merge nicely if the opacity is < 1\n\t\t\t\t\t\tctx.fillStyle = mergeOpacity(vm.legendColorBackground, opacity);\n\t\t\t\t\t\tctx.fillRect(pt.x, pt.y, bodyFontSize, bodyFontSize);\n\n\t\t\t\t\t\t// Border\n\t\t\t\t\t\tctx.lineWidth = 1;\n\t\t\t\t\t\tctx.strokeStyle = mergeOpacity(vm.labelColors[i].borderColor, opacity);\n\t\t\t\t\t\tctx.strokeRect(pt.x, pt.y, bodyFontSize, bodyFontSize);\n\n\t\t\t\t\t\t// Inner square\n\t\t\t\t\t\tctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity);\n\t\t\t\t\t\tctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);\n\t\t\t\t\t\tctx.fillStyle = textColor;\n\t\t\t\t\t}\n\n\t\t\t\t\tfillLineOfText(line);\n\t\t\t\t});\n\n\t\t\t\thelpers.each(bodyItem.after, fillLineOfText);\n\t\t\t});\n\n\t\t\t// Reset back to 0 for after body\n\t\t\txLinePadding = 0;\n\n\t\t\t// After body lines\n\t\t\thelpers.each(vm.afterBody, fillLineOfText);\n\t\t\tpt.y -= bodySpacing; // Remove last body spacing\n\t\t},\n\t\tdrawFooter: function(pt, vm, ctx, opacity) {\n\t\t\tvar footer = vm.footer;\n\n\t\t\tif (footer.length) {\n\t\t\t\tpt.y += vm.footerMarginTop;\n\n\t\t\t\tctx.textAlign = vm._footerAlign;\n\t\t\t\tctx.textBaseline = 'top';\n\n\t\t\t\tctx.fillStyle = mergeOpacity(vm.footerFontColor, opacity);\n\t\t\t\tctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);\n\n\t\t\t\thelpers.each(footer, function(line) {\n\t\t\t\t\tctx.fillText(line, pt.x, pt.y);\n\t\t\t\t\tpt.y += vm.footerFontSize + vm.footerSpacing;\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tdrawBackground: function(pt, vm, ctx, tooltipSize, opacity) {\n\t\t\tctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);\n\t\t\tctx.strokeStyle = mergeOpacity(vm.borderColor, opacity);\n\t\t\tctx.lineWidth = vm.borderWidth;\n\t\t\tvar xAlign = vm.xAlign;\n\t\t\tvar yAlign = vm.yAlign;\n\t\t\tvar x = pt.x;\n\t\t\tvar y = pt.y;\n\t\t\tvar width = tooltipSize.width;\n\t\t\tvar height = tooltipSize.height;\n\t\t\tvar radius = vm.cornerRadius;\n\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x + radius, y);\n\t\t\tif (yAlign === 'top') {\n\t\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t\t}\n\t\t\tctx.lineTo(x + width - radius, y);\n\t\t\tctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n\t\t\tif (yAlign === 'center' && xAlign === 'right') {\n\t\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t\t}\n\t\t\tctx.lineTo(x + width, y + height - radius);\n\t\t\tctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n\t\t\tif (yAlign === 'bottom') {\n\t\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t\t}\n\t\t\tctx.lineTo(x + radius, y + height);\n\t\t\tctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n\t\t\tif (yAlign === 'center' && xAlign === 'left') {\n\t\t\t\tthis.drawCaret(pt, tooltipSize);\n\t\t\t}\n\t\t\tctx.lineTo(x, y + radius);\n\t\t\tctx.quadraticCurveTo(x, y, x + radius, y);\n\t\t\tctx.closePath();\n\n\t\t\tctx.fill();\n\n\t\t\tif (vm.borderWidth > 0) {\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t},\n\t\tdraw: function() {\n\t\t\tvar ctx = this._chart.ctx;\n\t\t\tvar vm = this._view;\n\n\t\t\tif (vm.opacity === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar tooltipSize = {\n\t\t\t\twidth: vm.width,\n\t\t\t\theight: vm.height\n\t\t\t};\n\t\t\tvar pt = {\n\t\t\t\tx: vm.x,\n\t\t\t\ty: vm.y\n\t\t\t};\n\n\t\t\t// IE11/Edge does not like very small opacities, so snap to 0\n\t\t\tvar opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;\n\n\t\t\t// Truthy/falsey value for empty tooltip\n\t\t\tvar hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;\n\n\t\t\tif (this._options.enabled && hasTooltipContent) {\n\t\t\t\t// Draw Background\n\t\t\t\tthis.drawBackground(pt, vm, ctx, tooltipSize, opacity);\n\n\t\t\t\t// Draw Title, Body, and Footer\n\t\t\t\tpt.x += vm.xPadding;\n\t\t\t\tpt.y += vm.yPadding;\n\n\t\t\t\t// Titles\n\t\t\t\tthis.drawTitle(pt, vm, ctx, opacity);\n\n\t\t\t\t// Body\n\t\t\t\tthis.drawBody(pt, vm, ctx, opacity);\n\n\t\t\t\t// Footer\n\t\t\t\tthis.drawFooter(pt, vm, ctx, opacity);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle an event\n\t\t * @private\n\t\t * @param {IEvent} event - The event to handle\n\t\t * @returns {Boolean} true if the tooltip changed\n\t\t */\n\t\thandleEvent: function(e) {\n\t\t\tvar me = this;\n\t\t\tvar options = me._options;\n\t\t\tvar changed = false;\n\n\t\t\tme._lastActive = me._lastActive || [];\n\n\t\t\t// Find Active Elements for tooltips\n\t\t\tif (e.type === 'mouseout') {\n\t\t\t\tme._active = [];\n\t\t\t} else {\n\t\t\t\tme._active = me._chart.getElementsAtEventForMode(e, options.mode, options);\n\t\t\t}\n\n\t\t\t// Remember Last Actives\n\t\t\tchanged = !helpers.arrayEquals(me._active, me._lastActive);\n\n\t\t\t// Only handle target event on tooltip change\n\t\t\tif (changed) {\n\t\t\t\tme._lastActive = me._active;\n\n\t\t\t\tif (options.enabled || options.custom) {\n\t\t\t\t\tme._eventPosition = {\n\t\t\t\t\t\tx: e.x,\n\t\t\t\t\t\ty: e.y\n\t\t\t\t\t};\n\n\t\t\t\t\tme.update(true);\n\t\t\t\t\tme.pivot();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn changed;\n\t\t}\n\t});\n\n\t/**\n\t * @namespace Chart.Tooltip.positioners\n\t */\n\tChart.Tooltip.positioners = {\n\t\t/**\n\t\t * Average mode places the tooltip at the average position of the elements shown\n\t\t * @function Chart.Tooltip.positioners.average\n\t\t * @param elements {ChartElement[]} the elements being displayed in the tooltip\n\t\t * @returns {Point} tooltip position\n\t\t */\n\t\taverage: function(elements) {\n\t\t\tif (!elements.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar i, len;\n\t\t\tvar x = 0;\n\t\t\tvar y = 0;\n\t\t\tvar count = 0;\n\n\t\t\tfor (i = 0, len = elements.length; i < len; ++i) {\n\t\t\t\tvar el = elements[i];\n\t\t\t\tif (el && el.hasValue()) {\n\t\t\t\t\tvar pos = el.tooltipPosition();\n\t\t\t\t\tx += pos.x;\n\t\t\t\t\ty += pos.y;\n\t\t\t\t\t++count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tx: Math.round(x / count),\n\t\t\t\ty: Math.round(y / count)\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * Gets the tooltip position nearest of the item nearest to the event position\n\t\t * @function Chart.Tooltip.positioners.nearest\n\t\t * @param elements {Chart.Element[]} the tooltip elements\n\t\t * @param eventPosition {Point} the position of the event in canvas coordinates\n\t\t * @returns {Point} the tooltip position\n\t\t */\n\t\tnearest: function(elements, eventPosition) {\n\t\t\tvar x = eventPosition.x;\n\t\t\tvar y = eventPosition.y;\n\t\t\tvar minDistance = Number.POSITIVE_INFINITY;\n\t\t\tvar i, len, nearestElement;\n\n\t\t\tfor (i = 0, len = elements.length; i < len; ++i) {\n\t\t\t\tvar el = elements[i];\n\t\t\t\tif (el && el.hasValue()) {\n\t\t\t\t\tvar center = el.getCenterPoint();\n\t\t\t\t\tvar d = helpers.distanceBetweenPoints(eventPosition, center);\n\n\t\t\t\t\tif (d < minDistance) {\n\t\t\t\t\t\tminDistance = d;\n\t\t\t\t\t\tnearestElement = el;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (nearestElement) {\n\t\t\t\tvar tp = nearestElement.tooltipPosition();\n\t\t\t\tx = tp.x;\n\t\t\t\ty = tp.y;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tx: x,\n\t\t\t\ty: y\n\t\t\t};\n\t\t}\n\t};\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.tooltip.js?");
  261. /***/ }),
  262. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.arc.js":
  263. /*!*********************************************************************************************!*\
  264. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.arc.js ***!
  265. \*********************************************************************************************/
  266. /*! no static exports found */
  267. /***/ (function(module, exports, __webpack_require__) {
  268. "use strict";
  269. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ../core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('global', {\n\telements: {\n\t\tarc: {\n\t\t\tbackgroundColor: defaults.global.defaultColor,\n\t\t\tborderColor: '#fff',\n\t\t\tborderWidth: 2\n\t\t}\n\t}\n});\n\nmodule.exports = Element.extend({\n\tinLabelRange: function(mouseX) {\n\t\tvar vm = this._view;\n\n\t\tif (vm) {\n\t\t\treturn (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\n\t\t}\n\t\treturn false;\n\t},\n\n\tinRange: function(chartX, chartY) {\n\t\tvar vm = this._view;\n\n\t\tif (vm) {\n\t\t\tvar pointRelativePosition = helpers.getAngleFromPoint(vm, {x: chartX, y: chartY});\n\t\t\tvar\tangle = pointRelativePosition.angle;\n\t\t\tvar distance = pointRelativePosition.distance;\n\n\t\t\t// Sanitise angle range\n\t\t\tvar startAngle = vm.startAngle;\n\t\t\tvar endAngle = vm.endAngle;\n\t\t\twhile (endAngle < startAngle) {\n\t\t\t\tendAngle += 2.0 * Math.PI;\n\t\t\t}\n\t\t\twhile (angle > endAngle) {\n\t\t\t\tangle -= 2.0 * Math.PI;\n\t\t\t}\n\t\t\twhile (angle < startAngle) {\n\t\t\t\tangle += 2.0 * Math.PI;\n\t\t\t}\n\n\t\t\t// Check if within the range of the open/close angle\n\t\t\tvar betweenAngles = (angle >= startAngle && angle <= endAngle);\n\t\t\tvar withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\n\n\t\t\treturn (betweenAngles && withinRadius);\n\t\t}\n\t\treturn false;\n\t},\n\n\tgetCenterPoint: function() {\n\t\tvar vm = this._view;\n\t\tvar halfAngle = (vm.startAngle + vm.endAngle) / 2;\n\t\tvar halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\n\t\treturn {\n\t\t\tx: vm.x + Math.cos(halfAngle) * halfRadius,\n\t\t\ty: vm.y + Math.sin(halfAngle) * halfRadius\n\t\t};\n\t},\n\n\tgetArea: function() {\n\t\tvar vm = this._view;\n\t\treturn Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\n\t},\n\n\ttooltipPosition: function() {\n\t\tvar vm = this._view;\n\t\tvar centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\n\t\tvar rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\n\n\t\treturn {\n\t\t\tx: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\n\t\t\ty: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\n\t\t};\n\t},\n\n\tdraw: function() {\n\t\tvar ctx = this._chart.ctx;\n\t\tvar vm = this._view;\n\t\tvar sA = vm.startAngle;\n\t\tvar eA = vm.endAngle;\n\n\t\tctx.beginPath();\n\n\t\tctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);\n\t\tctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);\n\n\t\tctx.closePath();\n\t\tctx.strokeStyle = vm.borderColor;\n\t\tctx.lineWidth = vm.borderWidth;\n\n\t\tctx.fillStyle = vm.backgroundColor;\n\n\t\tctx.fill();\n\t\tctx.lineJoin = 'bevel';\n\n\t\tif (vm.borderWidth) {\n\t\t\tctx.stroke();\n\t\t}\n\t}\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.arc.js?");
  270. /***/ }),
  271. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.line.js":
  272. /*!**********************************************************************************************!*\
  273. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.line.js ***!
  274. \**********************************************************************************************/
  275. /*! no static exports found */
  276. /***/ (function(module, exports, __webpack_require__) {
  277. "use strict";
  278. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ../core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nvar globalDefaults = defaults.global;\n\ndefaults._set('global', {\n\telements: {\n\t\tline: {\n\t\t\ttension: 0.4,\n\t\t\tbackgroundColor: globalDefaults.defaultColor,\n\t\t\tborderWidth: 3,\n\t\t\tborderColor: globalDefaults.defaultColor,\n\t\t\tborderCapStyle: 'butt',\n\t\t\tborderDash: [],\n\t\t\tborderDashOffset: 0.0,\n\t\t\tborderJoinStyle: 'miter',\n\t\t\tcapBezierPoints: true,\n\t\t\tfill: true, // do we fill in the area between the line and its base axis\n\t\t}\n\t}\n});\n\nmodule.exports = Element.extend({\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar vm = me._view;\n\t\tvar ctx = me._chart.ctx;\n\t\tvar spanGaps = vm.spanGaps;\n\t\tvar points = me._children.slice(); // clone array\n\t\tvar globalOptionLineElements = globalDefaults.elements.line;\n\t\tvar lastDrawnIndex = -1;\n\t\tvar index, current, previous, currentVM;\n\n\t\t// If we are looping, adding the first point again\n\t\tif (me._loop && points.length) {\n\t\t\tpoints.push(points[0]);\n\t\t}\n\n\t\tctx.save();\n\n\t\t// Stroke Line Options\n\t\tctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\n\n\t\t// IE 9 and 10 do not support line dash\n\t\tif (ctx.setLineDash) {\n\t\t\tctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\n\t\t}\n\n\t\tctx.lineDashOffset = vm.borderDashOffset || globalOptionLineElements.borderDashOffset;\n\t\tctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\n\t\tctx.lineWidth = vm.borderWidth || globalOptionLineElements.borderWidth;\n\t\tctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\n\n\t\t// Stroke Line\n\t\tctx.beginPath();\n\t\tlastDrawnIndex = -1;\n\n\t\tfor (index = 0; index < points.length; ++index) {\n\t\t\tcurrent = points[index];\n\t\t\tprevious = helpers.previousItem(points, index);\n\t\t\tcurrentVM = current._view;\n\n\t\t\t// First point moves to it's starting position no matter what\n\t\t\tif (index === 0) {\n\t\t\t\tif (!currentVM.skip) {\n\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\n\t\t\t\t\tlastDrawnIndex = index;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprevious = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];\n\n\t\t\t\tif (!currentVM.skip) {\n\t\t\t\t\tif ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\n\t\t\t\t\t\t// There was a gap and this is the first point after the gap\n\t\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Line to next point\n\t\t\t\t\t\thelpers.canvas.lineTo(ctx, previous._view, current._view);\n\t\t\t\t\t}\n\t\t\t\t\tlastDrawnIndex = index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tctx.stroke();\n\t\tctx.restore();\n\t}\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.line.js?");
  279. /***/ }),
  280. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.point.js":
  281. /*!***********************************************************************************************!*\
  282. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.point.js ***!
  283. \***********************************************************************************************/
  284. /*! no static exports found */
  285. /***/ (function(module, exports, __webpack_require__) {
  286. "use strict";
  287. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ../core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nvar defaultColor = defaults.global.defaultColor;\n\ndefaults._set('global', {\n\telements: {\n\t\tpoint: {\n\t\t\tradius: 3,\n\t\t\tpointStyle: 'circle',\n\t\t\tbackgroundColor: defaultColor,\n\t\t\tborderColor: defaultColor,\n\t\t\tborderWidth: 1,\n\t\t\t// Hover\n\t\t\thitRadius: 1,\n\t\t\thoverRadius: 4,\n\t\t\thoverBorderWidth: 1\n\t\t}\n\t}\n});\n\nfunction xRange(mouseX) {\n\tvar vm = this._view;\n\treturn vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;\n}\n\nfunction yRange(mouseY) {\n\tvar vm = this._view;\n\treturn vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;\n}\n\nmodule.exports = Element.extend({\n\tinRange: function(mouseX, mouseY) {\n\t\tvar vm = this._view;\n\t\treturn vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\n\t},\n\n\tinLabelRange: xRange,\n\tinXRange: xRange,\n\tinYRange: yRange,\n\n\tgetCenterPoint: function() {\n\t\tvar vm = this._view;\n\t\treturn {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y\n\t\t};\n\t},\n\n\tgetArea: function() {\n\t\treturn Math.PI * Math.pow(this._view.radius, 2);\n\t},\n\n\ttooltipPosition: function() {\n\t\tvar vm = this._view;\n\t\treturn {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y,\n\t\t\tpadding: vm.radius + vm.borderWidth\n\t\t};\n\t},\n\n\tdraw: function(chartArea) {\n\t\tvar vm = this._view;\n\t\tvar model = this._model;\n\t\tvar ctx = this._chart.ctx;\n\t\tvar pointStyle = vm.pointStyle;\n\t\tvar radius = vm.radius;\n\t\tvar x = vm.x;\n\t\tvar y = vm.y;\n\t\tvar color = helpers.color;\n\t\tvar errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.)\n\t\tvar ratio = 0;\n\n\t\tif (vm.skip) {\n\t\t\treturn;\n\t\t}\n\n\t\tctx.strokeStyle = vm.borderColor || defaultColor;\n\t\tctx.lineWidth = helpers.valueOrDefault(vm.borderWidth, defaults.global.elements.point.borderWidth);\n\t\tctx.fillStyle = vm.backgroundColor || defaultColor;\n\n\t\t// Cliping for Points.\n\t\t// going out from inner charArea?\n\t\tif ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right * errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom * errMargin < model.y))) {\n\t\t\t// Point fade out\n\t\t\tif (model.x < chartArea.left) {\n\t\t\t\tratio = (x - model.x) / (chartArea.left - model.x);\n\t\t\t} else if (chartArea.right * errMargin < model.x) {\n\t\t\t\tratio = (model.x - x) / (model.x - chartArea.right);\n\t\t\t} else if (model.y < chartArea.top) {\n\t\t\t\tratio = (y - model.y) / (chartArea.top - model.y);\n\t\t\t} else if (chartArea.bottom * errMargin < model.y) {\n\t\t\t\tratio = (model.y - y) / (model.y - chartArea.bottom);\n\t\t\t}\n\t\t\tratio = Math.round(ratio * 100) / 100;\n\t\t\tctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString();\n\t\t\tctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString();\n\t\t}\n\n\t\thelpers.canvas.drawPoint(ctx, pointStyle, radius, x, y);\n\t}\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.point.js?");
  288. /***/ }),
  289. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.rectangle.js":
  290. /*!***************************************************************************************************!*\
  291. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.rectangle.js ***!
  292. \***************************************************************************************************/
  293. /*! no static exports found */
  294. /***/ (function(module, exports, __webpack_require__) {
  295. "use strict";
  296. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ../core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\n\ndefaults._set('global', {\n\telements: {\n\t\trectangle: {\n\t\t\tbackgroundColor: defaults.global.defaultColor,\n\t\t\tborderColor: defaults.global.defaultColor,\n\t\t\tborderSkipped: 'bottom',\n\t\t\tborderWidth: 0\n\t\t}\n\t}\n});\n\nfunction isVertical(bar) {\n\treturn bar._view.width !== undefined;\n}\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param bar {Chart.Element.Rectangle} the bar\n * @return {Bounds} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar) {\n\tvar vm = bar._view;\n\tvar x1, x2, y1, y2;\n\n\tif (isVertical(bar)) {\n\t\t// vertical\n\t\tvar halfWidth = vm.width / 2;\n\t\tx1 = vm.x - halfWidth;\n\t\tx2 = vm.x + halfWidth;\n\t\ty1 = Math.min(vm.y, vm.base);\n\t\ty2 = Math.max(vm.y, vm.base);\n\t} else {\n\t\t// horizontal bar\n\t\tvar halfHeight = vm.height / 2;\n\t\tx1 = Math.min(vm.x, vm.base);\n\t\tx2 = Math.max(vm.x, vm.base);\n\t\ty1 = vm.y - halfHeight;\n\t\ty2 = vm.y + halfHeight;\n\t}\n\n\treturn {\n\t\tleft: x1,\n\t\ttop: y1,\n\t\tright: x2,\n\t\tbottom: y2\n\t};\n}\n\nmodule.exports = Element.extend({\n\tdraw: function() {\n\t\tvar ctx = this._chart.ctx;\n\t\tvar vm = this._view;\n\t\tvar left, right, top, bottom, signX, signY, borderSkipped;\n\t\tvar borderWidth = vm.borderWidth;\n\n\t\tif (!vm.horizontal) {\n\t\t\t// bar\n\t\t\tleft = vm.x - vm.width / 2;\n\t\t\tright = vm.x + vm.width / 2;\n\t\t\ttop = vm.y;\n\t\t\tbottom = vm.base;\n\t\t\tsignX = 1;\n\t\t\tsignY = bottom > top ? 1 : -1;\n\t\t\tborderSkipped = vm.borderSkipped || 'bottom';\n\t\t} else {\n\t\t\t// horizontal bar\n\t\t\tleft = vm.base;\n\t\t\tright = vm.x;\n\t\t\ttop = vm.y - vm.height / 2;\n\t\t\tbottom = vm.y + vm.height / 2;\n\t\t\tsignX = right > left ? 1 : -1;\n\t\t\tsignY = 1;\n\t\t\tborderSkipped = vm.borderSkipped || 'left';\n\t\t}\n\n\t\t// Canvas doesn't allow us to stroke inside the width so we can\n\t\t// adjust the sizes to fit if we're setting a stroke on the line\n\t\tif (borderWidth) {\n\t\t\t// borderWidth shold be less than bar width and bar height.\n\t\t\tvar barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));\n\t\t\tborderWidth = borderWidth > barSize ? barSize : borderWidth;\n\t\t\tvar halfStroke = borderWidth / 2;\n\t\t\t// Adjust borderWidth when bar top position is near vm.base(zero).\n\t\t\tvar borderLeft = left + (borderSkipped !== 'left' ? halfStroke * signX : 0);\n\t\t\tvar borderRight = right + (borderSkipped !== 'right' ? -halfStroke * signX : 0);\n\t\t\tvar borderTop = top + (borderSkipped !== 'top' ? halfStroke * signY : 0);\n\t\t\tvar borderBottom = bottom + (borderSkipped !== 'bottom' ? -halfStroke * signY : 0);\n\t\t\t// not become a vertical line?\n\t\t\tif (borderLeft !== borderRight) {\n\t\t\t\ttop = borderTop;\n\t\t\t\tbottom = borderBottom;\n\t\t\t}\n\t\t\t// not become a horizontal line?\n\t\t\tif (borderTop !== borderBottom) {\n\t\t\t\tleft = borderLeft;\n\t\t\t\tright = borderRight;\n\t\t\t}\n\t\t}\n\n\t\tctx.beginPath();\n\t\tctx.fillStyle = vm.backgroundColor;\n\t\tctx.strokeStyle = vm.borderColor;\n\t\tctx.lineWidth = borderWidth;\n\n\t\t// Corner points, from bottom-left to bottom-right clockwise\n\t\t// | 1 2 |\n\t\t// | 0 3 |\n\t\tvar corners = [\n\t\t\t[left, bottom],\n\t\t\t[left, top],\n\t\t\t[right, top],\n\t\t\t[right, bottom]\n\t\t];\n\n\t\t// Find first (starting) corner with fallback to 'bottom'\n\t\tvar borders = ['bottom', 'left', 'top', 'right'];\n\t\tvar startCorner = borders.indexOf(borderSkipped, 0);\n\t\tif (startCorner === -1) {\n\t\t\tstartCorner = 0;\n\t\t}\n\n\t\tfunction cornerAt(index) {\n\t\t\treturn corners[(startCorner + index) % 4];\n\t\t}\n\n\t\t// Draw rectangle from 'startCorner'\n\t\tvar corner = cornerAt(0);\n\t\tctx.moveTo(corner[0], corner[1]);\n\n\t\tfor (var i = 1; i < 4; i++) {\n\t\t\tcorner = cornerAt(i);\n\t\t\tctx.lineTo(corner[0], corner[1]);\n\t\t}\n\n\t\tctx.fill();\n\t\tif (borderWidth) {\n\t\t\tctx.stroke();\n\t\t}\n\t},\n\n\theight: function() {\n\t\tvar vm = this._view;\n\t\treturn vm.base - vm.y;\n\t},\n\n\tinRange: function(mouseX, mouseY) {\n\t\tvar inRange = false;\n\n\t\tif (this._view) {\n\t\t\tvar bounds = getBarBounds(this);\n\t\t\tinRange = mouseX >= bounds.left && mouseX <= bounds.right && mouseY >= bounds.top && mouseY <= bounds.bottom;\n\t\t}\n\n\t\treturn inRange;\n\t},\n\n\tinLabelRange: function(mouseX, mouseY) {\n\t\tvar me = this;\n\t\tif (!me._view) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar inRange = false;\n\t\tvar bounds = getBarBounds(me);\n\n\t\tif (isVertical(me)) {\n\t\t\tinRange = mouseX >= bounds.left && mouseX <= bounds.right;\n\t\t} else {\n\t\t\tinRange = mouseY >= bounds.top && mouseY <= bounds.bottom;\n\t\t}\n\n\t\treturn inRange;\n\t},\n\n\tinXRange: function(mouseX) {\n\t\tvar bounds = getBarBounds(this);\n\t\treturn mouseX >= bounds.left && mouseX <= bounds.right;\n\t},\n\n\tinYRange: function(mouseY) {\n\t\tvar bounds = getBarBounds(this);\n\t\treturn mouseY >= bounds.top && mouseY <= bounds.bottom;\n\t},\n\n\tgetCenterPoint: function() {\n\t\tvar vm = this._view;\n\t\tvar x, y;\n\t\tif (isVertical(this)) {\n\t\t\tx = vm.x;\n\t\t\ty = (vm.y + vm.base) / 2;\n\t\t} else {\n\t\t\tx = (vm.x + vm.base) / 2;\n\t\t\ty = vm.y;\n\t\t}\n\n\t\treturn {x: x, y: y};\n\t},\n\n\tgetArea: function() {\n\t\tvar vm = this._view;\n\t\treturn vm.width * Math.abs(vm.y - vm.base);\n\t},\n\n\ttooltipPosition: function() {\n\t\tvar vm = this._view;\n\t\treturn {\n\t\t\tx: vm.x,\n\t\t\ty: vm.y\n\t\t};\n\t}\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.rectangle.js?");
  297. /***/ }),
  298. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js":
  299. /*!***************************************************************************************!*\
  300. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js ***!
  301. \***************************************************************************************/
  302. /*! no static exports found */
  303. /***/ (function(module, exports, __webpack_require__) {
  304. "use strict";
  305. eval("\n\nmodule.exports = {};\nmodule.exports.Arc = __webpack_require__(/*! ./element.arc */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.arc.js\");\nmodule.exports.Line = __webpack_require__(/*! ./element.line */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.line.js\");\nmodule.exports.Point = __webpack_require__(/*! ./element.point */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.point.js\");\nmodule.exports.Rectangle = __webpack_require__(/*! ./element.rectangle */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/element.rectangle.js\");\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js?");
  306. /***/ }),
  307. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.canvas.js":
  308. /*!***********************************************************************************************!*\
  309. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.canvas.js ***!
  310. \***********************************************************************************************/
  311. /*! no static exports found */
  312. /***/ (function(module, exports, __webpack_require__) {
  313. "use strict";
  314. eval("\n\nvar helpers = __webpack_require__(/*! ./helpers.core */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js\");\n\n/**\n * @namespace Chart.helpers.canvas\n */\nvar exports = module.exports = {\n\t/**\n\t * Clears the entire canvas associated to the given `chart`.\n\t * @param {Chart} chart - The chart for which to clear the canvas.\n\t */\n\tclear: function(chart) {\n\t\tchart.ctx.clearRect(0, 0, chart.width, chart.height);\n\t},\n\n\t/**\n\t * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\n\t * given size (width, height) and the same `radius` for all corners.\n\t * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\n\t * @param {Number} x - The x axis of the coordinate for the rectangle starting point.\n\t * @param {Number} y - The y axis of the coordinate for the rectangle starting point.\n\t * @param {Number} width - The rectangle's width.\n\t * @param {Number} height - The rectangle's height.\n\t * @param {Number} radius - The rounded amount (in pixels) for the four corners.\n\t * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\n\t */\n\troundedRect: function(ctx, x, y, width, height, radius) {\n\t\tif (radius) {\n\t\t\tvar rx = Math.min(radius, width / 2);\n\t\t\tvar ry = Math.min(radius, height / 2);\n\n\t\t\tctx.moveTo(x + rx, y);\n\t\t\tctx.lineTo(x + width - rx, y);\n\t\t\tctx.quadraticCurveTo(x + width, y, x + width, y + ry);\n\t\t\tctx.lineTo(x + width, y + height - ry);\n\t\t\tctx.quadraticCurveTo(x + width, y + height, x + width - rx, y + height);\n\t\t\tctx.lineTo(x + rx, y + height);\n\t\t\tctx.quadraticCurveTo(x, y + height, x, y + height - ry);\n\t\t\tctx.lineTo(x, y + ry);\n\t\t\tctx.quadraticCurveTo(x, y, x + rx, y);\n\t\t} else {\n\t\t\tctx.rect(x, y, width, height);\n\t\t}\n\t},\n\n\tdrawPoint: function(ctx, style, radius, x, y) {\n\t\tvar type, edgeLength, xOffset, yOffset, height, size;\n\n\t\tif (style && typeof style === 'object') {\n\t\t\ttype = style.toString();\n\t\t\tif (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n\t\t\t\tctx.drawImage(style, x - style.width / 2, y - style.height / 2, style.width, style.height);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (isNaN(radius) || radius <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (style) {\n\t\t// Default includes circle\n\t\tdefault:\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(x, y, radius, 0, Math.PI * 2);\n\t\t\tctx.closePath();\n\t\t\tctx.fill();\n\t\t\tbreak;\n\t\tcase 'triangle':\n\t\t\tctx.beginPath();\n\t\t\tedgeLength = 3 * radius / Math.sqrt(3);\n\t\t\theight = edgeLength * Math.sqrt(3) / 2;\n\t\t\tctx.moveTo(x - edgeLength / 2, y + height / 3);\n\t\t\tctx.lineTo(x + edgeLength / 2, y + height / 3);\n\t\t\tctx.lineTo(x, y - 2 * height / 3);\n\t\t\tctx.closePath();\n\t\t\tctx.fill();\n\t\t\tbreak;\n\t\tcase 'rect':\n\t\t\tsize = 1 / Math.SQRT2 * radius;\n\t\t\tctx.beginPath();\n\t\t\tctx.fillRect(x - size, y - size, 2 * size, 2 * size);\n\t\t\tctx.strokeRect(x - size, y - size, 2 * size, 2 * size);\n\t\t\tbreak;\n\t\tcase 'rectRounded':\n\t\t\tvar offset = radius / Math.SQRT2;\n\t\t\tvar leftX = x - offset;\n\t\t\tvar topY = y - offset;\n\t\t\tvar sideSize = Math.SQRT2 * radius;\n\t\t\tctx.beginPath();\n\t\t\tthis.roundedRect(ctx, leftX, topY, sideSize, sideSize, radius / 2);\n\t\t\tctx.closePath();\n\t\t\tctx.fill();\n\t\t\tbreak;\n\t\tcase 'rectRot':\n\t\t\tsize = 1 / Math.SQRT2 * radius;\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x - size, y);\n\t\t\tctx.lineTo(x, y + size);\n\t\t\tctx.lineTo(x + size, y);\n\t\t\tctx.lineTo(x, y - size);\n\t\t\tctx.closePath();\n\t\t\tctx.fill();\n\t\t\tbreak;\n\t\tcase 'cross':\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x, y + radius);\n\t\t\tctx.lineTo(x, y - radius);\n\t\t\tctx.moveTo(x - radius, y);\n\t\t\tctx.lineTo(x + radius, y);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'crossRot':\n\t\t\tctx.beginPath();\n\t\t\txOffset = Math.cos(Math.PI / 4) * radius;\n\t\t\tyOffset = Math.sin(Math.PI / 4) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tctx.moveTo(x - xOffset, y + yOffset);\n\t\t\tctx.lineTo(x + xOffset, y - yOffset);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'star':\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x, y + radius);\n\t\t\tctx.lineTo(x, y - radius);\n\t\t\tctx.moveTo(x - radius, y);\n\t\t\tctx.lineTo(x + radius, y);\n\t\t\txOffset = Math.cos(Math.PI / 4) * radius;\n\t\t\tyOffset = Math.sin(Math.PI / 4) * radius;\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\n\t\t\tctx.moveTo(x - xOffset, y + yOffset);\n\t\t\tctx.lineTo(x + xOffset, y - yOffset);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'line':\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x - radius, y);\n\t\t\tctx.lineTo(x + radius, y);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\tcase 'dash':\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x, y);\n\t\t\tctx.lineTo(x + radius, y);\n\t\t\tctx.closePath();\n\t\t\tbreak;\n\t\t}\n\n\t\tctx.stroke();\n\t},\n\n\tclipArea: function(ctx, area) {\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n\t\tctx.clip();\n\t},\n\n\tunclipArea: function(ctx) {\n\t\tctx.restore();\n\t},\n\n\tlineTo: function(ctx, previous, target, flip) {\n\t\tif (target.steppedLine) {\n\t\t\tif ((target.steppedLine === 'after' && !flip) || (target.steppedLine !== 'after' && flip)) {\n\t\t\t\tctx.lineTo(previous.x, target.y);\n\t\t\t} else {\n\t\t\t\tctx.lineTo(target.x, previous.y);\n\t\t\t}\n\t\t\tctx.lineTo(target.x, target.y);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!target.tension) {\n\t\t\tctx.lineTo(target.x, target.y);\n\t\t\treturn;\n\t\t}\n\n\t\tctx.bezierCurveTo(\n\t\t\tflip ? previous.controlPointPreviousX : previous.controlPointNextX,\n\t\t\tflip ? previous.controlPointPreviousY : previous.controlPointNextY,\n\t\t\tflip ? target.controlPointNextX : target.controlPointPreviousX,\n\t\t\tflip ? target.controlPointNextY : target.controlPointPreviousY,\n\t\t\ttarget.x,\n\t\t\ttarget.y);\n\t}\n};\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\n * @namespace Chart.helpers.clear\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.clear = exports.clear;\n\n/**\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\n * @namespace Chart.helpers.drawRoundedRectangle\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.drawRoundedRectangle = function(ctx) {\n\tctx.beginPath();\n\texports.roundedRect.apply(exports, arguments);\n\tctx.closePath();\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.canvas.js?");
  315. /***/ }),
  316. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js":
  317. /*!*********************************************************************************************!*\
  318. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js ***!
  319. \*********************************************************************************************/
  320. /*! no static exports found */
  321. /***/ (function(module, exports, __webpack_require__) {
  322. "use strict";
  323. eval("\n\n/**\n * @namespace Chart.helpers\n */\nvar helpers = {\n\t/**\n\t * An empty function that can be used, for example, for optional callback.\n\t */\n\tnoop: function() {},\n\n\t/**\n\t * Returns a unique id, sequentially generated from a global variable.\n\t * @returns {Number}\n\t * @function\n\t */\n\tuid: (function() {\n\t\tvar id = 0;\n\t\treturn function() {\n\t\t\treturn id++;\n\t\t};\n\t}()),\n\n\t/**\n\t * Returns true if `value` is neither null nor undefined, else returns false.\n\t * @param {*} value - The value to test.\n\t * @returns {Boolean}\n\t * @since 2.7.0\n\t */\n\tisNullOrUndef: function(value) {\n\t\treturn value === null || typeof value === 'undefined';\n\t},\n\n\t/**\n\t * Returns true if `value` is an array, else returns false.\n\t * @param {*} value - The value to test.\n\t * @returns {Boolean}\n\t * @function\n\t */\n\tisArray: Array.isArray ? Array.isArray : function(value) {\n\t\treturn Object.prototype.toString.call(value) === '[object Array]';\n\t},\n\n\t/**\n\t * Returns true if `value` is an object (excluding null), else returns false.\n\t * @param {*} value - The value to test.\n\t * @returns {Boolean}\n\t * @since 2.7.0\n\t */\n\tisObject: function(value) {\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\n\t},\n\n\t/**\n\t * Returns `value` if defined, else returns `defaultValue`.\n\t * @param {*} value - The value to return if defined.\n\t * @param {*} defaultValue - The value to return if `value` is undefined.\n\t * @returns {*}\n\t */\n\tvalueOrDefault: function(value, defaultValue) {\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\n\t},\n\n\t/**\n\t * Returns value at the given `index` in array if defined, else returns `defaultValue`.\n\t * @param {Array} value - The array to lookup for value at `index`.\n\t * @param {Number} index - The index in `value` to lookup for value.\n\t * @param {*} defaultValue - The value to return if `value[index]` is undefined.\n\t * @returns {*}\n\t */\n\tvalueAtIndexOrDefault: function(value, index, defaultValue) {\n\t\treturn helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\n\t},\n\n\t/**\n\t * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n\t * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n\t * @param {Function} fn - The function to call.\n\t * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\n\t * @param {Object} [thisArg] - The value of `this` provided for the call to `fn`.\n\t * @returns {*}\n\t */\n\tcallback: function(fn, args, thisArg) {\n\t\tif (fn && typeof fn.call === 'function') {\n\t\t\treturn fn.apply(thisArg, args);\n\t\t}\n\t},\n\n\t/**\n\t * Note(SB) for performance sake, this method should only be used when loopable type\n\t * is unknown or in none intensive code (not called often and small loopable). Else\n\t * it's preferable to use a regular for() loop and save extra function calls.\n\t * @param {Object|Array} loopable - The object or array to be iterated.\n\t * @param {Function} fn - The function to call for each item.\n\t * @param {Object} [thisArg] - The value of `this` provided for the call to `fn`.\n\t * @param {Boolean} [reverse] - If true, iterates backward on the loopable.\n\t */\n\teach: function(loopable, fn, thisArg, reverse) {\n\t\tvar i, len, keys;\n\t\tif (helpers.isArray(loopable)) {\n\t\t\tlen = loopable.length;\n\t\t\tif (reverse) {\n\t\t\t\tfor (i = len - 1; i >= 0; i--) {\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (helpers.isObject(loopable)) {\n\t\t\tkeys = Object.keys(loopable);\n\t\t\tlen = keys.length;\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tfn.call(thisArg, loopable[keys[i]], keys[i]);\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n\t * @see http://stackoverflow.com/a/14853974\n\t * @param {Array} a0 - The array to compare\n\t * @param {Array} a1 - The array to compare\n\t * @returns {Boolean}\n\t */\n\tarrayEquals: function(a0, a1) {\n\t\tvar i, ilen, v0, v1;\n\n\t\tif (!a0 || !a1 || a0.length !== a1.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (i = 0, ilen = a0.length; i < ilen; ++i) {\n\t\t\tv0 = a0[i];\n\t\t\tv1 = a1[i];\n\n\t\t\tif (v0 instanceof Array && v1 instanceof Array) {\n\t\t\t\tif (!helpers.arrayEquals(v0, v1)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (v0 !== v1) {\n\t\t\t\t// NOTE: two different object instances will never be equal: {x:20} != {x:20}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Returns a deep copy of `source` without keeping references on objects and arrays.\n\t * @param {*} source - The value to clone.\n\t * @returns {*}\n\t */\n\tclone: function(source) {\n\t\tif (helpers.isArray(source)) {\n\t\t\treturn source.map(helpers.clone);\n\t\t}\n\n\t\tif (helpers.isObject(source)) {\n\t\t\tvar target = {};\n\t\t\tvar keys = Object.keys(source);\n\t\t\tvar klen = keys.length;\n\t\t\tvar k = 0;\n\n\t\t\tfor (; k < klen; ++k) {\n\t\t\t\ttarget[keys[k]] = helpers.clone(source[keys[k]]);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}\n\n\t\treturn source;\n\t},\n\n\t/**\n\t * The default merger when Chart.helpers.merge is called without merger option.\n\t * Note(SB): this method is also used by configMerge and scaleMerge as fallback.\n\t * @private\n\t */\n\t_merger: function(key, target, source, options) {\n\t\tvar tval = target[key];\n\t\tvar sval = source[key];\n\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\n\t\t\thelpers.merge(tval, sval, options);\n\t\t} else {\n\t\t\ttarget[key] = helpers.clone(sval);\n\t\t}\n\t},\n\n\t/**\n\t * Merges source[key] in target[key] only if target[key] is undefined.\n\t * @private\n\t */\n\t_mergerIf: function(key, target, source) {\n\t\tvar tval = target[key];\n\t\tvar sval = source[key];\n\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\n\t\t\thelpers.mergeIf(tval, sval);\n\t\t} else if (!target.hasOwnProperty(key)) {\n\t\t\ttarget[key] = helpers.clone(sval);\n\t\t}\n\t},\n\n\t/**\n\t * Recursively deep copies `source` properties into `target` with the given `options`.\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n\t * @param {Object} target - The target object in which all sources are merged into.\n\t * @param {Object|Array(Object)} source - Object(s) to merge into `target`.\n\t * @param {Object} [options] - Merging options:\n\t * @param {Function} [options.merger] - The merge method (key, target, source, options)\n\t * @returns {Object} The `target` object.\n\t */\n\tmerge: function(target, source, options) {\n\t\tvar sources = helpers.isArray(source) ? source : [source];\n\t\tvar ilen = sources.length;\n\t\tvar merge, i, keys, klen, k;\n\n\t\tif (!helpers.isObject(target)) {\n\t\t\treturn target;\n\t\t}\n\n\t\toptions = options || {};\n\t\tmerge = options.merger || helpers._merger;\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\tsource = sources[i];\n\t\t\tif (!helpers.isObject(source)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tkeys = Object.keys(source);\n\t\t\tfor (k = 0, klen = keys.length; k < klen; ++k) {\n\t\t\t\tmerge(keys[k], target, source, options);\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t},\n\n\t/**\n\t * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n\t * @param {Object} target - The target object in which all sources are merged into.\n\t * @param {Object|Array(Object)} source - Object(s) to merge into `target`.\n\t * @returns {Object} The `target` object.\n\t */\n\tmergeIf: function(target, source) {\n\t\treturn helpers.merge(target, source, {merger: helpers._mergerIf});\n\t},\n\n\t/**\n\t * Applies the contents of two or more objects together into the first object.\n\t * @param {Object} target - The target object in which all objects are merged into.\n\t * @param {Object} arg1 - Object containing additional properties to merge in target.\n\t * @param {Object} argN - Additional objects containing properties to merge in target.\n\t * @returns {Object} The `target` object.\n\t */\n\textend: function(target) {\n\t\tvar setFn = function(value, key) {\n\t\t\ttarget[key] = value;\n\t\t};\n\t\tfor (var i = 1, ilen = arguments.length; i < ilen; ++i) {\n\t\t\thelpers.each(arguments[i], setFn);\n\t\t}\n\t\treturn target;\n\t},\n\n\t/**\n\t * Basic javascript inheritance based on the model created in Backbone.js\n\t */\n\tinherits: function(extensions) {\n\t\tvar me = this;\n\t\tvar ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\n\t\t\treturn me.apply(this, arguments);\n\t\t};\n\n\t\tvar Surrogate = function() {\n\t\t\tthis.constructor = ChartElement;\n\t\t};\n\n\t\tSurrogate.prototype = me.prototype;\n\t\tChartElement.prototype = new Surrogate();\n\t\tChartElement.extend = helpers.inherits;\n\n\t\tif (extensions) {\n\t\t\thelpers.extend(ChartElement.prototype, extensions);\n\t\t}\n\n\t\tChartElement.__super__ = me.prototype;\n\t\treturn ChartElement;\n\t}\n};\n\nmodule.exports = helpers;\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.helpers.callback instead.\n * @function Chart.helpers.callCallback\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\nhelpers.callCallback = helpers.callback;\n\n/**\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\n * @function Chart.helpers.indexOf\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.indexOf = function(array, item, fromIndex) {\n\treturn Array.prototype.indexOf.call(array, item, fromIndex);\n};\n\n/**\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\n * @function Chart.helpers.getValueOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.getValueOrDefault = helpers.valueOrDefault;\n\n/**\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\n * @function Chart.helpers.getValueAtIndexOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js?");
  324. /***/ }),
  325. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.easing.js":
  326. /*!***********************************************************************************************!*\
  327. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.easing.js ***!
  328. \***********************************************************************************************/
  329. /*! no static exports found */
  330. /***/ (function(module, exports, __webpack_require__) {
  331. "use strict";
  332. eval("\n\nvar helpers = __webpack_require__(/*! ./helpers.core */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js\");\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easingEffects\n * @see http://www.robertpenner.com/easing/\n */\nvar effects = {\n\tlinear: function(t) {\n\t\treturn t;\n\t},\n\n\teaseInQuad: function(t) {\n\t\treturn t * t;\n\t},\n\n\teaseOutQuad: function(t) {\n\t\treturn -t * (t - 2);\n\t},\n\n\teaseInOutQuad: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t;\n\t\t}\n\t\treturn -0.5 * ((--t) * (t - 2) - 1);\n\t},\n\n\teaseInCubic: function(t) {\n\t\treturn t * t * t;\n\t},\n\n\teaseOutCubic: function(t) {\n\t\treturn (t = t - 1) * t * t + 1;\n\t},\n\n\teaseInOutCubic: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t * t;\n\t\t}\n\t\treturn 0.5 * ((t -= 2) * t * t + 2);\n\t},\n\n\teaseInQuart: function(t) {\n\t\treturn t * t * t * t;\n\t},\n\n\teaseOutQuart: function(t) {\n\t\treturn -((t = t - 1) * t * t * t - 1);\n\t},\n\n\teaseInOutQuart: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t * t * t;\n\t\t}\n\t\treturn -0.5 * ((t -= 2) * t * t * t - 2);\n\t},\n\n\teaseInQuint: function(t) {\n\t\treturn t * t * t * t * t;\n\t},\n\n\teaseOutQuint: function(t) {\n\t\treturn (t = t - 1) * t * t * t * t + 1;\n\t},\n\n\teaseInOutQuint: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * t * t * t * t * t;\n\t\t}\n\t\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\n\t},\n\n\teaseInSine: function(t) {\n\t\treturn -Math.cos(t * (Math.PI / 2)) + 1;\n\t},\n\n\teaseOutSine: function(t) {\n\t\treturn Math.sin(t * (Math.PI / 2));\n\t},\n\n\teaseInOutSine: function(t) {\n\t\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\n\t},\n\n\teaseInExpo: function(t) {\n\t\treturn (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\n\t},\n\n\teaseOutExpo: function(t) {\n\t\treturn (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\n\t},\n\n\teaseInOutExpo: function(t) {\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (t === 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * Math.pow(2, 10 * (t - 1));\n\t\t}\n\t\treturn 0.5 * (-Math.pow(2, -10 * --t) + 2);\n\t},\n\n\teaseInCirc: function(t) {\n\t\tif (t >= 1) {\n\t\t\treturn t;\n\t\t}\n\t\treturn -(Math.sqrt(1 - t * t) - 1);\n\t},\n\n\teaseOutCirc: function(t) {\n\t\treturn Math.sqrt(1 - (t = t - 1) * t);\n\t},\n\n\teaseInOutCirc: function(t) {\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn -0.5 * (Math.sqrt(1 - t * t) - 1);\n\t\t}\n\t\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n\t},\n\n\teaseInElastic: function(t) {\n\t\tvar s = 1.70158;\n\t\tvar p = 0;\n\t\tvar a = 1;\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (t === 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (!p) {\n\t\t\tp = 0.3;\n\t\t}\n\t\tif (a < 1) {\n\t\t\ta = 1;\n\t\t\ts = p / 4;\n\t\t} else {\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t}\n\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n\t},\n\n\teaseOutElastic: function(t) {\n\t\tvar s = 1.70158;\n\t\tvar p = 0;\n\t\tvar a = 1;\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (t === 1) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (!p) {\n\t\t\tp = 0.3;\n\t\t}\n\t\tif (a < 1) {\n\t\t\ta = 1;\n\t\t\ts = p / 4;\n\t\t} else {\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t}\n\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\n\t},\n\n\teaseInOutElastic: function(t) {\n\t\tvar s = 1.70158;\n\t\tvar p = 0;\n\t\tvar a = 1;\n\t\tif (t === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ((t /= 0.5) === 2) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (!p) {\n\t\t\tp = 0.45;\n\t\t}\n\t\tif (a < 1) {\n\t\t\ta = 1;\n\t\t\ts = p / 4;\n\t\t} else {\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n\t\t}\n\t\tif (t < 1) {\n\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n\t\t}\n\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\n\t},\n\teaseInBack: function(t) {\n\t\tvar s = 1.70158;\n\t\treturn t * t * ((s + 1) * t - s);\n\t},\n\n\teaseOutBack: function(t) {\n\t\tvar s = 1.70158;\n\t\treturn (t = t - 1) * t * ((s + 1) * t + s) + 1;\n\t},\n\n\teaseInOutBack: function(t) {\n\t\tvar s = 1.70158;\n\t\tif ((t /= 0.5) < 1) {\n\t\t\treturn 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n\t\t}\n\t\treturn 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n\t},\n\n\teaseInBounce: function(t) {\n\t\treturn 1 - effects.easeOutBounce(1 - t);\n\t},\n\n\teaseOutBounce: function(t) {\n\t\tif (t < (1 / 2.75)) {\n\t\t\treturn 7.5625 * t * t;\n\t\t}\n\t\tif (t < (2 / 2.75)) {\n\t\t\treturn 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\n\t\t}\n\t\tif (t < (2.5 / 2.75)) {\n\t\t\treturn 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\n\t\t}\n\t\treturn 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\n\t},\n\n\teaseInOutBounce: function(t) {\n\t\tif (t < 0.5) {\n\t\t\treturn effects.easeInBounce(t * 2) * 0.5;\n\t\t}\n\t\treturn effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\n\t}\n};\n\nmodule.exports = {\n\teffects: effects\n};\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\n * @function Chart.helpers.easingEffects\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.easingEffects = effects;\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.easing.js?");
  333. /***/ }),
  334. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.options.js":
  335. /*!************************************************************************************************!*\
  336. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.options.js ***!
  337. \************************************************************************************************/
  338. /*! no static exports found */
  339. /***/ (function(module, exports, __webpack_require__) {
  340. "use strict";
  341. eval("\n\nvar helpers = __webpack_require__(/*! ./helpers.core */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js\");\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\nmodule.exports = {\n\t/**\n\t * Converts the given line height `value` in pixels for a specific font `size`.\n\t * @param {Number|String} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n\t * @param {Number} size - The font size (in pixels) used to resolve relative `value`.\n\t * @returns {Number} The effective line height in pixels (size * 1.2 if value is invalid).\n\t * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n\t * @since 2.7.0\n\t */\n\ttoLineHeight: function(value, size) {\n\t\tvar matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\n\t\tif (!matches || matches[1] === 'normal') {\n\t\t\treturn size * 1.2;\n\t\t}\n\n\t\tvalue = +matches[2];\n\n\t\tswitch (matches[3]) {\n\t\tcase 'px':\n\t\t\treturn value;\n\t\tcase '%':\n\t\t\tvalue /= 100;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\treturn size * value;\n\t},\n\n\t/**\n\t * Converts the given value into a padding object with pre-computed width/height.\n\t * @param {Number|Object} value - If a number, set the value to all TRBL component,\n\t * else, if and object, use defined properties and sets undefined ones to 0.\n\t * @returns {Object} The padding values (top, right, bottom, left, width, height)\n\t * @since 2.7.0\n\t */\n\ttoPadding: function(value) {\n\t\tvar t, r, b, l;\n\n\t\tif (helpers.isObject(value)) {\n\t\t\tt = +value.top || 0;\n\t\t\tr = +value.right || 0;\n\t\t\tb = +value.bottom || 0;\n\t\t\tl = +value.left || 0;\n\t\t} else {\n\t\t\tt = r = b = l = +value || 0;\n\t\t}\n\n\t\treturn {\n\t\t\ttop: t,\n\t\t\tright: r,\n\t\t\tbottom: b,\n\t\t\tleft: l,\n\t\t\theight: t + b,\n\t\t\twidth: l + r\n\t\t};\n\t},\n\n\t/**\n\t * Evaluates the given `inputs` sequentially and returns the first defined value.\n\t * @param {Array[]} inputs - An array of values, falling back to the last value.\n\t * @param {Object} [context] - If defined and the current value is a function, the value\n\t * is called with `context` as first argument and the result becomes the new input.\n\t * @param {Number} [index] - If defined and the current value is an array, the value\n\t * at `index` become the new input.\n\t * @since 2.7.0\n\t */\n\tresolve: function(inputs, context, index) {\n\t\tvar i, ilen, value;\n\n\t\tfor (i = 0, ilen = inputs.length; i < ilen; ++i) {\n\t\t\tvalue = inputs[i];\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (context !== undefined && typeof value === 'function') {\n\t\t\t\tvalue = value(context);\n\t\t\t}\n\t\t\tif (index !== undefined && helpers.isArray(value)) {\n\t\t\t\tvalue = value[index];\n\t\t\t}\n\t\t\tif (value !== undefined) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.options.js?");
  342. /***/ }),
  343. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js":
  344. /*!**************************************************************************************!*\
  345. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js ***!
  346. \**************************************************************************************/
  347. /*! no static exports found */
  348. /***/ (function(module, exports, __webpack_require__) {
  349. "use strict";
  350. eval("\n\nmodule.exports = __webpack_require__(/*! ./helpers.core */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.core.js\");\nmodule.exports.easing = __webpack_require__(/*! ./helpers.easing */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.easing.js\");\nmodule.exports.canvas = __webpack_require__(/*! ./helpers.canvas */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.canvas.js\");\nmodule.exports.options = __webpack_require__(/*! ./helpers.options */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/helpers.options.js\");\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js?");
  351. /***/ }),
  352. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.basic.js":
  353. /*!*************************************************************************************************!*\
  354. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.basic.js ***!
  355. \*************************************************************************************************/
  356. /*! no static exports found */
  357. /***/ (function(module, exports) {
  358. eval("/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nmodule.exports = {\n\tacquireContext: function(item) {\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\treturn item && item.getContext('2d') || null;\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.basic.js?");
  359. /***/ }),
  360. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.dom.js":
  361. /*!***********************************************************************************************!*\
  362. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.dom.js ***!
  363. \***********************************************************************************************/
  364. /*! no static exports found */
  365. /***/ (function(module, exports, __webpack_require__) {
  366. "use strict";
  367. eval("/**\n * Chart.Platform implementation for targeting a web browser\n */\n\n\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\nvar EXPANDO_KEY = '$chartjs';\nvar CSS_PREFIX = 'chartjs-';\nvar CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\nvar CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\nvar ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nvar EVENT_TYPES = {\n\ttouchstart: 'mousedown',\n\ttouchmove: 'mousemove',\n\ttouchend: 'mouseup',\n\tpointerenter: 'mouseenter',\n\tpointerdown: 'mousedown',\n\tpointermove: 'mousemove',\n\tpointerup: 'mouseup',\n\tpointerleave: 'mouseout',\n\tpointerout: 'mouseout'\n};\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns {Number} Size in pixels or undefined if unknown.\n */\nfunction readUsedSize(element, property) {\n\tvar value = helpers.getStyle(element, property);\n\tvar matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n\treturn matches ? Number(matches[1]) : undefined;\n}\n\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n */\nfunction initCanvas(canvas, config) {\n\tvar style = canvas.style;\n\n\t// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n\t// returns null or '' if no explicit value has been set to the canvas attribute.\n\tvar renderHeight = canvas.getAttribute('height');\n\tvar renderWidth = canvas.getAttribute('width');\n\n\t// Chart.js modifies some canvas values that we want to restore on destroy\n\tcanvas[EXPANDO_KEY] = {\n\t\tinitial: {\n\t\t\theight: renderHeight,\n\t\t\twidth: renderWidth,\n\t\t\tstyle: {\n\t\t\t\tdisplay: style.display,\n\t\t\t\theight: style.height,\n\t\t\t\twidth: style.width\n\t\t\t}\n\t\t}\n\t};\n\n\t// Force canvas to display as block to avoid extra space caused by inline\n\t// elements, which would interfere with the responsive resize process.\n\t// https://github.com/chartjs/Chart.js/issues/2538\n\tstyle.display = style.display || 'block';\n\n\tif (renderWidth === null || renderWidth === '') {\n\t\tvar displayWidth = readUsedSize(canvas, 'width');\n\t\tif (displayWidth !== undefined) {\n\t\t\tcanvas.width = displayWidth;\n\t\t}\n\t}\n\n\tif (renderHeight === null || renderHeight === '') {\n\t\tif (canvas.style.height === '') {\n\t\t\t// If no explicit render height and style height, let's apply the aspect ratio,\n\t\t\t// which one can be specified by the user but also by charts as default option\n\t\t\t// (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n\t\t\tcanvas.height = canvas.width / (config.options.aspectRatio || 2);\n\t\t} else {\n\t\t\tvar displayHeight = readUsedSize(canvas, 'height');\n\t\t\tif (displayWidth !== undefined) {\n\t\t\t\tcanvas.height = displayHeight;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn canvas;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nvar supportsEventListenerOptions = (function() {\n\tvar supports = false;\n\ttry {\n\t\tvar options = Object.defineProperty({}, 'passive', {\n\t\t\tget: function() {\n\t\t\t\tsupports = true;\n\t\t\t}\n\t\t});\n\t\twindow.addEventListener('e', null, options);\n\t} catch (e) {\n\t\t// continue regardless of error\n\t}\n\treturn supports;\n}());\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nvar eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addEventListener(node, type, listener) {\n\tnode.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeEventListener(node, type, listener) {\n\tnode.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction createEvent(type, chart, x, y, nativeEvent) {\n\treturn {\n\t\ttype: type,\n\t\tchart: chart,\n\t\tnative: nativeEvent || null,\n\t\tx: x !== undefined ? x : null,\n\t\ty: y !== undefined ? y : null,\n\t};\n}\n\nfunction fromNativeEvent(event, chart) {\n\tvar type = EVENT_TYPES[event.type] || event.type;\n\tvar pos = helpers.getRelativePosition(event, chart);\n\treturn createEvent(type, chart, pos.x, pos.y, event);\n}\n\nfunction throttled(fn, thisArg) {\n\tvar ticking = false;\n\tvar args = [];\n\n\treturn function() {\n\t\targs = Array.prototype.slice.call(arguments);\n\t\tthisArg = thisArg || this;\n\n\t\tif (!ticking) {\n\t\t\tticking = true;\n\t\t\thelpers.requestAnimFrame.call(window, function() {\n\t\t\t\tticking = false;\n\t\t\t\tfn.apply(thisArg, args);\n\t\t\t});\n\t\t}\n\t};\n}\n\n// Implementation based on https://github.com/marcj/css-element-queries\nfunction createResizer(handler) {\n\tvar resizer = document.createElement('div');\n\tvar cls = CSS_PREFIX + 'size-monitor';\n\tvar maxSize = 1000000;\n\tvar style =\n\t\t'position:absolute;' +\n\t\t'left:0;' +\n\t\t'top:0;' +\n\t\t'right:0;' +\n\t\t'bottom:0;' +\n\t\t'overflow:hidden;' +\n\t\t'pointer-events:none;' +\n\t\t'visibility:hidden;' +\n\t\t'z-index:-1;';\n\n\tresizer.style.cssText = style;\n\tresizer.className = cls;\n\tresizer.innerHTML =\n\t\t'<div class=\"' + cls + '-expand\" style=\"' + style + '\">' +\n\t\t\t'<div style=\"' +\n\t\t\t\t'position:absolute;' +\n\t\t\t\t'width:' + maxSize + 'px;' +\n\t\t\t\t'height:' + maxSize + 'px;' +\n\t\t\t\t'left:0;' +\n\t\t\t\t'top:0\">' +\n\t\t\t'</div>' +\n\t\t'</div>' +\n\t\t'<div class=\"' + cls + '-shrink\" style=\"' + style + '\">' +\n\t\t\t'<div style=\"' +\n\t\t\t\t'position:absolute;' +\n\t\t\t\t'width:200%;' +\n\t\t\t\t'height:200%;' +\n\t\t\t\t'left:0; ' +\n\t\t\t\t'top:0\">' +\n\t\t\t'</div>' +\n\t\t'</div>';\n\n\tvar expand = resizer.childNodes[0];\n\tvar shrink = resizer.childNodes[1];\n\n\tresizer._reset = function() {\n\t\texpand.scrollLeft = maxSize;\n\t\texpand.scrollTop = maxSize;\n\t\tshrink.scrollLeft = maxSize;\n\t\tshrink.scrollTop = maxSize;\n\t};\n\tvar onScroll = function() {\n\t\tresizer._reset();\n\t\thandler();\n\t};\n\n\taddEventListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\n\taddEventListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\n\n\treturn resizer;\n}\n\n// https://davidwalsh.name/detect-node-insertion\nfunction watchForRender(node, handler) {\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\tvar proxy = expando.renderProxy = function(e) {\n\t\tif (e.animationName === CSS_RENDER_ANIMATION) {\n\t\t\thandler();\n\t\t}\n\t};\n\n\thelpers.each(ANIMATION_START_EVENTS, function(type) {\n\t\taddEventListener(node, type, proxy);\n\t});\n\n\t// #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class\n\t// is removed then added back immediately (same animation frame?). Accessing the\n\t// `offsetParent` property will force a reflow and re-evaluate the CSS animation.\n\t// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics\n\t// https://github.com/chartjs/Chart.js/issues/4737\n\texpando.reflow = !!node.offsetParent;\n\n\tnode.classList.add(CSS_RENDER_MONITOR);\n}\n\nfunction unwatchForRender(node) {\n\tvar expando = node[EXPANDO_KEY] || {};\n\tvar proxy = expando.renderProxy;\n\n\tif (proxy) {\n\t\thelpers.each(ANIMATION_START_EVENTS, function(type) {\n\t\t\tremoveEventListener(node, type, proxy);\n\t\t});\n\n\t\tdelete expando.renderProxy;\n\t}\n\n\tnode.classList.remove(CSS_RENDER_MONITOR);\n}\n\nfunction addResizeListener(node, listener, chart) {\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\n\t// Let's keep track of this added resizer and thus avoid DOM query when removing it.\n\tvar resizer = expando.resizer = createResizer(throttled(function() {\n\t\tif (expando.resizer) {\n\t\t\treturn listener(createEvent('resize', chart));\n\t\t}\n\t}));\n\n\t// The resizer needs to be attached to the node parent, so we first need to be\n\t// sure that `node` is attached to the DOM before injecting the resizer element.\n\twatchForRender(node, function() {\n\t\tif (expando.resizer) {\n\t\t\tvar container = node.parentNode;\n\t\t\tif (container && container !== resizer.parentNode) {\n\t\t\t\tcontainer.insertBefore(resizer, container.firstChild);\n\t\t\t}\n\n\t\t\t// The container size might have changed, let's reset the resizer state.\n\t\t\tresizer._reset();\n\t\t}\n\t});\n}\n\nfunction removeResizeListener(node) {\n\tvar expando = node[EXPANDO_KEY] || {};\n\tvar resizer = expando.resizer;\n\n\tdelete expando.resizer;\n\tunwatchForRender(node);\n\n\tif (resizer && resizer.parentNode) {\n\t\tresizer.parentNode.removeChild(resizer);\n\t}\n}\n\nfunction injectCSS(platform, css) {\n\t// http://stackoverflow.com/q/3922139\n\tvar style = platform._style || document.createElement('style');\n\tif (!platform._style) {\n\t\tplatform._style = style;\n\t\tcss = '/* Chart.js */\\n' + css;\n\t\tstyle.setAttribute('type', 'text/css');\n\t\tdocument.getElementsByTagName('head')[0].appendChild(style);\n\t}\n\n\tstyle.appendChild(document.createTextNode(css));\n}\n\nmodule.exports = {\n\t/**\n\t * This property holds whether this platform is enabled for the current environment.\n\t * Currently used by platform.js to select the proper implementation.\n\t * @private\n\t */\n\t_enabled: typeof window !== 'undefined' && typeof document !== 'undefined',\n\n\tinitialize: function() {\n\t\tvar keyframes = 'from{opacity:0.99}to{opacity:1}';\n\n\t\tinjectCSS(this,\n\t\t\t// DOM rendering detection\n\t\t\t// https://davidwalsh.name/detect-node-insertion\n\t\t\t'@-webkit-keyframes ' + CSS_RENDER_ANIMATION + '{' + keyframes + '}' +\n\t\t\t'@keyframes ' + CSS_RENDER_ANIMATION + '{' + keyframes + '}' +\n\t\t\t'.' + CSS_RENDER_MONITOR + '{' +\n\t\t\t\t'-webkit-animation:' + CSS_RENDER_ANIMATION + ' 0.001s;' +\n\t\t\t\t'animation:' + CSS_RENDER_ANIMATION + ' 0.001s;' +\n\t\t\t'}'\n\t\t);\n\t},\n\n\tacquireContext: function(item, config) {\n\t\tif (typeof item === 'string') {\n\t\t\titem = document.getElementById(item);\n\t\t} else if (item.length) {\n\t\t\t// Support for array based queries (such as jQuery)\n\t\t\titem = item[0];\n\t\t}\n\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\t// To prevent canvas fingerprinting, some add-ons undefine the getContext\n\t\t// method, for example: https://github.com/kkapsner/CanvasBlocker\n\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\tvar context = item && item.getContext && item.getContext('2d');\n\n\t\t// `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is\n\t\t// inside an iframe or when running in a protected environment. We could guess the\n\t\t// types from their toString() value but let's keep things flexible and assume it's\n\t\t// a sufficient condition if the item has a context2D which has item as `canvas`.\n\t\t// https://github.com/chartjs/Chart.js/issues/3887\n\t\t// https://github.com/chartjs/Chart.js/issues/4102\n\t\t// https://github.com/chartjs/Chart.js/issues/4152\n\t\tif (context && context.canvas === item) {\n\t\t\tinitCanvas(item, config);\n\t\t\treturn context;\n\t\t}\n\n\t\treturn null;\n\t},\n\n\treleaseContext: function(context) {\n\t\tvar canvas = context.canvas;\n\t\tif (!canvas[EXPANDO_KEY]) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar initial = canvas[EXPANDO_KEY].initial;\n\t\t['height', 'width'].forEach(function(prop) {\n\t\t\tvar value = initial[prop];\n\t\t\tif (helpers.isNullOrUndef(value)) {\n\t\t\t\tcanvas.removeAttribute(prop);\n\t\t\t} else {\n\t\t\t\tcanvas.setAttribute(prop, value);\n\t\t\t}\n\t\t});\n\n\t\thelpers.each(initial.style || {}, function(value, key) {\n\t\t\tcanvas.style[key] = value;\n\t\t});\n\n\t\t// The canvas render size might have been changed (and thus the state stack discarded),\n\t\t// we can't use save() and restore() to restore the initial state. So make sure that at\n\t\t// least the canvas context is reset to the default state by setting the canvas width.\n\t\t// https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n\t\tcanvas.width = canvas.width;\n\n\t\tdelete canvas[EXPANDO_KEY];\n\t},\n\n\taddEventListener: function(chart, type, listener) {\n\t\tvar canvas = chart.canvas;\n\t\tif (type === 'resize') {\n\t\t\t// Note: the resize event is not supported on all browsers.\n\t\t\taddResizeListener(canvas, listener, chart);\n\t\t\treturn;\n\t\t}\n\n\t\tvar expando = listener[EXPANDO_KEY] || (listener[EXPANDO_KEY] = {});\n\t\tvar proxies = expando.proxies || (expando.proxies = {});\n\t\tvar proxy = proxies[chart.id + '_' + type] = function(event) {\n\t\t\tlistener(fromNativeEvent(event, chart));\n\t\t};\n\n\t\taddEventListener(canvas, type, proxy);\n\t},\n\n\tremoveEventListener: function(chart, type, listener) {\n\t\tvar canvas = chart.canvas;\n\t\tif (type === 'resize') {\n\t\t\t// Note: the resize event is not supported on all browsers.\n\t\t\tremoveResizeListener(canvas, listener);\n\t\t\treturn;\n\t\t}\n\n\t\tvar expando = listener[EXPANDO_KEY] || {};\n\t\tvar proxies = expando.proxies || {};\n\t\tvar proxy = proxies[chart.id + '_' + type];\n\t\tif (!proxy) {\n\t\t\treturn;\n\t\t}\n\n\t\tremoveEventListener(canvas, type, proxy);\n\t}\n};\n\n// DEPRECATIONS\n\n/**\n * Provided for backward compatibility, use EventTarget.addEventListener instead.\n * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n * @function Chart.helpers.addEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.addEvent = addEventListener;\n\n/**\n * Provided for backward compatibility, use EventTarget.removeEventListener instead.\n * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener\n * @function Chart.helpers.removeEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\nhelpers.removeEvent = removeEventListener;\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.dom.js?");
  368. /***/ }),
  369. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.js":
  370. /*!*******************************************************************************************!*\
  371. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.js ***!
  372. \*******************************************************************************************/
  373. /*! no static exports found */
  374. /***/ (function(module, exports, __webpack_require__) {
  375. "use strict";
  376. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar basic = __webpack_require__(/*! ./platform.basic */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.basic.js\");\nvar dom = __webpack_require__(/*! ./platform.dom */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.dom.js\");\n\n// @TODO Make possible to select another platform at build time.\nvar implementation = dom._enabled ? dom : basic;\n\n/**\n * @namespace Chart.platform\n * @see https://chartjs.gitbooks.io/proposals/content/Platform.html\n * @since 2.4.0\n */\nmodule.exports = helpers.extend({\n\t/**\n\t * @since 2.7.0\n\t */\n\tinitialize: function() {},\n\n\t/**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {*} item - The native item from which to acquire context (platform specific)\n\t * @param {Object} options - The chart options\n\t * @returns {CanvasRenderingContext2D} context2d instance\n\t */\n\tacquireContext: function() {},\n\n\t/**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {Boolean} true if the method succeeded, else false\n\t */\n\treleaseContext: function() {},\n\n\t/**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {String} type - The ({@link IEvent}) type to listen for\n\t * @param {Function} listener - Receives a notification (an object that implements\n\t * the {@link IEvent} interface) when an event of the specified type occurs.\n\t */\n\taddEventListener: function() {},\n\n\t/**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart -Chart from which to remove the listener\n\t * @param {String} type - The ({@link IEvent}) type to remove\n\t * @param {Function} listener - The listener function to remove from the event target.\n\t */\n\tremoveEventListener: function() {}\n\n}, implementation);\n\n/**\n * @interface IPlatform\n * Allows abstracting platform dependencies away from the chart\n * @borrows Chart.platform.acquireContext as acquireContext\n * @borrows Chart.platform.releaseContext as releaseContext\n * @borrows Chart.platform.addEventListener as addEventListener\n * @borrows Chart.platform.removeEventListener as removeEventListener\n */\n\n/**\n * @interface IEvent\n * @prop {String} type - The event type name, possible values are:\n * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout',\n * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize'\n * @prop {*} native - The original native event (null for emulated events, e.g. 'resize')\n * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events)\n * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events)\n */\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/platforms/platform.js?");
  377. /***/ }),
  378. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/index.js":
  379. /*!**************************************************************************************!*\
  380. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/index.js ***!
  381. \**************************************************************************************/
  382. /*! no static exports found */
  383. /***/ (function(module, exports, __webpack_require__) {
  384. "use strict";
  385. eval("\n\nmodule.exports = {};\nmodule.exports.filler = __webpack_require__(/*! ./plugin.filler */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.filler.js\");\nmodule.exports.legend = __webpack_require__(/*! ./plugin.legend */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.legend.js\");\nmodule.exports.title = __webpack_require__(/*! ./plugin.title */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.title.js\");\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/index.js?");
  386. /***/ }),
  387. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.filler.js":
  388. /*!**********************************************************************************************!*\
  389. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.filler.js ***!
  390. \**********************************************************************************************/
  391. /*! no static exports found */
  392. /***/ (function(module, exports, __webpack_require__) {
  393. "use strict";
  394. eval("/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\n\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar elements = __webpack_require__(/*! ../elements/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/elements/index.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\ndefaults._set('global', {\n\tplugins: {\n\t\tfiller: {\n\t\t\tpropagate: true\n\t\t}\n\t}\n});\n\nvar mappers = {\n\tdataset: function(source) {\n\t\tvar index = source.fill;\n\t\tvar chart = source.chart;\n\t\tvar meta = chart.getDatasetMeta(index);\n\t\tvar visible = meta && chart.isDatasetVisible(index);\n\t\tvar points = (visible && meta.dataset._children) || [];\n\t\tvar length = points.length || 0;\n\n\t\treturn !length ? null : function(point, i) {\n\t\t\treturn (i < length && points[i]._view) || null;\n\t\t};\n\t},\n\n\tboundary: function(source) {\n\t\tvar boundary = source.boundary;\n\t\tvar x = boundary ? boundary.x : null;\n\t\tvar y = boundary ? boundary.y : null;\n\n\t\treturn function(point) {\n\t\t\treturn {\n\t\t\t\tx: x === null ? point.x : x,\n\t\t\t\ty: y === null ? point.y : y,\n\t\t\t};\n\t\t};\n\t}\n};\n\n// @todo if (fill[0] === '#')\nfunction decodeFill(el, index, count) {\n\tvar model = el._model || {};\n\tvar fill = model.fill;\n\tvar target;\n\n\tif (fill === undefined) {\n\t\tfill = !!model.backgroundColor;\n\t}\n\n\tif (fill === false || fill === null) {\n\t\treturn false;\n\t}\n\n\tif (fill === true) {\n\t\treturn 'origin';\n\t}\n\n\ttarget = parseFloat(fill, 10);\n\tif (isFinite(target) && Math.floor(target) === target) {\n\t\tif (fill[0] === '-' || fill[0] === '+') {\n\t\t\ttarget = index + target;\n\t\t}\n\n\t\tif (target === index || target < 0 || target >= count) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tswitch (fill) {\n\t// compatibility\n\tcase 'bottom':\n\t\treturn 'start';\n\tcase 'top':\n\t\treturn 'end';\n\tcase 'zero':\n\t\treturn 'origin';\n\t// supported boundaries\n\tcase 'origin':\n\tcase 'start':\n\tcase 'end':\n\t\treturn fill;\n\t// invalid fill values\n\tdefault:\n\t\treturn false;\n\t}\n}\n\nfunction computeBoundary(source) {\n\tvar model = source.el._model || {};\n\tvar scale = source.el._scale || {};\n\tvar fill = source.fill;\n\tvar target = null;\n\tvar horizontal;\n\n\tif (isFinite(fill)) {\n\t\treturn null;\n\t}\n\n\t// Backward compatibility: until v3, we still need to support boundary values set on\n\t// the model (scaleTop, scaleBottom and scaleZero) because some external plugins and\n\t// controllers might still use it (e.g. the Smith chart).\n\n\tif (fill === 'start') {\n\t\ttarget = model.scaleBottom === undefined ? scale.bottom : model.scaleBottom;\n\t} else if (fill === 'end') {\n\t\ttarget = model.scaleTop === undefined ? scale.top : model.scaleTop;\n\t} else if (model.scaleZero !== undefined) {\n\t\ttarget = model.scaleZero;\n\t} else if (scale.getBasePosition) {\n\t\ttarget = scale.getBasePosition();\n\t} else if (scale.getBasePixel) {\n\t\ttarget = scale.getBasePixel();\n\t}\n\n\tif (target !== undefined && target !== null) {\n\t\tif (target.x !== undefined && target.y !== undefined) {\n\t\t\treturn target;\n\t\t}\n\n\t\tif (typeof target === 'number' && isFinite(target)) {\n\t\t\thorizontal = scale.isHorizontal();\n\t\t\treturn {\n\t\t\t\tx: horizontal ? target : null,\n\t\t\t\ty: horizontal ? null : target\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction resolveTarget(sources, index, propagate) {\n\tvar source = sources[index];\n\tvar fill = source.fill;\n\tvar visited = [index];\n\tvar target;\n\n\tif (!propagate) {\n\t\treturn fill;\n\t}\n\n\twhile (fill !== false && visited.indexOf(fill) === -1) {\n\t\tif (!isFinite(fill)) {\n\t\t\treturn fill;\n\t\t}\n\n\t\ttarget = sources[fill];\n\t\tif (!target) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (target.visible) {\n\t\t\treturn fill;\n\t\t}\n\n\t\tvisited.push(fill);\n\t\tfill = target.fill;\n\t}\n\n\treturn false;\n}\n\nfunction createMapper(source) {\n\tvar fill = source.fill;\n\tvar type = 'dataset';\n\n\tif (fill === false) {\n\t\treturn null;\n\t}\n\n\tif (!isFinite(fill)) {\n\t\ttype = 'boundary';\n\t}\n\n\treturn mappers[type](source);\n}\n\nfunction isDrawable(point) {\n\treturn point && !point.skip;\n}\n\nfunction drawArea(ctx, curve0, curve1, len0, len1) {\n\tvar i;\n\n\tif (!len0 || !len1) {\n\t\treturn;\n\t}\n\n\t// building first area curve (normal)\n\tctx.moveTo(curve0[0].x, curve0[0].y);\n\tfor (i = 1; i < len0; ++i) {\n\t\thelpers.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);\n\t}\n\n\t// joining the two area curves\n\tctx.lineTo(curve1[len1 - 1].x, curve1[len1 - 1].y);\n\n\t// building opposite area curve (reverse)\n\tfor (i = len1 - 1; i > 0; --i) {\n\t\thelpers.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);\n\t}\n}\n\nfunction doFill(ctx, points, mapper, view, color, loop) {\n\tvar count = points.length;\n\tvar span = view.spanGaps;\n\tvar curve0 = [];\n\tvar curve1 = [];\n\tvar len0 = 0;\n\tvar len1 = 0;\n\tvar i, ilen, index, p0, p1, d0, d1;\n\n\tctx.beginPath();\n\n\tfor (i = 0, ilen = (count + !!loop); i < ilen; ++i) {\n\t\tindex = i % count;\n\t\tp0 = points[index]._view;\n\t\tp1 = mapper(p0, index, view);\n\t\td0 = isDrawable(p0);\n\t\td1 = isDrawable(p1);\n\n\t\tif (d0 && d1) {\n\t\t\tlen0 = curve0.push(p0);\n\t\t\tlen1 = curve1.push(p1);\n\t\t} else if (len0 && len1) {\n\t\t\tif (!span) {\n\t\t\t\tdrawArea(ctx, curve0, curve1, len0, len1);\n\t\t\t\tlen0 = len1 = 0;\n\t\t\t\tcurve0 = [];\n\t\t\t\tcurve1 = [];\n\t\t\t} else {\n\t\t\t\tif (d0) {\n\t\t\t\t\tcurve0.push(p0);\n\t\t\t\t}\n\t\t\t\tif (d1) {\n\t\t\t\t\tcurve1.push(p1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdrawArea(ctx, curve0, curve1, len0, len1);\n\n\tctx.closePath();\n\tctx.fillStyle = color;\n\tctx.fill();\n}\n\nmodule.exports = {\n\tid: 'filler',\n\n\tafterDatasetsUpdate: function(chart, options) {\n\t\tvar count = (chart.data.datasets || []).length;\n\t\tvar propagate = options.propagate;\n\t\tvar sources = [];\n\t\tvar meta, i, el, source;\n\n\t\tfor (i = 0; i < count; ++i) {\n\t\t\tmeta = chart.getDatasetMeta(i);\n\t\t\tel = meta.dataset;\n\t\t\tsource = null;\n\n\t\t\tif (el && el._model && el instanceof elements.Line) {\n\t\t\t\tsource = {\n\t\t\t\t\tvisible: chart.isDatasetVisible(i),\n\t\t\t\t\tfill: decodeFill(el, i, count),\n\t\t\t\t\tchart: chart,\n\t\t\t\t\tel: el\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tmeta.$filler = source;\n\t\t\tsources.push(source);\n\t\t}\n\n\t\tfor (i = 0; i < count; ++i) {\n\t\t\tsource = sources[i];\n\t\t\tif (!source) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tsource.fill = resolveTarget(sources, i, propagate);\n\t\t\tsource.boundary = computeBoundary(source);\n\t\t\tsource.mapper = createMapper(source);\n\t\t}\n\t},\n\n\tbeforeDatasetDraw: function(chart, args) {\n\t\tvar meta = args.meta.$filler;\n\t\tif (!meta) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar ctx = chart.ctx;\n\t\tvar el = meta.el;\n\t\tvar view = el._view;\n\t\tvar points = el._children || [];\n\t\tvar mapper = meta.mapper;\n\t\tvar color = view.backgroundColor || defaults.global.defaultColor;\n\n\t\tif (mapper && color && points.length) {\n\t\t\thelpers.canvas.clipArea(ctx, chart.chartArea);\n\t\t\tdoFill(ctx, points, mapper, view, color, el._loop);\n\t\t\thelpers.canvas.unclipArea(ctx);\n\t\t}\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.filler.js?");
  395. /***/ }),
  396. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.legend.js":
  397. /*!**********************************************************************************************!*\
  398. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.legend.js ***!
  399. \**********************************************************************************************/
  400. /*! no static exports found */
  401. /***/ (function(module, exports, __webpack_require__) {
  402. "use strict";
  403. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ../core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar layouts = __webpack_require__(/*! ../core/core.layouts */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js\");\n\nvar noop = helpers.noop;\n\ndefaults._set('global', {\n\tlegend: {\n\t\tdisplay: true,\n\t\tposition: 'top',\n\t\tfullWidth: true,\n\t\treverse: false,\n\t\tweight: 1000,\n\n\t\t// a callback that will handle\n\t\tonClick: function(e, legendItem) {\n\t\t\tvar index = legendItem.datasetIndex;\n\t\t\tvar ci = this.chart;\n\t\t\tvar meta = ci.getDatasetMeta(index);\n\n\t\t\t// See controller.isDatasetVisible comment\n\t\t\tmeta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;\n\n\t\t\t// We hid a dataset ... rerender the chart\n\t\t\tci.update();\n\t\t},\n\n\t\tonHover: null,\n\n\t\tlabels: {\n\t\t\tboxWidth: 40,\n\t\t\tpadding: 10,\n\t\t\t// Generates labels shown in the legend\n\t\t\t// Valid properties to return:\n\t\t\t// text : text to display\n\t\t\t// fillStyle : fill of coloured box\n\t\t\t// strokeStyle: stroke of coloured box\n\t\t\t// hidden : if this legend item refers to a hidden item\n\t\t\t// lineCap : cap style for line\n\t\t\t// lineDash\n\t\t\t// lineDashOffset :\n\t\t\t// lineJoin :\n\t\t\t// lineWidth :\n\t\t\tgenerateLabels: function(chart) {\n\t\t\t\tvar data = chart.data;\n\t\t\t\treturn helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: dataset.label,\n\t\t\t\t\t\tfillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),\n\t\t\t\t\t\thidden: !chart.isDatasetVisible(i),\n\t\t\t\t\t\tlineCap: dataset.borderCapStyle,\n\t\t\t\t\t\tlineDash: dataset.borderDash,\n\t\t\t\t\t\tlineDashOffset: dataset.borderDashOffset,\n\t\t\t\t\t\tlineJoin: dataset.borderJoinStyle,\n\t\t\t\t\t\tlineWidth: dataset.borderWidth,\n\t\t\t\t\t\tstrokeStyle: dataset.borderColor,\n\t\t\t\t\t\tpointStyle: dataset.pointStyle,\n\n\t\t\t\t\t\t// Below is extra data used for toggling the datasets\n\t\t\t\t\t\tdatasetIndex: i\n\t\t\t\t\t};\n\t\t\t\t}, this) : [];\n\t\t\t}\n\t\t}\n\t},\n\n\tlegendCallback: function(chart) {\n\t\tvar text = [];\n\t\ttext.push('<ul class=\"' + chart.id + '-legend\">');\n\t\tfor (var i = 0; i < chart.data.datasets.length; i++) {\n\t\t\ttext.push('<li><span style=\"background-color:' + chart.data.datasets[i].backgroundColor + '\"></span>');\n\t\t\tif (chart.data.datasets[i].label) {\n\t\t\t\ttext.push(chart.data.datasets[i].label);\n\t\t\t}\n\t\t\ttext.push('</li>');\n\t\t}\n\t\ttext.push('</ul>');\n\t\treturn text.join('');\n\t}\n});\n\n/**\n * Helper function to get the box width based on the usePointStyle option\n * @param labelopts {Object} the label options on the legend\n * @param fontSize {Number} the label font size\n * @return {Number} width of the color box area\n */\nfunction getBoxWidth(labelOpts, fontSize) {\n\treturn labelOpts.usePointStyle ?\n\t\tfontSize * Math.SQRT2 :\n\t\tlabelOpts.boxWidth;\n}\n\n/**\n * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!\n */\nvar Legend = Element.extend({\n\n\tinitialize: function(config) {\n\t\thelpers.extend(this, config);\n\n\t\t// Contains hit boxes for each dataset (in dataset order)\n\t\tthis.legendHitBoxes = [];\n\n\t\t// Are we in doughnut mode which has a different data type\n\t\tthis.doughnutMode = false;\n\t},\n\n\t// These methods are ordered by lifecycle. Utilities then follow.\n\t// Any function defined here is inherited by all legend types.\n\t// Any function can be extended by the legend type\n\n\tbeforeUpdate: noop,\n\tupdate: function(maxWidth, maxHeight, margins) {\n\t\tvar me = this;\n\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n\t\tme.beforeUpdate();\n\n\t\t// Absorb the master measurements\n\t\tme.maxWidth = maxWidth;\n\t\tme.maxHeight = maxHeight;\n\t\tme.margins = margins;\n\n\t\t// Dimensions\n\t\tme.beforeSetDimensions();\n\t\tme.setDimensions();\n\t\tme.afterSetDimensions();\n\t\t// Labels\n\t\tme.beforeBuildLabels();\n\t\tme.buildLabels();\n\t\tme.afterBuildLabels();\n\n\t\t// Fit\n\t\tme.beforeFit();\n\t\tme.fit();\n\t\tme.afterFit();\n\t\t//\n\t\tme.afterUpdate();\n\n\t\treturn me.minSize;\n\t},\n\tafterUpdate: noop,\n\n\t//\n\n\tbeforeSetDimensions: noop,\n\tsetDimensions: function() {\n\t\tvar me = this;\n\t\t// Set the unconstrained dimension before label rotation\n\t\tif (me.isHorizontal()) {\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.width = me.maxWidth;\n\t\t\tme.left = 0;\n\t\t\tme.right = me.width;\n\t\t} else {\n\t\t\tme.height = me.maxHeight;\n\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.top = 0;\n\t\t\tme.bottom = me.height;\n\t\t}\n\n\t\t// Reset padding\n\t\tme.paddingLeft = 0;\n\t\tme.paddingTop = 0;\n\t\tme.paddingRight = 0;\n\t\tme.paddingBottom = 0;\n\n\t\t// Reset minSize\n\t\tme.minSize = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t},\n\tafterSetDimensions: noop,\n\n\t//\n\n\tbeforeBuildLabels: noop,\n\tbuildLabels: function() {\n\t\tvar me = this;\n\t\tvar labelOpts = me.options.labels || {};\n\t\tvar legendItems = helpers.callback(labelOpts.generateLabels, [me.chart], me) || [];\n\n\t\tif (labelOpts.filter) {\n\t\t\tlegendItems = legendItems.filter(function(item) {\n\t\t\t\treturn labelOpts.filter(item, me.chart.data);\n\t\t\t});\n\t\t}\n\n\t\tif (me.options.reverse) {\n\t\t\tlegendItems.reverse();\n\t\t}\n\n\t\tme.legendItems = legendItems;\n\t},\n\tafterBuildLabels: noop,\n\n\t//\n\n\tbeforeFit: noop,\n\tfit: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar labelOpts = opts.labels;\n\t\tvar display = opts.display;\n\n\t\tvar ctx = me.ctx;\n\n\t\tvar globalDefault = defaults.global;\n\t\tvar valueOrDefault = helpers.valueOrDefault;\n\t\tvar fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);\n\t\tvar fontStyle = valueOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle);\n\t\tvar fontFamily = valueOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily);\n\t\tvar labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n\n\t\t// Reset hit boxes\n\t\tvar hitboxes = me.legendHitBoxes = [];\n\n\t\tvar minSize = me.minSize;\n\t\tvar isHorizontal = me.isHorizontal();\n\n\t\tif (isHorizontal) {\n\t\t\tminSize.width = me.maxWidth; // fill all the width\n\t\t\tminSize.height = display ? 10 : 0;\n\t\t} else {\n\t\t\tminSize.width = display ? 10 : 0;\n\t\t\tminSize.height = me.maxHeight; // fill all the height\n\t\t}\n\n\t\t// Increase sizes here\n\t\tif (display) {\n\t\t\tctx.font = labelFont;\n\n\t\t\tif (isHorizontal) {\n\t\t\t\t// Labels\n\n\t\t\t\t// Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n\t\t\t\tvar lineWidths = me.lineWidths = [0];\n\t\t\t\tvar totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;\n\n\t\t\t\tctx.textAlign = 'left';\n\t\t\t\tctx.textBaseline = 'top';\n\n\t\t\t\thelpers.each(me.legendItems, function(legendItem, i) {\n\t\t\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\n\t\t\t\t\tvar width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n\t\t\t\t\tif (lineWidths[lineWidths.length - 1] + width + labelOpts.padding >= me.width) {\n\t\t\t\t\t\ttotalHeight += fontSize + (labelOpts.padding);\n\t\t\t\t\t\tlineWidths[lineWidths.length] = me.left;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Store the hitbox width and height here. Final position will be updated in `draw`\n\t\t\t\t\thitboxes[i] = {\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\theight: fontSize\n\t\t\t\t\t};\n\n\t\t\t\t\tlineWidths[lineWidths.length - 1] += width + labelOpts.padding;\n\t\t\t\t});\n\n\t\t\t\tminSize.height += totalHeight;\n\n\t\t\t} else {\n\t\t\t\tvar vPadding = labelOpts.padding;\n\t\t\t\tvar columnWidths = me.columnWidths = [];\n\t\t\t\tvar totalWidth = labelOpts.padding;\n\t\t\t\tvar currentColWidth = 0;\n\t\t\t\tvar currentColHeight = 0;\n\t\t\t\tvar itemHeight = fontSize + vPadding;\n\n\t\t\t\thelpers.each(me.legendItems, function(legendItem, i) {\n\t\t\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\n\t\t\t\t\tvar itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n\t\t\t\t\t// If too tall, go to new column\n\t\t\t\t\tif (currentColHeight + itemHeight > minSize.height) {\n\t\t\t\t\t\ttotalWidth += currentColWidth + labelOpts.padding;\n\t\t\t\t\t\tcolumnWidths.push(currentColWidth); // previous column width\n\n\t\t\t\t\t\tcurrentColWidth = 0;\n\t\t\t\t\t\tcurrentColHeight = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get max width\n\t\t\t\t\tcurrentColWidth = Math.max(currentColWidth, itemWidth);\n\t\t\t\t\tcurrentColHeight += itemHeight;\n\n\t\t\t\t\t// Store the hitbox width and height here. Final position will be updated in `draw`\n\t\t\t\t\thitboxes[i] = {\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\twidth: itemWidth,\n\t\t\t\t\t\theight: fontSize\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\ttotalWidth += currentColWidth;\n\t\t\t\tcolumnWidths.push(currentColWidth);\n\t\t\t\tminSize.width += totalWidth;\n\t\t\t}\n\t\t}\n\n\t\tme.width = minSize.width;\n\t\tme.height = minSize.height;\n\t},\n\tafterFit: noop,\n\n\t// Shared Methods\n\tisHorizontal: function() {\n\t\treturn this.options.position === 'top' || this.options.position === 'bottom';\n\t},\n\n\t// Actually draw the legend on the canvas\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar labelOpts = opts.labels;\n\t\tvar globalDefault = defaults.global;\n\t\tvar lineDefault = globalDefault.elements.line;\n\t\tvar legendWidth = me.width;\n\t\tvar lineWidths = me.lineWidths;\n\n\t\tif (opts.display) {\n\t\t\tvar ctx = me.ctx;\n\t\t\tvar valueOrDefault = helpers.valueOrDefault;\n\t\t\tvar fontColor = valueOrDefault(labelOpts.fontColor, globalDefault.defaultFontColor);\n\t\t\tvar fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);\n\t\t\tvar fontStyle = valueOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle);\n\t\t\tvar fontFamily = valueOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily);\n\t\t\tvar labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n\t\t\tvar cursor;\n\n\t\t\t// Canvas setup\n\t\t\tctx.textAlign = 'left';\n\t\t\tctx.textBaseline = 'middle';\n\t\t\tctx.lineWidth = 0.5;\n\t\t\tctx.strokeStyle = fontColor; // for strikethrough effect\n\t\t\tctx.fillStyle = fontColor; // render in correct colour\n\t\t\tctx.font = labelFont;\n\n\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\n\t\t\tvar hitboxes = me.legendHitBoxes;\n\n\t\t\t// current position\n\t\t\tvar drawLegendBox = function(x, y, legendItem) {\n\t\t\t\tif (isNaN(boxWidth) || boxWidth <= 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Set the ctx for the box\n\t\t\t\tctx.save();\n\n\t\t\t\tctx.fillStyle = valueOrDefault(legendItem.fillStyle, globalDefault.defaultColor);\n\t\t\t\tctx.lineCap = valueOrDefault(legendItem.lineCap, lineDefault.borderCapStyle);\n\t\t\t\tctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, lineDefault.borderDashOffset);\n\t\t\t\tctx.lineJoin = valueOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);\n\t\t\t\tctx.lineWidth = valueOrDefault(legendItem.lineWidth, lineDefault.borderWidth);\n\t\t\t\tctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);\n\t\t\t\tvar isLineWidthZero = (valueOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);\n\n\t\t\t\tif (ctx.setLineDash) {\n\t\t\t\t\t// IE 9 and 10 do not support line dash\n\t\t\t\t\tctx.setLineDash(valueOrDefault(legendItem.lineDash, lineDefault.borderDash));\n\t\t\t\t}\n\n\t\t\t\tif (opts.labels && opts.labels.usePointStyle) {\n\t\t\t\t\t// Recalculate x and y for drawPoint() because its expecting\n\t\t\t\t\t// x and y to be center of figure (instead of top left)\n\t\t\t\t\tvar radius = fontSize * Math.SQRT2 / 2;\n\t\t\t\t\tvar offSet = radius / Math.SQRT2;\n\t\t\t\t\tvar centerX = x + offSet;\n\t\t\t\t\tvar centerY = y + offSet;\n\n\t\t\t\t\t// Draw pointStyle as legend symbol\n\t\t\t\t\thelpers.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);\n\t\t\t\t} else {\n\t\t\t\t\t// Draw box as legend symbol\n\t\t\t\t\tif (!isLineWidthZero) {\n\t\t\t\t\t\tctx.strokeRect(x, y, boxWidth, fontSize);\n\t\t\t\t\t}\n\t\t\t\t\tctx.fillRect(x, y, boxWidth, fontSize);\n\t\t\t\t}\n\n\t\t\t\tctx.restore();\n\t\t\t};\n\t\t\tvar fillText = function(x, y, legendItem, textWidth) {\n\t\t\t\tvar halfFontSize = fontSize / 2;\n\t\t\t\tvar xLeft = boxWidth + halfFontSize + x;\n\t\t\t\tvar yMiddle = y + halfFontSize;\n\n\t\t\t\tctx.fillText(legendItem.text, xLeft, yMiddle);\n\n\t\t\t\tif (legendItem.hidden) {\n\t\t\t\t\t// Strikethrough the text if hidden\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.lineWidth = 2;\n\t\t\t\t\tctx.moveTo(xLeft, yMiddle);\n\t\t\t\t\tctx.lineTo(xLeft + textWidth, yMiddle);\n\t\t\t\t\tctx.stroke();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Horizontal\n\t\t\tvar isHorizontal = me.isHorizontal();\n\t\t\tif (isHorizontal) {\n\t\t\t\tcursor = {\n\t\t\t\t\tx: me.left + ((legendWidth - lineWidths[0]) / 2),\n\t\t\t\t\ty: me.top + labelOpts.padding,\n\t\t\t\t\tline: 0\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tcursor = {\n\t\t\t\t\tx: me.left + labelOpts.padding,\n\t\t\t\t\ty: me.top + labelOpts.padding,\n\t\t\t\t\tline: 0\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvar itemHeight = fontSize + labelOpts.padding;\n\t\t\thelpers.each(me.legendItems, function(legendItem, i) {\n\t\t\t\tvar textWidth = ctx.measureText(legendItem.text).width;\n\t\t\t\tvar width = boxWidth + (fontSize / 2) + textWidth;\n\t\t\t\tvar x = cursor.x;\n\t\t\t\tvar y = cursor.y;\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tif (x + width >= legendWidth) {\n\t\t\t\t\t\ty = cursor.y += itemHeight;\n\t\t\t\t\t\tcursor.line++;\n\t\t\t\t\t\tx = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);\n\t\t\t\t\t}\n\t\t\t\t} else if (y + itemHeight > me.bottom) {\n\t\t\t\t\tx = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;\n\t\t\t\t\ty = cursor.y = me.top + labelOpts.padding;\n\t\t\t\t\tcursor.line++;\n\t\t\t\t}\n\n\t\t\t\tdrawLegendBox(x, y, legendItem);\n\n\t\t\t\thitboxes[i].left = x;\n\t\t\t\thitboxes[i].top = y;\n\n\t\t\t\t// Fill the actual label\n\t\t\t\tfillText(x, y, legendItem, textWidth);\n\n\t\t\t\tif (isHorizontal) {\n\t\t\t\t\tcursor.x += width + (labelOpts.padding);\n\t\t\t\t} else {\n\t\t\t\t\tcursor.y += itemHeight;\n\t\t\t\t}\n\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Handle an event\n\t * @private\n\t * @param {IEvent} event - The event to handle\n\t * @return {Boolean} true if a change occured\n\t */\n\thandleEvent: function(e) {\n\t\tvar me = this;\n\t\tvar opts = me.options;\n\t\tvar type = e.type === 'mouseup' ? 'click' : e.type;\n\t\tvar changed = false;\n\n\t\tif (type === 'mousemove') {\n\t\t\tif (!opts.onHover) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (type === 'click') {\n\t\t\tif (!opts.onClick) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// Chart event already has relative position in it\n\t\tvar x = e.x;\n\t\tvar y = e.y;\n\n\t\tif (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {\n\t\t\t// See if we are touching one of the dataset boxes\n\t\t\tvar lh = me.legendHitBoxes;\n\t\t\tfor (var i = 0; i < lh.length; ++i) {\n\t\t\t\tvar hitBox = lh[i];\n\n\t\t\t\tif (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {\n\t\t\t\t\t// Touching an element\n\t\t\t\t\tif (type === 'click') {\n\t\t\t\t\t\t// use e.native for backwards compatibility\n\t\t\t\t\t\topts.onClick.call(me, e.native, me.legendItems[i]);\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (type === 'mousemove') {\n\t\t\t\t\t\t// use e.native for backwards compatibility\n\t\t\t\t\t\topts.onHover.call(me, e.native, me.legendItems[i]);\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn changed;\n\t}\n});\n\nfunction createNewLegendAndAttach(chart, legendOpts) {\n\tvar legend = new Legend({\n\t\tctx: chart.ctx,\n\t\toptions: legendOpts,\n\t\tchart: chart\n\t});\n\n\tlayouts.configure(chart, legend, legendOpts);\n\tlayouts.addBox(chart, legend);\n\tchart.legend = legend;\n}\n\nmodule.exports = {\n\tid: 'legend',\n\n\t/**\n\t * Backward compatibility: since 2.1.5, the legend is registered as a plugin, making\n\t * Chart.Legend obsolete. To avoid a breaking change, we export the Legend as part of\n\t * the plugin, which one will be re-exposed in the chart.js file.\n\t * https://github.com/chartjs/Chart.js/pull/2640\n\t * @private\n\t */\n\t_element: Legend,\n\n\tbeforeInit: function(chart) {\n\t\tvar legendOpts = chart.options.legend;\n\n\t\tif (legendOpts) {\n\t\t\tcreateNewLegendAndAttach(chart, legendOpts);\n\t\t}\n\t},\n\n\tbeforeUpdate: function(chart) {\n\t\tvar legendOpts = chart.options.legend;\n\t\tvar legend = chart.legend;\n\n\t\tif (legendOpts) {\n\t\t\thelpers.mergeIf(legendOpts, defaults.global.legend);\n\n\t\t\tif (legend) {\n\t\t\t\tlayouts.configure(chart, legend, legendOpts);\n\t\t\t\tlegend.options = legendOpts;\n\t\t\t} else {\n\t\t\t\tcreateNewLegendAndAttach(chart, legendOpts);\n\t\t\t}\n\t\t} else if (legend) {\n\t\t\tlayouts.removeBox(chart, legend);\n\t\t\tdelete chart.legend;\n\t\t}\n\t},\n\n\tafterEvent: function(chart, e) {\n\t\tvar legend = chart.legend;\n\t\tif (legend) {\n\t\t\tlegend.handleEvent(e);\n\t\t}\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.legend.js?");
  404. /***/ }),
  405. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.title.js":
  406. /*!*********************************************************************************************!*\
  407. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.title.js ***!
  408. \*********************************************************************************************/
  409. /*! no static exports found */
  410. /***/ (function(module, exports, __webpack_require__) {
  411. "use strict";
  412. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar Element = __webpack_require__(/*! ../core/core.element */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.element.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar layouts = __webpack_require__(/*! ../core/core.layouts */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.layouts.js\");\n\nvar noop = helpers.noop;\n\ndefaults._set('global', {\n\ttitle: {\n\t\tdisplay: false,\n\t\tfontStyle: 'bold',\n\t\tfullWidth: true,\n\t\tlineHeight: 1.2,\n\t\tpadding: 10,\n\t\tposition: 'top',\n\t\ttext: '',\n\t\tweight: 2000 // by default greater than legend (1000) to be above\n\t}\n});\n\n/**\n * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!\n */\nvar Title = Element.extend({\n\tinitialize: function(config) {\n\t\tvar me = this;\n\t\thelpers.extend(me, config);\n\n\t\t// Contains hit boxes for each dataset (in dataset order)\n\t\tme.legendHitBoxes = [];\n\t},\n\n\t// These methods are ordered by lifecycle. Utilities then follow.\n\n\tbeforeUpdate: noop,\n\tupdate: function(maxWidth, maxHeight, margins) {\n\t\tvar me = this;\n\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n\t\tme.beforeUpdate();\n\n\t\t// Absorb the master measurements\n\t\tme.maxWidth = maxWidth;\n\t\tme.maxHeight = maxHeight;\n\t\tme.margins = margins;\n\n\t\t// Dimensions\n\t\tme.beforeSetDimensions();\n\t\tme.setDimensions();\n\t\tme.afterSetDimensions();\n\t\t// Labels\n\t\tme.beforeBuildLabels();\n\t\tme.buildLabels();\n\t\tme.afterBuildLabels();\n\n\t\t// Fit\n\t\tme.beforeFit();\n\t\tme.fit();\n\t\tme.afterFit();\n\t\t//\n\t\tme.afterUpdate();\n\n\t\treturn me.minSize;\n\n\t},\n\tafterUpdate: noop,\n\n\t//\n\n\tbeforeSetDimensions: noop,\n\tsetDimensions: function() {\n\t\tvar me = this;\n\t\t// Set the unconstrained dimension before label rotation\n\t\tif (me.isHorizontal()) {\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.width = me.maxWidth;\n\t\t\tme.left = 0;\n\t\t\tme.right = me.width;\n\t\t} else {\n\t\t\tme.height = me.maxHeight;\n\n\t\t\t// Reset position before calculating rotation\n\t\t\tme.top = 0;\n\t\t\tme.bottom = me.height;\n\t\t}\n\n\t\t// Reset padding\n\t\tme.paddingLeft = 0;\n\t\tme.paddingTop = 0;\n\t\tme.paddingRight = 0;\n\t\tme.paddingBottom = 0;\n\n\t\t// Reset minSize\n\t\tme.minSize = {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t},\n\tafterSetDimensions: noop,\n\n\t//\n\n\tbeforeBuildLabels: noop,\n\tbuildLabels: noop,\n\tafterBuildLabels: noop,\n\n\t//\n\n\tbeforeFit: noop,\n\tfit: function() {\n\t\tvar me = this;\n\t\tvar valueOrDefault = helpers.valueOrDefault;\n\t\tvar opts = me.options;\n\t\tvar display = opts.display;\n\t\tvar fontSize = valueOrDefault(opts.fontSize, defaults.global.defaultFontSize);\n\t\tvar minSize = me.minSize;\n\t\tvar lineCount = helpers.isArray(opts.text) ? opts.text.length : 1;\n\t\tvar lineHeight = helpers.options.toLineHeight(opts.lineHeight, fontSize);\n\t\tvar textSize = display ? (lineCount * lineHeight) + (opts.padding * 2) : 0;\n\n\t\tif (me.isHorizontal()) {\n\t\t\tminSize.width = me.maxWidth; // fill all the width\n\t\t\tminSize.height = textSize;\n\t\t} else {\n\t\t\tminSize.width = textSize;\n\t\t\tminSize.height = me.maxHeight; // fill all the height\n\t\t}\n\n\t\tme.width = minSize.width;\n\t\tme.height = minSize.height;\n\n\t},\n\tafterFit: noop,\n\n\t// Shared Methods\n\tisHorizontal: function() {\n\t\tvar pos = this.options.position;\n\t\treturn pos === 'top' || pos === 'bottom';\n\t},\n\n\t// Actually draw the title block on the canvas\n\tdraw: function() {\n\t\tvar me = this;\n\t\tvar ctx = me.ctx;\n\t\tvar valueOrDefault = helpers.valueOrDefault;\n\t\tvar opts = me.options;\n\t\tvar globalDefaults = defaults.global;\n\n\t\tif (opts.display) {\n\t\t\tvar fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize);\n\t\t\tvar fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle);\n\t\t\tvar fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily);\n\t\t\tvar titleFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n\t\t\tvar lineHeight = helpers.options.toLineHeight(opts.lineHeight, fontSize);\n\t\t\tvar offset = lineHeight / 2 + opts.padding;\n\t\t\tvar rotation = 0;\n\t\t\tvar top = me.top;\n\t\t\tvar left = me.left;\n\t\t\tvar bottom = me.bottom;\n\t\t\tvar right = me.right;\n\t\t\tvar maxWidth, titleX, titleY;\n\n\t\t\tctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour\n\t\t\tctx.font = titleFont;\n\n\t\t\t// Horizontal\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\ttitleX = left + ((right - left) / 2); // midpoint of the width\n\t\t\t\ttitleY = top + offset;\n\t\t\t\tmaxWidth = right - left;\n\t\t\t} else {\n\t\t\t\ttitleX = opts.position === 'left' ? left + offset : right - offset;\n\t\t\t\ttitleY = top + ((bottom - top) / 2);\n\t\t\t\tmaxWidth = bottom - top;\n\t\t\t\trotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);\n\t\t\t}\n\n\t\t\tctx.save();\n\t\t\tctx.translate(titleX, titleY);\n\t\t\tctx.rotate(rotation);\n\t\t\tctx.textAlign = 'center';\n\t\t\tctx.textBaseline = 'middle';\n\n\t\t\tvar text = opts.text;\n\t\t\tif (helpers.isArray(text)) {\n\t\t\t\tvar y = 0;\n\t\t\t\tfor (var i = 0; i < text.length; ++i) {\n\t\t\t\t\tctx.fillText(text[i], 0, y, maxWidth);\n\t\t\t\t\ty += lineHeight;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tctx.fillText(text, 0, 0, maxWidth);\n\t\t\t}\n\n\t\t\tctx.restore();\n\t\t}\n\t}\n});\n\nfunction createNewTitleBlockAndAttach(chart, titleOpts) {\n\tvar title = new Title({\n\t\tctx: chart.ctx,\n\t\toptions: titleOpts,\n\t\tchart: chart\n\t});\n\n\tlayouts.configure(chart, title, titleOpts);\n\tlayouts.addBox(chart, title);\n\tchart.titleBlock = title;\n}\n\nmodule.exports = {\n\tid: 'title',\n\n\t/**\n\t * Backward compatibility: since 2.1.5, the title is registered as a plugin, making\n\t * Chart.Title obsolete. To avoid a breaking change, we export the Title as part of\n\t * the plugin, which one will be re-exposed in the chart.js file.\n\t * https://github.com/chartjs/Chart.js/pull/2640\n\t * @private\n\t */\n\t_element: Title,\n\n\tbeforeInit: function(chart) {\n\t\tvar titleOpts = chart.options.title;\n\n\t\tif (titleOpts) {\n\t\t\tcreateNewTitleBlockAndAttach(chart, titleOpts);\n\t\t}\n\t},\n\n\tbeforeUpdate: function(chart) {\n\t\tvar titleOpts = chart.options.title;\n\t\tvar titleBlock = chart.titleBlock;\n\n\t\tif (titleOpts) {\n\t\t\thelpers.mergeIf(titleOpts, defaults.global.title);\n\n\t\t\tif (titleBlock) {\n\t\t\t\tlayouts.configure(chart, titleBlock, titleOpts);\n\t\t\t\ttitleBlock.options = titleOpts;\n\t\t\t} else {\n\t\t\t\tcreateNewTitleBlockAndAttach(chart, titleOpts);\n\t\t\t}\n\t\t} else if (titleBlock) {\n\t\t\tlayouts.removeBox(chart, titleBlock);\n\t\t\tdelete chart.titleBlock;\n\t\t}\n\t}\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/plugins/plugin.title.js?");
  413. /***/ }),
  414. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.category.js":
  415. /*!**********************************************************************************************!*\
  416. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.category.js ***!
  417. \**********************************************************************************************/
  418. /*! no static exports found */
  419. /***/ (function(module, exports, __webpack_require__) {
  420. "use strict";
  421. eval("\n\nmodule.exports = function(Chart) {\n\n\t// Default config for a category scale\n\tvar defaultConfig = {\n\t\tposition: 'bottom'\n\t};\n\n\tvar DatasetScale = Chart.Scale.extend({\n\t\t/**\n\t\t* Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those\n\t\t* else fall back to data.labels\n\t\t* @private\n\t\t*/\n\t\tgetLabels: function() {\n\t\t\tvar data = this.chart.data;\n\t\t\treturn this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;\n\t\t},\n\n\t\tdetermineDataLimits: function() {\n\t\t\tvar me = this;\n\t\t\tvar labels = me.getLabels();\n\t\t\tme.minIndex = 0;\n\t\t\tme.maxIndex = labels.length - 1;\n\t\t\tvar findIndex;\n\n\t\t\tif (me.options.ticks.min !== undefined) {\n\t\t\t\t// user specified min value\n\t\t\t\tfindIndex = labels.indexOf(me.options.ticks.min);\n\t\t\t\tme.minIndex = findIndex !== -1 ? findIndex : me.minIndex;\n\t\t\t}\n\n\t\t\tif (me.options.ticks.max !== undefined) {\n\t\t\t\t// user specified max value\n\t\t\t\tfindIndex = labels.indexOf(me.options.ticks.max);\n\t\t\t\tme.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;\n\t\t\t}\n\n\t\t\tme.min = labels[me.minIndex];\n\t\t\tme.max = labels[me.maxIndex];\n\t\t},\n\n\t\tbuildTicks: function() {\n\t\t\tvar me = this;\n\t\t\tvar labels = me.getLabels();\n\t\t\t// If we are viewing some subset of labels, slice the original array\n\t\t\tme.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);\n\t\t},\n\n\t\tgetLabelForIndex: function(index, datasetIndex) {\n\t\t\tvar me = this;\n\t\t\tvar data = me.chart.data;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\n\t\t\tif (data.yLabels && !isHorizontal) {\n\t\t\t\treturn me.getRightValue(data.datasets[datasetIndex].data[index]);\n\t\t\t}\n\t\t\treturn me.ticks[index - me.minIndex];\n\t\t},\n\n\t\t// Used to get data value locations. Value can either be an index or a numerical value\n\t\tgetPixelForValue: function(value, index) {\n\t\t\tvar me = this;\n\t\t\tvar offset = me.options.offset;\n\t\t\t// 1 is added because we need the length but we have the indexes\n\t\t\tvar offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - (offset ? 0 : 1)), 1);\n\n\t\t\t// If value is a data object, then index is the index in the data array,\n\t\t\t// not the index of the scale. We need to change that.\n\t\t\tvar valueCategory;\n\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\tvalueCategory = me.isHorizontal() ? value.x : value.y;\n\t\t\t}\n\t\t\tif (valueCategory !== undefined || (value !== undefined && isNaN(index))) {\n\t\t\t\tvar labels = me.getLabels();\n\t\t\t\tvalue = valueCategory || value;\n\t\t\t\tvar idx = labels.indexOf(value);\n\t\t\t\tindex = idx !== -1 ? idx : index;\n\t\t\t}\n\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tvar valueWidth = me.width / offsetAmt;\n\t\t\t\tvar widthOffset = (valueWidth * (index - me.minIndex));\n\n\t\t\t\tif (offset) {\n\t\t\t\t\twidthOffset += (valueWidth / 2);\n\t\t\t\t}\n\n\t\t\t\treturn me.left + Math.round(widthOffset);\n\t\t\t}\n\t\t\tvar valueHeight = me.height / offsetAmt;\n\t\t\tvar heightOffset = (valueHeight * (index - me.minIndex));\n\n\t\t\tif (offset) {\n\t\t\t\theightOffset += (valueHeight / 2);\n\t\t\t}\n\n\t\t\treturn me.top + Math.round(heightOffset);\n\t\t},\n\t\tgetPixelForTick: function(index) {\n\t\t\treturn this.getPixelForValue(this.ticks[index], index + this.minIndex, null);\n\t\t},\n\t\tgetValueForPixel: function(pixel) {\n\t\t\tvar me = this;\n\t\t\tvar offset = me.options.offset;\n\t\t\tvar value;\n\t\t\tvar offsetAmt = Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n\t\t\tvar horz = me.isHorizontal();\n\t\t\tvar valueDimension = (horz ? me.width : me.height) / offsetAmt;\n\n\t\t\tpixel -= horz ? me.left : me.top;\n\n\t\t\tif (offset) {\n\t\t\t\tpixel -= (valueDimension / 2);\n\t\t\t}\n\n\t\t\tif (pixel <= 0) {\n\t\t\t\tvalue = 0;\n\t\t\t} else {\n\t\t\t\tvalue = Math.round(pixel / valueDimension);\n\t\t\t}\n\n\t\t\treturn value + me.minIndex;\n\t\t},\n\t\tgetBasePixel: function() {\n\t\t\treturn this.bottom;\n\t\t}\n\t});\n\n\tChart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.category.js?");
  422. /***/ }),
  423. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linear.js":
  424. /*!********************************************************************************************!*\
  425. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linear.js ***!
  426. \********************************************************************************************/
  427. /*! no static exports found */
  428. /***/ (function(module, exports, __webpack_require__) {
  429. "use strict";
  430. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar Ticks = __webpack_require__(/*! ../core/core.ticks */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js\");\n\nmodule.exports = function(Chart) {\n\n\tvar defaultConfig = {\n\t\tposition: 'left',\n\t\tticks: {\n\t\t\tcallback: Ticks.formatters.linear\n\t\t}\n\t};\n\n\tvar LinearScale = Chart.LinearScaleBase.extend({\n\n\t\tdetermineDataLimits: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar chart = me.chart;\n\t\t\tvar data = chart.data;\n\t\t\tvar datasets = data.datasets;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\t\t\tvar DEFAULT_MIN = 0;\n\t\t\tvar DEFAULT_MAX = 1;\n\n\t\t\tfunction IDMatches(meta) {\n\t\t\t\treturn isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n\t\t\t}\n\n\t\t\t// First Calculate the range\n\t\t\tme.min = null;\n\t\t\tme.max = null;\n\n\t\t\tvar hasStacks = opts.stacked;\n\t\t\tif (hasStacks === undefined) {\n\t\t\t\thelpers.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\t\tif (hasStacks) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n\t\t\t\t\t\tmeta.stack !== undefined) {\n\t\t\t\t\t\thasStacks = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (opts.stacked || hasStacks) {\n\t\t\t\tvar valuesPerStack = {};\n\n\t\t\t\thelpers.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\t\tvar key = [\n\t\t\t\t\t\tmeta.type,\n\t\t\t\t\t\t// we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n\t\t\t\t\t\t((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n\t\t\t\t\t\tmeta.stack\n\t\t\t\t\t].join('.');\n\n\t\t\t\t\tif (valuesPerStack[key] === undefined) {\n\t\t\t\t\t\tvaluesPerStack[key] = {\n\t\t\t\t\t\t\tpositiveValues: [],\n\t\t\t\t\t\t\tnegativeValues: []\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Store these per type\n\t\t\t\t\tvar positiveValues = valuesPerStack[key].positiveValues;\n\t\t\t\t\tvar negativeValues = valuesPerStack[key].negativeValues;\n\n\t\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\t\thelpers.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpositiveValues[index] = positiveValues[index] || 0;\n\t\t\t\t\t\t\tnegativeValues[index] = negativeValues[index] || 0;\n\n\t\t\t\t\t\t\tif (opts.relativePoints) {\n\t\t\t\t\t\t\t\tpositiveValues[index] = 100;\n\t\t\t\t\t\t\t} else if (value < 0) {\n\t\t\t\t\t\t\t\tnegativeValues[index] += value;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpositiveValues[index] += value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\thelpers.each(valuesPerStack, function(valuesForType) {\n\t\t\t\t\tvar values = valuesForType.positiveValues.concat(valuesForType.negativeValues);\n\t\t\t\t\tvar minVal = helpers.min(values);\n\t\t\t\t\tvar maxVal = helpers.max(values);\n\t\t\t\t\tme.min = me.min === null ? minVal : Math.min(me.min, minVal);\n\t\t\t\t\tme.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n\t\t\t\t});\n\n\t\t\t} else {\n\t\t\t\thelpers.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\t\thelpers.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (me.min === null) {\n\t\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t\t} else if (value < me.min) {\n\t\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (me.max === null) {\n\t\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t\t} else if (value > me.max) {\n\t\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tme.min = isFinite(me.min) && !isNaN(me.min) ? me.min : DEFAULT_MIN;\n\t\t\tme.max = isFinite(me.max) && !isNaN(me.max) ? me.max : DEFAULT_MAX;\n\n\t\t\t// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n\t\t\tthis.handleTickRangeOptions();\n\t\t},\n\t\tgetTickLimit: function() {\n\t\t\tvar maxTicks;\n\t\t\tvar me = this;\n\t\t\tvar tickOpts = me.options.ticks;\n\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tmaxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.width / 50));\n\t\t\t} else {\n\t\t\t\t// The factor of 2 used to scale the font size has been experimentally determined.\n\t\t\t\tvar tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, defaults.global.defaultFontSize);\n\t\t\t\tmaxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.height / (2 * tickFontSize)));\n\t\t\t}\n\n\t\t\treturn maxTicks;\n\t\t},\n\t\t// Called after the ticks are built. We need\n\t\thandleDirectionalChanges: function() {\n\t\t\tif (!this.isHorizontal()) {\n\t\t\t\t// We are in a vertical orientation. The top value is the highest. So reverse the array\n\t\t\t\tthis.ticks.reverse();\n\t\t\t}\n\t\t},\n\t\tgetLabelForIndex: function(index, datasetIndex) {\n\t\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n\t\t},\n\t\t// Utils\n\t\tgetPixelForValue: function(value) {\n\t\t\t// This must be called after fit has been run so that\n\t\t\t// this.left, this.top, this.right, and this.bottom have been defined\n\t\t\tvar me = this;\n\t\t\tvar start = me.start;\n\n\t\t\tvar rightValue = +me.getRightValue(value);\n\t\t\tvar pixel;\n\t\t\tvar range = me.end - start;\n\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tpixel = me.left + (me.width / range * (rightValue - start));\n\t\t\t} else {\n\t\t\t\tpixel = me.bottom - (me.height / range * (rightValue - start));\n\t\t\t}\n\t\t\treturn pixel;\n\t\t},\n\t\tgetValueForPixel: function(pixel) {\n\t\t\tvar me = this;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\t\t\tvar innerDimension = isHorizontal ? me.width : me.height;\n\t\t\tvar offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;\n\t\t\treturn me.start + ((me.end - me.start) * offset);\n\t\t},\n\t\tgetPixelForTick: function(index) {\n\t\t\treturn this.getPixelForValue(this.ticksAsNumbers[index]);\n\t\t}\n\t});\n\tChart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linear.js?");
  431. /***/ }),
  432. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linearbase.js":
  433. /*!************************************************************************************************!*\
  434. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linearbase.js ***!
  435. \************************************************************************************************/
  436. /*! no static exports found */
  437. /***/ (function(module, exports, __webpack_require__) {
  438. "use strict";
  439. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\n/**\n * Generate a set of linear ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {Array<Number>} array of tick values\n */\nfunction generateTicks(generationOptions, dataRange) {\n\tvar ticks = [];\n\t// To get a \"nice\" value for the tick spacing, we will use the appropriately named\n\t// \"nice number\" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n\t// for details.\n\n\tvar spacing;\n\tif (generationOptions.stepSize && generationOptions.stepSize > 0) {\n\t\tspacing = generationOptions.stepSize;\n\t} else {\n\t\tvar niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);\n\t\tspacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);\n\t}\n\tvar niceMin = Math.floor(dataRange.min / spacing) * spacing;\n\tvar niceMax = Math.ceil(dataRange.max / spacing) * spacing;\n\n\t// If min, max and stepSize is set and they make an evenly spaced scale use it.\n\tif (generationOptions.min && generationOptions.max && generationOptions.stepSize) {\n\t\t// If very close to our whole number, use it.\n\t\tif (helpers.almostWhole((generationOptions.max - generationOptions.min) / generationOptions.stepSize, spacing / 1000)) {\n\t\t\tniceMin = generationOptions.min;\n\t\t\tniceMax = generationOptions.max;\n\t\t}\n\t}\n\n\tvar numSpaces = (niceMax - niceMin) / spacing;\n\t// If very close to our rounded value, use it.\n\tif (helpers.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n\t\tnumSpaces = Math.round(numSpaces);\n\t} else {\n\t\tnumSpaces = Math.ceil(numSpaces);\n\t}\n\n\tvar precision = 1;\n\tif (spacing < 1) {\n\t\tprecision = Math.pow(10, spacing.toString().length - 2);\n\t\tniceMin = Math.round(niceMin * precision) / precision;\n\t\tniceMax = Math.round(niceMax * precision) / precision;\n\t}\n\tticks.push(generationOptions.min !== undefined ? generationOptions.min : niceMin);\n\tfor (var j = 1; j < numSpaces; ++j) {\n\t\tticks.push(Math.round((niceMin + j * spacing) * precision) / precision);\n\t}\n\tticks.push(generationOptions.max !== undefined ? generationOptions.max : niceMax);\n\n\treturn ticks;\n}\n\n\nmodule.exports = function(Chart) {\n\n\tvar noop = helpers.noop;\n\n\tChart.LinearScaleBase = Chart.Scale.extend({\n\t\tgetRightValue: function(value) {\n\t\t\tif (typeof value === 'string') {\n\t\t\t\treturn +value;\n\t\t\t}\n\t\t\treturn Chart.Scale.prototype.getRightValue.call(this, value);\n\t\t},\n\n\t\thandleTickRangeOptions: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar tickOpts = opts.ticks;\n\n\t\t\t// If we are forcing it to begin at 0, but 0 will already be rendered on the chart,\n\t\t\t// do nothing since that would make the chart weird. If the user really wants a weird chart\n\t\t\t// axis, they can manually override it\n\t\t\tif (tickOpts.beginAtZero) {\n\t\t\t\tvar minSign = helpers.sign(me.min);\n\t\t\t\tvar maxSign = helpers.sign(me.max);\n\n\t\t\t\tif (minSign < 0 && maxSign < 0) {\n\t\t\t\t\t// move the top up to 0\n\t\t\t\t\tme.max = 0;\n\t\t\t\t} else if (minSign > 0 && maxSign > 0) {\n\t\t\t\t\t// move the bottom down to 0\n\t\t\t\t\tme.min = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;\n\t\t\tvar setMax = tickOpts.max !== undefined || tickOpts.suggestedMax !== undefined;\n\n\t\t\tif (tickOpts.min !== undefined) {\n\t\t\t\tme.min = tickOpts.min;\n\t\t\t} else if (tickOpts.suggestedMin !== undefined) {\n\t\t\t\tif (me.min === null) {\n\t\t\t\t\tme.min = tickOpts.suggestedMin;\n\t\t\t\t} else {\n\t\t\t\t\tme.min = Math.min(me.min, tickOpts.suggestedMin);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tickOpts.max !== undefined) {\n\t\t\t\tme.max = tickOpts.max;\n\t\t\t} else if (tickOpts.suggestedMax !== undefined) {\n\t\t\t\tif (me.max === null) {\n\t\t\t\t\tme.max = tickOpts.suggestedMax;\n\t\t\t\t} else {\n\t\t\t\t\tme.max = Math.max(me.max, tickOpts.suggestedMax);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (setMin !== setMax) {\n\t\t\t\t// We set the min or the max but not both.\n\t\t\t\t// So ensure that our range is good\n\t\t\t\t// Inverted or 0 length range can happen when\n\t\t\t\t// ticks.min is set, and no datasets are visible\n\t\t\t\tif (me.min >= me.max) {\n\t\t\t\t\tif (setMin) {\n\t\t\t\t\t\tme.max = me.min + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tme.min = me.max - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (me.min === me.max) {\n\t\t\t\tme.max++;\n\n\t\t\t\tif (!tickOpts.beginAtZero) {\n\t\t\t\t\tme.min--;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetTickLimit: noop,\n\t\thandleDirectionalChanges: noop,\n\n\t\tbuildTicks: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar tickOpts = opts.ticks;\n\n\t\t\t// Figure out what the max number of ticks we can support it is based on the size of\n\t\t\t// the axis area. For now, we say that the minimum tick spacing in pixels must be 50\n\t\t\t// We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n\t\t\t// the graph. Make sure we always have at least 2 ticks\n\t\t\tvar maxTicks = me.getTickLimit();\n\t\t\tmaxTicks = Math.max(2, maxTicks);\n\n\t\t\tvar numericGeneratorOptions = {\n\t\t\t\tmaxTicks: maxTicks,\n\t\t\t\tmin: tickOpts.min,\n\t\t\t\tmax: tickOpts.max,\n\t\t\t\tstepSize: helpers.valueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)\n\t\t\t};\n\t\t\tvar ticks = me.ticks = generateTicks(numericGeneratorOptions, me);\n\n\t\t\tme.handleDirectionalChanges();\n\n\t\t\t// At this point, we need to update our max and min given the tick values since we have expanded the\n\t\t\t// range of the scale\n\t\t\tme.max = helpers.max(ticks);\n\t\t\tme.min = helpers.min(ticks);\n\n\t\t\tif (tickOpts.reverse) {\n\t\t\t\tticks.reverse();\n\n\t\t\t\tme.start = me.max;\n\t\t\t\tme.end = me.min;\n\t\t\t} else {\n\t\t\t\tme.start = me.min;\n\t\t\t\tme.end = me.max;\n\t\t\t}\n\t\t},\n\t\tconvertTicksToLabels: function() {\n\t\t\tvar me = this;\n\t\t\tme.ticksAsNumbers = me.ticks.slice();\n\t\t\tme.zeroLineIndex = me.ticks.indexOf(0);\n\n\t\t\tChart.Scale.prototype.convertTicksToLabels.call(me);\n\t\t}\n\t});\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.linearbase.js?");
  440. /***/ }),
  441. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.logarithmic.js":
  442. /*!*************************************************************************************************!*\
  443. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.logarithmic.js ***!
  444. \*************************************************************************************************/
  445. /*! no static exports found */
  446. /***/ (function(module, exports, __webpack_require__) {
  447. "use strict";
  448. eval("\n\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar Ticks = __webpack_require__(/*! ../core/core.ticks */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js\");\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {Array<Number>} array of tick values\n */\nfunction generateTicks(generationOptions, dataRange) {\n\tvar ticks = [];\n\tvar valueOrDefault = helpers.valueOrDefault;\n\n\t// Figure out what the max number of ticks we can support it is based on the size of\n\t// the axis area. For now, we say that the minimum tick spacing in pixels must be 50\n\t// We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n\t// the graph\n\tvar tickVal = valueOrDefault(generationOptions.min, Math.pow(10, Math.floor(helpers.log10(dataRange.min))));\n\n\tvar endExp = Math.floor(helpers.log10(dataRange.max));\n\tvar endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n\tvar exp, significand;\n\n\tif (tickVal === 0) {\n\t\texp = Math.floor(helpers.log10(dataRange.minNotZero));\n\t\tsignificand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));\n\n\t\tticks.push(tickVal);\n\t\ttickVal = significand * Math.pow(10, exp);\n\t} else {\n\t\texp = Math.floor(helpers.log10(tickVal));\n\t\tsignificand = Math.floor(tickVal / Math.pow(10, exp));\n\t}\n\tvar precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n\n\tdo {\n\t\tticks.push(tickVal);\n\n\t\t++significand;\n\t\tif (significand === 10) {\n\t\t\tsignificand = 1;\n\t\t\t++exp;\n\t\t\tprecision = exp >= 0 ? 1 : precision;\n\t\t}\n\n\t\ttickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;\n\t} while (exp < endExp || (exp === endExp && significand < endSignificand));\n\n\tvar lastTick = valueOrDefault(generationOptions.max, tickVal);\n\tticks.push(lastTick);\n\n\treturn ticks;\n}\n\n\nmodule.exports = function(Chart) {\n\n\tvar defaultConfig = {\n\t\tposition: 'left',\n\n\t\t// label settings\n\t\tticks: {\n\t\t\tcallback: Ticks.formatters.logarithmic\n\t\t}\n\t};\n\n\tvar LogarithmicScale = Chart.Scale.extend({\n\t\tdetermineDataLimits: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar chart = me.chart;\n\t\t\tvar data = chart.data;\n\t\t\tvar datasets = data.datasets;\n\t\t\tvar isHorizontal = me.isHorizontal();\n\t\t\tfunction IDMatches(meta) {\n\t\t\t\treturn isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n\t\t\t}\n\n\t\t\t// Calculate Range\n\t\t\tme.min = null;\n\t\t\tme.max = null;\n\t\t\tme.minNotZero = null;\n\n\t\t\tvar hasStacks = opts.stacked;\n\t\t\tif (hasStacks === undefined) {\n\t\t\t\thelpers.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\t\tif (hasStacks) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n\t\t\t\t\t\tmeta.stack !== undefined) {\n\t\t\t\t\t\thasStacks = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (opts.stacked || hasStacks) {\n\t\t\t\tvar valuesPerStack = {};\n\n\t\t\t\thelpers.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\t\tvar key = [\n\t\t\t\t\t\tmeta.type,\n\t\t\t\t\t\t// we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n\t\t\t\t\t\t((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n\t\t\t\t\t\tmeta.stack\n\t\t\t\t\t].join('.');\n\n\t\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\t\tif (valuesPerStack[key] === undefined) {\n\t\t\t\t\t\t\tvaluesPerStack[key] = [];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thelpers.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\t\tvar values = valuesPerStack[key];\n\t\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\t\t// invalid, hidden and negative values are ignored\n\t\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden || value < 0) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalues[index] = values[index] || 0;\n\t\t\t\t\t\t\tvalues[index] += value;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\thelpers.each(valuesPerStack, function(valuesForType) {\n\t\t\t\t\tif (valuesForType.length > 0) {\n\t\t\t\t\t\tvar minVal = helpers.min(valuesForType);\n\t\t\t\t\t\tvar maxVal = helpers.max(valuesForType);\n\t\t\t\t\t\tme.min = me.min === null ? minVal : Math.min(me.min, minVal);\n\t\t\t\t\t\tme.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else {\n\t\t\t\thelpers.each(datasets, function(dataset, datasetIndex) {\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\t\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n\t\t\t\t\t\thelpers.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\t\t// invalid, hidden and negative values are ignored\n\t\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden || value < 0) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (me.min === null) {\n\t\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t\t} else if (value < me.min) {\n\t\t\t\t\t\t\t\tme.min = value;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (me.max === null) {\n\t\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t\t} else if (value > me.max) {\n\t\t\t\t\t\t\t\tme.max = value;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {\n\t\t\t\t\t\t\t\tme.minNotZero = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Common base implementation to handle ticks.min, ticks.max\n\t\t\tthis.handleTickRangeOptions();\n\t\t},\n\t\thandleTickRangeOptions: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar tickOpts = opts.ticks;\n\t\t\tvar valueOrDefault = helpers.valueOrDefault;\n\t\t\tvar DEFAULT_MIN = 1;\n\t\t\tvar DEFAULT_MAX = 10;\n\n\t\t\tme.min = valueOrDefault(tickOpts.min, me.min);\n\t\t\tme.max = valueOrDefault(tickOpts.max, me.max);\n\n\t\t\tif (me.min === me.max) {\n\t\t\t\tif (me.min !== 0 && me.min !== null) {\n\t\t\t\t\tme.min = Math.pow(10, Math.floor(helpers.log10(me.min)) - 1);\n\t\t\t\t\tme.max = Math.pow(10, Math.floor(helpers.log10(me.max)) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tme.min = DEFAULT_MIN;\n\t\t\t\t\tme.max = DEFAULT_MAX;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me.min === null) {\n\t\t\t\tme.min = Math.pow(10, Math.floor(helpers.log10(me.max)) - 1);\n\t\t\t}\n\t\t\tif (me.max === null) {\n\t\t\t\tme.max = me.min !== 0\n\t\t\t\t\t? Math.pow(10, Math.floor(helpers.log10(me.min)) + 1)\n\t\t\t\t\t: DEFAULT_MAX;\n\t\t\t}\n\t\t\tif (me.minNotZero === null) {\n\t\t\t\tif (me.min > 0) {\n\t\t\t\t\tme.minNotZero = me.min;\n\t\t\t\t} else if (me.max < 1) {\n\t\t\t\t\tme.minNotZero = Math.pow(10, Math.floor(helpers.log10(me.max)));\n\t\t\t\t} else {\n\t\t\t\t\tme.minNotZero = DEFAULT_MIN;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tbuildTicks: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar tickOpts = opts.ticks;\n\t\t\tvar reverse = !me.isHorizontal();\n\n\t\t\tvar generationOptions = {\n\t\t\t\tmin: tickOpts.min,\n\t\t\t\tmax: tickOpts.max\n\t\t\t};\n\t\t\tvar ticks = me.ticks = generateTicks(generationOptions, me);\n\n\t\t\t// At this point, we need to update our max and min given the tick values since we have expanded the\n\t\t\t// range of the scale\n\t\t\tme.max = helpers.max(ticks);\n\t\t\tme.min = helpers.min(ticks);\n\n\t\t\tif (tickOpts.reverse) {\n\t\t\t\treverse = !reverse;\n\t\t\t\tme.start = me.max;\n\t\t\t\tme.end = me.min;\n\t\t\t} else {\n\t\t\t\tme.start = me.min;\n\t\t\t\tme.end = me.max;\n\t\t\t}\n\t\t\tif (reverse) {\n\t\t\t\tticks.reverse();\n\t\t\t}\n\t\t},\n\t\tconvertTicksToLabels: function() {\n\t\t\tthis.tickValues = this.ticks.slice();\n\n\t\t\tChart.Scale.prototype.convertTicksToLabels.call(this);\n\t\t},\n\t\t// Get the correct tooltip label\n\t\tgetLabelForIndex: function(index, datasetIndex) {\n\t\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n\t\t},\n\t\tgetPixelForTick: function(index) {\n\t\t\treturn this.getPixelForValue(this.tickValues[index]);\n\t\t},\n\t\t/**\n\t\t * Returns the value of the first tick.\n\t\t * @param {Number} value - The minimum not zero value.\n\t\t * @return {Number} The first tick value.\n\t\t * @private\n\t\t */\n\t\t_getFirstTickValue: function(value) {\n\t\t\tvar exp = Math.floor(helpers.log10(value));\n\t\t\tvar significand = Math.floor(value / Math.pow(10, exp));\n\n\t\t\treturn significand * Math.pow(10, exp);\n\t\t},\n\t\tgetPixelForValue: function(value) {\n\t\t\tvar me = this;\n\t\t\tvar reverse = me.options.ticks.reverse;\n\t\t\tvar log10 = helpers.log10;\n\t\t\tvar firstTickValue = me._getFirstTickValue(me.minNotZero);\n\t\t\tvar offset = 0;\n\t\t\tvar innerDimension, pixel, start, end, sign;\n\n\t\t\tvalue = +me.getRightValue(value);\n\t\t\tif (reverse) {\n\t\t\t\tstart = me.end;\n\t\t\t\tend = me.start;\n\t\t\t\tsign = -1;\n\t\t\t} else {\n\t\t\t\tstart = me.start;\n\t\t\t\tend = me.end;\n\t\t\t\tsign = 1;\n\t\t\t}\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tinnerDimension = me.width;\n\t\t\t\tpixel = reverse ? me.right : me.left;\n\t\t\t} else {\n\t\t\t\tinnerDimension = me.height;\n\t\t\t\tsign *= -1; // invert, since the upper-left corner of the canvas is at pixel (0, 0)\n\t\t\t\tpixel = reverse ? me.top : me.bottom;\n\t\t\t}\n\t\t\tif (value !== start) {\n\t\t\t\tif (start === 0) { // include zero tick\n\t\t\t\t\toffset = helpers.getValueOrDefault(\n\t\t\t\t\t\tme.options.ticks.fontSize,\n\t\t\t\t\t\tChart.defaults.global.defaultFontSize\n\t\t\t\t\t);\n\t\t\t\t\tinnerDimension -= offset;\n\t\t\t\t\tstart = firstTickValue;\n\t\t\t\t}\n\t\t\t\tif (value !== 0) {\n\t\t\t\t\toffset += innerDimension / (log10(end) - log10(start)) * (log10(value) - log10(start));\n\t\t\t\t}\n\t\t\t\tpixel += sign * offset;\n\t\t\t}\n\t\t\treturn pixel;\n\t\t},\n\t\tgetValueForPixel: function(pixel) {\n\t\t\tvar me = this;\n\t\t\tvar reverse = me.options.ticks.reverse;\n\t\t\tvar log10 = helpers.log10;\n\t\t\tvar firstTickValue = me._getFirstTickValue(me.minNotZero);\n\t\t\tvar innerDimension, start, end, value;\n\n\t\t\tif (reverse) {\n\t\t\t\tstart = me.end;\n\t\t\t\tend = me.start;\n\t\t\t} else {\n\t\t\t\tstart = me.start;\n\t\t\t\tend = me.end;\n\t\t\t}\n\t\t\tif (me.isHorizontal()) {\n\t\t\t\tinnerDimension = me.width;\n\t\t\t\tvalue = reverse ? me.right - pixel : pixel - me.left;\n\t\t\t} else {\n\t\t\t\tinnerDimension = me.height;\n\t\t\t\tvalue = reverse ? pixel - me.top : me.bottom - pixel;\n\t\t\t}\n\t\t\tif (value !== start) {\n\t\t\t\tif (start === 0) { // include zero tick\n\t\t\t\t\tvar offset = helpers.getValueOrDefault(\n\t\t\t\t\t\tme.options.ticks.fontSize,\n\t\t\t\t\t\tChart.defaults.global.defaultFontSize\n\t\t\t\t\t);\n\t\t\t\t\tvalue -= offset;\n\t\t\t\t\tinnerDimension -= offset;\n\t\t\t\t\tstart = firstTickValue;\n\t\t\t\t}\n\t\t\t\tvalue *= log10(end) - log10(start);\n\t\t\t\tvalue /= innerDimension;\n\t\t\t\tvalue = Math.pow(10, log10(start) + value);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t});\n\tChart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.logarithmic.js?");
  449. /***/ }),
  450. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.radialLinear.js":
  451. /*!**************************************************************************************************!*\
  452. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.radialLinear.js ***!
  453. \**************************************************************************************************/
  454. /*! no static exports found */
  455. /***/ (function(module, exports, __webpack_require__) {
  456. "use strict";
  457. eval("\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\nvar Ticks = __webpack_require__(/*! ../core/core.ticks */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.ticks.js\");\n\nmodule.exports = function(Chart) {\n\n\tvar globalDefaults = defaults.global;\n\n\tvar defaultConfig = {\n\t\tdisplay: true,\n\n\t\t// Boolean - Whether to animate scaling the chart from the centre\n\t\tanimate: true,\n\t\tposition: 'chartArea',\n\n\t\tangleLines: {\n\t\t\tdisplay: true,\n\t\t\tcolor: 'rgba(0, 0, 0, 0.1)',\n\t\t\tlineWidth: 1\n\t\t},\n\n\t\tgridLines: {\n\t\t\tcircular: false\n\t\t},\n\n\t\t// label settings\n\t\tticks: {\n\t\t\t// Boolean - Show a backdrop to the scale label\n\t\t\tshowLabelBackdrop: true,\n\n\t\t\t// String - The colour of the label backdrop\n\t\t\tbackdropColor: 'rgba(255,255,255,0.75)',\n\n\t\t\t// Number - The backdrop padding above & below the label in pixels\n\t\t\tbackdropPaddingY: 2,\n\n\t\t\t// Number - The backdrop padding to the side of the label in pixels\n\t\t\tbackdropPaddingX: 2,\n\n\t\t\tcallback: Ticks.formatters.linear\n\t\t},\n\n\t\tpointLabels: {\n\t\t\t// Boolean - if true, show point labels\n\t\t\tdisplay: true,\n\n\t\t\t// Number - Point label font size in pixels\n\t\t\tfontSize: 10,\n\n\t\t\t// Function - Used to convert point labels\n\t\t\tcallback: function(label) {\n\t\t\t\treturn label;\n\t\t\t}\n\t\t}\n\t};\n\n\tfunction getValueCount(scale) {\n\t\tvar opts = scale.options;\n\t\treturn opts.angleLines.display || opts.pointLabels.display ? scale.chart.data.labels.length : 0;\n\t}\n\n\tfunction getPointLabelFontOptions(scale) {\n\t\tvar pointLabelOptions = scale.options.pointLabels;\n\t\tvar fontSize = helpers.valueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);\n\t\tvar fontStyle = helpers.valueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);\n\t\tvar fontFamily = helpers.valueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily);\n\t\tvar font = helpers.fontString(fontSize, fontStyle, fontFamily);\n\n\t\treturn {\n\t\t\tsize: fontSize,\n\t\t\tstyle: fontStyle,\n\t\t\tfamily: fontFamily,\n\t\t\tfont: font\n\t\t};\n\t}\n\n\tfunction measureLabelSize(ctx, fontSize, label) {\n\t\tif (helpers.isArray(label)) {\n\t\t\treturn {\n\t\t\t\tw: helpers.longestText(ctx, ctx.font, label),\n\t\t\t\th: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tw: ctx.measureText(label).width,\n\t\t\th: fontSize\n\t\t};\n\t}\n\n\tfunction determineLimits(angle, pos, size, min, max) {\n\t\tif (angle === min || angle === max) {\n\t\t\treturn {\n\t\t\t\tstart: pos - (size / 2),\n\t\t\t\tend: pos + (size / 2)\n\t\t\t};\n\t\t} else if (angle < min || angle > max) {\n\t\t\treturn {\n\t\t\t\tstart: pos - size - 5,\n\t\t\t\tend: pos\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tstart: pos,\n\t\t\tend: pos + size + 5\n\t\t};\n\t}\n\n\t/**\n\t * Helper function to fit a radial linear scale with point labels\n\t */\n\tfunction fitWithPointLabels(scale) {\n\t\t/*\n\t\t * Right, this is really confusing and there is a lot of maths going on here\n\t\t * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n\t\t *\n\t\t * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n\t\t *\n\t\t * Solution:\n\t\t *\n\t\t * We assume the radius of the polygon is half the size of the canvas at first\n\t\t * at each index we check if the text overlaps.\n\t\t *\n\t\t * Where it does, we store that angle and that index.\n\t\t *\n\t\t * After finding the largest index and angle we calculate how much we need to remove\n\t\t * from the shape radius to move the point inwards by that x.\n\t\t *\n\t\t * We average the left and right distances to get the maximum shape radius that can fit in the box\n\t\t * along with labels.\n\t\t *\n\t\t * Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n\t\t * on each side, removing that from the size, halving it and adding the left x protrusion width.\n\t\t *\n\t\t * This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n\t\t * and position it in the most space efficient manner\n\t\t *\n\t\t * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\t\t */\n\n\t\tvar plFont = getPointLabelFontOptions(scale);\n\n\t\t// Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n\t\t// Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n\t\tvar largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);\n\t\tvar furthestLimits = {\n\t\t\tr: scale.width,\n\t\t\tl: 0,\n\t\t\tt: scale.height,\n\t\t\tb: 0\n\t\t};\n\t\tvar furthestAngles = {};\n\t\tvar i, textSize, pointPosition;\n\n\t\tscale.ctx.font = plFont.font;\n\t\tscale._pointLabelSizes = [];\n\n\t\tvar valueCount = getValueCount(scale);\n\t\tfor (i = 0; i < valueCount; i++) {\n\t\t\tpointPosition = scale.getPointPosition(i, largestPossibleRadius);\n\t\t\ttextSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || '');\n\t\t\tscale._pointLabelSizes[i] = textSize;\n\n\t\t\t// Add quarter circle to make degree 0 mean top of circle\n\t\t\tvar angleRadians = scale.getIndexAngle(i);\n\t\t\tvar angle = helpers.toDegrees(angleRadians) % 360;\n\t\t\tvar hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n\t\t\tvar vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n\n\t\t\tif (hLimits.start < furthestLimits.l) {\n\t\t\t\tfurthestLimits.l = hLimits.start;\n\t\t\t\tfurthestAngles.l = angleRadians;\n\t\t\t}\n\n\t\t\tif (hLimits.end > furthestLimits.r) {\n\t\t\t\tfurthestLimits.r = hLimits.end;\n\t\t\t\tfurthestAngles.r = angleRadians;\n\t\t\t}\n\n\t\t\tif (vLimits.start < furthestLimits.t) {\n\t\t\t\tfurthestLimits.t = vLimits.start;\n\t\t\t\tfurthestAngles.t = angleRadians;\n\t\t\t}\n\n\t\t\tif (vLimits.end > furthestLimits.b) {\n\t\t\t\tfurthestLimits.b = vLimits.end;\n\t\t\t\tfurthestAngles.b = angleRadians;\n\t\t\t}\n\t\t}\n\n\t\tscale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles);\n\t}\n\n\t/**\n\t * Helper function to fit a radial linear scale with no point labels\n\t */\n\tfunction fit(scale) {\n\t\tvar largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);\n\t\tscale.drawingArea = Math.round(largestPossibleRadius);\n\t\tscale.setCenterPoint(0, 0, 0, 0);\n\t}\n\n\tfunction getTextAlignForAngle(angle) {\n\t\tif (angle === 0 || angle === 180) {\n\t\t\treturn 'center';\n\t\t} else if (angle < 180) {\n\t\t\treturn 'left';\n\t\t}\n\n\t\treturn 'right';\n\t}\n\n\tfunction fillText(ctx, text, position, fontSize) {\n\t\tif (helpers.isArray(text)) {\n\t\t\tvar y = position.y;\n\t\t\tvar spacing = 1.5 * fontSize;\n\n\t\t\tfor (var i = 0; i < text.length; ++i) {\n\t\t\t\tctx.fillText(text[i], position.x, y);\n\t\t\t\ty += spacing;\n\t\t\t}\n\t\t} else {\n\t\t\tctx.fillText(text, position.x, position.y);\n\t\t}\n\t}\n\n\tfunction adjustPointPositionForLabelHeight(angle, textSize, position) {\n\t\tif (angle === 90 || angle === 270) {\n\t\t\tposition.y -= (textSize.h / 2);\n\t\t} else if (angle > 270 || angle < 90) {\n\t\t\tposition.y -= textSize.h;\n\t\t}\n\t}\n\n\tfunction drawPointLabels(scale) {\n\t\tvar ctx = scale.ctx;\n\t\tvar opts = scale.options;\n\t\tvar angleLineOpts = opts.angleLines;\n\t\tvar pointLabelOpts = opts.pointLabels;\n\n\t\tctx.lineWidth = angleLineOpts.lineWidth;\n\t\tctx.strokeStyle = angleLineOpts.color;\n\n\t\tvar outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);\n\n\t\t// Point Label Font\n\t\tvar plFont = getPointLabelFontOptions(scale);\n\n\t\tctx.textBaseline = 'top';\n\n\t\tfor (var i = getValueCount(scale) - 1; i >= 0; i--) {\n\t\t\tif (angleLineOpts.display) {\n\t\t\t\tvar outerPosition = scale.getPointPosition(i, outerDistance);\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(scale.xCenter, scale.yCenter);\n\t\t\t\tctx.lineTo(outerPosition.x, outerPosition.y);\n\t\t\t\tctx.stroke();\n\t\t\t\tctx.closePath();\n\t\t\t}\n\n\t\t\tif (pointLabelOpts.display) {\n\t\t\t\t// Extra 3px out for some label spacing\n\t\t\t\tvar pointLabelPosition = scale.getPointPosition(i, outerDistance + 5);\n\n\t\t\t\t// Keep this in loop since we may support array properties here\n\t\t\t\tvar pointLabelFontColor = helpers.valueAtIndexOrDefault(pointLabelOpts.fontColor, i, globalDefaults.defaultFontColor);\n\t\t\t\tctx.font = plFont.font;\n\t\t\t\tctx.fillStyle = pointLabelFontColor;\n\n\t\t\t\tvar angleRadians = scale.getIndexAngle(i);\n\t\t\t\tvar angle = helpers.toDegrees(angleRadians);\n\t\t\t\tctx.textAlign = getTextAlignForAngle(angle);\n\t\t\t\tadjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);\n\t\t\t\tfillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction drawRadiusLine(scale, gridLineOpts, radius, index) {\n\t\tvar ctx = scale.ctx;\n\t\tctx.strokeStyle = helpers.valueAtIndexOrDefault(gridLineOpts.color, index - 1);\n\t\tctx.lineWidth = helpers.valueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);\n\n\t\tif (scale.options.gridLines.circular) {\n\t\t\t// Draw circular arcs between the points\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);\n\t\t\tctx.closePath();\n\t\t\tctx.stroke();\n\t\t} else {\n\t\t\t// Draw straight lines connecting each index\n\t\t\tvar valueCount = getValueCount(scale);\n\n\t\t\tif (valueCount === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tctx.beginPath();\n\t\t\tvar pointPosition = scale.getPointPosition(0, radius);\n\t\t\tctx.moveTo(pointPosition.x, pointPosition.y);\n\n\t\t\tfor (var i = 1; i < valueCount; i++) {\n\t\t\t\tpointPosition = scale.getPointPosition(i, radius);\n\t\t\t\tctx.lineTo(pointPosition.x, pointPosition.y);\n\t\t\t}\n\n\t\t\tctx.closePath();\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\tfunction numberOrZero(param) {\n\t\treturn helpers.isNumber(param) ? param : 0;\n\t}\n\n\tvar LinearRadialScale = Chart.LinearScaleBase.extend({\n\t\tsetDimensions: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar tickOpts = opts.ticks;\n\t\t\t// Set the unconstrained dimension before label rotation\n\t\t\tme.width = me.maxWidth;\n\t\t\tme.height = me.maxHeight;\n\t\t\tme.xCenter = Math.round(me.width / 2);\n\t\t\tme.yCenter = Math.round(me.height / 2);\n\n\t\t\tvar minSize = helpers.min([me.height, me.width]);\n\t\t\tvar tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n\t\t\tme.drawingArea = opts.display ? (minSize / 2) - (tickFontSize / 2 + tickOpts.backdropPaddingY) : (minSize / 2);\n\t\t},\n\t\tdetermineDataLimits: function() {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar min = Number.POSITIVE_INFINITY;\n\t\t\tvar max = Number.NEGATIVE_INFINITY;\n\n\t\t\thelpers.each(chart.data.datasets, function(dataset, datasetIndex) {\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex)) {\n\t\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\n\n\t\t\t\t\thelpers.each(dataset.data, function(rawValue, index) {\n\t\t\t\t\t\tvar value = +me.getRightValue(rawValue);\n\t\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmin = Math.min(value, min);\n\t\t\t\t\t\tmax = Math.max(value, max);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tme.min = (min === Number.POSITIVE_INFINITY ? 0 : min);\n\t\t\tme.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);\n\n\t\t\t// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n\t\t\tme.handleTickRangeOptions();\n\t\t},\n\t\tgetTickLimit: function() {\n\t\t\tvar tickOpts = this.options.ticks;\n\t\t\tvar tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n\t\t\treturn Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * tickFontSize)));\n\t\t},\n\t\tconvertTicksToLabels: function() {\n\t\t\tvar me = this;\n\n\t\t\tChart.LinearScaleBase.prototype.convertTicksToLabels.call(me);\n\n\t\t\t// Point labels\n\t\t\tme.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);\n\t\t},\n\t\tgetLabelForIndex: function(index, datasetIndex) {\n\t\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n\t\t},\n\t\tfit: function() {\n\t\t\tif (this.options.pointLabels.display) {\n\t\t\t\tfitWithPointLabels(this);\n\t\t\t} else {\n\t\t\t\tfit(this);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Set radius reductions and determine new radius and center point\n\t\t * @private\n\t\t */\n\t\tsetReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {\n\t\t\tvar me = this;\n\t\t\tvar radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);\n\t\t\tvar radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);\n\t\t\tvar radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);\n\t\t\tvar radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b);\n\n\t\t\tradiusReductionLeft = numberOrZero(radiusReductionLeft);\n\t\t\tradiusReductionRight = numberOrZero(radiusReductionRight);\n\t\t\tradiusReductionTop = numberOrZero(radiusReductionTop);\n\t\t\tradiusReductionBottom = numberOrZero(radiusReductionBottom);\n\n\t\t\tme.drawingArea = Math.min(\n\t\t\t\tMath.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),\n\t\t\t\tMath.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));\n\t\t\tme.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);\n\t\t},\n\t\tsetCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {\n\t\t\tvar me = this;\n\t\t\tvar maxRight = me.width - rightMovement - me.drawingArea;\n\t\t\tvar maxLeft = leftMovement + me.drawingArea;\n\t\t\tvar maxTop = topMovement + me.drawingArea;\n\t\t\tvar maxBottom = me.height - bottomMovement - me.drawingArea;\n\n\t\t\tme.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left);\n\t\t\tme.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top);\n\t\t},\n\n\t\tgetIndexAngle: function(index) {\n\t\t\tvar angleMultiplier = (Math.PI * 2) / getValueCount(this);\n\t\t\tvar startAngle = this.chart.options && this.chart.options.startAngle ?\n\t\t\t\tthis.chart.options.startAngle :\n\t\t\t\t0;\n\n\t\t\tvar startAngleRadians = startAngle * Math.PI * 2 / 360;\n\n\t\t\t// Start from the top instead of right, so remove a quarter of the circle\n\t\t\treturn index * angleMultiplier + startAngleRadians;\n\t\t},\n\t\tgetDistanceFromCenterForValue: function(value) {\n\t\t\tvar me = this;\n\n\t\t\tif (value === null) {\n\t\t\t\treturn 0; // null always in center\n\t\t\t}\n\n\t\t\t// Take into account half font size + the yPadding of the top value\n\t\t\tvar scalingFactor = me.drawingArea / (me.max - me.min);\n\t\t\tif (me.options.ticks.reverse) {\n\t\t\t\treturn (me.max - value) * scalingFactor;\n\t\t\t}\n\t\t\treturn (value - me.min) * scalingFactor;\n\t\t},\n\t\tgetPointPosition: function(index, distanceFromCenter) {\n\t\t\tvar me = this;\n\t\t\tvar thisAngle = me.getIndexAngle(index) - (Math.PI / 2);\n\t\t\treturn {\n\t\t\t\tx: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter,\n\t\t\t\ty: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter\n\t\t\t};\n\t\t},\n\t\tgetPointPositionForValue: function(index, value) {\n\t\t\treturn this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n\t\t},\n\n\t\tgetBasePosition: function() {\n\t\t\tvar me = this;\n\t\t\tvar min = me.min;\n\t\t\tvar max = me.max;\n\n\t\t\treturn me.getPointPositionForValue(0,\n\t\t\t\tme.beginAtZero ? 0 :\n\t\t\t\tmin < 0 && max < 0 ? max :\n\t\t\t\tmin > 0 && max > 0 ? min :\n\t\t\t\t0);\n\t\t},\n\n\t\tdraw: function() {\n\t\t\tvar me = this;\n\t\t\tvar opts = me.options;\n\t\t\tvar gridLineOpts = opts.gridLines;\n\t\t\tvar tickOpts = opts.ticks;\n\t\t\tvar valueOrDefault = helpers.valueOrDefault;\n\n\t\t\tif (opts.display) {\n\t\t\t\tvar ctx = me.ctx;\n\t\t\t\tvar startAngle = this.getIndexAngle(0);\n\n\t\t\t\t// Tick Font\n\t\t\t\tvar tickFontSize = valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n\t\t\t\tvar tickFontStyle = valueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle);\n\t\t\t\tvar tickFontFamily = valueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily);\n\t\t\t\tvar tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);\n\n\t\t\t\thelpers.each(me.ticks, function(label, index) {\n\t\t\t\t\t// Don't draw a centre value (if it is minimum)\n\t\t\t\t\tif (index > 0 || tickOpts.reverse) {\n\t\t\t\t\t\tvar yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);\n\n\t\t\t\t\t\t// Draw circular lines around the scale\n\t\t\t\t\t\tif (gridLineOpts.display && index !== 0) {\n\t\t\t\t\t\t\tdrawRadiusLine(me, gridLineOpts, yCenterOffset, index);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tickOpts.display) {\n\t\t\t\t\t\t\tvar tickFontColor = valueOrDefault(tickOpts.fontColor, globalDefaults.defaultFontColor);\n\t\t\t\t\t\t\tctx.font = tickLabelFont;\n\n\t\t\t\t\t\t\tctx.save();\n\t\t\t\t\t\t\tctx.translate(me.xCenter, me.yCenter);\n\t\t\t\t\t\t\tctx.rotate(startAngle);\n\n\t\t\t\t\t\t\tif (tickOpts.showLabelBackdrop) {\n\t\t\t\t\t\t\t\tvar labelWidth = ctx.measureText(label).width;\n\t\t\t\t\t\t\t\tctx.fillStyle = tickOpts.backdropColor;\n\t\t\t\t\t\t\t\tctx.fillRect(\n\t\t\t\t\t\t\t\t\t-labelWidth / 2 - tickOpts.backdropPaddingX,\n\t\t\t\t\t\t\t\t\t-yCenterOffset - tickFontSize / 2 - tickOpts.backdropPaddingY,\n\t\t\t\t\t\t\t\t\tlabelWidth + tickOpts.backdropPaddingX * 2,\n\t\t\t\t\t\t\t\t\ttickFontSize + tickOpts.backdropPaddingY * 2\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tctx.textAlign = 'center';\n\t\t\t\t\t\t\tctx.textBaseline = 'middle';\n\t\t\t\t\t\t\tctx.fillStyle = tickFontColor;\n\t\t\t\t\t\t\tctx.fillText(label, 0, -yCenterOffset);\n\t\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (opts.angleLines.display || opts.pointLabels.display) {\n\t\t\t\t\tdrawPointLabels(me);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tChart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);\n\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.radialLinear.js?");
  458. /***/ }),
  459. /***/ "./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.time.js":
  460. /*!******************************************************************************************!*\
  461. !*** ./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.time.js ***!
  462. \******************************************************************************************/
  463. /*! no static exports found */
  464. /***/ (function(module, exports, __webpack_require__) {
  465. "use strict";
  466. eval("/* global window: false */\n\n\nvar moment = __webpack_require__(/*! moment */ \"./node_modules/.pnpm/moment@2.30.1/node_modules/moment/moment.js\");\nmoment = typeof moment === 'function' ? moment : window.moment;\n\nvar defaults = __webpack_require__(/*! ../core/core.defaults */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/core/core.defaults.js\");\nvar helpers = __webpack_require__(/*! ../helpers/index */ \"./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/helpers/index.js\");\n\n// Integer constants are from the ES6 spec.\nvar MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\nvar MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\nvar INTERVALS = {\n\tmillisecond: {\n\t\tcommon: true,\n\t\tsize: 1,\n\t\tsteps: [1, 2, 5, 10, 20, 50, 100, 250, 500]\n\t},\n\tsecond: {\n\t\tcommon: true,\n\t\tsize: 1000,\n\t\tsteps: [1, 2, 5, 10, 30]\n\t},\n\tminute: {\n\t\tcommon: true,\n\t\tsize: 60000,\n\t\tsteps: [1, 2, 5, 10, 30]\n\t},\n\thour: {\n\t\tcommon: true,\n\t\tsize: 3600000,\n\t\tsteps: [1, 2, 3, 6, 12]\n\t},\n\tday: {\n\t\tcommon: true,\n\t\tsize: 86400000,\n\t\tsteps: [1, 2, 5]\n\t},\n\tweek: {\n\t\tcommon: false,\n\t\tsize: 604800000,\n\t\tsteps: [1, 2, 3, 4]\n\t},\n\tmonth: {\n\t\tcommon: true,\n\t\tsize: 2.628e9,\n\t\tsteps: [1, 2, 3]\n\t},\n\tquarter: {\n\t\tcommon: false,\n\t\tsize: 7.884e9,\n\t\tsteps: [1, 2, 3, 4]\n\t},\n\tyear: {\n\t\tcommon: true,\n\t\tsize: 3.154e10\n\t}\n};\n\nvar UNITS = Object.keys(INTERVALS);\n\nfunction sorter(a, b) {\n\treturn a - b;\n}\n\nfunction arrayUnique(items) {\n\tvar hash = {};\n\tvar out = [];\n\tvar i, ilen, item;\n\n\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\n\t\titem = items[i];\n\t\tif (!hash[item]) {\n\t\t\thash[item] = true;\n\t\t\tout.push(item);\n\t\t}\n\t}\n\n\treturn out;\n}\n\n/**\n * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n * extremity (left + width or top + height). Note that it would be more optimized to directly\n * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n *\n * @param {Number[]} timestamps - timestamps sorted from lowest to highest.\n * @param {String} distribution - If 'linear', timestamps will be spread linearly along the min\n * and max range, so basically, the table will contains only two items: {min, 0} and {max, 1}.\n * If 'series', timestamps will be positioned at the same distance from each other. In this\n * case, only timestamps that break the time linearity are registered, meaning that in the\n * best case, all timestamps are linear, the table contains only min and max.\n */\nfunction buildLookupTable(timestamps, min, max, distribution) {\n\tif (distribution === 'linear' || !timestamps.length) {\n\t\treturn [\n\t\t\t{time: min, pos: 0},\n\t\t\t{time: max, pos: 1}\n\t\t];\n\t}\n\n\tvar table = [];\n\tvar items = [min];\n\tvar i, ilen, prev, curr, next;\n\n\tfor (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n\t\tcurr = timestamps[i];\n\t\tif (curr > min && curr < max) {\n\t\t\titems.push(curr);\n\t\t}\n\t}\n\n\titems.push(max);\n\n\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\n\t\tnext = items[i + 1];\n\t\tprev = items[i - 1];\n\t\tcurr = items[i];\n\n\t\t// only add points that breaks the scale linearity\n\t\tif (prev === undefined || next === undefined || Math.round((next + prev) / 2) !== curr) {\n\t\t\ttable.push({time: curr, pos: i / (ilen - 1)});\n\t\t}\n\t}\n\n\treturn table;\n}\n\n// @see adapted from http://www.anujgakhar.com/2014/03/01/binary-search-in-javascript/\nfunction lookup(table, key, value) {\n\tvar lo = 0;\n\tvar hi = table.length - 1;\n\tvar mid, i0, i1;\n\n\twhile (lo >= 0 && lo <= hi) {\n\t\tmid = (lo + hi) >> 1;\n\t\ti0 = table[mid - 1] || null;\n\t\ti1 = table[mid];\n\n\t\tif (!i0) {\n\t\t\t// given value is outside table (before first item)\n\t\t\treturn {lo: null, hi: i1};\n\t\t} else if (i1[key] < value) {\n\t\t\tlo = mid + 1;\n\t\t} else if (i0[key] > value) {\n\t\t\thi = mid - 1;\n\t\t} else {\n\t\t\treturn {lo: i0, hi: i1};\n\t\t}\n\t}\n\n\t// given value is outside table (after last item)\n\treturn {lo: i1, hi: null};\n}\n\n/**\n * Linearly interpolates the given source `value` using the table items `skey` values and\n * returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')\n * returns the position for a timestamp equal to 42. If value is out of bounds, values at\n * index [0, 1] or [n - 1, n] are used for the interpolation.\n */\nfunction interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}\n\n/**\n * Convert the given value to a moment object using the given time options.\n * @see http://momentjs.com/docs/#/parsing/\n */\nfunction momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}\n\nfunction parse(input, scale) {\n\tif (helpers.isNullOrUndef(input)) {\n\t\treturn null;\n\t}\n\n\tvar options = scale.options.time;\n\tvar value = momentify(scale.getRightValue(input), options);\n\tif (!value.isValid()) {\n\t\treturn null;\n\t}\n\n\tif (options.round) {\n\t\tvalue.startOf(options.round);\n\t}\n\n\treturn value.valueOf();\n}\n\n/**\n * Returns the number of unit to skip to be able to display up to `capacity` number of ticks\n * in `unit` for the given `min` / `max` range and respecting the interval steps constraints.\n */\nfunction determineStepSize(min, max, unit, capacity) {\n\tvar range = max - min;\n\tvar interval = INTERVALS[unit];\n\tvar milliseconds = interval.size;\n\tvar steps = interval.steps;\n\tvar i, ilen, factor;\n\n\tif (!steps) {\n\t\treturn Math.ceil(range / (capacity * milliseconds));\n\t}\n\n\tfor (i = 0, ilen = steps.length; i < ilen; ++i) {\n\t\tfactor = steps[i];\n\t\tif (Math.ceil(range / (milliseconds * factor)) <= capacity) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn factor;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n\tvar ilen = UNITS.length;\n\tvar i, interval, factor;\n\n\tfor (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n\t\tinterval = INTERVALS[UNITS[i]];\n\t\tfactor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;\n\n\t\tif (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n\t\t\treturn UNITS[i];\n\t\t}\n\t}\n\n\treturn UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n */\nfunction determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\nfunction determineMajorUnit(unit) {\n\tfor (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n\t\tif (INTERVALS[UNITS[i]].common) {\n\t\t\treturn UNITS[i];\n\t\t}\n\t}\n}\n\n/**\n * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n * `minor` unit, aligned on the `major` unit and using the given scale time `options`.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n */\nfunction generate(min, max, capacity, options) {\n\tvar timeOpts = options.time;\n\tvar minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);\n\tvar major = determineMajorUnit(minor);\n\tvar stepSize = helpers.valueOrDefault(timeOpts.stepSize, timeOpts.unitStepSize);\n\tvar weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n\tvar majorTicksEnabled = options.ticks.major.enabled;\n\tvar interval = INTERVALS[minor];\n\tvar first = moment(min);\n\tvar last = moment(max);\n\tvar ticks = [];\n\tvar time;\n\n\tif (!stepSize) {\n\t\tstepSize = determineStepSize(min, max, minor, capacity);\n\t}\n\n\t// For 'week' unit, handle the first day of week option\n\tif (weekday) {\n\t\tfirst = first.isoWeekday(weekday);\n\t\tlast = last.isoWeekday(weekday);\n\t}\n\n\t// Align first/last ticks on unit\n\tfirst = first.startOf(weekday ? 'day' : minor);\n\tlast = last.startOf(weekday ? 'day' : minor);\n\n\t// Make sure that the last tick include max\n\tif (last < max) {\n\t\tlast.add(1, minor);\n\t}\n\n\ttime = moment(first);\n\n\tif (majorTicksEnabled && major && !weekday && !timeOpts.round) {\n\t\t// Align the first tick on the previous `minor` unit aligned on the `major` unit:\n\t\t// we first aligned time on the previous `major` unit then add the number of full\n\t\t// stepSize there is between first and the previous major time.\n\t\ttime.startOf(major);\n\t\ttime.add(~~((first - time) / (interval.size * stepSize)) * stepSize, minor);\n\t}\n\n\tfor (; time < last; time.add(stepSize, minor)) {\n\t\tticks.push(+time);\n\t}\n\n\tticks.push(+time);\n\n\treturn ticks;\n}\n\n/**\n * Returns the right and left offsets from edges in the form of {left, right}.\n * Offsets are added when the `offset` option is true.\n */\nfunction computeOffsets(table, ticks, min, max, options) {\n\tvar left = 0;\n\tvar right = 0;\n\tvar upper, lower;\n\n\tif (options.offset && ticks.length) {\n\t\tif (!options.time.min) {\n\t\t\tupper = ticks.length > 1 ? ticks[1] : max;\n\t\t\tlower = ticks[0];\n\t\t\tleft = (\n\t\t\t\tinterpolate(table, 'time', upper, 'pos') -\n\t\t\t\tinterpolate(table, 'time', lower, 'pos')\n\t\t\t) / 2;\n\t\t}\n\t\tif (!options.time.max) {\n\t\t\tupper = ticks[ticks.length - 1];\n\t\t\tlower = ticks.length > 1 ? ticks[ticks.length - 2] : min;\n\t\t\tright = (\n\t\t\t\tinterpolate(table, 'time', upper, 'pos') -\n\t\t\t\tinterpolate(table, 'time', lower, 'pos')\n\t\t\t) / 2;\n\t\t}\n\t}\n\n\treturn {left: left, right: right};\n}\n\nfunction ticksFromTimestamps(values, majorUnit) {\n\tvar ticks = [];\n\tvar i, ilen, value, major;\n\n\tfor (i = 0, ilen = values.length; i < ilen; ++i) {\n\t\tvalue = values[i];\n\t\tmajor = majorUnit ? value === +moment(value).startOf(majorUnit) : false;\n\n\t\tticks.push({\n\t\t\tvalue: value,\n\t\t\tmajor: major\n\t\t});\n\t}\n\n\treturn ticks;\n}\n\nfunction determineLabelFormat(data, timeOpts) {\n\tvar i, momentDate, hasTime;\n\tvar ilen = data.length;\n\n\t// find the label with the most parts (milliseconds, minutes, etc.)\n\t// format all labels with the same level of detail as the most specific label\n\tfor (i = 0; i < ilen; i++) {\n\t\tmomentDate = momentify(data[i], timeOpts);\n\t\tif (momentDate.millisecond() !== 0) {\n\t\t\treturn 'MMM D, YYYY h:mm:ss.SSS a';\n\t\t}\n\t\tif (momentDate.second() !== 0 || momentDate.minute() !== 0 || momentDate.hour() !== 0) {\n\t\t\thasTime = true;\n\t\t}\n\t}\n\tif (hasTime) {\n\t\treturn 'MMM D, YYYY h:mm:ss a';\n\t}\n\treturn 'MMM D, YYYY';\n}\n\nmodule.exports = function(Chart) {\n\n\tvar defaultConfig = {\n\t\tposition: 'bottom',\n\n\t\t/**\n\t\t * Data distribution along the scale:\n\t\t * - 'linear': data are spread according to their time (distances can vary),\n\t\t * - 'series': data are spread at the same distance from each other.\n\t\t * @see https://github.com/chartjs/Chart.js/pull/4507\n\t\t * @since 2.7.0\n\t\t */\n\t\tdistribution: 'linear',\n\n\t\t/**\n\t\t * Scale boundary strategy (bypassed by min/max time options)\n\t\t * - `data`: make sure data are fully visible, ticks outside are removed\n\t\t * - `ticks`: make sure ticks are fully visible, data outside are truncated\n\t\t * @see https://github.com/chartjs/Chart.js/pull/4556\n\t\t * @since 2.7.0\n\t\t */\n\t\tbounds: 'data',\n\n\t\ttime: {\n\t\t\tparser: false, // false == a pattern string from http://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment\n\t\t\tformat: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from http://momentjs.com/docs/#/parsing/string-format/\n\t\t\tunit: false, // false == automatic or override with week, month, year, etc.\n\t\t\tround: false, // none, or override with week, month, year, etc.\n\t\t\tdisplayFormat: false, // DEPRECATED\n\t\t\tisoWeekday: false, // override week start day - see http://momentjs.com/docs/#/get-set/iso-weekday/\n\t\t\tminUnit: 'millisecond',\n\n\t\t\t// defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/\n\t\t\tdisplayFormats: {\n\t\t\t\tmillisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM,\n\t\t\t\tsecond: 'h:mm:ss a', // 11:20:01 AM\n\t\t\t\tminute: 'h:mm a', // 11:20 AM\n\t\t\t\thour: 'hA', // 5PM\n\t\t\t\tday: 'MMM D', // Sep 4\n\t\t\t\tweek: 'll', // Week 46, or maybe \"[W]WW - YYYY\" ?\n\t\t\t\tmonth: 'MMM YYYY', // Sept 2015\n\t\t\t\tquarter: '[Q]Q - YYYY', // Q3\n\t\t\t\tyear: 'YYYY' // 2015\n\t\t\t},\n\t\t},\n\t\tticks: {\n\t\t\tautoSkip: false,\n\n\t\t\t/**\n\t\t\t * Ticks generation input values:\n\t\t\t * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n\t\t\t * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n\t\t\t * - 'labels': generates ticks from user given `data.labels` values ONLY.\n\t\t\t * @see https://github.com/chartjs/Chart.js/pull/4507\n\t\t\t * @since 2.7.0\n\t\t\t */\n\t\t\tsource: 'auto',\n\n\t\t\tmajor: {\n\t\t\t\tenabled: false\n\t\t\t}\n\t\t}\n\t};\n\n\tvar TimeScale = Chart.Scale.extend({\n\t\tinitialize: function() {\n\t\t\tif (!moment) {\n\t\t\t\tthrow new Error('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com');\n\t\t\t}\n\n\t\t\tthis.mergeTicksOptions();\n\n\t\t\tChart.Scale.prototype.initialize.call(this);\n\t\t},\n\n\t\tupdate: function() {\n\t\t\tvar me = this;\n\t\t\tvar options = me.options;\n\n\t\t\t// DEPRECATIONS: output a message only one time per update\n\t\t\tif (options.time && options.time.format) {\n\t\t\t\tconsole.warn('options.time.format is deprecated and replaced by options.time.parser.');\n\t\t\t}\n\n\t\t\treturn Chart.Scale.prototype.update.apply(me, arguments);\n\t\t},\n\n\t\t/**\n\t\t * Allows data to be referenced via 't' attribute\n\t\t */\n\t\tgetRightValue: function(rawValue) {\n\t\t\tif (rawValue && rawValue.t !== undefined) {\n\t\t\t\trawValue = rawValue.t;\n\t\t\t}\n\t\t\treturn Chart.Scale.prototype.getRightValue.call(this, rawValue);\n\t\t},\n\n\t\tdetermineDataLimits: function() {\n\t\t\tvar me = this;\n\t\t\tvar chart = me.chart;\n\t\t\tvar timeOpts = me.options.time;\n\t\t\tvar unit = timeOpts.unit || 'day';\n\t\t\tvar min = MAX_INTEGER;\n\t\t\tvar max = MIN_INTEGER;\n\t\t\tvar timestamps = [];\n\t\t\tvar datasets = [];\n\t\t\tvar labels = [];\n\t\t\tvar i, j, ilen, jlen, data, timestamp;\n\n\t\t\t// Convert labels to timestamps\n\t\t\tfor (i = 0, ilen = chart.data.labels.length; i < ilen; ++i) {\n\t\t\t\tlabels.push(parse(chart.data.labels[i], me));\n\t\t\t}\n\n\t\t\t// Convert data to timestamps\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n\t\t\t\tif (chart.isDatasetVisible(i)) {\n\t\t\t\t\tdata = chart.data.datasets[i].data;\n\n\t\t\t\t\t// Let's consider that all data have the same format.\n\t\t\t\t\tif (helpers.isObject(data[0])) {\n\t\t\t\t\t\tdatasets[i] = [];\n\n\t\t\t\t\t\tfor (j = 0, jlen = data.length; j < jlen; ++j) {\n\t\t\t\t\t\t\ttimestamp = parse(data[j], me);\n\t\t\t\t\t\t\ttimestamps.push(timestamp);\n\t\t\t\t\t\t\tdatasets[i][j] = timestamp;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttimestamps.push.apply(timestamps, labels);\n\t\t\t\t\t\tdatasets[i] = labels.slice(0);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdatasets[i] = [];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (labels.length) {\n\t\t\t\t// Sort labels **after** data have been converted\n\t\t\t\tlabels = arrayUnique(labels).sort(sorter);\n\t\t\t\tmin = Math.min(min, labels[0]);\n\t\t\t\tmax = Math.max(max, labels[labels.length - 1]);\n\t\t\t}\n\n\t\t\tif (timestamps.length) {\n\t\t\t\ttimestamps = arrayUnique(timestamps).sort(sorter);\n\t\t\t\tmin = Math.min(min, timestamps[0]);\n\t\t\t\tmax = Math.max(max, timestamps[timestamps.length - 1]);\n\t\t\t}\n\n\t\t\tmin = parse(timeOpts.min, me) || min;\n\t\t\tmax = parse(timeOpts.max, me) || max;\n\n\t\t\t// In case there is no valid min/max, set limits based on unit time option\n\t\t\tmin = min === MAX_INTEGER ? +moment().startOf(unit) : min;\n\t\t\tmax = max === MIN_INTEGER ? +moment().endOf(unit) + 1 : max;\n\n\t\t\t// Make sure that max is strictly higher than min (required by the lookup table)\n\t\t\tme.min = Math.min(min, max);\n\t\t\tme.max = Math.max(min + 1, max);\n\n\t\t\t// PRIVATE\n\t\t\tme._horizontal = me.isHorizontal();\n\t\t\tme._table = [];\n\t\t\tme._timestamps = {\n\t\t\t\tdata: timestamps,\n\t\t\t\tdatasets: datasets,\n\t\t\t\tlabels: labels\n\t\t\t};\n\t\t},\n\n\t\tbuildTicks: function() {\n\t\t\tvar me = this;\n\t\t\tvar min = me.min;\n\t\t\tvar max = me.max;\n\t\t\tvar options = me.options;\n\t\t\tvar timeOpts = options.time;\n\t\t\tvar timestamps = [];\n\t\t\tvar ticks = [];\n\t\t\tvar i, ilen, timestamp;\n\n\t\t\tswitch (options.ticks.source) {\n\t\t\tcase 'data':\n\t\t\t\ttimestamps = me._timestamps.data;\n\t\t\t\tbreak;\n\t\t\tcase 'labels':\n\t\t\t\ttimestamps = me._timestamps.labels;\n\t\t\t\tbreak;\n\t\t\tcase 'auto':\n\t\t\tdefault:\n\t\t\t\ttimestamps = generate(min, max, me.getLabelCapacity(min), options);\n\t\t\t}\n\n\t\t\tif (options.bounds === 'ticks' && timestamps.length) {\n\t\t\t\tmin = timestamps[0];\n\t\t\t\tmax = timestamps[timestamps.length - 1];\n\t\t\t}\n\n\t\t\t// Enforce limits with user min/max options\n\t\t\tmin = parse(timeOpts.min, me) || min;\n\t\t\tmax = parse(timeOpts.max, me) || max;\n\n\t\t\t// Remove ticks outside the min/max range\n\t\t\tfor (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n\t\t\t\ttimestamp = timestamps[i];\n\t\t\t\tif (timestamp >= min && timestamp <= max) {\n\t\t\t\t\tticks.push(timestamp);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tme.min = min;\n\t\t\tme.max = max;\n\n\t\t\t// PRIVATE\n\t\t\tme._unit = timeOpts.unit || determineUnitForFormatting(ticks, timeOpts.minUnit, me.min, me.max);\n\t\t\tme._majorUnit = determineMajorUnit(me._unit);\n\t\t\tme._table = buildLookupTable(me._timestamps.data, min, max, options.distribution);\n\t\t\tme._offsets = computeOffsets(me._table, ticks, min, max, options);\n\t\t\tme._labelFormat = determineLabelFormat(me._timestamps.data, timeOpts);\n\n\t\t\treturn ticksFromTimestamps(ticks, me._majorUnit);\n\t\t},\n\n\t\tgetLabelForIndex: function(index, datasetIndex) {\n\t\t\tvar me = this;\n\t\t\tvar data = me.chart.data;\n\t\t\tvar timeOpts = me.options.time;\n\t\t\tvar label = data.labels && index < data.labels.length ? data.labels[index] : '';\n\t\t\tvar value = data.datasets[datasetIndex].data[index];\n\n\t\t\tif (helpers.isObject(value)) {\n\t\t\t\tlabel = me.getRightValue(value);\n\t\t\t}\n\t\t\tif (timeOpts.tooltipFormat) {\n\t\t\t\treturn momentify(label, timeOpts).format(timeOpts.tooltipFormat);\n\t\t\t}\n\t\t\tif (typeof label === 'string') {\n\t\t\t\treturn label;\n\t\t\t}\n\n\t\t\treturn momentify(label, timeOpts).format(me._labelFormat);\n\t\t},\n\n\t\t/**\n\t\t * Function to format an individual tick mark\n\t\t * @private\n\t\t */\n\t\ttickFormatFunction: function(tick, index, ticks, formatOverride) {\n\t\t\tvar me = this;\n\t\t\tvar options = me.options;\n\t\t\tvar time = tick.valueOf();\n\t\t\tvar formats = options.time.displayFormats;\n\t\t\tvar minorFormat = formats[me._unit];\n\t\t\tvar majorUnit = me._majorUnit;\n\t\t\tvar majorFormat = formats[majorUnit];\n\t\t\tvar majorTime = tick.clone().startOf(majorUnit).valueOf();\n\t\t\tvar majorTickOpts = options.ticks.major;\n\t\t\tvar major = majorTickOpts.enabled && majorUnit && majorFormat && time === majorTime;\n\t\t\tvar label = tick.format(formatOverride ? formatOverride : major ? majorFormat : minorFormat);\n\t\t\tvar tickOpts = major ? majorTickOpts : options.ticks.minor;\n\t\t\tvar formatter = helpers.valueOrDefault(tickOpts.callback, tickOpts.userCallback);\n\n\t\t\treturn formatter ? formatter(label, index, ticks) : label;\n\t\t},\n\n\t\tconvertTicksToLabels: function(ticks) {\n\t\t\tvar labels = [];\n\t\t\tvar i, ilen;\n\n\t\t\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\n\t\t\t\tlabels.push(this.tickFormatFunction(moment(ticks[i].value), i, ticks));\n\t\t\t}\n\n\t\t\treturn labels;\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetPixelForOffset: function(time) {\n\t\t\tvar me = this;\n\t\t\tvar size = me._horizontal ? me.width : me.height;\n\t\t\tvar start = me._horizontal ? me.left : me.top;\n\t\t\tvar pos = interpolate(me._table, 'time', time, 'pos');\n\n\t\t\treturn start + size * (me._offsets.left + pos) / (me._offsets.left + 1 + me._offsets.right);\n\t\t},\n\n\t\tgetPixelForValue: function(value, index, datasetIndex) {\n\t\t\tvar me = this;\n\t\t\tvar time = null;\n\n\t\t\tif (index !== undefined && datasetIndex !== undefined) {\n\t\t\t\ttime = me._timestamps.datasets[datasetIndex][index];\n\t\t\t}\n\n\t\t\tif (time === null) {\n\t\t\t\ttime = parse(value, me);\n\t\t\t}\n\n\t\t\tif (time !== null) {\n\t\t\t\treturn me.getPixelForOffset(time);\n\t\t\t}\n\t\t},\n\n\t\tgetPixelForTick: function(index) {\n\t\t\tvar ticks = this.getTicks();\n\t\t\treturn index >= 0 && index < ticks.length ?\n\t\t\t\tthis.getPixelForOffset(ticks[index].value) :\n\t\t\t\tnull;\n\t\t},\n\n\t\tgetValueForPixel: function(pixel) {\n\t\t\tvar me = this;\n\t\t\tvar size = me._horizontal ? me.width : me.height;\n\t\t\tvar start = me._horizontal ? me.left : me.top;\n\t\t\tvar pos = (size ? (pixel - start) / size : 0) * (me._offsets.left + 1 + me._offsets.left) - me._offsets.right;\n\t\t\tvar time = interpolate(me._table, 'pos', pos, 'time');\n\n\t\t\treturn moment(time);\n\t\t},\n\n\t\t/**\n\t\t * Crude approximation of what the label width might be\n\t\t * @private\n\t\t */\n\t\tgetLabelWidth: function(label) {\n\t\t\tvar me = this;\n\t\t\tvar ticksOpts = me.options.ticks;\n\t\t\tvar tickLabelWidth = me.ctx.measureText(label).width;\n\t\t\tvar angle = helpers.toRadians(ticksOpts.maxRotation);\n\t\t\tvar cosRotation = Math.cos(angle);\n\t\t\tvar sinRotation = Math.sin(angle);\n\t\t\tvar tickFontSize = helpers.valueOrDefault(ticksOpts.fontSize, defaults.global.defaultFontSize);\n\n\t\t\treturn (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);\n\t\t},\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tgetLabelCapacity: function(exampleTime) {\n\t\t\tvar me = this;\n\n\t\t\tvar formatOverride = me.options.time.displayFormats.millisecond;\t// Pick the longest format for guestimation\n\n\t\t\tvar exampleLabel = me.tickFormatFunction(moment(exampleTime), 0, [], formatOverride);\n\t\t\tvar tickLabelWidth = me.getLabelWidth(exampleLabel);\n\t\t\tvar innerWidth = me.isHorizontal() ? me.width : me.height;\n\n\t\t\tvar capacity = Math.floor(innerWidth / tickLabelWidth);\n\t\t\treturn capacity > 0 ? capacity : 1;\n\t\t}\n\t});\n\n\tChart.scaleService.registerScaleType('time', TimeScale, defaultConfig);\n};\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/chart.js@2.7.2/node_modules/chart.js/src/scales/scale.time.js?");
  467. /***/ }),
  468. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css":
  469. /*!***********************************************************************************************!*\
  470. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css ***!
  471. \***********************************************************************************************/
  472. /*! no static exports found */
  473. /***/ (function(module, exports, __webpack_require__) {
  474. eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(/*! !../../../../../css-loader@0.28.11/node_modules/css-loader!./show-hint.css */ \"./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/index.js!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css\");\nif(typeof content === 'string') content = [[module.i, content, '']];\n// add the styles to the DOM\nvar update = __webpack_require__(/*! ../../../../../style-loader@0.13.1/node_modules/style-loader/addStyles.js */ \"./node_modules/.pnpm/style-loader@0.13.1/node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {}\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css?");
  475. /***/ }),
  476. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.js":
  477. /*!**********************************************************************************************!*\
  478. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.js ***!
  479. \**********************************************************************************************/
  480. /*! no static exports found */
  481. /***/ (function(module, exports, __webpack_require__) {
  482. eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (true) // CommonJS\n mod(__webpack_require__(/*! ../../lib/codemirror */ \"./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.js\"));\n else {}\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n if (data && this.data && isNewCompletion(this.data, data)) return;\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function isNewCompletion(old, nw) {\n var moved = CodeMirror.cmpPos(nw.from, old.from)\n return moved > 0 && old.to.ch - old.from.ch != nw.to.ch - nw.from.ch\n }\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n\n var hints = this.hints = document.createElement(\"ul\");\n hints.className = \"CodeMirror-hints\";\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(document.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);\n var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);\n (completion.options.container || document.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[0], hints.firstChild);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n var to = CodeMirror.Pos(cur.line, token.end);\n if (token.string && /\\w/.test(token.string[token.string.length - 1])) {\n var term = token.string, from = CodeMirror.Pos(cur.line, token.start);\n } else {\n var term = \"\", from = to;\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.js?");
  483. /***/ }),
  484. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css":
  485. /*!******************************************************************************************!*\
  486. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css ***!
  487. \******************************************************************************************/
  488. /*! no static exports found */
  489. /***/ (function(module, exports, __webpack_require__) {
  490. eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(/*! !../../../../../css-loader@0.28.11/node_modules/css-loader!./lint.css */ \"./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/index.js!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css\");\nif(typeof content === 'string') content = [[module.i, content, '']];\n// add the styles to the DOM\nvar update = __webpack_require__(/*! ../../../../../style-loader@0.13.1/node_modules/style-loader/addStyles.js */ \"./node_modules/.pnpm/style-loader@0.13.1/node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {}\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css?");
  491. /***/ }),
  492. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.js":
  493. /*!*****************************************************************************************!*\
  494. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.js ***!
  495. \*****************************************************************************************/
  496. /*! no static exports found */
  497. /***/ (function(module, exports, __webpack_require__) {
  498. eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (true) // CommonJS\n mod(__webpack_require__(/*! ../../lib/codemirror */ \"./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.js\"));\n else {}\n})(function(CodeMirror) {\n \"use strict\";\n var GUTTER_ID = \"CodeMirror-lint-markers\";\n\n function showTooltip(e, content) {\n var tt = document.createElement(\"div\");\n tt.className = \"CodeMirror-lint-tooltip\";\n tt.appendChild(content.cloneNode(true));\n document.body.appendChild(tt);\n\n function position(e) {\n if (!tt.parentNode) return CodeMirror.off(document, \"mousemove\", position);\n tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + \"px\";\n tt.style.left = (e.clientX + 5) + \"px\";\n }\n CodeMirror.on(document, \"mousemove\", position);\n position(e);\n if (tt.style.opacity != null) tt.style.opacity = 1;\n return tt;\n }\n function rm(elt) {\n if (elt.parentNode) elt.parentNode.removeChild(elt);\n }\n function hideTooltip(tt) {\n if (!tt.parentNode) return;\n if (tt.style.opacity == null) rm(tt);\n tt.style.opacity = 0;\n setTimeout(function() { rm(tt); }, 600);\n }\n\n function showTooltipFor(e, content, node) {\n var tooltip = showTooltip(e, content);\n function hide() {\n CodeMirror.off(node, \"mouseout\", hide);\n if (tooltip) { hideTooltip(tooltip); tooltip = null; }\n }\n var poll = setInterval(function() {\n if (tooltip) for (var n = node;; n = n.parentNode) {\n if (n && n.nodeType == 11) n = n.host;\n if (n == document.body) return;\n if (!n) { hide(); break; }\n }\n if (!tooltip) return clearInterval(poll);\n }, 400);\n CodeMirror.on(node, \"mouseout\", hide);\n }\n\n function LintState(cm, options, hasGutter) {\n this.marked = [];\n this.options = options;\n this.timeout = null;\n this.hasGutter = hasGutter;\n this.onMouseOver = function(e) { onMouseOver(cm, e); };\n this.waitingFor = 0\n }\n\n function parseOptions(_cm, options) {\n if (options instanceof Function) return {getAnnotations: options};\n if (!options || options === true) options = {};\n return options;\n }\n\n function clearMarks(cm) {\n var state = cm.state.lint;\n if (state.hasGutter) cm.clearGutter(GUTTER_ID);\n for (var i = 0; i < state.marked.length; ++i)\n state.marked[i].clear();\n state.marked.length = 0;\n }\n\n function makeMarker(labels, severity, multiple, tooltips) {\n var marker = document.createElement(\"div\"), inner = marker;\n marker.className = \"CodeMirror-lint-marker-\" + severity;\n if (multiple) {\n inner = marker.appendChild(document.createElement(\"div\"));\n inner.className = \"CodeMirror-lint-marker-multiple\";\n }\n\n if (tooltips != false) CodeMirror.on(inner, \"mouseover\", function(e) {\n showTooltipFor(e, labels, inner);\n });\n\n return marker;\n }\n\n function getMaxSeverity(a, b) {\n if (a == \"error\") return a;\n else return b;\n }\n\n function groupByLine(annotations) {\n var lines = [];\n for (var i = 0; i < annotations.length; ++i) {\n var ann = annotations[i], line = ann.from.line;\n (lines[line] || (lines[line] = [])).push(ann);\n }\n return lines;\n }\n\n function annotationTooltip(ann) {\n var severity = ann.severity;\n if (!severity) severity = \"error\";\n var tip = document.createElement(\"div\");\n tip.className = \"CodeMirror-lint-message-\" + severity;\n tip.appendChild(document.createTextNode(ann.message));\n return tip;\n }\n\n function lintAsync(cm, getAnnotations, passOptions) {\n var state = cm.state.lint\n var id = ++state.waitingFor\n function abort() {\n id = -1\n cm.off(\"change\", abort)\n }\n cm.on(\"change\", abort)\n getAnnotations(cm.getValue(), function(annotations, arg2) {\n cm.off(\"change\", abort)\n if (state.waitingFor != id) return\n if (arg2 && annotations instanceof CodeMirror) annotations = arg2\n updateLinting(cm, annotations)\n }, passOptions, cm);\n }\n\n function startLinting(cm) {\n var state = cm.state.lint, options = state.options;\n var passOptions = options.options || options; // Support deprecated passing of `options` property in options\n var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), \"lint\");\n if (!getAnnotations) return;\n if (options.async || getAnnotations.async) {\n lintAsync(cm, getAnnotations, passOptions)\n } else {\n updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));\n }\n }\n\n function updateLinting(cm, annotationsNotSorted) {\n clearMarks(cm);\n var state = cm.state.lint, options = state.options;\n\n var annotations = groupByLine(annotationsNotSorted);\n\n for (var line = 0; line < annotations.length; ++line) {\n var anns = annotations[line];\n if (!anns) continue;\n\n var maxSeverity = null;\n var tipLabel = state.hasGutter && document.createDocumentFragment();\n\n for (var i = 0; i < anns.length; ++i) {\n var ann = anns[i];\n var severity = ann.severity;\n if (!severity) severity = \"error\";\n maxSeverity = getMaxSeverity(maxSeverity, severity);\n\n if (options.formatAnnotation) ann = options.formatAnnotation(ann);\n if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));\n\n if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {\n className: \"CodeMirror-lint-mark-\" + severity,\n __annotation: ann\n }));\n }\n\n if (state.hasGutter)\n cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1,\n state.options.tooltips));\n }\n if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);\n }\n\n function onChange(cm) {\n var state = cm.state.lint;\n if (!state) return;\n clearTimeout(state.timeout);\n state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);\n }\n\n function popupTooltips(annotations, e) {\n var target = e.target || e.srcElement;\n var tooltip = document.createDocumentFragment();\n for (var i = 0; i < annotations.length; i++) {\n var ann = annotations[i];\n tooltip.appendChild(annotationTooltip(ann));\n }\n showTooltipFor(e, tooltip, target);\n }\n\n function onMouseOver(cm, e) {\n var target = e.target || e.srcElement;\n if (!/\\bCodeMirror-lint-mark-/.test(target.className)) return;\n var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;\n var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, \"client\"));\n\n var annotations = [];\n for (var i = 0; i < spans.length; ++i) {\n var ann = spans[i].__annotation;\n if (ann) annotations.push(ann);\n }\n if (annotations.length) popupTooltips(annotations, e);\n }\n\n CodeMirror.defineOption(\"lint\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n clearMarks(cm);\n if (cm.state.lint.options.lintOnChange !== false)\n cm.off(\"change\", onChange);\n CodeMirror.off(cm.getWrapperElement(), \"mouseover\", cm.state.lint.onMouseOver);\n clearTimeout(cm.state.lint.timeout);\n delete cm.state.lint;\n }\n\n if (val) {\n var gutters = cm.getOption(\"gutters\"), hasLintGutter = false;\n for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;\n var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);\n if (state.options.lintOnChange !== false)\n cm.on(\"change\", onChange);\n if (state.options.tooltips != false && state.options.tooltips != \"gutter\")\n CodeMirror.on(cm.getWrapperElement(), \"mouseover\", state.onMouseOver);\n\n startLinting(cm);\n }\n });\n\n CodeMirror.defineExtension(\"performLint\", function() {\n if (this.state.lint) startLinting(this);\n });\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.js?");
  499. /***/ }),
  500. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css":
  501. /*!*****************************************************************************************!*\
  502. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css ***!
  503. \*****************************************************************************************/
  504. /*! no static exports found */
  505. /***/ (function(module, exports, __webpack_require__) {
  506. eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(/*! !../../../../css-loader@0.28.11/node_modules/css-loader!./codemirror.css */ \"./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/index.js!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css\");\nif(typeof content === 'string') content = [[module.i, content, '']];\n// add the styles to the DOM\nvar update = __webpack_require__(/*! ../../../../style-loader@0.13.1/node_modules/style-loader/addStyles.js */ \"./node_modules/.pnpm/style-loader@0.13.1/node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {}\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css?");
  507. /***/ }),
  508. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.js":
  509. /*!****************************************************************************************!*\
  510. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.js ***!
  511. \****************************************************************************************/
  512. /*! no static exports found */
  513. /***/ (function(module, exports, __webpack_require__) {
  514. eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n// This is CodeMirror (http://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n}(this, (function () { 'use strict';\n\n// Kludges for bugs and behavior differences that can't be feature\n// detected are enabled based on userAgent etc sniffing.\nvar userAgent = navigator.userAgent\nvar platform = navigator.platform\n\nvar gecko = /gecko\\/\\d/i.test(userAgent)\nvar ie_upto10 = /MSIE \\d/.test(userAgent)\nvar ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent)\nvar ie = ie_upto10 || ie_11up\nvar ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1])\nvar webkit = /WebKit\\//.test(userAgent)\nvar qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent)\nvar chrome = /Chrome\\//.test(userAgent)\nvar presto = /Opera\\//.test(userAgent)\nvar safari = /Apple Computer/.test(navigator.vendor)\nvar mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent)\nvar phantom = /PhantomJS/.test(userAgent)\n\nvar ios = /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent)\n// This is woefully incomplete. Suggestions for alternative methods welcome.\nvar mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)\nvar mac = ios || /Mac/.test(platform)\nvar chromeOS = /\\bCrOS\\b/.test(userAgent)\nvar windows = /win/i.test(platform)\n\nvar presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/)\nif (presto_version) { presto_version = Number(presto_version[1]) }\nif (presto_version && presto_version >= 15) { presto = false; webkit = true }\n// Some browsers use the wrong event properties to signal cmd/ctrl on OS X\nvar flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))\nvar captureRightClick = gecko || (ie && ie_version >= 9)\n\nfunction classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\nvar rmClass = function(node, cls) {\n var current = node.className\n var match = classTest(cls).exec(current)\n if (match) {\n var after = current.slice(match.index + match[0].length)\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\")\n }\n}\n\nfunction removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild) }\n return e\n}\n\nfunction removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n}\n\nfunction elt(tag, content, className, style) {\n var e = document.createElement(tag)\n if (className) { e.className = className }\n if (style) { e.style.cssText = style }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)) }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }\n return e\n}\n\nvar range\nif (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange()\n r.setEnd(endNode || node, end)\n r.setStart(node, start)\n return r\n} }\nelse { range = function(node, start, end) {\n var r = document.body.createTextRange()\n try { r.moveToElementText(node.parentNode) }\n catch(e) { return r }\n r.collapse(true)\n r.moveEnd(\"character\", end)\n r.moveStart(\"character\", start)\n return r\n} }\n\nfunction contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n}\n\nfunction activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement\n try {\n activeElement = document.activeElement\n } catch(e) {\n activeElement = document.body || null\n }\n while (activeElement && activeElement.root && activeElement.root.activeElement)\n { activeElement = activeElement.root.activeElement }\n return activeElement\n}\n\nfunction addClass(node, cls) {\n var current = node.className\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls }\n}\nfunction joinClasses(a, b) {\n var as = a.split(\" \")\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i] } }\n return b\n}\n\nvar selectInput = function(node) { node.select() }\nif (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }\nelse if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select() } catch(_e) {} } }\n\nfunction bind(f) {\n var args = Array.prototype.slice.call(arguments, 1)\n return function(){return f.apply(null, args)}\n}\n\nfunction copyObj(obj, target, overwrite) {\n if (!target) { target = {} }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop] } }\n return target\n}\n\n// Counts the column offset in a string, taking tabs into account.\n// Used mostly to find indentation.\nfunction countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/)\n if (end == -1) { end = string.length }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i)\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i\n n += tabSize - (n % tabSize)\n i = nextTab + 1\n }\n}\n\nfunction Delayed() {this.id = null}\nDelayed.prototype.set = function(ms, f) {\n clearTimeout(this.id)\n this.id = setTimeout(f, ms)\n}\n\nfunction indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n}\n\n// Number of pixels added to scroller and sizer to hide scrollbar\nvar scrollerGap = 30\n\n// Returned or thrown by various protocols to signal 'I'm not\n// handling this'.\nvar Pass = {toString: function(){return \"CodeMirror.Pass\"}}\n\n// Reused option objects for setSelection & friends\nvar sel_dontScroll = {scroll: false};\nvar sel_mouse = {origin: \"*mouse\"};\nvar sel_move = {origin: \"+move\"};\n// The inverse of countColumn -- find the offset that corresponds to\n// a particular column.\nfunction findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos)\n if (nextTab == -1) { nextTab = string.length }\n var skipped = nextTab - pos\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos\n col += tabSize - (col % tabSize)\n pos = nextTab + 1\n if (col >= goal) { return pos }\n }\n}\n\nvar spaceStrs = [\"\"]\nfunction spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \") }\n return spaceStrs[n]\n}\n\nfunction lst(arr) { return arr[arr.length-1] }\n\nfunction map(array, f) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }\n return out\n}\n\nfunction insertSorted(array, value, score) {\n var pos = 0, priority = score(value)\n while (pos < array.length && score(array[pos]) <= priority) { pos++ }\n array.splice(pos, 0, value)\n}\n\nfunction nothing() {}\n\nfunction createObj(base, props) {\n var inst\n if (Object.create) {\n inst = Object.create(base)\n } else {\n nothing.prototype = base\n inst = new nothing()\n }\n if (props) { copyObj(props, inst) }\n return inst\n}\n\nvar nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/\nfunction isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n}\nfunction isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n}\n\nfunction isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n}\n\n// Extending unicode characters. A series of a non-extending char +\n// any number of extending chars is treated as a single unit as far\n// as editing and measuring is concerned. This is not fully correct,\n// since some scripts/fonts/browsers also treat other configurations\n// of code points as a group.\nvar extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/\nfunction isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n// The display handles the DOM integration, both for input reading\n// and content drawing. It holds references to DOM nodes and\n// display-related state.\n\nfunction Display(place, doc, input) {\n var d = this\n this.input = input\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\")\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\")\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\")\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\")\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\")\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\")\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\")\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\")\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\")\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\")\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\")\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\")\n d.sizerWidth = null\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\")\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\")\n d.lineGutter = null\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\")\n d.scroller.setAttribute(\"tabIndex\", \"-1\")\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\")\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper) }\n else { place(d.wrapper) }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first\n d.reportedViewFrom = d.reportedViewTo = doc.first\n // Information about the rendered lines.\n d.view = []\n d.renderedView = null\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null\n // Empty space (in pixels) above the view\n d.viewOffset = 0\n d.lastWrapHeight = d.lastWrapWidth = 0\n d.updateLineNumbers = null\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0\n d.scrollbarsClipped = false\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null\n d.maxLineLength = 0\n d.maxLineChanged = false\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null\n\n // True when shift is held down.\n d.shift = false\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null\n\n d.activeTouch = null\n\n input.init(d)\n}\n\n// Find the line object corresponding to the given line number.\nfunction getLine(doc, n) {\n n -= doc.first\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize()\n if (n < sz) { chunk = child; break }\n n -= sz\n }\n }\n return chunk.lines[n]\n}\n\n// Get the part of a document between two positions, as an array of\n// strings.\nfunction getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}\n// Get the lines between from and to, as array of strings.\nfunction getLines(doc, from, to) {\n var out = []\n doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value\n return out\n}\n\n// Update the height of a line, propagating the height change\n// upwards to parent nodes.\nfunction updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}\n\n// Given a line object, find its line number by walking up through\n// its parent links.\nfunction lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line)\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize()\n }\n }\n return no + cur.first\n}\n\n// Find the line at the given vertical position, using the height\n// information in the document tree.\nfunction lineAtHeight(chunk, h) {\n var n = chunk.first\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height\n if (h < ch) { chunk = child; continue outer }\n h -= ch\n n += child.chunkSize()\n }\n return n\n } while (!chunk.lines)\n var i = 0\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height\n if (h < lh) { break }\n h -= lh\n }\n return n + i\n}\n\nfunction isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\nfunction lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n}\n\n// A Pos instance represents a position within the text.\nfunction Pos (line, ch) {\n if (!(this instanceof Pos)) { return new Pos(line, ch) }\n this.line = line; this.ch = ch\n}\n\n// Compare two positions, return 0 if they are the same, a negative\n// number when a is less, and a positive number otherwise.\nfunction cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\nfunction copyPos(x) {return Pos(x.line, x.ch)}\nfunction maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\nfunction minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n// Most of the external API clips given positions to make sure they\n// actually exist within the document.\nfunction clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\nfunction clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n}\nfunction clipToLen(pos, linelen) {\n var ch = pos.ch\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n}\nfunction clipPosArray(doc, array) {\n var out = []\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }\n return out\n}\n\n// Optimize some code when these features are not used.\nvar sawReadOnlySpans = false;\nvar sawCollapsedSpans = false;\nfunction seeReadOnlySpans() {\n sawReadOnlySpans = true\n}\n\nfunction seeCollapsedSpans() {\n sawCollapsedSpans = true\n}\n\n// TEXTMARKER SPANS\n\nfunction MarkedSpan(marker, from, to) {\n this.marker = marker\n this.from = from; this.to = to\n}\n\n// Search an array of spans for a span matching the given marker.\nfunction getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.marker == marker) { return span }\n } }\n}\n// Remove a span from an array, returning undefined if no spans are\n// left (we don't store arrays for lines without spans).\nfunction removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}\n// Add a span to a line.\nfunction addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}\n\n// Used for the algorithm that adjusts markers for a change in the\n// document. These functions cut an array of spans at a given\n// character position, returning an array of remaining chunks (or\n// undefined if nothing remains).\nfunction markedSpansBefore(old, startCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))\n }\n } }\n return nw\n}\nfunction markedSpansAfter(old, endCh, isInsert) {\n var nw\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh))\n }\n } }\n return nw\n}\n\n// Given a change object, compute the new set of marker spans that\n// cover the line in which the change took place. Removes spans\n// entirely within the change, reconnects spans belonging to the\n// same marker that appear on both sides of the change, and cuts off\n// spans partially within the change. Returns an array of span\n// arrays with one element for each line in (after) the change.\nfunction stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert)\n var last = markedSpansAfter(oldLast, endCh, isInsert)\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i]\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker)\n if (!found) { span.to = startCh }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1]\n if (span$1.to != null) { span$1.to += offset }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker)\n if (!found$1) {\n span$1.from = offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n } else {\n span$1.from += offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first) }\n if (last && last != first) { last = clearEmptySpans(last) }\n\n var newMarkers = [first]\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers) }\n newMarkers.push(last)\n }\n return newMarkers\n}\n\n// Remove spans that are empty and don't have a clearWhenEmpty\n// option of false.\nfunction clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1) }\n }\n if (!spans.length) { return null }\n return spans\n}\n\n// Used to 'clip' out readOnly ranges when making a change.\nfunction removeReadOnlyRanges(doc, from, to) {\n var markers = null\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark) }\n } }\n })\n if (!markers) { return null }\n var parts = [{from: from, to: to}]\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0)\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j]\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}) }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}) }\n parts.splice.apply(parts, newParts)\n j += newParts.length - 1\n }\n }\n return parts\n}\n\n// Connect or disconnect spans from a line.\nfunction detachMarkedSpans(line) {\n var spans = line.markedSpans\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line) }\n line.markedSpans = null\n}\nfunction attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line) }\n line.markedSpans = spans\n}\n\n// Helpers used when computing which overlapping collapsed span\n// counts as the larger one.\nfunction extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\nfunction extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n// Returns a number indicating which of two overlapping collapsed\n// spans is larger (and thus includes the other). Falls back to\n// comparing ids when the spans cover exactly the same range.\nfunction compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}\n\n// Find out whether a line ends or starts in a collapsed span. If\n// so, return the marker for that span.\nfunction collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}\nfunction collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\nfunction collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n// Test whether there exists a collapsed span that partially\n// overlaps (covers the start or end, but not both) of a new span.\n// Such overlap is not allowed.\nfunction conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}\n\n// A visual line is a line as drawn on the screen. Folding, for\n// example, can cause multiple logical lines to appear on the same\n// visual line. This finds the start of the visual line that the\n// given line is part of (usually that is the line itself).\nfunction visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}\n\n// Returns an array of logical lines that continue the visual line\n// started by the argument, or undefined if there are no such lines.\nfunction visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}\n\n// Get the line number of the start of the visual line that the\n// given line number is part of.\nfunction visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}\n\n// Get the line number of the start of the next visual line after\n// the given line.\nfunction visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}\n\n// Compute whether a line is hidden. Lines count as hidden when they\n// are part of a visual line that starts with another line, or when\n// they are entirely covered by collapsed, non-widget span.\nfunction lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}\nfunction lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true)\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i]\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n}\n\n// Find the height above the given line.\nfunction heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}\n\n// Compute the character length of a line, taking into account\n// collapsed ranges (see markText) that might hide parts, and join\n// other lines onto it.\nfunction lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}\n\n// Find the longest line in the document.\nfunction findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}\n\n// BIDI HELPERS\n\nfunction iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\") }\n var found = false\n for (var i = 0; i < order.length; ++i) {\n var part = order[i]\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\")\n found = true\n }\n }\n if (!found) { f(from, to, \"ltr\") }\n}\n\nfunction bidiLeft(part) { return part.level % 2 ? part.to : part.from }\nfunction bidiRight(part) { return part.level % 2 ? part.from : part.to }\n\nfunction lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0 }\nfunction lineRight(line) {\n var order = getOrder(line)\n if (!order) { return line.text.length }\n return bidiRight(lst(order))\n}\n\nfunction compareBidiLevel(order, a, b) {\n var linedir = order[0].level\n if (a == linedir) { return true }\n if (b == linedir) { return false }\n return a < b\n}\n\nvar bidiOther = null\nfunction getBidiPartAt(order, pos) {\n var found\n bidiOther = null\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i]\n if (cur.from < pos && cur.to > pos) { return i }\n if ((cur.from == pos || cur.to == pos)) {\n if (found == null) {\n found = i\n } else if (compareBidiLevel(order, cur.level, order[found].level)) {\n if (cur.from != cur.to) { bidiOther = found }\n return i\n } else {\n if (cur.from != cur.to) { bidiOther = i }\n return found\n }\n }\n }\n return found\n}\n\nfunction moveInLine(line, pos, dir, byUnit) {\n if (!byUnit) { return pos + dir }\n do { pos += dir }\n while (pos > 0 && isExtendingChar(line.text.charAt(pos)))\n return pos\n}\n\n// This is needed in order to move 'visually' through bi-directional\n// text -- i.e., pressing left should make the cursor go left, even\n// when in RTL text. The tricky part is the 'jumps', where RTL and\n// LTR text touch each other. This often requires the cursor offset\n// to move more than one unit, in order to visually move one unit.\nfunction moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line)\n if (!bidi) { return moveLogically(line, start, dir, byUnit) }\n var pos = getBidiPartAt(bidi, start), part = bidi[pos]\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit)\n\n for (;;) {\n if (target > part.from && target < part.to) { return target }\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) { return target }\n part = bidi[pos += dir]\n return (dir > 0) == part.level % 2 ? part.to : part.from\n } else {\n part = bidi[pos += dir]\n if (!part) { return null }\n if ((dir > 0) == part.level % 2)\n { target = moveInLine(line, part.to, -1, byUnit) }\n else\n { target = moveInLine(line, part.from, 1, byUnit) }\n }\n }\n}\n\nfunction moveLogically(line, start, dir, byUnit) {\n var target = start + dir\n if (byUnit) { while (target > 0 && isExtendingChar(line.text.charAt(target))) { target += dir } }\n return target < 0 || target > line.text.length ? null : target\n}\n\n// Bidirectional ordering algorithm\n// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n// that this (partially) implements.\n\n// One-char codes used for character types:\n// L (L): Left-to-Right\n// R (R): Right-to-Left\n// r (AL): Right-to-Left Arabic\n// 1 (EN): European Number\n// + (ES): European Number Separator\n// % (ET): European Number Terminator\n// n (AN): Arabic Number\n// , (CS): Common Number Separator\n// m (NSM): Non-Spacing Mark\n// b (BN): Boundary Neutral\n// s (B): Paragraph Separator\n// t (S): Segment Separator\n// w (WS): Whitespace\n// N (ON): Other Neutrals\n\n// Returns null if characters are ordered as they appear\n// (left-to-right), or an array of sections ({from, to, level}\n// objects) in the order in which they occur visually.\nvar bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\"\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\"\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/\n // Browsers seem to always treat the boundaries of block elements as being L.\n var outerType = \"L\"\n\n function BidiSpan(level, from, to) {\n this.level = level\n this.from = from; this.to = to\n }\n\n return function(str) {\n if (!bidiRE.test(str)) { return false }\n var len = str.length, types = []\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))) }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1]\n if (type == \"m\") { types[i$1] = prev }\n else { prev = type }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2]\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\" }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\" } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3]\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\" }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1 }\n prev$1 = type$2\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4]\n if (type$3 == \",\") { types[i$4] = \"N\" }\n else if (type$3 == \"%\") {\n var end = (void 0)\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\"\n for (var j = i$4; j < end; ++j) { types[j] = replace }\n i$4 = end - 1\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5]\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\" }\n else if (isStrong.test(type$4)) { cur$1 = type$4 }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0)\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\"\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\"\n var replace$1 = before || after ? \"L\" : \"R\"\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }\n i$6 = end$1 - 1\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7))\n } else {\n var pos = i$7, at = order.length\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }\n var nstart = j$2\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2))\n pos = j$2\n } else { ++j$2 }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }\n }\n }\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length\n order.unshift(new BidiSpan(0, 0, m[0].length))\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length\n order.push(new BidiSpan(0, len - m[0].length, len))\n }\n if (order[0].level == 2)\n { order.unshift(new BidiSpan(1, order[0].to, order[0].to)) }\n if (order[0].level != lst(order).level)\n { order.push(new BidiSpan(order[0].level, len, len)) }\n\n return order\n }\n})()\n\n// Get the bidi ordering for the given line (and cache it). Returns\n// false for lines that are fully left-to-right, and an array of\n// BidiSpan objects otherwise.\nfunction getOrder(line) {\n var order = line.order\n if (order == null) { order = line.order = bidiOrdering(line.text) }\n return order\n}\n\n// EVENT HANDLING\n\n// Lightweight event framework. on/off also work on DOM nodes,\n// registering native DOM handlers.\n\nvar noHandlers = []\n\nvar on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false)\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f)\n } else {\n var map = emitter._handlers || (emitter._handlers = {})\n map[type] = (map[type] || noHandlers).concat(f)\n }\n}\n\nfunction getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n}\n\nfunction off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false)\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f)\n } else {\n var map = emitter._handlers, arr = map && map[type]\n if (arr) {\n var index = indexOf(arr, f)\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }\n }\n }\n}\n\nfunction signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type)\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2)\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }\n}\n\n// The DOM events that CodeMirror handles can be overridden by\n// registering a (non-DOM) handler on the editor for the event name,\n// and preventDefault-ing the event in that handler.\nfunction signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }\n signal(cm, override || e.type, cm, e)\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}\n\nfunction signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]) } }\n}\n\nfunction hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n}\n\n// Add on and off methods to a constructor's prototype, to make\n// registering events on such objects more convenient.\nfunction eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f)}\n ctor.prototype.off = function(type, f) {off(this, type, f)}\n}\n\n// Due to the fact that we still support jurassic IE versions, some\n// compatibility wrappers are needed.\n\nfunction e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault() }\n else { e.returnValue = false }\n}\nfunction e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation() }\n else { e.cancelBubble = true }\n}\nfunction e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n}\nfunction e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}\n\nfunction e_target(e) {return e.target || e.srcElement}\nfunction e_button(e) {\n var b = e.which\n if (b == null) {\n if (e.button & 1) { b = 1 }\n else if (e.button & 2) { b = 3 }\n else if (e.button & 4) { b = 2 }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3 }\n return b\n}\n\n// Detect drag-and-drop\nvar dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div')\n return \"draggable\" in div || \"dragDrop\" in div\n}()\n\nvar zwspSupported\nfunction zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\")\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]))\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\")\n node.setAttribute(\"cm-text\", \"\")\n return node\n}\n\n// Feature-detect IE's crummy client rect reporting for bidi text\nvar badBidiRects\nfunction hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"))\n var r0 = range(txt, 0, 1).getBoundingClientRect()\n var r1 = range(txt, 1, 2).getBoundingClientRect()\n removeChildren(measure)\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n}\n\n// See if \"\".split is the broken IE version, if so, provide an\n// alternative way to split lines.\nvar splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos)\n if (nl == -1) { nl = string.length }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl)\n var rt = line.indexOf(\"\\r\")\n if (rt != -1) {\n result.push(line.slice(0, rt))\n pos += rt + 1\n } else {\n result.push(line)\n pos = nl + 1\n }\n }\n return result\n} : function (string) { return string.split(/\\r\\n?|\\n/); }\n\nvar hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n} : function (te) {\n var range\n try {range = te.ownerDocument.selection.createRange()}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n}\n\nvar hasCopyEvent = (function () {\n var e = elt(\"div\")\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\")\n return typeof e.oncopy == \"function\"\n})()\n\nvar badZoomedRects = null\nfunction hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"))\n var normal = node.getBoundingClientRect()\n var fromRange = range(node, 0, 1).getBoundingClientRect()\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n}\n\nvar modes = {};\nvar mimeModes = {};\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nfunction defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}\n\nfunction defineMIME(mime, spec) {\n mimeModes[mime] = spec\n}\n\n// Given a MIME type, a {name, ...options} config object, or a name\n// string, return a mode config object.\nfunction resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec]\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name]\n if (typeof found == \"string\") { found = {name: found} }\n spec = createObj(found, spec)\n spec.name = found.name\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n}\n\n// Given a mode spec (anything that resolveMode accepts), find and\n// initialize an actual mode object.\nfunction getMode(options, spec) {\n spec = resolveMode(spec)\n var mfactory = modes[spec.name]\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec)\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name]\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop] }\n modeObj[prop] = exts[prop]\n }\n }\n modeObj.name = spec.name\n if (spec.helperType) { modeObj.helperType = spec.helperType }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1] } }\n\n return modeObj\n}\n\n// This can be used to attach properties to mode objects from\n// outside the actual mode definition.\nvar modeExtensions = {}\nfunction extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})\n copyObj(properties, exts)\n}\n\nfunction copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {}\n for (var n in state) {\n var val = state[n]\n if (val instanceof Array) { val = val.concat([]) }\n nstate[n] = val\n }\n return nstate\n}\n\n// Given a mode and a state (for that mode), find the inner mode and\n// state at the position that the state refers to.\nfunction innerMode(mode, state) {\n var info\n while (mode.innerMode) {\n info = mode.innerMode(state)\n if (!info || info.mode == mode) { break }\n state = info.state\n mode = info.mode\n }\n return info || {mode: mode, state: state}\n}\n\nfunction startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n}\n\n// STRING STREAM\n\n// Fed to the mode parsers, provides helper functions to make\n// parsers more succinct.\n\nvar StringStream = function(string, tabSize) {\n this.pos = this.start = 0\n this.string = string\n this.tabSize = tabSize || 8\n this.lastColumnPos = this.lastColumnValue = 0\n this.lineStart = 0\n}\n\nStringStream.prototype = {\n eol: function() {return this.pos >= this.string.length},\n sol: function() {return this.pos == this.lineStart},\n peek: function() {return this.string.charAt(this.pos) || undefined},\n next: function() {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n },\n eat: function(match) {\n var ch = this.string.charAt(this.pos)\n var ok\n if (typeof match == \"string\") { ok = ch == match }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)) }\n if (ok) {++this.pos; return ch}\n },\n eatWhile: function(match) {\n var start = this.pos\n while (this.eat(match)){}\n return this.pos > start\n },\n eatSpace: function() {\n var this$1 = this;\n\n var start = this.pos\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }\n return this.pos > start\n },\n skipToEnd: function() {this.pos = this.string.length},\n skipTo: function(ch) {\n var found = this.string.indexOf(ch, this.pos)\n if (found > -1) {this.pos = found; return true}\n },\n backUp: function(n) {this.pos -= n},\n column: function() {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)\n this.lastColumnPos = this.start\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n },\n indentation: function() {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n },\n match: function(pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }\n var substr = this.string.substr(this.pos, pattern.length)\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern)\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length }\n return match\n }\n },\n current: function(){return this.string.slice(this.start, this.pos)},\n hideFirstChars: function(n, inner) {\n this.lineStart += n\n try { return inner() }\n finally { this.lineStart -= n }\n }\n}\n\n// Compute a style array (an array starting with a mode generation\n// -- for invalidation -- followed by pairs of end positions and\n// style strings), which is used to highlight the tokens on the\n// line.\nfunction highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}\n\nfunction getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var state = getStateBefore(cm, lineNo(line))\n var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state)\n line.stateAfter = state\n line.styles = result.styles\n if (result.classes) { line.styleClasses = result.classes }\n else if (line.styleClasses) { line.styleClasses = null }\n if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ }\n }\n return line.styles\n}\n\nfunction getStateBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display\n if (!doc.mode.startState) { return true }\n var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter\n if (!state) { state = startState(doc.mode) }\n else { state = copyState(doc.mode, state) }\n doc.iter(pos, n, function (line) {\n processLine(cm, line.text, state)\n var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo\n line.stateAfter = save ? copyState(doc.mode, state) : null\n ++pos\n })\n if (precise) { doc.frontier = pos }\n return state\n}\n\n// Lightweight form of highlight -- proceed over this line and\n// update state, but don't save a style array. Used for lines that\n// aren't currently visible.\nfunction processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode\n var stream = new StringStream(text, cm.options.tabSize)\n stream.start = stream.pos = startAt || 0\n if (text == \"\") { callBlankLine(mode, state) }\n while (!stream.eol()) {\n readToken(mode, stream, state)\n stream.start = stream.pos\n }\n}\n\nfunction callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state)\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n}\n\nfunction readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode }\n var style = mode.token(stream, state)\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n}\n\n// Utility for getTokenAt and getLineTokens\nfunction takeToken(cm, pos, precise, asArray) {\n var getObj = function (copy) { return ({\n start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state\n }); }\n\n var doc = cm.doc, mode = doc.mode, style\n pos = clipPos(doc, pos)\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)\n var stream = new StringStream(line.text, cm.options.tabSize), tokens\n if (asArray) { tokens = [] }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos\n style = readToken(mode, stream, state)\n if (asArray) { tokens.push(getObj(true)) }\n }\n return asArray ? tokens : getObj()\n}\n\nfunction extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/)\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\"\n if (output[prop] == null)\n { output[prop] = lineClass[2] }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2] }\n } }\n return type\n}\n\n// Run the given mode's parser over a line, calling f for each token.\nfunction runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }\n var curStart = 0, curStyle = null\n var stream = new StringStream(text, cm.options.tabSize), style\n var inner = cm.options.addModeClass && [null]\n if (text == \"\") { extractLineClasses(callBlankLine(mode, state), lineClasses) }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false\n if (forceToEnd) { processLine(cm, text, state, stream.pos) }\n stream.pos = text.length\n style = null\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)\n }\n if (inner) {\n var mName = inner[0].name\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName) }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000)\n f(curStart, curStyle)\n }\n curStyle = style\n }\n stream.start = stream.pos\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000)\n f(pos, curStyle)\n curStart = pos\n }\n}\n\n// Finds the line to start with when starting a parse. Tries to\n// find a line with a stateAfter, so that it can start with a\n// valid state. If that fails, it returns the line with the\n// smallest indentation, which tends to need the least context to\n// parse correctly.\nfunction findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1)\n if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}\n\n// LINE DATA STRUCTURE\n\n// Line objects. These hold state related to a line, including\n// highlighting info (the styles array).\nfunction Line(text, markedSpans, estimateHeight) {\n this.text = text\n attachMarkedSpans(this, markedSpans)\n this.height = estimateHeight ? estimateHeight(this) : 1\n}\neventMixin(Line)\nLine.prototype.lineNo = function() { return lineNo(this) }\n\n// Change the content (text, markers) of a line. Automatically\n// invalidates cached information and tries to re-estimate the\n// line's height.\nfunction updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n if (line.order != null) { line.order = null }\n detachMarkedSpans(line)\n attachMarkedSpans(line, markedSpans)\n var estHeight = estimateHeight ? estimateHeight(line) : 1\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n}\n\n// Detach a line from the document tree and its markers.\nfunction cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}\n\n// Convert a style as returned by a mode (either null, or a string\n// containing one or more styles) to a CSS style. This is cached,\n// and also looks for line-wide styles.\nvar styleToClassCache = {};\nvar styleToClassCacheWithMode = {};\nfunction interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n}\n\n// Render the DOM representation of the text of a line. Also builds\n// up a 'line map', which points at the DOM nodes that represent\n// specific stretches of text, and is used by the measuring code.\n// The returned object contains the DOM node, this map, and\n// information about line-wide styles that were set by the mode.\nfunction buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}\n\nfunction defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\")\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16)\n token.setAttribute(\"aria-label\", token.title)\n return token\n}\n\n// Build up the DOM representation for a single token, and add it to\n// the line map. Takes care to render special characters separately.\nfunction buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false\n var content\n if (!special.test(text)) {\n builder.col += text.length\n content = document.createTextNode(displayText)\n builder.map.push(builder.pos, builder.pos + text.length, content)\n if (ie && ie_version < 9) { mustWrap = true }\n builder.pos += text.length\n } else {\n content = document.createDocumentFragment()\n var pos = 0\n while (true) {\n special.lastIndex = pos\n var m = special.exec(text)\n var skipped = m ? m.index - pos : text.length - pos\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped))\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])) }\n else { content.appendChild(txt) }\n builder.map.push(builder.pos, builder.pos + skipped, txt)\n builder.col += skipped\n builder.pos += skipped\n }\n if (!m) { break }\n pos += skipped + 1\n var txt$1 = (void 0)\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"))\n txt$1.setAttribute(\"role\", \"presentation\")\n txt$1.setAttribute(\"cm-text\", \"\\t\")\n builder.col += tabWidth\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"))\n txt$1.setAttribute(\"cm-text\", m[0])\n builder.col += 1\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0])\n txt$1.setAttribute(\"cm-text\", m[0])\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])) }\n else { content.appendChild(txt$1) }\n builder.col += 1\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1)\n builder.pos++\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\"\n if (startStyle) { fullStyle += startStyle }\n if (endStyle) { fullStyle += endStyle }\n var token = elt(\"span\", [content], fullStyle, css)\n if (title) { token.title = title }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content)\n}\n\nfunction splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\"\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i)\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\" }\n result += ch\n spaceBefore = ch == \" \"\n }\n return result\n}\n\n// Work around nonsense dimensions being reported for stretches of\n// right-to-left text.\nfunction buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, title, css) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\"\n var start = builder.pos, end = start + text.length\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0)\n for (var i = 0; i < order.length; i++) {\n part = order[i]\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)\n startStyle = null\n text = text.slice(part.to - start)\n start = part.to\n }\n }\n}\n\nfunction buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")) }\n widget.setAttribute(\"cm-marker\", marker.id)\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget)\n builder.content.appendChild(widget)\n }\n builder.pos += size\n builder.trailingSpace = false\n}\n\n// Outputs a number of spans to make up a line, taking highlighting\n// and marked text into account.\nfunction insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}\n\n\n// These objects are used to represent the visible (currently drawn)\n// part of the document. A LineView may correspond to multiple\n// logical lines, if those are connected by collapsed ranges.\nfunction LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}\n\n// Create a range of LineView objects for the given lines.\nfunction buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n}\n\nvar operationGroup = null\n\nfunction pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op)\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n }\n }\n}\n\nfunction fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null) }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j]\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }\n }\n } while (i < callbacks.length)\n}\n\nfunction finishOperation(op, endCb) {\n var group = op.ownsGroup\n if (!group) { return }\n\n try { fireCallbacksForOps(group) }\n finally {\n operationGroup = null\n endCb(group)\n }\n}\n\nvar orphanDelayedCallbacks = null\n\n// Often, we want to signal events at a point where we are in the\n// middle of some work, but don't want the handler to start calling\n// other methods on the editor, which might be in an inconsistent\n// state or simply not expect any other events to happen.\n// signalLater looks whether there are any handlers, and schedules\n// them to be executed when the last operation ends, or, if no\n// operation is active, when a timeout fires.\nfunction signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type)\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list\n if (operationGroup) {\n list = operationGroup.delayedCallbacks\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks\n } else {\n list = orphanDelayedCallbacks = []\n setTimeout(fireOrphanDelayed, 0)\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); })\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}\n\nfunction fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks\n orphanDelayedCallbacks = null\n for (var i = 0; i < delayed.length; ++i) { delayed[i]() }\n}\n\n// When an aspect of a line changes, a string is added to\n// lineView.changes. This updates the relevant part of the line's\n// DOM structure.\nfunction updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}\n\n// Lines with gutter elements, widgets or a background class need to\n// be wrapped, and have the extra elements added to the wrapper div\nfunction ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\")\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }\n lineView.node.appendChild(lineView.text)\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }\n }\n return lineView.node\n}\n\nfunction updateLineBackground(lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass\n if (cls) { cls += \" CodeMirror-linebackground\" }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView)\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild)\n }\n}\n\n// Wrapper around buildLineContent which will reuse the structure\n// in display.externalMeasured when possible.\nfunction getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}\n\n// Redraw the line's text. Interacts with the background and text\n// classes because the mode may output tokens that influence these\n// classes.\nfunction updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}\n\nfunction updateLineClasses(lineView) {\n updateLineBackground(lineView)\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\" }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass\n lineView.text.className = textClass || \"\"\n}\n\nfunction updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter)\n lineView.gutter = null\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground)\n lineView.gutterBackground = null\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView)\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"))\n wrap.insertBefore(lineView.gutterBackground, lineView.text)\n }\n var markers = lineView.line.gutterMarkers\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView)\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"))\n cm.display.input.setUneditable(gutterWrap)\n wrap$1.insertBefore(gutterWrap, lineView.text)\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))) }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))) }\n } }\n }\n}\n\nfunction updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node) }\n }\n insertLineWidgets(cm, lineView, dims)\n}\n\n// Build a line's DOM representation from scratch\nfunction buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}\n\n// A lineView may contain multiple logical lines (when merged by\n// collapsed spans). The widgets for all of them need to be drawn.\nfunction insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }\n}\n\nfunction insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView)\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\")\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\") }\n positionLineWidget(widget, node, lineView, dims)\n cm.display.input.setUneditable(node)\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text) }\n else\n { wrap.appendChild(node) }\n signalLater(widget, \"redraw\")\n }\n}\n\nfunction positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n ;(lineView.alignable || (lineView.alignable = [])).push(node)\n var width = dims.wrapperWidth\n node.style.left = dims.fixedPos + \"px\"\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\"\n }\n node.style.width = width + \"px\"\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5\n node.style.position = \"relative\"\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\" }\n }\n}\n\nfunction widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\"\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\" }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\" }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle))\n }\n return widget.height = widget.node.parentNode.offsetHeight\n}\n\n// Return true when the given mouse event happened in a widget\nfunction eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}\n\n// POSITION MEASUREMENT\n\nfunction paddingTop(display) {return display.lineSpace.offsetTop}\nfunction paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\nfunction paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"))\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }\n return data\n}\n\nfunction scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\nfunction displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n}\nfunction displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n}\n\n// Ensure the lineView.wrapping.heights array is populated. This is\n// an array of bottom offsets for the lines that make up a drawn\n// line. When lineWrapping is on, there might be more than one\n// height.\nfunction ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}\n\n// Find a line map (mapping character offsets to text nodes) and a\n// measurement cache for the given line number. (A line view might\n// contain multiple lines when collapsed ranges are present.)\nfunction mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}\n\n// Render a line into the hidden node display.externalMeasured. Used\n// when measurement is needed for a line that's not in the viewport.\nfunction updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}\n\n// Get a {top, bottom, left, right} box (in line-local coordinates)\n// for a given character.\nfunction measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n}\n\n// Find a line view that corresponds to the given line number.\nfunction findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}\n\n// Measurement can be split in two steps, the set-up work that\n// applies to the whole line, and the measurement of the actual\n// character. Functions like coordsChar, that need to do a lot of\n// measurements in a row, can thus ensure that the set-up work is\n// only done once.\nfunction prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}\n\n// Given a prepared measurement object, measures the position of an\n// actual character (or fetches it from the cache).\nfunction measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1 }\n var key = ch + (bias || \"\"), found\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key]\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect() }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect)\n prepared.hasHeights = true\n }\n found = measureCharInner(cm, prepared, ch, bias)\n if (!found.bogus) { prepared.cache[key] = found }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}\n\nvar nullRect = {left: 0, right: 0, top: 0, bottom: 0}\n\nfunction nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i]\n mEnd = map[i + 1]\n if (ch < mStart) {\n start = 0; end = 1\n collapse = \"left\"\n } else if (ch < mEnd) {\n start = ch - mStart\n end = start + 1\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart\n start = end - 1\n if (ch >= mEnd) { collapse = \"right\" }\n }\n if (start != null) {\n node = map[i + 2]\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2]\n collapse = \"left\"\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2]\n collapse = \"right\"\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n}\n\nfunction getUsefulRect(rects, bias) {\n var rect = nullRect\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n}\n\nfunction measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse\n\n var rect\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect() }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }\n if (rect.left || rect.right || start == 0) { break }\n end = start\n start = start - 1\n collapse = \"right\"\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\" }\n var rects\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0] }\n else\n { rect = node.getBoundingClientRect() }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0]\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }\n else\n { rect = nullRect }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top\n var mid = (rtop + rbot) / 2\n var heights = prepared.view.measure.heights\n var i = 0\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i]\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot}\n if (!rect.left && !rect.right) { result.bogus = true }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }\n\n return result\n}\n\n// Work around problem with bounding client rects on ranges being\n// returned incorrectly when zoomed on IE10 and below.\nfunction maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI\n var scaleY = screen.logicalYDPI / screen.deviceYDPI\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n}\n\nfunction clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {}\n lineView.measure.heights = null\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {} } }\n }\n}\n\nfunction clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null\n removeChildren(cm.display.lineMeasure)\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]) }\n}\n\nfunction clearCaches(cm) {\n clearLineMeasurementCache(cm)\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }\n cm.display.lineNumChars = null\n}\n\nfunction pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft }\nfunction pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop }\n\n// Converts a {top, bottom, left, right} box from line-local\n// coordinates into another coordinate system. Context may be one of\n// \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n// or \"page\".\nfunction intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i])\n rect.top += size; rect.bottom += size\n } } }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\" }\n var yOff = heightAtLine(lineObj)\n if (context == \"local\") { yOff += paddingTop(cm.display) }\n else { yOff -= cm.display.viewOffset }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect()\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY())\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX())\n rect.left += xOff; rect.right += xOff\n }\n rect.top += yOff; rect.bottom += yOff\n return rect\n}\n\n// Coverts a box from \"div\" coords to another coordinate system.\n// Context may be \"window\", \"page\", \"div\", or \"local\"./null.\nfunction fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX()\n top -= pageScrollY()\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect()\n left += localBox.left\n top += localBox.top\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}\n\nfunction charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n}\n\n// Returns a box for a given cursor position, which may have an\n// 'other' property containing the position of the secondary cursor\n// on a bidi boundary.\nfunction cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos]\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1)\n right = true\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos]\n ch = bidiLeft(part) - part.level % 2\n right = false\n }\n if (right && ch == part.to && ch > part.from) { return get(ch - 1) }\n return get(ch, right)\n }\n var order = getOrder(lineObj), ch = pos.ch\n if (!order) { return get(ch) }\n var partPos = getBidiPartAt(order, ch)\n var val = getBidi(ch, partPos)\n if (bidiOther != null) { val.other = getBidi(ch, bidiOther) }\n return val\n}\n\n// Used to cheaply estimate the coordinates for a position. Used for\n// intermediate scroll updates.\nfunction estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}\n\n// Positions returned by coordsChar contain some extra information.\n// xRel is the relative x position of the input coordinates compared\n// to the found position (so xRel > 0 means the coordinates are to\n// the right of the character position, for example). When outside\n// is true, that means the coordinates lie outside the line's\n// vertical range.\nfunction PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch)\n pos.xRel = xRel\n if (outside) { pos.outside = true }\n return pos\n}\n\n// Compute the character position closest to the given coordinates.\n// Input must be lineSpace-local (\"div\" coordinate system).\nfunction coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}\n\nfunction coordsCharInner(cm, lineObj, lineNo, x, y) {\n var innerOff = y - heightAtLine(lineObj)\n var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth\n var preparedMeasure = prepareMeasureForLine(cm, lineObj)\n\n function getX(ch) {\n var sp = cursorCoords(cm, Pos(lineNo, ch), \"line\", lineObj, preparedMeasure)\n wrongLine = true\n if (innerOff > sp.bottom) { return sp.left - adjust }\n else if (innerOff < sp.top) { return sp.left + adjust }\n else { wrongLine = false }\n return sp.left\n }\n\n var bidi = getOrder(lineObj), dist = lineObj.text.length\n var from = lineLeft(lineObj), to = lineRight(lineObj)\n var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine\n\n if (x > toX) { return PosWithInfo(lineNo, to, toOutside, 1) }\n // Do a binary search between these bounds.\n for (;;) {\n if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {\n var ch = x < fromX || x - fromX <= toX - x ? from : to\n var outside = ch == from ? fromOutside : toOutside\n var xDiff = x - (ch == from ? fromX : toX)\n // This is a kludge to handle the case where the coordinates\n // are after a line-wrapped line. We should replace it with a\n // more general handling of cursor positions around line\n // breaks. (Issue #4078)\n if (toOutside && !bidi && !/\\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 &&\n ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) {\n var charSize = measureCharPrepared(cm, preparedMeasure, ch, \"right\")\n if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) {\n outside = false\n ch++\n xDiff = x - charSize.right\n }\n }\n while (isExtendingChar(lineObj.text.charAt(ch))) { ++ch }\n var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0)\n return pos\n }\n var step = Math.ceil(dist / 2), middle = from + step\n if (bidi) {\n middle = from\n for (var i = 0; i < step; ++i) { middle = moveVisually(lineObj, middle, 1) }\n }\n var middleX = getX(middle)\n if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) { toX += 1000; } dist = step}\n else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step}\n }\n}\n\nvar measureText\n// Compute the default text height.\nfunction textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\")\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"))\n measureText.appendChild(elt(\"br\"))\n }\n measureText.appendChild(document.createTextNode(\"x\"))\n }\n removeChildrenAndAdd(display.measure, measureText)\n var height = measureText.offsetHeight / 50\n if (height > 3) { display.cachedTextHeight = height }\n removeChildren(display.measure)\n return height || 1\n}\n\n// Compute the default character width.\nfunction charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}\n\n// Do a bulk-read of the DOM positions and sizes needed to draw the\n// view, so that we don't interleave reading and writing to the DOM.\nfunction getDimensions(cm) {\n var d = cm.display, left = {}, width = {}\n var gutterLeft = d.gutters.clientLeft\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft\n width[cm.options.gutters[i]] = n.clientWidth\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}\n\n// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n// but using getBoundingClientRect to get a sub-pixel-accurate\n// result.\nfunction compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}\n\n// Returns a function that estimates the height of a line, to use as\n// first approximation until the line becomes visible (and is thus\n// properly measurable).\nfunction estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}\n\nfunction estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm)\n doc.iter(function (line) {\n var estHeight = est(line)\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n })\n}\n\n// Given a mouse event, find the corresponding position. If liberal\n// is false, it checks whether a gutter or scrollbar was clicked,\n// and returns null if it was. forRect is used by rectangular\n// selections, and tries to estimate a character position even for\n// coordinates beyond the right of the text.\nfunction posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect()\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))\n }\n return coords\n}\n\n// Find the view element corresponding to a given line. Return null\n// when the line isn't visible.\nfunction findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom\n if (n < 0) { return null }\n var view = cm.display.view\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size\n if (n < 0) { return i }\n }\n}\n\nfunction updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection())\n}\n\nfunction prepareSelection(cm, primary) {\n var doc = cm.doc, result = {}\n var curFragment = result.cursors = document.createDocumentFragment()\n var selFragment = result.selection = document.createDocumentFragment()\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (primary === false && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i]\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty()\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range.head, curFragment) }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment) }\n }\n return result\n}\n\n// Draws a cursor for the given range\nfunction drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}\n\n// Draws the given range as a highlighted selection\nfunction drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}\n\n// Cursor-blinking\nfunction restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display\n clearInterval(display.blinker)\n var on = true\n display.cursorDiv.style.visibility = \"\"\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate) }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\" }\n}\n\nfunction ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }\n}\n\nfunction delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false\n onBlur(cm)\n } }, 100)\n}\n\nfunction onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e)\n cm.state.focused = true\n addClass(cm.display.wrapper, \"CodeMirror-focused\")\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset()\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730\n }\n cm.display.input.receivedFocus()\n }\n restartBlink(cm)\n}\nfunction onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e)\n cm.state.focused = false\n rmClass(cm.display.wrapper, \"CodeMirror-focused\")\n }\n clearInterval(cm.display.blinker)\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)\n}\n\n// Re-align line numbers and gutter marks to compensate for\n// horizontal scrolling.\nfunction alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}\n\n// Used to ensure that the line number gutter is still the right\n// size for the current document size. Returns true when an update\n// is needed.\nfunction maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}\n\n// Read the actual heights of the rendered lines, and update their\n// stored heights to match.\nfunction updateHeightsInViewport(cm) {\n var display = cm.display\n var prevBottom = display.lineDiv.offsetTop\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0)\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight\n height = bot - prevBottom\n prevBottom = bot\n } else {\n var box = cur.node.getBoundingClientRect()\n height = box.bottom - box.top\n }\n var diff = cur.line.height - height\n if (height < 2) { height = textHeight(display) }\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height)\n updateWidgetHeight(cur.line)\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]) } }\n }\n }\n}\n\n// Read and store the height of line widgets associated with the\n// given line.\nfunction updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}\n\n// Compute the lines that are visible in a given viewport (defaults\n// the the current scroll position). viewport may contain top,\n// height, and ensure (see op.scrollToPos) properties.\nfunction visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}\n\n// Sync the scrollable area and scrollbars, ensure the viewport\n// covers the visible area.\nfunction setScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n cm.doc.scrollTop = val\n if (!gecko) { updateDisplaySimple(cm, {top: val}) }\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }\n cm.display.scrollbars.setScrollTop(val)\n if (gecko) { updateDisplaySimple(cm) }\n startWorker(cm, 100)\n}\n// Sync scroller and scrollbar, ensure the gutter elements are\n// aligned.\nfunction setScrollLeft(cm, val, isScroller) {\n if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return }\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)\n cm.doc.scrollLeft = val\n alignHorizontally(cm)\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }\n cm.display.scrollbars.setScrollLeft(val)\n}\n\n// Since the delta values reported on mouse wheel events are\n// unstandardized between browsers and even browser versions, and\n// generally horribly unpredictable, this code starts by measuring\n// the scroll effect that the first few mouse wheel events have,\n// and, from that, detects the way it can convert deltas to pixel\n// offsets afterwards.\n//\n// The reason we want to know the amount a wheel event will scroll\n// is that it gives us a chance to update the display before the\n// actual scrolling happens, reducing flickering.\n\nvar wheelSamples = 0;\nvar wheelPixelsPerUnit = null;\n// Fill in a browser-detected starting value on browsers where we\n// know one. These don't have to be accurate -- the result of them\n// being wrong would just be a slight flicker on the first wheel\n// scroll (if it is large enough).\nif (ie) { wheelPixelsPerUnit = -.53 }\nelse if (gecko) { wheelPixelsPerUnit = 15 }\nelse if (chrome) { wheelPixelsPerUnit = -.7 }\nelse if (safari) { wheelPixelsPerUnit = -1/3 }\n\nfunction wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }\n else if (dy == null) { dy = e.wheelDelta }\n return {x: dx, y: dy}\n}\nfunction wheelEventPixels(e) {\n var delta = wheelEventDelta(e)\n delta.x *= wheelPixelsPerUnit\n delta.y *= wheelPixelsPerUnit\n return delta\n}\n\nfunction onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y\n\n var display = cm.display, scroll = display.scroller\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth\n var canScrollY = scroll.scrollHeight > scroll.clientHeight\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))) }\n setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)))\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e) }\n display.wheelStartX = null // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight\n if (pixels < 0) { top = Math.max(0, top + pixels - 50) }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50) }\n updateDisplaySimple(cm, {top: top, bottom: bot})\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop\n display.wheelDX = dx; display.wheelDY = dy\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX\n var movedY = scroll.scrollTop - display.wheelStartY\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX)\n display.wheelStartX = display.wheelStartY = null\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)\n ++wheelSamples\n }, 200)\n } else {\n display.wheelDX += dx; display.wheelDY += dy\n }\n }\n}\n\n// SCROLLBARS\n\n// Prepare DOM reads needed to update the scrollbars. Done in one\n// shot to minimize update/measure roundtrips.\nfunction measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth\n var docH = Math.round(cm.doc.height + paddingVert(cm.display))\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n}\n\nvar NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\")\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\")\n place(vert); place(horiz)\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\") }\n })\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\") }\n })\n\n this.checkedZeroWidth = false\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\" }\n};\n\nNativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1\n var needsV = measure.scrollHeight > measure.clientHeight + 1\n var sWidth = measure.nativeBarWidth\n\n if (needsV) {\n this.vert.style.display = \"block\"\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\"\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\"\n } else {\n this.vert.style.display = \"\"\n this.vert.firstChild.style.height = \"0\"\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\"\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\"\n this.horiz.style.left = measure.barLeft + \"px\"\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)\n this.horiz.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\"\n } else {\n this.horiz.style.display = \"\"\n this.horiz.firstChild.style.width = \"0\"\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack() }\n this.checkedZeroWidth = true\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n};\n\nNativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }\n};\n\nNativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }\n};\n\nNativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\"\n this.horiz.style.height = this.vert.style.width = w\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\"\n this.disableHoriz = new Delayed\n this.disableVert = new Delayed\n};\n\nNativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) {\n bar.style.pointerEvents = \"auto\"\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // left corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect()\n var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)\n if (elt != bar) { bar.style.pointerEvents = \"none\" }\n else { delay.set(1000, maybeDisable) }\n }\n delay.set(1000, maybeDisable)\n};\n\nNativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode\n parent.removeChild(this.horiz)\n parent.removeChild(this.vert)\n};\n\nvar NullScrollbars = function () {};\n\nNullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\nNullScrollbars.prototype.setScrollLeft = function () {};\nNullScrollbars.prototype.setScrollTop = function () {};\nNullScrollbars.prototype.clear = function () {};\n\nfunction updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm) }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight\n updateScrollbarsInner(cm, measure)\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm) }\n updateScrollbarsInner(cm, measureForScrollbars(cm))\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight\n }\n}\n\n// Re-synchronize the fake scrollbars with the actual size of the\n// content.\nfunction updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}\n\nvar scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars}\n\nfunction initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear()\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }\n })\n node.setAttribute(\"cm-not-content\", \"true\")\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos) }\n else { setScrollTop(cm, pos) }\n }, cm)\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }\n}\n\n// SCROLLING THINGS INTO VIEW\n\n// If an editor sits on the top or bottom of the window, partially\n// scrolled out of view, this ensures that the cursor is visible.\nfunction maybeScrollWindow(cm, coords) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null\n if (coords.top + box.top < 0) { doScroll = true }\n else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (coords.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (coords.left) + \"px; width: 2px;\"))\n cm.display.lineSpace.appendChild(scrollNode)\n scrollNode.scrollIntoView(doScroll)\n cm.display.lineSpace.removeChild(scrollNode)\n }\n}\n\n// Scroll a given position into view (immediately), verifying that\n// it actually became visible (as line heights are accurately\n// measured, the position of something may 'drift' during drawing).\nfunction scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0 }\n var coords\n for (var limit = 0; limit < 5; limit++) {\n var changed = false\n coords = cursorCoords(cm, pos)\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin)\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop)\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft)\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }\n }\n if (!changed) { break }\n }\n return coords\n}\n\n// Scroll a given set of coordinates into view (immediately).\nfunction scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2)\n if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }\n}\n\n// Calculate a new scroll position needed to scroll the given\n// rectangle into view. Returns an object with scrollTop and\n// scrollLeft properties. When these are undefined, the\n// vertical/horizontal position does not need to be adjusted.\nfunction calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display)\n if (y1 < 0) { y1 = 0 }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop\n var screen = displayHeight(cm), result = {}\n if (y2 - y1 > screen) { y2 = y1 + screen }\n var docBottom = cm.doc.height + paddingVert(display)\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen)\n if (newTop != screentop) { result.scrollTop = newTop }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)\n var tooWide = x2 - x1 > screenw\n if (tooWide) { x2 = x1 + screenw }\n if (x1 < 10)\n { result.scrollLeft = 0 }\n else if (x1 < screenleft)\n { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) }\n else if (x2 > screenw + screenleft - 3)\n { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw }\n return result\n}\n\n// Store a relative adjustment to the scroll position in the current\n// operation (to be applied when the operation finishes).\nfunction addToScrollPos(cm, left, top) {\n if (left != null || top != null) { resolveScrollToPos(cm) }\n if (left != null)\n { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }\n if (top != null)\n { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }\n}\n\n// Make sure that at the end of the operation the current cursor is\n// shown.\nfunction ensureCursorVisible(cm) {\n resolveScrollToPos(cm)\n var cur = cm.getCursor(), from = cur, to = cur\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur\n to = Pos(cur.line, cur.ch + 1)\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}\n}\n\n// When an operation has its scrollToPos property set, and another\n// scroll action is applied before the end of the operation, this\n// 'simulates' scrolling that position into view in a cheap way, so\n// that the effect of intermediate scroll commands is not ignored.\nfunction resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos\n if (range) {\n cm.curOp.scrollToPos = null\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin)\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n}\n\n// Operations are used to wrap a series of changes to the editor\n// state in such a way that each change won't have to update the\n// cursor and display (which would be awkward, slow, and\n// error-prone). Instead, display updates are batched and then all\n// combined and executed at once.\n\nvar nextOpId = 0\n// Start a new operation.\nfunction startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n }\n pushOperation(cm.curOp)\n}\n\n// Finish an operation, updating the display and signalling delayed events\nfunction endOperation(cm) {\n var op = cm.curOp\n finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null }\n endOperations(group)\n })\n}\n\n// The DOM updates done when an operation finishes are batched so\n// that the minimum number of relayouts are required.\nfunction endOperations(group) {\n var ops = group.ops\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]) }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]) }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]) }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]) }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]) }\n}\n\nfunction endOperation_R1(op) {\n var cm = op.cm, display = cm.display\n maybeClipScrollbars(cm)\n if (op.updateMaxLine) { findMaxLine(cm) }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)\n}\n\nfunction endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)\n}\n\nfunction endOperation_R2(op) {\n var cm = op.cm, display = cm.display\n if (op.updatedDisplay) { updateHeightsInViewport(cm) }\n\n op.barMeasure = measureForScrollbars(cm)\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3\n cm.display.sizerWidth = op.adjustWidthTo\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(op.focus) }\n}\n\nfunction endOperation_W2(op) {\n var cm = op.cm\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\"\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }\n cm.display.maxLineChanged = false\n }\n\n var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus) }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure) }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure) }\n\n if (op.selectionChanged) { restartBlink(cm) }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing) }\n if (takeFocus) { ensureFocus(op.cm) }\n}\n\nfunction endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {\n doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop))\n display.scrollbars.setScrollTop(doc.scrollTop)\n display.scroller.scrollTop = doc.scrollTop\n }\n if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {\n doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft))\n display.scrollbars.setScrollLeft(doc.scrollLeft)\n display.scroller.scrollLeft = doc.scrollLeft\n alignHorizontally(cm)\n }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)\n if (op.scrollToPos.isCursor && cm.state.focused) { maybeScrollWindow(cm, coords) }\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\") } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\") } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs) }\n if (op.update)\n { op.update.finish() }\n}\n\n// Run the given function in an operation\nfunction runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm)\n try { return f() }\n finally { endOperation(cm) }\n}\n// Wraps a function in an operation. Returns the wrapped function.\nfunction operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}\n// Used to add methods to editor and doc instances, wrapping them in\n// operations.\nfunction methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this)\n try { return f.apply(this, arguments) }\n finally { endOperation(this) }\n }\n}\nfunction docMethodOp(f) {\n return function() {\n var cm = this.cm\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm)\n try { return f.apply(this, arguments) }\n finally { endOperation(cm) }\n }\n}\n\n// Updates the display.view data structure for a given change to the\n// document. From and to are in pre-change coordinates. Lendiff is\n// the amount of lines added or subtracted by the change. This is\n// used for changes that span multiple lines, or change the way\n// lines are divided into visual lines. regLineChange (below)\n// registers single-line changes.\nfunction regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first }\n if (to == null) { to = cm.doc.first + cm.doc.size }\n if (!lendiff) { lendiff = 0 }\n\n var display = cm.display\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from }\n\n cm.curOp.viewChanged = true\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm) }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm)\n } else {\n display.viewFrom += lendiff\n display.viewTo += lendiff\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm)\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cut) {\n display.view = display.view.slice(cut.index)\n display.viewFrom = cut.lineN\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1)\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index)\n display.viewTo = cut$1.lineN\n } else {\n resetView(cm)\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1)\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index))\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n }\n\n var ext = display.externalMeasured\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null }\n }\n}\n\n// Register a change to a single line. Type must be one of \"text\",\n// \"gutter\", \"class\", \"widget\"\nfunction regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true\n var display = cm.display, ext = cm.display.externalMeasured\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)]\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = [])\n if (indexOf(arr, type) == -1) { arr.push(type) }\n}\n\n// Clear the view.\nfunction resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first\n cm.display.view = []\n cm.display.viewOffset = 0\n}\n\nfunction viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom\n for (var i = 0; i < index; i++)\n { n += view[i].size }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN\n index++\n } else {\n diff = n - oldN\n }\n oldN += diff; newN += diff\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size\n index += dir\n }\n return {index: index, lineN: newN}\n}\n\n// Force the view to cover a given range, adding empty view element\n// or clipping off existing ones as needed.\nfunction adjustView(cm, from, to) {\n var display = cm.display, view = display.view\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to)\n display.viewFrom = from\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)) }\n display.viewFrom = from\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)) }\n }\n display.viewTo = to\n}\n\n// Count the number of lines in the view whose DOM representation is\n// out of date (or nonexistent).\nfunction countDirtyView(cm) {\n var view = cm.display.view, dirty = 0\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }\n }\n return dirty\n}\n\n// HIGHLIGHT WORKER\n\nfunction startWorker(cm, time) {\n if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)) }\n}\n\nfunction highlightWorker(cm) {\n var doc = cm.doc\n if (doc.frontier < doc.first) { doc.frontier = doc.first }\n if (doc.frontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime\n var state = copyState(doc.mode, getStateBefore(cm, doc.frontier))\n var changedLines = []\n\n doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (doc.frontier >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength\n var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true)\n line.styles = highlighted.styles\n var oldCls = line.styleClasses, newCls = highlighted.classes\n if (newCls) { line.styleClasses = newCls }\n else if (oldCls) { line.styleClasses = null }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }\n if (ischange) { changedLines.push(doc.frontier) }\n line.stateAfter = tooLong ? state : copyState(doc.mode, state)\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, state) }\n line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null\n }\n ++doc.frontier\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay)\n return true\n }\n })\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\") }\n }) }\n}\n\n// DISPLAY DRAWING\n\nvar DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display\n\n this.viewport = viewport\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport)\n this.editorIsHidden = !display.wrapper.offsetWidth\n this.wrapperHeight = display.wrapper.clientHeight\n this.wrapperWidth = display.wrapper.clientWidth\n this.oldDisplayWidth = displayWidth(cm)\n this.force = force\n this.dims = getDimensions(cm)\n this.events = []\n};\n\nDisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments) }\n};\nDisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]) }\n};\n\nfunction maybeClipScrollbars(cm) {\n var display = cm.display\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth\n display.heightForcer.style.height = scrollGap(cm) + \"px\"\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\"\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\"\n display.scrollbarsClipped = true\n }\n}\n\n// Does the actual updating of the line display. Bails out\n// (returning false) when there is nothing to be done and forced is\n// false.\nfunction updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt()\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}\n\nfunction postUpdateDisplay(cm, update) {\n var viewport = update.viewport\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport)\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm)\n var barMeasure = measureForScrollbars(cm)\n updateSelection(cm)\n updateScrollbars(cm, barMeasure)\n setDocumentHeight(cm, barMeasure)\n }\n\n update.signal(cm, \"update\", cm)\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo)\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo\n }\n}\n\nfunction updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport)\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm)\n postUpdateDisplay(cm, update)\n var barMeasure = measureForScrollbars(cm)\n updateSelection(cm)\n updateScrollbars(cm, barMeasure)\n setDocumentHeight(cm, barMeasure)\n update.finish()\n }\n}\n\n// Sync the actual display DOM structure with display.view, removing\n// nodes for lines that are no longer in view, and creating the ones\n// that are not there yet, and updating the ones that are out of\n// date.\nfunction patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers\n var container = display.lineDiv, cur = container.firstChild\n\n function rm(node) {\n var next = node.nextSibling\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\" }\n else\n { node.parentNode.removeChild(node) }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims)\n container.insertBefore(node, cur)\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur) }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false }\n updateLineForChanges(cm, lineView, lineN, dims)\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber)\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))\n }\n cur = lineView.node.nextSibling\n }\n lineN += lineView.size\n }\n while (cur) { cur = rm(cur) }\n}\n\nfunction updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth\n cm.display.sizer.style.marginLeft = width + \"px\"\n}\n\nfunction setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\"\n cm.display.heightForcer.style.top = measure.docHeight + \"px\"\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\"\n}\n\n// Rebuild the gutter elements, ensure the margin to the left of the\n// code matches their width.\nfunction updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}\n\n// Make sure the gutters options contains the element\n// \"CodeMirror-linenumbers\" when the lineNumbers option is true.\nfunction setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\")\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"])\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0)\n options.gutters.splice(found, 1)\n }\n}\n\n// Selection objects are immutable. A new one is created every time\n// the selection changes. A selection is one or more non-overlapping\n// (and non-touching) ranges, sorted, and an integer that indicates\n// which one is the primary selection (the one that's scrolled into\n// view, that getCursor returns, etc).\nfunction Selection(ranges, primIndex) {\n this.ranges = ranges\n this.primIndex = primIndex\n}\n\nSelection.prototype = {\n primary: function() { return this.ranges[this.primIndex] },\n equals: function(other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i]\n if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) { return false }\n }\n return true\n },\n deepCopy: function() {\n var this$1 = this;\n\n var out = []\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }\n return new Selection(out, this.primIndex)\n },\n somethingSelected: function() {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n },\n contains: function(pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i]\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n }\n}\n\nfunction Range(anchor, head) {\n this.anchor = anchor; this.head = head\n}\n\nRange.prototype = {\n from: function() { return minPos(this.anchor, this.head) },\n to: function() { return maxPos(this.anchor, this.head) },\n empty: function() {\n return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch\n }\n}\n\n// Take an unsorted, potentially overlapping set of ranges, and\n// build a selection out of it. 'Consumes' ranges array (modifying\n// it).\nfunction normalizeSelection(ranges, primIndex) {\n var prim = ranges[primIndex]\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })\n primIndex = indexOf(ranges, prim)\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1]\n if (cmp(prev.to(), cur.from()) >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head\n if (i <= primIndex) { --primIndex }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))\n }\n }\n return new Selection(ranges, primIndex)\n}\n\nfunction simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n}\n\n// Compute the position of the end of a change (its 'to' property\n// refers to the pre-change end).\nfunction changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n}\n\n// Adjust a position to refer to the post-change position of the\n// same text, or the end of the change if the change covers it.\nfunction adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }\n return Pos(line, ch)\n}\n\nfunction computeSelAfterChange(doc, change) {\n var out = []\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i]\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)))\n }\n return normalizeSelection(out, doc.sel.primIndex)\n}\n\nfunction offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n}\n\n// Used by replaceSelections to allow moving the selection to the\n// start or around the replaced test. Hint may be \"start\" or \"around\".\nfunction computeReplacedSel(doc, changes, hint) {\n var out = []\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i]\n var from = offsetPos(change.from, oldPrev, newPrev)\n var to = offsetPos(changeEnd(change), oldPrev, newPrev)\n oldPrev = change.to\n newPrev = to\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0\n out[i] = new Range(inv ? to : from, inv ? from : to)\n } else {\n out[i] = new Range(from, from)\n }\n }\n return new Selection(out, doc.sel.primIndex)\n}\n\n// Used to get the editor into a consistent state again when options change.\n\nfunction loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption)\n resetModeState(cm)\n}\n\nfunction resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n })\n cm.doc.frontier = cm.doc.first\n startWorker(cm, 100)\n cm.state.modeGen++\n if (cm.curOp) { regChange(cm) }\n}\n\n// DOCUMENT DATA STRUCTURE\n\n// By default, updates that start and end at the beginning of a line\n// are treated specially, in order to make the association of line\n// widgets and marker elements with the text behave more intuitive.\nfunction isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n}\n\n// Perform a change on the document data structure.\nfunction updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight)\n signalLater(line, \"change\", line, change)\n }\n function linesFor(start, end) {\n var result = []\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length))\n doc.remove(text.length, doc.size - text.length)\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1)\n update(lastLine, lastLine.text, lastSpans)\n if (nlines) { doc.remove(from.line, nlines) }\n if (added.length) { doc.insert(from.line, added) }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\n } else {\n var added$1 = linesFor(1, text.length - 1)\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n doc.insert(from.line + 1, added$1)\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\n doc.remove(from.line + 1, nlines)\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\n var added$2 = linesFor(1, text.length - 1)\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\n doc.insert(from.line + 1, added$2)\n }\n\n signalLater(doc, \"change\", doc, change)\n}\n\n// Call f for all linked documents.\nfunction linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i]\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared)\n propagate(rel.doc, doc, shared)\n } }\n }\n propagate(doc, null, true)\n}\n\n// Attach a document to an editor.\nfunction attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc\n doc.cm = cm\n estimateLineHeights(cm)\n loadMode(cm)\n if (!cm.options.lineWrapping) { findMaxLine(cm) }\n cm.options.mode = doc.modeOption\n regChange(cm)\n}\n\nfunction History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = []\n this.undoDepth = Infinity\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0\n this.lastOp = this.lastSelOp = null\n this.lastOrigin = this.lastSelOrigin = null\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1\n}\n\n// Create a history change event from an updateDoc-style change\n// object.\nfunction historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)\n return histChange\n}\n\n// Pop all selection events off the end of a history array. Stop at\n// a change event.\nfunction clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array)\n if (last.ranges) { array.pop() }\n else { break }\n }\n}\n\n// Find the top change event in the history. Pop off selection\n// events that are in the way.\nfunction lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done)\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop()\n return lst(hist.done)\n }\n}\n\n// Register a change in the history. Merges changes that are within\n// a single operation, or are close together with an origin that\n// allows merging (starting with \"+\") into a single event.\nfunction addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history\n hist.undone.length = 0\n var time = +new Date, cur\n var last\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes)\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change)\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change))\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done)\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done) }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation}\n hist.done.push(cur)\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift()\n if (!hist.done[0].ranges) { hist.done.shift() }\n }\n }\n hist.done.push(selAfter)\n hist.generation = ++hist.maxGeneration\n hist.lastModTime = hist.lastSelTime = time\n hist.lastOp = hist.lastSelOp = opId\n hist.lastOrigin = hist.lastSelOrigin = change.origin\n\n if (!last) { signal(doc, \"historyAdded\") }\n}\n\nfunction selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0)\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n}\n\n// Called whenever the selection changes, sets the new selection as\n// the pending selection in the history, and pushes the old pending\n// selection into the 'done' array when it was significantly\n// different (in number of selected ranges, emptiness, or time).\nfunction addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel }\n else\n { pushSelectionToHistory(sel, hist.done) }\n\n hist.lastSelTime = +new Date\n hist.lastSelOrigin = origin\n hist.lastSelOp = opId\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone) }\n}\n\nfunction pushSelectionToHistory(sel, dest) {\n var top = lst(dest)\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel) }\n}\n\n// Used to store marked span information in the history.\nfunction attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans }\n ++n\n })\n}\n\n// When un/re-doing restores text containing marked spans, those\n// that have been explicitly cleared should not be restored.\nfunction removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}\n\n// Retrieve and filter the old marked spans stored in a change event.\nfunction getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}\n\n// Used for un/re-doing changes from the history. Combines the\n// result of computing the existing spans with the set of spans that\n// existed in the history (so that deleting around a span and then\n// undoing brings back the span).\nfunction mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change)\n var stretched = stretchSpansOverChange(doc, change)\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i]\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j]\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span)\n }\n } else if (stretchCur) {\n old[i] = stretchCur\n }\n }\n return old\n}\n\n// Used both to provide a JSON-safe object in .getHistory, and, when\n// detaching a document, to split the history in two\nfunction copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = []\n for (var i = 0; i < events.length; ++i) {\n var event = events[i]\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)\n continue\n }\n var changes = event.changes, newChanges = []\n copy.push({changes: newChanges})\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0)\n newChanges.push({from: change.from, to: change.to, text: change.text})\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop]\n delete change[prop]\n }\n } } }\n }\n }\n return copy\n}\n\n// The 'scroll' parameter given to many of these indicated whether\n// the new cursor position should be scrolled into view after\n// modifying the selection.\n\n// If shift is held or the extend flag is set, extends a range to\n// include a given position (and optionally a second position).\n// Otherwise, simply returns the range between the given positions.\n// Used for cursor motion and such.\nfunction extendRange(doc, range, head, other) {\n if (doc.cm && doc.cm.display.shift || doc.extend) {\n var anchor = range.anchor\n if (other) {\n var posBefore = cmp(head, anchor) < 0\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head\n head = other\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n}\n\n// Extend the primary selection range, discard the rest.\nfunction extendSelection(doc, head, other, options) {\n setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options)\n}\n\n// Extend all selections (pos is an array of selections with length\n// equal the number of selections)\nfunction extendSelections(doc, heads, options) {\n var out = []\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null) }\n var newSel = normalizeSelection(out, doc.sel.primIndex)\n setSelection(doc, newSel, options)\n}\n\n// Updates a single range in the selection.\nfunction replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0)\n ranges[i] = range\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)\n}\n\n// Reset the selection to a single range.\nfunction setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options)\n}\n\n// Give beforeSelectionChange handlers a change to influence a\n// selection update.\nfunction filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = []\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)) }\n },\n origin: options && options.origin\n }\n signal(doc, \"beforeSelectionChange\", doc, obj)\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj) }\n if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n}\n\nfunction setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done)\n if (last && last.ranges) {\n done[done.length - 1] = sel\n setSelectionNoUndo(doc, sel, options)\n } else {\n setSelection(doc, sel, options)\n }\n}\n\n// Set a new selection.\nfunction setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options)\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)\n}\n\nfunction setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options) }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm) }\n}\n\nfunction setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true\n signalCursorActivity(doc.cm)\n }\n signalLater(doc, \"cursorActivity\", doc)\n}\n\n// Verify that the selection does not partially select any atomic\n// marked ranges.\nfunction reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll)\n}\n\n// Return a selection that does not partially select any atomic\n// ranges.\nfunction skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i]\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i) }\n out[i] = new Range(newAnchor, newHead)\n }\n }\n return out ? normalizeSelection(out, sel.primIndex) : sel\n}\n\nfunction skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line)\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\")\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1)\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null) }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n}\n\n// Ensure a given position is not inside an atomic range.\nfunction skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))\n if (!found) {\n doc.cantEdit = true\n return Pos(doc.first, 0)\n }\n return found\n}\n\nfunction movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n}\n\nfunction selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)\n}\n\n// UPDATING\n\n// Allow \"beforeChange\" event handlers to influence a change\nfunction filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n }\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from) }\n if (to) { obj.to = clipPos(doc, to) }\n if (text) { obj.text = text }\n if (origin !== undefined) { obj.origin = origin }\n } }\n signal(doc, \"beforeChange\", doc, obj)\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj) }\n\n if (obj.canceled) { return null }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n}\n\n// Apply a change to a document, and add it to the document's\n// history, and propagating it to all linked documents.\nfunction makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true)\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text}) }\n } else {\n makeChangeInner(doc, change)\n }\n}\n\nfunction makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change)\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))\n var rebased = []\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))\n })\n}\n\n// Revert a change stored in a document's history.\nfunction makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0\n for (; i < source.length; i++) {\n event = source[i]\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null\n\n for (;;) {\n event = source.pop()\n if (event.ranges) {\n pushSelectionToHistory(event, dest)\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false})\n return\n }\n selAfter = event\n }\n else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = []\n pushSelectionToHistory(selAfter, dest)\n dest.push({changes: antiChanges, generation: hist.generation})\n hist.generation = event.generation || ++hist.maxGeneration\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")\n\n var loop = function ( i ) {\n var change = event.changes[i]\n change.origin = type\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change))\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source)\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }\n var rebased = []\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change)\n rebased.push(doc.history)\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))\n })\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n}\n\n// Sub-views need their line numbers shifted when text is added\n// above or below them in the parent document.\nfunction shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex)\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance)\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\") }\n }\n}\n\n// More lower-level change function, handling only a single document\n// (not linked ones).\nfunction makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line)\n shiftDoc(doc, shift)\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin}\n }\n var last = doc.lastLine()\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin}\n }\n\n change.removed = getBetween(doc, change.from, change.to)\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }\n else { updateDoc(doc, change, spans) }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll)\n}\n\n// Handle the interaction of a change to a document with the editor\n// that this document is part of.\nfunction makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to\n\n var recomputeMaxLength = false, checkWidthStart = from.line\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true\n return true\n }\n })\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm) }\n\n updateDoc(doc, change, spans, estimateHeight(cm))\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line)\n if (len > display.maxLineLength) {\n display.maxLine = line\n display.maxLineLength = len\n display.maxLineChanged = true\n recomputeMaxLength = false\n }\n })\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }\n }\n\n // Adjust frontier, schedule worker\n doc.frontier = Math.min(doc.frontier, from.line)\n startWorker(cm, 400)\n\n var lendiff = change.text.length - (to.line - from.line) - 1\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm) }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\") }\n else\n { regChange(cm, from.line, to.line + 1, lendiff) }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\")\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n }\n if (changeHandler) { signalLater(cm, \"change\", cm, obj) }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }\n }\n cm.display.selForContextMenu = null\n}\n\nfunction replaceRange(doc, code, from, to, origin) {\n if (!to) { to = from }\n if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }\n if (typeof code == \"string\") { code = doc.splitLines(code) }\n makeChange(doc, {from: from, to: to, text: code, origin: origin})\n}\n\n// Rebasing/resetting history to deal with externally-sourced changes\n\nfunction rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff\n } else if (from < pos.line) {\n pos.line = from\n pos.ch = 0\n }\n}\n\n// Tries to rebase an array of history events given a change in the\n// document. If the change touches the same lines as the event, the\n// event, and everything 'behind' it, is discarded. If the change is\n// before the event, the event's positions are updated. Uses a\n// copy-on-write scheme for the positions, to avoid having to\n// reallocate them all on every rebase, but also avoid problems with\n// shared position objects being unsafely updated.\nfunction rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1]\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch)\n cur.to = Pos(cur.to.line + diff, cur.to.ch)\n } else if (from <= cur.to.line) {\n ok = false\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1)\n i = 0\n }\n }\n}\n\nfunction rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1\n rebaseHistArray(hist.done, from, to, diff)\n rebaseHistArray(hist.undone, from, to, diff)\n}\n\n// Utility for applying a change to a line by handle or number,\n// returning the number and optionally registering the line as\n// changed.\nfunction changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)) }\n else { no = lineNo(handle) }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }\n return line\n}\n\n// The document is represented as a BTree consisting of leaves, with\n// chunk of lines in them, and branches, with up to ten leaves or\n// other branch nodes below them. The top node is always a branch\n// node, and is the document object itself (meaning it has\n// additional methods and properties).\n//\n// All nodes have parent links. The tree is used both to go from\n// line numbers to line objects, and to go from objects to numbers.\n// It also indexes by height, and is used to convert between height\n// and line object, and to find the total height of the document.\n//\n// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\nfunction LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines\n this.parent = null\n var height = 0\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1\n height += lines[i].height\n }\n this.height = height\n}\n\nLeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i]\n this$1.height -= line.height\n cleanUpLine(line)\n signalLater(line, \"delete\")\n }\n this.lines.splice(at, n)\n },\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines)\n },\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }\n },\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n}\n\nfunction BranchChunk(children) {\n var this$1 = this;\n\n this.children = children\n var size = 0, height = 0\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i]\n size += ch.chunkSize(); height += ch.height\n ch.parent = this$1\n }\n this.size = size\n this.height = height\n this.parent = null\n}\n\nBranchChunk.prototype = {\n chunkSize: function() { return this.size },\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height\n child.removeInner(at, rm)\n this$1.height -= oldHeight - child.height\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }\n if ((n -= rm) == 0) { break }\n at = 0\n } else { at -= sz }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = []\n this.collapse(lines)\n this.children = [new LeafChunk(lines)]\n this.children[0].parent = this\n }\n },\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }\n },\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length\n this.height += height\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at <= sz) {\n child.insertInner(at, lines, height)\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))\n child.height -= leaf.height\n this$1.children.splice(++i, 0, leaf)\n leaf.parent = this$1\n }\n child.lines = child.lines.slice(0, remaining)\n this$1.maybeSpill()\n }\n break\n }\n at -= sz\n }\n },\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this\n do {\n var spilled = me.children.splice(me.children.length - 5, 5)\n var sibling = new BranchChunk(spilled)\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children)\n copy.parent = me\n me.children = [copy, sibling]\n me = copy\n } else {\n me.size -= sibling.size\n me.height -= sibling.height\n var myIndex = indexOf(me.parent.children, me)\n me.parent.children.splice(myIndex + 1, 0, sibling)\n }\n sibling.parent = me.parent\n } while (me.children.length > 10)\n me.parent.maybeSpill()\n },\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize()\n if (at < sz) {\n var used = Math.min(n, sz - at)\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0\n } else { at -= sz }\n }\n }\n}\n\n// Line widgets are block elements displayed above or below a line.\n\nfunction LineWidget(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt] } } }\n this.doc = doc\n this.node = node\n}\neventMixin(LineWidget)\n\nfunction adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollPos(cm, null, diff) }\n}\n\nLineWidget.prototype.clear = function() {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }\n if (!ws.length) { line.widgets = null }\n var height = widgetHeight(this)\n updateLineHeight(line, Math.max(0, line.height - height))\n if (cm) { runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height)\n regLineChange(cm, no, \"widget\")\n }) }\n}\nLineWidget.prototype.changed = function() {\n var oldH = this.height, cm = this.doc.cm, line = this.line\n this.height = null\n var diff = widgetHeight(this) - oldH\n if (!diff) { return }\n updateLineHeight(line, line.height + diff)\n if (cm) { runInOp(cm, function () {\n cm.curOp.forceUpdate = true\n adjustScrollWhenAboveVisible(cm, line, diff)\n }) }\n}\n\nfunction addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options)\n var cm = doc.cm\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = [])\n if (widget.insertAt == null) { widgets.push(widget) }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }\n widget.line = line\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop\n updateLineHeight(line, line.height + widgetHeight(widget))\n if (aboveVisible) { addToScrollPos(cm, null, widget.height) }\n cm.curOp.forceUpdate = true\n }\n return true\n })\n return widget\n}\n\n// TEXTMARKERS\n\n// Created with markText and setBookmark methods. A TextMarker is a\n// handle that can be used to clear or find a marked position in the\n// document. Line objects hold arrays (markedSpans) containing\n// {from, to, marker} object pointing to such marker objects, and\n// indicating that such a marker is present on that line. Multiple\n// lines may point to the same marker when it spans across lines.\n// The spans will have null for their from/to properties when the\n// marker continues beyond the start/end of the line. Markers have\n// links back to the lines they currently touch.\n\n// Collapsed markers have unique ids, in order to be able to order\n// them, which is needed for uniquely determining an outer marker\n// when they overlap (they may nest, but not partially overlap).\nvar nextMarkerId = 0\n\nfunction TextMarker(doc, type) {\n this.lines = []\n this.type = type\n this.doc = doc\n this.id = ++nextMarkerId\n}\neventMixin(TextMarker)\n\n// Clear the marker.\nTextMarker.prototype.clear = function() {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp\n if (withOp) { startOperation(cm) }\n if (hasHandler(this, \"clear\")) {\n var found = this.find()\n if (found) { signalLater(this, \"clear\", found.from, found.to) }\n }\n var min = null, max = null\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i]\n var span = getMarkedSpanFor(line.markedSpans, this$1)\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\") }\n else if (cm) {\n if (span.to != null) { max = lineNo(line) }\n if (span.from != null) { min = lineNo(line) }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span)\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)) }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual\n cm.display.maxLineLength = len\n cm.display.maxLineChanged = true\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }\n this.lines.length = 0\n this.explicitlyCleared = true\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false\n if (cm) { reCheckSelection(cm.doc) }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this) }\n if (withOp) { endOperation(cm) }\n if (this.parent) { this.parent.clear() }\n}\n\n// Find the position of the marker in the document. Returns a {from,\n// to} object by default. Side can be passed to get a specific side\n// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n// Pos objects returned contain a line object, rather than a line\n// number (used to prevent looking up the same line twice).\nTextMarker.prototype.find = function(side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1 }\n var from, to\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i]\n var span = getMarkedSpanFor(line.markedSpans, this$1)\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from)\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to)\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n}\n\n// Signals that the marker's widget changed, and surrounding layout\n// should be recomputed.\nTextMarker.prototype.changed = function() {\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line)\n var view = findViewForLine(cm, lineN)\n if (view) {\n clearLineMeasurementCacheFor(view)\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true\n }\n cm.curOp.updateMaxLine = true\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height\n widget.height = null\n var dHeight = widgetHeight(widget) - oldHeight\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight) }\n }\n })\n}\n\nTextMarker.prototype.attachLine = function(line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }\n }\n this.lines.push(line)\n}\nTextMarker.prototype.detachLine = function(line) {\n this.lines.splice(indexOf(this.lines, line), 1)\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)\n }\n}\n\n// Create a marker, wire it up to the right lines, and\nfunction markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to)\n if (options) { copyObj(options, marker, false) }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true\n marker.widgetNode = elt(\"span\", [marker.replacedWith], \"CodeMirror-widget\")\n marker.widgetNode.setAttribute(\"role\", \"presentation\") // hide from accessibility tree\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\") }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans()\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN) }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null))\n ++curLine\n })\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }\n }) }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }) }\n\n if (marker.readOnly) {\n seeReadOnlySpans()\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory() }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId\n marker.atomic = true\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1) }\n else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\") } }\n if (marker.atomic) { reCheckSelection(cm.doc) }\n signalLater(cm, \"markerAdded\", cm, marker)\n }\n return marker\n}\n\n// SHARED TEXTMARKERS\n\n// A shared marker spans multiple linked documents. It is\n// implemented as a meta-marker-object controlling multiple normal\n// markers.\nfunction SharedTextMarker(markers, primary) {\n var this$1 = this;\n\n this.markers = markers\n this.primary = primary\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1 }\n}\neventMixin(SharedTextMarker)\n\nSharedTextMarker.prototype.clear = function() {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear() }\n signalLater(this, \"clear\")\n}\nSharedTextMarker.prototype.find = function(side, lineObj) {\n return this.primary.find(side, lineObj)\n}\n\nfunction markTextShared(doc, from, to, options, type) {\n options = copyObj(options)\n options.shared = false\n var markers = [markText(doc, from, to, options, type)], primary = markers[0]\n var widget = options.widgetNode\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true) }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers)\n })\n return new SharedTextMarker(markers, primary)\n}\n\nfunction findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n}\n\nfunction copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find()\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)\n marker.markers.push(subMark)\n subMark.parent = marker\n }\n }\n}\n\nfunction detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc]\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j]\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null\n marker.markers.splice(j--, 1)\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n}\n\nvar nextDocId = 0\nvar Doc = function(text, mode, firstLine, lineSep) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep) }\n if (firstLine == null) { firstLine = 0 }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])])\n this.first = firstLine\n this.scrollTop = this.scrollLeft = 0\n this.cantEdit = false\n this.cleanGeneration = 1\n this.frontier = firstLine\n var start = Pos(firstLine, 0)\n this.sel = simpleSelection(start)\n this.history = new History(null)\n this.id = ++nextDocId\n this.modeOption = mode\n this.lineSep = lineSep\n this.extend = false\n\n if (typeof text == \"string\") { text = this.splitLines(text) }\n updateDoc(this, {from: start, to: start, text: text})\n setSelection(this, simpleSelection(start), sel_dontScroll)\n}\n\nDoc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op) }\n else { this.iterN(this.first, this.first + this.size, from) }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height }\n this.insertInner(at - this.first, lines, height)\n },\n remove: function(at, n) { this.removeInner(at - this.first, n) },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size)\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true)\n setSelection(this, simpleSelection(top))\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from)\n to = to ? clipPos(this, to) : from\n replaceRange(this, code, from, to, origin)\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to))\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line) }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos\n if (start == null || start == \"head\") { pos = range.head }\n else if (start == \"anchor\") { pos = range.anchor }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to() }\n else { pos = range.from() }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options)\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options)\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f)\n extendSelections(this, clipPosArray(this, heads), options)\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = []\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)) }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }\n setSelection(this, normalizeSelection(out, primary), options)\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0)\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))\n setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())\n lines = lines ? lines.concat(sel) : sel\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }\n parts[i] = sel\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = []\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code }\n this.replaceSelections(dup, collapse, origin || \"+input\")\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i]\n changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse)\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]) }\n if (newSel) { setSelectionReplaceHistory(this, newSel) }\n else if (this.cm) { ensureCursorVisible(this.cm) }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\")}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\")}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true)}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true)}),\n\n setExtending: function(val) {this.extend = val},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration)},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true)\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration)\n hist.done = copyHistoryArray(histData.done.slice(0), null, true)\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {})\n markers[gutterID] = value\n if (!value && isEmpty(markers)) { line.gutterMarkers = null }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }\n return true\n })\n }\n })\n }),\n\n lineInfo: function(line) {\n var n\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line\n line = getLine(this, line)\n if (!line) { return null }\n } else {\n n = lineNo(line)\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\"\n if (!line[prop]) { line[prop] = cls }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\"\n var cur = line[prop]\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null }\n else {\n var found = cur.match(classTest(cls))\n if (!found) { return false }\n var end = found.index + found[0].length\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear() },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents}\n pos = clipPos(this, pos)\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos)\n var markers = [], spans = getLine(this, pos.line).markedSpans\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker) }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to)\n var found = [], lineNo = from.line\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i]\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker) }\n } }\n ++lineNo\n })\n return found\n },\n getAllMarks: function() {\n var markers = []\n this.iter(function (line) {\n var sps = line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker) } } }\n })\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length\n this.iter(function (line) {\n var sz = line.text.length + sepSize\n if (sz > off) { ch = off; return true }\n off -= sz\n ++lineNo\n })\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords)\n var index = coords.ch\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize\n })\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep)\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft\n doc.sel = this.sel\n doc.extend = false\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth\n doc.setHistory(this.getHistory())\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {} }\n var from = this.first, to = this.first + this.size\n if (options.from != null && options.from > from) { from = options.from }\n if (options.to != null && options.to < to) { to = options.to }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep)\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]\n copySharedMarkers(copy, findSharedMarkers(this))\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i]\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1)\n other.unlinkDoc(this$1)\n detachSharedMarkers(findSharedMarkers(this$1))\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id]\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)\n other.history = new History(null)\n other.history.done = copyHistoryArray(this.history.done, splitIds)\n other.history.undone = copyHistoryArray(this.history.undone, splitIds)\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f)},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" }\n})\n\n// Public alias.\nDoc.prototype.eachLine = Doc.prototype.iter\n\n// Kludge to work around strange IE behavior where it'll sometimes\n// re-fire a series of drag-related events right after the drop (#1551)\nvar lastDrop = 0\n\nfunction onDrop(e) {\n var cm = this\n clearDragCursor(cm)\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e)\n if (ie) { lastDrop = +new Date }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader\n reader.onload = operation(cm, function () {\n var content = reader.result\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\" }\n text[i] = content\n if (++read == n) {\n pos = clipPos(cm.doc, pos)\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"}\n makeChange(cm.doc, change)\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))\n }\n })\n reader.readAsText(file)\n }\n for (var i = 0; i < n; ++i) { loadFile(files[i], i) }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e)\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20)\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\")\n if (text$1) {\n var selected\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections() }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\") } }\n cm.replaceSelection(text$1, \"around\", \"paste\")\n cm.display.input.focus()\n }\n }\n catch(e){}\n }\n}\n\nfunction onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection())\n e.dataTransfer.effectAllowed = \"copyMove\"\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\")\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"\n if (presto) {\n img.width = img.height = 1\n cm.display.wrapper.appendChild(img)\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop\n }\n e.dataTransfer.setDragImage(img, 0, 0)\n if (presto) { img.parentNode.removeChild(img) }\n }\n}\n\nfunction onDragOver(cm, e) {\n var pos = posFromMouse(cm, e)\n if (!pos) { return }\n var frag = document.createDocumentFragment()\n drawSelectionCursor(cm, pos, frag)\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\")\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag)\n}\n\nfunction clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor)\n cm.display.dragCursor = null\n }\n}\n\n// These must be handled carefully, because naively registering a\n// handler for each editor will cause the editors to never be\n// garbage collected.\n\nfunction forEachCodeMirror(f) {\n if (!document.body.getElementsByClassName) { return }\n var byClass = document.body.getElementsByClassName(\"CodeMirror\")\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror\n if (cm) { f(cm) }\n }\n}\n\nvar globalsRegistered = false\nfunction ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers()\n globalsRegistered = true\n}\nfunction registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null\n forEachCodeMirror(onResize)\n }, 100) }\n })\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); })\n}\n// Called when the window resizes\nfunction onResize(cm) {\n var d = cm.display\n if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n { return }\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n d.scrollbarsClipped = false\n cm.setSize()\n}\n\nvar keyNames = {\n 3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n}\n\n// Number keys\nfor (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }\n// Alphabetic keys\nfor (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }\n// Function keys\nfor (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2 }\n\nvar keyMap = {}\n\nkeyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n}\n// Note that the save and find-related commands aren't defined by\n// default. User code or addons can define them. Unknown commands\n// are simply ignored.\nkeyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n fallthrough: \"basic\"\n}\n// Very basic readline/emacs-style bindings, which are standard on Mac.\nkeyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n}\nkeyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n fallthrough: [\"basic\", \"emacsy\"]\n}\nkeyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault\n\n// KEYMAP DISPATCH\n\nfunction normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/)\n name = parts[parts.length - 1]\n var alt, ctrl, shift, cmd\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i]\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }\n else if (/^a(lt)?$/i.test(mod)) { alt = true }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }\n else if (/^s(hift)?$/i.test(mod)) { shift = true }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name }\n if (ctrl) { name = \"Ctrl-\" + name }\n if (cmd) { name = \"Cmd-\" + name }\n if (shift) { name = \"Shift-\" + name }\n return name\n}\n\n// This is a kludge to keep keymaps mostly working as raw objects\n// (backwards compatibility) while at the same time support features\n// like normalization and multi-stroke key bindings. It compiles a\n// new normalized keymap, and then updates the old object to reflect\n// this.\nfunction normalizeKeyMap(keymap) {\n var copy = {}\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname]\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName)\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0)\n if (i == keys.length - 1) {\n name = keys.join(\" \")\n val = value\n } else {\n name = keys.slice(0, i + 1).join(\" \")\n val = \"...\"\n }\n var prev = copy[name]\n if (!prev) { copy[name] = val }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname]\n } }\n for (var prop in copy) { keymap[prop] = copy[prop] }\n return keymap\n}\n\nfunction lookupKey(key, map, handle, context) {\n map = getKeyMap(map)\n var found = map.call ? map.call(key, context) : map[key]\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context)\n if (result) { return result }\n }\n }\n}\n\n// Modifier key presses don't count as 'real' key presses for the\n// purpose of keymap fallthrough.\nfunction isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode]\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n}\n\n// Look up the name of a key as indicated by an event object.\nfunction keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var base = keyNames[event.keyCode], name = base\n if (name == null || event.altGraphKey) { return false }\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name }\n return name\n}\n\nfunction getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n}\n\n// Helper for deleting text near the selection(s), used to implement\n// backspace, delete, and similar functionality.\nfunction deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = []\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i])\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop()\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from\n break\n }\n }\n kill.push(toKill)\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\") }\n ensureCursorVisible(cm)\n })\n}\n\n// Commands are parameter-less actions that can be performed on an\n// editor, mostly used for keybindings.\nvar commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\")\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5\n var pos = cm.coordsChar({left: 0, top: top}, \"div\")\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from()\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)\n spaces.push(spaceStr(tabSize - col % tabSize))\n }\n cm.replaceSelections(spaces)\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\") }\n else { cm.execCommand(\"insertTab\") }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = []\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1)\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\")\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text\n if (prev) {\n cur = new Pos(cur.line, 1)\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\")\n }\n }\n }\n newSel.push(new Range(cur, cur))\n }\n cm.setSelections(newSel)\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections()\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\") }\n sels = cm.listSelections()\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true) }\n ensureCursorVisible(cm)\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n}\n\n\nfunction lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN)\n var visual = visualLine(line)\n if (visual != line) { lineN = lineNo(visual) }\n var order = getOrder(visual)\n var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual)\n return Pos(lineN, ch)\n}\nfunction lineEnd(cm, lineN) {\n var merged, line = getLine(cm.doc, lineN)\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n lineN = null\n }\n var order = getOrder(line)\n var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line)\n return Pos(lineN == null ? lineNo(line) : lineN, ch)\n}\nfunction lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line)\n var line = getLine(cm.doc, start.line)\n var order = getOrder(line)\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/))\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch\n return Pos(start.line, inWS ? 0 : firstNonWS)\n }\n return start\n}\n\n// Run a handler that was bound to a key.\nfunction doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound]\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled()\n var prevShift = cm.display.shift, done = false\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true }\n if (dropShift) { cm.display.shift = false }\n done = bound(cm) != Pass\n } finally {\n cm.display.shift = prevShift\n cm.state.suppressEdits = false\n }\n return done\n}\n\nfunction lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n}\n\nvar stopSeq = new Delayed\nfunction dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null\n cm.display.input.reset()\n }\n })\n name = seq + \" \" + name\n }\n var result = lookupKeyForEditor(cm, name, handle)\n\n if (result == \"multi\")\n { cm.state.keySeq = name }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e) }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e)\n restartBlink(cm)\n }\n\n if (seq && !result && /\\'$/.test(name)) {\n e_preventDefault(e)\n return true\n }\n return !!result\n}\n\n// Handle a key from the keydown event.\nfunction handleKeyBinding(cm, e) {\n var name = keyName(e, true)\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n}\n\n// Handle a key from the keypress event\nfunction handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n}\n\nvar lastStoppedKey = null\nfunction onKeyDown(e) {\n var cm = this\n cm.curOp.focus = activeElt()\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }\n var code = e.keyCode\n cm.display.shift = code == 16 || e.shiftKey\n var handled = handleKeyBinding(cm, e)\n if (presto) {\n lastStoppedKey = handled ? code : null\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\") }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm) }\n}\n\nfunction showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv\n addClass(lineDiv, \"CodeMirror-crosshair\")\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\")\n off(document, \"keyup\", up)\n off(document, \"mouseover\", up)\n }\n }\n on(document, \"keyup\", up)\n on(document, \"mouseover\", up)\n}\n\nfunction onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false }\n signalDOMEvent(this, e)\n}\n\nfunction onKeyPress(e) {\n var cm = this\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode)\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e)\n}\n\n// A mouse down can be a single click, double click, triple click,\n// start of selection drag, start of text drag, new cursor\n// (ctrl-click), rectangle drag (alt-drag), or xwin\n// middle-click-paste. Or it might be a click on something we should\n// not interfere with, such as a scrollbar or widget.\nfunction onMouseDown(e) {\n var cm = this, display = cm.display\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled()\n display.shift = e.shiftKey\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false\n setTimeout(function () { return display.scroller.draggable = true; }, 100)\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var start = posFromMouse(cm, e)\n window.focus()\n\n switch (e_button(e)) {\n case 1:\n // #3261: make sure, that we're not starting a second selection\n if (cm.state.selectingText)\n { cm.state.selectingText(e) }\n else if (start)\n { leftButtonDown(cm, e, start) }\n else if (e_target(e) == display.scroller)\n { e_preventDefault(e) }\n break\n case 2:\n if (webkit) { cm.state.lastMiddleDown = +new Date }\n if (start) { extendSelection(cm.doc, start) }\n setTimeout(function () { return display.input.focus(); }, 20)\n e_preventDefault(e)\n break\n case 3:\n if (captureRightClick) { onContextMenu(cm, e) }\n else { delayBlurEvent(cm) }\n break\n }\n}\n\nvar lastClick;\nvar lastDoubleClick;\nfunction leftButtonDown(cm, e, start) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0) }\n else { cm.curOp.focus = activeElt() }\n\n var now = +new Date, type\n if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {\n type = \"triple\"\n } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {\n type = \"double\"\n lastDoubleClick = {time: now, pos: start}\n } else {\n type = \"single\"\n lastClick = {time: now, pos: start}\n }\n\n var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n type == \"single\" && (contained = sel.contains(start)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&\n (cmp(contained.to(), start) > 0 || start.xRel < 0))\n { leftButtonStartDrag(cm, e, start, modifier) }\n else\n { leftButtonSelect(cm, e, start, type, modifier) }\n}\n\n// Start a text drag. When it ends, see if any dragging actually\n// happen, and treat as a click if it didn't.\nfunction leftButtonStartDrag(cm, e, start, modifier) {\n var display = cm.display, startTime = +new Date\n var dragEnd = operation(cm, function (e2) {\n if (webkit) { display.scroller.draggable = false }\n cm.state.draggingText = false\n off(document, \"mouseup\", dragEnd)\n off(display.scroller, \"drop\", dragEnd)\n if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {\n e_preventDefault(e2)\n if (!modifier && +new Date - 200 < startTime)\n { extendSelection(cm.doc, start) }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }\n else\n { display.input.focus() }\n }\n })\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true }\n cm.state.draggingText = dragEnd\n dragEnd.copy = mac ? e.altKey : e.ctrlKey\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop() }\n on(document, \"mouseup\", dragEnd)\n on(display.scroller, \"drop\", dragEnd)\n}\n\n// Normal selection, as opposed to text dragging.\nfunction leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(e)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\"\n if (!addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, e, true, true)\n ourIndex = -1\n } else if (type == \"double\") {\n var word = cm.findWordAt(start)\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }\n else\n { ourRange = word }\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }\n else\n { ourRange = line }\n } else {\n ourRange = extendRange(doc, ourRange, start)\n }\n\n if (!addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var anchor = oldRange.anchor, head = pos\n if (type != \"single\") {\n var range\n if (type == \"double\")\n { range = cm.findWordAt(pos) }\n else\n { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, type == \"rect\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}\n\n\n// Determines whether an event happened in the gutter, and fires the\n// handlers for the corresponding event.\nfunction gutterEvent(cm, e, type, prevent) {\n var mX, mY\n try { mX = e.clientX; mY = e.clientY }\n catch(e) { return false }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e) }\n\n var display = cm.display\n var lineBox = display.lineDiv.getBoundingClientRect()\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i]\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY)\n var gutter = cm.options.gutters[i]\n signal(cm, type, cm, line, gutter, e)\n return e_defaultPrevented(e)\n }\n }\n}\n\nfunction clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n}\n\n// CONTEXT MENU HANDLING\n\n// To make the context menu work, we need to briefly unhide the\n// textarea (making it as unobtrusive as possible) to let the\n// right-click take effect on it.\nfunction onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n cm.display.input.onContextMenu(e)\n}\n\nfunction contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n}\n\nfunction themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\")\n clearCaches(cm)\n}\n\nvar Init = {toString: function(){return \"CodeMirror.Init\"}}\n\nvar defaults = {}\nvar optionHandlers = {}\n\nfunction defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }\n }\n\n CodeMirror.defineOption = option\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true)\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val\n loadMode(cm)\n }, true)\n\n option(\"indentUnit\", 2, loadMode, true)\n option(\"indentWithTabs\", false)\n option(\"smartIndent\", true)\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm)\n clearCaches(cm)\n regChange(cm)\n }, true)\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos)\n if (found == -1) { break }\n pos = found + val.length\n newBreaks.push(Pos(lineNo, found))\n }\n lineNo++\n })\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }\n })\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\")\n if (old != Init) { cm.refresh() }\n })\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)\n option(\"electricChars\", true)\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true)\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)\n option(\"rtlMoveVisually\", !windows)\n option(\"wholeLineUpdateBefore\", true)\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm)\n guttersChanged(cm)\n }, true)\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val)\n var prev = old != Init && getKeyMap(old)\n if (prev && prev.detach) { prev.detach(cm, next) }\n if (next.attach) { next.attach(cm, prev || null) }\n })\n option(\"extraKeys\", null)\n\n option(\"lineWrapping\", false, wrappingChanged, true)\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options)\n guttersChanged(cm)\n }, true)\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\"\n cm.refresh()\n }, true)\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true)\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm)\n updateScrollbars(cm)\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)\n }, true)\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options)\n guttersChanged(cm)\n }, true)\n option(\"firstLineNumber\", 1, guttersChanged, true)\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true)\n option(\"showCursorWhenSelecting\", false, updateSelection, true)\n\n option(\"resetSelectionOnContextMenu\", true)\n option(\"lineWiseCopyCut\", true)\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm)\n cm.display.input.blur()\n cm.display.disabled = true\n } else {\n cm.display.disabled = false\n }\n cm.display.input.readOnlyChanged(val)\n })\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)\n option(\"dragDrop\", true, dragDropChanged)\n option(\"allowDropFileTypes\", null)\n\n option(\"cursorBlinkRate\", 530)\n option(\"cursorScrollMargin\", 0)\n option(\"cursorHeight\", 1, updateSelection, true)\n option(\"singleCursorHeightPerLine\", true, updateSelection, true)\n option(\"workTime\", 100)\n option(\"workDelay\", 100)\n option(\"flattenSpans\", true, resetModeState, true)\n option(\"addModeClass\", false, resetModeState, true)\n option(\"pollInterval\", 100)\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })\n option(\"historyEventDelay\", 1250)\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true)\n option(\"maxHighlightLength\", 10000, resetModeState, true)\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition() }\n })\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; })\n option(\"autofocus\", null)\n}\n\nfunction guttersChanged(cm) {\n updateGutters(cm)\n regChange(cm)\n alignHorizontally(cm)\n}\n\nfunction dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions\n var toggle = value ? on : off\n toggle(cm.display.scroller, \"dragstart\", funcs.start)\n toggle(cm.display.scroller, \"dragenter\", funcs.enter)\n toggle(cm.display.scroller, \"dragover\", funcs.over)\n toggle(cm.display.scroller, \"dragleave\", funcs.leave)\n toggle(cm.display.scroller, \"drop\", funcs.drop)\n }\n}\n\nfunction wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\")\n cm.display.sizer.style.minWidth = \"\"\n cm.display.sizerWidth = null\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\")\n findMaxLine(cm)\n }\n estimateLineHeights(cm)\n regChange(cm)\n clearCaches(cm)\n setTimeout(function () { return updateScrollbars(cm); }, 100)\n}\n\n// A CodeMirror instance represents an editor. This is the object\n// that user code is usually dealing with.\n\nfunction CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {}\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false)\n setGuttersForLineNumbers(options)\n\n var doc = options.value\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator) }\n this.doc = doc\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this)\n var display = this.display = new Display(place, doc, input)\n display.wrapper.CodeMirror = this\n updateGutters(this)\n themeChanged(this)\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\" }\n initScrollbars(this)\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n }\n\n if (options.autofocus && !mobile) { display.input.focus() }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }\n\n registerEventHandlers(this)\n ensureGlobalHandlers()\n\n startOperation(this)\n this.curOp.forceUpdate = true\n attachDoc(this, doc)\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20) }\n else\n { onBlur(this) }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init) } }\n maybeUpdateLineNumberWidth(this)\n if (options.finishInit) { options.finishInit(this) }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }\n endOperation(this)\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\" }\n}\n\n// The default configuration options.\nCodeMirror.defaults = defaults\n// Functions to run when options are changed.\nCodeMirror.optionHandlers = optionHandlers\n\n// Attach the necessary event handlers when initializing the editor\nfunction registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}\n\nvar initHooks = []\nCodeMirror.defineInitHook = function (f) { return initHooks.push(f); }\n\n// Indent the given line. The how parameter can be \"smart\",\n// \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n// (typically set to true for forced single-line indents), empty\n// lines are not indented, and places where the mode returns Pass\n// are left alone.\nfunction indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state\n if (how == null) { how = \"add\" }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\" }\n else { state = getStateBefore(cm, n) }\n }\n\n var tabSize = cm.options.tabSize\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)\n if (line.stateAfter) { line.stateAfter = null }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0\n how = \"not\"\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\"\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }\n else { indentation = 0 }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit\n } else if (typeof how == \"number\") {\n indentation = curSpace + how\n }\n indentation = Math.max(0, indentation)\n\n var indentString = \"\", pos = 0\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\"} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos) }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\")\n line.stateAfter = null\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1]\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length)\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))\n break\n }\n }\n }\n}\n\n// This will be set to a {lineWise: bool, text: [string]} object, so\n// that, when pasting, we know what kind of selections the copied\n// text was made out of.\nvar lastCopied = null\n\nfunction setLastCopied(newLastCopied) {\n lastCopied = newLastCopied\n}\n\nfunction applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc\n cm.display.shift = false\n if (!sel) { sel = doc.sel }\n\n var paste = cm.state.pasteIncoming || origin == \"paste\"\n var textLines = splitLinesAuto(inserted), multiPaste = null\n // When pasing N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = []\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])) }\n }\n } else if (textLines.length == sel.ranges.length) {\n multiPaste = map(textLines, function (l) { return [l]; })\n }\n }\n\n var updateInput\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1]\n var from = range.from(), to = range.to()\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted) }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }\n else if (lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0) }\n }\n updateInput = cm.curOp.updateInput\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\")}\n makeChange(cm.doc, changeEvent)\n signalLater(cm, \"inputRead\", cm, changeEvent)\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted) }\n\n ensureCursorVisible(cm)\n cm.curOp.updateInput = updateInput\n cm.curOp.typing = true\n cm.state.pasteIncoming = cm.state.cutIncoming = false\n}\n\nfunction handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\")\n if (pasted) {\n e.preventDefault()\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }) }\n return true\n }\n}\n\nfunction triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i]\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head)\n var indented = false\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\")\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\") }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line) }\n }\n}\n\nfunction copyableRanges(cm) {\n var text = [], ranges = []\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}\n ranges.push(lineRange)\n text.push(cm.getRange(lineRange.anchor, lineRange.head))\n }\n return {text: text, ranges: ranges}\n}\n\nfunction disableBrowserMagic(field, spellcheck) {\n field.setAttribute(\"autocorrect\", \"off\")\n field.setAttribute(\"autocapitalize\", \"off\")\n field.setAttribute(\"spellcheck\", !!spellcheck)\n}\n\nfunction hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\")\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\")\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\" }\n else { te.setAttribute(\"wrap\", \"off\") }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\" }\n disableBrowserMagic(te)\n return div\n}\n\n// The publicly visible API. Note that methodOp(f) means\n// 'wrap f in an operation, performed on its `this` parameter'.\n\n// This is not the complete set of editor methods. Most of the\n// methods defined on the Doc type are also injected into\n// CodeMirror.prototype, for backwards compatibility and\n// convenience.\n\nfunction addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n var helpers = CodeMirror.helpers = {}\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus()},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option]\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old) }\n signal(this, \"optionChange\", this, option)\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map))\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1)\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; })\n this.state.modeGen++\n regChange(this)\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1)\n this$1.state.modeGen++\n regChange(this$1)\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\" }\n else { dir = dir ? \"add\" : \"subtract\" }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (!range.empty()) {\n var from = range.from(), to = range.to()\n var start = Math.max(end, from.line)\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how) }\n var newRanges = this$1.doc.sel.ranges\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }\n } else if (range.head.line > end) {\n indentLine(this$1, range.head.line, how, true)\n end = range.head.line\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos)\n var styles = getLineStyles(this, getLine(this.doc, pos.line))\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch\n var type\n if (ch == 0) { type = styles[2] }\n else { for (;;) {\n var mid = (before + after) >> 1\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = []\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos)\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]) }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]]\n if (val) { found.push(val) }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType])\n } else if (help[mode.name]) {\n found.push(help[mode.name])\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1]\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val) }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)\n return getStateBefore(this, line + 1, precise)\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary()\n if (start == null) { pos = range.head }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start) }\n else { pos = start ? range.from() : range.to() }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\")\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1\n if (line < this.doc.first) { line = this.doc.first }\n else if (line > last) { line = last; end = true }\n lineObj = getLine(this.doc, line)\n } else {\n lineObj = line\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display\n pos = cursorCoords(this, clipPos(this.doc, pos))\n var top = pos.bottom, left = pos.left\n node.style.position = \"absolute\"\n node.setAttribute(\"cm-ignore-events\", \"true\")\n this.display.input.setUneditable(node)\n display.sizer.appendChild(node)\n if (vert == \"over\") {\n top = pos.top\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth }\n }\n node.style.top = top + \"px\"\n node.style.left = node.style.right = \"\"\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth\n node.style.right = \"0px\"\n } else {\n if (horiz == \"left\") { left = 0 }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }\n node.style.left = left + \"px\"\n }\n if (scroll)\n { scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight) }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move)\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\") }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false)\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }) }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\")\n if (x == null) { x = coords.left }\n else { coords.left = x }\n cur = findPosV(this$1, coords, dir, unit)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = []\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\")\n if (range.goalColumn != null) { headPos.left = range.goalColumn }\n goals.push(headPos.left)\n var pos = findPosV(this$1, headPos, dir, unit)\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollPos(this$1, null, charCoords(this$1, pos, \"div\").top - headPos.top) }\n return pos\n }, sel_move)\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i] } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text\n var start = pos.ch, end = pos.ch\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\")\n if ((pos.xRel < 0 || end == line.length) && start) { --start; } else { ++end }\n var startChar = line.charAt(start)\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); }\n while (start > 0 && check(line.charAt(start - 1))) { --start }\n while (end < line.length && check(line.charAt(end))) { ++end }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite)\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function(x, y) {\n if (x != null || y != null) { resolveScrollToPos(this) }\n if (x != null) { this.curOp.scrollLeft = x }\n if (y != null) { this.curOp.scrollTop = y }\n }),\n getScrollInfo: function() {\n var scroller = this.display.scroller\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null}\n if (margin == null) { margin = this.options.cursorScrollMargin }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null}\n } else if (range.from == null) {\n range = {from: range, to: null}\n }\n if (!range.to) { range.to = range.from }\n range.margin = margin || 0\n\n if (range.from.line != null) {\n resolveScrollToPos(this)\n this.curOp.scrollToPos = range\n } else {\n var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),\n Math.min(range.from.top, range.to.top) - range.margin,\n Math.max(range.from.right, range.to.right),\n Math.max(range.from.bottom, range.to.bottom) + range.margin)\n this.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; }\n if (width != null) { this.display.wrapper.style.width = interpret(width) }\n if (height != null) { this.display.wrapper.style.height = interpret(height) }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this) }\n var lineNo = this.display.viewFrom\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo\n })\n this.curOp.forceUpdate = true\n signal(this, \"refresh\", this)\n }),\n\n operation: function(f){return runInOp(this, f)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight\n regChange(this)\n this.curOp.forceUpdate = true\n clearCaches(this)\n this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop)\n updateGutterSpace(this)\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this) }\n signal(this, \"refresh\", this)\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc\n old.cm = null\n attachDoc(this, doc)\n clearCaches(this)\n this.display.input.reset()\n this.scrollTo(doc.scrollLeft, doc.scrollTop)\n this.curOp.forceScroll = true\n signalLater(this, \"swapDoc\", this, old)\n return old\n }),\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n }\n eventMixin(CodeMirror)\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }\n helpers[type][name] = value\n }\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value)\n helpers[type]._global.push({pred: predicate, val: value})\n }\n}\n\n// Used for horizontal relative motion. Dir is -1 or 1 (left or\n// right), unit can be \"char\", \"column\" (like char, but doesn't\n// cross line boundaries), \"word\" (across next word), or \"group\" (to\n// the start of next group of word or non-word-non-whitespace\n// chars). The visually param controls whether, in right-to-left\n// text, direction 1 means to move towards the next index in the\n// string, or towards the character to the right of the current\n// position. The resulting position will have a hitSide=true\n// property if it reached the end of the document.\nfunction findPosH(doc, pos, dir, unit, visually) {\n var line = pos.line, ch = pos.ch, origDir = dir\n var lineObj = getLine(doc, line)\n function findNextLine() {\n var l = line + dir\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n line = l\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true)\n if (next == null) {\n if (!boundToLine && findNextLine()) {\n if (visually) { ch = (dir < 0 ? lineRight : lineLeft)(lineObj) }\n else { ch = dir < 0 ? lineObj.text.length : 0 }\n } else { return false }\n } else { ch = next }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce()\n } else if (unit == \"column\") {\n moveOnce(true)\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\"\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\")\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(ch) || \"\\n\"\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\"\n if (group && !first && !type) { type = \"s\" }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce()}\n break\n }\n\n if (type) { sawType = type }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true)\n if (!cmp(pos, result)) { result.hitSide = true }\n return result\n}\n\n// For relative vertical movement. Dir may be -1 or 1. Unit can be\n// \"page\" or \"line\". The resulting position will have a hitSide=true\n// property if it reached the end of the document.\nfunction findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3\n }\n var target\n for (;;) {\n target = coordsChar(cm, x, y)\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5\n }\n return target\n}\n\n// CONTENTEDITABLE INPUT STYLE\n\nvar ContentEditableInput = function(cm) {\n this.cm = cm\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null\n this.polling = new Delayed()\n this.composing = null\n this.gracePeriod = false\n this.readDOMTimeout = null\n};\n\nContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm\n var div = input.div = display.lineDiv\n disableBrowserMagic(div, cm.options.spellcheck)\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () {\n if (!input.pollContent()) { regChange(cm) }\n }), 20) }\n })\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false}\n })\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }\n })\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }\n this$1.composing.done = true\n }\n })\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); })\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon() }\n })\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()})\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\") }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm)\n setLastCopied({lineWise: true, text: ranges.text})\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll)\n cm.replaceSelection(\"\", null, \"cut\")\n })\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData()\n var content = lastCopied.text.join(\"\\n\")\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content)\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault()\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)\n te.value = lastCopied.text.join(\"\\n\")\n var hadFocus = document.activeElement\n selectInput(te)\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge)\n hadFocus.focus()\n if (hadFocus == div) { input.showPrimarySelection() }\n }, 50)\n }\n on(div, \"copy\", onCopyCut)\n on(div, \"cut\", onCopyCut)\n};\n\nContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false)\n result.focus = this.cm.state.focused\n return result\n};\n\nContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection() }\n this.showMultipleSelections(info)\n};\n\nContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = window.getSelection(), prim = this.cm.doc.sel.primary()\n var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset)\n var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset)\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&\n cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)\n { return }\n\n var start = posToDOM(this.cm, prim.from())\n var end = posToDOM(this.cm, prim.to())\n if (!start && !end) { return }\n\n var view = this.cm.display.view\n var old = sel.rangeCount && sel.getRangeAt(0)\n if (!start) {\n start = {node: view[0].measure.map[2], offset: 0}\n } else if (!end) { // FIXME dangerously hacky\n var measure = view[view.length - 1].measure\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}\n }\n\n var rng\n try { rng = range(start.node, start.offset, end.offset, end.node) }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && this.cm.state.focused) {\n sel.collapse(start.node, start.offset)\n if (!rng.collapsed) {\n sel.removeAllRanges()\n sel.addRange(rng)\n }\n } else {\n sel.removeAllRanges()\n sel.addRange(rng)\n }\n if (old && sel.anchorNode == null) { sel.addRange(old) }\n else if (gecko) { this.startGracePeriod() }\n }\n this.rememberSelection()\n};\n\nContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod)\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }\n }, 20)\n};\n\nContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)\n};\n\nContentEditableInput.prototype.rememberSelection = function () {\n var sel = window.getSelection()\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset\n};\n\nContentEditableInput.prototype.selectionInEditor = function () {\n var sel = window.getSelection()\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer\n return contains(this.div, node)\n};\n\nContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true) }\n this.div.focus()\n }\n};\nContentEditableInput.prototype.blur = function () { this.div.blur() };\nContentEditableInput.prototype.getField = function () { return this.div };\n\nContentEditableInput.prototype.supportsTouch = function () { return true };\n\nContentEditableInput.prototype.receivedFocus = function () {\n var input = this\n if (this.selectionInEditor())\n { this.pollSelection() }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection()\n input.polling.set(input.cm.options.pollInterval, poll)\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll)\n};\n\nContentEditableInput.prototype.selectionChanged = function () {\n var sel = window.getSelection()\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n};\n\nContentEditableInput.prototype.pollSelection = function () {\n if (!this.composing && this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) {\n var sel = window.getSelection(), cm = this.cm\n this.rememberSelection()\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)\n var head = domToPos(cm, sel.focusNode, sel.focusOffset)\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }\n }) }\n }\n};\n\nContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout)\n this.readDOMTimeout = null\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()\n var from = sel.from(), to = sel.to()\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0) }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line)\n fromNode = display.view[0].node\n } else {\n fromLine = lineNo(display.view[fromIndex].line)\n fromNode = display.view[fromIndex - 1].node.nextSibling\n }\n var toIndex = findViewIndex(cm, to.line)\n var toLine, toNode\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1\n toNode = display.lineDiv.lastChild\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1\n toNode = display.view[toIndex + 1].node.previousSibling\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront }\n var newBot = lst(newText), oldBot = lst(oldText)\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0))\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\")\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\")\n\n var chFrom = Pos(fromLine, cutFront)\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\")\n return true\n }\n};\n\nContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd()\n};\nContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd()\n};\nContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout)\n this.composing = null\n if (!this.pollContent()) { regChange(this.cm) }\n this.div.blur()\n this.div.focus()\n};\nContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null }\n else { return }\n }\n if (this$1.cm.isReadOnly() || !this$1.pollContent())\n { runInOp(this$1.cm, function () { return regChange(this$1.cm); }) }\n }, 80)\n};\n\nContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\"\n};\n\nContentEditableInput.prototype.onKeyPress = function (e) {\n e.preventDefault()\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }\n};\n\nContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\")\n};\n\nContentEditableInput.prototype.onContextMenu = function () {};\nContentEditableInput.prototype.resetPosition = function () {};\n\nContentEditableInput.prototype.needsContentAttribute = true\n\nfunction posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line)\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line)\n var info = mapFromLineView(view, line, pos.line)\n\n var order = getOrder(line), side = \"left\"\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch)\n side = partPos % 2 ? \"right\" : \"left\"\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)\n result.offset = result.collapse == \"right\" ? result.end : result.start\n return result\n}\n\nfunction badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\nfunction domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator()\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\")\n if (cmText != null) {\n if (cmText == \"\") { text += node.textContent.replace(/\\u200b/g, \"\") }\n else { text += cmText }\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))\n if (found.length && (range = found[0].find()))\n { text += getBetween(cm.doc, range.from, range.to).join(lineSep) }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]) }\n if (/^(pre|div|p)$/i.test(node.nodeName))\n { closing = true }\n } else if (node.nodeType == 3) {\n var val = node.nodeValue\n if (!val) { return }\n if (closing) {\n text += lineSep\n closing = false\n }\n text += val\n }\n }\n for (;;) {\n walk(from)\n if (from == to) { break }\n from = from.nextSibling\n }\n return text\n}\n\nfunction domToPos(cm, node, offset) {\n var lineNode\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset]\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i]\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n}\n\nfunction locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true\n node = wrapper.childNodes[offset]\n offset = 0\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild\n if (offset) { offset = textNode.nodeValue.length }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }\n var measure = lineView.measure, maps = measure.maps\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i]\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2]\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])\n var ch = map[j] + offset\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset)\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0)\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1)\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length }\n }\n}\n\n// TEXTAREA INPUT STYLE\n\nvar TextareaInput = function(cm) {\n this.cm = cm\n // See input.poll and input.reset\n this.prevInput = \"\"\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false\n // Self-resetting timeout for the poller\n this.polling = new Delayed()\n // Tracks when input.reset has punted to just putting a short\n // string into the textarea instead of the full selection.\n this.inaccurateSelection = false\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false\n this.composing = null\n};\n\nTextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm\n\n // Wraps and hides input textarea\n var div = this.wrapper = hiddenTextarea()\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var te = this.textarea = div.firstChild\n display.wrapper.insertBefore(div, display.wrapper.firstChild)\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\" }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }\n input.poll()\n })\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = true\n input.fastPoll()\n })\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()})\n if (input.inaccurateSelection) {\n input.prevInput = \"\"\n input.inaccurateSelection = false\n te.value = lastCopied.text.join(\"\\n\")\n selectInput(te)\n }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm)\n setLastCopied({lineWise: true, text: ranges.text})\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll)\n } else {\n input.prevInput = \"\"\n te.value = ranges.text.join(\"\\n\")\n selectInput(te)\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = true }\n }\n on(te, \"cut\", prepareCopyCut)\n on(te, \"copy\", prepareCopyCut)\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n cm.state.pasteIncoming = true\n input.focus()\n })\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e) }\n })\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\")\n if (input.composing) { input.composing.range.clear() }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n }\n })\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll()\n input.composing.range.clear()\n input.composing = null\n }\n })\n};\n\nTextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc\n var result = prepareSelection(cm)\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\")\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top))\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left))\n }\n\n return result\n};\n\nTextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors)\n removeChildrenAndAdd(display.selectionDiv, drawn.selection)\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\"\n this.wrapper.style.left = drawn.teLeft + \"px\"\n }\n};\n\n// Reset the input to correspond to the selection (or to be empty,\n// when not typing and nothing is selected)\nTextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending) { return }\n var minimal, selected, cm = this.cm, doc = cm.doc\n if (cm.somethingSelected()) {\n this.prevInput = \"\"\n var range = doc.sel.primary()\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)\n var content = minimal ? \"-\" : selected || cm.getSelection()\n this.textarea.value = content\n if (cm.state.focused) { selectInput(this.textarea) }\n if (ie && ie_version >= 9) { this.hasSelection = content }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\"\n if (ie && ie_version >= 9) { this.hasSelection = null }\n }\n this.inaccurateSelection = minimal\n};\n\nTextareaInput.prototype.getField = function () { return this.textarea };\n\nTextareaInput.prototype.supportsTouch = function () { return false };\n\nTextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus() }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n};\n\nTextareaInput.prototype.blur = function () { this.textarea.blur() };\n\nTextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0\n};\n\nTextareaInput.prototype.receivedFocus = function () { this.slowPoll() };\n\n// Poll for input changes, using the normal rate of polling. This\n// runs as long as the editor is focused.\nTextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll()\n if (this$1.cm.state.focused) { this$1.slowPoll() }\n })\n};\n\n// When an event has just come in that is likely to add or change\n// something in the input textarea, we poll faster, to ensure that\n// the change appears on the screen quickly.\nTextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this\n input.pollingFast = true\n function p() {\n var changed = input.poll()\n if (!changed && !missed) {missed = true; input.polling.set(60, p)}\n else {input.pollingFast = false; input.slowPoll()}\n }\n input.polling.set(20, p)\n};\n\n// Read input from the textarea, and update the document to match.\n// When something is selected, it is present in the textarea, and\n// selected (unless it is huge, in which case a placeholder is\n// used). When nothing is selected, the cursor sits after previously\n// seen text (can be empty), which is stored in prevInput (we must\n// not reset the textarea when typing, because that breaks IME).\nTextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset()\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0)\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\" }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length)\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null)\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\" }\n else { this$1.prevInput = text }\n\n if (this$1.composing) {\n this$1.composing.range.clear()\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"})\n }\n })\n return true\n};\n\nTextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false }\n};\n\nTextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null }\n this.fastPoll()\n};\n\nTextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText\n input.wrapper.style.cssText = \"position: absolute\"\n var wrapperBox = input.wrapper.getBoundingClientRect()\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\"\n var oldScrollY\n if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)\n display.input.focus()\n if (webkit) { window.scrollTo(null, oldScrollY) }\n display.input.reset()\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \" }\n input.contextMenuPending = true\n display.selForContextMenu = cm.doc.sel\n clearTimeout(display.detectingSelectAll)\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected()\n var extval = \"\\u200b\" + (selected ? te.value : \"\")\n te.value = \"\\u21da\" // Used to catch context-menu undo\n te.value = extval\n input.prevInput = selected ? \"\" : \"\\u200b\"\n te.selectionStart = 1; te.selectionEnd = extval.length\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel\n }\n }\n function rehide() {\n input.contextMenuPending = false\n input.wrapper.style.cssText = oldWrapperCSS\n te.style.cssText = oldCSS\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\")\n { operation(cm, selectAll)(cm) }\n else if (i++ < 10) { display.detectingSelectAll = setTimeout(poll, 500) }\n else { display.input.reset() }\n }\n display.detectingSelectAll = setTimeout(poll, 200)\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack() }\n if (captureRightClick) {\n e_stop(e)\n var mouseup = function () {\n off(window, \"mouseup\", mouseup)\n setTimeout(rehide, 20)\n }\n on(window, \"mouseup\", mouseup)\n } else {\n setTimeout(rehide, 50)\n }\n};\n\nTextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset() }\n};\n\nTextareaInput.prototype.setUneditable = function () {};\n\nTextareaInput.prototype.needsContentAttribute = false\n\nfunction fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {}\n options.value = textarea.value\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt()\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body\n }\n\n function save() {textarea.value = cm.getValue()}\n\n var realSubmit\n if (textarea.form) {\n on(textarea.form, \"submit\", save)\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form\n realSubmit = form.submit\n try {\n var wrappedSubmit = form.submit = function () {\n save()\n form.submit = realSubmit\n form.submit()\n form.submit = wrappedSubmit\n }\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save\n cm.getTextArea = function () { return textarea; }\n cm.toTextArea = function () {\n cm.toTextArea = isNaN // Prevent this from being ran twice\n save()\n textarea.parentNode.removeChild(cm.getWrapperElement())\n textarea.style.display = \"\"\n if (textarea.form) {\n off(textarea.form, \"submit\", save)\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit }\n }\n }\n }\n\n textarea.style.display = \"none\"\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options)\n return cm\n}\n\nfunction addLegacyProps(CodeMirror) {\n CodeMirror.off = off\n CodeMirror.on = on\n CodeMirror.wheelEventPixels = wheelEventPixels\n CodeMirror.Doc = Doc\n CodeMirror.splitLines = splitLinesAuto\n CodeMirror.countColumn = countColumn\n CodeMirror.findColumn = findColumn\n CodeMirror.isWordChar = isWordCharBasic\n CodeMirror.Pass = Pass\n CodeMirror.signal = signal\n CodeMirror.Line = Line\n CodeMirror.changeEnd = changeEnd\n CodeMirror.scrollbarModel = scrollbarModel\n CodeMirror.Pos = Pos\n CodeMirror.cmpPos = cmp\n CodeMirror.modes = modes\n CodeMirror.mimeModes = mimeModes\n CodeMirror.resolveMode = resolveMode\n CodeMirror.getMode = getMode\n CodeMirror.modeExtensions = modeExtensions\n CodeMirror.extendMode = extendMode\n CodeMirror.copyState = copyState\n CodeMirror.startState = startState\n CodeMirror.innerMode = innerMode\n CodeMirror.commands = commands\n CodeMirror.keyMap = keyMap\n CodeMirror.keyName = keyName\n CodeMirror.isModifierKey = isModifierKey\n CodeMirror.lookupKey = lookupKey\n CodeMirror.normalizeKeyMap = normalizeKeyMap\n CodeMirror.StringStream = StringStream\n CodeMirror.SharedTextMarker = SharedTextMarker\n CodeMirror.TextMarker = TextMarker\n CodeMirror.LineWidget = LineWidget\n CodeMirror.e_preventDefault = e_preventDefault\n CodeMirror.e_stopPropagation = e_stopPropagation\n CodeMirror.e_stop = e_stop\n CodeMirror.addClass = addClass\n CodeMirror.contains = contains\n CodeMirror.rmClass = rmClass\n CodeMirror.keyNames = keyNames\n}\n\n// EDITOR CONSTRUCTOR\n\ndefineOptions(CodeMirror)\n\naddEditorMethods(CodeMirror)\n\n// Set up methods on CodeMirror's prototype to redirect to the editor's document.\nvar dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \")\nfor (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]) } }\n\neventMixin(Doc)\n\n// INPUT HANDLING\n\nCodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput}\n\n// MODE DEFINITION AND QUERYING\n\n// Extra arguments are stored as the mode's dependencies, which is\n// used by (legacy) mechanisms like loadmode.js to automatically\n// load a mode. (Preferred mechanism is the require/define calls.)\nCodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name }\n defineMode.apply(this, arguments)\n}\n\nCodeMirror.defineMIME = defineMIME\n\n// Minimal default mode.\nCodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })\nCodeMirror.defineMIME(\"text/plain\", \"null\")\n\n// EXTENSIONS\n\nCodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func\n}\nCodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func\n}\n\nCodeMirror.fromTextArea = fromTextArea\n\naddLegacyProps(CodeMirror)\n\nCodeMirror.version = \"5.23.0\"\n\nreturn CodeMirror;\n\n})));\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.js?");
  515. /***/ }),
  516. /***/ "./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/mode/javascript/javascript.js":
  517. /*!****************************************************************************************************!*\
  518. !*** ./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/mode/javascript/javascript.js ***!
  519. \****************************************************************************************************/
  520. /*! no static exports found */
  521. /***/ (function(module, exports, __webpack_require__) {
  522. eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (true) // CommonJS\n mod(__webpack_require__(/*! ../../lib/codemirror */ \"./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.js\"));\n else {}\n})(function(CodeMirror) {\n\"use strict\";\n\nfunction expressionAllowed(stream, state, backUp) {\n return /^(?:operator|sof|keyword c|case|new|export|default|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n}\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n var jsKeywords = {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": C, \"break\": C, \"continue\": C, \"new\": kw(\"new\"), \"delete\": C, \"throw\": C, \"debugger\": C,\n \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C, \"async\": kw(\"async\")\n };\n\n // Extend the 'normal' keywords with the TypeScript language extensions\n if (isTS) {\n var type = {type: \"variable\", style: \"variable-3\"};\n var tsKeywords = {\n // object-like things\n \"interface\": kw(\"class\"),\n \"implements\": C,\n \"namespace\": C,\n \"module\": kw(\"module\"),\n \"enum\": kw(\"module\"),\n \"type\": kw(\"type\"),\n\n // scope modifiers\n \"public\": kw(\"modifier\"),\n \"private\": kw(\"modifier\"),\n \"protected\": kw(\"modifier\"),\n \"abstract\": kw(\"modifier\"),\n\n // operators\n \"as\": operator,\n\n // types\n \"string\": type, \"number\": type, \"boolean\": type, \"any\": type\n };\n\n for (var attr in tsKeywords) {\n jsKeywords[attr] = tsKeywords[attr];\n }\n }\n\n return jsKeywords;\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d+(?:[eE][+\\-]?\\d+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.eat(/x/i)) {\n stream.eatWhile(/[\\da-f]/i);\n return ret(\"number\", \"number\");\n } else if (ch == \"0\" && stream.eat(/o/i)) {\n stream.eatWhile(/[0-7]/i);\n return ret(\"number\", \"number\");\n } else if (ch == \"0\" && stream.eat(/b/i)) {\n stream.eatWhile(/[01]/i);\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^\\d*(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyu])(?![gimyu]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eatWhile(isOperatorChar);\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\") {\n stream.skipToEnd();\n return ret(\"error\", \"error\");\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\")\n stream.eatWhile(isOperatorChar);\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];\n return (known && state.lastType != \".\") ? ret(known.type, known.style, word) :\n ret(\"variable\", \"variable\", word);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/]/.test(ch)) {\n return;\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true, \"regexp\": true, \"this\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function register(varname) {\n function inList(list) {\n for (var v = list; v; v = v.next)\n if (v.name == varname) return true;\n return false;\n }\n var state = cx.state;\n cx.marked = \"def\";\n if (state.context) {\n if (inList(state.localVars)) return;\n state.localVars = {name: varname, next: state.localVars};\n } else {\n if (inList(state.globalVars)) return;\n if (parserConfig.globalVars)\n state.globalVars = {name: varname, next: state.globalVars};\n }\n }\n\n // Combinators\n\n var defaultVars = {name: \"this\", next: {name: \"arguments\"}};\n function pushcontext() {\n cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};\n cx.state.localVars = defaultVars;\n }\n function popcontext() {\n cx.state.localVars = cx.state.context.vars;\n cx.state.context = cx.state.context.prev;\n }\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value.length), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"{\") return cont(pushlex(\"}\"), block, poplex);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), forspec, statement, poplex);\n if (type == \"variable\") return cont(pushlex(\"stat\"), maybelabel);\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, pushlex(\"}\", \"switch\"), expect(\"{\"),\n block, poplex, poplex);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, expect(\"(\"), funarg, expect(\")\"),\n statement, poplex, popcontext);\n if (type == \"class\") return cont(pushlex(\"form\"), className, poplex);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"module\") return cont(pushlex(\"form\"), pattern, pushlex(\"}\"), expect(\"{\"), block, poplex, poplex)\n if (type == \"type\") return cont(typeexpr, expect(\"operator\"), typeexpr, expect(\";\"));\n if (type == \"async\") return cont(statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function expression(type) {\n return expressionInner(type, false);\n }\n function expressionNoComma(type) {\n return expressionInner(type, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), expression, expect(\")\"), poplex)\n }\n function expressionInner(type, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(pattern, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\") return cont(pushlex(\"form\"), classExpression, poplex);\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? maybeexpressionNoComma : maybeexpression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n function maybeexpressionNoComma(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expressionNoComma);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(expression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value)) return cont(me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(expression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (type == \"modifier\") {\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expression);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function typeexpr(type) {\n if (type == \"variable\") {cx.marked = \"variable-3\"; return cont(afterType);}\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"{\") return cont(pushlex(\"}\"), commasep(typeprop, \"}\", \",;\"), poplex)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType)\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n }\n }\n function typearg(type) {\n if (type == \"variable\") return cont(typearg)\n else if (type == \":\") return cont(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\") return cont(typeexpr)\n if (type == \"[\") return cont(expect(\"]\"), afterType)\n }\n function vardef() {\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (type == \"modifier\") return cont(pattern)\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(pattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type) {\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, expect(\")\"), poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, expect(\";\"), forspec2);\n if (type == \";\") return cont(forspec2);\n if (type == \"variable\") return cont(formaybeinof);\n return pass(expression, expect(\";\"), forspec2);\n }\n function formaybeinof(_type, value) {\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression); }\n return cont(maybeoperatorComma, forspec2);\n }\n function forspec2(type, value) {\n if (type == \";\") return cont(forspec3);\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression); }\n return pass(expression, expect(\";\"), forspec3);\n }\n function forspec3(type) {\n if (type != \")\") cont(expression);\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, maybetype, statement, popcontext);\n }\n function funarg(type) {\n if (type == \"spread\") return cont(funarg);\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"extends\" || value == \"implements\") return cont(isTS ? typeexpr : expression, classNameAfter);\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n if ((value == \"static\" || value == \"get\" || value == \"set\" ||\n (isTS && (value == \"public\" || value == \"private\" || value == \"protected\" || value == \"readonly\" || value == \"abstract\"))) &&\n cx.stream.match(/^\\s+[\\w$\\xa1-\\uffff]/, false)) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n cx.marked = \"property\";\n return cont(isTS ? classfield : functiondef, classBody);\n }\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \";\") return cont(classBody);\n if (type == \"}\") return cont();\n }\n function classfield(type, value) {\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n return pass(functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && {vars: parserConfig.localVars},\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n skipExpression: function(state) {\n var top = state.cc[state.cc.length - 1]\n if (top == expression || top == expressionNoComma) state.cc.pop()\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"application/x-json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"application/ld+json\", {name: \"javascript\", jsonld: true});\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/mode/javascript/javascript.js?");
  523. /***/ }),
  524. /***/ "./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/index.js!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css":
  525. /*!***************************************************************************************************************************************************************!*\
  526. !*** ./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css ***!
  527. \***************************************************************************************************************************************************************/
  528. /*! no static exports found */
  529. /***/ (function(module, exports, __webpack_require__) {
  530. eval("exports = module.exports = __webpack_require__(/*! ../../../../../css-loader@0.28.11/node_modules/css-loader/lib/css-base.js */ \"./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \".CodeMirror-hints {\\n position: absolute;\\n z-index: 10;\\n overflow: hidden;\\n list-style: none;\\n\\n margin: 0;\\n padding: 2px;\\n\\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\\n border-radius: 3px;\\n border: 1px solid silver;\\n\\n background: white;\\n font-size: 90%;\\n font-family: monospace;\\n\\n max-height: 20em;\\n overflow-y: auto;\\n}\\n\\n.CodeMirror-hint {\\n margin: 0;\\n padding: 0 4px;\\n border-radius: 2px;\\n white-space: pre;\\n color: black;\\n cursor: pointer;\\n}\\n\\nli.CodeMirror-hint-active {\\n background: #08f;\\n color: white;\\n}\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/hint/show-hint.css?./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader");
  531. /***/ }),
  532. /***/ "./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/index.js!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css":
  533. /*!**********************************************************************************************************************************************************!*\
  534. !*** ./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css ***!
  535. \**********************************************************************************************************************************************************/
  536. /*! no static exports found */
  537. /***/ (function(module, exports, __webpack_require__) {
  538. eval("exports = module.exports = __webpack_require__(/*! ../../../../../css-loader@0.28.11/node_modules/css-loader/lib/css-base.js */ \"./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \"/* The lint marker gutter */\\n.CodeMirror-lint-markers {\\n width: 16px;\\n}\\n\\n.CodeMirror-lint-tooltip {\\n background-color: #ffd;\\n border: 1px solid black;\\n border-radius: 4px 4px 4px 4px;\\n color: black;\\n font-family: monospace;\\n font-size: 10pt;\\n overflow: hidden;\\n padding: 2px 5px;\\n position: fixed;\\n white-space: pre;\\n white-space: pre-wrap;\\n z-index: 100;\\n max-width: 600px;\\n opacity: 0;\\n transition: opacity .4s;\\n -moz-transition: opacity .4s;\\n -webkit-transition: opacity .4s;\\n -o-transition: opacity .4s;\\n -ms-transition: opacity .4s;\\n}\\n\\n.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {\\n background-position: left bottom;\\n background-repeat: repeat-x;\\n}\\n\\n.CodeMirror-lint-mark-error {\\n background-image:\\n url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\\\")\\n ;\\n}\\n\\n.CodeMirror-lint-mark-warning {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\\\");\\n}\\n\\n.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {\\n background-position: center center;\\n background-repeat: no-repeat;\\n cursor: pointer;\\n display: inline-block;\\n height: 16px;\\n width: 16px;\\n vertical-align: middle;\\n position: relative;\\n}\\n\\n.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {\\n padding-left: 18px;\\n background-position: top left;\\n background-repeat: no-repeat;\\n}\\n\\n.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\\\");\\n}\\n\\n.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\\\");\\n}\\n\\n.CodeMirror-lint-marker-multiple {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\\\");\\n background-repeat: no-repeat;\\n background-position: right bottom;\\n width: 100%; height: 100%;\\n}\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/addon/lint/lint.css?./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader");
  539. /***/ }),
  540. /***/ "./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/index.js!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css":
  541. /*!*********************************************************************************************************************************************************!*\
  542. !*** ./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader!./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css ***!
  543. \*********************************************************************************************************************************************************/
  544. /*! no static exports found */
  545. /***/ (function(module, exports, __webpack_require__) {
  546. eval("exports = module.exports = __webpack_require__(/*! ../../../../css-loader@0.28.11/node_modules/css-loader/lib/css-base.js */ \"./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \"/* BASICS */\\n\\n.CodeMirror {\\n /* Set height, width, borders, and global font properties here */\\n font-family: monospace;\\n height: 300px;\\n color: black;\\n}\\n\\n/* PADDING */\\n\\n.CodeMirror-lines {\\n padding: 4px 0; /* Vertical padding around content */\\n}\\n.CodeMirror pre {\\n padding: 0 4px; /* Horizontal padding of content */\\n}\\n\\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n background-color: white; /* The little square between H and V scrollbars */\\n}\\n\\n/* GUTTER */\\n\\n.CodeMirror-gutters {\\n border-right: 1px solid #ddd;\\n background-color: #f7f7f7;\\n white-space: nowrap;\\n}\\n.CodeMirror-linenumbers {}\\n.CodeMirror-linenumber {\\n padding: 0 3px 0 5px;\\n min-width: 20px;\\n text-align: right;\\n color: #999;\\n white-space: nowrap;\\n}\\n\\n.CodeMirror-guttermarker { color: black; }\\n.CodeMirror-guttermarker-subtle { color: #999; }\\n\\n/* CURSOR */\\n\\n.CodeMirror-cursor {\\n border-left: 1px solid black;\\n border-right: none;\\n width: 0;\\n}\\n/* Shown when moving in bi-directional text */\\n.CodeMirror div.CodeMirror-secondarycursor {\\n border-left: 1px solid silver;\\n}\\n.cm-fat-cursor .CodeMirror-cursor {\\n width: auto;\\n border: 0 !important;\\n background: #7e7;\\n}\\n.cm-fat-cursor div.CodeMirror-cursors {\\n z-index: 1;\\n}\\n\\n.cm-animate-fat-cursor {\\n width: auto;\\n border: 0;\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n background-color: #7e7;\\n}\\n@-moz-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@-webkit-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n\\n/* Can style cursor different in overwrite (non-insert) mode */\\n.CodeMirror-overwrite .CodeMirror-cursor {}\\n\\n.cm-tab { display: inline-block; text-decoration: inherit; }\\n\\n.CodeMirror-rulers {\\n position: absolute;\\n left: 0; right: 0; top: -50px; bottom: -20px;\\n overflow: hidden;\\n}\\n.CodeMirror-ruler {\\n border-left: 1px solid #ccc;\\n top: 0; bottom: 0;\\n position: absolute;\\n}\\n\\n/* DEFAULT THEME */\\n\\n.cm-s-default .cm-header {color: blue;}\\n.cm-s-default .cm-quote {color: #090;}\\n.cm-negative {color: #d44;}\\n.cm-positive {color: #292;}\\n.cm-header, .cm-strong {font-weight: bold;}\\n.cm-em {font-style: italic;}\\n.cm-link {text-decoration: underline;}\\n.cm-strikethrough {text-decoration: line-through;}\\n\\n.cm-s-default .cm-keyword {color: #708;}\\n.cm-s-default .cm-atom {color: #219;}\\n.cm-s-default .cm-number {color: #164;}\\n.cm-s-default .cm-def {color: #00f;}\\n.cm-s-default .cm-variable,\\n.cm-s-default .cm-punctuation,\\n.cm-s-default .cm-property,\\n.cm-s-default .cm-operator {}\\n.cm-s-default .cm-variable-2 {color: #05a;}\\n.cm-s-default .cm-variable-3 {color: #085;}\\n.cm-s-default .cm-comment {color: #a50;}\\n.cm-s-default .cm-string {color: #a11;}\\n.cm-s-default .cm-string-2 {color: #f50;}\\n.cm-s-default .cm-meta {color: #555;}\\n.cm-s-default .cm-qualifier {color: #555;}\\n.cm-s-default .cm-builtin {color: #30a;}\\n.cm-s-default .cm-bracket {color: #997;}\\n.cm-s-default .cm-tag {color: #170;}\\n.cm-s-default .cm-attribute {color: #00c;}\\n.cm-s-default .cm-hr {color: #999;}\\n.cm-s-default .cm-link {color: #00c;}\\n\\n.cm-s-default .cm-error {color: #f00;}\\n.cm-invalidchar {color: #f00;}\\n\\n.CodeMirror-composing { border-bottom: 2px solid; }\\n\\n/* Default styles for common addons */\\n\\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}\\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\\n.CodeMirror-activeline-background {background: #e8f2ff;}\\n\\n/* STOP */\\n\\n/* The rest of this file contains styles related to the mechanics of\\n the editor. You probably shouldn't touch them. */\\n\\n.CodeMirror {\\n position: relative;\\n overflow: hidden;\\n background: white;\\n}\\n\\n.CodeMirror-scroll {\\n overflow: scroll !important; /* Things will break if this is overridden */\\n /* 30px is the magic margin used to hide the element's real scrollbars */\\n /* See overflow: hidden in .CodeMirror */\\n margin-bottom: -30px; margin-right: -30px;\\n padding-bottom: 30px;\\n height: 100%;\\n outline: none; /* Prevent dragging from highlighting the element */\\n position: relative;\\n}\\n.CodeMirror-sizer {\\n position: relative;\\n border-right: 30px solid transparent;\\n}\\n\\n/* The fake, visible scrollbars. Used to force redraw during scrolling\\n before actual scrolling happens, thus preventing shaking and\\n flickering artifacts. */\\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n position: absolute;\\n z-index: 6;\\n display: none;\\n}\\n.CodeMirror-vscrollbar {\\n right: 0; top: 0;\\n overflow-x: hidden;\\n overflow-y: scroll;\\n}\\n.CodeMirror-hscrollbar {\\n bottom: 0; left: 0;\\n overflow-y: hidden;\\n overflow-x: scroll;\\n}\\n.CodeMirror-scrollbar-filler {\\n right: 0; bottom: 0;\\n}\\n.CodeMirror-gutter-filler {\\n left: 0; bottom: 0;\\n}\\n\\n.CodeMirror-gutters {\\n position: absolute; left: 0; top: 0;\\n min-height: 100%;\\n z-index: 3;\\n}\\n.CodeMirror-gutter {\\n white-space: normal;\\n height: 100%;\\n display: inline-block;\\n vertical-align: top;\\n margin-bottom: -30px;\\n}\\n.CodeMirror-gutter-wrapper {\\n position: absolute;\\n z-index: 4;\\n background: none !important;\\n border: none !important;\\n}\\n.CodeMirror-gutter-background {\\n position: absolute;\\n top: 0; bottom: 0;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-elt {\\n position: absolute;\\n cursor: default;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-wrapper {\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n}\\n\\n.CodeMirror-lines {\\n cursor: text;\\n min-height: 1px; /* prevents collapsing before first draw */\\n}\\n.CodeMirror pre {\\n /* Reset some styles that the rest of the page might have set */\\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\\n border-width: 0;\\n background: transparent;\\n font-family: inherit;\\n font-size: inherit;\\n margin: 0;\\n white-space: pre;\\n word-wrap: normal;\\n line-height: inherit;\\n color: inherit;\\n z-index: 2;\\n position: relative;\\n overflow: visible;\\n -webkit-tap-highlight-color: transparent;\\n -webkit-font-variant-ligatures: contextual;\\n font-variant-ligatures: contextual;\\n}\\n.CodeMirror-wrap pre {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: normal;\\n}\\n\\n.CodeMirror-linebackground {\\n position: absolute;\\n left: 0; right: 0; top: 0; bottom: 0;\\n z-index: 0;\\n}\\n\\n.CodeMirror-linewidget {\\n position: relative;\\n z-index: 2;\\n overflow: auto;\\n}\\n\\n.CodeMirror-widget {}\\n\\n.CodeMirror-code {\\n outline: none;\\n}\\n\\n/* Force content-box sizing for the elements where we expect it */\\n.CodeMirror-scroll,\\n.CodeMirror-sizer,\\n.CodeMirror-gutter,\\n.CodeMirror-gutters,\\n.CodeMirror-linenumber {\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\n.CodeMirror-measure {\\n position: absolute;\\n width: 100%;\\n height: 0;\\n overflow: hidden;\\n visibility: hidden;\\n}\\n\\n.CodeMirror-cursor {\\n position: absolute;\\n pointer-events: none;\\n}\\n.CodeMirror-measure pre { position: static; }\\n\\ndiv.CodeMirror-cursors {\\n visibility: hidden;\\n position: relative;\\n z-index: 3;\\n}\\ndiv.CodeMirror-dragcursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-focused div.CodeMirror-cursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-selected { background: #d9d9d9; }\\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\\n.CodeMirror-crosshair { cursor: crosshair; }\\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\\n\\n.cm-searching {\\n background: #ffa;\\n background: rgba(255, 255, 0, .4);\\n}\\n\\n/* Used to force a border model for a node */\\n.cm-force-border { padding-right: .1px; }\\n\\n@media print {\\n /* Hide the cursor when printing */\\n .CodeMirror div.CodeMirror-cursors {\\n visibility: hidden;\\n }\\n}\\n\\n/* See issue #2901 */\\n.cm-tab-wrap-hack:after { content: ''; }\\n\\n/* Help users use markselection to safely style text background */\\nspan.CodeMirror-selectedtext { background: none; }\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack:///./node_modules/.pnpm/codemirror@5.23.0/node_modules/codemirror/lib/codemirror.css?./node_modules/.pnpm/css-loader@0.28.11/node_modules/css-loader");
  547. /***/ }),
  548. /***/ "./node_modules/.pnpm/handsontable@0.32.0/node_modules/handsontable/dist/handsontable.js":
  549. /*!***********************************************************************************************!*\
  550. !*** ./node_modules/.pnpm/handsontable@0.32.0/node_modules/handsontable/dist/handsontable.js ***!
  551. \***********************************************************************************************/
  552. /*! no static exports found */
  553. /***/ (function(module, exports, __webpack_require__) {
  554. eval("/*!\n * (The MIT License)\n * \n * Copyright (c) 2012-2014 Marcin Warpechowski\n * Copyright (c) 2015 Handsoncode sp. z o.o. <hello@handsoncode.net>\n * \n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * 'Software'), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n * \n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * \n * Version: 0.32.0\n * Date: Tue May 30 2017 12:18:32 GMT+0200 (CEST)\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! moment */ \"./node_modules/.pnpm/moment@2.13.0/node_modules/moment/moment.js\"), __webpack_require__(/*! numbro */ \"./node_modules/.pnpm/numbro@1.11.0/node_modules/numbro/numbro.js\"), __webpack_require__(/*! pikaday */ \"./node_modules/.pnpm/pikaday@1.4.0/node_modules/pikaday/pikaday.js\"), __webpack_require__(/*! zeroclipboard */ \"./node_modules/.pnpm/zeroclipboard@2.3.0/node_modules/zeroclipboard/dist/ZeroClipboard.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_62__, __WEBPACK_EXTERNAL_MODULE_86__, __WEBPACK_EXTERNAL_MODULE_299__, __WEBPACK_EXTERNAL_MODULE_300__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 209);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.HTML_CHARACTERS = undefined;\nexports.getParent = getParent;\nexports.closest = closest;\nexports.closestDown = closestDown;\nexports.isChildOf = isChildOf;\nexports.isChildOfWebComponentTable = isChildOfWebComponentTable;\nexports.polymerWrap = polymerWrap;\nexports.polymerUnwrap = polymerUnwrap;\nexports.index = index;\nexports.overlayContainsElement = overlayContainsElement;\nexports.hasClass = hasClass;\nexports.addClass = addClass;\nexports.removeClass = removeClass;\nexports.removeTextNodes = removeTextNodes;\nexports.empty = empty;\nexports.fastInnerHTML = fastInnerHTML;\nexports.fastInnerText = fastInnerText;\nexports.isVisible = isVisible;\nexports.offset = offset;\nexports.getWindowScrollTop = getWindowScrollTop;\nexports.getWindowScrollLeft = getWindowScrollLeft;\nexports.getScrollTop = getScrollTop;\nexports.getScrollLeft = getScrollLeft;\nexports.getScrollableElement = getScrollableElement;\nexports.getTrimmingContainer = getTrimmingContainer;\nexports.getStyle = getStyle;\nexports.getComputedStyle = getComputedStyle;\nexports.outerWidth = outerWidth;\nexports.outerHeight = outerHeight;\nexports.innerHeight = innerHeight;\nexports.innerWidth = innerWidth;\nexports.addEvent = addEvent;\nexports.removeEvent = removeEvent;\nexports.getCaretPosition = getCaretPosition;\nexports.getSelectionEndPosition = getSelectionEndPosition;\nexports.getSelectionText = getSelectionText;\nexports.setCaretPosition = setCaretPosition;\nexports.getScrollbarWidth = getScrollbarWidth;\nexports.hasVerticalScrollbar = hasVerticalScrollbar;\nexports.hasHorizontalScrollbar = hasHorizontalScrollbar;\nexports.setOverlayPosition = setOverlayPosition;\nexports.getCssTransform = getCssTransform;\nexports.resetCssTransform = resetCssTransform;\nexports.isInput = isInput;\nexports.isOutsideInput = isOutsideInput;\n\nvar _browser = __webpack_require__(25);\n\nvar _feature = __webpack_require__(34);\n\n/**\n * Get the parent of the specified node in the DOM tree.\n *\n * @param {HTMLElement} element Element from which traversing is started.\n * @param {Number} [level=0] Traversing deep level.\n * @return {HTMLElement|null}\n */\nfunction getParent(element) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var iteration = -1;\n var parent = null;\n\n while (element != null) {\n if (iteration === level) {\n parent = element;\n break;\n }\n\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n } else {\n iteration++;\n element = element.parentNode;\n }\n }\n\n return parent;\n}\n\n/**\n * Goes up the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.\n * This method goes up through web components.\n *\n * @param {HTMLElement} element Element from which traversing is started\n * @param {Array} nodes Array of elements or Array of elements name\n * @param {HTMLElement} [until]\n * @returns {HTMLElement|null}\n */\nfunction closest(element, nodes, until) {\n while (element != null && element !== until) {\n if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) {\n return element;\n }\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n } else {\n element = element.parentNode;\n }\n }\n\n return null;\n}\n\n/**\n * Goes \"down\" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.\n *\n * @param {HTMLElement} element Element from which traversing is started\n * @param {Array} nodes Array of elements or Array of elements name\n * @param {HTMLElement} [until]\n * @returns {HTMLElement|null}\n */\nfunction closestDown(element, nodes, until) {\n var matched = [];\n\n while (element) {\n element = closest(element, nodes, until);\n\n if (!element || until && !until.contains(element)) {\n break;\n }\n matched.push(element);\n\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n } else {\n element = element.parentNode;\n }\n }\n var length = matched.length;\n\n return length ? matched[length - 1] : null;\n}\n\n/**\n * Goes up the DOM tree and checks if element is child of another element.\n *\n * @param child Child element\n * @param {Object|String} parent Parent element OR selector of the parent element.\n * If string provided, function returns `true` for the first occurrence of element with that class.\n * @returns {Boolean}\n */\nfunction isChildOf(child, parent) {\n var node = child.parentNode;\n var queriedParents = [];\n\n if (typeof parent === 'string') {\n queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0);\n } else {\n queriedParents.push(parent);\n }\n\n while (node != null) {\n if (queriedParents.indexOf(node) > -1) {\n return true;\n }\n node = node.parentNode;\n }\n\n return false;\n}\n\n/**\n * Check if an element is part of `hot-table` web component.\n *\n * @param {Element} element\n * @returns {Boolean}\n */\nfunction isChildOfWebComponentTable(element) {\n var hotTableName = 'hot-table',\n result = false,\n parentNode;\n\n parentNode = polymerWrap(element);\n\n function isHotTable(element) {\n return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase();\n }\n\n while (parentNode != null) {\n if (isHotTable(parentNode)) {\n result = true;\n break;\n } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result = isHotTable(parentNode.host);\n\n if (result) {\n break;\n }\n parentNode = parentNode.host;\n }\n parentNode = parentNode.parentNode;\n }\n\n return result;\n}\n\n/**\n * Wrap element into polymer/webcomponent container if exists\n *\n * @param element\n * @returns {*}\n */\nfunction polymerWrap(element) {\n /* global Polymer */\n return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element;\n}\n\n/**\n * Unwrap element from polymer/webcomponent container if exists\n *\n * @param element\n * @returns {*}\n */\nfunction polymerUnwrap(element) {\n /* global Polymer */\n return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element;\n}\n\n/**\n * Counts index of element within its parent\n * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true for Walkotnable\n * Otherwise would need to check for nodeType or use previousElementSibling\n *\n * @see http://jsperf.com/sibling-index/10\n * @param {Element} element\n * @return {Number}\n */\nfunction index(element) {\n var i = 0;\n\n if (element.previousSibling) {\n /* eslint-disable no-cond-assign */\n while (element = element.previousSibling) {\n ++i;\n }\n }\n\n return i;\n}\n\n/**\n * Check if the provided overlay contains the provided element\n *\n * @param {String} overlay\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nfunction overlayContainsElement(overlayType, element) {\n var overlayElement = document.querySelector('.ht_clone_' + overlayType);\n return overlayElement ? overlayElement.contains(element) : null;\n}\n\nvar classListSupport = !!document.documentElement.classList;\nvar _hasClass, _addClass, _removeClass;\n\nfunction filterEmptyClassNames(classNames) {\n var len = 0,\n result = [];\n\n if (!classNames || !classNames.length) {\n return result;\n }\n while (classNames[len]) {\n result.push(classNames[len]);\n len++;\n }\n\n return result;\n}\n\nif (classListSupport) {\n var isSupportMultipleClassesArg = function () {\n var element = document.createElement('div');\n\n element.classList.add('test', 'test2');\n\n return element.classList.contains('test2');\n }();\n\n _hasClass = function _hasClass(element, className) {\n if (className === '') {\n return false;\n }\n\n return element.classList.contains(className);\n };\n\n _addClass = function _addClass(element, className) {\n var len = 0;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n className = filterEmptyClassNames(className);\n\n if (isSupportMultipleClassesArg) {\n element.classList.add.apply(element.classList, className);\n } else {\n while (className && className[len]) {\n element.classList.add(className[len]);\n len++;\n }\n }\n };\n\n _removeClass = function _removeClass(element, className) {\n var len = 0;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n className = filterEmptyClassNames(className);\n\n if (isSupportMultipleClassesArg) {\n element.classList.remove.apply(element.classList, className);\n } else {\n while (className && className[len]) {\n element.classList.remove(className[len]);\n len++;\n }\n }\n };\n} else {\n var createClassNameRegExp = function createClassNameRegExp(className) {\n return new RegExp('(\\\\s|^)' + className + '(\\\\s|$)');\n };\n\n _hasClass = function _hasClass(element, className) {\n // http://snipplr.com/view/3561/addclass-removeclass-hasclass/\n return !!element.className.match(createClassNameRegExp(className));\n };\n\n _addClass = function _addClass(element, className) {\n var len = 0,\n _className = element.className;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n if (_className === '') {\n _className = className.join(' ');\n } else {\n while (className && className[len]) {\n if (!createClassNameRegExp(className[len]).test(_className)) {\n _className += ' ' + className[len];\n }\n len++;\n }\n }\n element.className = _className;\n };\n\n _removeClass = function _removeClass(element, className) {\n var len = 0,\n _className = element.className;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n while (className && className[len]) {\n // String.prototype.trim is defined in polyfill.js\n _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();\n len++;\n }\n if (element.className !== _className) {\n element.className = _className;\n }\n };\n}\n\n/**\n * Checks if element has class name\n *\n * @param {HTMLElement} element\n * @param {String} className Class name to check\n * @returns {Boolean}\n */\nfunction hasClass(element, className) {\n return _hasClass(element, className);\n}\n\n/**\n * Add class name to an element\n *\n * @param {HTMLElement} element\n * @param {String|Array} className Class name as string or array of strings\n */\nfunction addClass(element, className) {\n return _addClass(element, className);\n}\n\n/**\n * Remove class name from an element\n *\n * @param {HTMLElement} element\n * @param {String|Array} className Class name as string or array of strings\n */\nfunction removeClass(element, className) {\n return _removeClass(element, className);\n}\n\nfunction removeTextNodes(element, parent) {\n if (element.nodeType === 3) {\n parent.removeChild(element); // bye text nodes!\n } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {\n var childs = element.childNodes;\n for (var i = childs.length - 1; i >= 0; i--) {\n removeTextNodes(childs[i], element);\n }\n }\n}\n\n/**\n * Remove childs function\n * WARNING - this doesn't unload events and data attached by jQuery\n * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9\n * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method\n *\n * @param element\n * @returns {void}\n */\n//\nfunction empty(element) {\n var child;\n /* eslint-disable no-cond-assign */\n while (child = element.lastChild) {\n element.removeChild(child);\n }\n}\n\nvar HTML_CHARACTERS = exports.HTML_CHARACTERS = /(<(.*)>|&(.*);)/;\n\n/**\n * Insert content into element trying avoid innerHTML method.\n * @return {void}\n */\nfunction fastInnerHTML(element, content) {\n if (HTML_CHARACTERS.test(content)) {\n element.innerHTML = content;\n } else {\n fastInnerText(element, content);\n }\n}\n\n/**\n * Insert text content into element\n * @return {void}\n */\n\nvar textContextSupport = !!document.createTextNode('test').textContent;\n\nfunction fastInnerText(element, content) {\n var child = element.firstChild;\n\n if (child && child.nodeType === 3 && child.nextSibling === null) {\n // fast lane - replace existing text node\n\n if (textContextSupport) {\n // http://jsperf.com/replace-text-vs-reuse\n child.textContent = content;\n } else {\n // http://jsperf.com/replace-text-vs-reuse\n child.data = content;\n }\n } else {\n // slow lane - empty element and insert a text node\n empty(element);\n element.appendChild(document.createTextNode(content));\n }\n}\n\n/**\n * Returns true if element is attached to the DOM and visible, false otherwise\n * @param elem\n * @returns {boolean}\n */\nfunction isVisible(elem) {\n var next = elem;\n\n while (polymerUnwrap(next) !== document.documentElement) {\n // until <html> reached\n if (next === null) {\n // parent detached from DOM\n return false;\n } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n if (next.host) {\n // this is Web Components Shadow DOM\n // see: http://w3c.github.io/webcomponents/spec/shadow/#encapsulation\n // according to spec, should be if (next.ownerDocument !== window.document), but that doesn't work yet\n if (next.host.impl) {\n // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features disabled\n return isVisible(next.host.impl);\n } else if (next.host) {\n // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled\n return isVisible(next.host);\n }\n throw new Error('Lost in Web Components world');\n } else {\n return false; // this is a node detached from document in IE8\n }\n } else if (next.style.display === 'none') {\n return false;\n }\n next = next.parentNode;\n }\n\n return true;\n}\n\n/**\n * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.\n *\n * @param {HTMLElement} elem\n * @return {Object} Returns object with `top` and `left` props\n */\nfunction offset(elem) {\n var offsetLeft, offsetTop, lastElem, docElem, box;\n\n docElem = document.documentElement;\n\n if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {\n // fixes problem with Firefox ignoring <caption> in TABLE offset (see also export outerHeight)\n // http://jsperf.com/offset-vs-getboundingclientrect/8\n box = elem.getBoundingClientRect();\n\n return {\n top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),\n left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)\n };\n }\n offsetLeft = elem.offsetLeft;\n offsetTop = elem.offsetTop;\n lastElem = elem;\n\n /* eslint-disable no-cond-assign */\n while (elem = elem.offsetParent) {\n // from my observation, document.body always has scrollLeft/scrollTop == 0\n if (elem === document.body) {\n break;\n }\n offsetLeft += elem.offsetLeft;\n offsetTop += elem.offsetTop;\n lastElem = elem;\n }\n\n // slow - http://jsperf.com/offset-vs-getboundingclientrect/6\n if (lastElem && lastElem.style.position === 'fixed') {\n // if(lastElem !== document.body) { //faster but does gives false positive in Firefox\n offsetLeft += window.pageXOffset || docElem.scrollLeft;\n offsetTop += window.pageYOffset || docElem.scrollTop;\n }\n\n return {\n left: offsetLeft,\n top: offsetTop\n };\n}\n\n/**\n * Returns the document's scrollTop property.\n *\n * @returns {Number}\n */\nfunction getWindowScrollTop() {\n var res = window.scrollY;\n\n if (res === void 0) {\n // IE8-11\n res = document.documentElement.scrollTop;\n }\n\n return res;\n}\n\n/**\n * Returns the document's scrollLeft property.\n *\n * @returns {Number}\n */\nfunction getWindowScrollLeft() {\n var res = window.scrollX;\n\n if (res === void 0) {\n // IE8-11\n res = document.documentElement.scrollLeft;\n }\n\n return res;\n}\n\n/**\n * Returns the provided element's scrollTop property.\n *\n * @param element\n * @returns {Number}\n */\nfunction getScrollTop(element) {\n if (element === window) {\n return getWindowScrollTop();\n }\n return element.scrollTop;\n}\n\n/**\n * Returns the provided element's scrollLeft property.\n *\n * @param element\n * @returns {Number}\n */\nfunction getScrollLeft(element) {\n if (element === window) {\n return getWindowScrollLeft();\n }\n return element.scrollLeft;\n}\n\n/**\n * Returns a DOM element responsible for scrolling of the provided element.\n *\n * @param {HTMLElement} element\n * @returns {HTMLElement} Element's scrollable parent\n */\nfunction getScrollableElement(element) {\n var el = element.parentNode,\n props = ['auto', 'scroll'],\n overflow,\n overflowX,\n overflowY,\n computedStyle = '',\n computedOverflow = '',\n computedOverflowY = '',\n computedOverflowX = '';\n\n while (el && el.style && document.body !== el) {\n overflow = el.style.overflow;\n overflowX = el.style.overflowX;\n overflowY = el.style.overflowY;\n\n if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') {\n return el;\n } else if (window.getComputedStyle) {\n computedStyle = window.getComputedStyle(el);\n computedOverflow = computedStyle.getPropertyValue('overflow');\n computedOverflowY = computedStyle.getPropertyValue('overflow-y');\n computedOverflowX = computedStyle.getPropertyValue('overflow-x');\n\n if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') {\n return el;\n }\n }\n\n if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) {\n return el;\n }\n if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) {\n return el;\n }\n el = el.parentNode;\n }\n\n return window;\n}\n\n/**\n * Returns a DOM element responsible for trimming the provided element.\n *\n * @param {HTMLElement} base Base element\n * @returns {HTMLElement} Base element's trimming parent\n */\nfunction getTrimmingContainer(base) {\n var el = base.parentNode;\n\n while (el && el.style && document.body !== el) {\n if (el.style.overflow !== 'visible' && el.style.overflow !== '') {\n return el;\n } else if (window.getComputedStyle) {\n var computedStyle = window.getComputedStyle(el);\n\n if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') {\n return el;\n }\n }\n\n el = el.parentNode;\n }\n\n return window;\n}\n\n/**\n * Returns a style property for the provided element. (Be it an inline or external style).\n *\n * @param {HTMLElement} element\n * @param {String} prop Wanted property\n * @returns {String|undefined} Element's style property\n */\nfunction getStyle(element, prop) {\n /* eslint-disable */\n if (!element) {\n return;\n } else if (element === window) {\n if (prop === 'width') {\n return window.innerWidth + 'px';\n } else if (prop === 'height') {\n return window.innerHeight + 'px';\n }\n\n return;\n }\n\n var styleProp = element.style[prop],\n computedStyle;\n\n if (styleProp !== '' && styleProp !== void 0) {\n return styleProp;\n } else {\n computedStyle = getComputedStyle(element);\n\n if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {\n return computedStyle[prop];\n }\n }\n}\n\n/**\n * Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).\n *\n * @param element\n * @returns {IEElementStyle|CssStyle} Elements computed style object\n */\nfunction getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n}\n\n/**\n * Returns the element's outer width.\n *\n * @param element\n * @returns {number} Element's outer width\n */\nfunction outerWidth(element) {\n return element.offsetWidth;\n}\n\n/**\n * Returns the element's outer height\n *\n * @param elem\n * @returns {number} Element's outer height\n */\nfunction outerHeight(elem) {\n if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {\n // fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight\n // jQuery (1.10.1) still has this unsolved\n // may be better to just switch to getBoundingClientRect\n // http://bililite.com/blog/2009/03/27/finding-the-size-of-a-table/\n // http://lists.w3.org/Archives/Public/www-style/2009Oct/0089.html\n // http://bugs.jquery.com/ticket/2196\n // http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140\n return elem.offsetHeight + elem.firstChild.offsetHeight;\n }\n\n return elem.offsetHeight;\n}\n\n/**\n * Returns the element's inner height.\n *\n * @param element\n * @returns {number} Element's inner height\n */\nfunction innerHeight(element) {\n return element.clientHeight || element.innerHeight;\n}\n\n/**\n * Returns the element's inner width.\n *\n * @param element\n * @returns {number} Element's inner width\n */\nfunction innerWidth(element) {\n return element.clientWidth || element.innerWidth;\n}\n\nfunction addEvent(element, event, callback) {\n if (window.addEventListener) {\n element.addEventListener(event, callback, false);\n } else {\n element.attachEvent('on' + event, callback);\n }\n}\n\nfunction removeEvent(element, event, callback) {\n if (window.removeEventListener) {\n element.removeEventListener(event, callback, false);\n } else {\n element.detachEvent('on' + event, callback);\n }\n}\n\n/**\n * Returns caret position in text input\n *\n * @author http://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea\n * @return {Number}\n */\nfunction getCaretPosition(el) {\n if (el.selectionStart) {\n return el.selectionStart;\n } else if (document.selection) {\n // IE8\n el.focus();\n\n var r = document.selection.createRange();\n\n if (r == null) {\n return 0;\n }\n var re = el.createTextRange();\n var rc = re.duplicate();\n\n re.moveToBookmark(r.getBookmark());\n rc.setEndPoint('EndToStart', re);\n\n return rc.text.length;\n }\n\n return 0;\n}\n\n/**\n * Returns end of the selection in text input\n *\n * @return {Number}\n */\nfunction getSelectionEndPosition(el) {\n if (el.selectionEnd) {\n return el.selectionEnd;\n } else if (document.selection) {\n // IE8\n var r = document.selection.createRange();\n\n if (r == null) {\n return 0;\n }\n var re = el.createTextRange();\n\n return re.text.indexOf(r.text) + r.text.length;\n }\n\n return 0;\n}\n\n/**\n * Returns text under selection.\n *\n * @returns {String}\n */\nfunction getSelectionText() {\n var text = '';\n\n if (window.getSelection) {\n text = window.getSelection().toString();\n } else if (document.selection && document.selection.type !== 'Control') {\n text = document.selection.createRange().text;\n }\n\n return text;\n}\n\n/**\n * Sets caret position in text input.\n *\n * @author http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/\n * @param {Element} element\n * @param {Number} pos\n * @param {Number} endPos\n */\nfunction setCaretPosition(element, pos, endPos) {\n if (endPos === void 0) {\n endPos = pos;\n }\n if (element.setSelectionRange) {\n element.focus();\n\n try {\n element.setSelectionRange(pos, endPos);\n } catch (err) {\n var elementParent = element.parentNode;\n var parentDisplayValue = elementParent.style.display;\n elementParent.style.display = 'block';\n element.setSelectionRange(pos, endPos);\n elementParent.style.display = parentDisplayValue;\n }\n } else if (element.createTextRange) {\n // IE8\n var range = element.createTextRange();\n range.collapse(true);\n range.moveEnd('character', endPos);\n range.moveStart('character', pos);\n range.select();\n }\n}\n\nvar cachedScrollbarWidth;\n\n// http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\nfunction walkontableCalculateScrollbarWidth() {\n var inner = document.createElement('div');\n inner.style.height = '200px';\n inner.style.width = '100%';\n\n var outer = document.createElement('div');\n outer.style.boxSizing = 'content-box';\n outer.style.height = '150px';\n outer.style.left = '0px';\n outer.style.overflow = 'hidden';\n outer.style.position = 'absolute';\n outer.style.top = '0px';\n outer.style.width = '200px';\n outer.style.visibility = 'hidden';\n outer.appendChild(inner);\n\n (document.body || document.documentElement).appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n (document.body || document.documentElement).removeChild(outer);\n\n return w1 - w2;\n}\n\n/**\n * Returns the computed width of the native browser scroll bar.\n *\n * @return {Number} width\n */\nfunction getScrollbarWidth() {\n if (cachedScrollbarWidth === void 0) {\n cachedScrollbarWidth = walkontableCalculateScrollbarWidth();\n }\n\n return cachedScrollbarWidth;\n}\n\n/**\n * Checks if the provided element has a vertical scrollbar.\n *\n * @param {HTMLElement} element\n * @returns {Boolean}\n */\nfunction hasVerticalScrollbar(element) {\n return element.offsetWidth !== element.clientWidth;\n}\n\n/**\n * Checks if the provided element has a vertical scrollbar.\n *\n * @param {HTMLElement} element\n * @returns {Boolean}\n */\nfunction hasHorizontalScrollbar(element) {\n return element.offsetHeight !== element.clientHeight;\n}\n\n/**\n * Sets overlay position depending on it's type and used browser\n */\nfunction setOverlayPosition(overlayElem, left, top) {\n if ((0, _browser.isIE8)() || (0, _browser.isIE9)()) {\n overlayElem.style.top = top;\n overlayElem.style.left = left;\n } else if ((0, _browser.isSafari)()) {\n overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)';\n } else {\n overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)';\n }\n}\n\nfunction getCssTransform(element) {\n var transform;\n\n if (element.style.transform && (transform = element.style.transform) !== '') {\n return ['transform', transform];\n } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {\n\n return ['-webkit-transform', transform];\n }\n\n return -1;\n}\n\nfunction resetCssTransform(element) {\n if (element.style.transform && element.style.transform !== '') {\n element.style.transform = '';\n } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') {\n element.style['-webkit-transform'] = '';\n }\n}\n\n/**\n * Determines if the given DOM element is an input field.\n * Notice: By 'input' we mean input, textarea and select nodes\n *\n * @param {HTMLElement} element - DOM element\n * @returns {Boolean}\n */\nfunction isInput(element) {\n var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];\n\n return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true');\n}\n\n/**\n * Determines if the given DOM element is an input field placed OUTSIDE of HOT.\n * Notice: By 'input' we mean input, textarea and select nodes\n *\n * @param {HTMLElement} element - DOM element\n * @returns {Boolean}\n */\nfunction isOutsideInput(element) {\n return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1;\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.to2dArray = to2dArray;\nexports.extendArray = extendArray;\nexports.pivot = pivot;\nexports.arrayReduce = arrayReduce;\nexports.arrayFilter = arrayFilter;\nexports.arrayMap = arrayMap;\nexports.arrayEach = arrayEach;\nexports.arraySum = arraySum;\nexports.arrayMax = arrayMax;\nexports.arrayMin = arrayMin;\nexports.arrayAvg = arrayAvg;\nexports.arrayFlatten = arrayFlatten;\nexports.arrayUnique = arrayUnique;\nfunction to2dArray(arr) {\n var i = 0,\n ilen = arr.length;\n\n while (i < ilen) {\n arr[i] = [arr[i]];\n i++;\n }\n}\n\nfunction extendArray(arr, extension) {\n var i = 0,\n ilen = extension.length;\n\n while (i < ilen) {\n arr.push(extension[i]);\n i++;\n }\n}\n\nfunction pivot(arr) {\n var pivotedArr = [];\n\n if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) {\n return pivotedArr;\n }\n\n var rowCount = arr.length;\n var colCount = arr[0].length;\n\n for (var i = 0; i < rowCount; i++) {\n for (var j = 0; j < colCount; j++) {\n if (!pivotedArr[j]) {\n pivotedArr[j] = [];\n }\n\n pivotedArr[j][i] = arr[i][j];\n }\n }\n\n return pivotedArr;\n}\n\n/**\n * A specialized version of `.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {Boolean} [initFromArray] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initFromArray) {\n var index = -1,\n length = array.length;\n\n if (initFromArray && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n\n return accumulator;\n}\n\n/**\n * A specialized version of `.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (predicate(value, index, array)) {\n result[++resIndex] = value;\n }\n }\n\n return result;\n}\n\n/**\n * A specialized version of `.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n result[++resIndex] = iteratee(value, index, array);\n }\n\n return result;\n}\n\n/**\n * A specialized version of `.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n\n return array;\n}\n\n/**\n * Calculate sum value for each item of the array.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns calculated sum value.\n */\nfunction arraySum(array) {\n return arrayReduce(array, function (a, b) {\n return a + b;\n }, 0);\n}\n\n/**\n * Returns the highest value from an array. Can be array of numbers or array of strings.\n * NOTICE: Mixed values is not supported.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns the highest value from an array.\n */\nfunction arrayMax(array) {\n return arrayReduce(array, function (a, b) {\n return a > b ? a : b;\n }, Array.isArray(array) ? array[0] : void 0);\n}\n\n/**\n * Returns the lowest value from an array. Can be array of numbers or array of strings.\n * NOTICE: Mixed values is not supported.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns the lowest value from an array.\n */\nfunction arrayMin(array) {\n return arrayReduce(array, function (a, b) {\n return a < b ? a : b;\n }, Array.isArray(array) ? array[0] : void 0);\n}\n\n/**\n * Calculate average value for each item of the array.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns calculated average value.\n */\nfunction arrayAvg(array) {\n if (!array.length) {\n return 0;\n }\n\n return arraySum(array) / array.length;\n}\n\n/**\n * Flatten multidimensional array.\n *\n * @param {Array} array Array of Arrays\n * @returns {Array}\n */\nfunction arrayFlatten(array) {\n return arrayReduce(array, function (initial, value) {\n return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value);\n }, []);\n}\n\n/**\n * Unique values in the array.\n *\n * @param {Array} array The array to process.\n * @returns {Array}\n */\nfunction arrayUnique(array) {\n var unique = [];\n\n arrayEach(array, function (value) {\n if (unique.indexOf(value) === -1) {\n unique.push(value);\n }\n });\n\n return unique;\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.duckSchema = duckSchema;\nexports.inherit = inherit;\nexports.extend = extend;\nexports.deepExtend = deepExtend;\nexports.deepClone = deepClone;\nexports.clone = clone;\nexports.mixin = mixin;\nexports.isObjectEquals = isObjectEquals;\nexports.isObject = isObject;\nexports.defineGetter = defineGetter;\nexports.objectEach = objectEach;\nexports.getProperty = getProperty;\nexports.deepObjectSize = deepObjectSize;\nexports.createObjectPropListener = createObjectPropListener;\nexports.hasOwnProperty = hasOwnProperty;\n\nvar _array = __webpack_require__(1);\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Generate schema for passed object.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nfunction duckSchema(object) {\n var schema;\n\n if (Array.isArray(object)) {\n schema = [];\n } else {\n schema = {};\n\n objectEach(object, function (value, key) {\n if (key === '__children') {\n return;\n }\n\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !Array.isArray(value)) {\n schema[key] = duckSchema(value);\n } else if (Array.isArray(value)) {\n if (value.length && _typeof(value[0]) === 'object' && !Array.isArray(value[0])) {\n schema[key] = [duckSchema(value[0])];\n } else {\n schema[key] = [];\n }\n } else {\n schema[key] = null;\n }\n });\n }\n\n return schema;\n}\n\n/**\n * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`.\n * Creates temporary dummy function to call it as constructor.\n * Described in ticket: https://github.com/handsontable/handsontable/pull/516\n *\n * @param {Object} Child child class\n * @param {Object} Parent parent class\n * @return {Object} extended Child\n */\nfunction inherit(Child, Parent) {\n Parent.prototype.constructor = Parent;\n Child.prototype = new Parent();\n Child.prototype.constructor = Child;\n\n return Child;\n}\n\n/**\n * Perform shallow extend of a target object with extension's own properties.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\nfunction extend(target, extension) {\n objectEach(extension, function (value, key) {\n target[key] = value;\n });\n\n return target;\n}\n\n/**\n * Perform deep extend of a target object with extension's own properties.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\nfunction deepExtend(target, extension) {\n objectEach(extension, function (value, key) {\n if (extension[key] && _typeof(extension[key]) === 'object') {\n if (!target[key]) {\n if (Array.isArray(extension[key])) {\n target[key] = [];\n } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') {\n target[key] = extension[key];\n } else {\n target[key] = {};\n }\n }\n deepExtend(target[key], extension[key]);\n } else {\n target[key] = extension[key];\n }\n });\n}\n\n/**\n * Perform deep clone of an object.\n * WARNING! Only clones JSON properties. Will cause error when `obj` contains a function, Date, etc.\n *\n * @param {Object} obj An object that will be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {\n return JSON.parse(JSON.stringify(obj));\n }\n\n return obj;\n}\n\n/**\n * Shallow clone object.\n *\n * @param {Object} object\n * @returns {Object}\n */\nfunction clone(object) {\n var result = {};\n\n objectEach(object, function (value, key) {\n result[key] = value;\n });\n\n return result;\n}\n\n/**\n * Extend the Base object (usually prototype) of the functionality the `mixins` objects.\n *\n * @param {Object} Base Base object which will be extended.\n * @param {Object} mixins The object of the functionality will be \"copied\".\n * @returns {Object}\n */\nfunction mixin(Base) {\n if (!Base.MIXINS) {\n Base.MIXINS = [];\n }\n\n for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n mixins[_key - 1] = arguments[_key];\n }\n\n (0, _array.arrayEach)(mixins, function (mixin) {\n Base.MIXINS.push(mixin.MIXIN_NAME);\n\n objectEach(mixin, function (value, key) {\n if (Base.prototype[key] !== void 0) {\n throw new Error('Mixin conflict. Property \\'' + key + '\\' already exist and cannot be overwritten.');\n }\n if (typeof value === 'function') {\n Base.prototype[key] = value;\n } else {\n var getter = function _getter(propertyName, initialValue) {\n propertyName = '_' + propertyName;\n\n var initValue = function initValue(value) {\n if (Array.isArray(value) || isObject(value)) {\n value = deepClone(value);\n }\n\n return value;\n };\n\n return function () {\n if (this[propertyName] === void 0) {\n this[propertyName] = initValue(initialValue);\n }\n\n return this[propertyName];\n };\n };\n var setter = function _setter(propertyName) {\n propertyName = '_' + propertyName;\n\n return function (value) {\n this[propertyName] = value;\n };\n };\n Object.defineProperty(Base.prototype, key, {\n get: getter(key, value),\n set: setter(key),\n configurable: true\n });\n }\n });\n });\n\n return Base;\n}\n\n/**\n * Checks if two objects or arrays are (deep) equal\n *\n * @param {Object|Array} object1\n * @param {Object|Array} object2\n * @returns {Boolean}\n */\nfunction isObjectEquals(object1, object2) {\n return JSON.stringify(object1) === JSON.stringify(object2);\n}\n\n/**\n * Determines whether given object is a plain Object.\n * Note: String and Array are not plain Objects\n * @param {*} obj\n * @returns {boolean}\n */\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) == '[object Object]';\n}\n\nfunction defineGetter(object, property, value, options) {\n options.value = value;\n options.writable = options.writable !== false;\n options.enumerable = options.enumerable !== false;\n options.configurable = options.configurable !== false;\n\n Object.defineProperty(object, property, options);\n}\n\n/**\n * A specialized version of `.forEach` for objects.\n *\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction objectEach(object, iteratee) {\n for (var key in object) {\n if (!object.hasOwnProperty || object.hasOwnProperty && Object.prototype.hasOwnProperty.call(object, key)) {\n if (iteratee(object[key], key, object) === false) {\n break;\n }\n }\n }\n\n return object;\n}\n\n/**\n * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`).\n *\n * @param {Object} object Object which value will be exported.\n * @param {String} name Object property name.\n * @returns {*}\n */\nfunction getProperty(object, name) {\n var names = name.split('.');\n var result = object;\n\n objectEach(names, function (name) {\n result = result[name];\n\n if (result === void 0) {\n result = void 0;\n\n return false;\n }\n });\n\n return result;\n}\n\n/**\n * Return object length (recursively).\n *\n * @param {*} object Object for which we want get length.\n * @returns {Number}\n */\nfunction deepObjectSize(object) {\n if (!isObject(object)) {\n return 0;\n }\n var recursObjLen = function recursObjLen(obj) {\n var result = 0;\n\n if (isObject(obj)) {\n objectEach(obj, function (key) {\n result += recursObjLen(key);\n });\n } else {\n result++;\n }\n\n return result;\n };\n\n return recursObjLen(object);\n}\n\n/**\n * Create object with property where its value change will be observed.\n *\n * @param {*} [defaultValue=undefined] Default value.\n * @param {String} [propertyToListen='value'] Property to listen.\n * @returns {Object}\n */\nfunction createObjectPropListener(defaultValue) {\n var _holder;\n\n var propertyToListen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';\n\n var privateProperty = '_' + propertyToListen;\n var holder = (_holder = {\n _touched: false\n }, _defineProperty(_holder, privateProperty, defaultValue), _defineProperty(_holder, 'isTouched', function isTouched() {\n return this._touched;\n }), _holder);\n\n Object.defineProperty(holder, propertyToListen, {\n get: function get() {\n return this[privateProperty];\n },\n set: function set(value) {\n this._touched = true;\n this[privateProperty] = value;\n },\n\n enumerable: true,\n configurable: true\n });\n\n return holder;\n}\n\n/**\n * Check if at specified `key` there is any value for `object`.\n *\n * @param {Object} object Object to search value at specyfic key.\n * @param {String} key String key to check.\n */\nfunction hasOwnProperty(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , core = __webpack_require__(44)\n , hide = __webpack_require__(32)\n , redefine = __webpack_require__(33)\n , ctx = __webpack_require__(29)\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // import Core from './core';\n\n\nexports.getListenersCounter = getListenersCounter;\n\nvar _element = __webpack_require__(0);\n\nvar _feature = __webpack_require__(34);\n\nvar _event = __webpack_require__(7);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Counter which tracks unregistered listeners (useful for detecting memory leaks).\n *\n * @type {Number}\n */\nvar listenersCounter = 0;\n\n/**\n * Event DOM manager for internal use in Handsontable.\n *\n * @class EventManager\n * @util\n */\n\nvar EventManager = function () {\n /**\n * @param {Object} [context=null]\n * @private\n */\n function EventManager() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _classCallCheck(this, EventManager);\n\n this.context = context || this;\n\n if (!this.context.eventListeners) {\n this.context.eventListeners = [];\n }\n }\n\n /**\n * Register specified listener (`eventName`) to the element.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n * @param {Function} callback Function which will be called after event occur.\n * @returns {Function} Returns function which you can easily call to remove that event\n */\n\n\n _createClass(EventManager, [{\n key: 'addEventListener',\n value: function addEventListener(element, eventName, callback) {\n var _this = this;\n\n var context = this.context;\n\n function callbackProxy(event) {\n event = extendEvent(context, event);\n\n callback.call(this, event);\n }\n this.context.eventListeners.push({\n element: element,\n event: eventName,\n callback: callback,\n callbackProxy: callbackProxy\n });\n\n if (window.addEventListener) {\n element.addEventListener(eventName, callbackProxy, false);\n } else {\n element.attachEvent('on' + eventName, callbackProxy);\n }\n listenersCounter++;\n\n return function () {\n _this.removeEventListener(element, eventName, callback);\n };\n }\n\n /**\n * Remove the event listener previously registered.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n * @param {Function} callback Function to remove from the event target. It must be the same as during registration listener.\n */\n\n }, {\n key: 'removeEventListener',\n value: function removeEventListener(element, eventName, callback) {\n var len = this.context.eventListeners.length;\n var tmpEvent = void 0;\n\n while (len--) {\n tmpEvent = this.context.eventListeners[len];\n\n if (tmpEvent.event == eventName && tmpEvent.element == element) {\n if (callback && callback != tmpEvent.callback) {\n /* eslint-disable no-continue */\n continue;\n }\n this.context.eventListeners.splice(len, 1);\n\n if (tmpEvent.element.removeEventListener) {\n tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false);\n } else {\n tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy);\n }\n listenersCounter--;\n }\n }\n }\n\n /**\n * Clear all previously registered events.\n *\n * @private\n * @since 0.15.0-beta3\n */\n\n }, {\n key: 'clearEvents',\n value: function clearEvents() {\n if (!this.context) {\n return;\n }\n var len = this.context.eventListeners.length;\n\n while (len--) {\n var event = this.context.eventListeners[len];\n\n if (event) {\n this.removeEventListener(event.element, event.event, event.callback);\n }\n }\n }\n\n /**\n * Clear all previously registered events.\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n this.clearEvents();\n }\n\n /**\n * Destroy instance of EventManager.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.clearEvents();\n this.context = null;\n }\n\n /**\n * Trigger event at the specified target element.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n */\n\n }, {\n key: 'fireEvent',\n value: function fireEvent(element, eventName) {\n var options = {\n bubbles: true,\n cancelable: eventName !== 'mousemove',\n view: window,\n detail: 0,\n screenX: 0,\n screenY: 0,\n clientX: 1,\n clientY: 1,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: undefined\n };\n var event;\n\n if (document.createEvent) {\n event = document.createEvent('MouseEvents');\n 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);\n } else {\n event = document.createEventObject();\n }\n\n if (element.dispatchEvent) {\n element.dispatchEvent(event);\n } else {\n element.fireEvent('on' + eventName, event);\n }\n }\n }]);\n\n return EventManager;\n}();\n\n/**\n * @param {Object} context\n * @param {Event} event\n * @private\n * @returns {*}\n */\n\n\nfunction extendEvent(context, event) {\n var componentName = 'HOT-TABLE';\n var isHotTableSpotted = void 0;\n var fromElement = void 0;\n var realTarget = void 0;\n var target = void 0;\n var len = void 0;\n var nativeStopImmediatePropagation = void 0;\n\n event.isTargetWebComponent = false;\n event.realTarget = event.target;\n\n nativeStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function () {\n nativeStopImmediatePropagation.apply(this);\n (0, _event.stopImmediatePropagation)(this);\n };\n\n if (!EventManager.isHotTableEnv) {\n return event;\n }\n event = (0, _element.polymerWrap)(event);\n len = event.path ? event.path.length : 0;\n\n while (len--) {\n if (event.path[len].nodeName === componentName) {\n isHotTableSpotted = true;\n } else if (isHotTableSpotted && event.path[len].shadowRoot) {\n target = event.path[len];\n\n break;\n }\n if (len === 0 && !target) {\n target = event.path[len];\n }\n }\n if (!target) {\n target = event.target;\n }\n event.isTargetWebComponent = true;\n\n if ((0, _feature.isWebComponentSupportedNatively)()) {\n event.realTarget = event.srcElement || event.toElement;\n } else if (context instanceof Core || context instanceof Walkontable) {\n // Polymer doesn't support `event.target` property properly we must emulate it ourselves\n if (context instanceof Core) {\n fromElement = context.view ? context.view.wt.wtTable.TABLE : null;\n } else if (context instanceof Walkontable) {\n // .wtHider\n fromElement = context.wtTable.TABLE.parentNode.parentNode;\n }\n realTarget = (0, _element.closest)(event.target, [componentName], fromElement);\n\n if (realTarget) {\n event.realTarget = fromElement.querySelector(componentName) || event.target;\n } else {\n event.realTarget = event.target;\n }\n }\n\n Object.defineProperty(event, 'target', {\n get: function get() {\n return (0, _element.polymerWrap)(target);\n },\n\n enumerable: true,\n configurable: true\n });\n\n return event;\n}\n\nexports.default = EventManager;\nfunction getListenersCounter() {\n return listenersCounter;\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getPluginName = exports.getRegistredPluginNames = exports.getPlugin = exports.registerPlugin = undefined;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _object = __webpack_require__(2);\n\nvar _string = __webpack_require__(27);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar registeredPlugins = new WeakMap();\n\n/**\n * Registers plugin under given name\n *\n * @param {String} pluginName\n * @param {Function} PluginClass\n */\n/**\n * Utility to register plugins and common namespace for keeping reference to all plugins classes\n */\nfunction registerPlugin(pluginName, PluginClass) {\n pluginName = (0, _string.toUpperCaseFirst)(pluginName);\n\n _pluginHooks2.default.getSingleton().add('construct', function () {\n var holder = void 0;\n\n if (!registeredPlugins.has(this)) {\n registeredPlugins.set(this, {});\n }\n holder = registeredPlugins.get(this);\n\n if (!holder[pluginName]) {\n holder[pluginName] = new PluginClass(this);\n }\n });\n _pluginHooks2.default.getSingleton().add('afterDestroy', function () {\n if (registeredPlugins.has(this)) {\n var pluginsHolder = registeredPlugins.get(this);\n\n (0, _object.objectEach)(pluginsHolder, function (plugin) {\n return plugin.destroy();\n });\n registeredPlugins.delete(this);\n }\n });\n}\n\n/**\n * @param {Object} instance\n * @param {String|Function} pluginName\n * @returns {Function} pluginClass Returns plugin instance if exists or `undefined` if not exists.\n */\nfunction getPlugin(instance, pluginName) {\n if (typeof pluginName != 'string') {\n throw Error('Only strings can be passed as \"plugin\" parameter');\n }\n var _pluginName = (0, _string.toUpperCaseFirst)(pluginName);\n\n if (!registeredPlugins.has(instance) || !registeredPlugins.get(instance)[_pluginName]) {\n return void 0;\n }\n\n return registeredPlugins.get(instance)[_pluginName];\n}\n\n/**\n * Get all registred plugins names for concrete Handsontable instance.\n *\n * @param {Object} hotInstance\n * @returns {Array}\n */\nfunction getRegistredPluginNames(hotInstance) {\n return registeredPlugins.has(hotInstance) ? Object.keys(registeredPlugins.get(hotInstance)) : [];\n}\n\n/**\n * Get plugin name.\n *\n * @param {Object} hotInstance\n * @param {Object} plugin\n * @returns {String|null}\n */\nfunction getPluginName(hotInstance, plugin) {\n var pluginName = null;\n\n if (registeredPlugins.has(hotInstance)) {\n (0, _object.objectEach)(registeredPlugins.get(hotInstance), function (pluginInstance, name) {\n if (pluginInstance === plugin) {\n pluginName = name;\n }\n });\n }\n\n return pluginName;\n}\n\nexports.registerPlugin = registerPlugin;\nexports.getPlugin = getPlugin;\nexports.getRegistredPluginNames = getRegistredPluginNames;\nexports.getPluginName = getPluginName;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.isNumeric = isNumeric;\nexports.rangeEach = rangeEach;\nexports.rangeEachReverse = rangeEachReverse;\nexports.valueAccordingPercent = valueAccordingPercent;\n/**\n * Checks if value of n is a numeric one\n * http://jsperf.com/isnan-vs-isnumeric/4\n * @param n\n * @returns {boolean}\n */\nfunction isNumeric(n) {\n /* eslint-disable */\n var t = typeof n === 'undefined' ? 'undefined' : _typeof(n);\n\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;\n}\n\n/**\n * A specialized version of `.forEach` defined by ranges.\n *\n * @param {Number} rangeFrom The number from start iterate.\n * @param {Number|Function} rangeTo The number where finish iterate or function as a iteratee.\n * @param {Function} [iteratee] The function invoked per iteration.\n */\nfunction rangeEach(rangeFrom, rangeTo, iteratee) {\n var index = -1;\n\n if (typeof rangeTo === 'function') {\n iteratee = rangeTo;\n rangeTo = rangeFrom;\n } else {\n index = rangeFrom - 1;\n }\n while (++index <= rangeTo) {\n if (iteratee(index) === false) {\n break;\n }\n }\n}\n\n/**\n * A specialized version of `.forEach` defined by ranges iterable in reverse order.\n *\n * @param {Number} rangeFrom The number from start iterate.\n * @param {Number} rangeTo The number where finish iterate.\n * @param {Function} iteratee The function invoked per iteration.\n */\nfunction rangeEachReverse(rangeFrom, rangeTo, iteratee) {\n var index = rangeFrom + 1;\n\n if (typeof rangeTo === 'function') {\n iteratee = rangeTo;\n rangeTo = 0;\n }\n while (--index >= rangeTo) {\n if (iteratee(index) === false) {\n break;\n }\n }\n}\n\n/**\n * Calculate value from percent.\n *\n * @param {Number} value Base value from percent will be calculated.\n * @param {String|Number} percent Can be Number or String (eq. `'33%'`).\n * @returns {Number}\n */\nfunction valueAccordingPercent(value, percent) {\n percent = parseInt(percent.toString().replace('%', ''), 10);\n percent = parseInt(value * percent / 100, 10);\n\n return percent;\n}\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.stopImmediatePropagation = stopImmediatePropagation;\nexports.isImmediatePropagationStopped = isImmediatePropagationStopped;\nexports.stopPropagation = stopPropagation;\nexports.pageX = pageX;\nexports.pageY = pageY;\nexports.isRightClick = isRightClick;\nexports.isLeftClick = isLeftClick;\n\nvar _element = __webpack_require__(0);\n\n/**\n * Prevent other listeners of the same event from being called.\n *\n * @param {Event} event\n */\nfunction stopImmediatePropagation(event) {\n event.isImmediatePropagationEnabled = false;\n event.cancelBubble = true;\n}\n\n/**\n * Check if event was stopped by `stopImmediatePropagation`.\n *\n * @param event {Event}\n * @returns {Boolean}\n */\nfunction isImmediatePropagationStopped(event) {\n return event.isImmediatePropagationEnabled === false;\n}\n\n/**\n * Prevent further propagation of the current event (prevent bubbling).\n *\n * @param event {Event}\n */\nfunction stopPropagation(event) {\n // ie8\n // http://msdn.microsoft.com/en-us/library/ie/ff975462(v=vs.85).aspx\n if (typeof event.stopPropagation === 'function') {\n event.stopPropagation();\n } else {\n event.cancelBubble = true;\n }\n}\n\n/**\n * Get horizontal coordinate of the event object relative to the whole document.\n *\n * @param {Event} event\n * @returns {Number}\n */\nfunction pageX(event) {\n if (event.pageX) {\n return event.pageX;\n }\n\n return event.clientX + (0, _element.getWindowScrollLeft)();\n}\n\n/**\n * Get vertical coordinate of the event object relative to the whole document.\n *\n * @param {Event} event\n * @returns {Number}\n */\nfunction pageY(event) {\n if (event.pageY) {\n return event.pageY;\n }\n\n return event.clientY + (0, _element.getWindowScrollTop)();\n}\n\n/**\n * Check if provided event was triggered by clicking the right mouse button.\n *\n * @param {Event} event DOM Event.\n * @returns {Boolean}\n */\nfunction isRightClick(event) {\n return event.button === 2;\n}\n\n/**\n * Check if provided event was triggered by clicking the left mouse button.\n *\n * @param {Event} event DOM Event.\n * @returns {Boolean}\n */\nfunction isLeftClick(event) {\n return event.button === 0;\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @description\n * Handsontable events are the common interface that function in 2 ways: as __callbacks__ and as __hooks__.\n *\n * @example\n *\n * ```js\n * // Using events as callbacks:\n * ...\n * var hot1 = new Handsontable(document.getElementById('example1'), {\n * afterChange: function(changes, source) {\n * $.ajax({\n * url: \"save.php',\n * data: change\n * });\n * }\n * });\n * ...\n * ```\n *\n * ```js\n * // Using events as plugin hooks:\n * ...\n * var hot1 = new Handsontable(document.getElementById('example1'), {\n * myPlugin: true\n * });\n *\n * var hot2 = new Handsontable(document.getElementById('example2'), {\n * myPlugin: false\n * });\n *\n * // global hook\n * Handsontable.hooks.add('afterChange', function() {\n * // Fired twice - for hot1 and hot2\n * if (this.getSettings().myPlugin) {\n * // function body - will only run for hot1\n * }\n * });\n *\n * // local hook (has same effect as a callback)\n * hot2.addHook('afterChange', function() {\n * // function body - will only run in #example2\n * });\n * ```\n * ...\n */\n\n// @TODO: Move plugin description hooks to plugin?\nvar REGISTERED_HOOKS = [\n/**\n * Callback fired after resetting a cell's meta.\n *\n * @event Hooks#afterCellMetaReset\n * @since 0.11\n */\n'afterCellMetaReset',\n\n/**\n * @description\n * Callback fired after one or more cells has been changed. Its main use case is to save the input.\n *\n * __Note:__ For performance reasons, the `changes` array is null for `\"loadData\"` source.\n *\n * @event Hooks#afterChange\n * @param {Array} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterChange',\n\n/**\n * @description\n * Fired after observing changes.\n *\n * @event Hooks#afterChangesObserved\n */\n'afterChangesObserved',\n\n/**\n * @description\n * Fired after setting up the Context Menu's default options. These options are a collection which user can select by setting\n * an array of keys or an array of objects in `contextMenu` option.\n *\n * @event Hooks#afterContextMenuDefaultOptions\n * @param {Array} predefinedItems Array of objects containing information about the pre-defined Context Menu items.\n */\n'afterContextMenuDefaultOptions',\n\n/**\n * @description\n * Fired before setting up the Context Menu's items but after filtering these options by user (`contextMenu` option). This hook\n * can by helpful to determine if user use specified menu item or to set up one of the menu item to by always visible.\n *\n * @event Hooks#beforeContextMenuSetItems\n * @param {Array} menuItems Array of objects containing information about to generated Context Menu items.\n */\n'beforeContextMenuSetItems',\n\n/**\n * @description\n * Fired after setting up the Context Menu's default options. These options are a collection which user can select by setting\n * an array of keys or an array of objects in `contextMenu` option.\n *\n * @pro\n * @event Hooks#afterDropdownMenuDefaultOptions\n * @param {Array} predefinedItems Array of objects containing information about the pre-defined Context Menu items.\n */\n'afterDropdownMenuDefaultOptions',\n\n/**\n * @description\n * Fired before setting up the Dropdown Menu's items but after filtering these options by user (`dropdownMenu` option). This hook\n * can by helpful to determine if user use specified menu item or to set up one of the menu item to by always visible.\n *\n * @pro\n * @event Hooks#beforeDropdownMenuSetItems\n * @param {Array} menuItems Array of objects containing information about to generated Dropdown Menu items.\n */\n'beforeDropdownMenuSetItems',\n\n/**\n * @description\n * Fired after hiding the Context Menu.\n *\n * @event Hooks#afterContextMenuHide\n * @param {Object} context The Context menu instance.\n */\n'afterContextMenuHide',\n\n/**\n * @description\n * Fired after opening the Context Menu.\n *\n * @event Hooks#afterContextMenuShow\n * @param {Object} context The Context Menu instance.\n */\n'afterContextMenuShow',\n\n/**\n * @description\n * Fired after reaching the copy limit while copying data.\n *\n * @event Hooks#afterCopyLimit\n * @param {Number} selectedRows Count of selected copyable rows.\n * @param {Number} selectedColumns Count of selected copyable columns.\n * @param {Number} copyRowsLimit Current copy rows limit.\n * @param {Number} copyColumnsLimit Current copy columns limit.\n */\n'afterCopyLimit',\n\n/**\n * Callback is fired before a new column was created.\n *\n * @since 0.28.0\n * @event Hooks#beforeCreateCol\n * @param {Number} index Represents the index of first newly created column in the data source array.\n * @param {Number} amount Number of newly created columns in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeCreateCol',\n\n/**\n * Callback is fired after a new column was created.\n *\n * @event Hooks#afterCreateCol\n * @param {Number} index Represents the index of first newly created column in the data source array.\n * @param {Number} amount Number of newly created columns in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterCreateCol',\n\n/**\n * Callback is fired before a new row was created.\n *\n * @since 0.28.0\n * @event Hooks#beforeCreateRow\n * @param {Number} index Represents the index of first newly created row in the data source array.\n * @param {Number} amount Number of newly created rows in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeCreateRow',\n\n/**\n * Callback is fired after a new row was created.\n *\n * @event Hooks#afterCreateRow\n * @param {Number} index Represents the index of first newly created row in the data source array.\n * @param {Number} amount Number of newly created rows in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterCreateRow',\n\n/**\n * Fired after the current cell is deselected.\n *\n * @event Hooks#afterDeselect\n */\n'afterDeselect',\n\n/**\n * Fired after destroying the Handsontable instance.\n *\n * @event Hooks#afterDestroy\n */\n'afterDestroy',\n\n/**\n * Fired on a `keydown` event on the document body.\n *\n * @event Hooks#afterDocumentKeyDown\n * @param {Event} event A `keydown` event.\n */\n'afterDocumentKeyDown',\n\n/**\n * Callback fired after getting the cell settings.\n *\n * @event Hooks#afterGetCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} cellProperties Object containing the cell properties.\n */\n'afterGetCellMeta',\n\n/**\n * Callback fired after retrieving information about a column header and appending it to the table header.\n *\n * @event Hooks#afterGetColHeader\n * @param {Number} col Column index.\n * @param {Element} TH Header's TH element.\n */\n'afterGetColHeader',\n\n/**\n * Callback fired after retrieving information about a column header and appending it to the table header.\n *\n * @event Hooks#afterGetRowHeader\n * @param {Number} row Row index.\n * @param {Element} TH Header's TH element.\n */\n'afterGetRowHeader',\n\n/**\n * Callback fired after Handsontable instance is initiated.\n *\n * @event Hooks#afterInit\n */\n'afterInit',\n\n/**\n * Callback fired after new data is loaded (by `loadData` method) into the data source array.\n *\n * @event Hooks#afterLoadData\n * @param {Boolean} firstTime flag that determines whether the data has been loaded during the initialization.\n */\n'afterLoadData',\n\n/**\n * Fired after a scroll event, which is identified as a momentum scroll (e.g. on an iPad).\n *\n * @event Hooks#afterMomentumScroll\n */\n'afterMomentumScroll',\n\n/**\n * Fired after a `mousedown` event is triggered on the cell corner (the drag handle).\n *\n * @event Hooks#afterOnCellCornerMouseDown\n * @since 0.11\n * @param {Object} event `mousedown` event object.\n */\n'afterOnCellCornerMouseDown',\n\n/**\n * Fired after a `dblclick` event is triggered on the cell corner (the drag handle).\n *\n * @event Hooks#afterOnCellCornerDblClick\n * @since 0.30.0\n * @param {Object} event `dblclick` event object.\n */\n'afterOnCellCornerDblClick',\n\n/**\n * Callback fired after clicking on a cell or row/column header.\n * In case the row/column header was clicked, the index is negative.\n * For example clicking on the row header of cell (0, 0) results with `afterOnCellMouseDown` called\n * with coords `{row: 0, col: -1}`.\n *\n * @event Hooks#afterOnCellMouseDown\n * @since 0.11\n * @param {Object} event `mousedown` event object.\n * @param {Object} coords Coordinates object containing the row and column indexes of the clicked cell.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n'afterOnCellMouseDown',\n\n/**\n * Callback fired after hovering a cell or row/column header with the mouse cursor.\n * In case the row/column header was hovered, the index is negative.\n * For example, hovering over the row header of cell (0, 0) results with `afterOnCellMouseOver` called\n * with coords `{row: 0, col: -1}`.\n *\n * @event Hooks#afterOnCellMouseOver\n * @since 0.11\n * @param {Object} event `mouseover` event object.\n * @param {Object} coords Hovered cell's coordinate object.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n'afterOnCellMouseOver',\n\n/**\n * Callback fired after leaving a cell or row/column header with the mouse cursor.\n *\n * @event Hooks#afterOnCellMouseOver\n * @since 0.31.1\n * @param {Object} event `mouseout` event object.\n * @param {Object} coords Leaved cell's coordinate object.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n'afterOnCellMouseOut',\n\n/**\n * Callback is fired when one or more columns are removed.\n *\n * @event Hooks#afterRemoveCol\n * @param {Number} index Is an index of starter column.\n * @param {Number} amount Is an amount of removed columns.\n */\n'afterRemoveCol',\n\n/**\n * Callback is fired when one or more rows are removed.\n *\n * @event Hooks#afterRemoveRow\n * @param {Number} index Is an index of starter row.\n * @param {Number} amount Is an amount of removed rows.\n */\n'afterRemoveRow',\n\n/**\n * Callback fired after the Handsontable table is rendered.\n *\n * @event Hooks#afterRender\n * @param {Boolean} isForced Is `true` if rendering was triggered by a change of settings or data; or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n'afterRender',\n\n/**\n * Fired before starting rendering the cell.\n *\n * @event Hooks#beforeRenderer\n * @since 0.24.2\n * @param {Element} TD Currently rendered cell's TD element.\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String|Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n'beforeRenderer',\n\n/**\n * Fired after finishing rendering the cell (after the renderer finishes).\n *\n * @event Hooks#afterRenderer\n * @since 0.11.0\n * @param {Element} TD Currently rendered cell's TD element.\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String|Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n'afterRenderer',\n\n/**\n * Fired after the horizontal scroll event.\n *\n * @event Hooks#afterScrollHorizontally\n * @since 0.11\n */\n'afterScrollHorizontally',\n\n/**\n * Fired after the vertical scroll event.\n *\n * @event Hooks#afterScrollVertically\n * @since 0.11\n */\n'afterScrollVertically',\n\n/**\n * Callback fired after one or more cells are selected (e.g. during mouse move).\n *\n * @event Hooks#afterSelection\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * * @example\n * ```js\n * handsontable({\n * afterSelection: function (r, c, r2, c2, preventScrolling) {\n * // setting if prevent scrolling after selection\n *\n * preventScrolling.value = true;\n * }\n * })\n * ```\n */\n'afterSelection',\n\n/**\n * Callback fired after one or more cells are selected. The `p` argument represents the source object property name instead of the column number.\n *\n * @event Hooks#afterSelectionByProp\n * @param {Number} r Selection start row index.\n * @param {String} p Selection start data source object property name.\n * @param {Number} r2 Selection end row index.\n * @param {String} p2 Selection end data source object property name.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * * @example\n * ```js\n * handsontable({\n * afterSelectionByProp: function (r, c, r2, c2, preventScrolling) {\n * // setting if prevent scrolling after selection\n *\n * preventScrolling.value = true;\n * }\n * })\n * ```\n */\n'afterSelectionByProp',\n\n/**\n * Callback fired after one or more cells are selected (e.g. on mouse up).\n *\n * @event Hooks#afterSelectionEnd\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n */\n'afterSelectionEnd',\n\n/**\n * Callback fired after one or more cells are selected (e.g. on mouse up). The `p` argument represents the data source object\n * property name instead of the column number.\n *\n * @event Hooks#afterSelectionEndByProp\n * @param {Number} r Selection start row index.\n * @param {String} p Selection start data source object property index.\n * @param {Number} r2 Selection end row index.\n * @param {String} p2 Selection end data source object property index.\n */\n'afterSelectionEndByProp',\n\n/**\n * Called after cell meta is changed.\n *\n * @event Hooks#afterSetCellMeta\n * @since 0.11.0\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} key The updated meta key.\n * @param {*} value The updated meta value.\n */\n'afterSetCellMeta',\n\n/**\n * Called after cell data was changed.\n *\n * @event Hooks#afterSetDataAtCell\n * @since 0.28.0\n * @param {Array} changes An array of changes in format `[[row, col, oldValue, value], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterSetDataAtCell',\n\n/**\n * Called after cell data was changed.\n *\n * @event Hooks#afterSetDataAtRowProp\n * @since 0.28.0\n * @param {Array} changes An array of changes in format `[[row, prop, oldValue, value], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterSetDataAtRowProp',\n\n/**\n * Fired after calling the `updateSettings` method.\n *\n * @event Hooks#afterUpdateSettings\n */\n'afterUpdateSettings',\n\n/**\n * @description\n * A plugin hook executed after validator function, only if validator function is defined.\n * Validation result is the first parameter. This can be used to determinate if validation passed successfully or not.\n *\n * __Returning false from the callback will mark the cell as invalid.__\n *\n * @event Hooks#afterValidate\n * @since 0.9.5\n * @param {Boolean} isValid `true` if valid, `false` if not.\n * @param {*} value The value in question.\n * @param {Number} row Row index.\n * @param {String|Number} prop Property name / column index.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterValidate',\n\n/**\n * Fired before populating the data in the autofill feature.\n *\n * @event Hooks#beforeAutofill\n * @param {Object} start Object containing information about first filled cell: `{row: 2, col: 0}`.\n * @param {Object} end Object containing information about last filled cell: `{row: 4, col: 1}`.\n * @param {Array} data 2D array containing information about fill pattern: `[[\"1', \"Ted\"], [\"1', \"John\"]]`.\n */\n'beforeAutofill',\n\n/**\n * Fired before aligning the cell contents.\n *\n * @event Hooks#beforeCellAlignment\n * @param stateBefore\n * @param range\n * @param {String} type Type of the alignment - either `horizontal` or `vertical`\n * @param {String} alignmentClass String defining the alignment class added to the cell.\n * Possible values:\n * * `htLeft`,\n * * `htCenter`,\n * * `htRight`,\n * * `htJustify`\n * for horizontal alignment,\n *\n *\n * * `htTop`,\n * * `htMiddle`,\n * * `htBottom`\n * for vertical alignment.\n */\n'beforeCellAlignment',\n\n/**\n * Callback fired before one or more cells is changed. Its main purpose is to alter changes silently before input.\n *\n * @event Hooks#beforeChange\n * @param {Array} changes 2D array containing information about each of the edited cells.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n * @example\n * ```js\n * // To disregard a single change, set changes[i] to null or remove it from array using changes.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * changes[0] = null;\n * }\n * });\n * ...\n *\n * // To alter a single change, overwrite the desired value to changes[i][3].\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * changes[0][3] = 10;\n * }\n * });\n * ...\n *\n * // To cancel all edit, return false from the callback or set array length to 0 (changes.length = 0).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforeChange',\n\n/**\n * Fired right before rendering the changes.\n *\n * @event Hooks#beforeChangeRender\n * @since 0.11\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue].\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeChangeRender',\n\n/**\n * Fired before drawing the borders.\n *\n * @event Hooks#beforeDrawBorders\n * @param {Array} corners Array specifying the current selection borders.\n * @param {String} borderClassName Specifies the border class name.\n */\n'beforeDrawBorders',\n\n/**\n * Callback fired before getting cell settings.\n *\n * @event Hooks#beforeGetCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n'beforeGetCellMeta',\n\n/**\n * @description\n * Callback fired before Handsontable instance is initiated.\n *\n * @event Hooks#beforeInit\n */\n'beforeInit',\n\n/**\n * Callback fired before Walkontable instance is initiated.\n *\n * @since 0.11\n * @event Hooks#beforeInitWalkontable\n * @param {Object} walkontableConfig Walkontable configuration object.\n */\n'beforeInitWalkontable',\n\n/**\n * Callback fired before keydown event is handled. It can be used to overwrite default key bindings.\n * Caution - in your `beforeKeyDown` handler you need to call `event.stopImmediatePropagation()` to prevent default key behavior.\n *\n * @event Hooks#beforeKeyDown\n * @since 0.9.0\n * @param {Event} event Original DOM event.\n */\n'beforeKeyDown',\n\n/**\n * Fired after the user clicked a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseDown\n * @param {Event} event The `mousedown` event object.\n * @param {CellCoords} coords CellCoords object containing the coordinates of the clicked cell.\n * @param {Element} TD TD element.\n */\n'beforeOnCellMouseDown',\n\n/**\n * Fired after the user moved cursor over a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseOver\n * @param {Event} event The `mouseover` event object.\n * @param {CellCoords} coords CellCoords object containing the coordinates of the clicked cell.\n * @param {Element} TD TD element.\n * @param {Object} blockCalculations Contain keys 'row' and 'column' with boolean value.\n */\n'beforeOnCellMouseOver',\n\n/**\n * Fired after the user moved cursor out from a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseOut\n * @since 0.31.1\n * @param {Event} event The `mouseout` event object.\n * @param {WalkontableCellCoords} coords WalkontableCellCoords object containing the coordinates of the leaved cell.\n * @param {Element} TD TD element.\n */\n'beforeOnCellMouseOut',\n\n/**\n * Callback is fired when one or more columns are about to be removed.\n *\n * @event Hooks#beforeRemoveCol\n * @param {Number} index Index of starter column.\n * @param {Number} amount Amount of columns to be removed.\n * @param {Array} [logicalCols] Consists of logical indexes of processed columns.\n */\n'beforeRemoveCol',\n\n/**\n * Callback is fired when one or more rows are about to be removed.\n *\n * @event Hooks#beforeRemoveRow\n * @param {Number} index Index of starter column.\n * @param {Number} amount Amount of columns to be removed.\n * @param {Array} [logicalRows] Consists of logical indexes of processed rows.\n */\n'beforeRemoveRow',\n\n/**\n * Callback fired before Handsontable table is rendered.\n *\n * @event Hooks#beforeRender\n * @param {Boolean} isForced If `true` rendering was triggered by a change of settings or data; or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n'beforeRender',\n\n/**\n * Callback fired before setting range is started.\n *\n * @event Hooks#beforeSetRangeStart\n * @param {Array} coords CellCoords array.\n */\n'beforeSetRangeStart',\n\n/**\n * Callback fired before setting range is ended.\n *\n * @event Hooks#beforeSetRangeEnd\n * @param {Array} coords CellCoords array.\n */\n'beforeSetRangeEnd',\n\n/**\n * Fired before the logic of handling a touch scroll, when user started scrolling on a touch-enabled device.\n *\n * @event Hooks#beforeTouchScroll\n */\n'beforeTouchScroll',\n\n/**\n * @description\n * A plugin hook executed before validator function, only if validator function is defined.\n * This can be used to manipulate the value of changed cell before it is applied to the validator function.\n *\n * __Notice:__ this will not affect values of changes. This will change value ONLY for validation!\n *\n * @event Hooks#beforeValidate\n * @since 0.9.5\n * @param {*} value Value of the cell.\n * @param {Number} row Row index.\n * @param {String|Number} prop Property name / column index.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeValidate',\n\n/**\n * Callback fired before cell value is rendered into the DOM (through renderer function).\n *\n * @event Hooks#beforeValueRender\n * @since 0.29.0\n * @param {*} value Cell value to render.\n */\n'beforeValueRender',\n\n/**\n * Callback fired after Handsontable instance is constructed (via `new` operator).\n *\n * @event Hooks#construct\n * @since 0.16.1\n */\n'construct',\n\n/**\n * Callback fired after Handsontable instance is initiated but before table is rendered.\n *\n * @event Hooks#init\n * @since 0.16.1\n */\n'init',\n\n/**\n * Fired when a column index is about to be modified by a callback function.\n *\n * @event Hooks#modifyCol\n * @since 0.11\n * @param {Number} col Column index.\n */\n'modifyCol',\n\n/**\n * Fired when a column index is about to be de-modified by a callback function.\n *\n * @event Hooks#unmodifyCol\n * @since 0.23.0\n * @param {Number} col Column index.\n */\n'unmodifyCol',\n\n/**\n * Fired when a row index is about to be de-modified by a callback function.\n *\n * @event Hooks#unmodifyRow\n * @since 0.26.2\n * @param {Number} row Logical row index.\n */\n'unmodifyRow',\n/**\n * Fired when a column header index is about to be modified by a callback function.\n *\n * @event Hooks#modifyColHeader\n * @since 0.20.0\n * @param {Number} column Column header index.\n */\n'modifyColHeader',\n\n/**\n * Fired when a column width is about to be modified by a callback function.\n *\n * @event Hooks#modifyColWidth\n * @since 0.11\n * @param {Number} width Current column width.\n * @param {Number} col Column index.\n */\n'modifyColWidth',\n\n/**\n * Fired when a row index is about to be modified by a callback function.\n *\n * @event Hooks#modifyRow\n * @since 0.11\n * @param {Number} row Row index.\n */\n'modifyRow',\n\n/**\n * Fired when a row header index is about to be modified by a callback function.\n *\n * @event Hooks#modifyRowHeader\n * @since 0.20.0\n * @param {Number} row Row header index.\n */\n'modifyRowHeader',\n\n/**\n * Fired when a row height is about to be modified by a callback function.\n *\n * @event Hooks#modifyRowHeight\n * @since 0.11.0\n * @param {Number} height Row height.\n * @param {Number} row Row index.\n */\n'modifyRowHeight',\n\n/**\n * Fired when a data was retrieved or modified.\n *\n * @event Hooks#modifyData\n * @since 0.28.0\n * @param {Number} row Row height.\n * @param {Number} column Column index.\n * @param {Object} valueHolder Object which contains original value which can be modified by overwriting `.value` property.\n * @param {String} ioMode String which indicates for what operation hook is fired (`get` or `set`).\n */\n'modifyData',\n\n/**\n * Fired when a data was retrieved or modified.\n *\n * @event Hooks#modifyRowSourceData\n * @since 0.28.0\n * @param {Number} row Row logical index.\n */\n'modifyRowData',\n\n/**\n * Fired after loading data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateLoad\n * @param {String} key Key string.\n * @param {Object} valuePlaceholder Object containing the loaded data.\n */\n'persistentStateLoad',\n\n/**\n * Fired after resetting data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateReset\n * @param {String} key Key string.\n */\n'persistentStateReset',\n\n/**\n * Fired after resetting data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateSave\n * @param {String} key Key string.\n * @param {Mixed} value Value to save.\n */\n'persistentStateSave',\n\n/**\n * Fired before sorting the column. If you return `false` value then sorting will be not applied by\n * Handsontable (useful for server-side sorting).\n *\n * @event Hooks#beforeColumnSort\n * @param {Number} column Sorted column index.\n * @param {Boolean} order Soring order where:\n * * `true` means ascending order,\n * * `false` means descending order,\n * * `undefined` means original order.\n */\n'beforeColumnSort',\n\n/**\n * Fired after sorting the column.\n *\n * @event Hooks#afterColumnSort\n * @param {Number} column Sorted column index.\n * @param {Boolean} order Soring order where:\n * * `true` means ascending order\n * * `false` means descending order\n * * `undefined` means original order\n */\n'afterColumnSort',\n\n/**\n * @description\n * Fired after setting range of autofill.\n * Both arguments are provided in the following format:\n * ```js\n * [startRow, startColumn, endRow, endColumn]\n * ```\n *\n * @event Hooks#modifyAutofillRange\n * @param {Array} startArea Array of coordinates of the starting point for the drag-down operation.\n * @param {Array} entireArea Array of coordinates of the entire area of the drag-down operation.\n */\n'modifyAutofillRange',\n\n/**\n * Fired to allow modifying the copyable range with a callback function.\n *\n * @since 0.19.0\n * @event Hooks#modifyCopyableRange\n * @param {Array} copyableRanges Array of objects defining copyable cells.\n */\n'modifyCopyableRange',\n\n/**\n * Called before copying the values into clipboard and before clearing values of the selected cells.\n *\n * @event Hooks#beforeCut\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to cut.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which will be cut out.\n * @returns {*} If returns `false` then operation of the cutting out is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCut: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel cutting out, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCut: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforeCut',\n\n/**\n * Fired after data are cutted out from the table.\n *\n * @event Hooks#afterCut\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the cutted out data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which was cut out.\n */\n'afterCut',\n\n/**\n * Fired before values are copied into clipboard.\n *\n * @event Hooks#beforeCopy\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to copied.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which will copied.\n * @returns {*} If returns `false` then copying is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCopy: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel copying, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCopy: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforeCopy',\n\n/**\n * Fired after data are pasted into table.\n *\n * @event Hooks#afterCopy\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the copied data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which was copied.\n */\n'afterCopy',\n\n/**\n * Fired before values are pasted into table.\n *\n * @event Hooks#beforePaste\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to paste.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * where changes will be inserted.\n * @returns {*} If returns `false` then pasting is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforePaste: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel pasting, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforePaste: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforePaste',\n\n/**\n * Fired after values are pasted into table.\n *\n * @event Hooks#afterePaste\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the pasted data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * where changes was inserted.\n */\n'afterPaste',\n\n/**\n * Fired before change order of the logical indexes.\n *\n * @event Hooks#beforeColumnMove\n * @param {Array} columns Array of visual column indexes to be moved.\n * @param {Number} target Visual column index being a target for moved columns.\n */\n'beforeColumnMove',\n\n/**\n * Fired after change order of the logical indexes.\n *\n * @event Hooks#afterColumnMove\n * @param {Array} columns Array of visual column indexes that were moved.\n * @param {Number} target Visual column index being a target for moved columns.\n */\n'afterColumnMove',\n\n/**\n * Fired before change order of the logical indexes.\n *\n * @event Hooks#beforeRowMove\n * @param {Array} rows Array of visual row indexes to be moved.\n * @param {Number} target Visual row index being a target for moved rows.\n */\n'beforeRowMove',\n\n/**\n * Fired after change order of the logical indexes.\n *\n * @event Hooks#afterRowMove\n * @param {Array} rows Array of visual row indexes that were moved.\n * @param {Number} target Visual row index being a target for moved rows.\n */\n'afterRowMove',\n\n/**\n * Fired before rendering the table with modified column sizes.\n *\n * @event Hooks#beforeColumnResize\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n * @returns {Number} Returns a new column size or `undefined`, if column size should be calculated automatically.\n */\n'beforeColumnResize',\n\n/**\n * Fired after rendering the table with modified column sizes.\n *\n * @event Hooks#afterColumnResize\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n'afterColumnResize',\n\n/**\n * Fired before rendering the table with modified row sizes.\n *\n * @event Hooks#beforeRowResize\n * @param {Number} currentRow Index of the resized row.\n * @param {Number} newSize Calculated new row height.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n * @returns {Number} Returns the new row size or `undefined` if row size should be calculated automatically.\n */\n'beforeRowResize',\n\n/**\n * Fired after rendering the table with modified row sizes.\n *\n * @event Hooks#afterRowResize\n * @param {Number} currentRow Index of the resized row.\n * @param {Number} newSize Calculated new row height.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n'afterRowResize',\n\n/**\n * Fired after getting the column header renderers.\n *\n * @event Hooks#afterGetColumnHeaderRenderers\n * @param {Array} array Array of the column header renderers.\n */\n'afterGetColumnHeaderRenderers',\n\n/**\n * Fired after getting the row header renderers.\n *\n * @event Hooks#afterGetRowHeaderRenderers\n * @param {Array} array Array of the row header renderers.\n */\n'afterGetRowHeaderRenderers',\n\n/**\n * Fired before applying stretched column width to column.\n *\n * @event Hooks#beforeStretchingColumnWidth\n * @param {Number} stretchedWidth Calculated width.\n * @param {Number} column Column index.\n * @returns {Number} Returns new width which will be applied to the column element.\n */\n'beforeStretchingColumnWidth',\n\n/**\n * Fired before applying [filtering]{@link http://docs.handsontable.com/pro/demo-filtering.html}.\n *\n * @pro\n * @event Hooks#beforeFilter\n * @param {Array} formulasStack An array of objects with added formulas.\n * @returns {Boolean} If hook returns `false` value then filtering won't be applied on the UI side (server-side filtering).\n */\n'beforeFilter',\n\n/**\n * Fired after applying [filtering]{@link http://docs.handsontable.com/pro/demo-filtering.html}.\n *\n * @pro\n * @event Hooks#afterFilter\n * @param {Array} formulasStack An array of objects with added formulas.\n */\n'afterFilter',\n\n/**\n * Used to modify the column header height.\n *\n * @event Hooks#modifyColumnHeaderHeight\n * @since 0.25.0\n * @param {Number} col Column index.\n */\n'modifyColumnHeaderHeight',\n\n/**\n * Fired before the undo action. Contains information about the action that is being undone.\n *\n * @event Hooks#beforeUndo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being undone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'beforeUndo',\n\n/**\n * Fired after the undo action. Contains information about the action that is being undone.\n *\n * @event Hooks#afterUndo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being undone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'afterUndo',\n\n/**\n * Fired before the redo action. Contains information about the action that is being redone.\n *\n * @event Hooks#beforeRedo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being redone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'beforeRedo',\n\n/**\n * Fired after the redo action. Contains information about the action that is being redone.\n *\n * @event Hooks#afterRedo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being redone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'afterRedo',\n\n/**\n * Used to modify the row header width.\n *\n * @event Hooks#modifyRowHeaderWidth\n * @param {Number} rowHeaderWidth Row header width.\n */\n'modifyRowHeaderWidth',\n\n/**\n * Fired from the `populateFromArray` method during the `autofill` process. Fired for each \"autofilled\" cell individually.\n *\n * @event Hooks#beforeAutofillInsidePopulate\n * @param {Object} index Object containing `row` and `col` properties, defining the number of rows/columns from the initial cell of the autofill.\n * @param {String} direction Declares the direction of the autofill. Possible values: `up`, `down`, `left`, `right`.\n * @param {Array} input Array of arrays. Contains an array of rows with data being used in the autofill.\n * @param {Array} deltas The deltas array passed to the `populateFromArray` method.\n */\n'beforeAutofillInsidePopulate',\n\n/**\n * Fired when the start of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#modifyTransformStart\n * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.\n */\n'modifyTransformStart',\n\n/**\n * Fired when the end of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#modifyTransformEnd\n * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.\n */\n'modifyTransformEnd',\n\n/**\n * Fired after the start of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#afterModifyTransformStart\n * @param {CellCoords} coords Coords of the freshly selected cell.\n * @param {Number} rowTransformDir `-1` if trying to select a cell with a negative row index. `0` otherwise.\n * @param {Number} colTransformDir `-1` if trying to select a cell with a negative column index. `0` otherwise.\n */\n'afterModifyTransformStart',\n\n/**\n * Fired after the end of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#afterModifyTransformEnd\n * @param {CellCoords} coords Coords of the freshly selected cell.\n * @param {Number} rowTransformDir `-1` if trying to select a cell with a negative row index. `0` otherwise.\n * @param {Number} colTransformDir `-1` if trying to select a cell with a negative column index. `0` otherwise.\n */\n'afterModifyTransformEnd',\n\n/**\n * Fired before rendering a cell value.\n *\n * @event Hooks#beforeValueRender\n * @param {Mixed} value The rendered value.\n */\n'beforeValueRender',\n\n/**\n * Fired inside the `viewportRowCalculatorOverride` method. Allows modifying the row calculator parameters.\n *\n * @event Hooks#afterViewportRowCalculatorOverride\n * @param {Object} calc The row calculator.\n */\n'afterViewportRowCalculatorOverride',\n\n/**\n * Fired inside the `viewportColumnCalculatorOverride` method. Allows modifying the row calculator parameters.\n *\n * @event Hooks#afterViewportColumnCalculatorOverride\n * @param {Object} calc The row calculator.\n */\n'afterViewportColumnCalculatorOverride',\n\n/**\n * Fired after initializing all the plugins.\n *\n * @event Hooks#afterPluginsInitialized\n */\n'afterPluginsInitialized',\n\n/**\n * Used when saving/loading the manual row heights state.\n *\n * @event Hooks#manualRowHeights\n * @param {Array} state The current manual row heights state.\n */\n'manualRowHeights',\n\n/**\n * Used to skip the length cache calculation for a defined period of time.\n *\n * @event Hooks#skipLengthCache\n * @param {Number} delay The delay in milliseconds.\n */\n'skipLengthCache',\n\n/**\n * Fired after trimming rows in the TrimRows plugin.\n *\n * @pro\n * @event Hooks#afterTrimRow\n * @param {Array} rows Indexes of trimmed rows.\n */\n'afterTrimRow',\n\n/**\n * Fired after untrimming rows in the TrimRows plugin.\n *\n * @pro\n * @event Hooks#afterUntrimRow\n * @param {Array} rows Indexes of untrimmed rows.\n */\n'afterUntrimRow',\n\n/**\n * Fired after opening the dropdown menu.\n *\n * @pro\n * @event Hooks#afterDropdownMenuShow\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n'afterDropdownMenuShow',\n\n/**\n * Fired after hiding the dropdown menu.\n *\n * @pro\n * @event Hooks#afterDropdownMenuHide\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n'afterDropdownMenuHide',\n\n/**\n * Used to check whether the provided row index is hidden.\n *\n * @pro\n * @event Hooks#hiddenRow\n * @param {Number} row The row index in question.\n */\n'hiddenRow',\n\n/**\n * Used to check whether the provided column index is hidden.\n *\n * @pro\n * @event Hooks#hiddenColumn\n * @param {Number} column The column index in question.\n */\n'hiddenColumn',\n\n/**\n * Fired before adding a children to the NestedRows structure.\n *\n * @pro\n * @event Hooks#beforeAddChild\n * @param {Object} parent The parent object.\n * @param {Object|undefined} element The element added as a child. If `undefined`, a blank child was added.\n * @param {Number|undefined} index The index within the parent where the new child was added. If `undefined`, the element was added as the last child.\n */\n'beforeAddChild',\n\n/**\n * Fired after adding a children to the NestedRows structure.\n *\n * @pro\n * @event Hooks#afterAddChild\n * @param {Object} parent The parent object.\n * @param {Object|undefined} element The element added as a child. If `undefined`, a blank child was added.\n * @param {Number|undefined} index The index within the parent where the new child was added. If `undefined`, the element was added as the last child.\n */\n'afterAddChild',\n\n/**\n * Fired before detaching a child from its parent in the NestedRows plugin.\n *\n * @pro\n * @event Hooks#beforeDetachChild\n * @param {Object} parent An object representing the parent from which the element is to be detached.\n * @param {Object} element The detached element.\n */\n'beforeDetachChild',\n\n/**\n * Fired after detaching a child from its parent in the NestedRows plugin.\n *\n * @pro\n * @event Hooks#afterDetachChild\n * @param {Object} parent An object representing the parent from which the element was detached.\n * @param {Object} element The detached element.\n */\n'afterDetachChild',\n\n/**\n * Fired after the editor is opened and rendered.\n *\n * @event Hooks#afterBeginEditing\n * @param {Number} row Row index of the edited cell.\n * @param {Number} column Column index of the edited cell.\n */\n'afterBeginEditing'];\n\nvar Hooks = function () {\n _createClass(Hooks, null, [{\n key: 'getSingleton',\n value: function getSingleton() {\n return globalSingleton;\n }\n\n /**\n *\n */\n\n }]);\n\n function Hooks() {\n _classCallCheck(this, Hooks);\n\n this.globalBucket = this.createEmptyBucket();\n }\n\n /**\n * Returns a new object with empty handlers related to every registered hook name.\n *\n * @returns {Object} The empty bucket object.\n *\n * @example\n * ```js\n * Handsontable.hooks.createEmptyBucket();\n * // Results:\n * {\n * ...\n * afterCreateCol: [],\n * afterCreateRow: [],\n * beforeInit: [],\n * ...\n * }\n * ```\n */\n\n\n _createClass(Hooks, [{\n key: 'createEmptyBucket',\n value: function createEmptyBucket() {\n var bucket = Object.create(null);\n\n (0, _array.arrayEach)(REGISTERED_HOOKS, function (hook) {\n return bucket[hook] = [];\n });\n\n return bucket;\n }\n\n /**\n * Get hook bucket based on the context of the object or if argument is `undefined`, get the global hook bucket.\n *\n * @param {Object} [context=null] A Handsontable instance.\n * @returns {Object} Returns a global or Handsontable instance bucket.\n */\n\n }, {\n key: 'getBucket',\n value: function getBucket() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (context) {\n if (!context.pluginHookBucket) {\n context.pluginHookBucket = this.createEmptyBucket();\n }\n\n return context.pluginHookBucket;\n }\n\n return this.globalBucket;\n }\n\n /**\n * Adds a listener (globally or locally) to a specified hook name.\n * If the `context` parameter is provided, the hook will be added only to the instance it references.\n * Otherwise, the callback will be used everytime the hook fires on any Handsontable instance.\n * You can provide an array of callback functions as the `callback` argument, this way they will all be fired\n * once the hook is triggered.\n *\n * @see Core#addHook\n * @param {String} key Hook name.\n * @param {Function|Array} callback Callback function or an array of functions.\n * @param {Object} [context=null] The context for the hook callback to be added - a Handsontable instance or leave empty.\n * @returns {Hooks} Instance of Hooks.\n *\n * @example\n * ```js\n * // single callback, added locally\n * Handsontable.hooks.add('beforeInit', myCallback, hotInstance);\n *\n * // single callback, added globally\n * Handsontable.hooks.add('beforeInit', myCallback);\n *\n * // multiple callbacks, added locally\n * Handsontable.hooks.add('beforeInit', [myCallback, anotherCallback], hotInstance);\n *\n * // multiple callbacks, added globally\n * Handsontable.hooks.add('beforeInit', [myCallback, anotherCallback]);\n * ```\n */\n\n }, {\n key: 'add',\n value: function add(key, callback) {\n var _this = this;\n\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (Array.isArray(callback)) {\n (0, _array.arrayEach)(callback, function (c) {\n return _this.add(key, c, context);\n });\n } else {\n var bucket = this.getBucket(context);\n\n if (typeof bucket[key] === 'undefined') {\n this.register(key);\n bucket[key] = [];\n }\n callback.skip = false;\n\n if (bucket[key].indexOf(callback) === -1) {\n // only add a hook if it has not already been added (adding the same hook twice is now silently ignored)\n var foundInitialHook = false;\n\n if (callback.initialHook) {\n (0, _array.arrayEach)(bucket[key], function (cb, i) {\n if (cb.initialHook) {\n bucket[key][i] = callback;\n foundInitialHook = true;\n\n return false;\n }\n });\n }\n\n if (!foundInitialHook) {\n bucket[key].push(callback);\n }\n }\n }\n\n return this;\n }\n\n /**\n * Adds a listener to a specified hook. After the hook runs this listener will be automatically removed from the bucket.\n *\n * @see Core#addHookOnce\n * @param {String} key Hook/Event name.\n * @param {Function|Array} callback Callback function.\n * @param {Object} [context=null] A Handsontable instance.\n *\n * @example\n * ```js\n * Handsontable.hooks.once('beforeInit', myCallback, hotInstance);\n * ```\n */\n\n }, {\n key: 'once',\n value: function once(key, callback) {\n var _this2 = this;\n\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (Array.isArray(callback)) {\n (0, _array.arrayEach)(callback, function (c) {\n return _this2.once(key, c, context);\n });\n } else {\n callback.runOnce = true;\n this.add(key, callback, context);\n }\n }\n\n /**\n * Removes a listener from a hook with a given name. If the `context` argument is provided, it removes a listener from a local hook assigned to the given Handsontable instance.\n *\n * @see Core#removeHook\n * @param {String} key Hook/Event name.\n * @param {Function} callback Callback function (needs the be the function that was previously added to the hook).\n * @param {Object} [context=null] Handsontable instance.\n * @return {Boolean} Returns `true` if hook was removed, `false` otherwise.\n *\n * @example\n * ```js\n * Handsontable.hooks.remove('beforeInit', myCallback);\n * ```\n */\n\n }, {\n key: 'remove',\n value: function remove(key, callback) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n var bucket = this.getBucket(context);\n\n if (typeof bucket[key] !== 'undefined') {\n if (bucket[key].indexOf(callback) >= 0) {\n callback.skip = true;\n\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Checks whether there are any registered listeners for the provided hook name.\n * If the `context` parameter is provided, it only checks for listeners assigned to the given Handsontable instance.\n *\n * @param {String} key Hook name.\n * @param {Object} [context=null] A Handsontable instance.\n * @returns {Boolean} `true` for success, `false` otherwise.\n */\n\n }, {\n key: 'has',\n value: function has(key) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var bucket = this.getBucket(context);\n\n return !!(bucket[key] !== void 0 && bucket[key].length);\n }\n\n /**\n * Runs all local and global callbacks assigned to the hook identified by the `key` parameter.\n * It returns either a return value from the last called callback or the first parameter (`p1`) passed to the `run` function.\n *\n * @see Core#runHooks\n * @param {Object} context Handsontable instance.\n * @param {String} key Hook/Event name.\n * @param {*} [p1] Parameter to be passed as an argument to the callback function.\n * @param {*} [p2] Parameter to be passed as an argument to the callback function.\n * @param {*} [p3] Parameter to be passed as an argument to the callback function.\n * @param {*} [p4] Parameter to be passed as an argument to the callback function.\n * @param {*} [p5] Parameter to be passed as an argument to the callback function.\n * @param {*} [p6] Parameter to be passed as an argument to the callback function.\n * @returns {*} Either a return value from the last called callback or `p1`.\n *\n * @example\n * ```js\n * Handsontable.hooks.run(hot, 'beforeInit');\n * ```\n */\n\n }, {\n key: 'run',\n value: function run(context, key, p1, p2, p3, p4, p5, p6) {\n {\n var globalHandlers = this.globalBucket[key];\n var index = -1;\n var length = globalHandlers ? globalHandlers.length : 0;\n\n if (length) {\n // Do not optimise this loop with arrayEach or arrow function! If you do You'll decrease perf because of GC.\n while (++index < length) {\n if (!globalHandlers[index] || globalHandlers[index].skip) {\n /* eslint-disable no-continue */\n continue;\n }\n // performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture\n var res = globalHandlers[index].call(context, p1, p2, p3, p4, p5, p6);\n\n if (res !== void 0) {\n p1 = res;\n }\n if (globalHandlers[index] && globalHandlers[index].runOnce) {\n this.remove(key, globalHandlers[index]);\n }\n }\n }\n }\n {\n var localHandlers = this.getBucket(context)[key];\n var _index = -1;\n var _length = localHandlers ? localHandlers.length : 0;\n\n if (_length) {\n // Do not optimise this loop with arrayEach or arrow function! If you do You'll decrease perf because of GC.\n while (++_index < _length) {\n if (!localHandlers[_index] || localHandlers[_index].skip) {\n /* eslint-disable no-continue */\n continue;\n }\n // performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture\n var _res = localHandlers[_index].call(context, p1, p2, p3, p4, p5, p6);\n\n if (_res !== void 0) {\n p1 = _res;\n }\n if (localHandlers[_index] && localHandlers[_index].runOnce) {\n this.remove(key, localHandlers[_index], context);\n }\n }\n }\n }\n\n return p1;\n }\n\n /**\n * Destroy all listeners connected to the context. If no context is provided, the global listeners will be destroyed.\n *\n * @param {Object} [context=null] A Handsontable instance.\n * @example\n * ```js\n * // destroy the global listeners\n * Handsontable.hooks.destroy();\n *\n * // destroy the local listeners\n * Handsontable.hooks.destroy(hotInstance);\n * ```\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n (0, _object.objectEach)(this.getBucket(context), function (value, key, bucket) {\n return bucket[key].length = 0;\n });\n }\n\n /**\n * Registers a hook name (adds it to the list of the known hook names). Used by plugins.\n * It is not necessary to call register, but if you use it, your plugin hook will be used returned by\n * the `getRegistered` method. (which itself is used in the demo http://docs.handsontable.com/tutorial-callbacks.html).\n *\n * @param key {String} The hook name.\n *\n * @example\n * ```js\n * Handsontable.hooks.register('myHook');\n * ```\n */\n\n }, {\n key: 'register',\n value: function register(key) {\n if (!this.isRegistered(key)) {\n REGISTERED_HOOKS.push(key);\n }\n }\n\n /**\n * Deregisters a hook name (removes it from the list of known hook names).\n *\n * @param key {String} Hook name.\n *\n * @example\n * ```js\n * Handsontable.hooks.deregister('myHook');\n * ```\n */\n\n }, {\n key: 'deregister',\n value: function deregister(key) {\n if (this.isRegistered(key)) {\n REGISTERED_HOOKS.splice(REGISTERED_HOOKS.indexOf(key), 1);\n }\n }\n\n /**\n * Returns a boolean depending on if a hook by such name has been registered.\n *\n * @param key {String} Hook name.\n * @returns {Boolean} `true` for success, `false` otherwise.\n *\n * @example\n * ```js\n * Handsontable.hooks.isRegistered('beforeInit');\n *\n * // Results:\n * true\n * ```\n */\n\n }, {\n key: 'isRegistered',\n value: function isRegistered(key) {\n return REGISTERED_HOOKS.indexOf(key) >= 0;\n }\n\n /**\n * Returns an array of registered hooks.\n *\n * @returns {Array} An array of registered hooks.\n *\n * @example\n * ```js\n * Handsontable.hooks.getRegistered();\n *\n * // Results:\n * [\n * ...\n * 'beforeInit',\n * 'beforeRender',\n * 'beforeSetRangeEnd',\n * 'beforeDrawBorders',\n * 'beforeChange',\n * ...\n * ]\n * ```\n */\n\n }, {\n key: 'getRegistered',\n value: function getRegistered() {\n return REGISTERED_HOOKS;\n }\n }]);\n\n return Hooks;\n}();\n\nvar globalSingleton = new Hooks();\n\nexports.default = Hooks;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredRenderers = exports.getRegisteredRendererNames = exports.hasRenderer = exports.getRenderer = exports.registerRenderer = undefined;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _cellDecorator = __webpack_require__(260);\n\nvar _cellDecorator2 = _interopRequireDefault(_cellDecorator);\n\nvar _autocompleteRenderer = __webpack_require__(261);\n\nvar _autocompleteRenderer2 = _interopRequireDefault(_autocompleteRenderer);\n\nvar _checkboxRenderer = __webpack_require__(262);\n\nvar _checkboxRenderer2 = _interopRequireDefault(_checkboxRenderer);\n\nvar _htmlRenderer = __webpack_require__(263);\n\nvar _htmlRenderer2 = _interopRequireDefault(_htmlRenderer);\n\nvar _numericRenderer = __webpack_require__(264);\n\nvar _numericRenderer2 = _interopRequireDefault(_numericRenderer);\n\nvar _passwordRenderer = __webpack_require__(265);\n\nvar _passwordRenderer2 = _interopRequireDefault(_passwordRenderer);\n\nvar _textRenderer = __webpack_require__(266);\n\nvar _textRenderer2 = _interopRequireDefault(_textRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _staticRegister = (0, _staticRegister3.default)('renderers'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\nregister('base', _cellDecorator2.default);\nregister('autocomplete', _autocompleteRenderer2.default);\nregister('checkbox', _checkboxRenderer2.default);\nregister('html', _htmlRenderer2.default);\nregister('numeric', _numericRenderer2.default);\nregister('password', _passwordRenderer2.default);\nregister('text', _textRenderer2.default);\n\n/**\n * Retrieve renderer function.\n *\n * @param {String} name Renderer identification.\n * @returns {Function} Returns renderer function.\n */\nfunction _getItem(name) {\n if (typeof name === 'function') {\n return name;\n }\n if (!hasItem(name)) {\n throw Error('No registered renderer found under \"' + name + '\" name');\n }\n\n return getItem(name);\n}\n\nexports.registerRenderer = register;\nexports.getRenderer = _getItem;\nexports.hasRenderer = hasItem;\nexports.getRegisteredRendererNames = getNames;\nexports.getRegisteredRenderers = getValues;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar store = __webpack_require__(82)('wks')\n , uid = __webpack_require__(49)\n , Symbol = __webpack_require__(13).Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.Viewport = exports.TableRenderer = exports.Table = exports.Settings = exports.Selection = exports.Scroll = exports.Overlays = exports.Event = exports.Core = exports.default = exports.Border = exports.TopLeftCornerOverlay = exports.TopOverlay = exports.LeftOverlay = exports.DebugOverlay = exports.RowFilter = exports.ColumnFilter = exports.CellRange = exports.CellCoords = exports.ViewportRowsCalculator = exports.ViewportColumnsCalculator = undefined;\n\n__webpack_require__(96);\n\n__webpack_require__(113);\n\n__webpack_require__(122);\n\n__webpack_require__(123);\n\n__webpack_require__(107);\n\n__webpack_require__(121);\n\n__webpack_require__(104);\n\n__webpack_require__(105);\n\n__webpack_require__(106);\n\n__webpack_require__(95);\n\n__webpack_require__(118);\n\n__webpack_require__(116);\n\n__webpack_require__(114);\n\n__webpack_require__(119);\n\n__webpack_require__(120);\n\n__webpack_require__(115);\n\n__webpack_require__(117);\n\n__webpack_require__(108);\n\n__webpack_require__(109);\n\n__webpack_require__(110);\n\n__webpack_require__(112);\n\n__webpack_require__(111);\n\n__webpack_require__(93);\n\n__webpack_require__(94);\n\n__webpack_require__(89);\n\n__webpack_require__(92);\n\n__webpack_require__(91);\n\n__webpack_require__(90);\n\n__webpack_require__(68);\n\n__webpack_require__(98);\n\n__webpack_require__(99);\n\n__webpack_require__(101);\n\n__webpack_require__(100);\n\n__webpack_require__(97);\n\n__webpack_require__(103);\n\n__webpack_require__(102);\n\n__webpack_require__(124);\n\n__webpack_require__(127);\n\n__webpack_require__(125);\n\n__webpack_require__(126);\n\n__webpack_require__(129);\n\n__webpack_require__(128);\n\n__webpack_require__(131);\n\n__webpack_require__(130);\n\nvar _viewportColumns = __webpack_require__(135);\n\nvar _viewportColumns2 = _interopRequireDefault(_viewportColumns);\n\nvar _viewportRows = __webpack_require__(136);\n\nvar _viewportRows2 = _interopRequireDefault(_viewportRows);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _range = __webpack_require__(69);\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _column = __webpack_require__(139);\n\nvar _column2 = _interopRequireDefault(_column);\n\nvar _row = __webpack_require__(140);\n\nvar _row2 = _interopRequireDefault(_row);\n\nvar _debug = __webpack_require__(185);\n\nvar _debug2 = _interopRequireDefault(_debug);\n\nvar _left = __webpack_require__(186);\n\nvar _left2 = _interopRequireDefault(_left);\n\nvar _top = __webpack_require__(187);\n\nvar _top2 = _interopRequireDefault(_top);\n\nvar _topLeftCorner = __webpack_require__(188);\n\nvar _topLeftCorner2 = _interopRequireDefault(_topLeftCorner);\n\nvar _border = __webpack_require__(134);\n\nvar _border2 = _interopRequireDefault(_border);\n\nvar _core = __webpack_require__(137);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _event = __webpack_require__(138);\n\nvar _event2 = _interopRequireDefault(_event);\n\nvar _overlays = __webpack_require__(141);\n\nvar _overlays2 = _interopRequireDefault(_overlays);\n\nvar _scroll = __webpack_require__(142);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _selection = __webpack_require__(189);\n\nvar _selection2 = _interopRequireDefault(_selection);\n\nvar _settings = __webpack_require__(143);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _table = __webpack_require__(144);\n\nvar _table2 = _interopRequireDefault(_table);\n\nvar _tableRenderer = __webpack_require__(145);\n\nvar _tableRenderer2 = _interopRequireDefault(_tableRenderer);\n\nvar _viewport = __webpack_require__(146);\n\nvar _viewport2 = _interopRequireDefault(_viewport);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.ViewportColumnsCalculator = _viewportColumns2.default;\nexports.ViewportRowsCalculator = _viewportRows2.default;\nexports.CellCoords = _coords2.default;\nexports.CellRange = _range2.default;\nexports.ColumnFilter = _column2.default;\nexports.RowFilter = _row2.default;\nexports.DebugOverlay = _debug2.default;\nexports.LeftOverlay = _left2.default;\nexports.TopOverlay = _top2.default;\nexports.TopLeftCornerOverlay = _topLeftCorner2.default;\nexports.Border = _border2.default;\nexports.default = _core2.default;\nexports.Core = _core2.default;\nexports.Event = _event2.default;\nexports.Overlays = _overlays2.default;\nexports.Scroll = _scroll2.default;\nexports.Selection = _selection2.default;\nexports.Settings = _settings2.default;\nexports.Table = _table2.default;\nexports.TableRenderer = _tableRenderer2.default;\nexports.Viewport = _viewport2.default;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _recordTranslator = __webpack_require__(153);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar privatePool = new WeakMap();\nvar initializedPlugins = null;\n\n/**\n * @private\n */\n\nvar BasePlugin = function () {\n /**\n * @param {Object} hotInstance Handsontable instance.\n */\n function BasePlugin(hotInstance) {\n var _this = this;\n\n _classCallCheck(this, BasePlugin);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n (0, _object.defineGetter)(this, 'hot', hotInstance, {\n writable: false\n });\n (0, _object.defineGetter)(this, 't', (0, _recordTranslator.getTranslator)(hotInstance), {\n writable: false\n });\n\n privatePool.set(this, { hooks: {} });\n initializedPlugins = null;\n\n this.pluginName = null;\n this.pluginsInitializedCallbacks = [];\n this.isPluginsReady = false;\n this.enabled = false;\n this.initialized = false;\n\n this.hot.addHook('afterPluginsInitialized', function () {\n return _this.onAfterPluginsInitialized();\n });\n this.hot.addHook('afterUpdateSettings', function () {\n return _this.onUpdateSettings();\n });\n this.hot.addHook('beforeInit', function () {\n return _this.init();\n });\n }\n\n _createClass(BasePlugin, [{\n key: 'init',\n value: function init() {\n this.pluginName = (0, _plugins.getPluginName)(this.hot, this);\n\n if (this.isEnabled && this.isEnabled()) {\n this.enablePlugin();\n }\n if (!initializedPlugins) {\n initializedPlugins = (0, _plugins.getRegistredPluginNames)(this.hot);\n }\n if (initializedPlugins.indexOf(this.pluginName) >= 0) {\n initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);\n }\n if (!initializedPlugins.length) {\n this.hot.runHooks('afterPluginsInitialized');\n }\n this.initialized = true;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n this.enabled = true;\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n if (this.eventManager) {\n this.eventManager.clear();\n }\n this.clearHooks();\n this.enabled = false;\n }\n\n /**\n * Add listener to plugin hooks system.\n *\n * @param {String} name\n * @param {Function} callback\n */\n\n }, {\n key: 'addHook',\n value: function addHook(name, callback) {\n privatePool.get(this).hooks[name] = privatePool.get(this).hooks[name] || [];\n\n var hooks = privatePool.get(this).hooks[name];\n\n this.hot.addHook(name, callback);\n hooks.push(callback);\n privatePool.get(this).hooks[name] = hooks;\n }\n\n /**\n * Remove all hooks listeners by hook name.\n *\n * @param {String} name\n */\n\n }, {\n key: 'removeHooks',\n value: function removeHooks(name) {\n var _this2 = this;\n\n (0, _array.arrayEach)(privatePool.get(this).hooks[name] || [], function (callback) {\n _this2.hot.removeHook(name, callback);\n });\n }\n\n /**\n * Clear all hooks.\n */\n\n }, {\n key: 'clearHooks',\n value: function clearHooks() {\n var _this3 = this;\n\n var hooks = privatePool.get(this).hooks;\n\n (0, _object.objectEach)(hooks, function (callbacks, name) {\n return _this3.removeHooks(name);\n });\n hooks.length = 0;\n }\n\n /**\n * Register function which will be immediately called after all plugins initialized.\n *\n * @param {Function} callback\n */\n\n }, {\n key: 'callOnPluginsReady',\n value: function callOnPluginsReady(callback) {\n if (this.isPluginsReady) {\n callback();\n } else {\n this.pluginsInitializedCallbacks.push(callback);\n }\n }\n\n /**\n * On after plugins initialized listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterPluginsInitialized',\n value: function onAfterPluginsInitialized() {\n (0, _array.arrayEach)(this.pluginsInitializedCallbacks, function (callback) {\n return callback();\n });\n this.pluginsInitializedCallbacks.length = 0;\n this.isPluginsReady = true;\n }\n\n /**\n * On update settings listener.\n *\n * @private\n */\n\n }, {\n key: 'onUpdateSettings',\n value: function onUpdateSettings() {\n if (this.isEnabled) {\n if (this.enabled && !this.isEnabled()) {\n this.disablePlugin();\n }\n if (!this.enabled && this.isEnabled()) {\n this.enablePlugin();\n }\n if (this.enabled && this.isEnabled()) {\n this.updatePlugin();\n }\n }\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n *\n * @private\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {}\n\n /**\n * Destroy plugin.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var _this4 = this;\n\n if (this.eventManager) {\n this.eventManager.destroy();\n }\n this.clearHooks();\n\n (0, _object.objectEach)(this, function (value, property) {\n if (property !== 'hot' && property !== 't') {\n _this4[property] = null;\n }\n });\n delete this.t;\n delete this.hot;\n }\n }]);\n\n return BasePlugin;\n}();\n\nexports.default = BasePlugin;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredEditors = exports.getRegisteredEditorNames = exports.hasEditor = exports.getEditorInstance = exports.getEditor = exports.registerEditor = undefined;\nexports.RegisteredEditor = RegisteredEditor;\nexports._getEditorInstance = _getEditorInstance;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _autocompleteEditor = __webpack_require__(147);\n\nvar _autocompleteEditor2 = _interopRequireDefault(_autocompleteEditor);\n\nvar _checkboxEditor = __webpack_require__(202);\n\nvar _checkboxEditor2 = _interopRequireDefault(_checkboxEditor);\n\nvar _dateEditor = __webpack_require__(203);\n\nvar _dateEditor2 = _interopRequireDefault(_dateEditor);\n\nvar _dropdownEditor = __webpack_require__(204);\n\nvar _dropdownEditor2 = _interopRequireDefault(_dropdownEditor);\n\nvar _handsontableEditor = __webpack_require__(148);\n\nvar _handsontableEditor2 = _interopRequireDefault(_handsontableEditor);\n\nvar _mobileTextEditor = __webpack_require__(205);\n\nvar _mobileTextEditor2 = _interopRequireDefault(_mobileTextEditor);\n\nvar _numericEditor = __webpack_require__(206);\n\nvar _numericEditor2 = _interopRequireDefault(_numericEditor);\n\nvar _passwordEditor = __webpack_require__(207);\n\nvar _passwordEditor2 = _interopRequireDefault(_passwordEditor);\n\nvar _selectEditor = __webpack_require__(208);\n\nvar _selectEditor2 = _interopRequireDefault(_selectEditor);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar registeredEditorClasses = new WeakMap(); /**\n * Utility to register editors and common namespace for keeping reference to all editor classes\n */\n\nvar _staticRegister = (0, _staticRegister3.default)('editors'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\n_register('base', _baseEditor2.default);\n_register('autocomplete', _autocompleteEditor2.default);\n_register('checkbox', _checkboxEditor2.default);\n_register('date', _dateEditor2.default);\n_register('dropdown', _dropdownEditor2.default);\n_register('handsontable', _handsontableEditor2.default);\n_register('mobile', _mobileTextEditor2.default);\n_register('numeric', _numericEditor2.default);\n_register('password', _passwordEditor2.default);\n_register('select', _selectEditor2.default);\n_register('text', _textEditor2.default);\n\nfunction RegisteredEditor(editorClass) {\n var instances = {};\n var Clazz = editorClass;\n\n this.getConstructor = function () {\n return editorClass;\n };\n\n this.getInstance = function (hotInstance) {\n if (!(hotInstance.guid in instances)) {\n instances[hotInstance.guid] = new Clazz(hotInstance);\n }\n\n return instances[hotInstance.guid];\n };\n\n _pluginHooks2.default.getSingleton().add('afterDestroy', function () {\n instances = {};\n });\n}\n\n/**\n * Returns instance (singleton) of editor class.\n *\n * @param {String} name Name of an editor under which it has been stored.\n * @param {Object} hotInstance Instance of Handsontable.\n * @returns {Function} Returns instance of editor.\n */\nfunction _getEditorInstance(name, hotInstance) {\n var editor = void 0;\n\n if (typeof name === 'function') {\n if (!registeredEditorClasses.get(name)) {\n _register(null, name);\n }\n editor = registeredEditorClasses.get(name);\n } else if (typeof name === 'string') {\n editor = getItem(name);\n } else {\n throw Error('Only strings and functions can be passed as \"editor\" parameter');\n }\n\n if (!editor) {\n throw Error('No editor registered under name \"' + name + '\"');\n }\n\n return editor.getInstance(hotInstance);\n}\n\n/**\n * Retrieve editor class.\n *\n * @param {String} name Editor identification.\n * @returns {Function} Returns editor class.\n */\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error('No registered editor found under \"' + name + '\" name');\n }\n\n return getItem(name).getConstructor();\n}\n\n/**\n * Register editor class under specified name.\n *\n * @param {String} name Editor identification.\n * @param {Function} editorClass Editor class.\n */\nfunction _register(name, editorClass) {\n var editorWrapper = new RegisteredEditor(editorClass);\n\n if (typeof name === 'string') {\n register(name, editorWrapper);\n }\n registeredEditorClasses.set(editorClass, editorWrapper);\n}\n\nexports.registerEditor = _register;\nexports.getEditor = _getItem;\nexports.getEditorInstance = _getEditorInstance;\nexports.hasEditor = hasItem;\nexports.getRegisteredEditorNames = getNames;\nexports.getRegisteredEditors = getValues;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY_CODES = undefined;\nexports.isPrintableChar = isPrintableChar;\nexports.isMetaKey = isMetaKey;\nexports.isCtrlKey = isCtrlKey;\nexports.isKey = isKey;\n\nvar _array = __webpack_require__(1);\n\nvar KEY_CODES = exports.KEY_CODES = {\n MOUSE_LEFT: 1,\n MOUSE_RIGHT: 3,\n MOUSE_MIDDLE: 2,\n BACKSPACE: 8,\n COMMA: 188,\n INSERT: 45,\n DELETE: 46,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n CONTROL_LEFT: 91,\n COMMAND_LEFT: 17,\n COMMAND_RIGHT: 93,\n ALT: 18,\n HOME: 36,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n PERIOD: 190,\n SPACE: 32,\n SHIFT: 16,\n CAPS_LOCK: 20,\n TAB: 9,\n ARROW_RIGHT: 39,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_DOWN: 40,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123,\n A: 65,\n X: 88,\n C: 67,\n V: 86\n};\n\n/**\n * Returns true if keyCode represents a printable character.\n *\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nfunction isPrintableChar(keyCode) {\n return keyCode == 32 || // space\n keyCode >= 48 && keyCode <= 57 || // 0-9\n keyCode >= 96 && keyCode <= 111 || // numpad\n keyCode >= 186 && keyCode <= 192 || // ;=,-./`\n keyCode >= 219 && keyCode <= 222 || // []{}\\|\"'\n keyCode >= 226 || // special chars (229 for Asian chars)\n keyCode >= 65 && keyCode <= 90; // a-z\n}\n\n/**\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nfunction isMetaKey(keyCode) {\n 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];\n\n return metaKeys.indexOf(keyCode) !== -1;\n}\n\n/**\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nfunction isCtrlKey(keyCode) {\n return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1;\n}\n\n/**\n * @param {Number} keyCode\n * @param {String} baseCode\n * @returns {Boolean}\n */\nfunction isKey(keyCode, baseCode) {\n var keys = baseCode.split('|');\n var result = false;\n\n (0, _array.arrayEach)(keys, function (key) {\n if (keyCode === KEY_CODES[key]) {\n result = true;\n\n return false;\n }\n });\n\n return result;\n}\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.normalizeSelection = normalizeSelection;\nexports.isSeparator = isSeparator;\nexports.hasSubMenu = hasSubMenu;\nexports.isDisabled = isDisabled;\nexports.isSelectionDisabled = isSelectionDisabled;\nexports.getValidSelection = getValidSelection;\nexports.prepareVerticalAlignClass = prepareVerticalAlignClass;\nexports.prepareHorizontalAlignClass = prepareHorizontalAlignClass;\nexports.getAlignmentClasses = getAlignmentClasses;\nexports.align = align;\nexports.checkSelectionConsistency = checkSelectionConsistency;\nexports.markLabelAsSelected = markLabelAsSelected;\nexports.isItemHidden = isItemHidden;\nexports.filterSeparators = filterSeparators;\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _separator = __webpack_require__(70);\n\nfunction normalizeSelection(selRange) {\n return {\n start: selRange.getTopLeftCorner(),\n end: selRange.getBottomRightCorner()\n };\n}\n\nfunction isSeparator(cell) {\n return (0, _element.hasClass)(cell, 'htSeparator');\n}\n\nfunction hasSubMenu(cell) {\n return (0, _element.hasClass)(cell, 'htSubmenu');\n}\n\nfunction isDisabled(cell) {\n return (0, _element.hasClass)(cell, 'htDisabled');\n}\n\nfunction isSelectionDisabled(cell) {\n return (0, _element.hasClass)(cell, 'htSelectionDisabled');\n}\n\nfunction getValidSelection(hot) {\n var selected = hot.getSelected();\n\n if (!selected) {\n return null;\n }\n if (selected[0] < 0) {\n return null;\n }\n\n return selected;\n}\n\nfunction prepareVerticalAlignClass(className, alignment) {\n if (className.indexOf(alignment) != -1) {\n return className;\n }\n className = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', '');\n\n className += ' ' + alignment;\n\n return className;\n}\n\nfunction prepareHorizontalAlignClass(className, alignment) {\n if (className.indexOf(alignment) != -1) {\n return className;\n }\n className = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', '');\n\n className += ' ' + alignment;\n\n return className;\n}\n\nfunction getAlignmentClasses(range, callback) {\n var classes = {};\n\n for (var row = range.from.row; row <= range.to.row; row++) {\n for (var col = range.from.col; col <= range.to.col; col++) {\n if (!classes[row]) {\n classes[row] = [];\n }\n classes[row][col] = callback(row, col);\n }\n }\n\n return classes;\n}\n\nfunction align(range, type, alignment, cellDescriptor, propertySetter) {\n if (range.from.row == range.to.row && range.from.col == range.to.col) {\n applyAlignClassName(range.from.row, range.from.col, type, alignment, cellDescriptor, propertySetter);\n } else {\n for (var row = range.from.row; row <= range.to.row; row++) {\n for (var col = range.from.col; col <= range.to.col; col++) {\n applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter);\n }\n }\n }\n}\n\nfunction applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter) {\n var cellMeta = cellDescriptor(row, col);\n var className = alignment;\n\n if (cellMeta.className) {\n if (type === 'vertical') {\n className = prepareVerticalAlignClass(cellMeta.className, alignment);\n } else {\n className = prepareHorizontalAlignClass(cellMeta.className, alignment);\n }\n }\n\n propertySetter(row, col, 'className', className);\n}\n\nfunction checkSelectionConsistency(range, comparator) {\n var result = false;\n\n if (range) {\n range.forAll(function (row, col) {\n if (comparator(row, col)) {\n result = true;\n\n return false;\n }\n });\n }\n\n return result;\n}\n\nfunction markLabelAsSelected(label) {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n return '<span class=\"selected\">' + String.fromCharCode(10003) + '</span>' + label;\n}\n\nfunction isItemHidden(item, instance) {\n return !item.hidden || !(typeof item.hidden == 'function' && item.hidden.call(instance));\n}\n\nfunction shiftSeparators(items, separator) {\n var result = items.slice(0);\n\n for (var i = 0; i < result.length;) {\n if (result[i].name === separator) {\n result.shift();\n } else {\n break;\n }\n }\n return result;\n}\n\nfunction popSeparators(items, separator) {\n var result = items.slice(0);\n\n result.reverse();\n result = shiftSeparators(result, separator);\n result.reverse();\n\n return result;\n}\n\nfunction removeDuplicatedSeparators(items) {\n var result = [];\n\n (0, _array.arrayEach)(items, function (value, index) {\n if (index > 0) {\n if (result[result.length - 1].name !== value.name) {\n result.push(value);\n }\n } else {\n result.push(value);\n }\n });\n\n return result;\n}\n\nfunction filterSeparators(items) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _separator.KEY;\n\n var result = items.slice(0);\n\n result = shiftSeparators(result, separator);\n result = popSeparators(result, separator);\n result = removeDuplicatedSeparators(result);\n\n return result;\n}\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15);\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(18)\n , IE8_DOM_DEFINE = __webpack_require__(160)\n , toPrimitive = __webpack_require__(85)\n , dP = Object.defineProperty;\n\nexports.f = __webpack_require__(21) ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.stringify = stringify;\nexports.isDefined = isDefined;\nexports.isUndefined = isUndefined;\nexports.isEmpty = isEmpty;\nexports.isRegExp = isRegExp;\n\n/**\n * Converts any value to string.\n *\n * @param {*} value\n * @returns {String}\n */\nfunction stringify(value) {\n var result = void 0;\n\n switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) {\n case 'string':\n case 'number':\n result = '' + value;\n break;\n\n case 'object':\n result = value === null ? '' : value.toString();\n break;\n case 'undefined':\n result = '';\n break;\n default:\n result = value.toString();\n break;\n }\n\n return result;\n}\n\n/**\n * Checks if given variable is defined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isDefined(variable) {\n return typeof variable !== 'undefined';\n}\n\n/**\n * Checks if given variable is undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isUndefined(variable) {\n return typeof variable === 'undefined';\n}\n\n/**\n * Check if given variable is null, empty string or undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isEmpty(variable) {\n return variable === null || variable === '' || isUndefined(variable);\n}\n\n/**\n * Check if given variable is a regular expression.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isRegExp(variable) {\n return Object.prototype.toString.call(variable) === '[object RegExp]';\n}\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(31)(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\nvar hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(76)\n , defined = __webpack_require__(30);\nmodule.exports = function(it){\n return IObject(defined(it));\n};\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.15 ToLength\nvar toInteger = __webpack_require__(61)\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.isIE8 = isIE8;\nexports.isIE9 = isIE9;\nexports.isSafari = isSafari;\nexports.isChrome = isChrome;\nexports.isMobileBrowser = isMobileBrowser;\n\nvar _isIE8 = !document.createTextNode('test').textContent;\n\nfunction isIE8() {\n return _isIE8;\n}\n\nvar _isIE9 = !!document.documentMode;\n\nfunction isIE9() {\n return _isIE9;\n}\n\nvar _isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);\n\nfunction isSafari() {\n return _isSafari;\n}\n\nvar _isChrome = /Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor);\n\nfunction isChrome() {\n return _isChrome;\n}\n\nfunction isMobileBrowser(userAgent) {\n if (!userAgent) {\n userAgent = navigator.userAgent;\n }\n\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)\n );\n}\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredValidators = exports.getRegisteredValidatorNames = exports.hasValidator = exports.getValidator = exports.registerValidator = undefined;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _autocompleteValidator = __webpack_require__(271);\n\nvar _autocompleteValidator2 = _interopRequireDefault(_autocompleteValidator);\n\nvar _dateValidator = __webpack_require__(272);\n\nvar _dateValidator2 = _interopRequireDefault(_dateValidator);\n\nvar _numericValidator = __webpack_require__(273);\n\nvar _numericValidator2 = _interopRequireDefault(_numericValidator);\n\nvar _timeValidator = __webpack_require__(274);\n\nvar _timeValidator2 = _interopRequireDefault(_timeValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _staticRegister = (0, _staticRegister3.default)('validators'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\nregister('autocomplete', _autocompleteValidator2.default);\nregister('date', _dateValidator2.default);\nregister('numeric', _numericValidator2.default);\nregister('time', _timeValidator2.default);\n\n/**\n * Retrieve validator function.\n *\n * @param {String} name Validator identification.\n * @returns {Function} Returns validator function.\n */\nfunction _getItem(name) {\n if (typeof name === 'function') {\n return name;\n }\n if (!hasItem(name)) {\n throw Error('No registered validator found under \"' + name + '\" name');\n }\n\n return getItem(name);\n}\n\nexports.registerValidator = register;\nexports.getValidator = _getItem;\nexports.hasValidator = hasItem;\nexports.getRegisteredValidatorNames = getNames;\nexports.getRegisteredValidators = getValues;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.toUpperCaseFirst = toUpperCaseFirst;\nexports.equalsIgnoreCase = equalsIgnoreCase;\nexports.randomString = randomString;\nexports.isPercentValue = isPercentValue;\nexports.substitute = substitute;\nexports.stripTags = stripTags;\n\nvar _mixed = __webpack_require__(20);\n\nvar _number = __webpack_require__(6);\n\n/**\n * Convert string to upper case first letter.\n *\n * @param {String} string String to convert.\n * @returns {String}\n */\nfunction toUpperCaseFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n}\n\n/**\n * Compare strings case insensitively.\n *\n * @param {...String} strings Strings to compare.\n * @returns {Boolean}\n */\nfunction equalsIgnoreCase() {\n var unique = [];\n\n for (var _len = arguments.length, strings = Array(_len), _key = 0; _key < _len; _key++) {\n strings[_key] = arguments[_key];\n }\n\n var length = strings.length;\n\n while (length--) {\n var string = (0, _mixed.stringify)(strings[length]).toLowerCase();\n\n if (unique.indexOf(string) === -1) {\n unique.push(string);\n }\n }\n\n return unique.length === 1;\n}\n\n/**\n * Generates a random hex string. Used as namespace for Handsontable instance events.\n *\n * @return {String} Returns 16-long character random string (eq. `'92b1bfc74ec4'`).\n */\nfunction randomString() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + s4() + s4();\n}\n\n/**\n * Checks if value is valid percent.\n *\n * @param {String} value\n * @returns {Boolean}\n */\nfunction isPercentValue(value) {\n return (/^([0-9][0-9]?%$)|(^100%$)/.test(value)\n );\n}\n\n/**\n * Substitute strings placed beetwen square brackets into value defined in `variables` object. String names defined in\n * square brackets must be the same as property name of `variables` object.\n *\n * @param {String} template Template string.\n * @param {Object} variables Object which contains all available values which can be injected into template.\n * @returns {String}\n */\nfunction substitute(template) {\n var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return ('' + template).replace(/(?:\\\\)?\\[([^[\\]]+)]/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.substr(1, match.length - 1);\n }\n\n return variables[name] === void 0 ? '' : variables[name];\n });\n}\n\nvar STRIP_TAGS_REGEX = /<\\/?\\w+\\/?>|<\\w+[\\s|/][^>]*>/gi;\n\n/**\n * Strip any HTML tag from the string.\n *\n * @param {String} string String to cut HTML from.\n * @return {String}\n */\nfunction stripTags(string) {\n string += '';\n\n return string.replace(STRIP_TAGS_REGEX, '');\n}\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _core = __webpack_require__(137);\n\nvar _core2 = _interopRequireDefault(_core);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar registeredOverlays = {};\n\n/**\n * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable\n * and (optionally) implements behavior needed for native horizontal and vertical scrolling.\n *\n * @class Overlay\n */\n\nvar Overlay = function () {\n _createClass(Overlay, null, [{\n key: 'registerOverlay',\n\n\n /**\n * Register overlay class.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @param {Overlay} overlayClass Overlay class extended from base overlay class {@link Overlay}\n */\n value: function registerOverlay(type, overlayClass) {\n if (Overlay.CLONE_TYPES.indexOf(type) === -1) {\n throw new Error('Unsupported overlay (' + type + ').');\n }\n registeredOverlays[type] = overlayClass;\n }\n\n /**\n * Create new instance of overlay type.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @param {Walkontable} wot Walkontable instance\n */\n\n }, {\n key: 'createOverlay',\n value: function createOverlay(type, wot) {\n return new registeredOverlays[type](wot);\n }\n\n /**\n * Check if specified overlay was registered.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasOverlay',\n value: function hasOverlay(type) {\n return registeredOverlays[type] !== void 0;\n }\n\n /**\n * Checks if overlay object (`overlay`) is instance of overlay type (`type`).\n *\n * @param {Overlay} overlay Overlay object\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @returns {Boolean}\n */\n\n }, {\n key: 'isOverlayTypeOf',\n value: function isOverlayTypeOf(overlay, type) {\n if (!overlay || !registeredOverlays[type]) {\n return false;\n }\n\n return overlay instanceof registeredOverlays[type];\n }\n\n /**\n * @param {Walkontable} wotInstance\n */\n\n }, {\n key: 'CLONE_TOP',\n\n /**\n * @type {String}\n */\n get: function get() {\n return 'top';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_BOTTOM',\n get: function get() {\n return 'bottom';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_LEFT',\n get: function get() {\n return 'left';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_TOP_LEFT_CORNER',\n get: function get() {\n return 'top_left_corner';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_BOTTOM_LEFT_CORNER',\n get: function get() {\n return 'bottom_left_corner';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_DEBUG',\n get: function get() {\n return 'debug';\n }\n\n /**\n * List of all availables clone types\n *\n * @type {Array}\n */\n\n }, {\n key: 'CLONE_TYPES',\n get: function get() {\n return [Overlay.CLONE_TOP, Overlay.CLONE_BOTTOM, Overlay.CLONE_LEFT, Overlay.CLONE_TOP_LEFT_CORNER, Overlay.CLONE_BOTTOM_LEFT_CORNER, Overlay.CLONE_DEBUG];\n }\n }]);\n\n function Overlay(wotInstance) {\n _classCallCheck(this, Overlay);\n\n (0, _object.defineGetter)(this, 'wot', wotInstance, {\n writable: false\n });\n\n // legacy support, deprecated in the future\n this.instance = this.wot;\n\n this.type = '';\n this.mainTableScrollableElement = null;\n this.TABLE = this.wot.wtTable.TABLE;\n this.hider = this.wot.wtTable.hider;\n this.spreader = this.wot.wtTable.spreader;\n this.holder = this.wot.wtTable.holder;\n this.wtRootElement = this.wot.wtTable.wtRootElement;\n this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);\n this.areElementSizesAdjusted = false;\n this.updateStateOfRendering();\n }\n\n /**\n * Update internal state of object with an information about the need of full rendering of the overlay.\n *\n * @returns {Boolean} Returns `true` if the state has changed since the last check.\n */\n\n\n _createClass(Overlay, [{\n key: 'updateStateOfRendering',\n value: function updateStateOfRendering() {\n var previousState = this.needFullRender;\n\n this.needFullRender = this.shouldBeRendered();\n\n var changed = previousState !== this.needFullRender;\n\n if (changed && !this.needFullRender) {\n this.reset();\n }\n\n return changed;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return true;\n }\n\n /**\n * Update the trimming container.\n */\n\n }, {\n key: 'updateTrimmingContainer',\n value: function updateTrimmingContainer() {\n this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);\n }\n\n /**\n * Update the main scrollable element.\n */\n\n }, {\n key: 'updateMainScrollableElement',\n value: function updateMainScrollableElement() {\n this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n }\n\n /**\n * Make a clone of table for overlay\n *\n * @param {String} direction Can be `Overlay.CLONE_TOP`, `Overlay.CLONE_LEFT`,\n * `Overlay.CLONE_TOP_LEFT_CORNER`, `Overlay.CLONE_DEBUG`\n * @returns {Walkontable}\n */\n\n }, {\n key: 'makeClone',\n value: function makeClone(direction) {\n if (Overlay.CLONE_TYPES.indexOf(direction) === -1) {\n throw new Error('Clone type \"' + direction + '\" is not supported.');\n }\n var clone = document.createElement('DIV');\n var clonedTable = document.createElement('TABLE');\n\n clone.className = 'ht_clone_' + direction + ' handsontable';\n clone.style.position = 'absolute';\n clone.style.top = 0;\n clone.style.left = 0;\n clone.style.overflow = 'hidden';\n\n clonedTable.className = this.wot.wtTable.TABLE.className;\n clone.appendChild(clonedTable);\n\n this.type = direction;\n this.wot.wtTable.wtRootElement.parentNode.appendChild(clone);\n\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === Overlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === Overlay.CLONE_LEFT) {\n this.mainTableScrollableElement = window;\n } else {\n this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n }\n\n return new _core2.default({\n cloneSource: this.wot,\n cloneOverlay: this,\n table: clonedTable\n });\n }\n\n /**\n * Refresh/Redraw overlay\n *\n * @param {Boolean} [fastDraw=false]\n */\n\n }, {\n key: 'refresh',\n value: function refresh() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n // When hot settings are changed we allow to refresh overlay once before blocking\n var nextCycleRenderFlag = this.shouldBeRendered();\n\n if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {\n this.clone.draw(fastDraw);\n }\n this.needFullRender = nextCycleRenderFlag;\n }\n\n /**\n * Reset overlay styles to initial values.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n if (!this.clone) {\n return;\n }\n var holder = this.clone.wtTable.holder;\n var hider = this.clone.wtTable.hider;\n var holderStyle = holder.style;\n var hidderStyle = hider.style;\n var rootStyle = holder.parentNode.style;\n\n (0, _array.arrayEach)([holderStyle, hidderStyle, rootStyle], function (style) {\n style.width = '';\n style.height = '';\n });\n }\n\n /**\n * Destroy overlay instance\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n new _eventManager2.default(this.clone).destroy();\n }\n }]);\n\n return Overlay;\n}();\n\nexports.default = Overlay;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// optional / simple context binding\nvar aFunction = __webpack_require__(71);\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\n// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(19)\n , createDesc = __webpack_require__(40);\nmodule.exports = __webpack_require__(21) ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , hide = __webpack_require__(32)\n , has = __webpack_require__(22)\n , SRC = __webpack_require__(49)('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(44).inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.requestAnimationFrame = requestAnimationFrame;\nexports.cancelAnimationFrame = cancelAnimationFrame;\nexports.isTouchSupported = isTouchSupported;\nexports.isWebComponentSupportedNatively = isWebComponentSupportedNatively;\nexports.hasCaptionProblem = hasCaptionProblem;\nexports.getComparisonFunction = getComparisonFunction;\n// https://gist.github.com/paulirish/1579671\nvar lastTime = 0;\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\nvar _requestAnimationFrame = window.requestAnimationFrame;\nvar _cancelAnimationFrame = window.cancelAnimationFrame;\n\nfor (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) {\n _requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n _cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\n}\n\nif (!_requestAnimationFrame) {\n _requestAnimationFrame = function _requestAnimationFrame(callback) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = window.setTimeout(function () {\n callback(currTime + timeToCall);\n }, timeToCall);\n lastTime = currTime + timeToCall;\n\n return id;\n };\n}\n\nif (!_cancelAnimationFrame) {\n _cancelAnimationFrame = function _cancelAnimationFrame(id) {\n clearTimeout(id);\n };\n}\n\n/**\n * Polyfill for requestAnimationFrame\n *\n * @param {Function} callback\n * @returns {Number}\n */\nfunction requestAnimationFrame(callback) {\n return _requestAnimationFrame.call(window, callback);\n}\n\n/**\n * Polyfill for cancelAnimationFrame\n *\n * @param {Number} id\n */\nfunction cancelAnimationFrame(id) {\n _cancelAnimationFrame.call(window, id);\n}\n\nfunction isTouchSupported() {\n return 'ontouchstart' in window;\n}\n\n/**\n * Checks if browser is support web components natively\n *\n * @returns {Boolean}\n */\nfunction isWebComponentSupportedNatively() {\n var test = document.createElement('div');\n\n return !!(test.createShadowRoot && test.createShadowRoot.toString().match(/\\[native code\\]/));\n}\n\nvar _hasCaptionProblem;\n\nfunction detectCaptionProblem() {\n var TABLE = document.createElement('TABLE');\n TABLE.style.borderSpacing = 0;\n TABLE.style.borderWidth = 0;\n TABLE.style.padding = 0;\n var TBODY = document.createElement('TBODY');\n TABLE.appendChild(TBODY);\n TBODY.appendChild(document.createElement('TR'));\n TBODY.firstChild.appendChild(document.createElement('TD'));\n TBODY.firstChild.firstChild.innerHTML = '<tr><td>t<br>t</td></tr>';\n\n var CAPTION = document.createElement('CAPTION');\n CAPTION.innerHTML = 'c<br>c<br>c<br>c';\n CAPTION.style.padding = 0;\n CAPTION.style.margin = 0;\n TABLE.insertBefore(CAPTION, TBODY);\n\n document.body.appendChild(TABLE);\n _hasCaptionProblem = TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight; // boolean\n document.body.removeChild(TABLE);\n}\n\nfunction hasCaptionProblem() {\n if (_hasCaptionProblem === void 0) {\n detectCaptionProblem();\n }\n\n return _hasCaptionProblem;\n}\n\nvar comparisonFunction = void 0;\n\n/**\n * Get string comparison function for sorting purposes. It supports multilingual string comparison base on Internationalization API.\n *\n * @param {String} [language]\n * @param {Object} [options]\n * @returns {*}\n */\nfunction getComparisonFunction(language) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (comparisonFunction) {\n return comparisonFunction;\n }\n\n if ((typeof Intl === 'undefined' ? 'undefined' : _typeof(Intl)) === 'object') {\n comparisonFunction = new Intl.Collator(language, options).compare;\n } else if (typeof String.prototype.localeCompare === 'function') {\n comparisonFunction = function comparisonFunction(a, b) {\n return ('' + a).localeCompare(b);\n };\n } else {\n comparisonFunction = function comparisonFunction(a, b) {\n if (a === b) {\n return 0;\n }\n\n return a > b ? -1 : 1;\n };\n }\n\n return comparisonFunction;\n}\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.isFunction = isFunction;\nexports.throttle = throttle;\nexports.throttleAfterHits = throttleAfterHits;\nexports.debounce = debounce;\nexports.pipe = pipe;\nexports.partial = partial;\nexports.curry = curry;\nexports.curryRight = curryRight;\n\nvar _array = __webpack_require__(1);\n\n/**\n * Checks if given variable is function.\n *\n * @param {*} func Variable to check.\n * @returns {Boolean}\n */\nfunction isFunction(func) {\n return typeof func === 'function';\n}\n\n/**\n * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over time (`wait`).\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in miliseconds.\n * @returns {Function}\n */\nfunction throttle(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;\n\n var lastCalled = 0;\n var result = {\n lastCallThrottled: true\n };\n var lastTimer = null;\n\n function _throttle() {\n var _this = this;\n\n var args = arguments;\n var stamp = Date.now();\n var needCall = false;\n\n result.lastCallThrottled = true;\n\n if (!lastCalled) {\n lastCalled = stamp;\n needCall = true;\n }\n var remaining = wait - (stamp - lastCalled);\n\n if (needCall) {\n result.lastCallThrottled = false;\n func.apply(this, args);\n } else {\n if (lastTimer) {\n clearTimeout(lastTimer);\n }\n lastTimer = setTimeout(function () {\n result.lastCallThrottled = false;\n func.apply(_this, args);\n lastCalled = 0;\n lastTimer = void 0;\n }, remaining);\n }\n\n return result;\n }\n\n return _throttle;\n}\n\n/**\n * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over\n * time (`wait`) after specified hits.\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in miliseconds.\n * @param {Number} hits Number of hits after throttling will be applied.\n * @returns {Function}\n */\nfunction throttleAfterHits(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;\n var hits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;\n\n var funcThrottle = throttle(func, wait);\n var remainHits = hits;\n\n function _clearHits() {\n remainHits = hits;\n }\n function _throttleAfterHits() {\n if (remainHits) {\n remainHits--;\n\n return func.apply(this, arguments);\n }\n\n return funcThrottle.apply(this, arguments);\n }\n _throttleAfterHits.clearHits = _clearHits;\n\n return _throttleAfterHits;\n}\n\n/**\n * Creates debounce function that enforces a function (`func`) not be called again until a certain amount of time (`wait`)\n * has passed without it being called.\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in milliseconds.\n * @returns {Function}\n */\nfunction debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;\n\n var lastTimer = null;\n var result = void 0;\n\n function _debounce() {\n var _this2 = this;\n\n var args = arguments;\n\n if (lastTimer) {\n clearTimeout(lastTimer);\n }\n lastTimer = setTimeout(function () {\n result = func.apply(_this2, args);\n }, wait);\n\n return result;\n }\n\n return _debounce;\n}\n\n/**\n * Creates the function that returns the result of calling the given functions. Result of the first function is passed to\n * the second as an argument and so on. Only first function in the chain can handle multiple arguments.\n *\n * @param {Function} functions Functions to compose.\n * @returns {Function}\n */\nfunction pipe() {\n for (var _len = arguments.length, functions = Array(_len), _key = 0; _key < _len; _key++) {\n functions[_key] = arguments[_key];\n }\n\n var firstFunc = functions[0],\n restFunc = functions.slice(1);\n\n\n return function _pipe() {\n return (0, _array.arrayReduce)(restFunc, function (acc, fn) {\n return fn(acc);\n }, firstFunc.apply(this, arguments));\n };\n}\n\n/**\n * Creates the function that returns the function with cached arguments.\n *\n * @param {Function} func Function to partialization.\n * @param {Array} params Function arguments to cache.\n * @returns {Function}\n */\nfunction partial(func) {\n for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n\n return function _partial() {\n for (var _len3 = arguments.length, restParams = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n restParams[_key3] = arguments[_key3];\n }\n\n return func.apply(this, params.concat(restParams));\n };\n}\n\n/**\n * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched\n * to the arguments defined in `func` then function will be invoked.\n * Arguments are added to the stack in direction from the left to the right.\n *\n * @example\n * ```\n * var replace = curry(function(find, replace, string) {\n * return string.replace(find, replace);\n * });\n *\n * // returns function with bounded first argument\n * var replace = replace('foo')\n *\n * // returns replaced string - all arguments was passed so function was invoked\n * replace('bar', 'Some test with foo...');\n *\n * ```\n *\n * @param {Function} func Function to currying.\n * @returns {Function}\n */\nfunction curry(func) {\n var argsLength = func.length;\n\n function given(argsSoFar) {\n return function _curry() {\n for (var _len4 = arguments.length, params = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n params[_key4] = arguments[_key4];\n }\n\n var passedArgsSoFar = argsSoFar.concat(params);\n var result = void 0;\n\n if (passedArgsSoFar.length >= argsLength) {\n result = func.apply(this, passedArgsSoFar);\n } else {\n result = given(passedArgsSoFar);\n }\n\n return result;\n };\n }\n\n return given([]);\n}\n\n/**\n * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched\n * to the arguments defined in `func` then function will be invoked.\n * Arguments are added to the stack in direction from the right to the left.\n *\n * @example\n * ```\n * var replace = curry(function(find, replace, string) {\n * return string.replace(find, replace);\n * });\n *\n * // returns function with bounded first argument\n * var replace = replace('Some test with foo...')\n *\n * // returns replaced string - all arguments was passed so function was invoked\n * replace('bar', 'foo');\n *\n * ```\n *\n * @param {Function} func Function to currying.\n * @returns {Function}\n */\nfunction curryRight(func) {\n var argsLength = func.length;\n\n function given(argsSoFar) {\n return function _curry() {\n for (var _len5 = arguments.length, params = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n params[_key5] = arguments[_key5];\n }\n\n var passedArgsSoFar = argsSoFar.concat(params.reverse());\n var result = void 0;\n\n if (passedArgsSoFar.length >= argsLength) {\n result = func.apply(this, passedArgsSoFar);\n } else {\n result = given(passedArgsSoFar);\n }\n\n return result;\n };\n }\n\n return given([]);\n}\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.EditorState = undefined;\n\nvar _src = __webpack_require__(11);\n\nvar _mixed = __webpack_require__(20);\n\nvar EditorState = exports.EditorState = {\n VIRGIN: 'STATE_VIRGIN', // before editing\n EDITING: 'STATE_EDITING',\n WAITING: 'STATE_WAITING', // waiting for async validation\n FINISHED: 'STATE_FINISHED'\n};\n\nfunction BaseEditor(instance) {\n this.instance = instance;\n this.state = EditorState.VIRGIN;\n\n this._opened = false;\n this._fullEditMode = false;\n this._closeCallback = null;\n\n this.init();\n}\n\nBaseEditor.prototype._fireCallbacks = function (result) {\n if (this._closeCallback) {\n this._closeCallback(result);\n this._closeCallback = null;\n }\n};\n\nBaseEditor.prototype.init = function () {};\n\nBaseEditor.prototype.getValue = function () {\n throw Error('Editor getValue() method unimplemented');\n};\n\nBaseEditor.prototype.setValue = function (newValue) {\n throw Error('Editor setValue() method unimplemented');\n};\n\nBaseEditor.prototype.open = function () {\n throw Error('Editor open() method unimplemented');\n};\n\nBaseEditor.prototype.close = function () {\n throw Error('Editor close() method unimplemented');\n};\n\nBaseEditor.prototype.prepare = function (row, col, prop, td, originalValue, cellProperties) {\n this.TD = td;\n this.row = row;\n this.col = col;\n this.prop = prop;\n this.originalValue = originalValue;\n this.cellProperties = cellProperties;\n\n var invalidActiveElement = !document.activeElement || document.activeElement && document.activeElement.nodeName === void 0;\n\n if (this.instance.view.isMouseDown() && document.activeElement && document.activeElement !== document.body && !invalidActiveElement) {\n document.activeElement.blur();\n } else if (invalidActiveElement) {\n // IE\n document.body.focus();\n }\n\n this.state = EditorState.VIRGIN;\n};\n\nBaseEditor.prototype.extend = function () {\n var baseClass = this.constructor;\n\n function Editor() {\n baseClass.apply(this, arguments);\n }\n\n function inherit(Child, Parent) {\n function Bridge() {}\n Bridge.prototype = Parent.prototype;\n Child.prototype = new Bridge();\n Child.prototype.constructor = Child;\n\n return Child;\n }\n\n return inherit(Editor, baseClass);\n};\n\nBaseEditor.prototype.saveValue = function (value, ctrlDown) {\n var selection = void 0;\n var tmp = void 0;\n\n // if ctrl+enter and multiple cells selected, behave like Excel (finish editing and apply to all cells)\n if (ctrlDown) {\n selection = this.instance.getSelected();\n\n if (selection[0] > selection[2]) {\n tmp = selection[0];\n selection[0] = selection[2];\n selection[2] = tmp;\n }\n if (selection[1] > selection[3]) {\n tmp = selection[1];\n selection[1] = selection[3];\n selection[3] = tmp;\n }\n } else {\n selection = [this.row, this.col, null, null];\n }\n\n this.instance.populateFromArray(selection[0], selection[1], value, selection[2], selection[3], 'edit');\n};\n\nBaseEditor.prototype.beginEditing = function (initialValue, event) {\n if (this.state != EditorState.VIRGIN) {\n return;\n }\n this.instance.view.scrollViewport(new _src.CellCoords(this.row, this.col));\n this.instance.view.render();\n this.state = EditorState.EDITING;\n\n initialValue = typeof initialValue == 'string' ? initialValue : this.originalValue;\n this.setValue((0, _mixed.stringify)(initialValue));\n\n this.open(event);\n this._opened = true;\n this.focus();\n\n // only rerender the selections (FillHandle should disappear when beginediting is triggered)\n this.instance.view.render();\n\n this.instance.runHooks('afterBeginEditing', this.row, this.col);\n};\n\nBaseEditor.prototype.finishEditing = function (restoreOriginalValue, ctrlDown, callback) {\n var _this = this,\n val;\n\n if (callback) {\n var previousCloseCallback = this._closeCallback;\n\n this._closeCallback = function (result) {\n if (previousCloseCallback) {\n previousCloseCallback(result);\n }\n\n callback(result);\n _this.instance.view.render();\n };\n }\n\n if (this.isWaiting()) {\n return;\n }\n\n if (this.state == EditorState.VIRGIN) {\n this.instance._registerTimeout(setTimeout(function () {\n _this._fireCallbacks(true);\n }, 0));\n\n return;\n }\n\n if (this.state == EditorState.EDITING) {\n if (restoreOriginalValue) {\n this.cancelChanges();\n this.instance.view.render();\n\n return;\n }\n\n var value = this.getValue();\n\n if (this.instance.getSettings().trimWhitespace) {\n // We trim only string values\n val = [[typeof value === 'string' ? String.prototype.trim.call(value || '') : value]];\n } else {\n val = [[value]];\n }\n\n this.state = EditorState.WAITING;\n this.saveValue(val, ctrlDown);\n\n if (this.instance.getCellValidator(this.cellProperties)) {\n this.instance.addHookOnce('postAfterValidate', function (result) {\n _this.state = EditorState.FINISHED;\n _this.discardEditor(result);\n });\n } else {\n this.state = EditorState.FINISHED;\n this.discardEditor(true);\n }\n }\n};\n\nBaseEditor.prototype.cancelChanges = function () {\n this.state = EditorState.FINISHED;\n this.discardEditor();\n};\n\nBaseEditor.prototype.discardEditor = function (result) {\n if (this.state !== EditorState.FINISHED) {\n return;\n }\n // validator was defined and failed\n if (result === false && this.cellProperties.allowInvalid !== true) {\n this.instance.selectCell(this.row, this.col);\n this.focus();\n this.state = EditorState.EDITING;\n this._fireCallbacks(false);\n } else {\n this.close();\n this._opened = false;\n this._fullEditMode = false;\n this.state = EditorState.VIRGIN;\n this._fireCallbacks(true);\n }\n};\n\n/**\n * Switch editor into full edit mode. In this state navigation keys don't close editor. This mode is activated\n * automatically after hit ENTER or F2 key on the cell or while editing cell press F2 key.\n */\nBaseEditor.prototype.enableFullEditMode = function () {\n this._fullEditMode = true;\n};\n\n/**\n * Checks if editor is in full edit mode.\n *\n * @returns {Boolean}\n */\nBaseEditor.prototype.isInFullEditMode = function () {\n return this._fullEditMode;\n};\n\nBaseEditor.prototype.isOpened = function () {\n return this._opened;\n};\n\nBaseEditor.prototype.isWaiting = function () {\n return this.state === EditorState.WAITING;\n};\n\nBaseEditor.prototype.checkEditorSection = function () {\n var totalRows = this.instance.countRows();\n var section = '';\n\n if (this.row < this.instance.getSettings().fixedRowsTop) {\n if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'top-left-corner';\n } else {\n section = 'top';\n }\n } else if (this.instance.getSettings().fixedRowsBottom && this.row >= totalRows - this.instance.getSettings().fixedRowsBottom) {\n if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'bottom-left-corner';\n } else {\n section = 'bottom';\n }\n } else if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'left';\n }\n\n return section;\n};\n\nexports.default = BaseEditor;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = __webpack_require__(10)('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(32)(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(169)\n , enumBugKeys = __webpack_require__(74);\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(30);\nmodule.exports = function(it){\n return Object(defined(it));\n};\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * CellCoords holds cell coordinates (row, column) and few method to validate them and\n * retrieve as an array or an object\n *\n * @class CellCoords\n */\nvar CellCoords = function () {\n /**\n * @param {Number} row Row index\n * @param {Number} col Column index\n */\n function CellCoords(row, col) {\n _classCallCheck(this, CellCoords);\n\n if (typeof row !== 'undefined' && typeof col !== 'undefined') {\n this.row = row;\n this.col = col;\n } else {\n this.row = null;\n this.col = null;\n }\n }\n\n /**\n * Checks if given set of coordinates is valid in context of a given Walkontable instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Boolean}\n */\n\n\n _createClass(CellCoords, [{\n key: 'isValid',\n value: function isValid(wotInstance) {\n // is it a valid cell index (0 or higher)\n if (this.row < 0 || this.col < 0) {\n return false;\n }\n // is selection within total rows and columns\n if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks if this cell coords are the same as cell coords given as a parameter\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isEqual',\n value: function isEqual(cellCoords) {\n if (cellCoords === this) {\n return true;\n }\n\n return this.row === cellCoords.row && this.col === cellCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in south-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSouthEastOf',\n value: function isSouthEastOf(testedCoords) {\n return this.row >= testedCoords.row && this.col >= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in north-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNorthWestOf',\n value: function isNorthWestOf(testedCoords) {\n return this.row <= testedCoords.row && this.col <= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in south-west from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSouthWestOf',\n value: function isSouthWestOf(testedCoords) {\n return this.row >= testedCoords.row && this.col <= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in north-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNorthEastOf',\n value: function isNorthEastOf(testedCoords) {\n return this.row <= testedCoords.row && this.col >= testedCoords.col;\n }\n }]);\n\n return CellCoords;\n}();\n\nexports.default = CellCoords;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _autoResize = __webpack_require__(183);\n\nvar _autoResize2 = _interopRequireDefault(_autoResize);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar TextEditor = _baseEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor TextEditor\n * @class TextEditor\n * @dependencies autoResize\n */\nTextEditor.prototype.init = function () {\n var that = this;\n this.createElements();\n this.eventManager = new _eventManager2.default(this);\n this.bindEvents();\n this.autoResize = (0, _autoResize2.default)();\n\n this.instance.addHook('afterDestroy', function () {\n that.destroy();\n });\n};\n\nTextEditor.prototype.getValue = function () {\n return this.TEXTAREA.value;\n};\n\nTextEditor.prototype.setValue = function (newValue) {\n this.TEXTAREA.value = newValue;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n var instance = this,\n that = instance.getActiveEditor(),\n ctrlDown;\n\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n // Process only events that have been fired in the editor\n if (event.target !== that.TEXTAREA || (0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) {\n // when CTRL or its equivalent is pressed and cell is edited, don't prepare selectable text in textarea\n (0, _event.stopImmediatePropagation)(event);\n return;\n }\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ARROW_RIGHT:\n if (that.isInFullEditMode()) {\n if (!that.isWaiting() && !that.allowKeyEventPropagation || !that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode)) {\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n break;\n case _unicode.KEY_CODES.ARROW_LEFT:\n if (that.isInFullEditMode()) {\n if (!that.isWaiting() && !that.allowKeyEventPropagation || !that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode)) {\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n break;\n case _unicode.KEY_CODES.ARROW_UP:\n case _unicode.KEY_CODES.ARROW_DOWN:\n if (that.isInFullEditMode()) {\n if (!that.isWaiting() && !that.allowKeyEventPropagation || !that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode)) {\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n break;\n\n case _unicode.KEY_CODES.ENTER:\n var selected = that.instance.getSelected();\n var isMultipleSelection = !(selected[0] === selected[2] && selected[1] === selected[3]);\n if (ctrlDown && !isMultipleSelection || event.altKey) {\n // if ctrl+enter or alt+enter, add new line\n if (that.isOpened()) {\n var caretPosition = (0, _element.getCaretPosition)(that.TEXTAREA),\n value = that.getValue();\n\n var newValue = value.slice(0, caretPosition) + '\\n' + value.slice(caretPosition);\n\n that.setValue(newValue);\n\n (0, _element.setCaretPosition)(that.TEXTAREA, caretPosition + 1);\n } else {\n that.beginEditing(that.originalValue + '\\n');\n }\n (0, _event.stopImmediatePropagation)(event);\n }\n event.preventDefault(); // don't add newline to field\n break;\n\n case _unicode.KEY_CODES.A:\n case _unicode.KEY_CODES.X:\n case _unicode.KEY_CODES.C:\n case _unicode.KEY_CODES.V:\n if (ctrlDown) {\n (0, _event.stopImmediatePropagation)(event); // CTRL+A, CTRL+C, CTRL+V, CTRL+X should only work locally when cell is edited (not in table context)\n }\n break;\n\n case _unicode.KEY_CODES.BACKSPACE:\n case _unicode.KEY_CODES.DELETE:\n case _unicode.KEY_CODES.HOME:\n case _unicode.KEY_CODES.END:\n (0, _event.stopImmediatePropagation)(event); // backspace, delete, home, end should only work locally when cell is edited (not in table context)\n break;\n default:\n break;\n }\n\n if ([_unicode.KEY_CODES.ARROW_UP, _unicode.KEY_CODES.ARROW_RIGHT, _unicode.KEY_CODES.ARROW_DOWN, _unicode.KEY_CODES.ARROW_LEFT].indexOf(event.keyCode) === -1) {\n that.autoResize.resize(String.fromCharCode(event.keyCode));\n }\n};\n\nTextEditor.prototype.open = function () {\n this.refreshDimensions(); // need it instantly, to prevent https://github.com/handsontable/handsontable/issues/348\n\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nTextEditor.prototype.close = function (tdOutside) {\n this.textareaParentStyle.display = 'none';\n\n this.autoResize.unObserve();\n\n if (document.activeElement === this.TEXTAREA) {\n this.instance.listen(); // don't refocus the table if user focused some cell outside of HT on purpose\n }\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nTextEditor.prototype.focus = function () {\n this.TEXTAREA.focus();\n (0, _element.setCaretPosition)(this.TEXTAREA, this.TEXTAREA.value.length);\n};\n\nTextEditor.prototype.createElements = function () {\n // this.$body = $(document.body);\n\n this.TEXTAREA = document.createElement('TEXTAREA');\n\n (0, _element.addClass)(this.TEXTAREA, 'handsontableInput');\n\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n\n this.TEXTAREA_PARENT = document.createElement('DIV');\n (0, _element.addClass)(this.TEXTAREA_PARENT, 'handsontableInputHolder');\n\n this.textareaParentStyle = this.TEXTAREA_PARENT.style;\n this.textareaParentStyle.top = 0;\n this.textareaParentStyle.left = 0;\n this.textareaParentStyle.display = 'none';\n\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n\n this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);\n\n var that = this;\n this.instance._registerTimeout(setTimeout(function () {\n that.refreshDimensions();\n }, 0));\n};\n\nTextEditor.prototype.getEditedCell = function () {\n var editorSection = this.checkEditorSection(),\n editedCell;\n\n switch (editorSection) {\n case 'top':\n editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 101;\n break;\n case 'top-left-corner':\n editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 103;\n break;\n case 'bottom-left-corner':\n editedCell = this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 103;\n break;\n case 'left':\n editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 102;\n break;\n case 'bottom':\n editedCell = this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 102;\n break;\n default:\n editedCell = this.instance.getCell(this.row, this.col);\n this.textareaParentStyle.zIndex = '';\n break;\n }\n\n return editedCell != -1 && editedCell != -2 ? editedCell : void 0;\n};\n\nTextEditor.prototype.refreshValue = function () {\n var sourceData = this.instance.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n};\n\nTextEditor.prototype.refreshDimensions = function () {\n if (this.state !== _baseEditor.EditorState.EDITING) {\n return;\n }\n this.TD = this.getEditedCell();\n\n // TD is outside of the viewport.\n if (!this.TD) {\n this.close(true);\n\n return;\n }\n var currentOffset = (0, _element.offset)(this.TD),\n containerOffset = (0, _element.offset)(this.instance.rootElement),\n scrollableContainer = (0, _element.getScrollableElement)(this.TD),\n totalRowsCount = this.instance.countRows(),\n\n\n // If colHeaders is disabled, cells in the first row have border-top\n editTopModifier = currentOffset.top === containerOffset.top ? 0 : 1,\n editTop = currentOffset.top - containerOffset.top - editTopModifier - (scrollableContainer.scrollTop || 0),\n editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),\n settings = this.instance.getSettings(),\n rowHeadersCount = this.instance.hasRowHeaders(),\n colHeadersCount = this.instance.hasColHeaders(),\n editorSection = this.checkEditorSection(),\n backgroundColor = this.TD.style.backgroundColor,\n cssTransformOffset;\n\n // TODO: Refactor this to the new instance.getCell method (from #ply-59), after 0.12.1 is released\n switch (editorSection) {\n case 'top':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'left':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'top-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n default:\n break;\n }\n\n if (colHeadersCount && this.instance.getSelected()[0] === 0 || settings.fixedRowsBottom && this.instance.getSelected()[0] === totalRowsCount - settings.fixedRowsBottom) {\n editTop += 1;\n }\n\n if (this.instance.getSelected()[1] === 0) {\n editLeft += 1;\n }\n\n if (cssTransformOffset && cssTransformOffset != -1) {\n this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n (0, _element.resetCssTransform)(this.TEXTAREA_PARENT);\n }\n\n this.textareaParentStyle.top = editTop + 'px';\n this.textareaParentStyle.left = editLeft + 'px';\n\n var firstRowOffset = this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition;\n var firstColumnOffset = this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition;\n var horizontalScrollPosition = this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition();\n var verticalScrollPosition = this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition();\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n var cellTopOffset = this.TD.offsetTop + firstRowOffset - verticalScrollPosition;\n var cellLeftOffset = this.TD.offsetLeft + firstColumnOffset - horizontalScrollPosition;\n\n var width = (0, _element.innerWidth)(this.TD) - 8;\n var actualVerticalScrollbarWidth = (0, _element.hasVerticalScrollbar)(scrollableContainer) ? scrollbarWidth : 0;\n var actualHorizontalScrollbarWidth = (0, _element.hasHorizontalScrollbar)(scrollableContainer) ? scrollbarWidth : 0;\n var maxWidth = this.instance.view.maximumVisibleElementWidth(cellLeftOffset) - 9 - actualVerticalScrollbarWidth;\n var height = this.TD.scrollHeight + 1;\n var maxHeight = Math.max(this.instance.view.maximumVisibleElementHeight(cellTopOffset) - actualHorizontalScrollbarWidth, 23);\n\n var cellComputedStyle = (0, _element.getComputedStyle)(this.TD);\n\n this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize;\n this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily;\n this.TEXTAREA.style.backgroundColor = ''; // RESET STYLE\n this.TEXTAREA.style.backgroundColor = backgroundColor ? backgroundColor : (0, _element.getComputedStyle)(this.TEXTAREA).backgroundColor;\n\n this.autoResize.init(this.TEXTAREA, {\n minHeight: Math.min(height, maxHeight),\n maxHeight: maxHeight, // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n minWidth: Math.min(width, maxWidth),\n maxWidth: maxWidth // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n }, true);\n\n this.textareaParentStyle.display = 'block';\n};\n\nTextEditor.prototype.bindEvents = function () {\n var editor = this;\n\n this.eventManager.addEventListener(this.TEXTAREA, 'cut', function (event) {\n (0, _event.stopPropagation)(event);\n });\n\n this.eventManager.addEventListener(this.TEXTAREA, 'paste', function (event) {\n (0, _event.stopPropagation)(event);\n });\n\n this.instance.addHook('afterScrollHorizontally', function () {\n editor.refreshDimensions();\n });\n\n this.instance.addHook('afterScrollVertically', function () {\n editor.refreshDimensions();\n });\n\n this.instance.addHook('afterColumnResize', function () {\n editor.refreshDimensions();\n editor.focus();\n });\n\n this.instance.addHook('afterRowResize', function () {\n editor.refreshDimensions();\n editor.focus();\n });\n\n this.instance.addHook('afterDestroy', function () {\n editor.eventManager.destroy();\n });\n};\n\nTextEditor.prototype.destroy = function () {\n this.eventManager.destroy();\n};\n\nexports.default = TextEditor;\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports) {\n\nvar core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports) {\n\nmodule.exports = {};\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar META = __webpack_require__(49)('meta')\n , isObject = __webpack_require__(15)\n , has = __webpack_require__(22)\n , setDesc = __webpack_require__(19).f\n , id = 0;\nvar isExtensible = Object.isExtensible || function(){\n return true;\n};\nvar FREEZE = !__webpack_require__(31)(function(){\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function(it){\n setDesc(it, META, {value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n }});\n};\nvar fastKey = function(it, create){\n // return primitive with prefix\n if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return 'F';\n // not necessary to add metadata\n if(!create)return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function(it, create){\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return true;\n // not necessary to add metadata\n if(!create)return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function(it){\n if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports) {\n\nexports.f = {}.propertyIsEnumerable;\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar def = __webpack_require__(19).f\n , has = __webpack_require__(22)\n , TAG = __webpack_require__(10)('toStringTag');\n\nmodule.exports = function(it, tag, stat){\n if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});\n};\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports) {\n\nvar id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.ITEMS = exports.UNDO = exports.SEPARATOR = exports.ROW_BELOW = exports.ROW_ABOVE = exports.REMOVE_ROW = exports.REMOVE_COLUMN = exports.REDO = exports.READ_ONLY = exports.COLUMN_RIGHT = exports.COLUMN_LEFT = exports.CLEAR_COLUMN = exports.ALIGNMENT = undefined;\n\nvar _predefinedItems2;\n\nvar _alignment = __webpack_require__(223);\n\nObject.defineProperty(exports, 'ALIGNMENT', {\n enumerable: true,\n get: function get() {\n return _alignment.KEY;\n }\n});\n\nvar _clearColumn = __webpack_require__(224);\n\nObject.defineProperty(exports, 'CLEAR_COLUMN', {\n enumerable: true,\n get: function get() {\n return _clearColumn.KEY;\n }\n});\n\nvar _columnLeft = __webpack_require__(225);\n\nObject.defineProperty(exports, 'COLUMN_LEFT', {\n enumerable: true,\n get: function get() {\n return _columnLeft.KEY;\n }\n});\n\nvar _columnRight = __webpack_require__(226);\n\nObject.defineProperty(exports, 'COLUMN_RIGHT', {\n enumerable: true,\n get: function get() {\n return _columnRight.KEY;\n }\n});\n\nvar _readOnly = __webpack_require__(227);\n\nObject.defineProperty(exports, 'READ_ONLY', {\n enumerable: true,\n get: function get() {\n return _readOnly.KEY;\n }\n});\n\nvar _redo = __webpack_require__(228);\n\nObject.defineProperty(exports, 'REDO', {\n enumerable: true,\n get: function get() {\n return _redo.KEY;\n }\n});\n\nvar _removeColumn = __webpack_require__(229);\n\nObject.defineProperty(exports, 'REMOVE_COLUMN', {\n enumerable: true,\n get: function get() {\n return _removeColumn.KEY;\n }\n});\n\nvar _removeRow = __webpack_require__(230);\n\nObject.defineProperty(exports, 'REMOVE_ROW', {\n enumerable: true,\n get: function get() {\n return _removeRow.KEY;\n }\n});\n\nvar _rowAbove = __webpack_require__(231);\n\nObject.defineProperty(exports, 'ROW_ABOVE', {\n enumerable: true,\n get: function get() {\n return _rowAbove.KEY;\n }\n});\n\nvar _rowBelow = __webpack_require__(232);\n\nObject.defineProperty(exports, 'ROW_BELOW', {\n enumerable: true,\n get: function get() {\n return _rowBelow.KEY;\n }\n});\n\nvar _separator = __webpack_require__(70);\n\nObject.defineProperty(exports, 'SEPARATOR', {\n enumerable: true,\n get: function get() {\n return _separator.KEY;\n }\n});\n\nvar _undo = __webpack_require__(233);\n\nObject.defineProperty(exports, 'UNDO', {\n enumerable: true,\n get: function get() {\n return _undo.KEY;\n }\n});\nexports.predefinedItems = predefinedItems;\nexports.addItem = addItem;\n\nvar _object = __webpack_require__(2);\n\nvar _alignment2 = _interopRequireDefault(_alignment);\n\nvar _clearColumn2 = _interopRequireDefault(_clearColumn);\n\nvar _columnLeft2 = _interopRequireDefault(_columnLeft);\n\nvar _columnRight2 = _interopRequireDefault(_columnRight);\n\nvar _readOnly2 = _interopRequireDefault(_readOnly);\n\nvar _redo2 = _interopRequireDefault(_redo);\n\nvar _removeColumn2 = _interopRequireDefault(_removeColumn);\n\nvar _removeRow2 = _interopRequireDefault(_removeRow);\n\nvar _rowAbove2 = _interopRequireDefault(_rowAbove);\n\nvar _rowBelow2 = _interopRequireDefault(_rowBelow);\n\nvar _separator2 = _interopRequireDefault(_separator);\n\nvar _undo2 = _interopRequireDefault(_undo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar ITEMS = exports.ITEMS = [_rowAbove.KEY, _rowBelow.KEY, _columnLeft.KEY, _columnRight.KEY, _clearColumn.KEY, _removeRow.KEY, _removeColumn.KEY, _undo.KEY, _redo.KEY, _readOnly.KEY, _alignment.KEY, _separator.KEY];\n\nvar _predefinedItems = (_predefinedItems2 = {}, _defineProperty(_predefinedItems2, _separator.KEY, _separator2.default), _defineProperty(_predefinedItems2, _rowAbove.KEY, _rowAbove2.default), _defineProperty(_predefinedItems2, _rowBelow.KEY, _rowBelow2.default), _defineProperty(_predefinedItems2, _columnLeft.KEY, _columnLeft2.default), _defineProperty(_predefinedItems2, _columnRight.KEY, _columnRight2.default), _defineProperty(_predefinedItems2, _clearColumn.KEY, _clearColumn2.default), _defineProperty(_predefinedItems2, _removeRow.KEY, _removeRow2.default), _defineProperty(_predefinedItems2, _removeColumn.KEY, _removeColumn2.default), _defineProperty(_predefinedItems2, _undo.KEY, _undo2.default), _defineProperty(_predefinedItems2, _redo.KEY, _redo2.default), _defineProperty(_predefinedItems2, _readOnly.KEY, _readOnly2.default), _defineProperty(_predefinedItems2, _alignment.KEY, _alignment2.default), _predefinedItems2);\n\n/**\n * Gets new object with all predefined menu items.\n *\n * @returns {Object}\n */\nfunction predefinedItems() {\n var items = {};\n\n (0, _object.objectEach)(_predefinedItems, function (itemFactory, key) {\n items[key] = itemFactory();\n });\n\n return items;\n}\n\n/**\n * Add new predefined menu item to the collection.\n *\n * @param {String} key Menu command id.\n * @param {Object} item Object command descriptor.\n */\nfunction addItem(key, item) {\n if (ITEMS.indexOf(key) === -1) {\n _predefinedItems[key] = item;\n }\n}\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = staticRegister;\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar collection = exports.collection = new Map();\n\nfunction staticRegister() {\n var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'common';\n\n if (!collection.has(namespace)) {\n collection.set(namespace, new Map());\n }\n var subCollection = collection.get(namespace);\n\n /**\n * Register an item to the collection. If the item under the same was exist earlier then this item will be replaced with new one.\n *\n * @param {String} name Identification of the item.\n * @param {*} item Item to save in the collection.\n */\n function register(name, item) {\n subCollection.set(name, item);\n }\n\n /**\n * Retrieve the item from the collection.\n *\n * @param {String} name Identification of the item.\n * @returns {*} Returns item which was saved in the collection.\n */\n function getItem(name) {\n return subCollection.get(name);\n }\n\n /**\n * Check if item under specyfied name is exists.\n *\n * @param {String} name Identification of the item.\n * @returns {Boolean} Returns `true` or `false` depends on if element exists in the collection.\n */\n function hasItem(name) {\n return subCollection.has(name);\n }\n\n /**\n * Retrieve list of names registered from the collection.\n *\n * @returns {Array} Returns an array of strings with all names under which objects are stored.\n */\n function getNames() {\n return [].concat(_toConsumableArray(subCollection.keys()));\n }\n\n /**\n * Retrieve all registered values from the collection.\n *\n * @returns {Array} Returns an array with all values stored in the collection.\n */\n function getValues() {\n return [].concat(_toConsumableArray(subCollection.values()));\n }\n\n return {\n register: register,\n getItem: getItem,\n hasItem: hasItem,\n getNames: getNames,\n getValues: getValues\n };\n}\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(it, Constructor, name, forbiddenField){\n if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = __webpack_require__(29)\n , IObject = __webpack_require__(76)\n , toObject = __webpack_require__(41)\n , toLength = __webpack_require__(24)\n , asc = __webpack_require__(278);\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(13)\n , $export = __webpack_require__(3)\n , redefine = __webpack_require__(33)\n , redefineAll = __webpack_require__(59)\n , meta = __webpack_require__(46)\n , forOf = __webpack_require__(56)\n , anInstance = __webpack_require__(52)\n , isObject = __webpack_require__(15)\n , fails = __webpack_require__(31)\n , $iterDetect = __webpack_require__(77)\n , setToStringTag = __webpack_require__(48)\n , inheritIfRequired = __webpack_require__(281);\n\nmodule.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){\n var Base = global[NAME]\n , C = Base\n , ADDER = IS_MAP ? 'set' : 'add'\n , proto = C && C.prototype\n , O = {};\n var fixMethod = function(KEY){\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function(a){\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a){\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a){\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){\n new C().entries().next();\n }))){\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C\n // early implementations not supports chaining\n , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n , BUGGY_ZERO = !IS_WEAK && fails(function(){\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C()\n , index = 5;\n while(index--)$instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if(!ACCEPT_ITERABLES){ \n C = wrapper(function(target, iterable){\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base, target, C);\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);\n // weak collections should not contains .clear method\n if(IS_WEAK && proto.clear)delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar hide = __webpack_require__(32)\n , redefine = __webpack_require__(33)\n , fails = __webpack_require__(31)\n , defined = __webpack_require__(30)\n , wks = __webpack_require__(10);\n\nmodule.exports = function(KEY, length, exec){\n var SYMBOL = wks(KEY)\n , fns = exec(defined, SYMBOL, ''[KEY])\n , strfn = fns[0]\n , rxfn = fns[1];\n if(fails(function(){\n var O = {};\n O[SYMBOL] = function(){ return 7; };\n return ''[KEY](O) != 7;\n })){\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function(string, arg){ return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function(string){ return rxfn.call(string, this); }\n );\n }\n};\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(29)\n , call = __webpack_require__(165)\n , isArrayIter = __webpack_require__(161)\n , anObject = __webpack_require__(18)\n , toLength = __webpack_require__(24)\n , getIterFn = __webpack_require__(176)\n , BREAK = {}\n , RETURN = {};\nvar exports = module.exports = function(iterable, entries, fn, that, ITERATOR){\n var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)\n , f = ctx(fn, that, entries ? 2 : 1)\n , index = 0\n , length, step, iterator, result;\n if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if(result === BREAK || result === RETURN)return result;\n } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){\n result = call(iterator, f, step.value, entries);\n if(result === BREAK || result === RETURN)return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports) {\n\nmodule.exports = false;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\nexports.f = Object.getOwnPropertySymbols;\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar redefine = __webpack_require__(33);\nmodule.exports = function(target, src, safe){\n for(var key in src)redefine(target, key, src[key], safe);\n return target;\n};\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(61)\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports) {\n\n// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_62__;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredCellTypes = exports.getRegisteredCellTypeNames = exports.hasCellType = exports.getCellType = exports.registerCellType = undefined;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar _autocompleteType = __webpack_require__(190);\n\nvar _autocompleteType2 = _interopRequireDefault(_autocompleteType);\n\nvar _checkboxType = __webpack_require__(191);\n\nvar _checkboxType2 = _interopRequireDefault(_checkboxType);\n\nvar _dateType = __webpack_require__(192);\n\nvar _dateType2 = _interopRequireDefault(_dateType);\n\nvar _dropdownType = __webpack_require__(193);\n\nvar _dropdownType2 = _interopRequireDefault(_dropdownType);\n\nvar _handsontableType = __webpack_require__(194);\n\nvar _handsontableType2 = _interopRequireDefault(_handsontableType);\n\nvar _numericType = __webpack_require__(195);\n\nvar _numericType2 = _interopRequireDefault(_numericType);\n\nvar _passwordType = __webpack_require__(196);\n\nvar _passwordType2 = _interopRequireDefault(_passwordType);\n\nvar _textType = __webpack_require__(197);\n\nvar _textType2 = _interopRequireDefault(_textType);\n\nvar _timeType = __webpack_require__(198);\n\nvar _timeType2 = _interopRequireDefault(_timeType);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _staticRegister = (0, _staticRegister3.default)('cellTypes'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\n_register('autocomplete', _autocompleteType2.default);\n_register('checkbox', _checkboxType2.default);\n_register('date', _dateType2.default);\n_register('dropdown', _dropdownType2.default);\n_register('handsontable', _handsontableType2.default);\n_register('numeric', _numericType2.default);\n_register('password', _passwordType2.default);\n_register('text', _textType2.default);\n_register('time', _timeType2.default);\n\n/**\n * Retrieve cell type object.\n *\n * @param {String} name Cell type identification.\n * @returns {Object} Returns cell type object.\n */\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error('You declared cell type \"' + name + '\" as a string that is not mapped to a known object.\\n Cell type must be an object or a string mapped to an object registered by \"Handsontable.cellTypes.registerCellType\" method');\n }\n\n return getItem(name);\n}\n\n/**\n * Register cell type under specified name.\n *\n * @param {String} name Cell type identification.\n * @param {Object} type An object with contains keys (eq: `editor`, `renderer`, `validator`) which describes specified behaviour of the cell.\n */\nfunction _register(name, type) {\n var editor = type.editor,\n renderer = type.renderer,\n validator = type.validator;\n\n\n if (editor) {\n (0, _editors.registerEditor)(name, editor);\n }\n if (renderer) {\n (0, _renderers.registerRenderer)(name, renderer);\n }\n if (validator) {\n (0, _validators.registerValidator)(name, validator);\n }\n\n register(name, type);\n}\n\nexports.registerCellType = _register;\nexports.getCellType = _getItem;\nexports.hasCellType = hasItem;\nexports.getRegisteredCellTypeNames = getNames;\nexports.getRegisteredCellTypes = getValues;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = Core;\n\nvar _numbro = __webpack_require__(86);\n\nvar _numbro2 = _interopRequireDefault(_numbro);\n\nvar _element = __webpack_require__(0);\n\nvar _setting = __webpack_require__(66);\n\nvar _function = __webpack_require__(35);\n\nvar _mixed = __webpack_require__(20);\n\nvar _browser = __webpack_require__(25);\n\nvar _dataMap = __webpack_require__(199);\n\nvar _dataMap2 = _interopRequireDefault(_dataMap);\n\nvar _editorManager = __webpack_require__(201);\n\nvar _editorManager2 = _interopRequireDefault(_editorManager);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _plugins = __webpack_require__(5);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar _string = __webpack_require__(27);\n\nvar _number = __webpack_require__(6);\n\nvar _tableView = __webpack_require__(267);\n\nvar _tableView2 = _interopRequireDefault(_tableView);\n\nvar _dataSource = __webpack_require__(200);\n\nvar _dataSource2 = _interopRequireDefault(_dataSource);\n\nvar _data = __webpack_require__(65);\n\nvar _recordTranslator = __webpack_require__(153);\n\nvar _src = __webpack_require__(11);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _defaultSettings = __webpack_require__(87);\n\nvar _defaultSettings2 = _interopRequireDefault(_defaultSettings);\n\nvar _cellTypes = __webpack_require__(63);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar activeGuid = null;\n\n/**\n * Handsontable constructor\n *\n * @core\n * @dependencies numbro\n * @constructor Core\n * @description\n *\n * After Handsontable is constructed, you can modify the grid behavior using the available public methods.\n *\n * ---\n * ## How to call methods\n *\n * These are 2 equal ways to call a Handsontable method:\n *\n * ```js\n * // all following examples assume that you constructed Handsontable like this\n * var ht = new Handsontable(document.getElementById('example1'), options);\n *\n * // now, to use setDataAtCell method, you can either:\n * ht.setDataAtCell(0, 0, 'new value');\n * ```\n *\n * Alternatively, you can call the method using jQuery wrapper (__obsolete__, requires initialization using our jQuery guide\n * ```js\n * $('#example1').handsontable('setDataAtCell', 0, 0, 'new value');\n * ```\n * ---\n */\nfunction Core(rootElement, userSettings) {\n var priv,\n datamap,\n dataSource,\n grid,\n selection,\n editorManager,\n instance = this,\n GridSettings = function GridSettings() {},\n eventManager = new _eventManager2.default(instance);\n\n (0, _object.extend)(GridSettings.prototype, _defaultSettings2.default.prototype); // create grid settings as a copy of default settings\n (0, _object.extend)(GridSettings.prototype, userSettings); // overwrite defaults with user settings\n (0, _object.extend)(GridSettings.prototype, expandType(userSettings));\n\n this.rootElement = rootElement;\n this.isHotTableEnv = (0, _element.isChildOfWebComponentTable)(this.rootElement);\n _eventManager2.default.isHotTableEnv = this.isHotTableEnv;\n\n this.container = document.createElement('DIV');\n this.renderCall = false;\n\n rootElement.insertBefore(this.container, rootElement.firstChild);\n\n this.guid = 'ht_' + (0, _string.randomString)(); // this is the namespace for global events\n\n var recordTranslator = (0, _recordTranslator.getTranslator)(instance);\n\n dataSource = new _dataSource2.default(instance);\n\n if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') {\n this.rootElement.id = this.guid; // if root element does not have an id, assign a random id\n }\n priv = {\n cellSettings: [],\n columnSettings: [],\n columnsSettingConflicts: ['data', 'width'],\n settings: new GridSettings(), // current settings instance\n selRange: null, // exposed by public method `getSelectedRange`\n isPopulated: null,\n scrollable: null,\n firstRun: true\n };\n\n grid = {\n /**\n * Inserts or removes rows and columns\n *\n * @memberof Core#\n * @function alter\n * @private\n * @param {String} action Possible values: \"insert_row\", \"insert_col\", \"remove_row\", \"remove_col\"\n * @param {Number} index\n * @param {Number} amount\n * @param {String} [source] Optional. Source of hook runner.\n * @param {Boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows.\n */\n alter: function alter(action, index, amount, source, keepEmptyRows) {\n var delta;\n\n amount = amount || 1;\n\n function spliceWith(data, index, count, toInject) {\n var valueFactory = function valueFactory() {\n var result = void 0;\n\n if (toInject === 'array') {\n result = [];\n } else if (toInject === 'object') {\n result = {};\n }\n\n return result;\n };\n var spliceArgs = (0, _array.arrayMap)(new Array(count), function () {\n return valueFactory();\n });\n\n spliceArgs.unshift(index, 0);\n data.splice.apply(data, _toConsumableArray(spliceArgs));\n }\n\n /* eslint-disable no-case-declarations */\n switch (action) {\n case 'insert_row':\n\n var numberOfSourceRows = instance.countSourceRows();\n\n if (instance.getSettings().maxRows === numberOfSourceRows) {\n return;\n }\n\n index = (0, _mixed.isDefined)(index) ? index : numberOfSourceRows;\n\n delta = datamap.createRow(index, amount, source);\n spliceWith(priv.cellSettings, index, amount, 'array');\n\n if (delta) {\n if (selection.isSelected() && priv.selRange.from.row >= index) {\n priv.selRange.from.row += delta;\n selection.transformEnd(delta, 0); // will call render() internally\n } else {\n selection.refreshBorders(); // it will call render and prepare methods\n }\n }\n break;\n\n case 'insert_col':\n delta = datamap.createCol(index, amount, source);\n\n for (var row = 0, len = instance.countSourceRows(); row < len; row++) {\n if (priv.cellSettings[row]) {\n spliceWith(priv.cellSettings[row], index, amount);\n }\n }\n\n if (delta) {\n if (Array.isArray(instance.getSettings().colHeaders)) {\n var spliceArray = [index, 0];\n spliceArray.length += delta; // inserts empty (undefined) elements at the end of an array\n Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray); // inserts empty (undefined) elements into the colHeader array\n }\n\n if (selection.isSelected() && priv.selRange.from.col >= index) {\n priv.selRange.from.col += delta;\n selection.transformEnd(0, delta); // will call render() internally\n } else {\n selection.refreshBorders(); // it will call render and prepare methods\n }\n }\n break;\n\n case 'remove_row':\n datamap.removeRow(index, amount, source);\n priv.cellSettings.splice(index, amount);\n\n var totalRows = instance.countRows();\n var fixedRowsTop = instance.getSettings().fixedRowsTop;\n if (fixedRowsTop >= index + 1) {\n instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index);\n }\n\n var fixedRowsBottom = instance.getSettings().fixedRowsBottom;\n if (fixedRowsBottom && index >= totalRows - fixedRowsBottom) {\n instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom);\n }\n\n grid.adjustRowsAndCols();\n selection.refreshBorders(); // it will call render and prepare methods\n break;\n\n case 'remove_col':\n var logicalColumnIndex = recordTranslator.toPhysicalColumn(index);\n\n datamap.removeCol(index, amount, source);\n\n for (var _row = 0, _len = instance.countSourceRows(); _row < _len; _row++) {\n if (priv.cellSettings[_row]) {\n // if row hasn't been rendered it wouldn't have cellSettings\n priv.cellSettings[_row].splice(logicalColumnIndex, amount);\n }\n }\n var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft;\n\n if (fixedColumnsLeft >= index + 1) {\n instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index);\n }\n\n if (Array.isArray(instance.getSettings().colHeaders)) {\n if (typeof logicalColumnIndex == 'undefined') {\n logicalColumnIndex = -1;\n }\n instance.getSettings().colHeaders.splice(logicalColumnIndex, amount);\n }\n\n grid.adjustRowsAndCols();\n selection.refreshBorders(); // it will call render and prepare methods\n\n break;\n default:\n throw new Error('There is no such action \"' + action + '\"');\n }\n\n if (!keepEmptyRows) {\n grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh\n }\n },\n\n\n /**\n * Makes sure there are empty rows at the bottom of the table\n */\n adjustRowsAndCols: function adjustRowsAndCols() {\n if (priv.settings.minRows) {\n // should I add empty rows to data source to meet minRows?\n var rows = instance.countRows();\n\n if (rows < priv.settings.minRows) {\n for (var r = 0, minRows = priv.settings.minRows; r < minRows - rows; r++) {\n datamap.createRow(instance.countRows(), 1, 'auto');\n }\n }\n }\n if (priv.settings.minSpareRows) {\n var emptyRows = instance.countEmptyRows(true);\n\n // should I add empty rows to meet minSpareRows?\n if (emptyRows < priv.settings.minSpareRows) {\n for (; emptyRows < priv.settings.minSpareRows && instance.countSourceRows() < priv.settings.maxRows; emptyRows++) {\n datamap.createRow(instance.countRows(), 1, 'auto');\n }\n }\n }\n {\n var emptyCols = void 0;\n\n // count currently empty cols\n if (priv.settings.minCols || priv.settings.minSpareCols) {\n emptyCols = instance.countEmptyCols(true);\n }\n\n // should I add empty cols to meet minCols?\n if (priv.settings.minCols && !priv.settings.columns && instance.countCols() < priv.settings.minCols) {\n for (; instance.countCols() < priv.settings.minCols; emptyCols++) {\n datamap.createCol(instance.countCols(), 1, 'auto');\n }\n }\n // should I add empty cols to meet minSpareCols?\n if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' && emptyCols < priv.settings.minSpareCols) {\n for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) {\n datamap.createCol(instance.countCols(), 1, 'auto');\n }\n }\n }\n var rowCount = instance.countRows();\n var colCount = instance.countCols();\n\n if (rowCount === 0 || colCount === 0) {\n selection.deselect();\n }\n\n if (selection.isSelected()) {\n var selectionChanged = false;\n var fromRow = priv.selRange.from.row;\n var fromCol = priv.selRange.from.col;\n var toRow = priv.selRange.to.row;\n var toCol = priv.selRange.to.col;\n\n // if selection is outside, move selection to last row\n if (fromRow > rowCount - 1) {\n fromRow = rowCount - 1;\n selectionChanged = true;\n\n if (toRow > fromRow) {\n toRow = fromRow;\n }\n } else if (toRow > rowCount - 1) {\n toRow = rowCount - 1;\n selectionChanged = true;\n\n if (fromRow > toRow) {\n fromRow = toRow;\n }\n }\n // if selection is outside, move selection to last row\n if (fromCol > colCount - 1) {\n fromCol = colCount - 1;\n selectionChanged = true;\n\n if (toCol > fromCol) {\n toCol = fromCol;\n }\n } else if (toCol > colCount - 1) {\n toCol = colCount - 1;\n selectionChanged = true;\n\n if (fromCol > toCol) {\n fromCol = toCol;\n }\n }\n\n if (selectionChanged) {\n instance.selectCell(fromRow, fromCol, toRow, toCol);\n }\n }\n if (instance.view) {\n instance.view.wt.wtOverlays.adjustElementsSize();\n }\n },\n\n\n /**\n * Populate the data from the provided 2d array from the given cell coordinates.\n *\n * @private\n * @param {Object} start Start selection position.\n * @param {Array} input 2d data array.\n * @param {Object} [end] End selection position (only for drag-down mode).\n * @param {String} [source=\"populateFromArray\"] Source information string.\n * @param {String} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {String} direction (left|right|up|down) String specifying the direction.\n * @param {Array} deltas The deltas array.\n * @returns {Object|undefined} ending td in pasted area (only if any cell was changed).\n */\n populateFromArray: function populateFromArray(start, input, end, source, method, direction, deltas) {\n var r,\n rlen,\n c,\n clen,\n setData = [],\n current = {};\n\n rlen = input.length;\n\n if (rlen === 0) {\n return false;\n }\n\n var repeatCol,\n repeatRow,\n cmax,\n rmax,\n baseEnd = {\n row: end === null ? null : end.row,\n col: end === null ? null : end.col\n };\n\n /* eslint-disable no-case-declarations */\n // insert data with specified pasteMode method\n switch (method) {\n case 'shift_down':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n input = (0, _data.translateRowsToColumns)(input);\n for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) {\n if (c < clen) {\n var _instance;\n\n for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) {\n input[c].push(input[c][r % rlen]);\n }\n input[c].unshift(start.col + c, start.row, 0);\n (_instance = instance).spliceCol.apply(_instance, _toConsumableArray(input[c]));\n } else {\n var _instance2;\n\n input[c % clen][0] = start.col + c;\n (_instance2 = instance).spliceCol.apply(_instance2, _toConsumableArray(input[c % clen]));\n }\n }\n break;\n\n case 'shift_right':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) {\n if (r < rlen) {\n var _instance3;\n\n for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) {\n input[r].push(input[r][c % clen]);\n }\n input[r].unshift(start.row + r, start.col, 0);\n (_instance3 = instance).spliceRow.apply(_instance3, _toConsumableArray(input[r]));\n } else {\n var _instance4;\n\n input[r % rlen][0] = start.row + r;\n (_instance4 = instance).spliceRow.apply(_instance4, _toConsumableArray(input[r % rlen]));\n }\n }\n break;\n\n case 'overwrite':\n default:\n // overwrite and other not specified options\n current.row = start.row;\n current.col = start.col;\n\n var selected = { // selected range\n row: end && start ? end.row - start.row + 1 : 1,\n col: end && start ? end.col - start.col + 1 : 1\n };\n var skippedRow = 0;\n var skippedColumn = 0;\n var pushData = true;\n var cellMeta = void 0;\n\n var getInputValue = function getInputValue(row) {\n var col = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var rowValue = input[row % input.length];\n\n if (col !== null) {\n return rowValue[col % rowValue.length];\n }\n\n return rowValue;\n };\n var rowInputLength = input.length;\n var rowSelectionLength = end ? end.row - start.row + 1 : 0;\n\n if (end) {\n rlen = rowSelectionLength;\n } else {\n rlen = Math.max(rowInputLength, rowSelectionLength);\n }\n for (r = 0; r < rlen; r++) {\n if (end && current.row > end.row && rowSelectionLength > rowInputLength || !priv.settings.allowInsertRow && current.row > instance.countRows() - 1 || current.row >= priv.settings.maxRows) {\n break;\n }\n var logicalRow = r - skippedRow;\n var colInputLength = getInputValue(logicalRow).length;\n var colSelectionLength = end ? end.col - start.col + 1 : 0;\n\n if (end) {\n clen = colSelectionLength;\n } else {\n clen = Math.max(colInputLength, colSelectionLength);\n }\n current.col = start.col;\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.autofill') && cellMeta.skipRowOnPaste) {\n skippedRow++;\n current.row++;\n rlen++;\n /* eslint-disable no-continue */\n continue;\n }\n skippedColumn = 0;\n\n for (c = 0; c < clen; c++) {\n if (end && current.col > end.col && colSelectionLength > colInputLength || !priv.settings.allowInsertColumn && current.col > instance.countCols() - 1 || current.col >= priv.settings.maxCols) {\n break;\n }\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.fill') && cellMeta.skipColumnOnPaste) {\n skippedColumn++;\n current.col++;\n clen++;\n continue;\n }\n if (cellMeta.readOnly) {\n current.col++;\n /* eslint-disable no-continue */\n continue;\n }\n var logicalColumn = c - skippedColumn;\n var value = getInputValue(logicalRow, logicalColumn);\n var orgValue = instance.getDataAtCell(current.row, current.col);\n var index = {\n row: logicalRow,\n col: logicalColumn\n };\n\n if (source === 'Autofill.fill') {\n var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);\n\n if (result) {\n value = (0, _mixed.isUndefined)(result.value) ? value : result.value;\n }\n }\n if (value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n if (orgValue === null || (typeof orgValue === 'undefined' ? 'undefined' : _typeof(orgValue)) !== 'object') {\n pushData = false;\n } else {\n var orgValueSchema = (0, _object.duckSchema)(orgValue[0] || orgValue);\n var valueSchema = (0, _object.duckSchema)(value[0] || value);\n\n /* eslint-disable max-depth */\n if ((0, _object.isObjectEquals)(orgValueSchema, valueSchema)) {\n value = (0, _object.deepClone)(value);\n } else {\n pushData = false;\n }\n }\n } else if (orgValue !== null && (typeof orgValue === 'undefined' ? 'undefined' : _typeof(orgValue)) === 'object') {\n pushData = false;\n }\n if (pushData) {\n setData.push([current.row, current.col, value]);\n }\n pushData = true;\n current.col++;\n }\n current.row++;\n }\n instance.setDataAtCell(setData, null, null, source || 'populateFromArray');\n break;\n }\n }\n };\n\n /* eslint-disable no-multi-assign */\n this.selection = selection = { // this public assignment is only temporary\n inProgress: false,\n\n selectedHeader: {\n cols: false,\n rows: false\n },\n\n /**\n * @param {Boolean} [rows=false]\n * @param {Boolean} [cols=false]\n * @param {Boolean} [corner=false]\n */\n setSelectedHeaders: function setSelectedHeaders() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var cols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var corner = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n instance.selection.selectedHeader.rows = rows;\n instance.selection.selectedHeader.cols = cols;\n instance.selection.selectedHeader.corner = corner;\n },\n\n\n /**\n * Sets inProgress to `true`. This enables onSelectionEnd and onSelectionEndByProp to function as desired.\n */\n begin: function begin() {\n instance.selection.inProgress = true;\n },\n\n\n /**\n * Sets inProgress to `false`. Triggers onSelectionEnd and onSelectionEndByProp.\n */\n finish: function finish() {\n var sel = instance.getSelected();\n instance.runHooks('afterSelectionEnd', sel[0], sel[1], sel[2], sel[3]);\n instance.runHooks('afterSelectionEndByProp', sel[0], instance.colToProp(sel[1]), sel[2], instance.colToProp(sel[3]));\n instance.selection.inProgress = false;\n },\n\n\n /**\n * @returns {Boolean}\n */\n isInProgress: function isInProgress() {\n return instance.selection.inProgress;\n },\n\n\n /**\n * Starts selection range on given td object.\n *\n * @param {CellCoords} coords\n * @param keepEditorOpened\n */\n setRangeStart: function setRangeStart(coords, keepEditorOpened) {\n instance.runHooks('beforeSetRangeStart', coords);\n priv.selRange = new _src.CellRange(coords, coords, coords);\n selection.setRangeEnd(coords, null, keepEditorOpened);\n },\n\n\n /**\n * Starts selection range on given td object.\n *\n * @param {CellCoords} coords\n * @param keepEditorOpened\n */\n setRangeStartOnly: function setRangeStartOnly(coords) {\n instance.runHooks('beforeSetRangeStartOnly', coords);\n priv.selRange = new _src.CellRange(coords, coords, coords);\n },\n\n\n /**\n * Ends selection range on given td object.\n *\n * @param {CellCoords} coords\n * @param {Boolean} [scrollToCell=true] If `true`, viewport will be scrolled to range end\n * @param {Boolean} [keepEditorOpened] If `true`, cell editor will be still opened after changing selection range\n */\n setRangeEnd: function setRangeEnd(coords, scrollToCell, keepEditorOpened) {\n if (priv.selRange === null) {\n return;\n }\n var disableVisualSelection,\n isHeaderSelected = false,\n areCoordsPositive = true;\n\n var firstVisibleRow = instance.view.wt.wtTable.getFirstVisibleRow();\n var firstVisibleColumn = instance.view.wt.wtTable.getFirstVisibleColumn();\n var newRangeCoords = {\n row: null,\n col: null\n };\n\n // trigger handlers\n instance.runHooks('beforeSetRangeEnd', coords);\n instance.selection.begin();\n\n newRangeCoords.row = coords.row < 0 ? firstVisibleRow : coords.row;\n newRangeCoords.col = coords.col < 0 ? firstVisibleColumn : coords.col;\n\n priv.selRange.to = new _src.CellCoords(newRangeCoords.row, newRangeCoords.col);\n\n if (!priv.settings.multiSelect) {\n priv.selRange.from = coords;\n }\n // set up current selection\n instance.view.wt.selections.current.clear();\n\n disableVisualSelection = instance.getCellMeta(priv.selRange.highlight.row, priv.selRange.highlight.col).disableVisualSelection;\n\n if (typeof disableVisualSelection === 'string') {\n disableVisualSelection = [disableVisualSelection];\n }\n\n if (disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('current') === -1) {\n instance.view.wt.selections.current.add(priv.selRange.highlight);\n }\n // set up area selection\n instance.view.wt.selections.area.clear();\n\n if ((disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('area') === -1) && selection.isMultiple()) {\n instance.view.wt.selections.area.add(priv.selRange.from);\n instance.view.wt.selections.area.add(priv.selRange.to);\n }\n // set up highlight\n if (priv.settings.currentHeaderClassName || priv.settings.currentRowClassName || priv.settings.currentColClassName) {\n instance.view.wt.selections.highlight.clear();\n instance.view.wt.selections.highlight.add(priv.selRange.from);\n instance.view.wt.selections.highlight.add(priv.selRange.to);\n }\n\n var preventScrolling = (0, _object.createObjectPropListener)('value');\n\n // trigger handlers\n instance.runHooks('afterSelection', priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col, preventScrolling);\n instance.runHooks('afterSelectionByProp', priv.selRange.from.row, datamap.colToProp(priv.selRange.from.col), priv.selRange.to.row, datamap.colToProp(priv.selRange.to.col), preventScrolling);\n\n 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) {\n isHeaderSelected = true;\n }\n\n if (coords.row < 0 || coords.col < 0) {\n areCoordsPositive = false;\n }\n\n if (preventScrolling.isTouched()) {\n scrollToCell = !preventScrolling.value;\n }\n\n if (scrollToCell !== false && !isHeaderSelected && areCoordsPositive) {\n if (priv.selRange.from && !selection.isMultiple()) {\n instance.view.scrollViewport(priv.selRange.from);\n } else {\n instance.view.scrollViewport(coords);\n }\n }\n\n if (selection.selectedHeader.rows && selection.selectedHeader.cols) {\n (0, _element.addClass)(instance.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n } else if (selection.selectedHeader.rows) {\n (0, _element.removeClass)(instance.rootElement, 'ht__selection--columns');\n (0, _element.addClass)(instance.rootElement, 'ht__selection--rows');\n } else if (selection.selectedHeader.cols) {\n (0, _element.removeClass)(instance.rootElement, 'ht__selection--rows');\n (0, _element.addClass)(instance.rootElement, 'ht__selection--columns');\n } else {\n (0, _element.removeClass)(instance.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n }\n\n selection.refreshBorders(null, keepEditorOpened);\n },\n\n\n /**\n * Destroys editor, redraws borders around cells, prepares editor.\n *\n * @param {Boolean} [revertOriginal]\n * @param {Boolean} [keepEditor]\n */\n refreshBorders: function refreshBorders(revertOriginal, keepEditor) {\n if (!keepEditor) {\n editorManager.destroyEditor(revertOriginal);\n }\n instance.view.render();\n\n if (selection.isSelected() && !keepEditor) {\n editorManager.prepareEditor();\n }\n },\n\n\n /**\n * Returns information if we have a multiselection.\n *\n * @returns {Boolean}\n */\n isMultiple: function isMultiple() {\n var isMultiple = !(priv.selRange.to.col === priv.selRange.from.col && priv.selRange.to.row === priv.selRange.from.row),\n modifier = instance.runHooks('afterIsMultipleSelection', isMultiple);\n\n if (isMultiple) {\n return modifier;\n }\n },\n\n\n /**\n * Selects cell relative to current cell (if possible).\n */\n transformStart: function transformStart(rowDelta, colDelta, force, keepEditorOpened) {\n var delta = new _src.CellCoords(rowDelta, colDelta),\n rowTransformDir = 0,\n colTransformDir = 0,\n totalRows,\n totalCols,\n coords,\n fixedRowsBottom;\n\n instance.runHooks('modifyTransformStart', delta);\n totalRows = instance.countRows();\n totalCols = instance.countCols();\n fixedRowsBottom = instance.getSettings().fixedRowsBottom;\n\n if (priv.selRange.highlight.row + rowDelta > totalRows - 1) {\n if (force && priv.settings.minSpareRows > 0 && !(fixedRowsBottom && priv.selRange.highlight.row >= totalRows - fixedRowsBottom - 1)) {\n instance.alter('insert_row', totalRows);\n totalRows = instance.countRows();\n } else if (priv.settings.autoWrapCol) {\n delta.row = 1 - totalRows;\n delta.col = priv.selRange.highlight.col + delta.col == totalCols - 1 ? 1 - totalCols : 1;\n }\n } else if (priv.settings.autoWrapCol && priv.selRange.highlight.row + delta.row < 0 && priv.selRange.highlight.col + delta.col >= 0) {\n delta.row = totalRows - 1;\n delta.col = priv.selRange.highlight.col + delta.col == 0 ? totalCols - 1 : -1;\n }\n\n if (priv.selRange.highlight.col + delta.col > totalCols - 1) {\n if (force && priv.settings.minSpareCols > 0) {\n instance.alter('insert_col', totalCols);\n totalCols = instance.countCols();\n } else if (priv.settings.autoWrapRow) {\n delta.row = priv.selRange.highlight.row + delta.row == totalRows - 1 ? 1 - totalRows : 1;\n delta.col = 1 - totalCols;\n }\n } else if (priv.settings.autoWrapRow && priv.selRange.highlight.col + delta.col < 0 && priv.selRange.highlight.row + delta.row >= 0) {\n delta.row = priv.selRange.highlight.row + delta.row == 0 ? totalRows - 1 : -1;\n delta.col = totalCols - 1;\n }\n\n coords = new _src.CellCoords(priv.selRange.highlight.row + delta.row, priv.selRange.highlight.col + delta.col);\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n instance.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);\n selection.setRangeStart(coords, keepEditorOpened);\n },\n\n\n /**\n * Sets selection end cell relative to current selection end cell (if possible).\n */\n transformEnd: function transformEnd(rowDelta, colDelta) {\n var delta = new _src.CellCoords(rowDelta, colDelta),\n rowTransformDir = 0,\n colTransformDir = 0,\n totalRows,\n totalCols,\n coords;\n\n instance.runHooks('modifyTransformEnd', delta);\n\n totalRows = instance.countRows();\n totalCols = instance.countCols();\n coords = new _src.CellCoords(priv.selRange.to.row + delta.row, priv.selRange.to.col + delta.col);\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n instance.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);\n selection.setRangeEnd(coords, true);\n },\n\n\n /**\n * Returns `true` if currently there is a selection on screen, `false` otherwise.\n *\n * @returns {Boolean}\n */\n isSelected: function isSelected() {\n return priv.selRange !== null;\n },\n\n\n /**\n * Returns `true` if coords is within current selection coords.\n *\n * @param {CellCoords} coords\n * @returns {Boolean}\n */\n inInSelection: function inInSelection(coords) {\n if (!selection.isSelected()) {\n return false;\n }\n\n return priv.selRange.includes(coords);\n },\n\n\n /**\n * Deselects all selected cells\n */\n deselect: function deselect() {\n if (!selection.isSelected()) {\n return;\n }\n instance.selection.inProgress = false; // needed by HT inception\n priv.selRange = null;\n instance.view.wt.selections.current.clear();\n instance.view.wt.selections.area.clear();\n if (priv.settings.currentHeaderClassName || priv.settings.currentRowClassName || priv.settings.currentColClassName) {\n instance.view.wt.selections.highlight.clear();\n }\n editorManager.destroyEditor();\n selection.refreshBorders();\n (0, _element.removeClass)(instance.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n instance.runHooks('afterDeselect');\n },\n\n\n /**\n * Select all cells\n */\n selectAll: function selectAll() {\n if (!priv.settings.multiSelect) {\n return;\n }\n selection.setSelectedHeaders(true, true, true);\n selection.setRangeStart(new _src.CellCoords(0, 0));\n selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, instance.countCols() - 1), false);\n },\n\n\n /**\n * Deletes data from selected cells\n */\n empty: function empty() {\n if (!selection.isSelected()) {\n return;\n }\n var topLeft = priv.selRange.getTopLeftCorner();\n var bottomRight = priv.selRange.getBottomRightCorner();\n var r,\n c,\n changes = [];\n\n for (r = topLeft.row; r <= bottomRight.row; r++) {\n for (c = topLeft.col; c <= bottomRight.col; c++) {\n if (!instance.getCellMeta(r, c).readOnly) {\n changes.push([r, c, '']);\n }\n }\n }\n instance.setDataAtCell(changes);\n }\n };\n\n this.init = function () {\n dataSource.setData(priv.settings.data);\n instance.runHooks('beforeInit');\n\n if ((0, _browser.isMobileBrowser)()) {\n (0, _element.addClass)(instance.rootElement, 'mobile');\n }\n\n this.updateSettings(priv.settings, true);\n\n this.view = new _tableView2.default(this);\n editorManager = new _editorManager2.default(instance, priv, selection, datamap);\n\n this.forceFullRender = true; // used when data was changed\n\n instance.runHooks('init');\n this.view.render();\n\n if (_typeof(priv.firstRun) === 'object') {\n instance.runHooks('afterChange', priv.firstRun[0], priv.firstRun[1]);\n priv.firstRun = false;\n }\n instance.runHooks('afterInit');\n };\n\n function ValidatorsQueue() {\n // moved this one level up so it can be used in any function here. Probably this should be moved to a separate file\n var resolved = false;\n\n return {\n validatorsInQueue: 0,\n valid: true,\n addValidatorToQueue: function addValidatorToQueue() {\n this.validatorsInQueue++;\n resolved = false;\n },\n removeValidatorFormQueue: function removeValidatorFormQueue() {\n this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;\n this.checkIfQueueIsEmpty();\n },\n onQueueEmpty: function onQueueEmpty(valid) {},\n checkIfQueueIsEmpty: function checkIfQueueIsEmpty() {\n if (this.validatorsInQueue == 0 && resolved == false) {\n resolved = true;\n this.onQueueEmpty(this.valid);\n }\n }\n };\n }\n\n function validateChanges(changes, source, callback) {\n var waitingForValidator = new ValidatorsQueue();\n waitingForValidator.onQueueEmpty = resolve;\n\n for (var i = changes.length - 1; i >= 0; i--) {\n if (changes[i] === null) {\n changes.splice(i, 1);\n } else {\n var row = changes[i][0];\n var col = datamap.propToCol(changes[i][1]);\n\n var cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.type === 'numeric' && typeof changes[i][3] === 'string') {\n if (changes[i][3].length > 0 && (/^-?[\\d\\s]*(\\.|,)?\\d*$/.test(changes[i][3]) || cellProperties.format)) {\n var len = changes[i][3].length;\n\n if ((0, _mixed.isUndefined)(cellProperties.language)) {\n _numbro2.default.culture('en-US');\n } else if (changes[i][3].indexOf('.') === len - 3 && changes[i][3].indexOf(',') === -1) {\n // this input in format XXXX.XX is likely to come from paste. Let's parse it using international rules\n _numbro2.default.culture('en-US');\n } else {\n\n _numbro2.default.culture(cellProperties.language);\n }\n\n var _numbro$cultureData = _numbro2.default.cultureData(_numbro2.default.culture()),\n delimiters = _numbro$cultureData.delimiters;\n\n // try to parse to float - https://github.com/foretagsplatsen/numbro/pull/183\n\n\n if (_numbro2.default.validate(changes[i][3]) && !isNaN(changes[i][3])) {\n changes[i][3] = parseFloat(changes[i][3]);\n } else {\n changes[i][3] = (0, _numbro2.default)().unformat(changes[i][3]) || changes[i][3];\n }\n }\n }\n\n /* eslint-disable no-loop-func */\n if (instance.getCellValidator(cellProperties)) {\n waitingForValidator.addValidatorToQueue();\n instance.validateCell(changes[i][3], cellProperties, function (i, cellProperties) {\n return function (result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n if (result === false && cellProperties.allowInvalid === false) {\n changes.splice(i, 1); // cancel the change\n cellProperties.valid = true; // we cancelled the change, so cell value is still valid\n var cell = instance.getCell(cellProperties.row, cellProperties.col);\n (0, _element.removeClass)(cell, instance.getSettings().invalidCellClassName);\n --i;\n }\n waitingForValidator.removeValidatorFormQueue();\n };\n }(i, cellProperties), source);\n }\n }\n }\n waitingForValidator.checkIfQueueIsEmpty();\n\n function resolve() {\n var beforeChangeResult;\n\n if (changes.length) {\n beforeChangeResult = instance.runHooks('beforeChange', changes, source);\n if ((0, _function.isFunction)(beforeChangeResult)) {\n 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).');\n } else if (beforeChangeResult === false) {\n changes.splice(0, changes.length); // invalidate all changes (remove everything from array)\n }\n }\n callback(); // called when async validators are resolved and beforeChange was not async\n }\n }\n\n /**\n * Internal function to apply changes. Called after validateChanges\n *\n * @private\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue]\n * @param {String} source String that identifies how this change will be described in changes array (useful in onChange callback)\n * @fires Hooks#beforeChangeRender\n * @fires Hooks#afterChange\n */\n function applyChanges(changes, source) {\n var i = changes.length - 1;\n\n if (i < 0) {\n return;\n }\n\n for (; i >= 0; i--) {\n var skipThisChange = false;\n\n if (changes[i] === null) {\n changes.splice(i, 1);\n /* eslint-disable no-continue */\n continue;\n }\n\n if (changes[i][2] == null && changes[i][3] == null) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (priv.settings.allowInsertRow) {\n while (changes[i][0] > instance.countRows() - 1) {\n var numberOfCreatedRows = datamap.createRow(void 0, void 0, source);\n\n if (numberOfCreatedRows === 0) {\n skipThisChange = true;\n break;\n }\n }\n }\n\n if (skipThisChange) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (instance.dataType === 'array' && (!priv.settings.columns || priv.settings.columns.length === 0) && priv.settings.allowInsertColumn) {\n while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) {\n datamap.createCol(void 0, void 0, source);\n }\n }\n\n datamap.set(changes[i][0], changes[i][1], changes[i][3]);\n }\n\n instance.forceFullRender = true; // used when data was changed\n grid.adjustRowsAndCols();\n instance.runHooks('beforeChangeRender', changes, source);\n selection.refreshBorders(null, true);\n instance.view.wt.wtOverlays.adjustElementsSize();\n instance.runHooks('afterChange', changes, source || 'edit');\n\n var activeEditor = instance.getActiveEditor();\n\n if (activeEditor && (0, _mixed.isDefined)(activeEditor.refreshValue)) {\n activeEditor.refreshValue();\n }\n }\n\n this.validateCell = function (value, cellProperties, callback, source) {\n var validator = instance.getCellValidator(cellProperties);\n\n function done(valid) {\n var col = cellProperties.visualCol,\n row = cellProperties.visualRow,\n td = instance.getCell(row, col, true);\n\n if (td && td.nodeName != 'TH') {\n instance.view.wt.wtSettings.settings.cellRenderer(row, col, td);\n }\n callback(valid);\n }\n\n if ((0, _mixed.isRegExp)(validator)) {\n validator = function (validator) {\n return function (value, callback) {\n callback(validator.test(value));\n };\n }(validator);\n }\n\n if ((0, _function.isFunction)(validator)) {\n\n value = instance.runHooks('beforeValidate', value, cellProperties.visualRow, cellProperties.prop, source);\n\n // To provide consistent behaviour, validation should be always asynchronous\n instance._registerTimeout(setTimeout(function () {\n validator.call(cellProperties, value, function (valid) {\n valid = instance.runHooks('afterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n cellProperties.valid = valid;\n\n done(valid);\n instance.runHooks('postAfterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n });\n }, 0));\n } else {\n // resolve callback even if validator function was not found\n instance._registerTimeout(setTimeout(function () {\n cellProperties.valid = true;\n done(cellProperties.valid);\n }, 0));\n }\n };\n\n function setDataInputToArray(row, propOrCol, value) {\n if ((typeof row === 'undefined' ? 'undefined' : _typeof(row)) === 'object') {\n // is it an array of changes\n return row;\n }\n return [[row, propOrCol, value]];\n }\n\n /**\n * @description\n * Set new value to a cell. To change many cells at once, pass an array of `changes` in format `[[row, col, value], ...]` as\n * the only parameter. `col` is the index of a __visible__ column (note that if columns were reordered,\n * the current visible order will be used). `source` is a flag for before/afterChange events. If you pass only array of\n * changes then `source` could be set as second parameter.\n *\n * @memberof Core#\n * @function setDataAtCell\n * @param {Number|Array} row Row index or array of changes in format `[[row, col, value], ...]`.\n * @param {Number} col Column index.\n * @param {String} value New value.\n * @param {String} [source] String that identifies how this change will be described in the changes array (useful in onAfterChange or onBeforeChange callback).\n */\n this.setDataAtCell = function (row, col, value, source) {\n var input = setDataInputToArray(row, col, value),\n i,\n ilen,\n changes = [],\n prop;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n if (_typeof(input[i]) !== 'object') {\n throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter');\n }\n if (typeof input[i][1] !== 'number') {\n throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`');\n }\n prop = datamap.colToProp(input[i][1]);\n changes.push([input[i][0], prop, dataSource.getAtCell(recordTranslator.toPhysicalRow(input[i][0]), input[i][1]), input[i][2]]);\n }\n\n if (!source && (typeof row === 'undefined' ? 'undefined' : _typeof(row)) === 'object') {\n source = col;\n }\n\n instance.runHooks('afterSetDataAtCell', changes, source);\n\n validateChanges(changes, source, function () {\n applyChanges(changes, source);\n });\n };\n\n /**\n * @description\n * Set new value to a cell. To change many cells at once, pass an array of `changes` in format `[[row, prop, value], ...]` as\n * the only parameter. `prop` is the name of the object property (e.g. `first.name`). `source` is a flag for before/afterChange events.\n * If you pass only array of changes then `source` could be set as second parameter.\n *\n * @memberof Core#\n * @function setDataAtRowProp\n * @param {Number|Array} row Row index or array of changes in format `[[row, prop, value], ...]`.\n * @param {String} prop Property name or the source string.\n * @param {String} value Value to be set.\n * @param {String} [source] String that identifies how this change will be described in changes array (useful in onChange callback).\n */\n this.setDataAtRowProp = function (row, prop, value, source) {\n var input = setDataInputToArray(row, prop, value),\n i,\n ilen,\n changes = [];\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n changes.push([input[i][0], input[i][1], dataSource.getAtCell(recordTranslator.toPhysicalRow(input[i][0]), input[i][1]), input[i][2]]);\n }\n\n if (!source && (typeof row === 'undefined' ? 'undefined' : _typeof(row)) === 'object') {\n source = prop;\n }\n\n instance.runHooks('afterSetDataAtRowProp', changes, source);\n\n validateChanges(changes, source, function () {\n applyChanges(changes, source);\n });\n };\n\n /**\n * Listen to the keyboard input on document body.\n *\n * @memberof Core#\n * @function listen\n * @since 0.11\n */\n this.listen = function () {\n activeGuid = instance.guid;\n };\n\n /**\n * Stop listening to keyboard input on the document body.\n *\n * @memberof Core#\n * @function unlisten\n * @since 0.11\n */\n this.unlisten = function () {\n activeGuid = null;\n };\n\n /**\n * Returns `true` if the current Handsontable instance is listening to keyboard input on document body.\n *\n * @memberof Core#\n * @function isListening\n * @since 0.11\n * @returns {Boolean} `true` if the instance is listening, `false` otherwise.\n */\n this.isListening = function () {\n return activeGuid === instance.guid;\n };\n\n /**\n * Destroys the current editor, renders and selects the current cell.\n *\n * @memberof Core#\n * @function destroyEditor\n * @param {Boolean} [revertOriginal] If != `true`, edited data is saved. Otherwise the previous value is restored.\n */\n this.destroyEditor = function (revertOriginal) {\n selection.refreshBorders(revertOriginal);\n };\n\n /**\n * Populate cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`).\n * Use `endRow`, `endCol` when you want to cut input when a certain row is reached.\n * Optional `source` parameter (default value \"populateFromArray\") is used to identify this call in the resulting events (beforeChange, afterChange).\n * Optional `populateMethod` parameter (default value \"overwrite\", possible values \"shift_down\" and \"shift_right\")\n * has the same effect as pasteMode option {@link Options#pasteMode}\n *\n * @memberof Core#\n * @function populateFromArray\n * @since 0.9.0\n * @param {Number} row Start row\n * @param {Number} col Start column\n * @param {Array} input 2d array\n * @param {Number} [endRow] End row (use when you want to cut input when certain row is reached)\n * @param {Number} [endCol] End column (use when you want to cut input when certain column is reached)\n * @param {String} [source=\"populateFromArray\"] Source string.\n * @param {String} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {String} direction Populate direction. (left|right|up|down)\n * @param {Array} deltas Deltas array.\n * @returns {Object|undefined} The ending TD element in pasted area (only if any cells were changed).\n */\n this.populateFromArray = function (row, col, input, endRow, endCol, source, method, direction, deltas) {\n var c;\n\n if (!((typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && _typeof(input[0]) === 'object')) {\n throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly\n }\n c = typeof endRow === 'number' ? new _src.CellCoords(endRow, endCol) : null;\n\n return grid.populateFromArray(new _src.CellCoords(row, col), input, c, source, method, direction, deltas);\n };\n\n /**\n * Adds/removes data from the column. This function is modelled after Array.splice.\n * Parameter `col` is the index of the column in which do you want to do splice.\n * Parameter `index` is the row index at which to start changing the array.\n * If negative, will begin that many elements from the end. Parameter `amount`, is the number of the old array elements to remove.\n * If the amount is 0, no elements are removed. Fourth and further parameters are the `elements` to add to the array.\n * If you don't specify any elements, spliceCol simply removes elements from the array.\n * {@link DataMap#spliceCol}\n *\n * @memberof Core#\n * @function spliceCol\n * @since 0.9-beta2\n * @param {Number} col Index of the column in which do you want to do splice.\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {*} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n */\n this.spliceCol = function (col, index, amount /* , elements... */) {\n var _datamap;\n\n return (_datamap = datamap).spliceCol.apply(_datamap, arguments);\n };\n\n /**\n * Adds/removes data from the row. This function works is modelled after Array.splice.\n * Parameter `row` is the index of row in which do you want to do splice.\n * Parameter `index` is the column index at which to start changing the array.\n * If negative, will begin that many elements from the end. Parameter `amount`, is the number of old array elements to remove.\n * If the amount is 0, no elements are removed. Fourth and further parameters are the `elements` to add to the array.\n * If you don't specify any elements, spliceCol simply removes elements from the array.\n * {@link DataMap#spliceRow}\n *\n * @memberof Core#\n * @function spliceRow\n * @since 0.11\n * @param {Number} row Index of column in which do you want to do splice.\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {*} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n */\n this.spliceRow = function (row, index, amount /* , elements... */) {\n var _datamap2;\n\n return (_datamap2 = datamap).spliceRow.apply(_datamap2, arguments);\n };\n\n /**\n * Returns indexes of the currently selected cells as an array `[startRow, startCol, endRow, endCol]`.\n *\n * Start row and start col are the coordinates of the active cell (where the selection was started).\n *\n * @memberof Core#\n * @function getSelected\n * @returns {Array} Array of the selection's indexes.\n */\n this.getSelected = function () {\n // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return [priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col];\n }\n };\n\n /**\n * Returns the current selection as a CellRange object.\n *\n * @memberof Core#\n * @function getSelectedRange\n * @since 0.11\n * @returns {CellRange} Selected range object or undefined` if there is no selection.\n */\n this.getSelectedRange = function () {\n // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return priv.selRange;\n }\n };\n\n /**\n * Rerender the table.\n *\n * @memberof Core#\n * @function render\n */\n this.render = function () {\n if (instance.view) {\n instance.renderCall = true;\n instance.forceFullRender = true; // used when data was changed\n selection.refreshBorders(null, true);\n }\n };\n\n /**\n * Reset all cells in the grid to contain data from the data array.\n *\n * @memberof Core#\n * @function loadData\n * @param {Array} data Array of arrays or array of objects containing data.\n * @fires Hooks#afterLoadData\n * @fires Hooks#afterChange\n */\n this.loadData = function (data) {\n if (Array.isArray(priv.settings.dataSchema)) {\n instance.dataType = 'array';\n } else if ((0, _function.isFunction)(priv.settings.dataSchema)) {\n instance.dataType = 'function';\n } else {\n instance.dataType = 'object';\n }\n\n if (datamap) {\n datamap.destroy();\n }\n datamap = new _dataMap2.default(instance, priv, GridSettings);\n\n if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object' && data !== null) {\n if (!(data.push && data.splice)) {\n // check if data is array. Must use duck-type check so Backbone Collections also pass it\n // when data is not an array, attempt to make a single-row array of it\n data = [data];\n }\n } else if (data === null) {\n data = [];\n var row;\n var r = 0;\n var rlen = 0;\n var dataSchema = datamap.getSchema();\n\n for (r = 0, rlen = priv.settings.startRows; r < rlen; r++) {\n if ((instance.dataType === 'object' || instance.dataType === 'function') && priv.settings.dataSchema) {\n row = (0, _object.deepClone)(dataSchema);\n data.push(row);\n } else if (instance.dataType === 'array') {\n row = (0, _object.deepClone)(dataSchema[0]);\n data.push(row);\n } else {\n row = [];\n\n for (var c = 0, clen = priv.settings.startCols; c < clen; c++) {\n row.push(null);\n }\n\n data.push(row);\n }\n }\n } else {\n throw new Error('loadData only accepts array of objects or array of arrays (' + (typeof data === 'undefined' ? 'undefined' : _typeof(data)) + ' given)');\n }\n\n priv.isPopulated = false;\n GridSettings.prototype.data = data;\n\n if (Array.isArray(data[0])) {\n instance.dataType = 'array';\n }\n\n datamap.dataSource = data;\n dataSource.data = data;\n dataSource.dataType = instance.dataType;\n dataSource.colToProp = datamap.colToProp.bind(datamap);\n dataSource.propToCol = datamap.propToCol.bind(datamap);\n\n clearCellSettingCache();\n\n grid.adjustRowsAndCols();\n instance.runHooks('afterLoadData', priv.firstRun);\n\n if (priv.firstRun) {\n priv.firstRun = [null, 'loadData'];\n } else {\n instance.runHooks('afterChange', null, 'loadData');\n instance.render();\n }\n priv.isPopulated = true;\n\n function clearCellSettingCache() {\n priv.cellSettings.length = 0;\n }\n };\n\n /**\n * Returns the current data object (the same one that was passed by `data` configuration option or `loadData` method,\n * unless the `modifyRow` hook was used to trim some of the rows. If that's the case - use the {@link Core#getSourceData} method.).\n * Optionally you can provide cell range by defining `row`, `col`, `row2`, `col2` to get only a fragment of grid data.\n *\n * Note: getData functionality changed with the release of version 0.20. If you're looking for the previous functionality,\n * you should use the {@link Core#getSourceData} method.\n *\n * @memberof Core#\n * @function getData\n * @param {Number} [r] From row.\n * @param {Number} [c] From column.\n * @param {Number} [r2] To row.\n * @param {Number} [c2] To column.\n * @returns {Array} Array with the data.\n */\n this.getData = function (r, c, r2, c2) {\n if ((0, _mixed.isUndefined)(r)) {\n return datamap.getAll();\n }\n return datamap.getRange(new _src.CellCoords(r, c), new _src.CellCoords(r2, c2), datamap.DESTINATION_RENDERER);\n };\n\n /**\n * Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new line character.\n * {@link DataMap#getCopyableText}\n *\n * @memberof Core#\n * @function getCopyableText\n * @since 0.11\n * @param {Number} startRow From row.\n * @param {Number} startCol From column.\n * @param {Number} endRow To row.\n * @param {Number} endCol To column.\n * @returns {String}\n */\n this.getCopyableText = function (startRow, startCol, endRow, endCol) {\n return datamap.getCopyableText(new _src.CellCoords(startRow, startCol), new _src.CellCoords(endRow, endCol));\n };\n\n /**\n * Returns the data's copyable value at specified row and column index ({@link DataMap#getCopyable}).\n *\n * @memberof Core#\n * @function getCopyableData\n * @since 0.19.0\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {String}\n */\n this.getCopyableData = function (row, column) {\n return datamap.getCopyable(row, datamap.colToProp(column));\n };\n\n /**\n * Returns schema provided by constructor settings. If it doesn't exist then it returns the schema based on the data\n * structure in the first row.\n *\n * @memberof Core#\n * @function getSchema\n * @since 0.13.2\n * @returns {Object} Schema object.\n */\n this.getSchema = function () {\n return datamap.getSchema();\n };\n\n /**\n * Use it if you need to change configuration after initialization. The `settings` parameter is an object containing the new\n * settings, declared the same way as in the initial settings object.\n * Note, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset\n * the settings made post-initialization. (for example - ignore changes made using the columnResize feature).\n *\n * @memberof Core#\n * @function updateSettings\n * @param {Object} settings New settings object.\n * @param {Boolean} init\n * @example\n * ```js\n * hot.updateSettings({\n * contextMenu: true,\n * colHeaders: true,\n * fixedRowsTop: 2\n * });\n * ```\n * @fires Hooks#afterCellMetaReset\n * @fires Hooks#afterUpdateSettings\n */\n this.updateSettings = function (settings, init) {\n var columnsAsFunc = false;\n var i = void 0;\n var j = void 0;\n var clen = void 0;\n\n if ((0, _mixed.isDefined)(settings.rows)) {\n throw new Error('\"rows\" setting is no longer supported. do you mean startRows, minRows or maxRows?');\n }\n if ((0, _mixed.isDefined)(settings.cols)) {\n throw new Error('\"cols\" setting is no longer supported. do you mean startCols, minCols or maxCols?');\n }\n\n for (i in settings) {\n if (i === 'data') {\n /* eslint-disable no-continue */\n continue; // loadData will be triggered later\n } else if (_pluginHooks2.default.getSingleton().getRegistered().indexOf(i) > -1) {\n if ((0, _function.isFunction)(settings[i]) || Array.isArray(settings[i])) {\n settings[i].initialHook = true;\n instance.addHook(i, settings[i]);\n }\n } else if (!init && (0, _object.hasOwnProperty)(settings, i)) {\n // Update settings\n GridSettings.prototype[i] = settings[i];\n }\n }\n\n // Load data or create data map\n if (settings.data === void 0 && priv.settings.data === void 0) {\n instance.loadData(null); // data source created just now\n } else if (settings.data !== void 0) {\n instance.loadData(settings.data); // data source given as option\n } else if (settings.columns !== void 0) {\n datamap.createMap();\n }\n\n clen = instance.countCols();\n\n var columnSetting = settings.columns || GridSettings.prototype.columns;\n\n // Init columns constructors configuration\n if (columnSetting && (0, _function.isFunction)(columnSetting)) {\n clen = instance.countSourceCols();\n columnsAsFunc = true;\n }\n\n // Clear cellSettings cache\n if (settings.cell !== void 0 || settings.cells !== void 0 || settings.columns !== void 0) {\n priv.cellSettings.length = 0;\n }\n\n if (clen > 0) {\n var proto = void 0;\n var column = void 0;\n\n for (i = 0, j = 0; i < clen; i++) {\n if (columnsAsFunc && !columnSetting(i)) {\n /* eslint-disable no-continue */\n continue;\n }\n priv.columnSettings[j] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);\n\n // shortcut for prototype\n proto = priv.columnSettings[j].prototype;\n\n // Use settings provided by user\n if (columnSetting) {\n if (columnsAsFunc) {\n column = columnSetting(i);\n } else {\n column = columnSetting[j];\n }\n\n if (column) {\n (0, _object.extend)(proto, column);\n (0, _object.extend)(proto, expandType(column));\n }\n }\n\n j++;\n }\n }\n\n if ((0, _mixed.isDefined)(settings.cell)) {\n for (var key in settings.cell) {\n if ((0, _object.hasOwnProperty)(settings.cell, key)) {\n var cell = settings.cell[key];\n\n instance.setCellMetaObject(cell.row, cell.col, cell);\n }\n }\n }\n\n instance.runHooks('afterCellMetaReset');\n\n if ((0, _mixed.isDefined)(settings.className)) {\n if (GridSettings.prototype.className) {\n (0, _element.removeClass)(instance.rootElement, GridSettings.prototype.className);\n }\n if (settings.className) {\n (0, _element.addClass)(instance.rootElement, settings.className);\n }\n }\n\n var currentHeight = instance.rootElement.style.height;\n if (currentHeight !== '') {\n currentHeight = parseInt(instance.rootElement.style.height, 10);\n }\n\n var height = settings.height;\n if ((0, _function.isFunction)(height)) {\n height = height();\n }\n\n if (init) {\n var initialStyle = instance.rootElement.getAttribute('style');\n\n if (initialStyle) {\n instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style'));\n }\n }\n\n if (height === null) {\n var _initialStyle = instance.rootElement.getAttribute('data-initialstyle');\n\n if (_initialStyle && (_initialStyle.indexOf('height') > -1 || _initialStyle.indexOf('overflow') > -1)) {\n instance.rootElement.setAttribute('style', _initialStyle);\n } else {\n instance.rootElement.style.height = '';\n instance.rootElement.style.overflow = '';\n }\n } else if (height !== void 0) {\n instance.rootElement.style.height = height + 'px';\n instance.rootElement.style.overflow = 'hidden';\n }\n\n if (typeof settings.width != 'undefined') {\n var width = settings.width;\n\n if ((0, _function.isFunction)(width)) {\n width = width();\n }\n\n instance.rootElement.style.width = width + 'px';\n }\n\n if (!init) {\n datamap.clearLengthCache(); // force clear cache length on updateSettings() #3416\n\n if (instance.view) {\n instance.view.wt.wtViewport.resetHasOversizedColumnHeadersMarked();\n }\n\n instance.runHooks('afterUpdateSettings');\n }\n\n grid.adjustRowsAndCols();\n if (instance.view && !priv.firstRun) {\n instance.forceFullRender = true; // used when data was changed\n selection.refreshBorders(null, true);\n }\n\n if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {\n instance.view.wt.wtOverlays.updateMainScrollableElements();\n }\n };\n\n /**\n * Get value from the selected cell.\n *\n * @memberof Core#\n * @function getValue\n * @since 0.11\n * @returns {*} Value of selected cell.\n */\n this.getValue = function () {\n var sel = instance.getSelected();\n if (GridSettings.prototype.getValue) {\n if ((0, _function.isFunction)(GridSettings.prototype.getValue)) {\n return GridSettings.prototype.getValue.call(instance);\n } else if (sel) {\n return instance.getData()[sel[0]][GridSettings.prototype.getValue];\n }\n } else if (sel) {\n return instance.getDataAtCell(sel[0], sel[1]);\n }\n };\n\n function expandType(obj) {\n if (!(0, _object.hasOwnProperty)(obj, 'type')) {\n // ignore obj.prototype.type\n return;\n }\n\n var type,\n expandedType = {};\n\n if (_typeof(obj.type) === 'object') {\n type = obj.type;\n } else if (typeof obj.type === 'string') {\n type = (0, _cellTypes.getCellType)(obj.type);\n }\n\n for (var i in type) {\n if ((0, _object.hasOwnProperty)(type, i) && !(0, _object.hasOwnProperty)(obj, i)) {\n expandedType[i] = type[i];\n }\n }\n\n return expandedType;\n }\n\n /**\n * Returns the object settings.\n *\n * @memberof Core#\n * @function getSettings\n * @returns {Object} Object containing the current grid settings.\n */\n this.getSettings = function () {\n return priv.settings;\n };\n\n /**\n * Clears the data from the grid. (The table settings remain intact.)\n *\n * @memberof Core#\n * @function clear\n * @since 0.11\n */\n this.clear = function () {\n selection.selectAll();\n selection.empty();\n };\n\n /**\n * @memberof Core#\n * @function alter\n * @param {String} action See grid.alter for possible values: `\"insert_row\"`, `\"insert_col\"`, `\"remove_row\"`, `\"remove_col\"`\n * @param {Number} index Index of the row/column before which the new row/column will be inserted/removed.\n * @param {Number} [amount = 1] Amound of rows/columns to be inserted/removed.\n * @param {String} [source] Source indicator.\n * @param {Boolean} [keepEmptyRows] Flag for preventing deletion of empty rows.\n * @description\n *\n * Allows altering the table structure by either inserting/removing rows or inserting/removing columns:\n *\n * Insert new row(s) above the row with a given `index`. If index is `null` or `undefined`, the new row will be\n * added after the last row.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('insert_row', 10);\n * ```\n *\n * Insert new column(s) before the column with a given `index`. If index is `null` or `undefined`, the new column\n * will be added after the last column.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('insert_col', 10);\n * ```\n *\n * Remove the row(s) at the given `index`.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('remove_row', 10);\n * ```\n *\n * Remove the column(s) at the given `index`.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('remove_col', 10);\n * ```\n */\n this.alter = function (action, index, amount, source, keepEmptyRows) {\n grid.alter(action, index, amount, source, keepEmptyRows);\n };\n\n /**\n * Returns a TD element for the given `row` and `col` arguments, if it is rendered on screen.\n * Returns `null` if the TD is not rendered on screen (probably because that part of the table is not visible).\n *\n * @memberof Core#\n * @function getCell\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Boolean} topmost If set to true, it returns the TD element from the topmost overlay. For example,\n * if the wanted cell is in the range of fixed rows, it will return a TD element from the `top` overlay.\n * @returns {Element} The cell's TD element.\n */\n this.getCell = function (row, col, topmost) {\n return instance.view.getCellAtCoords(new _src.CellCoords(row, col), topmost);\n };\n\n /**\n * Returns the coordinates of the cell, provided as a HTML Element.\n *\n * @memberof Core#\n * @function getCoords\n * @param {Element} elem The HTML Element representing the cell.\n * @returns {CellCoords} Coordinates object.\n */\n this.getCoords = function (elem) {\n return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable, elem);\n };\n\n /**\n * Returns the property name that corresponds with the given column index. {@link DataMap#colToProp}\n * If the data source is an array of arrays, it returns the columns index.\n *\n * @memberof Core#\n * @function colToProp\n * @param {Number} col Column index\n * @returns {String|Number} Column property or column index.\n */\n this.colToProp = function (col) {\n return datamap.colToProp(col);\n };\n\n /**\n * Returns column index that corresponds with the given property. {@link DataMap#propToCol}\n *\n * @memberof Core#\n * @function propToCol\n * @param {String|Number} prop Property name or column index.\n * @returns {Number} Column index.\n */\n this.propToCol = function (prop) {\n return datamap.propToCol(prop);\n };\n\n /**\n * Translate physical row index into visual.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toVisualRow\n * @param {Number} row Physical row index.\n * @returns {Number} Returns visual row index.\n */\n this.toVisualRow = function (row) {\n return recordTranslator.toVisualRow(row);\n };\n\n /**\n * Translate physical column index into visual.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toVisualColumn\n * @param {Number} column Physical column index.\n * @returns {Number} Returns visual column index.\n */\n this.toVisualColumn = function (column) {\n return recordTranslator.toVisualColumn(column);\n };\n\n /**\n * Translate visual row index into physical.\n * If displayed rows order is different than the order of rows stored in memory (i.e. sorting is applied)\n * to retrieve valid physical row index you can use this method.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toPhysicalRow\n * @param {Number} row Visual row index.\n * @returns {Number} Returns physical row index.\n */\n this.toPhysicalRow = function (row) {\n return recordTranslator.toPhysicalRow(row);\n };\n\n /**\n * Translate visual column index into physical.\n * If displayed columns order is different than the order of columns stored in memory (i.e. manual column move is applied)\n * to retrieve valid physical column index you can use this method.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toPhysicalColumn\n * @param {Number} column Visual column index.\n * @returns {Number} Returns physical column index.\n */\n this.toPhysicalColumn = function (column) {\n return recordTranslator.toPhysicalColumn(column);\n };\n\n /**\n * @description\n * Returns the cell value at `row`, `col`. `row` and `col` are the __visible__ indexes (note, that if columns were reordered or sorted,\n * the currently visible order will be used).\n *\n * @memberof Core#\n * @function getDataAtCell\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {String|Boolean|null} Data at cell.\n */\n this.getDataAtCell = function (row, col) {\n return datamap.get(row, datamap.colToProp(col));\n };\n\n /**\n * Return value at `row`, `prop`. (Uses {@link DataMap#get})\n *\n * @memberof Core#\n * @function getDataAtRowProp\n * @param {Number} row Row index.\n * @param {String} prop Property name.\n * @returns {*} Cell value.\n */\n this.getDataAtRowProp = function (row, prop) {\n return datamap.get(row, prop);\n };\n\n /**\n * @description\n * Returns array of column values from the data source. `col` is the __visible__ index of the column.\n * Note, that if columns were reordered or sorted, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtCol\n * @since 0.9-beta2\n * @param {Number} col Column index.\n * @returns {Array} Array of cell values.\n */\n this.getDataAtCol = function (col) {\n var out = [];\n return out.concat.apply(out, _toConsumableArray(datamap.getRange(new _src.CellCoords(0, col), new _src.CellCoords(priv.settings.data.length - 1, col), datamap.DESTINATION_RENDERER)));\n };\n\n /**\n * Given the object property name (e.g. `'first.name'`), returns an array of column's values from the data source.\n * You can also provide a column index as the first argument.\n *\n * @memberof Core#\n * @function getDataAtProp\n * @since 0.9-beta2\n * @param {String|Number} prop Property name / column index.\n * @returns {Array} Array of cell values.\n */\n this.getDataAtProp = function (prop) {\n var out = [],\n range;\n\n range = datamap.getRange(new _src.CellCoords(0, datamap.propToCol(prop)), new _src.CellCoords(priv.settings.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);\n\n return out.concat.apply(out, _toConsumableArray(range));\n };\n\n /**\n * Returns the source data object (the same that was passed by `data` configuration option or `loadData` method).\n * Optionally you can provide a cell range by using the `row`, `col`, `row2`, `col2` arguments, to get only a fragment of grid data.\n *\n * @memberof Core#\n * @function getSourceData\n * @since 0.20.0\n * @param {Number} [r] From row.\n * @param {Number} [c] From column.\n * @param {Number} [r2] To row.\n * @param {Number} [c2] To column.\n * @returns {Array} Array of grid data.\n */\n this.getSourceData = function (r, c, r2, c2) {\n var data = void 0;\n\n if (r === void 0) {\n data = dataSource.getData();\n } else {\n data = dataSource.getByRange(new _src.CellCoords(r, c), new _src.CellCoords(r2, c2));\n }\n\n return data;\n };\n\n /**\n * Returns the source data object as an arrays of arrays format even when source data was provided in another format.\n * Optionally you can provide a cell range by using the `row`, `col`, `row2`, `col2` arguments, to get only a fragment of grid data.\n *\n * @memberof Core#\n * @function getSourceDataArray\n * @since 0.28.0\n * @param {Number} [r] From row.\n * @param {Number} [c] From column.\n * @param {Number} [r2] To row.\n * @param {Number} [c2] To column.\n * @returns {Array} An array of arrays.\n */\n this.getSourceDataArray = function (r, c, r2, c2) {\n var data = void 0;\n\n if (r === void 0) {\n data = dataSource.getData(true);\n } else {\n data = dataSource.getByRange(new _src.CellCoords(r, c), new _src.CellCoords(r2, c2), true);\n }\n\n return data;\n };\n\n /**\n * Returns an array of column values from the data source. `col` is the index of the row in the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCol\n * @since 0.11.0-beta3\n * @param {Number} column Column index.\n * @returns {Array} Array of the column's cell values.\n */\n this.getSourceDataAtCol = function (column) {\n return dataSource.getAtColumn(column);\n };\n\n /**\n * Returns a single row of the data (array or object, depending on what you have). `row` is the index of the row in the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtRow\n * @since 0.11.0-beta3\n * @param {Number} row Row index.\n * @returns {Array|Object} Single row of data.\n */\n this.getSourceDataAtRow = function (row) {\n return dataSource.getAtRow(row);\n };\n\n /**\n * Returns a single value from the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCell\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {*} Cell data.\n * @since 0.20.0\n */\n this.getSourceDataAtCell = function (row, column) {\n return dataSource.getAtCell(row, column);\n };\n\n /**\n * @description\n * Returns a single row of the data. The `row` argument is the __visible__ index of the row.\n *\n * @memberof Core#\n * @function getDataAtRow\n * @param {Number} row Row index.\n * @returns {Array} Array of row's cell data.\n * @since 0.9-beta2\n */\n this.getDataAtRow = function (row) {\n var data = datamap.getRange(new _src.CellCoords(row, 0), new _src.CellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);\n\n return data[0] || [];\n };\n\n /**\n * @description\n * Returns a data type defined in the Handsontable settings under the `type` key ([Options#type](http://docs.handsontable.com/Options.html#type)).\n * If there are cells with different types in the selected range, it returns `'mixed'`.\n *\n * @since 0.18.1\n * @memberof Core#\n * @function getDataType\n * @param {Number} rowFrom From row index.\n * @param {Number} columnFrom To row index.\n * @param {Number} rowTo From column index.\n * @param {Number} columnTo To column index.\n * @returns {String} Cell type (e.q: `'mixed'`, `'text'`, `'numeric'`, `'autocomplete'`).\n */\n this.getDataType = function (rowFrom, columnFrom, rowTo, columnTo) {\n var _this = this;\n\n var previousType = null;\n var currentType = null;\n\n if (rowFrom === void 0) {\n rowFrom = 0;\n rowTo = this.countRows();\n columnFrom = 0;\n columnTo = this.countCols();\n }\n if (rowTo === void 0) {\n rowTo = rowFrom;\n }\n if (columnTo === void 0) {\n columnTo = columnFrom;\n }\n var type = 'mixed';\n\n (0, _number.rangeEach)(Math.min(rowFrom, rowTo), Math.max(rowFrom, rowTo), function (row) {\n var isTypeEqual = true;\n\n (0, _number.rangeEach)(Math.min(columnFrom, columnTo), Math.max(columnFrom, columnTo), function (column) {\n var cellType = _this.getCellMeta(row, column);\n\n currentType = cellType.type;\n\n if (previousType) {\n isTypeEqual = previousType === currentType;\n } else {\n previousType = currentType;\n }\n\n return isTypeEqual;\n });\n type = isTypeEqual ? currentType : 'mixed';\n\n return isTypeEqual;\n });\n\n return type;\n };\n\n /**\n * Remove a property defined by the `key` argument from the cell meta object for the provided `row` and `col` coordinates.\n *\n * @memberof Core#\n * @function removeCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} key Property name.\n */\n this.removeCellMeta = function (row, col, key) {\n var cellMeta = instance.getCellMeta(row, col);\n if (cellMeta[key] != undefined) {\n delete priv.cellSettings[row][col][key];\n }\n };\n\n /**\n * Remove one or more rows from the cell meta object.\n *\n * @since 0.30.0\n * @param {Number} index An integer that specifies at what position to add/remove items, Use negative values to specify the position from the end of the array.\n * @param {Number} deleteAmount The number of items to be removed. If set to 0, no items will be removed.\n * @param {Array} items The new items to be added to the array.\n */\n this.spliceCellsMeta = function (index, deleteAmount) {\n var _priv$cellSettings;\n\n for (var _len2 = arguments.length, items = Array(_len2 > 2 ? _len2 - 2 : 0), _key = 2; _key < _len2; _key++) {\n items[_key - 2] = arguments[_key];\n }\n\n (_priv$cellSettings = priv.cellSettings).splice.apply(_priv$cellSettings, [index, deleteAmount].concat(items));\n };\n\n /**\n * Set cell meta data object defined by `prop` to the corresponding params `row` and `col`.\n *\n * @memberof Core#\n * @function setCellMetaObject\n * @since 0.11\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} prop Meta object.\n */\n this.setCellMetaObject = function (row, col, prop) {\n if ((typeof prop === 'undefined' ? 'undefined' : _typeof(prop)) === 'object') {\n for (var key in prop) {\n if ((0, _object.hasOwnProperty)(prop, key)) {\n var value = prop[key];\n this.setCellMeta(row, col, key, value);\n }\n }\n }\n };\n\n /**\n * Sets a property defined by the `key` object to the meta object of a cell corresponding to params `row` and `col`.\n *\n * @memberof Core#\n * @function setCellMeta\n * @since 0.11\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} key Property name.\n * @param {String} val Property value.\n * @fires Hooks#afterSetCellMeta\n */\n this.setCellMeta = function (row, col, key, val) {\n var _recordTranslator$toP = recordTranslator.toPhysical(row, col);\n\n var _recordTranslator$toP2 = _slicedToArray(_recordTranslator$toP, 2);\n\n row = _recordTranslator$toP2[0];\n col = _recordTranslator$toP2[1];\n\n\n if (!priv.columnSettings[col]) {\n priv.columnSettings[col] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);\n }\n\n if (!priv.cellSettings[row]) {\n priv.cellSettings[row] = [];\n }\n if (!priv.cellSettings[row][col]) {\n priv.cellSettings[row][col] = new priv.columnSettings[col]();\n }\n priv.cellSettings[row][col][key] = val;\n instance.runHooks('afterSetCellMeta', row, col, key, val);\n };\n\n /**\n * Get all the cells meta settings at least once generated in the table (in order of cell initialization).\n *\n * @since 0.19.0\n * @returns {Array} Returns Array of ColumnSettings object.\n */\n this.getCellsMeta = function () {\n return (0, _array.arrayFlatten)(priv.cellSettings);\n };\n\n /**\n * Returns the cell properties object for the given `row` and `col` coordinates.\n *\n * @memberof Core#\n * @function getCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Object} The cell properties object.\n * @fires Hooks#beforeGetCellMeta\n * @fires Hooks#afterGetCellMeta\n */\n this.getCellMeta = function (row, col) {\n var prop = datamap.colToProp(col),\n cellProperties;\n\n var visualRow = row;\n var visualCol = col;\n\n var _recordTranslator$toP3 = recordTranslator.toPhysical(row, col);\n\n var _recordTranslator$toP4 = _slicedToArray(_recordTranslator$toP3, 2);\n\n row = _recordTranslator$toP4[0];\n col = _recordTranslator$toP4[1];\n\n\n if (!priv.columnSettings[col]) {\n priv.columnSettings[col] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);\n }\n\n if (!priv.cellSettings[row]) {\n priv.cellSettings[row] = [];\n }\n if (!priv.cellSettings[row][col]) {\n priv.cellSettings[row][col] = new priv.columnSettings[col]();\n }\n\n cellProperties = priv.cellSettings[row][col]; // retrieve cellProperties from cache\n\n cellProperties.row = row;\n cellProperties.col = col;\n cellProperties.visualRow = visualRow;\n cellProperties.visualCol = visualCol;\n cellProperties.prop = prop;\n cellProperties.instance = instance;\n\n instance.runHooks('beforeGetCellMeta', row, col, cellProperties);\n (0, _object.extend)(cellProperties, expandType(cellProperties)); // for `type` added in beforeGetCellMeta\n\n if (cellProperties.cells) {\n var settings = cellProperties.cells.call(cellProperties, row, col, prop);\n\n if (settings) {\n (0, _object.extend)(cellProperties, settings);\n (0, _object.extend)(cellProperties, expandType(settings)); // for `type` added in cells\n }\n }\n\n instance.runHooks('afterGetCellMeta', row, col, cellProperties);\n\n return cellProperties;\n };\n\n /**\n * Returns a row off the cell meta array.\n *\n * @memberof Core#\n * @function getCellMetaAtRow\n * @since 0.30.0\n * @param {Number} row Index of the row to return cell meta for.\n * @returns {Array}\n */\n this.getCellMetaAtRow = function (row) {\n return priv.cellSettings[row];\n };\n\n /**\n * Checks if the data format and config allows user to modify the column structure.\n * @returns {boolean}\n */\n this.isColumnModificationAllowed = function () {\n return !(instance.dataType === 'object' || instance.getSettings().columns);\n };\n\n var rendererLookup = (0, _data.cellMethodLookupFactory)('renderer');\n\n /**\n * Returns the cell renderer function by given `row` and `col` arguments.\n *\n * @memberof Core#\n * @function getCellRenderer\n * @since 0.11\n * @param {Number|Object} row Row index or cell meta object.\n * @param {Number} [col] Column index.\n * @returns {Function} The renderer function.\n */\n this.getCellRenderer = function (row, col) {\n return (0, _renderers.getRenderer)(rendererLookup.call(this, row, col));\n };\n\n /**\n * Returns the cell editor by the provided `row` and `col` arguments.\n *\n * @memberof Core#\n * @function getCellEditor\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Object} The Editor object.\n */\n this.getCellEditor = (0, _data.cellMethodLookupFactory)('editor');\n\n var validatorLookup = (0, _data.cellMethodLookupFactory)('validator');\n\n /**\n * Returns the cell validator by `row` and `col`, provided a validator is defined. If not - it doesn't return anything.\n *\n * @memberof Core#\n * @function getCellValidator\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Function|RegExp|undefined} The validator function.\n */\n this.getCellValidator = function (row, col) {\n var validator = validatorLookup.call(this, row, col);\n\n if (typeof validator === 'string') {\n validator = (0, _validators.getValidator)(validator);\n }\n\n return validator;\n };\n\n /**\n * Validates all cells using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * @memberof Core#\n * @function validateCells\n * @param {Function} [callback] The callback function.\n */\n this.validateCells = function (callback) {\n var waitingForValidator = new ValidatorsQueue();\n\n if (callback) {\n waitingForValidator.onQueueEmpty = callback;\n }\n\n var i = instance.countRows() - 1;\n\n while (i >= 0) {\n var j = instance.countCols() - 1;\n\n while (j >= 0) {\n waitingForValidator.addValidatorToQueue();\n\n instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), function (result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n if (result === false) {\n waitingForValidator.valid = false;\n }\n waitingForValidator.removeValidatorFormQueue();\n }, 'validateCells');\n j--;\n }\n i--;\n }\n waitingForValidator.checkIfQueueIsEmpty();\n };\n\n /**\n * Returns an array of row headers' values (if they are enabled). If param `row` was given, it returns the header of the given row as a string.\n *\n * @memberof Core#\n * @function getRowHeader\n * @param {Number} [row] Row index.\n * @fires Hooks#modifyRowHeader\n * @returns {Array|String} Array of header values / single header value.\n */\n this.getRowHeader = function (row) {\n var rowHeader = priv.settings.rowHeaders;\n\n if (row !== void 0) {\n row = instance.runHooks('modifyRowHeader', row);\n }\n if (row === void 0) {\n rowHeader = [];\n (0, _number.rangeEach)(instance.countRows() - 1, function (i) {\n rowHeader.push(instance.getRowHeader(i));\n });\n } else if (Array.isArray(rowHeader) && rowHeader[row] !== void 0) {\n rowHeader = rowHeader[row];\n } else if ((0, _function.isFunction)(rowHeader)) {\n rowHeader = rowHeader(row);\n } else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') {\n rowHeader = row + 1;\n }\n\n return rowHeader;\n };\n\n /**\n * Returns information about if this table is configured to display row headers.\n *\n * @memberof Core#\n * @function hasRowHeaders\n * @returns {Boolean} `true` if the instance has the row headers enabled, `false` otherwise.\n * @since 0.11\n */\n this.hasRowHeaders = function () {\n return !!priv.settings.rowHeaders;\n };\n\n /**\n * Returns information about if this table is configured to display column headers.\n *\n * @memberof Core#\n * @function hasColHeaders\n * @since 0.11\n * @returns {Boolean} `True` if the instance has the column headers enabled, `false` otherwise.\n */\n this.hasColHeaders = function () {\n if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) {\n // Polymer has empty value = null\n return !!priv.settings.colHeaders;\n }\n for (var i = 0, ilen = instance.countCols(); i < ilen; i++) {\n if (instance.getColHeader(i)) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Returns an array of column headers (in string format, if they are enabled). If param `col` is given, it returns the header at the given column as a string.\n *\n * @memberof Core#\n * @function getColHeader\n * @param {Number} [col] Column index.\n * @fires Hooks#modifyColHeader\n * @returns {Array|String} The column header(s).\n */\n this.getColHeader = function (col) {\n var columnsAsFunc = priv.settings.columns && (0, _function.isFunction)(priv.settings.columns);\n var result = priv.settings.colHeaders;\n\n col = instance.runHooks('modifyColHeader', col);\n\n if (col === void 0) {\n var out = [];\n var ilen = columnsAsFunc ? instance.countSourceCols() : instance.countCols();\n\n for (var i = 0; i < ilen; i++) {\n out.push(instance.getColHeader(i));\n }\n\n result = out;\n } else {\n var translateVisualIndexToColumns = function translateVisualIndexToColumns(col) {\n var arr = [];\n var columnsLen = instance.countSourceCols();\n var index = 0;\n\n for (; index < columnsLen; index++) {\n if ((0, _function.isFunction)(instance.getSettings().columns) && instance.getSettings().columns(index)) {\n arr.push(index);\n }\n }\n\n return arr[col];\n };\n var baseCol = col;\n col = instance.runHooks('modifyCol', col);\n\n var prop = translateVisualIndexToColumns(col);\n\n if (priv.settings.columns && (0, _function.isFunction)(priv.settings.columns) && priv.settings.columns(prop) && priv.settings.columns(prop).title) {\n result = priv.settings.columns(prop).title;\n } else if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) {\n result = priv.settings.columns[col].title;\n } else if (Array.isArray(priv.settings.colHeaders) && priv.settings.colHeaders[col] !== void 0) {\n result = priv.settings.colHeaders[col];\n } else if ((0, _function.isFunction)(priv.settings.colHeaders)) {\n result = priv.settings.colHeaders(col);\n } else if (priv.settings.colHeaders && typeof priv.settings.colHeaders !== 'string' && typeof priv.settings.colHeaders !== 'number') {\n result = (0, _data.spreadsheetColumnLabel)(baseCol); // see #1458\n }\n }\n\n return result;\n };\n\n /**\n * Return column width from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getColWidthFromSettings\n * @param {Number} col\n * @returns {Number}\n */\n this._getColWidthFromSettings = function (col) {\n var cellProperties = instance.getCellMeta(0, col);\n var width = cellProperties.width;\n\n if (width === void 0 || width === priv.settings.width) {\n width = cellProperties.colWidths;\n }\n if (width !== void 0 && width !== null) {\n switch (typeof width === 'undefined' ? 'undefined' : _typeof(width)) {\n case 'object':\n // array\n width = width[col];\n break;\n\n case 'function':\n width = width(col);\n break;\n default:\n break;\n }\n if (typeof width === 'string') {\n width = parseInt(width, 10);\n }\n }\n\n return width;\n };\n\n /**\n * Returns the width of the requested column.\n *\n * @memberof Core#\n * @function getColWidth\n * @since 0.11\n * @param {Number} col Column index.\n * @returns {Number} Column width.\n * @fires Hooks#modifyColWidth\n */\n this.getColWidth = function (col) {\n var width = instance._getColWidthFromSettings(col);\n\n width = instance.runHooks('modifyColWidth', width, col);\n\n if (width === void 0) {\n width = _src.ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n };\n\n /**\n * Return row height from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getRowHeightFromSettings\n * @param {Number} row\n * @returns {Number}\n */\n this._getRowHeightFromSettings = function (row) {\n // let cellProperties = instance.getCellMeta(row, 0);\n // let height = cellProperties.height;\n //\n // if (height === void 0 || height === priv.settings.height) {\n // height = cellProperties.rowHeights;\n // }\n var height = priv.settings.rowHeights;\n\n if (height !== void 0 && height !== null) {\n switch (typeof height === 'undefined' ? 'undefined' : _typeof(height)) {\n case 'object':\n // array\n height = height[row];\n break;\n\n case 'function':\n height = height(row);\n break;\n default:\n break;\n }\n if (typeof height === 'string') {\n height = parseInt(height, 10);\n }\n }\n\n return height;\n };\n\n /**\n * Returns the row height.\n *\n * @memberof Core#\n * @function getRowHeight\n * @since 0.11\n * @param {Number} row Row index.\n * @returns {Number} The given row's height.\n * @fires Hooks#modifyRowHeight\n */\n this.getRowHeight = function (row) {\n var height = instance._getRowHeightFromSettings(row);\n\n height = instance.runHooks('modifyRowHeight', height, row);\n\n return height;\n };\n\n /**\n * Returns the total number of rows in the data source.\n *\n * @memberof Core#\n * @function countSourceRows\n * @since 0.20.0\n * @returns {Number} Total number in rows in data source.\n */\n this.countSourceRows = function () {\n var sourceLength = instance.runHooks('modifySourceLength');\n return sourceLength || (instance.getSourceData() ? instance.getSourceData().length : 0);\n };\n\n /**\n * Returns the total number of columns in the data source.\n *\n * @memberof Core#\n * @function countSourceCols\n * @since 0.26.1\n * @returns {Number} Total number in columns in data source.\n */\n this.countSourceCols = function () {\n var len = 0;\n var obj = instance.getSourceData() && instance.getSourceData()[0] ? instance.getSourceData()[0] : [];\n\n if ((0, _object.isObject)(obj)) {\n len = (0, _object.deepObjectSize)(obj);\n } else {\n len = obj.length || 0;\n }\n\n return len;\n };\n\n /**\n * Returns the total number of rows in the grid.\n *\n * @memberof Core#\n * @function countRows\n * @returns {Number} Total number in rows the grid.\n */\n this.countRows = function () {\n return datamap.getLength();\n };\n\n /**\n * Returns the total number of columns in the grid.\n *\n * @memberof Core#\n * @function countCols\n * @returns {Number} Total number of columns.\n */\n this.countCols = function () {\n var maxCols = this.getSettings().maxCols;\n var dataHasLength = false;\n var dataLen = 0;\n\n if (instance.dataType === 'array') {\n dataHasLength = priv.settings.data && priv.settings.data[0] && priv.settings.data[0].length;\n }\n\n if (dataHasLength) {\n dataLen = priv.settings.data[0].length;\n }\n\n if (priv.settings.columns) {\n var columnsIsFunction = (0, _function.isFunction)(priv.settings.columns);\n\n if (columnsIsFunction) {\n if (instance.dataType === 'array') {\n var columnLen = 0;\n\n for (var i = 0; i < dataLen; i++) {\n if (priv.settings.columns(i)) {\n columnLen++;\n }\n }\n\n dataLen = columnLen;\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n dataLen = datamap.colToPropCache.length;\n }\n } else {\n dataLen = priv.settings.columns.length;\n }\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n dataLen = datamap.colToPropCache.length;\n }\n\n return Math.min(maxCols, dataLen);\n };\n\n /**\n * Returns an index of the first rendered row.\n *\n * @memberof Core#\n * @function rowOffset\n * @returns {Number} Index of first rendered row.\n */\n this.rowOffset = function () {\n return instance.view.wt.wtTable.getFirstRenderedRow();\n };\n\n /**\n * Returns the index of the first rendered column.\n *\n * @memberof Core#\n * @function colOffset\n * @returns {Number} Index of the first visible column.\n */\n this.colOffset = function () {\n return instance.view.wt.wtTable.getFirstRenderedColumn();\n };\n\n /**\n * Returns the number of rendered rows (including rows partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedRows\n * @returns {Number} Returns -1 if table is not visible.\n */\n this.countRenderedRows = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1;\n };\n\n /**\n * Returns the number of visible rows (rendered rows that fully fit inside viewport).\n *\n * @memberof Core#\n * @function countVisibleRows\n * @returns {Number} Number of visible rows or -1.\n */\n this.countVisibleRows = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1;\n };\n\n /**\n * Returns the number of rendered columns (including columns partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedCols\n * @returns {Number} Returns -1 if table is not visible.\n */\n this.countRenderedCols = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1;\n };\n\n /**\n * Returns the number of visible columns. Returns -1 if table is not visible\n *\n * @memberof Core#\n * @function countVisibleCols\n * @return {Number} Number of visible columns or -1.\n */\n this.countVisibleCols = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1;\n };\n\n /**\n * Returns the number of empty rows. If the optional ending parameter is `true`, returns the\n * number of empty rows at the bottom of the table.\n *\n * @memberof Core#\n * @function countEmptyRows\n * @param {Boolean} [ending] If `true`, will only count empty rows at the end of the data source.\n * @returns {Number} Count empty rows\n * @fires Hooks#modifyRow\n */\n this.countEmptyRows = function (ending) {\n var i = instance.countRows() - 1,\n empty = 0,\n row;\n\n while (i >= 0) {\n row = instance.runHooks('modifyRow', i);\n\n if (instance.isEmptyRow(row)) {\n empty++;\n } else if (ending) {\n break;\n }\n i--;\n }\n\n return empty;\n };\n\n /**\n * Returns the number of empty columns. If the optional ending parameter is `true`, returns the number of empty\n * columns at right hand edge of the table.\n *\n * @memberof Core#\n * @function countEmptyCols\n * @param {Boolean} [ending] If `true`, will only count empty columns at the end of the data source row.\n * @returns {Number} Count empty cols\n */\n this.countEmptyCols = function (ending) {\n if (instance.countRows() < 1) {\n return 0;\n }\n var i = instance.countCols() - 1,\n empty = 0;\n\n while (i >= 0) {\n if (instance.isEmptyCol(i)) {\n empty++;\n } else if (ending) {\n break;\n }\n i--;\n }\n\n return empty;\n };\n\n /**\n * Check if all cells in the row declared by the `row` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyRow\n * @param {Number} row Row index.\n * @returns {Boolean} `true` if the row at the given `row` is empty, `false` otherwise.\n */\n this.isEmptyRow = function (row) {\n return priv.settings.isEmptyRow.call(instance, row);\n };\n\n /**\n * Check if all cells in the the column declared by the `col` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyCol\n * @param {Number} col Column index.\n * @returns {Boolean} `true` if the column at the given `col` is empty, `false` otherwise.\n */\n this.isEmptyCol = function (col) {\n return priv.settings.isEmptyCol.call(instance, col);\n };\n\n /**\n * Select cell specified by `row` and `col` values or a range of cells finishing at `endRow`, `endCol`.\n * By default, viewport will be scrolled to selection.\n * After the `selectCell` method had finished, the instance will be listening to keyboard input on the document.\n *\n * @memberof Core#\n * @function selectCell\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Number} [endRow] End row index (if selecting a range).\n * @param {Number} [endCol] End column index (if selecting a range).\n * @param {Boolean} [scrollToCell=true] If `true`, the viewport will be scrolled to the selection.\n * @param {Boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCell = function (row, col, endRow, endCol, scrollToCell, changeListener) {\n var coords;\n\n changeListener = (0, _mixed.isUndefined)(changeListener) || changeListener === true;\n\n if (typeof row !== 'number' || row < 0 || row >= instance.countRows()) {\n return false;\n }\n if (typeof col !== 'number' || col < 0 || col >= instance.countCols()) {\n return false;\n }\n if ((0, _mixed.isDefined)(endRow)) {\n if (typeof endRow !== 'number' || endRow < 0 || endRow >= instance.countRows()) {\n return false;\n }\n if (typeof endCol !== 'number' || endCol < 0 || endCol >= instance.countCols()) {\n return false;\n }\n }\n coords = new _src.CellCoords(row, col);\n priv.selRange = new _src.CellRange(coords, coords, coords);\n\n if (changeListener) {\n instance.listen();\n }\n\n if ((0, _mixed.isUndefined)(endRow)) {\n selection.setRangeEnd(priv.selRange.from, scrollToCell);\n } else {\n selection.setRangeEnd(new _src.CellCoords(endRow, endCol), scrollToCell);\n }\n instance.selection.finish();\n\n return true;\n };\n\n /**\n * Select the cell specified by the `row` and `prop` arguments, or a range finishing at `endRow`, `endProp`.\n * By default, viewport will be scrolled to selection.\n *\n * @memberof Core#\n * @function selectCellByProp\n * @param {Number} row Row index.\n * @param {String} prop Property name.\n * @param {Number} [endRow] End row index (if selecting a range).\n * @param {String} [endProp] End property name (if selecting a range).\n * @param {Boolean} [scrollToCell=true] If `true`, viewport will be scrolled to the selection.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCellByProp = function (row, prop, endRow, endProp, scrollToCell) {\n var _instance5;\n\n arguments[1] = datamap.propToCol(arguments[1]);\n\n if ((0, _mixed.isDefined)(arguments[3])) {\n arguments[3] = datamap.propToCol(arguments[3]);\n }\n\n return (_instance5 = instance).selectCell.apply(_instance5, arguments);\n };\n\n /**\n * Deselects the current cell selection on grid.\n *\n * @memberof Core#\n * @function deselectCell\n */\n this.deselectCell = function () {\n selection.deselect();\n };\n\n /**\n * Scroll viewport to coords specified by the `row` and `column` arguments.\n *\n * @since 0.24.3\n * @memberof Core#\n * @function scrollViewportTo\n * @param {Number} [row] Row index.\n * @param {Number} [column] Column index.\n * @param {Boolean} [snapToBottom = false] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @param {Boolean} [snapToRight = false] If `true`, viewport is scrolled to show the cell on the right side of the table.\n * @returns {Boolean} `true` if scroll was successful, `false` otherwise.\n */\n this.scrollViewportTo = function (row, column) {\n var snapToBottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var snapToRight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (row !== void 0 && (row < 0 || row >= instance.countRows())) {\n return false;\n }\n if (column !== void 0 && (column < 0 || column >= instance.countCols())) {\n return false;\n }\n\n var result = false;\n\n if (row !== void 0 && column !== void 0) {\n instance.view.wt.wtOverlays.topOverlay.scrollTo(row, snapToBottom);\n instance.view.wt.wtOverlays.leftOverlay.scrollTo(column, snapToRight);\n\n result = true;\n }\n if (typeof row === 'number' && typeof column !== 'number') {\n instance.view.wt.wtOverlays.topOverlay.scrollTo(row, snapToBottom);\n\n result = true;\n }\n if (typeof column === 'number' && typeof row !== 'number') {\n instance.view.wt.wtOverlays.leftOverlay.scrollTo(column, snapToRight);\n\n result = true;\n }\n\n return result;\n };\n\n /**\n * Removes grid from the DOM.\n *\n * @memberof Core#\n * @function destroy\n * @fires Hooks#afterDestroy\n */\n this.destroy = function () {\n\n instance._clearTimeouts();\n if (instance.view) {\n // in case HT is destroyed before initialization has finished\n instance.view.destroy();\n }\n if (dataSource) {\n dataSource.destroy();\n }\n dataSource = null;\n\n (0, _element.empty)(instance.rootElement);\n eventManager.destroy();\n\n instance.runHooks('afterDestroy');\n _pluginHooks2.default.getSingleton().destroy(instance);\n\n for (var i in instance) {\n if ((0, _object.hasOwnProperty)(instance, i)) {\n // replace instance methods with post mortem\n if ((0, _function.isFunction)(instance[i])) {\n instance[i] = postMortem;\n } else if (i !== 'guid') {\n // replace instance properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n instance[i] = null;\n }\n }\n }\n\n // replace private properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n if (datamap) {\n datamap.destroy();\n }\n datamap = null;\n priv = null;\n grid = null;\n selection = null;\n editorManager = null;\n instance = null;\n GridSettings = null;\n };\n\n /**\n * Replacement for all methods after Handsotnable was destroyed.\n *\n * @private\n */\n function postMortem() {\n throw new Error('This method cannot be called because this Handsontable instance has been destroyed');\n }\n\n /**\n * Returns the active editor object.\n *\n * @memberof Core#\n * @function getActiveEditor\n * @returns {Object} The active editor object.\n */\n this.getActiveEditor = function () {\n return editorManager.getActiveEditor();\n };\n\n /**\n * Returns plugin instance using the plugin name provided.\n *\n * @memberof Core#\n * @function getPlugin\n * @param {String} pluginName The plugin name.\n * @returns {*} The plugin instance.\n * @since 0.15.0\n */\n this.getPlugin = function (pluginName) {\n return (0, _plugins.getPlugin)(this, pluginName);\n };\n\n /**\n * Returns the Handsontable instance.\n *\n * @memberof Core#\n * @function getInstance\n * @returns {Handsontable} The Handsontable instance.\n */\n this.getInstance = function () {\n return instance;\n };\n\n /**\n * Adds listener to the specified hook name (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function addHook\n * @see Hooks#add\n * @param {String} key Hook name.\n * @param {Function|Array} callback Function or array of Functions.\n *\n * @example\n * ```js\n * hot.addHook('beforeInit', myCallback);\n * ```\n */\n this.addHook = function (key, callback) {\n _pluginHooks2.default.getSingleton().add(key, callback, instance);\n };\n\n /**\n * Check if for a specified hook name there are added listeners (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function hasHook\n * @see Hooks#has\n * @param {String} key Hook name\n * @return {Boolean}\n *\n * @example\n * ```js\n * var hasBeforeInitListeners = hot.hasHook('beforeInit');\n * ```\n */\n this.hasHook = function (key) {\n return _pluginHooks2.default.getSingleton().has(key, instance);\n };\n\n /**\n * Adds listener to specified hook name (only for this Handsontable instance).\n * After the listener is triggered, it will be automatically removed.\n *\n * @memberof Core#\n * @function addHookOnce\n * @see Hooks#once\n * @param {String} key Hook name.\n * @param {Function|Array} callback Function or array of Functions.\n *\n * @example\n * ```js\n * hot.addHookOnce('beforeInit', myCallback);\n * ```\n */\n this.addHookOnce = function (key, callback) {\n _pluginHooks2.default.getSingleton().once(key, callback, instance);\n };\n\n /**\n * Removes the hook listener previously registered with {@link Core#addHook}.\n *\n * @memberof Core#\n * @function removeHook\n * @see Hooks#remove\n * @param {String} key Hook name.\n * @param {Function} callback Function which have been registered via {@link Core#addHook}.\n *\n * @example\n * ```js\n * hot.removeHook('beforeInit', myCallback);\n * ```\n */\n this.removeHook = function (key, callback) {\n _pluginHooks2.default.getSingleton().remove(key, callback, instance);\n };\n\n /**\n * Run the callbacks for the hook provided in the `key` argument using the parameters given in the other arguments.\n *\n * @memberof Core#\n * @function runHooks\n * @see Hooks#run\n * @param {String} key Hook name.\n * @param {*} [p1] Argument passed to the callback.\n * @param {*} [p2] Argument passed to the callback.\n * @param {*} [p3] Argument passed to the callback.\n * @param {*} [p4] Argument passed to the callback.\n * @param {*} [p5] Argument passed to the callback.\n * @param {*} [p6] Argument passed to the callback.\n * @returns {*}\n *\n * @example\n * ```js\n * hot.runHooks('beforeInit');\n * ```\n */\n this.runHooks = function (key, p1, p2, p3, p4, p5, p6) {\n return _pluginHooks2.default.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);\n };\n\n this.timeouts = [];\n\n /**\n * Sets timeout. Purpose of this method is to clear all known timeouts when `destroy` method is called.\n *\n * @param {*} handle\n * @private\n */\n this._registerTimeout = function (handle) {\n this.timeouts.push(handle);\n };\n\n /**\n * Clears all known timeouts.\n *\n * @private\n */\n this._clearTimeouts = function () {\n for (var i = 0, ilen = this.timeouts.length; i < ilen; i++) {\n clearTimeout(this.timeouts[i]);\n }\n };\n\n /**\n * Handsontable version\n *\n * @type {String}\n */\n // this.version = Handsontable.version;\n\n _pluginHooks2.default.getSingleton().run(instance, 'construct');\n};\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.spreadsheetColumnLabel = spreadsheetColumnLabel;\nexports.spreadsheetColumnIndex = spreadsheetColumnIndex;\nexports.createSpreadsheetData = createSpreadsheetData;\nexports.createSpreadsheetObjectData = createSpreadsheetObjectData;\nexports.createEmptySpreadsheetData = createEmptySpreadsheetData;\nexports.translateRowsToColumns = translateRowsToColumns;\nexports.cellMethodLookupFactory = cellMethodLookupFactory;\n\nvar _cellTypes = __webpack_require__(63);\n\nvar _object = __webpack_require__(2);\n\nvar COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nvar COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\n/**\n * Generates spreadsheet-like column names: A, B, C, ..., Z, AA, AB, etc.\n *\n * @param {Number} index Column index.\n * @returns {String}\n */\nfunction spreadsheetColumnLabel(index) {\n var dividend = index + 1;\n var columnLabel = '';\n var modulo = void 0;\n\n while (dividend > 0) {\n modulo = (dividend - 1) % COLUMN_LABEL_BASE_LENGTH;\n columnLabel = String.fromCharCode(65 + modulo) + columnLabel;\n dividend = parseInt((dividend - modulo) / COLUMN_LABEL_BASE_LENGTH, 10);\n }\n\n return columnLabel;\n}\n\n/**\n * Generates spreadsheet-like column index from theirs labels: A, B, C ...., Z, AA, AB, etc.\n *\n * @param {String} label Column label.\n * @returns {Number}\n */\nfunction spreadsheetColumnIndex(label) {\n var result = 0;\n\n if (label) {\n for (var i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n }\n }\n --result;\n\n return result;\n}\n\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", ...\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} columns Number of columns to generate.\n * @returns {Array}\n */\nfunction createSpreadsheetData() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;\n\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = [];\n\n for (j = 0; j < columns; j++) {\n row.push(spreadsheetColumnLabel(j) + (i + 1));\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", as an array of objects.\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} colCount Number of columns to generate.\n * @returns {Array}\n */\nfunction createSpreadsheetObjectData() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var colCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;\n\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = {};\n\n for (j = 0; j < colCount; j++) {\n row['prop' + j] = spreadsheetColumnLabel(j) + (i + 1);\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\n/**\n * Generates an empty data object.\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} columns Number of columns to generate\n * @returns {Array}\n */\nfunction createEmptySpreadsheetData(rows, columns) {\n var data = [];\n var row = void 0;\n\n for (var i = 0; i < rows; i++) {\n row = [];\n for (var j = 0; j < columns; j++) {\n row.push('');\n }\n data.push(row);\n }\n\n return data;\n}\n\nfunction translateRowsToColumns(input) {\n var i,\n ilen,\n j,\n jlen,\n output = [],\n olen = 0;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n for (j = 0, jlen = input[i].length; j < jlen; j++) {\n if (j == olen) {\n output.push([]);\n olen++;\n }\n output[j].push(input[i][j]);\n }\n }\n\n return output;\n}\n\n/**\n * Factory that produces a function for searching methods (or any properties) which could be defined directly in\n * table configuration or implicitly, within cell type definition.\n *\n * For example: renderer can be defined explicitly using \"renderer\" property in column configuration or it can be\n * defined implicitly using \"type\" property.\n *\n * Methods/properties defined explicitly always takes precedence over those defined through \"type\".\n *\n * If the method/property is not found in an object, searching is continued recursively through prototype chain, until\n * it reaches the Object.prototype.\n *\n *\n * @param methodName {String} name of the method/property to search (i.e. 'renderer', 'validator', 'copyable')\n * @param allowUndefined {Boolean} [optional] if false, the search is continued if methodName has not been found in cell \"type\"\n * @returns {Function}\n */\nfunction cellMethodLookupFactory(methodName, allowUndefined) {\n\n allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined;\n\n return function cellMethodLookup(row, col) {\n return function getMethodFromProperties(properties) {\n\n if (!properties) {\n return; // method not found\n } else if ((0, _object.hasOwnProperty)(properties, methodName) && properties[methodName] !== void 0) {\n // check if it is own and is not empty\n return properties[methodName]; // method defined directly\n } else if ((0, _object.hasOwnProperty)(properties, 'type') && properties.type) {\n // check if it is own and is not empty\n var type;\n\n if (typeof properties.type != 'string') {\n throw new Error('Cell type must be a string ');\n }\n type = (0, _cellTypes.getCellType)(properties.type);\n\n if ((0, _object.hasOwnProperty)(type, methodName)) {\n return type[methodName]; // method defined in type.\n } else if (allowUndefined) {\n return; // method does not defined in type (eg. validator), returns undefined\n }\n }\n\n return getMethodFromProperties(Object.getPrototypeOf(properties));\n }(typeof row == 'number' ? this.getCellMeta(row, col) : row);\n };\n}\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.columnFactory = columnFactory;\n\nvar _object = __webpack_require__(2);\n\n/* eslint-disable import/prefer-default-export */\n/**\n * Factory for columns constructors.\n *\n * @param {Object} GridSettings\n * @param {Array} conflictList\n * @return {Object} ColumnSettings\n */\nfunction columnFactory(GridSettings, conflictList) {\n function ColumnSettings() {};\n\n (0, _object.inherit)(ColumnSettings, GridSettings);\n\n // Clear conflict settings\n for (var i = 0, len = conflictList.length; i < len; i++) {\n ColumnSettings.prototype[conflictList[i]] = void 0;\n }\n\n return ColumnSettings;\n}\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class GhostTable\n * @util\n */\nvar GhostTable = function () {\n function GhostTable(hotInstance) {\n _classCallCheck(this, GhostTable);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * Container element where every table will be injected.\n *\n * @type {HTMLElement|null}\n */\n this.container = null;\n /**\n * Flag which determine is table was injected to DOM.\n *\n * @type {Boolean}\n */\n this.injected = false;\n /**\n * Added rows collection.\n *\n * @type {Array}\n */\n this.rows = [];\n /**\n * Added columns collection.\n *\n * @type {Array}\n */\n this.columns = [];\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Ghost table settings.\n *\n * @type {Object}\n * @default {Object}\n */\n this.settings = {\n useHeaders: true\n };\n }\n\n /**\n * Add row.\n *\n * @param {Number} row Row index.\n * @param {Map} samples Samples Map object.\n */\n\n\n _createClass(GhostTable, [{\n key: 'addRow',\n value: function addRow(row, samples) {\n if (this.columns.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n if (!this.rows.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n var rowObject = { row: row };\n this.rows.push(rowObject);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tr.appendChild(this.createRow(row));\n this.container.container.appendChild(this.table.fragment);\n\n rowObject.table = this.table.table;\n }\n\n /**\n * Add a row consisting of the column headers.\n */\n\n }, {\n key: 'addColumnHeadersRow',\n value: function addColumnHeadersRow(samples) {\n if (this.hot.getColHeader(0) != null) {\n var rowObject = { row: -1 };\n this.rows.push(rowObject);\n\n this.container = this.createContainer(this.hot.rootElement.className);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tHead.appendChild(this.createColumnHeadersRow());\n this.container.container.appendChild(this.table.fragment);\n\n rowObject.table = this.table.table;\n }\n }\n\n /**\n * Add column.\n *\n * @param {Number} column Column index.\n * @param {Map} samples Samples Map object.\n */\n\n }, {\n key: 'addColumn',\n value: function addColumn(column, samples) {\n if (this.rows.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n if (!this.columns.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n var columnObject = { col: column };\n this.columns.push(columnObject);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n\n if (this.getSetting('useHeaders') && this.hot.getColHeader(column) !== null) {\n this.hot.view.appendColHeader(column, this.table.th);\n }\n this.table.tBody.appendChild(this.createCol(column));\n this.container.container.appendChild(this.table.fragment);\n\n columnObject.table = this.table.table;\n }\n\n /**\n * Get calculated heights.\n *\n * @param {Function} callback Callback which will be fired for each calculated row.\n */\n\n }, {\n key: 'getHeights',\n value: function getHeights(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n (0, _array.arrayEach)(this.rows, function (row) {\n // -1 <- reduce border-top from table\n callback(row.row, (0, _element.outerHeight)(row.table) - 1);\n });\n }\n\n /**\n * Get calculated widths.\n *\n * @param {Function} callback Callback which will be fired for each calculated column.\n */\n\n }, {\n key: 'getWidths',\n value: function getWidths(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n (0, _array.arrayEach)(this.columns, function (column) {\n callback(column.col, (0, _element.outerWidth)(column.table));\n });\n }\n\n /**\n * Set the Ghost Table settings to the provided object.\n *\n * @param {Object} settings New Ghost Table Settings\n */\n\n }, {\n key: 'setSettings',\n value: function setSettings(settings) {\n this.settings = settings;\n }\n\n /**\n * Set a single setting of the Ghost Table.\n *\n * @param {String} name Setting name.\n * @param {*} value Setting value.\n */\n\n }, {\n key: 'setSetting',\n value: function setSetting(name, value) {\n if (!this.settings) {\n this.settings = {};\n }\n\n this.settings[name] = value;\n }\n\n /**\n * Get the Ghost Table settings.\n *\n * @returns {Object|null}\n */\n\n }, {\n key: 'getSettings',\n value: function getSettings() {\n return this.settings;\n }\n\n /**\n * Get a single Ghost Table setting.\n *\n * @param {String} name\n * @returns {Boolean|null}\n */\n\n }, {\n key: 'getSetting',\n value: function getSetting(name) {\n if (this.settings) {\n return this.settings[name];\n }\n return null;\n }\n\n /**\n * Create colgroup col elements.\n *\n * @returns {DocumentFragment}\n */\n\n }, {\n key: 'createColGroupsCol',\n value: function createColGroupsCol() {\n var _this = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n fragment.appendChild(this.createColElement(-1));\n }\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n fragment.appendChild(_this.createColElement(string.col));\n });\n });\n\n return fragment;\n }\n\n /**\n * Create table row element.\n *\n * @param {Number} row Row index.\n * @returns {DocumentFragment} Returns created table row elements.\n */\n\n }, {\n key: 'createRow',\n value: function createRow(row) {\n var _this2 = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n var th = d.createElement('th');\n\n if (this.hot.hasRowHeaders()) {\n this.hot.view.appendRowHeader(row, th);\n\n fragment.appendChild(th);\n }\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n var column = string.col;\n var cellProperties = _this2.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n var renderer = _this2.hot.getCellRenderer(cellProperties);\n var td = d.createElement('td');\n\n renderer(_this2.hot, td, row, column, _this2.hot.colToProp(column), string.value, cellProperties);\n fragment.appendChild(td);\n });\n });\n\n return fragment;\n }\n }, {\n key: 'createColumnHeadersRow',\n value: function createColumnHeadersRow() {\n var _this3 = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n var th = d.createElement('th');\n this.hot.view.appendColHeader(-1, th);\n fragment.appendChild(th);\n }\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n var column = string.col;\n\n var th = d.createElement('th');\n\n _this3.hot.view.appendColHeader(column, th);\n fragment.appendChild(th);\n });\n });\n\n return fragment;\n }\n\n /**\n * Create table column elements.\n *\n * @param {Number} column Column index.\n * @returns {DocumentFragment} Returns created column table column elements.\n */\n\n }, {\n key: 'createCol',\n value: function createCol(column) {\n var _this4 = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n var row = string.row;\n var cellProperties = _this4.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n var renderer = _this4.hot.getCellRenderer(cellProperties);\n var td = d.createElement('td');\n var tr = d.createElement('tr');\n\n renderer(_this4.hot, td, row, column, _this4.hot.colToProp(column), string.value, cellProperties);\n tr.appendChild(td);\n fragment.appendChild(tr);\n });\n });\n\n return fragment;\n }\n\n /**\n * Remove table from document and reset internal state.\n */\n\n }, {\n key: 'clean',\n value: function clean() {\n this.rows.length = 0;\n this.rows[-1] = void 0;\n this.columns.length = 0;\n\n if (this.samples) {\n this.samples.clear();\n }\n this.samples = null;\n this.removeTable();\n }\n\n /**\n * Inject generated table into document.\n *\n * @param {HTMLElement} [parent=null]\n */\n\n }, {\n key: 'injectTable',\n value: function injectTable() {\n var parent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (!this.injected) {\n (parent || this.hot.rootElement).appendChild(this.container.fragment);\n this.injected = true;\n }\n }\n\n /**\n * Remove table from document.\n */\n\n }, {\n key: 'removeTable',\n value: function removeTable() {\n if (this.injected && this.container.container.parentNode) {\n this.container.container.parentNode.removeChild(this.container.container);\n this.container = null;\n this.injected = false;\n }\n }\n\n /**\n * Create col element.\n *\n * @param {Number} column Column index.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createColElement',\n value: function createColElement(column) {\n var d = document;\n var col = d.createElement('col');\n\n col.style.width = this.hot.view.wt.wtTable.getStretchedColumnWidth(column) + 'px';\n\n return col;\n }\n\n /**\n * Create table element.\n *\n * @param {String} className\n * @returns {Object}\n */\n\n }, {\n key: 'createTable',\n value: function createTable() {\n var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var d = document;\n var fragment = d.createDocumentFragment();\n var table = d.createElement('table');\n var tHead = d.createElement('thead');\n var tBody = d.createElement('tbody');\n var colGroup = d.createElement('colgroup');\n var tr = d.createElement('tr');\n var th = d.createElement('th');\n\n if (this.isVertical()) {\n table.appendChild(colGroup);\n }\n if (this.isHorizontal()) {\n tr.appendChild(th);\n tHead.appendChild(tr);\n table.style.tableLayout = 'auto';\n table.style.width = 'auto';\n }\n table.appendChild(tHead);\n\n if (this.isVertical()) {\n tBody.appendChild(tr);\n }\n table.appendChild(tBody);\n (0, _element.addClass)(table, className);\n fragment.appendChild(table);\n\n return { fragment: fragment, table: table, tHead: tHead, tBody: tBody, colGroup: colGroup, tr: tr, th: th };\n }\n\n /**\n * Create container for tables.\n *\n * @param {String} className\n * @returns {Object}\n */\n\n }, {\n key: 'createContainer',\n value: function createContainer() {\n var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var d = document;\n var fragment = d.createDocumentFragment();\n var container = d.createElement('div');\n\n className = 'htGhostTable htAutoSize ' + className.trim();\n (0, _element.addClass)(container, className);\n fragment.appendChild(container);\n\n return { fragment: fragment, container: container };\n }\n\n /**\n * Checks if table is raised vertically (checking rows).\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isVertical',\n value: function isVertical() {\n return !!(this.rows.length && !this.columns.length);\n }\n\n /**\n * Checks if table is raised horizontally (checking columns).\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isHorizontal',\n value: function isHorizontal() {\n return !!(this.columns.length && !this.rows.length);\n }\n }]);\n\n return GhostTable;\n}();\n\nexports.default = GhostTable;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar addToUnscopables = __webpack_require__(37)\n , step = __webpack_require__(167)\n , Iterators = __webpack_require__(45)\n , toIObject = __webpack_require__(23);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(166)(Array, 'Array', function(iterated, kind){\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , kind = this._k\n , index = this._i++;\n if(!O || index >= O.length){\n this._t = undefined;\n return step(1);\n }\n if(kind == 'keys' )return step(0, index);\n if(kind == 'values')return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A cell range is a set of exactly two CellCoords (that can be the same or different)\n *\n * @class CellRange\n */\nvar CellRange = function () {\n /**\n * @param {CellCoords} highlight Used to draw bold border around a cell where selection was\n * started and to edit the cell when you press Enter\n * @param {CellCoords} from Usually the same as highlight, but in Excel there is distinction - one can change\n * highlight within a selection\n * @param {CellCoords} to End selection\n */\n function CellRange(highlight, from, to) {\n _classCallCheck(this, CellRange);\n\n this.highlight = highlight;\n this.from = from;\n this.to = to;\n }\n\n /**\n * Checks if given coords are valid in context of a given Walkontable instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Boolean}\n */\n\n\n _createClass(CellRange, [{\n key: 'isValid',\n value: function isValid(wotInstance) {\n return this.from.isValid(wotInstance) && this.to.isValid(wotInstance);\n }\n\n /**\n * Checks if this cell range is restricted to one cell\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSingle',\n value: function isSingle() {\n return this.from.row === this.to.row && this.from.col === this.to.col;\n }\n\n /**\n * Returns selected range height (in number of rows)\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getHeight',\n value: function getHeight() {\n return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;\n }\n\n /**\n * Returns selected range width (in number of columns)\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getWidth',\n value: function getWidth() {\n return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;\n }\n\n /**\n * Checks if given cell coords is within `from` and `to` cell coords of this range\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'includes',\n value: function includes(cellCoords) {\n var row = cellCoords.row,\n col = cellCoords.col;\n\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n\n return topLeft.row <= row && bottomRight.row >= row && topLeft.col <= col && bottomRight.col >= col;\n }\n\n /**\n * Checks if given range is within of this range\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'includesRange',\n value: function includesRange(testedRange) {\n return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner());\n }\n\n /**\n * Checks if given range is equal to this range\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'isEqual',\n value: function isEqual(testedRange) {\n 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);\n }\n\n /**\n * Checks if tested range overlaps with the range.\n * Range A is considered to to be overlapping with range B if intersection of A and B or B and A is not empty.\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'overlaps',\n value: function overlaps(testedRange) {\n return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner());\n }\n\n /**\n * @param {CellRange} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSouthEastOf',\n value: function isSouthEastOf(testedCoords) {\n return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords);\n }\n\n /**\n * @param {CellRange} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNorthWestOf',\n value: function isNorthWestOf(testedCoords) {\n return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords);\n }\n\n /**\n * Adds a cell to a range (only if exceeds corners of the range). Returns information if range was expanded\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'expand',\n value: function expand(cellCoords) {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n\n if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {\n this.from = new _coords2.default(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));\n this.to = new _coords2.default(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));\n\n return true;\n }\n\n return false;\n }\n\n /**\n * @param {CellRange} expandingRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'expandByRange',\n value: function expandByRange(expandingRange) {\n if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {\n return false;\n }\n\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n var topRight = this.getTopRightCorner();\n var bottomLeft = this.getBottomLeftCorner();\n\n var expandingTopLeft = expandingRange.getTopLeftCorner();\n var expandingBottomRight = expandingRange.getBottomRightCorner();\n\n var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);\n var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);\n var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);\n var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);\n\n var finalFrom = new _coords2.default(resultTopRow, resultTopCol),\n finalTo = new _coords2.default(resultBottomRow, resultBottomCol);\n var isCorner = new CellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange),\n onlyMerge = expandingRange.isEqual(new CellRange(finalFrom, finalFrom, finalTo));\n\n if (isCorner && !onlyMerge) {\n if (this.from.col > finalFrom.col) {\n finalFrom.col = resultBottomCol;\n finalTo.col = resultTopCol;\n }\n if (this.from.row > finalFrom.row) {\n finalFrom.row = resultBottomRow;\n finalTo.row = resultTopRow;\n }\n }\n this.from = finalFrom;\n this.to = finalTo;\n\n return true;\n }\n\n /**\n * @returns {String}\n */\n\n }, {\n key: 'getDirection',\n value: function getDirection() {\n if (this.from.isNorthWestOf(this.to)) {\n // NorthWest - SouthEast\n return 'NW-SE';\n } else if (this.from.isNorthEastOf(this.to)) {\n // NorthEast - SouthWest\n return 'NE-SW';\n } else if (this.from.isSouthEastOf(this.to)) {\n // SouthEast - NorthWest\n return 'SE-NW';\n } else if (this.from.isSouthWestOf(this.to)) {\n // SouthWest - NorthEast\n return 'SW-NE';\n }\n }\n\n /**\n * @param {String} direction\n */\n\n }, {\n key: 'setDirection',\n value: function setDirection(direction) {\n switch (direction) {\n case 'NW-SE':\n var _ref = [this.getTopLeftCorner(), this.getBottomRightCorner()];\n this.from = _ref[0];\n this.to = _ref[1];\n\n break;\n case 'NE-SW':\n var _ref2 = [this.getTopRightCorner(), this.getBottomLeftCorner()];\n this.from = _ref2[0];\n this.to = _ref2[1];\n\n break;\n case 'SE-NW':\n var _ref3 = [this.getBottomRightCorner(), this.getTopLeftCorner()];\n this.from = _ref3[0];\n this.to = _ref3[1];\n\n break;\n case 'SW-NE':\n var _ref4 = [this.getBottomLeftCorner(), this.getTopRightCorner()];\n this.from = _ref4[0];\n this.to = _ref4[1];\n\n break;\n default:\n break;\n }\n }\n\n /**\n * Get top left corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getTopLeftCorner',\n value: function getTopLeftCorner() {\n return new _coords2.default(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n\n /**\n * Get bottom right corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getBottomRightCorner',\n value: function getBottomRightCorner() {\n return new _coords2.default(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n\n /**\n * Get top right corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getTopRightCorner',\n value: function getTopRightCorner() {\n return new _coords2.default(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n\n /**\n * Get bottom left corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getBottomLeftCorner',\n value: function getBottomLeftCorner() {\n return new _coords2.default(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n\n /**\n * @param {CellCoords} coords\n * @param {CellRange} expandedRange\n * @returns {*}\n */\n\n }, {\n key: 'isCorner',\n value: function isCorner(coords, expandedRange) {\n if (expandedRange) {\n if (expandedRange.includes(coords)) {\n if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col)) || this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col)) || this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col)) || this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {\n return true;\n }\n }\n }\n\n return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner());\n }\n\n /**\n * @param {CellCoords} coords\n * @param {CellRange} expandedRange\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getOppositeCorner',\n value: function getOppositeCorner(coords, expandedRange) {\n if (!(coords instanceof _coords2.default)) {\n return false;\n }\n\n if (expandedRange) {\n if (expandedRange.includes(coords)) {\n if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col))) {\n return this.getBottomRightCorner();\n }\n if (this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col))) {\n return this.getBottomLeftCorner();\n }\n if (this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col))) {\n return this.getTopRightCorner();\n }\n if (this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {\n return this.getTopLeftCorner();\n }\n }\n }\n\n if (coords.isEqual(this.getBottomRightCorner())) {\n return this.getTopLeftCorner();\n } else if (coords.isEqual(this.getTopLeftCorner())) {\n return this.getBottomRightCorner();\n } else if (coords.isEqual(this.getTopRightCorner())) {\n return this.getBottomLeftCorner();\n } else if (coords.isEqual(this.getBottomLeftCorner())) {\n return this.getTopRightCorner();\n }\n }\n\n /**\n * @param {CellRange} range\n * @returns {Array}\n */\n\n }, {\n key: 'getBordersSharedWith',\n value: function getBordersSharedWith(range) {\n if (!this.includesRange(range)) {\n return [];\n }\n\n var thisBorders = {\n top: Math.min(this.from.row, this.to.row),\n bottom: Math.max(this.from.row, this.to.row),\n left: Math.min(this.from.col, this.to.col),\n right: Math.max(this.from.col, this.to.col)\n };\n var rangeBorders = {\n top: Math.min(range.from.row, range.to.row),\n bottom: Math.max(range.from.row, range.to.row),\n left: Math.min(range.from.col, range.to.col),\n right: Math.max(range.from.col, range.to.col)\n };\n var result = [];\n\n if (thisBorders.top == rangeBorders.top) {\n result.push('top');\n }\n if (thisBorders.right == rangeBorders.right) {\n result.push('right');\n }\n if (thisBorders.bottom == rangeBorders.bottom) {\n result.push('bottom');\n }\n if (thisBorders.left == rangeBorders.left) {\n result.push('left');\n }\n\n return result;\n }\n\n /**\n * Get inner selected cell coords defined by this range\n *\n * @returns {Array}\n */\n\n }, {\n key: 'getInner',\n value: function getInner() {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n var out = [];\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {\n out.push(new _coords2.default(r, c));\n }\n }\n }\n return out;\n }\n\n /**\n * Get all selected cell coords defined by this range\n *\n * @returns {Array}\n */\n\n }, {\n key: 'getAll',\n value: function getAll() {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n var out = [];\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n if (topLeft.row === r && topLeft.col === c) {\n out.push(topLeft);\n } else if (bottomRight.row === r && bottomRight.col === c) {\n out.push(bottomRight);\n } else {\n out.push(new _coords2.default(r, c));\n }\n }\n }\n\n return out;\n }\n\n /**\n * Runs a callback function against all cells in the range. You can break the iteration by returning\n * `false` in the callback function\n *\n * @param callback {Function}\n */\n\n }, {\n key: 'forAll',\n value: function forAll(callback) {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n var breakIteration = callback(r, c);\n\n if (breakIteration === false) {\n return;\n }\n }\n }\n }\n }]);\n\n return CellRange;\n}();\n\nexports.default = CellRange;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = separatorItem;\nvar KEY = exports.KEY = '---------';\n\nfunction separatorItem() {\n return {\n name: KEY\n };\n}\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $defineProperty = __webpack_require__(19)\n , createDesc = __webpack_require__(40);\n\nmodule.exports = function(object, index, value){\n if(index in object)$defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15)\n , document = __webpack_require__(13).document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports) {\n\n// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar MATCH = __webpack_require__(10)('match');\nmodule.exports = function(KEY){\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch(e){\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch(f){ /* empty */ }\n } return true;\n};\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(38);\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ITERATOR = __webpack_require__(10)('iterator')\n , SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function(){ SAFE_CLOSING = true; };\n Array.from(riter, function(){ throw 2; });\n} catch(e){ /* empty */ }\n\nmodule.exports = function(exec, skipClosing){\n if(!skipClosing && !SAFE_CLOSING)return false;\n var safe = false;\n try {\n var arr = [7]\n , iter = arr[ITERATOR]();\n iter.next = function(){ return {done: safe = true}; };\n arr[ITERATOR] = function(){ return iter; };\n exec(arr);\n } catch(e){ /* empty */ }\n return safe;\n};\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(18)\n , dPs = __webpack_require__(286)\n , enumBugKeys = __webpack_require__(74)\n , IE_PROTO = __webpack_require__(81)('IE_PROTO')\n , Empty = function(){ /* empty */ }\n , PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function(){\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(73)('iframe')\n , i = enumBugKeys.length\n , lt = '<'\n , gt = '>'\n , iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(159).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties){\n var result;\n if(O !== null){\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty;\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pIE = __webpack_require__(47)\n , createDesc = __webpack_require__(40)\n , toIObject = __webpack_require__(23)\n , toPrimitive = __webpack_require__(85)\n , has = __webpack_require__(22)\n , IE8_DOM_DEFINE = __webpack_require__(160)\n , gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(21) ? gOPD : function getOwnPropertyDescriptor(O, P){\n O = toIObject(O);\n P = toPrimitive(P, true);\n if(IE8_DOM_DEFINE)try {\n return gOPD(O, P);\n } catch(e){ /* empty */ }\n if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(169)\n , hiddenKeys = __webpack_require__(74).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){\n return $keys(O, hiddenKeys);\n};\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar shared = __webpack_require__(82)('keys')\n , uid = __webpack_require__(49);\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = __webpack_require__(164)\n , defined = __webpack_require__(30);\n\nmodule.exports = function(that, searchString, NAME){\n if(isRegExp(searchString))throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(29)\n , invoke = __webpack_require__(282)\n , html = __webpack_require__(159)\n , cel = __webpack_require__(73)\n , global = __webpack_require__(13)\n , process = global.process\n , setTask = global.setImmediate\n , clearTask = global.clearImmediate\n , MessageChannel = global.MessageChannel\n , counter = 0\n , queue = {}\n , ONREADYSTATECHANGE = 'onreadystatechange'\n , defer, channel, port;\nvar run = function(){\n var id = +this;\n if(queue.hasOwnProperty(id)){\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function(event){\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif(!setTask || !clearTask){\n setTask = function setImmediate(fn){\n var args = [], i = 1;\n while(arguments.length > i)args.push(arguments[i++]);\n queue[++counter] = function(){\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id){\n delete queue[id];\n };\n // Node.js 0.8-\n if(__webpack_require__(38)(process) == 'process'){\n defer = function(id){\n process.nextTick(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if(MessageChannel){\n channel = new MessageChannel;\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){\n defer = function(id){\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if(ONREADYSTATECHANGE in cel('script')){\n defer = function(id){\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function(id){\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(15);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_86__;\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _mixed = __webpack_require__(20);\n\n/**\n * @alias Options\n * @constructor\n * @description\n\n * ## Constructor options\n *\n * Constructor options are applied using an object literal passed as a second argument to the Handsontable constructor.\n *\n * ```js\n * var hot = new Handsontable(document.getElementById('example1'), {\n * data: myArray,\n * width: 400,\n * height: 300\n * });\n * ```\n *\n * ---\n * ## Cascading configuration\n *\n * Handsontable 0.9 and newer is using *Cascading Configuration*, which is a fast way to provide configuration options\n * for the entire table, including its columns and particular cells.\n *\n * Consider the following example:\n * ```js\n * var hot = new Handsontable(document.getElementById('example'), {\n * readOnly: true,\n * columns: [\n * {readOnly: false},\n * {},\n * {}\n * ],\n * cells: function (row, col, prop) {\n * var cellProperties = {};\n *\n * if (row === 0 && col === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * }\n * });\n * ```\n *\n * The above notation will result in all TDs being *read only*, except for first column TDs which will be *editable*, except for the TD in top left corner which will still be *read only*.\n *\n * ### The Cascading Configuration model\n *\n * ##### 1. Constructor\n *\n * Configuration options that are provided using first-level `handsontable(container, {option: \"value\"})` and `updateSettings` method.\n *\n * ##### 2. Columns\n *\n * Configuration options that are provided using second-level object `handsontable(container, {columns: {option: \"value\"}]})`\n *\n * ##### 3. Cells\n *\n * Configuration options that are provided using second-level function `handsontable(container, {cells: function: (row, col, prop){ }})`\n *\n * ---\n * ## Architecture performance\n *\n * The Cascading Configuration model is based on prototypical inheritance. It is much faster and memory efficient compared\n * to the previous model that used jQuery extend. See: [http://jsperf.com/extending-settings](http://jsperf.com/extending-settings).\n *\n * ---\n * __Important notice:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n */\nfunction DefaultSettings() {};\n\nDefaultSettings.prototype = {\n /**\n * @description\n * Initial data source that will be bound to the data grid __by reference__ (editing data grid alters the data source).\n * Can be declared as an Array of Arrays, Array of Objects or a Function.\n *\n * See [Understanding binding as reference](http://docs.handsontable.com/tutorial-data-binding.html#page-reference).\n *\n * @type {Array|Function}\n * @default undefined\n */\n data: void 0,\n\n /**\n * @description\n * Defines the structure of a new row when data source is an array of objects.\n *\n * See [data-schema](http://docs.handsontable.com/tutorial-data-sources.html#page-data-schema) for examples.\n *\n * @type {Object}\n * @default undefined\n */\n dataSchema: void 0,\n\n /**\n * Width of the grid. Can be a value or a function that returns a value.\n *\n * @type {Number|Function}\n * @default undefined\n */\n width: void 0,\n\n /**\n * Height of the grid. Can be a number or a function that returns a number.\n *\n * @type {Number|Function}\n * @default undefined\n */\n height: void 0,\n\n /**\n * @description\n * Initial number of rows.\n *\n * __Notice:__ This option only has effect in Handsontable constructor and only if `data` option is not provided\n *\n * @type {Number}\n * @default 5\n */\n startRows: 5,\n\n /**\n * @description\n * Initial number of columns.\n *\n * __Notice:__ This option only has effect in Handsontable constructor and only if `data` option is not provided\n *\n * @type {Number}\n * @default 5\n */\n startCols: 5,\n\n /**\n * Setting `true` or `false` will enable or disable the default row headers (1, 2, 3).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set the index of the row is passed as a parameter.\n *\n * @type {Boolean|Array|Function}\n * @default null\n * @example\n * ```js\n * ...\n * // as boolean\n * rowHeaders: true,\n * ...\n *\n * ...\n * // as array\n * rowHeaders: [1, 2, 3],\n * ...\n *\n * ...\n * // as function\n * rowHeaders: function(index) {\n * return index + ': AB';\n * },\n * ...\n * ```\n */\n rowHeaders: void 0,\n\n /**\n * Setting `true` or `false` will enable or disable the default column headers (A, B, C).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set, then the index of the column is passed as a parameter.\n *\n * @type {Boolean|Array|Function}\n * @default null\n * @example\n * ```js\n * ...\n * // as boolean\n * colHeaders: true,\n * ...\n *\n * ...\n * // as array\n * colHeaders: ['A', 'B', 'C'],\n * ...\n *\n * ...\n * // as function\n * colHeaders: function(index) {\n * return index + ': AB';\n * },\n * ...\n * ```\n */\n colHeaders: null,\n\n /**\n * Defines column widths in pixels. Accepts number, string (that will be converted to a number),\n * array of numbers (if you want to define column width separately for each column) or a\n * function (if you want to set column width dynamically on each render).\n *\n * @type {Array|Function|Number|String}\n * @default undefined\n */\n colWidths: void 0,\n\n /**\n * Defines row heights in pixels. Accepts numbers, strings (that will be converted into a number),\n * array of numbers (if you want to define row height separately for each row) or a\n * function (if you want to set row height dynamically on each render).\n *\n * @type {Array|Function|Number|String}\n * @default undefined\n */\n rowHeights: void 0,\n\n /**\n * @description\n * Defines the cell properties and data binding for certain columns.\n *\n * __Notice:__ Using this option sets a fixed number of columns (options `startCols`, `minCols`, `maxCols` will be ignored).\n *\n * See [documentation -> datasources.html](http://docs.handsontable.com/tutorial-data-sources.html#page-nested) for examples.\n *\n * @type {Array}\n * @default undefined\n * @example\n * ```js\n * ...\n * columns: [\n * {\n * // column options for the first column\n * type: 'numeric',\n * format: '0,0.00 $'\n * },\n * {\n * // column options for the second column\n * type: 'text',\n * readOnly: true\n * }\n * ],\n * ...\n * ```\n */\n columns: void 0,\n\n /**\n * @description\n * Defines the cell properties for given `row`, `col`, `prop` coordinates.\n * Any constructor or column option may be overwritten for a particular cell (row/column combination)\n * using the `cells` property in the Handsontable constructor.\n *\n * __Note:__ Parameters `row` and `col` always represent __physical indexes__. Example below show how to execute\n * operations based on the __visual__ representation of Handsontable.\n *\n * @type {Function}\n * @default undefined\n * @example\n * ```js\n * ...\n * cells: function (row, col, prop) {\n * var cellProperties = {};\n * var visualRowIndex = this.instance.toVisualRow(row);\n * var visualColIndex = this.instance.toVisualColumn(col);\n *\n * if (visualRowIndex === 0 && visualColIndex === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * },\n * ...\n * ```\n */\n cells: void 0,\n\n /**\n * Any constructor or column option may be overwritten for a particular cell (row/column combination), using `cell`\n * array passed to the Handsontable constructor.\n *\n * @type {Array}\n * @default []\n * @example\n * ```js\n * ...\n * cell: [\n * {row: 0, col: 0, readOnly: true}\n * ],\n * ...\n * ```\n */\n cell: [],\n\n /**\n * @description\n * If `true`, enables the {@link Comments} plugin, which enables an option to apply cell comments through the context menu\n * (configurable with context menu keys `commentsAddEdit`, `commentsRemove`).\n *\n * To initialize Handsontable with predefined comments, provide cell coordinates and comment text values in a form of an array.\n *\n * See [Comments](http://docs.handsontable.com/demo-comments_.html) demo for examples.\n *\n * @since 0.11.0\n * @type {Boolean|Array}\n * @default false\n * @example\n * ```js\n * ...\n * comments: [{row: 1, col: 1, comment: {value: \"Test comment\"}}],\n * ...\n * ```\n */\n comments: false,\n\n /**\n * @description\n * If `true`, enables the Custom Borders plugin, which enables an option to apply custom borders through the context menu (configurable with context menu key `borders`).\n *\n * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](http://docs.handsontable.com/demo-custom-borders.html) demo for examples.\n *\n * @since 0.11.0\n * @type {Boolean|Array}\n * @default false\n * @example\n * ```js\n * ...\n * customBorders: [\n * {range: {\n * from: {row: 1, col: 1},\n * to: {row: 3, col: 4}},\n * left: {},\n * right: {},\n * top: {},\n * bottom: {}\n * }\n * ],\n * ...\n *\n * // or\n * ...\n * customBorders: [\n * {row: 2, col: 2, left: {width: 2, color: 'red'},\n * right: {width: 1, color: 'green'}, top: '', bottom: ''}\n * ],\n * ...\n * ```\n */\n customBorders: false,\n\n /**\n * Minimum number of rows. At least that number of rows will be created during initialization.\n *\n * @type {Number}\n * @default 0\n */\n minRows: 0,\n\n /**\n * Minimum number of columns. At least that number of columns will be created during initialization.\n *\n * @type {Number}\n * @default 0\n */\n minCols: 0,\n\n /**\n * Maximum number of rows. If set to a value lower than the initial row count, the data will be trimmed to the provided value as the number of rows.\n *\n * @type {Number}\n * @default Infinity\n */\n maxRows: Infinity,\n\n /**\n * Maximum number of cols. If set to a value lower than the initial col count, the data will be trimmed to the provided value as the number of cols.\n *\n * @type {Number}\n * @default Infinity\n */\n maxCols: Infinity,\n\n /**\n * When set to 1 (or more), Handsontable will add a new row at the end of grid if there are no more empty rows.\n * (unless the number of rows exceeds the one set in the `maxRows` property)\n *\n * @type {Number}\n * @default 0\n */\n minSpareRows: 0,\n\n /**\n * When set to 1 (or more), Handsontable will add a new column at the end of grid if there are no more empty columns.\n * (unless the number of rows exceeds the one set in the `maxCols` property)\n *\n * @type {Number}\n * @default 0\n */\n minSpareCols: 0,\n\n /**\n * If set to `false`, there won't be an option to insert new rows in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowInsertRow: true,\n\n /**\n * If set to `false`, there won't be an option to insert new columns in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowInsertColumn: true,\n\n /**\n * If set to `false`, there won't be an option to remove rows in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowRemoveRow: true,\n\n /**\n * If set to `false`, there won't be an option to remove columns in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowRemoveColumn: true,\n\n /**\n * If true, selection of multiple cells using keyboard or mouse is allowed.\n *\n * @type {Boolean}\n * @default true\n */\n multiSelect: true,\n\n /**\n * Enables the fill handle (drag-down and copy-down) functionality, which shows a small rectangle in bottom\n * right corner of the selected area, that let's you expand values to the adjacent cells.\n *\n * Possible values: `true` (to enable in all directions), `'vertical'` or `'horizontal'` (to enable in one direction),\n * `false` (to disable completely). Setting to `true` enables the fillHandle plugin.\n *\n * Since 0.23.0 you can pass object to plugin which allows you to add more options for this functionality. If `autoInsertRow`\n * option is `true`, fill-handler will create new rows till it reaches the last row. It is enabled by default.\n *\n * @example\n * ```js\n * ...\n * fillHandle: true // enable plugin in all directions and with autoInsertRow as true\n * ...\n * // or\n * ...\n * fillHandle: 'vertical' // enable plugin in vertical direction and with autoInsertRow as true\n * ...\n * // or\n * ...\n * fillHandle: { // enable plugin in both directions and with autoInsertRow as false\n * autoInsertRow: false,\n * }\n * // or\n * ...\n * fillHandle: { // enable plugin in vertical direction and with autoInsertRow as false\n * autoInsertRow: false,\n * direction: 'vertical' // 'vertical' or 'horizontal'\n * }\n * ```\n *\n * @type {Boolean|String|Object}\n * @default true\n */\n fillHandle: true,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the top of the table.\n *\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedRowsTop: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedRowsTop: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the bottom of the table.\n *\n * @pro\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedRowsBottom: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedRowsBottom: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) columns on the left of the table.\n *\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedColumnsLeft: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedColumnsLeft: 0,\n\n /**\n * If `true`, mouse click outside the grid will deselect the current selection.\n * Can be a function that takes the click event target and returns a boolean.\n *\n * @type {Boolean|Function}\n * @default true\n */\n outsideClickDeselects: true,\n\n /**\n * If `true`, <kbd>ENTER</kbd> begins editing mode (like in Google Docs). If `false`, <kbd>ENTER</kbd> moves to next\n * row (like Excel) and adds a new row if necessary. <kbd>TAB</kbd> adds new column if necessary.\n *\n * @type {Boolean}\n * @default true\n */\n enterBeginsEditing: true,\n\n /**\n * Defines the cursor movement after <kbd>ENTER</kbd> was pressed (<kbd>SHIFT</kbd> + <kbd>ENTER</kbd> uses a negative vector).\n * Can be an object or a function that returns an object. The event argument passed to the function\n * is a DOM Event object received after the <kbd>ENTER</kbd> key has been pressed. This event object can be used to check\n * whether user pressed <kbd>ENTER</kbd> or <kbd>SHIFT</kbd> + <kbd>ENTER</kbd>.\n *\n * @type {Object|Function}\n * @default {row: 1, col: 0}\n */\n enterMoves: { row: 1, col: 0 },\n\n /**\n * Defines the cursor movement after <kbd>TAB</kbd> is pressed (<kbd>SHIFT</kbd> + <kbd>TAB</kbd> uses a negative vector).\n * Can be an object or a function that returns an object. The event argument passed to the function\n * is a DOM Event object received after the <kbd>TAB</kbd> key has been pressed. This event object can be used to check\n * whether user pressed <kbd>TAB</kbd> or <kbd>SHIFT</kbd> + <kbd>TAB</kbd>.\n *\n * @type {Object}\n * @default {row: 0, col: 1}\n */\n tabMoves: { row: 0, col: 1 },\n\n /**\n * If `true`, pressing <kbd>TAB</kbd> or right arrow in the last column will move to first column in next row.\n *\n * @type {Boolean}\n * @default false\n */\n autoWrapRow: false,\n\n /**\n * If `true`, pressing <kbd>ENTER</kbd> or down arrow in the last row will move to the first row in the next column.\n *\n * @type {Boolean}\n * @default false\n */\n autoWrapCol: false,\n\n /**\n * Maximum number of rows than can be copied to clipboard using <kbd>CTRL</kbd> + <kbd>C</kbd>.\n *\n * @type {Number}\n * @default 1000\n */\n copyRowsLimit: 1000,\n\n /**\n * Maximum number of columns than can be copied to clipboard using <kbd>CTRL</kbd> + <kbd>C</kbd>.\n *\n * @type {Number}\n * @default 1000\n */\n copyColsLimit: 1000,\n\n /**\n * @description\n * Defines paste (<kbd>CTRL</kbd> + <kbd>V</kbd>) behavior.\n * * Default value `\"overwrite\"` will paste clipboard value over current selection.\n * * When set to `\"shift_down\"`, clipboard data will be pasted in place of current selection, while all selected cells are moved down.\n * * When set to `\"shift_right\"`, clipboard data will be pasted in place of current selection, while all selected cells are moved right.\n *\n * @type {String}\n * @default 'overwrite'\n */\n pasteMode: 'overwrite',\n\n /**\n * @description\n * Turns on saving the state of column sorting, column positions and column sizes in local storage.\n *\n * You can save any sort of data in local storage to preserve table state between page reloads.\n * In order to enable data storage mechanism, `persistentState` option must be set to `true` (you can set it\n * either during Handsontable initialization or using the `updateSettings` method). When `persistentState` is enabled it exposes 3 hooks:\n *\n * __persistentStateSave__ (key: String, value: Mixed)\n *\n * * Saves value under given key in browser local storage.\n *\n * __persistentStateLoad__ (key: String, valuePlaceholder: Object)\n *\n * * Loads `value`, saved under given key, form browser local storage. The loaded `value` will be saved in `valuePlaceholder.value`\n * (this is due to specific behaviour of `Hooks.run()` method). If no value have been saved under key `valuePlaceholder.value`\n * will be `undefined`.\n *\n * __persistentStateReset__ (key: String)\n *\n * * Clears the value saved under `key`. If no `key` is given, all values associated with table will be cleared.\n *\n * __Note:__ The main reason behind using `persistentState` hooks rather than regular LocalStorage API is that it\n * ensures separation of data stored by multiple Handsontable instances. In other words, if you have two (or more)\n * instances of Handsontable on one page, data saved by one instance won't be accessible by the second instance.\n * Those two instances can store data under the same key and no data would be overwritten.\n *\n * __Important:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n *\n * @type {Boolean}\n * @default false\n */\n persistentState: void 0,\n\n /**\n * Class name for all visible rows in the current selection.\n *\n * @type {String}\n * @default undefined\n * @example\n * ```js\n * currentRowClassName: 'currentRow' // This will add a 'currentRow' class name to appropriate table cells.\n * ```\n */\n currentRowClassName: void 0,\n\n /**\n * Class name for all visible columns in the current selection.\n *\n * @type {String}\n * @default undefined\n * @example\n * ```js\n * currentColClassName: 'currentColumn' // This will add a 'currentColumn' class name to appropriate table cells.\n * ```\n */\n currentColClassName: void 0,\n\n /**\n * Class name for all visible headers in current selection.\n *\n * @type {String}\n * @since 0.27.0\n * @default 'ht__highlight'\n * @example\n * ```js\n * currentHeaderClassName: 'ht__highlight' // This will add a 'ht__highlight' class name to appropriate table headers.\n * ```\n */\n currentHeaderClassName: 'ht__highlight',\n /**\n * Class name for the Handsontable container element.\n *\n * @type {String|Array}\n * @default undefined\n */\n className: void 0,\n\n /**\n * Class name for all tables inside container element.\n *\n * @since 0.17.0\n * @type {String|Array}\n * @default undefined\n */\n tableClassName: void 0,\n\n /**\n * @description\n * Defines how the columns react, when the declared table width is different than the calculated sum of all column widths.\n * [See more](http://docs.handsontable.com/demo-stretching.html) mode. Possible values:\n * * `'none'` Disable stretching\n * * `'last'` Stretch only the last column\n * * `'all'` Stretch all the columns evenly\n *\n * @type {String}\n * @default 'none'\n */\n stretchH: 'none',\n\n /**\n * Lets you overwrite the default `isEmptyRow` method, which checks if row at the provided index is empty.\n *\n * @type {Function}\n * @param {Number} row\n * @returns {Boolean}\n */\n isEmptyRow: function isEmptyRow(row) {\n var col, colLen, value, meta;\n\n for (col = 0, colLen = this.countCols(); col < colLen; col++) {\n value = this.getDataAtCell(row, col);\n\n if (value !== '' && value !== null && (0, _mixed.isDefined)(value)) {\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n meta = this.getCellMeta(row, col);\n\n return isObjectEquals(this.getSchema()[meta.prop], value);\n }\n return false;\n }\n }\n\n return true;\n },\n\n\n /**\n * Lets you overwrite the default `isEmptyCol` method, which checks if column at the provided index is empty.\n *\n * @type {Function}\n * @param {Number} col\n * @returns {Boolean}\n */\n isEmptyCol: function isEmptyCol(col) {\n var row, rowLen, value;\n\n for (row = 0, rowLen = this.countRows(); row < rowLen; row++) {\n value = this.getDataAtCell(row, col);\n\n if (value !== '' && value !== null && (0, _mixed.isDefined)(value)) {\n return false;\n }\n }\n\n return true;\n },\n\n\n /**\n * When set to `true`, the table is re-rendered when it is detected that it was made visible in DOM.\n *\n * @type {Boolean}\n * @default true\n */\n observeDOMVisibility: true,\n\n /**\n * If set to `true`, Handsontable will accept values that were marked as invalid by the cell `validator`.\n * It will result with *invalid* cells being treated as *valid* (will save the *invalid* value into the Handsontable data source).\n * If set to `false`, Handsontable will *not* accept the invalid values and won't allow the user to close the editor.\n * This option will be particularly useful when used with the Autocomplete's `strict` mode.\n *\n * @type {Boolean}\n * @default true\n * @since 0.9.5\n */\n allowInvalid: true,\n\n /**\n * If set to `true`, Handsontable will accept values that are empty (`null`, `undefined` or `''`).\n * If set to `false`, Handsontable will *not* accept the empty values and mark cell as invalid.\n *\n * @example\n * ```js\n * ...\n * allowEmpty: true // allow empty values for all cells (whole table)\n * ...\n * // or\n * ...\n * columns: [\n * // allow empty values only for 'date' column\n * {data: 'date', dateFormat: 'DD/MM/YYYY', allowEmpty: true}\n * ]\n * ...\n * ```\n *\n * @type {Boolean}\n * @default true\n * @since 0.23.0\n */\n allowEmpty: true,\n\n /**\n * CSS class name for cells that did not pass validation.\n *\n * @type {String}\n * @default 'htInvalid'\n */\n invalidCellClassName: 'htInvalid',\n\n /**\n * When set to an non-empty string, displayed as the cell content for empty cells. If a value of a different type is provided,\n * it will be stringified and applied as a string.\n *\n * @type {Mixed}\n * @default false\n */\n placeholder: false,\n\n /**\n * CSS class name for cells that have a placeholder in use.\n *\n * @type {String}\n * @default 'htPlaceholder'\n */\n placeholderCellClassName: 'htPlaceholder',\n\n /**\n * CSS class name for read-only cells.\n *\n * @type {String}\n * @default 'htDimmed'\n */\n readOnlyCellClassName: 'htDimmed',\n\n /**\n * @description\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `checkbox`,\n * * `html`,\n * * `numeric`,\n * * `password`.\n * * `text`.\n *\n * Or you can [register](http://docs.handsontable.com/demo-custom-renderers.html) the custom renderer under specified name and use\n * its name as an alias in your configuration.\n *\n * If a function is provided, it will receive the following arguments:\n * ```js\n * function(instance, TD, row, col, prop, value, cellProperties) {}\n * ```\n *\n * You can read more about custom renderes [in the documentation](http://docs.handsontable.com/demo-custom-renderers.html).\n *\n * @example\n * ```js\n * ...\n * Handsontable.renderers.registerRenderer('my.renderer', function(instance, TD, row, col, prop, value, cellProperties) {\n * TD.innerHTML = value;\n * });\n * ...\n * columns: [\n * {\n * editor: 'select',\n * renderer: 'autocomplete' // as string\n * },\n * {\n * renderer: 'my.renderer' // custom renderer as an alias\n * },\n * {\n * // renderer as custom function\n * renderer: function(hotInstance, TD, row, col, prop, value, cellProperties) {\n * TD.style.color = 'blue';\n * TD.innerHTML = value;\n * }\n * }\n * ]\n * ...\n * ```\n *\n * @type {String|Function}\n * @default undefined\n */\n renderer: void 0,\n\n /**\n * CSS class name added to the commented cells.\n *\n * @type {String}\n * @default 'htCommentCell'\n */\n commentedCellClassName: 'htCommentCell',\n\n /**\n * If set to `true`, it enables the browser's native selection of a fragment of the text within a single cell, between adjacent cells or in a whole table.\n * If set to `'cell'`, it enables the possibility of selecting a fragment of the text within a single cell's body.\n *\n * @type {Boolean|String}\n * @default false\n */\n fragmentSelection: false,\n\n /**\n * @description\n * Make cell [read only](http://docs.handsontable.com/demo-read-only.html).\n *\n * @type {Boolean}\n * @default false\n */\n readOnly: false,\n\n /**\n * @description\n * When added to a `column` property, it skips the column on paste and pastes the data on the next column to the right.\n *\n * @type {Boolean}\n * @default false\n */\n skipColumnOnPaste: false,\n\n /**\n * @description\n * Setting to true enables the search plugin (see [demo](http://docs.handsontable.com/demo-search-for-values.html)).\n *\n * @type {Boolean}\n * @default false\n */\n search: false,\n\n /**\n * @description\n * Shortcut to define the combination of the cell renderer, editor and validator for the column, cell or whole table.\n *\n * Possible values:\n * * [autocomplete](http://docs.handsontable.com/demo-autocomplete.html)\n * * [checkbox](http://docs.handsontable.com/demo-checkbox.html)\n * * [date](http://docs.handsontable.com/demo-date.html)\n * * [dropdown](http://docs.handsontable.com/demo-dropdown.html)\n * * [handsontable](http://docs.handsontable.com/demo-handsontable.html)\n * * [numeric](http://docs.handsontable.com/demo-numeric.html)\n * * [password](http://docs.handsontable.com/demo-password.html)\n * * text\n * * [time](http://docs.handsontable.com/demo-time.html)\n *\n * Or you can register the custom cell type under specified name and use\n * its name as an alias in your configuration.\n *\n * @example\n * ```js\n * ...\n * Handsontable.cellTypes.registerCellType('my.type', {\n * editor: MyEditorClass,\n * renderer: function(hot, td, row, col, prop, value, cellProperties) {\n * td.innerHTML = value;\n * },\n * validator: function(value, callback) {\n * callback(value === 'foo' ? true : false);\n * }\n * });\n * ...\n * columns: [\n * {\n * type: 'text'\n * },\n * {\n * type: 'my.type' // an alias to custom type\n * },\n * {\n * type: 'checkbox'\n * }\n * ]\n * ...\n * ```\n *\n * @type {String}\n * @default 'text'\n */\n type: 'text',\n\n /**\n * @description\n * Make cell copyable (pressing <kbd>CTRL</kbd> + <kbd>C</kbd> on your keyboard moves its value to system clipboard).\n *\n * __Note:__ this setting is `false` by default for cells with type `password`.\n *\n * @type {Boolean}\n * @default true\n * @since 0.10.2\n */\n copyable: true,\n\n /**\n * Defines the editor for the table/column/cell.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * [autocomplete](http://docs.handsontable.com/demo-autocomplete.html)\n * * [checkbox](http://docs.handsontable.com/demo-checkbox.html)\n * * [date](http://docs.handsontable.com/demo-date.html)\n * * [dropdown](http://docs.handsontable.com/demo-dropdown.html)\n * * [handsontable](http://docs.handsontable.com/demo-handsontable.html)\n * * [mobile](http://docs.handsontable.com/demo-mobiles-and-tablets.html)\n * * [password](http://docs.handsontable.com/demo-password.html)\n * * [select](http://docs.handsontable.com/demo-select.html)\n * * text\n *\n * Or you can [register](http://docs.handsontable.com/tutorial-cell-editor.html#registering-an-editor) the custom editor under specified name and use\n * its name as an alias in your configuration.\n *\n * To disable cell editing completely set `editor` property to `false`.\n *\n * @example\n * ```js\n * ...\n * columns: [\n * {\n * editor: 'select'\n * },\n * {\n * editor: false\n * }\n * ]\n * ...\n * ```\n *\n * @type {String|Function|Boolean}\n * @default 'text'\n */\n editor: void 0,\n\n /**\n * @description\n * Autocomplete definitions. See [autocomplete demo](http://docs.handsontable.com/demo-autocomplete.html) for examples and definitions.\n *\n * @type {Array}\n * @default undefined\n */\n autoComplete: void 0,\n\n /**\n * Control number of choices for the autocomplete (or dropdown) typed cells. After exceeding it, a scrollbar for the dropdown list of choices will appear.\n *\n * @since 0.18.0\n * @type {Number}\n * @default 10\n */\n visibleRows: 10,\n\n /**\n * Makes autocomplete or dropdown width the same as the edited cell width. If `false` then editor will be scaled\n * according to its content.\n *\n * @since 0.17.0\n * @type {Boolean}\n * @default true\n */\n trimDropdown: true,\n\n /**\n * Setting to true enables the debug mode, currently used to test the correctness of the row and column\n * header fixed positioning on a layer above the master table.\n *\n * @type {Boolean}\n * @default false\n */\n debug: false,\n\n /**\n * When set to `true`, the text of the cell content is wrapped if it does not fit in the fixed column width.\n *\n * @type {Boolean}\n * @default true\n * @since 0.11.0\n */\n wordWrap: true,\n\n /**\n * CSS class name added to cells with cell meta `wordWrap: false`.\n *\n * @type {String}\n * @default 'htNoWrap'\n * @since 0.11.0\n */\n noWordWrapClassName: 'htNoWrap',\n\n /**\n * @description\n * Defines if the right-click context menu should be enabled. Context menu allows to create new row or\n * column at any place in the grid among [other features](http://docs.handsontable.com/demo-context-menu.html).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n *\n * or array of any available strings:\n * * `[\"row_above\", \"row_below\", \"col_left\", \"col_right\",\n * \"remove_row\", \"remove_col\", \"---------\", \"undo\", \"redo\"]`.\n *\n * See [the context menu demo](http://docs.handsontable.com/demo-context-menu.html) for examples.\n *\n * @example\n * ```js\n * ...\n * // as a boolean\n * contextMenu: true\n * ...\n * // as a array\n * contextMenu: ['row_above', 'row_below', '--------', 'undo', 'redo']\n * ...\n * ```\n *\n * @type {Boolean|Array|Object}\n * @default undefined\n */\n contextMenu: void 0,\n\n /**\n * @description\n * Defines new actions copy/paste for context menu. This functionality is dependent on ZeroClipboard from which you\n * should pass the swf file path under `swfPath` object key.\n *\n * @example\n * ```js\n * ...\n * contextMenuCopyPaste: {swfPath: '[path to file]'}\n * ...\n * ```\n *\n * @type {Object}\n */\n contextMenuCopyPaste: void 0,\n\n /**\n * @description\n * Disable or enable the copy/paste functionality.\n *\n * @example\n * ```js\n * ...\n * copyPaste: false,\n * ...\n * ```\n *\n * @type {Boolean}\n * @default undefined\n */\n copyPaste: void 0,\n\n /**\n * If `true`, undo/redo functionality is enabled.\n *\n * @type {Boolean}\n * @default undefined\n */\n undo: void 0,\n\n /**\n * @description\n * Turns on [Column sorting](http://docs.handsontable.com/demo-sorting-data.html).\n * Can be either a boolean (true/false) or an object with a declared sorting options. See the below example:\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * columnSorting: true\n * ...\n * // as a object with initial order (sort ascending column at index 2)\n * columnSorting: {\n * column: 2,\n * sortOrder: true, // true = ascending, false = descending, undefined = original order\n * sortEmptyCells: true // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * }\n * ...\n * ```\n *\n * @type {Boolean|Object}\n * @default undefined\n */\n columnSorting: void 0,\n\n /**\n * @description\n * Turns on [Manual column move](http://docs.handsontable.com/demo-moving-rows-and-columns.html), if set to a boolean or define initial\n * column order, if set to an array of column indexes.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualColumnMove: true\n * ...\n * // as a array with initial order (move column index at 0 to 1 and move column index at 1 to 4)\n * manualColumnMove: [1, 4]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n */\n manualColumnMove: void 0,\n\n /**\n * @description\n * Turns on [Manual column resize](http://docs.handsontable.com/demo-resizing.html), if set to a boolean or define initial\n * column resized widths, if set to an array of numbers.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualColumnResize: true\n * ...\n * // as a array with initial widths (column at 0 index has 40px and column at 1 index has 50px)\n * manualColumnResize: [40, 50]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n */\n manualColumnResize: void 0,\n\n /**\n * @description\n * Turns on [Manual row move](http://docs.handsontable.com/demo-moving-rows-and-columns.html), if set to a boolean or define initial\n * row order, if set to an array of row indexes.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualRowMove: true\n * ...\n * // as a array with initial order (move row index at 0 to 1 and move row index at 1 to 4)\n * manualRowMove: [1, 4]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n * @since 0.11.0\n */\n manualRowMove: void 0,\n\n /**\n * @description\n * Turns on [Manual row resize](http://docs.handsontable.com/demo-resizing.html), if set to a boolean or define initial\n * row resized heights, if set to an array of numbers.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualRowResize: true\n * ...\n * // as a array with initial heights (row at 0 index has 40px and row at 1 index has 50px)\n * manualRowResize: [40, 50]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n * @since 0.11.0\n */\n manualRowResize: void 0,\n\n /**\n * @description\n * If set to `true`, it enables a possibility to merge cells. If set to an array of objects, it merges the cells provided in the objects (see the example below).\n * [More information on the demo page.](http://docs.handsontable.com/demo-merge-cells.html)\n *\n * @example\n * ```js\n * // enables the mergeCells plugin:\n * margeCells: true\n * ...\n * // declares a list of merged sections:\n * mergeCells: [\n * {row: 1, col: 1, rowspan: 3, colspan: 3}, // rowspan and colspan properties declare the width and height of a merged section in cells\n * {row: 3, col: 4, rowspan: 2, colspan: 2},\n * {row: 5, col: 6, rowspan: 3, colspan: 3}\n * ]\n * ```\n * @type {Boolean|Array}\n * @default false\n */\n mergeCells: false,\n\n /**\n * Number of rows to be rendered outside of the visible part of the table.\n * By default, it's set to `'auto'`, which makes Handsontable to attempt to calculate the best offset performance-wise.\n *\n * You may test out different values to find the best one that works for your specific implementation.\n *\n * @type {Number|String}\n * @default 'auto'\n */\n viewportRowRenderingOffset: 'auto',\n\n /**\n * Number of columns to be rendered outside of the visible part of the table.\n * By default, it's set to `'auto'`, which makes Handsontable try calculating the best offset performance-wise.\n *\n * You may experiment with the value to find the one that works best for your specific implementation.\n *\n * @type {Number|String}\n * @default 'auto'\n */\n viewportColumnRenderingOffset: 'auto',\n\n /**\n * A function, regular expression or a string, which will be used in the process of cell validation.\n * If a function is used, be sure to execute the callback argument with either `true` (`callback(true)`) if the validation passed\n * or with `false` (`callback(false)`), if the validation failed.\n * Note, that `this` in the function points to the `cellProperties` object.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `date`,\n * * `numeric`,\n * * `time`.\n *\n * Or you can [register](http://docs.handsontable.com/demo-data-validation.html) the validator function under specified name and use\n * its name as an alias in your configuration.\n *\n * See more [in the demo](http://docs.handsontable.com/demo-data-validation.html).\n *\n * @example\n * ```js\n * // as a function\n * columns: [\n * {\n * validator: function(value, callback) { // validation rules }\n * }\n * ]\n * ...\n * // as a regexp\n * columns: [\n * {\n * validator: /^[0-9]$/ // regular expression\n * }\n * ]\n * // as a string\n * columns: [\n * {\n * validator: 'numeric'\n * }\n * ]\n * ```\n * @type {Function|RegExp|String}\n * @default undefined\n * @since 0.9.5\n */\n validator: void 0,\n\n /**\n * @description\n * Disable visual cells selection.\n *\n * Possible values:\n * * `true` - Disables any type of visual selection (current and area selection),\n * * `false` - Enables any type of visual selection. This is default value.\n * * `current` - Disables the selection of a currently selected cell, the area selection is still present.\n * * `area` - Disables the area selection, the currently selected cell selection is still present.\n *\n * @type {Boolean|String|Array}\n * @default false\n * @since 0.13.2\n * @example\n * ```js\n * ...\n * // as boolean\n * disableVisualSelection: true,\n * ...\n *\n * ...\n * // as string ('current' or 'area')\n * disableVisualSelection: 'current',\n * ...\n *\n * ...\n * // as array\n * disableVisualSelection: ['current', 'area'],\n * ...\n * ```\n */\n disableVisualSelection: false,\n\n /**\n * @description\n * Set whether to display the current sorting order indicator (a triangle icon in the column header, specifying the sorting order).\n *\n * @type {Boolean}\n * @default false\n * @since 0.15.0-beta3\n */\n sortIndicator: void 0,\n\n /**\n * Disable or enable ManualColumnFreeze plugin.\n *\n * @type {Boolean}\n * @default false\n */\n manualColumnFreeze: void 0,\n\n /**\n * @description\n * Defines whether Handsontable should trim the whitespace at the beginning and the end of the cell contents.\n *\n * @type {Boolean}\n * @default true\n */\n trimWhitespace: true,\n\n settings: void 0,\n\n /**\n * @description\n * Defines data source for Autocomplete or Dropdown cell types.\n *\n * @example\n * ```js\n * ...\n * // source as a array\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C', 'D']\n * }]\n * ...\n * // source as a function\n * columns: [{\n * type: 'autocomplete',\n * source: function(query, callback) {\n * fetch('http://example.com/query?q=' + query, function(response) {\n * callback(response.items);\n * })\n * }\n * }]\n * ...\n * ```\n *\n * @type {Array|Function}\n * @default undefined\n */\n source: void 0,\n\n /**\n * @description\n * Defines the column header name.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * title: 'First name',\n * type: 'text',\n * },\n * {\n * title: 'Last name',\n * type: 'text',\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default undefined\n */\n title: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is checked.\n *\n * @example\n * ```js\n * checkedTemplate: 'good'\n *\n * // if a checkbox-typed cell is checked, then getDataAtCell(x,y), where x and y are the coordinates of the cell\n * // will return 'good'.\n * ```\n * @type {Boolean|String}\n * @default true\n */\n checkedTemplate: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is unchecked.\n *\n * @example\n * ```js\n * uncheckedTemplate: 'bad'\n *\n * // if a checkbox-typed cell is not checked, then getDataAtCell(x,y), where x and y are the coordinates of the cell\n * // will return 'bad'.\n * ```\n * @type {Boolean|String}\n * @default false\n */\n uncheckedTemplate: void 0,\n\n /**\n * @description\n * Object which describes if renderer should create checkbox element with label element as a parent. Option desired for\n * [checkbox](http://docs.handsontable.com/demo-checkbox.html)-typed cells.\n *\n * By default the [checkbox](http://docs.handsontable.com/demo-checkbox.html) renderer renders the checkbox without a label.\n *\n * Possible object properties:\n * * `property` - Defines the property name of the data object, which will to be used as a label.\n * (eg. `label: {property: 'name.last'}`). This option works only if data was passed as an array of objects.\n * * `position` - String which describes where to place the label text (before or after checkbox element).\n * Valid values are `'before'` and '`after`' (defaults to `'after'`).\n * * `value` - String or a Function which will be used as label text.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'checkbox',\n * label: {position: 'after', value: 'My label: '}\n * }]\n * ...\n * ```\n *\n * @since 0.19.0\n * @type {Object}\n * @default undefined\n */\n label: void 0,\n\n /**\n * Display format. See [numbrojs](http://numbrojs.com). This option is desired for\n * [numeric](http://docs.handsontable.com/demo-numeric.html)-typed cells.\n *\n * Since 0.26.0 Handsontable uses [numbro](http://numbrojs.com/) as a main library for numbers formatting.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'numeric',\n * format: '0,00'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default '0'\n */\n format: void 0,\n\n /**\n * Language display format. See [numbrojs](http://numbrojs.com/languages.html#supported-languages). This option is desired for\n * [numeric](http://docs.handsontable.com/demo-numeric.html)-typed cells.\n *\n * Since 0.26.0 Handsontable uses [numbro](http://numbrojs.com/) as a main library for numbers formatting.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'numeric',\n * language: 'en-US'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default 'en-US'\n */\n language: void 0,\n\n /**\n * @description\n * Data source for [select](http://docs.handsontable.com/demo-select.html)-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * editor: 'select',\n * selectOptions: ['A', 'B', 'C'],\n * }]\n * ...\n * ```\n *\n * @type {Array}\n */\n selectOptions: void 0,\n\n /**\n * Enables or disables the autoColumnSize plugin. Default value is `undefined`, which has the same effect as `true`.\n * Disabling this plugin can increase performance, as no size-related calculations would be done.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n * `syncLimit` option is available since 0.16.0.\n *\n * You can also use the `useHeaders` option to take the column headers with into calculation.\n *\n * @example\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ...\n *\n * ...\n * // use headers width while calculation the column width\n * autoColumnSize: {useHeaders: true},\n * ...\n *\n * ```\n *\n * @type {Object|Boolean}\n * @default {syncLimit: 50}\n */\n autoColumnSize: void 0,\n\n /**\n * Enables or disables autoRowSize plugin. Default value is `undefined`, which has the same effect as `false` (disabled).\n * Enabling this plugin can decrease performance, as size-related calculations would be performed.\n *\n * Row height calculations are divided into sync and async stages. Each of these stages has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n * `syncLimit` options is available since 0.16.0.\n *\n * @example\n * ```js\n * ...\n * // as number (300 columns in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ...\n * ```\n * @type {Object|Boolean}\n * @default {syncLimit: 1000}\n */\n autoRowSize: void 0,\n\n /**\n * Date validation format.\n *\n * Option desired for `'date'` - typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * dateFormat: 'MM/DD/YYYY'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default 'DD/MM/YYYY'\n */\n dateFormat: void 0,\n\n /**\n * If `true` then dates will be automatically formatted to match the desired format.\n *\n * Option desired for `'date'`-typed typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * dateFormat: 'YYYY-MM-DD',\n * correctFormat: true\n * }]\n * ...\n * ```\n *\n * @type {Boolean}\n * @default false\n */\n correctFormat: false,\n\n /**\n * Definition of default value which will fill the empty cells.\n *\n * Option desired for `'date'`-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * defaultData: '2015-02-02'\n * }]\n * ...\n * ```\n *\n * @type {String}\n */\n defaultDate: void 0,\n\n /**\n * If set to `true`, the value entered into the cell must match (case-sensitive) the autocomplete source. Otherwise, cell won't pass the validation.\n * When filtering the autocomplete source list, the editor will be working in case-insensitive mode.\n *\n * Option desired for `autocomplete`-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C'],\n * strict: true\n * }]\n * ...\n * ```\n *\n * @type {Boolean}\n */\n strict: void 0,\n\n /**\n * @description\n * If typed `true`, data defined in `source` of the autocomplete or dropdown cell will be treated as HTML.\n *\n * __Warning:__ Enabling this option can cause serious XSS vulnerabilities.\n *\n * Option desired for `'autocomplete'`-typed cells.\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'autocomplete',\n * allowHtml: true,\n * source: ['<b>foo</b>', '<b>bar</b>']\n * }]\n * ...\n * ```\n * @type {Boolean}\n * @default false\n */\n allowHtml: false,\n\n /**\n * If typed `true` then virtual rendering mechanism for handsontable will be disabled.\n *\n * @type {Boolean}\n */\n renderAllRows: void 0,\n\n /**\n * Prevents table to overlap outside the parent element. If `'horizontal'` option is chosen then table will appear horizontal\n * scrollbar in case where parent's width is narrower then table's width.\n *\n * Possible values:\n * * `false` - Disables functionality (Default option).\n * * `horizontal` - Prevents horizontal overflow table.\n * * `vertical` - Prevents vertical overflow table (Not implemented yet).\n *\n * @since 0.20.3\n * @example\n * ```js\n * ...\n * preventOverflow: 'horizontal'\n * ...\n * ```\n *\n * @type {String|Boolean}\n */\n preventOverflow: false,\n\n /**\n * @description\n * Plugin allowing binding the table rows with their headers.\n * If the plugin is enabled, the table row headers will \"stick\" to the rows, when they are hidden/moved. Basically, if at the initialization\n * row 0 has a header titled \"A\", it will have it no matter what you do with the table.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|String}\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * bindRowsWithHeaders: true\n * });\n * ...\n * ```\n *\n */\n bindRowsWithHeaders: void 0,\n\n /**\n * @description\n * The CollapsibleColumns plugin allows collapsing of columns, covered by a header with the `colspan` property defined.\n *\n * Clicking the \"collapse/expand\" button collapses (or expands) all \"child\" headers except the first one.\n *\n * Setting the `collapsibleColumns` property to `true` will display a \"collapse/expand\" button in every header with a defined\n * `colspan` property.\n *\n * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property as an array of objects, as in\n * the example below.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Array}\n * @example\n * ```js\n * ...\n * collapsibleColumns: [\n * {row: -4, col: 1, collapsible: true},\n * {row: -3, col: 5, collapsible: true}\n * ]\n * ...\n * // or\n * ...\n * collapsibleColumns: true\n * ...\n * ```\n */\n collapsibleColumns: void 0,\n\n /**\n * @description\n * Allows making pre-defined calculations on the cell values and display the results within Handsontable.\n * See the demo for more information.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Object}\n */\n columnSummary: void 0,\n\n /**\n * This plugin allows adding a configurable dropdown menu to the table's column headers.\n * The dropdown menu acts like the Context Menu, but is triggered by clicking the button in the header.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object|Array}\n */\n dropdownMenu: void 0,\n\n /**\n * The filters plugin.\n * It allows filtering the table data either by the built-in component or with the API.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean}\n */\n filters: void 0,\n\n /**\n * It allows Handsontable to process formula expressions defined in the provided data.\n *\n * @pro\n * @since 1.7.0\n * @type {Boolean}\n */\n formulas: void 0,\n\n /**\n * @description\n * GanttChart plugin enables a possibility to create a Gantt chart using a Handsontable instance.\n * In this case, the whole table becomes read-only.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Object}\n */\n ganttChart: void 0,\n\n /**\n * @description\n * Allows adding a tooltip to the table headers.\n *\n * Available options:\n * * the `rows` property defines if tooltips should be added to row headers,\n * * the `columns` property defines if tooltips should be added to column headers,\n * * the `onlyTrimmed` property defines if tooltips should be added only to headers, which content is trimmed by the header itself (the content being wider then the header).\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n headerTooltips: void 0,\n\n /**\n * Plugin allowing hiding of certain columns.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n hiddenColumns: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n hiddenRows: void 0,\n\n /**\n * @description\n * Allows creating a nested header structure, using the HTML's colspan attribute.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Array}\n */\n nestedHeaders: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Array}\n */\n trimRows: void 0,\n\n /**\n * @description\n * Allows setting a custom width of the row headers. You can provide a number or an array of widths, if many row header levels are defined.\n *\n * @since 0.22.0\n * @type {Number|Array}\n */\n rowHeaderWidth: void 0,\n\n /**\n * @description\n * Allows setting a custom height of the column headers. You can provide a number or an array of heights, if many column header levels are defined.\n *\n * @since 0.22.0\n * @type {Number|Array}\n */\n columnHeaderHeight: void 0,\n\n /**\n * @description\n * Enabling this plugin switches table into one-way data binding where changes are applied into data source (from outside table)\n * will be automatically reflected in the table.\n *\n * For every data change [afterChangesObserved](Hooks.html#event:afterChangesObserved) hook will be fired.\n *\n * @type {Boolean}\n * @default false\n */\n observeChanges: void 0,\n\n /**\n * @description\n * When passed to the `column` property, allows specifying a custom sorting function for the desired column.\n *\n * @since 0.24.0\n * @type {Function}\n * @example\n * ```js\n * columns: [\n * {\n * sortFunction: function(sortOrder) {\n * return function(a, b) {\n * // sorting function body.\n * //\n * // Function parameters:\n * // sortOrder: If true, the order is ascending, if false - descending. undefined = original order\n * // a, b: Two compared elements. These are 2-element arrays, with the first element being the row index, the second - cell value.\n * }\n * }\n * }\n * ]\n * ```\n */\n sortFunction: void 0,\n\n /**\n * If defined as 'true', the Autocomplete's suggestion list would be sorted by relevance (the closer to the left the match is, the higher the suggestion).\n *\n * Option desired for cells of the `'autocomplete'` type.\n *\n * @type {Boolean}\n * @default true\n */\n sortByRelevance: true,\n\n /**\n * If defined as 'true', when the user types into the input area the Autocomplete's suggestion list is updated to only\n * include those choices starting with what has been typed; if defined as 'false' all suggestions remain shown, with\n * those matching what has been typed marked in bold.\n *\n * @type {Boolean}\n * @default true\n */\n filter: true,\n\n /**\n * If defined as 'true', filtering in the Autocomplete Editor will be case-sensitive.\n *\n * @type {Boolean}\n * @default: false\n */\n filteringCaseSensitive: false\n};\n\nexports.default = DefaultSettings;\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getNormalizedDate = getNormalizedDate;\n/* eslint-disable import/prefer-default-export */\n\n/**\n * Get normalized Date object for the ISO formatted date strings.\n * Natively, the date object parsed from a ISO 8601 string will be offsetted by the timezone difference, which may result in returning a wrong date.\n * See: Github issue #3338.\n *\n * @param {String} dateString String representing the date.\n * @returns {Date} The proper Date object.\n */\nfunction getNormalizedDate(dateString) {\n var nativeDate = new Date(dateString);\n\n // NaN if dateString is not in ISO format\n if (!isNaN(new Date(dateString + \"T00:00\").getDate())) {\n\n // Compensate timezone offset\n return new Date(nativeDate.getTime() + nativeDate.getTimezoneOffset() * 60000);\n }\n\n return nativeDate;\n}\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = __webpack_require__(3);\n\n$export($export.P, 'Array', {copyWithin: __webpack_require__(275)});\n\n__webpack_require__(37)('copyWithin');\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = __webpack_require__(3);\n\n$export($export.P, 'Array', {fill: __webpack_require__(276)});\n\n__webpack_require__(37)('fill');\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = __webpack_require__(3)\n , $find = __webpack_require__(53)(6)\n , KEY = 'findIndex'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(37)(KEY);\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = __webpack_require__(3)\n , $find = __webpack_require__(53)(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(37)(KEY);\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar ctx = __webpack_require__(29)\n , $export = __webpack_require__(3)\n , toObject = __webpack_require__(41)\n , call = __webpack_require__(165)\n , isArrayIter = __webpack_require__(161)\n , toLength = __webpack_require__(24)\n , createProperty = __webpack_require__(72)\n , getIterFn = __webpack_require__(176);\n\n$export($export.S + $export.F * !__webpack_require__(77)(function(iter){ Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){\n var O = toObject(arrayLike)\n , C = typeof this == 'function' ? this : Array\n , aLen = arguments.length\n , mapfn = aLen > 1 ? arguments[1] : undefined\n , mapping = mapfn !== undefined\n , index = 0\n , iterFn = getIterFn(O)\n , length, result, step, iterator;\n if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){\n for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for(result = new C(length); length > index; index++){\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(3)\n , createProperty = __webpack_require__(72);\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * __webpack_require__(31)(function(){\n function F(){}\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */){\n var index = 0\n , aLen = arguments.length\n , result = new (typeof this == 'function' ? this : Array)(aLen);\n while(aLen > index)createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(19).f\n , createDesc = __webpack_require__(40)\n , has = __webpack_require__(22)\n , FProto = Function.prototype\n , nameRE = /^\\s*function ([^ (]*)/\n , NAME = 'name';\n\nvar isExtensible = Object.isExtensible || function(){\n return true;\n};\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(21) && dP(FProto, NAME, {\n configurable: true,\n get: function(){\n try {\n var that = this\n , name = ('' + that).match(nameRE)[1];\n has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));\n return name;\n } catch(e){\n return '';\n }\n }\n});\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(157);\n\n// 23.1 Map Objects\nmodule.exports = __webpack_require__(54)('Map', function(get){\n return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key){\n var entry = strong.getEntry(this, key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value){\n return strong.def(this, key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.1 Number.EPSILON\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.2 Number.isFinite(number)\nvar $export = __webpack_require__(3)\n , _isFinite = __webpack_require__(13).isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it){\n return typeof it == 'number' && _isFinite(it);\n }\n});\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {isInteger: __webpack_require__(163)});\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.4 Number.isNaN(number)\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number){\n return number != number;\n }\n});\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = __webpack_require__(3)\n , isInteger = __webpack_require__(163)\n , abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number){\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(3);\n\n$export($export.S + $export.F, 'Object', {assign: __webpack_require__(168)});\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.10 Object.is(value1, value2)\nvar $export = __webpack_require__(3);\n$export($export.S, 'Object', {is: __webpack_require__(290)});\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(3);\n$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(171).set});\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(57)\n , global = __webpack_require__(13)\n , ctx = __webpack_require__(29)\n , classof = __webpack_require__(156)\n , $export = __webpack_require__(3)\n , isObject = __webpack_require__(15)\n , aFunction = __webpack_require__(71)\n , anInstance = __webpack_require__(52)\n , forOf = __webpack_require__(56)\n , speciesConstructor = __webpack_require__(291)\n , task = __webpack_require__(84).set\n , microtask = __webpack_require__(285)()\n , PROMISE = 'Promise'\n , TypeError = global.TypeError\n , process = global.process\n , $Promise = global[PROMISE]\n , process = global.process\n , isNode = classof(process) == 'process'\n , empty = function(){ /* empty */ }\n , Internal, GenericPromiseCapability, Wrapper;\n\nvar USE_NATIVE = !!function(){\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1)\n , FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function(exec){ exec(empty, empty); };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch(e){ /* empty */ }\n}();\n\n// helpers\nvar sameConstructor = function(a, b){\n // with library wrapper special case\n return a === b || a === $Promise && b === Wrapper;\n};\nvar isThenable = function(it){\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar newPromiseCapability = function(C){\n return sameConstructor($Promise, C)\n ? new PromiseCapability(C)\n : new GenericPromiseCapability(C);\n};\nvar PromiseCapability = GenericPromiseCapability = function(C){\n var resolve, reject;\n this.promise = new C(function($$resolve, $$reject){\n if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\nvar perform = function(exec){\n try {\n exec();\n } catch(e){\n return {error: e};\n }\n};\nvar notify = function(promise, isReject){\n if(promise._n)return;\n promise._n = true;\n var chain = promise._c;\n microtask(function(){\n var value = promise._v\n , ok = promise._s == 1\n , i = 0;\n var run = function(reaction){\n var handler = ok ? reaction.ok : reaction.fail\n , resolve = reaction.resolve\n , reject = reaction.reject\n , domain = reaction.domain\n , result, then;\n try {\n if(handler){\n if(!ok){\n if(promise._h == 2)onHandleUnhandled(promise);\n promise._h = 1;\n }\n if(handler === true)result = value;\n else {\n if(domain)domain.enter();\n result = handler(value);\n if(domain)domain.exit();\n }\n if(result === reaction.promise){\n reject(TypeError('Promise-chain cycle'));\n } else if(then = isThenable(result)){\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch(e){\n reject(e);\n }\n };\n while(chain.length > i)run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if(isReject && !promise._h)onUnhandled(promise);\n });\n};\nvar onUnhandled = function(promise){\n task.call(global, function(){\n var value = promise._v\n , abrupt, handler, console;\n if(isUnhandled(promise)){\n abrupt = perform(function(){\n if(isNode){\n process.emit('unhandledRejection', value, promise);\n } else if(handler = global.onunhandledrejection){\n handler({promise: promise, reason: value});\n } else if((console = global.console) && console.error){\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if(abrupt)throw abrupt.error;\n });\n};\nvar isUnhandled = function(promise){\n if(promise._h == 1)return false;\n var chain = promise._a || promise._c\n , i = 0\n , reaction;\n while(chain.length > i){\n reaction = chain[i++];\n if(reaction.fail || !isUnhandled(reaction.promise))return false;\n } return true;\n};\nvar onHandleUnhandled = function(promise){\n task.call(global, function(){\n var handler;\n if(isNode){\n process.emit('rejectionHandled', promise);\n } else if(handler = global.onrejectionhandled){\n handler({promise: promise, reason: promise._v});\n }\n });\n};\nvar $reject = function(value){\n var promise = this;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if(!promise._a)promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function(value){\n var promise = this\n , then;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if(promise === value)throw TypeError(\"Promise can't be resolved itself\");\n if(then = isThenable(value)){\n microtask(function(){\n var wrapper = {_w: promise, _d: false}; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch(e){\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch(e){\n $reject.call({_w: promise, _d: false}, e); // wrap\n }\n};\n\n// constructor polyfill\nif(!USE_NATIVE){\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor){\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch(err){\n $reject.call(this, err);\n }\n };\n Internal = function Promise(executor){\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(59)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected){\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if(this._a)this._a.push(reaction);\n if(this._s)notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function(onRejected){\n return this.then(undefined, onRejected);\n }\n });\n PromiseCapability = function(){\n var promise = new Internal;\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});\n__webpack_require__(48)($Promise, PROMISE);\n__webpack_require__(172)(PROMISE);\nWrapper = __webpack_require__(44)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r){\n var capability = newPromiseCapability(this)\n , $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x){\n // instanceof instead of internal slot check because we should fix it without replacement native Promise core\n if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;\n var capability = newPromiseCapability(this)\n , $$resolve = capability.resolve;\n $$resolve(x);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(77)(function(iter){\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , resolve = capability.resolve\n , reject = capability.reject;\n var abrupt = perform(function(){\n var values = []\n , index = 0\n , remaining = 1;\n forOf(iterable, false, function(promise){\n var $index = index++\n , alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function(value){\n if(alreadyCalled)return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , reject = capability.reject;\n var abrupt = perform(function(){\n forOf(iterable, false, function(promise){\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n }\n});\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 21.2.5.3 get RegExp.prototype.flags()\nif(__webpack_require__(21) && /./g.flags != 'g')__webpack_require__(19).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(280)\n});\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@match logic\n__webpack_require__(55)('match', 1, function(defined, MATCH, $match){\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp){\n 'use strict';\n var O = defined(this)\n , fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n\n/***/ }),\n/* 110 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@replace logic\n__webpack_require__(55)('replace', 2, function(defined, REPLACE, $replace){\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue){\n 'use strict';\n var O = defined(this)\n , fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n\n/***/ }),\n/* 111 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@search logic\n__webpack_require__(55)('search', 1, function(defined, SEARCH, $search){\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp){\n 'use strict';\n var O = defined(this)\n , fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n\n/***/ }),\n/* 112 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@split logic\n__webpack_require__(55)('split', 2, function(defined, SPLIT, $split){\n 'use strict';\n var isRegExp = __webpack_require__(164)\n , _split = $split\n , $push = [].push\n , $SPLIT = 'split'\n , LENGTH = 'length'\n , LAST_INDEX = 'lastIndex';\n if(\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ){\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function(separator, limit){\n var string = String(this);\n if(separator === undefined && limit === 0)return [];\n // If `separator` is not a regex, use native split\n if(!isRegExp(separator))return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while(match = separatorCopy.exec(string)){\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if(lastIndex > lastLastIndex){\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){\n for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;\n });\n if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if(output[LENGTH] >= splitLimit)break;\n }\n if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if(lastLastIndex === string[LENGTH]){\n if(lastLength || !separatorCopy.test(''))output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if('0'[$SPLIT](undefined, 0)[LENGTH]){\n $split = function(separator, limit){\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit){\n var O = defined(this)\n , fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(157);\n\n// 23.2 Set Objects\nmodule.exports = __webpack_require__(54)('Set', function(get){\n return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value){\n return strong.def(this, value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n/***/ }),\n/* 114 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(3)\n , $at = __webpack_require__(292)(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos){\n return $at(this, pos);\n }\n});\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n\nvar $export = __webpack_require__(3)\n , toLength = __webpack_require__(24)\n , context = __webpack_require__(83)\n , ENDS_WITH = 'endsWith'\n , $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(75)(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /*, endPosition = @length */){\n var that = context(this, searchString, ENDS_WITH)\n , endPosition = arguments.length > 1 ? arguments[1] : undefined\n , len = toLength(that.length)\n , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)\n , search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3)\n , toIndex = __webpack_require__(60)\n , fromCharCode = String.fromCharCode\n , $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars\n var res = []\n , aLen = arguments.length\n , i = 0\n , code;\n while(aLen > i){\n code = +arguments[i++];\n if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n\nvar $export = __webpack_require__(3)\n , context = __webpack_require__(83)\n , INCLUDES = 'includes';\n\n$export($export.P + $export.F * __webpack_require__(75)(INCLUDES), 'String', {\n includes: function includes(searchString /*, position = 0 */){\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3)\n , toIObject = __webpack_require__(23)\n , toLength = __webpack_require__(24);\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite){\n var tpl = toIObject(callSite.raw)\n , len = toLength(tpl.length)\n , aLen = arguments.length\n , res = []\n , i = 0;\n while(len > i){\n res.push(String(tpl[i++]));\n if(i < aLen)res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3);\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: __webpack_require__(174)\n});\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n\nvar $export = __webpack_require__(3)\n , toLength = __webpack_require__(24)\n , context = __webpack_require__(83)\n , STARTS_WITH = 'startsWith'\n , $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(75)(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /*, position = 0 */){\n var that = context(this, searchString, STARTS_WITH)\n , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))\n , search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(13)\n , has = __webpack_require__(22)\n , DESCRIPTORS = __webpack_require__(21)\n , $export = __webpack_require__(3)\n , redefine = __webpack_require__(33)\n , META = __webpack_require__(46).KEY\n , $fails = __webpack_require__(31)\n , shared = __webpack_require__(82)\n , setToStringTag = __webpack_require__(48)\n , uid = __webpack_require__(49)\n , wks = __webpack_require__(10)\n , wksExt = __webpack_require__(175)\n , wksDefine = __webpack_require__(293)\n , keyOf = __webpack_require__(284)\n , enumKeys = __webpack_require__(279)\n , isArray = __webpack_require__(162)\n , anObject = __webpack_require__(18)\n , toIObject = __webpack_require__(23)\n , toPrimitive = __webpack_require__(85)\n , createDesc = __webpack_require__(40)\n , _create = __webpack_require__(78)\n , gOPNExt = __webpack_require__(287)\n , $GOPD = __webpack_require__(79)\n , $DP = __webpack_require__(19)\n , $keys = __webpack_require__(39)\n , gOPD = $GOPD.f\n , dP = $DP.f\n , gOPN = gOPNExt.f\n , $Symbol = global.Symbol\n , $JSON = global.JSON\n , _stringify = $JSON && $JSON.stringify\n , PROTOTYPE = 'prototype'\n , HIDDEN = wks('_hidden')\n , TO_PRIMITIVE = wks('toPrimitive')\n , isEnum = {}.propertyIsEnumerable\n , SymbolRegistry = shared('symbol-registry')\n , AllSymbols = shared('symbols')\n , OPSymbols = shared('op-symbols')\n , ObjectProto = Object[PROTOTYPE]\n , USE_NATIVE = typeof $Symbol == 'function'\n , QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function(){\n return _create(dP({}, 'a', {\n get: function(){ return dP(this, 'a', {value: 7}).a; }\n })).a != 7;\n}) ? function(it, key, D){\n var protoDesc = gOPD(ObjectProto, key);\n if(protoDesc)delete ObjectProto[key];\n dP(it, key, D);\n if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function(tag){\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){\n return typeof it == 'symbol';\n} : function(it){\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D){\n if(it === ObjectProto)$defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if(has(AllSymbols, key)){\n if(!D.enumerable){\n if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;\n D = _create(D, {enumerable: createDesc(0, false)});\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P){\n anObject(it);\n var keys = enumKeys(P = toIObject(P))\n , i = 0\n , l = keys.length\n , key;\n while(l > i)$defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P){\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key){\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){\n it = toIObject(it);\n key = toPrimitive(key, true);\n if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;\n var D = gOPD(it, key);\n if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it){\n var names = gOPN(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it){\n var IS_OP = it === ObjectProto\n , names = gOPN(IS_OP ? OPSymbols : toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif(!USE_NATIVE){\n $Symbol = function Symbol(){\n if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function(value){\n if(this === ObjectProto)$set.call(OPSymbols, value);\n if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString(){\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(80).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(47).f = $propertyIsEnumerable;\n __webpack_require__(58).f = $getOwnPropertySymbols;\n\n if(DESCRIPTORS && !__webpack_require__(57)){\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function(name){\n return wrap(wks(name));\n }\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});\n\nfor(var symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);\n\nfor(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function(key){\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(key){\n if(isSymbol(key))return keyOf(SymbolRegistry, key);\n throw TypeError(key + ' is not a symbol!');\n },\n useSetter: function(){ setter = true; },\n useSimple: function(){ setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it){\n if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined\n var args = [it]\n , i = 1\n , replacer, $replacer;\n while(arguments.length > i)args.push(arguments[i++]);\n replacer = args[1];\n if(typeof replacer == 'function')$replacer = replacer;\n if($replacer || !isArray(replacer))replacer = function(key, value){\n if($replacer)value = $replacer.call(this, key, value);\n if(!isSymbol(value))return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(32)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar each = __webpack_require__(53)(0)\n , redefine = __webpack_require__(33)\n , meta = __webpack_require__(46)\n , assign = __webpack_require__(168)\n , weak = __webpack_require__(158)\n , isObject = __webpack_require__(15)\n , getWeak = meta.getWeak\n , isExtensible = Object.isExtensible\n , uncaughtFrozenStore = weak.ufstore\n , tmp = {}\n , InternalMap;\n\nvar wrapper = function(get){\n return function WeakMap(){\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key){\n if(isObject(key)){\n var data = getWeak(key);\n if(data === true)return uncaughtFrozenStore(this).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value){\n return weak.def(this, key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = __webpack_require__(54)('WeakMap', wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){\n InternalMap = weak.getConstructor(wrapper);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function(key){\n var proto = $WeakMap.prototype\n , method = proto[key];\n redefine(proto, key, function(a, b){\n // store frozen objects on internal weakmap shim\n if(isObject(a) && !isExtensible(a)){\n if(!this._f)this._f = new InternalMap;\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar weak = __webpack_require__(158);\n\n// 23.4 WeakSet Objects\n__webpack_require__(54)('WeakSet', function(get){\n return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value){\n return weak.def(this, value, true);\n }\n}, weak, false, true);\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/Array.prototype.includes\nvar $export = __webpack_require__(3)\n , $includes = __webpack_require__(155)(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /*, fromIndex = 0 */){\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n__webpack_require__(37)('includes');\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(3)\n , $entries = __webpack_require__(170)(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it){\n return $entries(it);\n }\n});\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = __webpack_require__(3)\n , ownKeys = __webpack_require__(289)\n , toIObject = __webpack_require__(23)\n , gOPD = __webpack_require__(79)\n , createProperty = __webpack_require__(72);\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){\n var O = toIObject(object)\n , getDesc = gOPD.f\n , keys = ownKeys(O)\n , result = {}\n , i = 0\n , key;\n while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));\n return result;\n }\n});\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(3)\n , $values = __webpack_require__(170)(false);\n\n$export($export.S, 'Object', {\n values: function values(it){\n return $values(it);\n }\n});\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(3)\n , $pad = __webpack_require__(173);\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(3)\n , $pad = __webpack_require__(173);\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n\n/***/ }),\n/* 130 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $iterators = __webpack_require__(68)\n , redefine = __webpack_require__(33)\n , global = __webpack_require__(13)\n , hide = __webpack_require__(32)\n , Iterators = __webpack_require__(45)\n , wks = __webpack_require__(10)\n , ITERATOR = wks('iterator')\n , TO_STRING_TAG = wks('toStringTag')\n , ArrayValues = Iterators.Array;\n\nfor(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){\n var NAME = collections[i]\n , Collection = global[NAME]\n , proto = Collection && Collection.prototype\n , key;\n if(proto){\n if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);\n if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);\n }\n}\n\n/***/ }),\n/* 131 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3)\n , $task = __webpack_require__(84);\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n\n/***/ }),\n/* 132 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * SheetClip - Spreadsheet Clipboard Parser\n * version 0.2\n *\n * This tiny library transforms JavaScript arrays to strings that are pasteable by LibreOffice, OpenOffice,\n * Google Docs and Microsoft Excel.\n *\n * Copyright 2012, Marcin Warpechowski\n * Licensed under the MIT license.\n * http://github.com/warpech/sheetclip/\n */\n/*jslint white: true*/\n(function (global) {\n \"use strict\";\n\n function countQuotes(str) {\n return str.split('\"').length - 1;\n }\n\n var SheetClip = {\n /**\n * Decode spreadsheet string into array\n *\n * @param {String} str\n * @returns {Array}\n */\n parse: function parse(str) {\n var r,\n rLen,\n rows,\n arr = [],\n a = 0,\n c,\n cLen,\n multiline,\n last;\n\n rows = str.split('\\n');\n\n if (rows.length > 1 && rows[rows.length - 1] === '') {\n rows.pop();\n }\n for (r = 0, rLen = rows.length; r < rLen; r += 1) {\n rows[r] = rows[r].split('\\t');\n\n for (c = 0, cLen = rows[r].length; c < cLen; c += 1) {\n if (!arr[a]) {\n arr[a] = [];\n }\n if (multiline && c === 0) {\n last = arr[a].length - 1;\n arr[a][last] = arr[a][last] + '\\n' + rows[r][0];\n\n if (multiline && countQuotes(rows[r][0]) & 1) {\n //& 1 is a bitwise way of performing mod 2\n multiline = false;\n arr[a][last] = arr[a][last].substring(0, arr[a][last].length - 1).replace(/\"\"/g, '\"');\n }\n } else {\n if (c === cLen - 1 && rows[r][c].indexOf('\"') === 0 && countQuotes(rows[r][c]) & 1) {\n arr[a].push(rows[r][c].substring(1).replace(/\"\"/g, '\"'));\n multiline = true;\n } else {\n arr[a].push(rows[r][c].replace(/\"\"/g, '\"'));\n multiline = false;\n }\n }\n }\n if (!multiline) {\n a += 1;\n }\n }\n\n return arr;\n },\n\n /**\n * Encode array into valid spreadsheet string\n *\n * @param arr\n * @returns {String}\n */\n stringify: function stringify(arr) {\n var r,\n rLen,\n c,\n cLen,\n str = '',\n val;\n\n for (r = 0, rLen = arr.length; r < rLen; r += 1) {\n cLen = arr[r].length;\n\n for (c = 0; c < cLen; c += 1) {\n if (c > 0) {\n str += '\\t';\n }\n val = arr[r][c];\n\n if (typeof val === 'string') {\n if (val.indexOf('\\n') > -1) {\n str += '\"' + val.replace(/\"/g, '\"\"') + '\"';\n } else {\n str += val;\n }\n } else if (val === null || val === void 0) {\n // void 0 resolves to undefined\n str += '';\n } else {\n str += val;\n }\n }\n\n if (r !== rLen - 1) {\n str += '\\n';\n }\n }\n\n return str;\n }\n };\n\n if (true) {\n exports.parse = SheetClip.parse;\n exports.stringify = SheetClip.stringify;\n } else {}\n})(window);\n\n/***/ }),\n/* 133 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * json-patch-duplex.js version: 0.5.7\n * (c) 2013 Joachim Wester\n * MIT license\n */\nvar __extends = undefined && undefined.__extends || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OriginalError = Error;\nvar jsonpatch;\n(function (jsonpatch) {\n var _objectKeys = function _objectKeys(obj) {\n if (_isArray(obj)) {\n var keys = new Array(obj.length);\n for (var k = 0; k < keys.length; k++) {\n keys[k] = \"\" + k;\n }\n return keys;\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keys = [];\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n keys.push(i);\n }\n }\n return keys;\n };\n function _equals(a, b) {\n switch (typeof a === 'undefined' ? 'undefined' : _typeof(a)) {\n case 'undefined': //backward compatibility, but really I think we should return false\n case 'boolean':\n case 'string':\n case 'number':\n return a === b;\n case 'object':\n if (a === null) return b === null;\n if (_isArray(a)) {\n if (!_isArray(b) || a.length !== b.length) return false;\n for (var i = 0, l = a.length; i < l; i++) {\n if (!_equals(a[i], b[i])) return false;\n }return true;\n }\n var bKeys = _objectKeys(b);\n var bLength = bKeys.length;\n if (_objectKeys(a).length !== bLength) return false;\n for (var i = 0; i < bLength; i++) {\n if (!_equals(a[i], b[i])) return false;\n }return true;\n default:\n return false;\n }\n }\n /* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n /* The operations applicable to an object */\n var objOps = {\n add: function add(obj, key) {\n obj[key] = this.value;\n return true;\n },\n remove: function remove(obj, key) {\n delete obj[key];\n return true;\n },\n replace: function replace(obj, key) {\n obj[key] = this.value;\n return true;\n },\n move: function move(obj, key, tree) {\n var temp = { op: \"_get\", path: this.from };\n apply(tree, [temp]);\n apply(tree, [{ op: \"remove\", path: this.from }]);\n apply(tree, [{ op: \"add\", path: this.path, value: temp.value }]);\n return true;\n },\n copy: function copy(obj, key, tree) {\n var temp = { op: \"_get\", path: this.from };\n apply(tree, [temp]);\n apply(tree, [{ op: \"add\", path: this.path, value: temp.value }]);\n return true;\n },\n test: function test(obj, key) {\n return _equals(obj[key], this.value);\n },\n _get: function _get(obj, key) {\n this.value = obj[key];\n }\n };\n /* The operations applicable to an array. Many are the same as for the object */\n var arrOps = {\n add: function add(arr, i) {\n arr.splice(i, 0, this.value);\n return true;\n },\n remove: function remove(arr, i) {\n arr.splice(i, 1);\n return true;\n },\n replace: function replace(arr, i) {\n arr[i] = this.value;\n return true;\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n };\n /* The operations applicable to object root. Many are the same as for the object */\n var rootOps = {\n add: function add(obj) {\n rootOps.remove.call(this, obj);\n for (var key in this.value) {\n if (this.value.hasOwnProperty(key)) {\n obj[key] = this.value[key];\n }\n }\n return true;\n },\n remove: function remove(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n objOps.remove.call(this, obj, key);\n }\n }\n return true;\n },\n replace: function replace(obj) {\n apply(obj, [{ op: \"remove\", path: this.path }]);\n apply(obj, [{ op: \"add\", path: this.path, value: this.value }]);\n return true;\n },\n move: objOps.move,\n copy: objOps.copy,\n test: function test(obj) {\n return JSON.stringify(obj) === JSON.stringify(this.value);\n },\n _get: function _get(obj) {\n this.value = obj;\n }\n };\n var observeOps = {\n add: function add(patches, path) {\n var patch = {\n op: \"add\",\n path: path + escapePathComponent(this.name),\n value: this.object[this.name] };\n patches.push(patch);\n },\n 'delete': function _delete(patches, path) {\n var patch = {\n op: \"remove\",\n path: path + escapePathComponent(this.name)\n };\n patches.push(patch);\n },\n update: function update(patches, path) {\n var patch = {\n op: \"replace\",\n path: path + escapePathComponent(this.name),\n value: this.object[this.name]\n };\n patches.push(patch);\n }\n };\n function escapePathComponent(str) {\n if (str.indexOf('/') === -1 && str.indexOf('~') === -1) return str;\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n function _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n } else if (_typeof(root[key]) === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n }\n function getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new OriginalError(\"Object not found in root\");\n }\n return '/' + path;\n }\n var beforeDict = [];\n var Mirror = function () {\n function Mirror(obj) {\n this.observers = [];\n this.obj = obj;\n }\n return Mirror;\n }();\n var ObserverInfo = function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n }();\n function getMirror(obj) {\n for (var i = 0, ilen = beforeDict.length; i < ilen; i++) {\n if (beforeDict[i].obj === obj) {\n return beforeDict[i];\n }\n }\n }\n function getObserverFromMirror(mirror, callback) {\n for (var j = 0, jlen = mirror.observers.length; j < jlen; j++) {\n if (mirror.observers[j].callback === callback) {\n return mirror.observers[j].observer;\n }\n }\n }\n function removeObserverFromMirror(mirror, observer) {\n for (var j = 0, jlen = mirror.observers.length; j < jlen; j++) {\n if (mirror.observers[j].observer === observer) {\n mirror.observers.splice(j, 1);\n return;\n }\n }\n }\n function unobserve(root, observer) {\n observer.unobserve();\n }\n jsonpatch.unobserve = unobserve;\n function deepClone(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === \"object\") {\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n } else {\n return obj; //no need to clone primitives\n }\n }\n function observe(obj, callback) {\n var patches = [];\n var root = obj;\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.push(mirror);\n } else {\n observer = getObserverFromMirror(mirror, callback);\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var intervals = this.intervals || [100, 1000, 10000, 60000];\n if (intervals.push === void 0) {\n throw new OriginalError(\"jsonpatch.intervals must be an array\");\n }\n var currentInterval = 0;\n var dirtyCheck = function dirtyCheck() {\n generate(observer);\n };\n var fastCheck = function fastCheck() {\n clearTimeout(observer.next);\n observer.next = setTimeout(function () {\n dirtyCheck();\n currentInterval = 0;\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n }, 0);\n };\n var slowCheck = function slowCheck() {\n dirtyCheck();\n if (currentInterval == intervals.length) currentInterval = intervals.length - 1;\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n };\n if (typeof window !== 'undefined') {\n if (window.addEventListener) {\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keydown', fastCheck);\n } else {\n document.documentElement.attachEvent('onmousedown', fastCheck);\n document.documentElement.attachEvent('onmouseup', fastCheck);\n document.documentElement.attachEvent('onkeydown', fastCheck);\n }\n }\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n if (window.removeEventListener) {\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n } else {\n document.documentElement.detachEvent('onmousedown', fastCheck);\n document.documentElement.detachEvent('onmouseup', fastCheck);\n document.documentElement.detachEvent('onkeydown', fastCheck);\n }\n }\n };\n mirror.observers.push(new ObserverInfo(callback, observer));\n return observer;\n }\n jsonpatch.observe = observe;\n function generate(observer) {\n var mirror;\n for (var i = 0, ilen = beforeDict.length; i < ilen; i++) {\n if (beforeDict[i].obj === observer.object) {\n mirror = beforeDict[i];\n break;\n }\n }\n _generate(mirror.value, observer.object, observer.patches, \"\");\n if (observer.patches.length) {\n apply(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n }\n jsonpatch.generate = generate;\n // Dirty check if obj is different from mirror, generate patches and update mirror\n function _generate(mirror, obj, patches, path) {\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (obj.hasOwnProperty(key)) {\n var newVal = obj[key];\n if ((typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) == \"object\" && oldVal != null && (typeof newVal === 'undefined' ? 'undefined' : _typeof(newVal)) == \"object\" && newVal != null) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key));\n } else {\n if (oldVal != newVal) {\n changed = true;\n patches.push({ op: \"replace\", path: path + \"/\" + escapePathComponent(key), value: deepClone(newVal) });\n }\n }\n } else {\n patches.push({ op: \"remove\", path: path + \"/\" + escapePathComponent(key) });\n deleted = true; // property has been deleted\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!mirror.hasOwnProperty(key)) {\n patches.push({ op: \"add\", path: path + \"/\" + escapePathComponent(key), value: deepClone(obj[key]) });\n }\n }\n }\n var _isArray;\n if (Array.isArray) {\n _isArray = Array.isArray;\n } else {\n _isArray = function _isArray(obj) {\n return obj.push && typeof obj.length === 'number';\n };\n }\n //3x faster than cached /^\\d+$/.test(str)\n function isInteger(str) {\n var i = 0;\n var len = str.length;\n var charCode;\n while (i < len) {\n charCode = str.charCodeAt(i);\n if (charCode >= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n }\n /// Apply a json-patch operation on an object tree\n function apply(tree, patches, validate) {\n var result = false,\n p = 0,\n plen = patches.length,\n patch,\n key;\n while (p < plen) {\n patch = patches[p];\n p++;\n // Find the object\n var path = patch.path || \"\";\n var keys = path.split('/');\n var obj = tree;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n while (true) {\n key = keys[t];\n if (validate) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n } else if (t == len - 1) {\n existingPathFragment = patch.path;\n }\n if (existingPathFragment !== undefined) {\n this.validator(patch, p - 1, tree, existingPathFragment);\n }\n }\n }\n t++;\n if (key === undefined) {\n if (t >= len) {\n result = rootOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n if (_isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n } else {\n if (validate && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", p - 1, patch.path, patch);\n }\n key = parseInt(key, 10);\n }\n if (t >= len) {\n if (validate && patch.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", p - 1, patch.path, patch);\n }\n result = arrOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n } else {\n if (key && key.indexOf('~') != -1) key = key.replace(/~1/g, '/').replace(/~0/g, '~'); // escape chars\n if (t >= len) {\n result = objOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n obj = obj[key];\n }\n }\n return result;\n }\n jsonpatch.apply = apply;\n function compare(tree1, tree2) {\n var patches = [];\n _generate(tree1, tree2, patches, '');\n return patches;\n }\n jsonpatch.compare = compare;\n var JsonPatchError = function (_super) {\n __extends(JsonPatchError, _super);\n function JsonPatchError(message, name, index, operation, tree) {\n _super.call(this, message);\n this.message = message;\n this.name = name;\n this.index = index;\n this.operation = operation;\n this.tree = tree;\n }\n return JsonPatchError;\n }(OriginalError);\n jsonpatch.JsonPatchError = JsonPatchError;\n jsonpatch.Error = JsonPatchError;\n /**\n * Recursively checks whether an object has any undefined values inside.\n */\n function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (typeof obj == \"array\" || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == \"object\") {\n for (var i in obj) {\n if (hasUndefined(obj[i])) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [tree] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `tree`\n */\n function validator(operation, index, tree, existingPathFragment) {\n if ((typeof operation === 'undefined' ? 'undefined' : _typeof(operation)) !== 'object' || operation === null || _isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, tree);\n } else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, tree);\n } else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, tree);\n } else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, tree);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, tree);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, tree);\n } else if (tree) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, tree);\n }\n } else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, tree);\n }\n } else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = jsonpatch.validate([existingValue], tree);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, tree);\n }\n }\n }\n }\n jsonpatch.validator = validator;\n /**\n * Validates a sequence of operations. If `tree` parameter is provided, the sequence is additionally validated against the object tree.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param tree\n * @returns {JsonPatchError|undefined}\n */\n function validate(sequence, tree) {\n try {\n if (!_isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (tree) {\n tree = JSON.parse(JSON.stringify(tree)); //clone tree so that we can safely try applying operations\n apply.call(this, tree, sequence, true);\n } else {\n for (var i = 0; i < sequence.length; i++) {\n this.validator(sequence[i], i);\n }\n }\n } catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n } else {\n throw e;\n }\n }\n }\n jsonpatch.validate = validate;\n})(jsonpatch || (jsonpatch = {}));\nif (true) {\n exports.apply = jsonpatch.apply;\n exports.observe = jsonpatch.observe;\n exports.unobserve = jsonpatch.unobserve;\n exports.generate = jsonpatch.generate;\n exports.compare = jsonpatch.compare;\n exports.validate = jsonpatch.validate;\n exports.validator = jsonpatch.validator;\n exports.JsonPatchError = jsonpatch.JsonPatchError;\n exports.Error = jsonpatch.Error;\n}\n\n/***/ }),\n/* 134 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nvar _object = __webpack_require__(2);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n */\nvar Border = function () {\n /**\n * @param {Walkontable} wotInstance\n * @param {Object} settings\n */\n function Border(wotInstance, settings) {\n _classCallCheck(this, Border);\n\n if (!settings) {\n return;\n }\n this.eventManager = new _eventManager2.default(wotInstance);\n this.instance = wotInstance;\n this.wot = wotInstance;\n this.settings = settings;\n this.mouseDown = false;\n this.main = null;\n\n this.top = null;\n this.left = null;\n this.bottom = null;\n this.right = null;\n\n this.topStyle = null;\n this.leftStyle = null;\n this.bottomStyle = null;\n this.rightStyle = null;\n\n this.cornerDefaultStyle = {\n width: '5px',\n height: '5px',\n borderWidth: '2px',\n borderStyle: 'solid',\n borderColor: '#FFF'\n };\n this.corner = null;\n this.cornerStyle = null;\n\n this.createBorders(settings);\n this.registerListeners();\n }\n\n /**\n * Register all necessary events\n */\n\n\n _createClass(Border, [{\n key: 'registerListeners',\n value: function registerListeners() {\n var _this2 = this;\n\n this.eventManager.addEventListener(document.body, 'mousedown', function () {\n return _this2.onMouseDown();\n });\n this.eventManager.addEventListener(document.body, 'mouseup', function () {\n return _this2.onMouseUp();\n });\n\n var _loop = function _loop(c, len) {\n _this2.eventManager.addEventListener(_this2.main.childNodes[c], 'mouseenter', function (event) {\n return _this2.onMouseEnter(event, _this2.main.childNodes[c]);\n });\n };\n\n for (var c = 0, len = this.main.childNodes.length; c < len; c++) {\n _loop(c, len);\n }\n }\n\n /**\n * Mouse down listener\n *\n * @private\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown() {\n this.mouseDown = true;\n }\n\n /**\n * Mouse up listener\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n this.mouseDown = false;\n }\n\n /**\n * Mouse enter listener for fragment selection functionality.\n *\n * @private\n * @param {Event} event Dom event\n * @param {HTMLElement} parentElement Part of border element.\n */\n\n }, {\n key: 'onMouseEnter',\n value: function onMouseEnter(event, parentElement) {\n if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {\n return;\n }\n event.preventDefault();\n (0, _event.stopImmediatePropagation)(event);\n\n var _this = this;\n var bounds = parentElement.getBoundingClientRect();\n // Hide border to prevents selection jumping when fragmentSelection is enabled.\n parentElement.style.display = 'none';\n\n function isOutside(event) {\n if (event.clientY < Math.floor(bounds.top)) {\n return true;\n }\n if (event.clientY > Math.ceil(bounds.top + bounds.height)) {\n return true;\n }\n if (event.clientX < Math.floor(bounds.left)) {\n return true;\n }\n if (event.clientX > Math.ceil(bounds.left + bounds.width)) {\n return true;\n }\n }\n\n function handler(event) {\n if (isOutside(event)) {\n _this.eventManager.removeEventListener(document.body, 'mousemove', handler);\n parentElement.style.display = 'block';\n }\n }\n\n this.eventManager.addEventListener(document.body, 'mousemove', handler);\n }\n\n /**\n * Create border elements\n *\n * @param {Object} settings\n */\n\n }, {\n key: 'createBorders',\n value: function createBorders(settings) {\n this.main = document.createElement('div');\n\n var borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];\n var style = this.main.style;\n style.position = 'absolute';\n style.top = 0;\n style.left = 0;\n\n for (var i = 0; i < 5; i++) {\n var position = borderDivs[i];\n var div = document.createElement('div');\n div.className = 'wtBorder ' + (this.settings.className || ''); // + borderDivs[i];\n\n if (this.settings[position] && this.settings[position].hide) {\n div.className += ' hidden';\n }\n style = div.style;\n style.backgroundColor = this.settings[position] && this.settings[position].color ? this.settings[position].color : settings.border.color;\n style.height = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';\n style.width = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';\n\n this.main.appendChild(div);\n }\n this.top = this.main.childNodes[0];\n this.left = this.main.childNodes[1];\n this.bottom = this.main.childNodes[2];\n this.right = this.main.childNodes[3];\n\n this.topStyle = this.top.style;\n this.leftStyle = this.left.style;\n this.bottomStyle = this.bottom.style;\n this.rightStyle = this.right.style;\n\n this.corner = this.main.childNodes[4];\n this.corner.className += ' corner';\n this.cornerStyle = this.corner.style;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n this.cornerStyle.height = this.cornerDefaultStyle.height;\n this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');\n\n if ((0, _browser.isMobileBrowser)()) {\n this.createMultipleSelectorHandles();\n }\n this.disappear();\n\n if (!this.wot.wtTable.bordersHolder) {\n this.wot.wtTable.bordersHolder = document.createElement('div');\n this.wot.wtTable.bordersHolder.className = 'htBorders';\n this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder);\n }\n this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild);\n }\n\n /**\n * Create multiple selector handler for mobile devices\n */\n\n }, {\n key: 'createMultipleSelectorHandles',\n value: function createMultipleSelectorHandles() {\n this.selectionHandles = {\n topLeft: document.createElement('DIV'),\n topLeftHitArea: document.createElement('DIV'),\n bottomRight: document.createElement('DIV'),\n bottomRightHitArea: document.createElement('DIV')\n };\n var width = 10;\n var hitAreaWidth = 40;\n\n this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';\n this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';\n this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';\n this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';\n\n this.selectionHandles.styles = {\n topLeft: this.selectionHandles.topLeft.style,\n topLeftHitArea: this.selectionHandles.topLeftHitArea.style,\n bottomRight: this.selectionHandles.bottomRight.style,\n bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style\n };\n\n var hitAreaStyle = {\n position: 'absolute',\n height: hitAreaWidth + 'px',\n width: hitAreaWidth + 'px',\n 'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px'\n };\n\n for (var prop in hitAreaStyle) {\n if ((0, _object.hasOwnProperty)(hitAreaStyle, prop)) {\n this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop];\n this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop];\n }\n }\n\n var handleStyle = {\n position: 'absolute',\n height: width + 'px',\n width: width + 'px',\n 'border-radius': parseInt(width / 1.5, 10) + 'px',\n background: '#F5F5FF',\n border: '1px solid #4285c8'\n };\n\n for (var _prop in handleStyle) {\n if ((0, _object.hasOwnProperty)(handleStyle, _prop)) {\n this.selectionHandles.styles.bottomRight[_prop] = handleStyle[_prop];\n this.selectionHandles.styles.topLeft[_prop] = handleStyle[_prop];\n }\n }\n this.main.appendChild(this.selectionHandles.topLeft);\n this.main.appendChild(this.selectionHandles.bottomRight);\n this.main.appendChild(this.selectionHandles.topLeftHitArea);\n this.main.appendChild(this.selectionHandles.bottomRightHitArea);\n }\n }, {\n key: 'isPartRange',\n value: function isPartRange(row, col) {\n if (this.wot.selections.area.cellRange) {\n if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) {\n return true;\n }\n }\n\n return false;\n }\n }, {\n key: 'updateMultipleSelectionHandlesPosition',\n value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {\n var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);\n var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);\n\n this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px';\n this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px';\n\n this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - hitAreaWidth / 4 * 3, 10) + 'px';\n this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - hitAreaWidth / 4 * 3, 10) + 'px';\n\n this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px';\n this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px';\n\n this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px';\n this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px';\n\n if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) {\n this.selectionHandles.styles.topLeft.display = 'block';\n this.selectionHandles.styles.topLeftHitArea.display = 'block';\n\n if (this.isPartRange(row, col)) {\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n } else {\n this.selectionHandles.styles.bottomRight.display = 'block';\n this.selectionHandles.styles.bottomRightHitArea.display = 'block';\n }\n } else {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.topLeftHitArea.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n }\n\n if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) {\n this.selectionHandles.styles.topLeft.zIndex = '9999';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';\n } else {\n this.selectionHandles.styles.topLeft.zIndex = '';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '';\n }\n }\n\n /**\n * Show border around one or many cells\n *\n * @param {Array} corners\n */\n\n }, {\n key: 'appear',\n value: function appear(corners) {\n if (this.disabled) {\n return;\n }\n var isMultiple, fromTD, toTD, fromOffset, toOffset, containerOffset, top, minTop, left, minLeft, height, width, fromRow, fromColumn, toRow, toColumn, trimmingContainer, cornerOverlappingContainer, ilen;\n\n ilen = this.wot.wtTable.getRenderedRowsCount();\n\n for (var i = 0; i < ilen; i++) {\n var s = this.wot.wtTable.rowFilter.renderedToSource(i);\n\n if (s >= corners[0] && s <= corners[2]) {\n fromRow = s;\n break;\n }\n }\n\n for (var _i = ilen - 1; _i >= 0; _i--) {\n var _s = this.wot.wtTable.rowFilter.renderedToSource(_i);\n\n if (_s >= corners[0] && _s <= corners[2]) {\n toRow = _s;\n break;\n }\n }\n\n ilen = this.wot.wtTable.getRenderedColumnsCount();\n\n for (var _i2 = 0; _i2 < ilen; _i2++) {\n var _s2 = this.wot.wtTable.columnFilter.renderedToSource(_i2);\n\n if (_s2 >= corners[1] && _s2 <= corners[3]) {\n fromColumn = _s2;\n break;\n }\n }\n\n for (var _i3 = ilen - 1; _i3 >= 0; _i3--) {\n var _s3 = this.wot.wtTable.columnFilter.renderedToSource(_i3);\n\n if (_s3 >= corners[1] && _s3 <= corners[3]) {\n toColumn = _s3;\n break;\n }\n }\n if (fromRow === void 0 || fromColumn === void 0) {\n this.disappear();\n\n return;\n }\n isMultiple = fromRow !== toRow || fromColumn !== toColumn;\n fromTD = this.wot.wtTable.getCell(new _coords2.default(fromRow, fromColumn));\n toTD = isMultiple ? this.wot.wtTable.getCell(new _coords2.default(toRow, toColumn)) : fromTD;\n fromOffset = (0, _element.offset)(fromTD);\n toOffset = isMultiple ? (0, _element.offset)(toTD) : fromOffset;\n containerOffset = (0, _element.offset)(this.wot.wtTable.TABLE);\n\n minTop = fromOffset.top;\n height = toOffset.top + (0, _element.outerHeight)(toTD) - minTop;\n minLeft = fromOffset.left;\n width = toOffset.left + (0, _element.outerWidth)(toTD) - minLeft;\n\n top = minTop - containerOffset.top - 1;\n left = minLeft - containerOffset.left - 1;\n var style = (0, _element.getComputedStyle)(fromTD);\n\n if (parseInt(style.borderTopWidth, 10) > 0) {\n top += 1;\n height = height > 0 ? height - 1 : 0;\n }\n if (parseInt(style.borderLeftWidth, 10) > 0) {\n left += 1;\n width = width > 0 ? width - 1 : 0;\n }\n\n this.topStyle.top = top + 'px';\n this.topStyle.left = left + 'px';\n this.topStyle.width = width + 'px';\n this.topStyle.display = 'block';\n\n this.leftStyle.top = top + 'px';\n this.leftStyle.left = left + 'px';\n this.leftStyle.height = height + 'px';\n this.leftStyle.display = 'block';\n\n var delta = Math.floor(this.settings.border.width / 2);\n\n this.bottomStyle.top = top + height - delta + 'px';\n this.bottomStyle.left = left + 'px';\n this.bottomStyle.width = width + 'px';\n this.bottomStyle.display = 'block';\n\n this.rightStyle.top = top + 'px';\n this.rightStyle.left = left + width - delta + 'px';\n this.rightStyle.height = height + 1 + 'px';\n this.rightStyle.display = 'block';\n\n if ((0, _browser.isMobileBrowser)() || !this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn)) {\n this.cornerStyle.display = 'none';\n } else {\n this.cornerStyle.top = top + height - 4 + 'px';\n this.cornerStyle.left = left + width - 4 + 'px';\n this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n\n // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.\n this.cornerStyle.display = 'none';\n\n trimmingContainer = (0, _element.getTrimmingContainer)(this.wot.wtTable.TABLE);\n\n if (toColumn === this.wot.getSetting('totalColumns') - 1) {\n cornerOverlappingContainer = toTD.offsetLeft + (0, _element.outerWidth)(toTD) + parseInt(this.cornerDefaultStyle.width, 10) / 2 >= (0, _element.innerWidth)(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width, 10) / 2) + 'px';\n this.cornerStyle.borderRightWidth = 0;\n }\n }\n\n if (toRow === this.wot.getSetting('totalRows') - 1) {\n cornerOverlappingContainer = toTD.offsetTop + (0, _element.outerHeight)(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2 >= (0, _element.innerHeight)(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height, 10) / 2) + 'px';\n this.cornerStyle.borderBottomWidth = 0;\n }\n }\n\n this.cornerStyle.display = 'block';\n }\n\n if ((0, _browser.isMobileBrowser)()) {\n this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height);\n }\n }\n\n /**\n * Hide border\n */\n\n }, {\n key: 'disappear',\n value: function disappear() {\n this.topStyle.display = 'none';\n this.leftStyle.display = 'none';\n this.bottomStyle.display = 'none';\n this.rightStyle.display = 'none';\n this.cornerStyle.display = 'none';\n\n if ((0, _browser.isMobileBrowser)()) {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n }\n }\n\n /**\n * @param {Function} setting\n * @returns {*}\n */\n\n }, {\n key: 'hasSetting',\n value: function hasSetting(setting) {\n if (typeof setting === 'function') {\n return setting();\n }\n\n return !!setting;\n }\n }]);\n\n return Border;\n}();\n\nexports.default = Border;\n\n/***/ }),\n/* 135 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar privatePool = new WeakMap();\n\n/**\n * Calculates indexes of columns to render OR columns that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportColumnsCalculator\n */\n\nvar ViewportColumnsCalculator = function () {\n _createClass(ViewportColumnsCalculator, null, [{\n key: 'DEFAULT_WIDTH',\n\n /**\n * Default column width\n *\n * @type {Number}\n */\n get: function get() {\n return 50;\n }\n\n /**\n * @param {Number} viewportWidth Width of the viewport\n * @param {Number} scrollOffset Current horizontal scroll position of the viewport\n * @param {Number} totalColumns Total number of rows\n * @param {Function} columnWidthFn Function that returns the width of the column at a given index (in px)\n * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)\n * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport\n * @param {Boolean} stretchH\n * @param {Function} [stretchingColumnWidthFn] Function that returns the new width of the stretched column.\n */\n\n }]);\n\n function ViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) {\n var stretchingColumnWidthFn = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : function (width) {\n return width;\n };\n\n _classCallCheck(this, ViewportColumnsCalculator);\n\n privatePool.set(this, {\n viewportWidth: viewportWidth,\n scrollOffset: scrollOffset,\n totalColumns: totalColumns,\n columnWidthFn: columnWidthFn,\n overrideFn: overrideFn,\n onlyFullyVisible: onlyFullyVisible,\n stretchingColumnWidthFn: stretchingColumnWidthFn\n });\n\n /**\n * Number of rendered/visible columns\n *\n * @type {Number}\n */\n this.count = 0;\n\n /**\n * Index of the first rendered/visible column (can be overwritten using overrideFn)\n *\n * @type {Number|null}\n */\n this.startColumn = null;\n\n /**\n * Index of the last rendered/visible column (can be overwritten using overrideFn)\n *\n * @type {null}\n */\n this.endColumn = null;\n\n /**\n * Position of the first rendered/visible column (in px)\n *\n * @type {Number|null}\n */\n this.startPosition = null;\n\n this.stretchAllRatio = 0;\n this.stretchLastWidth = 0;\n this.stretch = stretchH;\n this.totalTargetWidth = 0;\n this.needVerifyLastColumnWidth = true;\n this.stretchAllColumnsWidth = [];\n\n this.calculate();\n }\n\n /**\n * Calculates viewport\n */\n\n\n _createClass(ViewportColumnsCalculator, [{\n key: 'calculate',\n value: function calculate() {\n var sum = 0;\n var needReverse = true;\n var startPositions = [];\n var columnWidth = void 0;\n\n var priv = privatePool.get(this);\n var onlyFullyVisible = priv.onlyFullyVisible;\n var overrideFn = priv.overrideFn;\n var scrollOffset = priv.scrollOffset;\n var totalColumns = priv.totalColumns;\n var viewportWidth = priv.viewportWidth;\n\n for (var i = 0; i < totalColumns; i++) {\n columnWidth = this._getColumnWidth(i);\n\n if (sum <= scrollOffset && !onlyFullyVisible) {\n this.startColumn = i;\n }\n\n // +1 pixel for row header width compensation for horizontal scroll > 0\n var compensatedViewportWidth = scrollOffset > 0 ? viewportWidth + 1 : viewportWidth;\n\n if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + compensatedViewportWidth) {\n if (this.startColumn == null) {\n this.startColumn = i;\n }\n this.endColumn = i;\n }\n startPositions.push(sum);\n sum += columnWidth;\n\n if (!onlyFullyVisible) {\n this.endColumn = i;\n }\n if (sum >= scrollOffset + viewportWidth) {\n needReverse = false;\n break;\n }\n }\n\n if (this.endColumn === totalColumns - 1 && needReverse) {\n this.startColumn = this.endColumn;\n\n while (this.startColumn > 0) {\n var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];\n\n if (viewportSum <= viewportWidth || !onlyFullyVisible) {\n this.startColumn--;\n }\n if (viewportSum > viewportWidth) {\n break;\n }\n }\n }\n\n if (this.startColumn !== null && overrideFn) {\n overrideFn(this);\n }\n this.startPosition = startPositions[this.startColumn];\n\n if (this.startPosition == void 0) {\n this.startPosition = null;\n }\n if (this.startColumn !== null) {\n this.count = this.endColumn - this.startColumn + 1;\n }\n }\n\n /**\n * Recalculate columns stretching.\n *\n * @param {Number} totalWidth\n */\n\n }, {\n key: 'refreshStretching',\n value: function refreshStretching(totalWidth) {\n if (this.stretch === 'none') {\n return;\n }\n this.totalTargetWidth = totalWidth;\n\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n var sumAll = 0;\n\n for (var i = 0; i < totalColumns; i++) {\n var columnWidth = this._getColumnWidth(i);\n var permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);\n\n if (typeof permanentColumnWidth === 'number') {\n totalWidth -= permanentColumnWidth;\n } else {\n sumAll += columnWidth;\n }\n }\n var remainingSize = totalWidth - sumAll;\n\n if (this.stretch === 'all' && remainingSize > 0) {\n this.stretchAllRatio = totalWidth / sumAll;\n this.stretchAllColumnsWidth = [];\n this.needVerifyLastColumnWidth = true;\n } else if (this.stretch === 'last' && totalWidth !== Infinity) {\n var _columnWidth = this._getColumnWidth(totalColumns - 1);\n var lastColumnWidth = remainingSize + _columnWidth;\n\n this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : _columnWidth;\n }\n }\n\n /**\n * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.\n *\n * @param {Number} column\n * @param {Number} baseWidth\n * @returns {Number|null}\n */\n\n }, {\n key: 'getStretchedColumnWidth',\n value: function getStretchedColumnWidth(column, baseWidth) {\n var result = null;\n\n if (this.stretch === 'all' && this.stretchAllRatio !== 0) {\n result = this._getStretchedAllColumnWidth(column, baseWidth);\n } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {\n result = this._getStretchedLastColumnWidth(column);\n }\n\n return result;\n }\n\n /**\n * @param {Number} column\n * @param {Number} baseWidth\n * @returns {Number}\n * @private\n */\n\n }, {\n key: '_getStretchedAllColumnWidth',\n value: function _getStretchedAllColumnWidth(column, baseWidth) {\n var sumRatioWidth = 0;\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n\n if (!this.stretchAllColumnsWidth[column]) {\n var stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);\n var newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);\n\n if (newStretchedWidth === void 0) {\n this.stretchAllColumnsWidth[column] = stretchedWidth;\n } else {\n this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;\n }\n }\n\n if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {\n this.needVerifyLastColumnWidth = false;\n\n for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) {\n sumRatioWidth += this.stretchAllColumnsWidth[i];\n }\n if (sumRatioWidth !== this.totalTargetWidth) {\n this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;\n }\n }\n\n return this.stretchAllColumnsWidth[column];\n }\n\n /**\n * @param {Number} column\n * @returns {Number|null}\n * @private\n */\n\n }, {\n key: '_getStretchedLastColumnWidth',\n value: function _getStretchedLastColumnWidth(column) {\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n\n if (column === totalColumns - 1) {\n return this.stretchLastWidth;\n }\n\n return null;\n }\n\n /**\n * @param {Number} column Column index.\n * @returns {Number}\n * @private\n */\n\n }, {\n key: '_getColumnWidth',\n value: function _getColumnWidth(column) {\n var width = privatePool.get(this).columnWidthFn(column);\n\n if (width === void 0) {\n width = ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n }\n }]);\n\n return ViewportColumnsCalculator;\n}();\n\nexports.default = ViewportColumnsCalculator;\n\n/***/ }),\n/* 136 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar privatePool = new WeakMap();\n\n/**\n * Calculates indexes of rows to render OR rows that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportRowsCalculator\n */\n\nvar ViewportRowsCalculator = function () {\n _createClass(ViewportRowsCalculator, null, [{\n key: \"DEFAULT_HEIGHT\",\n\n /**\n * Default row height\n *\n * @type {Number}\n */\n get: function get() {\n return 23;\n }\n\n /**\n * @param {Number} viewportHeight Height of the viewport\n * @param {Number} scrollOffset Current vertical scroll position of the viewport\n * @param {Number} totalRows Total number of rows\n * @param {Function} rowHeightFn Function that returns the height of the row at a given index (in px)\n * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)\n * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport\n * @param {Number} horizontalScrollbarHeight\n */\n\n }]);\n\n function ViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) {\n _classCallCheck(this, ViewportRowsCalculator);\n\n privatePool.set(this, {\n viewportHeight: viewportHeight,\n scrollOffset: scrollOffset,\n totalRows: totalRows,\n rowHeightFn: rowHeightFn,\n overrideFn: overrideFn,\n onlyFullyVisible: onlyFullyVisible,\n horizontalScrollbarHeight: horizontalScrollbarHeight\n });\n\n /**\n * Number of rendered/visible rows\n *\n * @type {Number}\n */\n this.count = 0;\n\n /**\n * Index of the first rendered/visible row (can be overwritten using overrideFn)\n *\n * @type {Number|null}\n */\n this.startRow = null;\n\n /**\n * Index of the last rendered/visible row (can be overwritten using overrideFn)\n *\n * @type {null}\n */\n this.endRow = null;\n\n /**\n * Position of the first rendered/visible row (in px)\n *\n * @type {Number|null}\n */\n this.startPosition = null;\n\n this.calculate();\n }\n\n /**\n * Calculates viewport\n */\n\n\n _createClass(ViewportRowsCalculator, [{\n key: \"calculate\",\n value: function calculate() {\n var sum = 0;\n var needReverse = true;\n var startPositions = [];\n\n var priv = privatePool.get(this);\n var onlyFullyVisible = priv.onlyFullyVisible;\n var overrideFn = priv.overrideFn;\n var rowHeightFn = priv.rowHeightFn;\n var scrollOffset = priv.scrollOffset;\n var totalRows = priv.totalRows;\n var viewportHeight = priv.viewportHeight;\n var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;\n var rowHeight = void 0;\n\n // Calculate the number (start and end index) of rows needed\n for (var i = 0; i < totalRows; i++) {\n rowHeight = rowHeightFn(i);\n\n if (rowHeight === undefined) {\n rowHeight = ViewportRowsCalculator.DEFAULT_HEIGHT;\n }\n if (sum <= scrollOffset && !onlyFullyVisible) {\n this.startRow = i;\n }\n\n // the row is within the \"visible range\"\n if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n if (this.startRow === null) {\n this.startRow = i;\n }\n this.endRow = i;\n }\n startPositions.push(sum);\n sum += rowHeight;\n\n if (!onlyFullyVisible) {\n this.endRow = i;\n }\n if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n needReverse = false;\n break;\n }\n }\n\n // If the estimation has reached the last row and there is still some space available in the viewport,\n // we need to render in reverse in order to fill the whole viewport with rows\n if (this.endRow === totalRows - 1 && needReverse) {\n this.startRow = this.endRow;\n\n while (this.startRow > 0) {\n // rowHeight is the height of the last row\n var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];\n\n if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) {\n this.startRow--;\n }\n if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {\n break;\n }\n }\n }\n\n if (this.startRow !== null && overrideFn) {\n overrideFn(this);\n }\n this.startPosition = startPositions[this.startRow];\n\n if (this.startPosition == void 0) {\n this.startPosition = null;\n }\n if (this.startRow !== null) {\n this.count = this.endRow - this.startRow + 1;\n }\n }\n }]);\n\n return ViewportRowsCalculator;\n}();\n\nexports.default = ViewportRowsCalculator;\n\n/***/ }),\n/* 137 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _string = __webpack_require__(27);\n\nvar _event = __webpack_require__(138);\n\nvar _event2 = _interopRequireDefault(_event);\n\nvar _overlays = __webpack_require__(141);\n\nvar _overlays2 = _interopRequireDefault(_overlays);\n\nvar _scroll = __webpack_require__(142);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _settings = __webpack_require__(143);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _table = __webpack_require__(144);\n\nvar _table2 = _interopRequireDefault(_table);\n\nvar _viewport = __webpack_require__(146);\n\nvar _viewport2 = _interopRequireDefault(_viewport);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Walkontable\n */\nvar Walkontable = function () {\n /**\n * @param {Object} settings\n */\n function Walkontable(settings) {\n _classCallCheck(this, Walkontable);\n\n var originalHeaders = [];\n\n // this is the namespace for global events\n this.guid = 'wt_' + (0, _string.randomString)();\n\n // bootstrap from settings\n if (settings.cloneSource) {\n this.cloneSource = settings.cloneSource;\n this.cloneOverlay = settings.cloneOverlay;\n this.wtSettings = settings.cloneSource.wtSettings;\n this.wtTable = new _table2.default(this, settings.table, settings.wtRootElement);\n this.wtScroll = new _scroll2.default(this);\n this.wtViewport = settings.cloneSource.wtViewport;\n this.wtEvent = new _event2.default(this);\n this.selections = this.cloneSource.selections;\n } else {\n this.wtSettings = new _settings2.default(this, settings);\n this.wtTable = new _table2.default(this, settings.table);\n this.wtScroll = new _scroll2.default(this);\n this.wtViewport = new _viewport2.default(this);\n this.wtEvent = new _event2.default(this);\n this.selections = this.getSetting('selections');\n this.wtOverlays = new _overlays2.default(this);\n this.exportSettingsAsClassNames();\n }\n\n // find original headers\n if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {\n for (var c = 0, clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {\n originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);\n }\n if (!this.getSetting('columnHeaders').length) {\n this.update('columnHeaders', [function (column, TH) {\n (0, _element.fastInnerText)(TH, originalHeaders[column]);\n }]);\n }\n }\n this.drawn = false;\n this.drawInterrupted = false;\n }\n\n /**\n * Force rerender of Walkontable\n *\n * @param {Boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering\n * the data. It will only work if Table.draw() does not force\n * rendering anyway\n * @returns {Walkontable}\n */\n\n\n _createClass(Walkontable, [{\n key: 'draw',\n value: function draw() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.drawInterrupted = false;\n\n if (!fastDraw && !(0, _element.isVisible)(this.wtTable.TABLE)) {\n // draw interrupted because TABLE is not visible\n this.drawInterrupted = true;\n } else {\n this.wtTable.draw(fastDraw);\n }\n\n return this;\n }\n\n /**\n * Returns the TD at coords. If topmost is set to true, returns TD from the topmost overlay layer,\n * if not set or set to false, returns TD from the master table.\n *\n * @param {CellCoords} coords\n * @param {Boolean} [topmost=false]\n * @returns {Object}\n */\n\n }, {\n key: 'getCell',\n value: function getCell(coords) {\n var topmost = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!topmost) {\n return this.wtTable.getCell(coords);\n }\n\n var totalRows = this.wtSettings.getSetting('totalRows');\n var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');\n var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');\n var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');\n\n if (coords.row < fixedRowsTop && coords.col < fixedColumns) {\n return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);\n } else if (coords.row < fixedRowsTop) {\n return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);\n } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomLeftCornerOverlay && this.wtOverlays.bottomLeftCornerOverlay.clone) {\n return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);\n }\n } else if (coords.col < fixedColumns) {\n return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);\n } else if (coords.row < totalRows && coords.row > totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {\n return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);\n }\n }\n\n return this.wtTable.getCell(coords);\n }\n\n /**\n * @param {Object} settings\n * @param {*} value\n * @returns {Walkontable}\n */\n\n }, {\n key: 'update',\n value: function update(settings, value) {\n return this.wtSettings.update(settings, value);\n }\n\n /**\n * Scroll the viewport to a row at the given index in the data source\n *\n * @param {Number} row\n * @returns {Walkontable}\n */\n\n }, {\n key: 'scrollVertical',\n value: function scrollVertical(row) {\n this.wtOverlays.topOverlay.scrollTo(row);\n this.getSetting('onScrollVertically');\n\n return this;\n }\n\n /**\n * Scroll the viewport to a column at the given index in the data source\n *\n * @param {Number} column\n * @returns {Walkontable}\n */\n\n }, {\n key: 'scrollHorizontal',\n value: function scrollHorizontal(column) {\n this.wtOverlays.leftOverlay.scrollTo(column);\n this.getSetting('onScrollHorizontally');\n\n return this;\n }\n\n /**\n * Scrolls the viewport to a cell (rerenders if needed)\n *\n * @param {CellCoords} coords\n * @returns {Walkontable}\n */\n\n }, {\n key: 'scrollViewport',\n value: function scrollViewport(coords) {\n this.wtScroll.scrollViewport(coords);\n\n return this;\n }\n\n /**\n * @returns {Array}\n */\n\n }, {\n key: 'getViewport',\n value: function getViewport() {\n return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()];\n }\n\n /**\n * Get overlay name\n *\n * @returns {String}\n */\n\n }, {\n key: 'getOverlayName',\n value: function getOverlayName() {\n return this.cloneOverlay ? this.cloneOverlay.type : 'master';\n }\n\n /**\n * Check overlay type of this Walkontable instance.\n *\n * @param {String} name Clone type @see {Overlay.CLONE_TYPES}.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isOverlayName',\n value: function isOverlayName(name) {\n if (this.cloneOverlay) {\n return this.cloneOverlay.type === name;\n }\n\n return false;\n }\n\n /**\n * Export settings as class names added to the parent element of the table.\n */\n\n }, {\n key: 'exportSettingsAsClassNames',\n value: function exportSettingsAsClassNames() {\n var _this = this;\n\n var toExport = {\n rowHeaders: ['array'],\n columnHeaders: ['array']\n };\n var allClassNames = [];\n var newClassNames = [];\n\n (0, _object.objectEach)(toExport, function (optionType, key) {\n if (optionType.indexOf('array') > -1 && _this.getSetting(key).length) {\n newClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));\n }\n allClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));\n });\n (0, _element.removeClass)(this.wtTable.wtRootElement.parentNode, allClassNames);\n (0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);\n }\n\n /**\n * Get/Set Walkontable instance setting\n *\n * @param {String} key\n * @param {*} [param1]\n * @param {*} [param2]\n * @param {*} [param3]\n * @param {*} [param4]\n * @returns {*}\n */\n\n }, {\n key: 'getSetting',\n value: function getSetting(key, param1, param2, param3, param4) {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.wtSettings.getSetting(key, param1, param2, param3, param4);\n }\n\n /**\n * Checks if setting exists\n *\n * @param {String} key\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasSetting',\n value: function hasSetting(key) {\n return this.wtSettings.has(key);\n }\n\n /**\n * Destroy instance\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.wtOverlays.destroy();\n this.wtEvent.destroy();\n }\n }]);\n\n return Walkontable;\n}();\n\nexports.default = Walkontable;\n\n/***/ }),\n/* 138 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _function = __webpack_require__(35);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n *\n */\nfunction Event(instance) {\n var that = this;\n var eventManager = new _eventManager2.default(instance);\n\n this.instance = instance;\n\n var dblClickOrigin = [null, null];\n this.dblClickTimeout = [null, null];\n\n var onMouseDown = function onMouseDown(event) {\n var activeElement = document.activeElement;\n var getParentNode = (0, _function.partial)(_element.getParent, event.realTarget);\n var realTarget = event.realTarget;\n\n // ignore focusable element from mouse down processing (https://github.com/handsontable/handsontable/issues/3555)\n if (realTarget === activeElement || getParentNode(0) === activeElement || getParentNode(1) === activeElement) {\n return;\n }\n\n var cell = that.parentCell(realTarget);\n\n if ((0, _element.hasClass)(realTarget, 'corner')) {\n that.instance.getSetting('onCellCornerMouseDown', event, realTarget);\n } else if (cell.TD) {\n if (that.instance.hasSetting('onCellMouseDown')) {\n that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance);\n }\n }\n\n if (event.button !== 2) {\n // if not right mouse button\n if (cell.TD) {\n dblClickOrigin[0] = cell.TD;\n clearTimeout(that.dblClickTimeout[0]);\n that.dblClickTimeout[0] = setTimeout(function () {\n dblClickOrigin[0] = null;\n }, 1000);\n }\n }\n };\n\n var onTouchMove = function onTouchMove(event) {\n that.instance.touchMoving = true;\n };\n\n var longTouchTimeout;\n\n var onTouchStart = function onTouchStart(event) {\n var container = this;\n\n eventManager.addEventListener(this, 'touchmove', onTouchMove);\n\n // Prevent cell selection when scrolling with touch event - not the best solution performance-wise\n that.checkIfTouchMove = setTimeout(function () {\n if (that.instance.touchMoving === true) {\n that.instance.touchMoving = void 0;\n\n eventManager.removeEventListener('touchmove', onTouchMove, false);\n }\n\n onMouseDown(event);\n }, 30);\n };\n\n var onMouseOver = function onMouseOver(event) {\n var table, td, mainWOT;\n\n if (that.instance.hasSetting('onCellMouseOver')) {\n table = that.instance.wtTable.TABLE;\n td = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);\n mainWOT = that.instance.cloneSource || that.instance;\n\n if (td && td !== mainWOT.lastMouseOver && (0, _element.isChildOf)(td, table)) {\n mainWOT.lastMouseOver = td;\n\n that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance);\n }\n }\n };\n\n var onMouseOut = function onMouseOut(event) {\n var table = void 0;\n var lastTD = void 0;\n var nextTD = void 0;\n\n if (that.instance.hasSetting('onCellMouseOut')) {\n table = that.instance.wtTable.TABLE;\n lastTD = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);\n nextTD = (0, _element.closestDown)(event.relatedTarget, ['TD', 'TH'], table);\n\n if (lastTD && lastTD !== nextTD && (0, _element.isChildOf)(lastTD, table)) {\n that.instance.getSetting('onCellMouseOut', event, that.instance.wtTable.getCoords(lastTD), lastTD, that.instance);\n }\n }\n };\n\n var onMouseUp = function onMouseUp(event) {\n if (event.button !== 2) {\n // if not right mouse button\n var cell = that.parentCell(event.realTarget);\n\n if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) {\n if ((0, _element.hasClass)(event.realTarget, 'corner')) {\n that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance);\n } else {\n that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance);\n }\n\n dblClickOrigin[0] = null;\n dblClickOrigin[1] = null;\n } else if (cell.TD === dblClickOrigin[0]) {\n that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);\n\n dblClickOrigin[1] = cell.TD;\n clearTimeout(that.dblClickTimeout[1]);\n that.dblClickTimeout[1] = setTimeout(function () {\n dblClickOrigin[1] = null;\n }, 500);\n } else if (cell.TD && that.instance.hasSetting('onCellMouseUp')) {\n that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);\n }\n }\n };\n\n var onTouchEnd = function onTouchEnd(event) {\n clearTimeout(longTouchTimeout);\n // that.instance.longTouch == void 0;\n\n event.preventDefault();\n onMouseUp(event);\n\n // eventManager.removeEventListener(that.instance.wtTable.holder, \"mouseup\", onMouseUp);\n };\n\n eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown);\n eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver);\n eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseout', onMouseOut);\n eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp);\n\n // check if full HOT instance, or detached WOT AND run on mobile device\n if (this.instance.wtTable.holder.parentNode.parentNode && (0, _browser.isMobileBrowser)() && !that.instance.wtTable.isWorkingOnClone()) {\n var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.');\n\n eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function (event) {\n that.instance.touchApplied = true;\n if ((0, _element.isChildOf)(event.target, classSelector)) {\n onTouchStart.call(event.target, event);\n }\n });\n eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function (event) {\n that.instance.touchApplied = false;\n if ((0, _element.isChildOf)(event.target, classSelector)) {\n onTouchEnd.call(event.target, event);\n }\n });\n\n if (!that.instance.momentumScrolling) {\n that.instance.momentumScrolling = {};\n }\n eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function (event) {\n clearTimeout(that.instance.momentumScrolling._timeout);\n\n if (!that.instance.momentumScrolling.ongoing) {\n that.instance.getSetting('onBeforeTouchScroll');\n }\n that.instance.momentumScrolling.ongoing = true;\n\n that.instance.momentumScrolling._timeout = setTimeout(function () {\n if (!that.instance.touchApplied) {\n that.instance.momentumScrolling.ongoing = false;\n\n that.instance.getSetting('onAfterMomentumScroll');\n }\n }, 200);\n });\n }\n\n eventManager.addEventListener(window, 'resize', function () {\n if (that.instance.getSetting('stretchH') !== 'none') {\n that.instance.draw();\n }\n });\n\n this.destroy = function () {\n clearTimeout(this.dblClickTimeout[0]);\n clearTimeout(this.dblClickTimeout[1]);\n\n eventManager.destroy();\n };\n}\n\nEvent.prototype.parentCell = function (elem) {\n var cell = {};\n var TABLE = this.instance.wtTable.TABLE;\n var TD = (0, _element.closestDown)(elem, ['TD', 'TH'], TABLE);\n\n if (TD) {\n cell.coords = this.instance.wtTable.getCoords(TD);\n cell.TD = TD;\n } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'current')) {\n cell.coords = this.instance.selections.current.cellRange.highlight; // selections.current is current selected cell\n cell.TD = this.instance.wtTable.getCell(cell.coords);\n } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'area')) {\n if (this.instance.selections.area.cellRange) {\n cell.coords = this.instance.selections.area.cellRange.to; // selections.area is area selected cells\n cell.TD = this.instance.wtTable.getCell(cell.coords);\n }\n }\n\n return cell;\n};\n\nexports.default = Event;\n\n/***/ }),\n/* 139 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class ColumnFilter\n */\nvar ColumnFilter = function () {\n /**\n * @param {Number} offset\n * @param {Number} total\n * @param {Number} countTH\n */\n function ColumnFilter(offset, total, countTH) {\n _classCallCheck(this, ColumnFilter);\n\n this.offset = offset;\n this.total = total;\n this.countTH = countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n\n _createClass(ColumnFilter, [{\n key: \"offsetted\",\n value: function offsetted(index) {\n return index + this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsetted\",\n value: function unOffsetted(index) {\n return index - this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"renderedToSource\",\n value: function renderedToSource(index) {\n return this.offsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceToRendered\",\n value: function sourceToRendered(index) {\n return this.unOffsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"offsettedTH\",\n value: function offsettedTH(index) {\n return index - this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsettedTH\",\n value: function unOffsettedTH(index) {\n return index + this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"visibleRowHeadedColumnToSourceColumn\",\n value: function visibleRowHeadedColumnToSourceColumn(index) {\n return this.renderedToSource(this.offsettedTH(index));\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceColumnToVisibleRowHeadedColumn\",\n value: function sourceColumnToVisibleRowHeadedColumn(index) {\n return this.unOffsettedTH(this.sourceToRendered(index));\n }\n }]);\n\n return ColumnFilter;\n}();\n\nexports.default = ColumnFilter;\n\n/***/ }),\n/* 140 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class RowFilter\n */\nvar RowFilter = function () {\n /**\n * @param {Number} offset\n * @param {Number} total\n * @param {Number} countTH\n */\n function RowFilter(offset, total, countTH) {\n _classCallCheck(this, RowFilter);\n\n this.offset = offset;\n this.total = total;\n this.countTH = countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n\n _createClass(RowFilter, [{\n key: \"offsetted\",\n value: function offsetted(index) {\n return index + this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsetted\",\n value: function unOffsetted(index) {\n return index - this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"renderedToSource\",\n value: function renderedToSource(index) {\n return this.offsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceToRendered\",\n value: function sourceToRendered(index) {\n return this.unOffsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"offsettedTH\",\n value: function offsettedTH(index) {\n return index - this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsettedTH\",\n value: function unOffsettedTH(index) {\n return index + this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"visibleColHeadedRowToSourceRow\",\n value: function visibleColHeadedRowToSourceRow(index) {\n return this.renderedToSource(this.offsettedTH(index));\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceRowToVisibleColHeadedRow\",\n value: function sourceRowToVisibleColHeadedRow(index) {\n return this.unOffsettedTH(this.sourceToRendered(index));\n }\n }]);\n\n return RowFilter;\n}();\n\nexports.default = RowFilter;\n\n/***/ }),\n/* 141 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _unicode = __webpack_require__(16);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Overlays\n */\nvar Overlays = function () {\n /**\n * @param {Walkontable} wotInstance\n */\n function Overlays(wotInstance) {\n _classCallCheck(this, Overlays);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = this.wot;\n this.eventManager = new _eventManager2.default(this.wot);\n\n this.wot.update('scrollbarWidth', (0, _element.getScrollbarWidth)());\n this.wot.update('scrollbarHeight', (0, _element.getScrollbarWidth)());\n\n this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n\n this.prepareOverlays();\n\n this.destroyed = false;\n this.keyPressed = false;\n this.spreaderLastSize = {\n width: null,\n height: null\n };\n this.overlayScrollPositions = {\n master: {\n top: 0,\n left: 0\n },\n top: {\n top: null,\n left: 0\n },\n bottom: {\n top: null,\n left: 0\n },\n left: {\n top: 0,\n left: null\n }\n };\n\n this.pendingScrollCallbacks = {\n master: {\n top: 0,\n left: 0\n },\n top: {\n left: 0\n },\n bottom: {\n left: 0\n },\n left: {\n top: 0\n }\n };\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n this.delegatedScrollCallback = false;\n\n this.registeredListeners = [];\n\n this.registerListeners();\n }\n\n /**\n * Prepare overlays based on user settings.\n *\n * @returns {Boolean} Returns `true` if changes applied to overlay needs scroll synchronization.\n */\n\n\n _createClass(Overlays, [{\n key: 'prepareOverlays',\n value: function prepareOverlays() {\n var syncScroll = false;\n\n if (this.topOverlay) {\n syncScroll = this.topOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP, this.wot);\n }\n\n if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM)) {\n this.bottomOverlay = {\n needFullRender: false,\n updateStateOfRendering: function updateStateOfRendering() {\n return false;\n }\n };\n }\n if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n this.bottomLeftCornerOverlay = {\n needFullRender: false,\n updateStateOfRendering: function updateStateOfRendering() {\n return false;\n }\n };\n }\n\n if (this.bottomOverlay) {\n syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM, this.wot);\n }\n\n if (this.leftOverlay) {\n syncScroll = this.leftOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.leftOverlay = _base2.default.createOverlay(_base2.default.CLONE_LEFT, this.wot);\n }\n\n if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.topLeftCornerOverlay) {\n syncScroll = this.topLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.bottomLeftCornerOverlay) {\n syncScroll = this.bottomLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.wot.getSetting('debug') && !this.debug) {\n this.debug = _base2.default.createOverlay(_base2.default.CLONE_DEBUG, this.wot);\n }\n\n return syncScroll;\n }\n\n /**\n * Refresh and redraw table\n */\n\n }, {\n key: 'refreshAll',\n value: function refreshAll() {\n if (!this.wot.drawn) {\n return;\n }\n if (!this.wot.wtTable.holder.parentNode) {\n // Walkontable was detached from DOM, but this handler was not removed\n this.destroy();\n\n return;\n }\n this.wot.draw(true);\n\n if (this.verticalScrolling) {\n this.leftOverlay.onScroll();\n }\n\n if (this.horizontalScrolling) {\n this.topOverlay.onScroll();\n }\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n }\n\n /**\n * Register all necessary event listeners.\n */\n\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n var _this = this;\n\n var topOverlayScrollable = this.topOverlay.mainTableScrollableElement;\n var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement;\n\n var listenersToRegister = [];\n listenersToRegister.push([document.documentElement, 'keydown', function (event) {\n return _this.onKeyDown(event);\n }]);\n listenersToRegister.push([document.documentElement, 'keyup', function () {\n return _this.onKeyUp();\n }]);\n listenersToRegister.push([document, 'visibilitychange', function () {\n return _this.onKeyUp();\n }]);\n listenersToRegister.push([topOverlayScrollable, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n\n if (topOverlayScrollable !== leftOverlayScrollable) {\n listenersToRegister.push([leftOverlayScrollable, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.topOverlay.needFullRender) {\n listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.bottomOverlay.needFullRender) {\n listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.leftOverlay.needFullRender) {\n listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.topLeftCornerOverlay && this.topLeftCornerOverlay.needFullRender) {\n listenersToRegister.push([this.topLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.needFullRender) {\n listenersToRegister.push([this.bottomLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) {\n // This is necessary?\n // eventManager.addEventListener(window, 'scroll', (event) => this.refreshAll(event));\n listenersToRegister.push([window, 'wheel', function (event) {\n var overlay = void 0;\n var deltaY = event.wheelDeltaY || event.deltaY;\n var deltaX = event.wheelDeltaX || event.deltaX;\n\n if (_this.topOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'top';\n } else if (_this.bottomOverlay.clone && _this.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'bottom';\n } else if (_this.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'left';\n } else if (_this.topLeftCornerOverlay && _this.topLeftCornerOverlay.clone && _this.topLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'topLeft';\n } else if (_this.bottomLeftCornerOverlay && _this.bottomLeftCornerOverlay.clone && _this.bottomLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'bottomLeft';\n }\n\n if (overlay == 'top' && deltaY !== 0 || overlay == 'left' && deltaX !== 0 || overlay == 'bottom' && deltaY !== 0 || (overlay === 'topLeft' || overlay === 'bottomLeft') && (deltaY !== 0 || deltaX !== 0)) {\n\n event.preventDefault();\n }\n }]);\n }\n\n while (listenersToRegister.length) {\n var listener = listenersToRegister.pop();\n this.eventManager.addEventListener(listener[0], listener[1], listener[2]);\n\n this.registeredListeners.push(listener);\n }\n }\n\n /**\n * Deregister all previously registered listeners.\n */\n\n }, {\n key: 'deregisterListeners',\n value: function deregisterListeners() {\n while (this.registeredListeners.length) {\n var listener = this.registeredListeners.pop();\n this.eventManager.removeEventListener(listener[0], listener[1], listener[2]);\n }\n }\n\n /**\n * Scroll listener\n *\n * @param {Event} event\n */\n\n }, {\n key: 'onTableScroll',\n value: function onTableScroll(event) {\n // if mobile browser, do not update scroll positions, as the overlays are hidden during the scroll\n if ((0, _browser.isMobileBrowser)()) {\n return;\n }\n var masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n var masterVertical = this.topOverlay.mainTableScrollableElement;\n var target = event.target;\n\n // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered\n // by hot.refreshBorder\n if (this.keyPressed) {\n if (masterVertical !== window && target !== window && !event.target.contains(masterVertical) || masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal)) {\n return;\n }\n }\n\n if (event.type === 'scroll') {\n this.syncScrollPositions(event);\n } else {\n this.translateMouseWheelToScroll(event);\n }\n }\n\n /**\n * Key down listener\n */\n\n }, {\n key: 'onKeyDown',\n value: function onKeyDown(event) {\n this.keyPressed = (0, _unicode.isKey)(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');\n }\n\n /**\n * Key up listener\n */\n\n }, {\n key: 'onKeyUp',\n value: function onKeyUp() {\n this.keyPressed = false;\n }\n\n /**\n * Translate wheel event into scroll event and sync scroll overlays position\n *\n * @private\n * @param {Event} event\n * @returns {Boolean}\n */\n\n }, {\n key: 'translateMouseWheelToScroll',\n value: function translateMouseWheelToScroll(event) {\n var topOverlay = this.topOverlay.clone.wtTable.holder;\n var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null;\n var leftOverlay = this.leftOverlay.clone.wtTable.holder;\n var topLeftCornerOverlay = this.topLeftCornerOverlay && this.topLeftCornerOverlay.clone ? this.topLeftCornerOverlay.clone.wtTable.holder : null;\n var bottomLeftCornerOverlay = this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone ? this.bottomLeftCornerOverlay.clone.wtTable.holder : null;\n var mouseWheelSpeedRatio = -0.2;\n var deltaY = event.wheelDeltaY || -1 * event.deltaY;\n var deltaX = event.wheelDeltaX || -1 * event.deltaX;\n var parentHolder = null;\n var eventMockup = { type: 'wheel' };\n var tempElem = event.target;\n var delta = null;\n\n // Fix for extremely slow header scrolling with a mousewheel on Firefox\n if (event.deltaMode === 1) {\n deltaY *= 120;\n deltaX *= 120;\n }\n\n while (tempElem != document && tempElem != null) {\n if (tempElem.className.indexOf('wtHolder') > -1) {\n parentHolder = tempElem;\n break;\n }\n tempElem = tempElem.parentNode;\n }\n eventMockup.target = parentHolder;\n\n if (parentHolder === topLeftCornerOverlay || parentHolder === bottomLeftCornerOverlay) {\n this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaX, 'x');\n this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaY, 'y');\n } else {\n if (parentHolder === topOverlay || parentHolder === bottomOverlay) {\n delta = deltaY;\n } else if (parentHolder === leftOverlay) {\n delta = deltaX;\n }\n\n this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * delta);\n }\n\n return false;\n }\n\n /**\n * Synchronize scroll position between master table and overlay table.\n *\n * @private\n * @param {Event|Object} event\n * @param {Number} [fakeScrollValue=null]\n * @param {String} [fakeScrollDirection=null] `x` or `y`.\n */\n\n }, {\n key: 'syncScrollPositions',\n value: function syncScrollPositions(event) {\n var fakeScrollValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var fakeScrollDirection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (this.destroyed) {\n return;\n }\n if (arguments.length === 0) {\n this.syncScrollWithMaster();\n\n return;\n }\n var masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n var masterVertical = this.topOverlay.mainTableScrollableElement;\n var target = event.target;\n var tempScrollValue = 0;\n var scrollValueChanged = false;\n var topOverlay = void 0;\n var leftOverlay = void 0;\n var topLeftCornerOverlay = void 0;\n var bottomLeftCornerOverlay = void 0;\n var bottomOverlay = void 0;\n var delegatedScroll = false;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.topOverlay.needFullRender) {\n topOverlay = this.topOverlay.clone.wtTable.holder;\n }\n\n if (this.bottomOverlay.needFullRender) {\n bottomOverlay = this.bottomOverlay.clone.wtTable.holder;\n }\n\n if (this.leftOverlay.needFullRender) {\n leftOverlay = this.leftOverlay.clone.wtTable.holder;\n }\n\n if (this.leftOverlay.needFullRender && this.topOverlay.needFullRender) {\n topLeftCornerOverlay = this.topLeftCornerOverlay.clone.wtTable.holder;\n }\n\n if (this.leftOverlay.needFullRender && this.bottomOverlay.needFullRender) {\n bottomLeftCornerOverlay = this.bottomLeftCornerOverlay.clone.wtTable.holder;\n }\n\n if (target === document) {\n target = window;\n }\n\n if (target === masterHorizontal || target === masterVertical) {\n if (preventOverflow) {\n tempScrollValue = (0, _element.getScrollLeft)(this.scrollableElement);\n } else {\n tempScrollValue = (0, _element.getScrollLeft)(target);\n }\n\n // if scrolling the master table - populate the scroll values to both top and left overlays\n this.horizontalScrolling = true;\n this.overlayScrollPositions.master.left = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.master.left > 0) {\n this.pendingScrollCallbacks.master.left--;\n } else {\n if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {\n\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.top.left++;\n }\n\n topOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterHorizontal !== window;\n }\n\n if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {\n\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.bottom.left++;\n }\n\n bottomOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterHorizontal !== window;\n }\n }\n\n tempScrollValue = (0, _element.getScrollTop)(target);\n\n this.verticalScrolling = true;\n this.overlayScrollPositions.master.top = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.master.top > 0) {\n this.pendingScrollCallbacks.master.top--;\n } else if (leftOverlay && leftOverlay.scrollTop !== tempScrollValue) {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.left.top++;\n }\n\n leftOverlay.scrollTop = tempScrollValue;\n delegatedScroll = masterVertical !== window;\n }\n } else if (target === bottomOverlay) {\n tempScrollValue = (0, _element.getScrollLeft)(target);\n\n // if scrolling the bottom overlay - populate the horizontal scroll to the master table\n this.horizontalScrolling = true;\n this.overlayScrollPositions.bottom.left = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.bottom.left > 0) {\n this.pendingScrollCallbacks.bottom.left--;\n } else {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.master.left++;\n }\n\n masterHorizontal.scrollLeft = tempScrollValue;\n\n if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.top.left++;\n }\n\n topOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterVertical !== window;\n }\n }\n\n // \"fake\" scroll value calculated from the mousewheel event\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n masterVertical.scrollTop += fakeScrollValue;\n }\n } else if (target === topOverlay) {\n tempScrollValue = (0, _element.getScrollLeft)(target);\n\n // if scrolling the top overlay - populate the horizontal scroll to the master table\n this.horizontalScrolling = true;\n this.overlayScrollPositions.top.left = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.top.left > 0) {\n this.pendingScrollCallbacks.top.left--;\n } else {\n\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.master.left++;\n }\n\n masterHorizontal.scrollLeft = tempScrollValue;\n }\n\n // \"fake\" scroll value calculated from the mousewheel event\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n masterVertical.scrollTop += fakeScrollValue;\n }\n\n if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.bottom.left++;\n }\n\n bottomOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterVertical !== window;\n }\n } else if (target === leftOverlay) {\n tempScrollValue = (0, _element.getScrollTop)(target);\n\n // if scrolling the left overlay - populate the vertical scroll to the master table\n if (this.overlayScrollPositions.left.top !== tempScrollValue) {\n this.verticalScrolling = true;\n this.overlayScrollPositions.left.top = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.left.top > 0) {\n this.pendingScrollCallbacks.left.top--;\n } else {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.master.top++;\n }\n\n masterVertical.scrollTop = tempScrollValue;\n }\n }\n\n // \"fake\" scroll value calculated from the mousewheel event\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n masterVertical.scrollLeft += fakeScrollValue;\n }\n } else if (target === topLeftCornerOverlay || target === bottomLeftCornerOverlay) {\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n\n if (fakeScrollDirection === 'x') {\n masterVertical.scrollLeft += fakeScrollValue;\n } else if (fakeScrollDirection === 'y') {\n masterVertical.scrollTop += fakeScrollValue;\n }\n }\n }\n\n if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') {\n if (this.delegatedScrollCallback) {\n this.delegatedScrollCallback = false;\n } else {\n this.refreshAll();\n }\n\n if (delegatedScroll) {\n this.delegatedScrollCallback = true;\n }\n }\n }\n\n /**\n * Synchronize overlay scrollbars with the master scrollbar\n */\n\n }, {\n key: 'syncScrollWithMaster',\n value: function syncScrollWithMaster() {\n var master = this.topOverlay.mainTableScrollableElement;\n var scrollLeft = master.scrollLeft,\n scrollTop = master.scrollTop;\n\n\n if (this.topOverlay.needFullRender) {\n this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n if (this.leftOverlay.needFullRender) {\n this.leftOverlay.clone.wtTable.holder.scrollTop = scrollTop;\n }\n }\n\n /**\n * Update the main scrollable elements for all the overlays.\n */\n\n }, {\n key: 'updateMainScrollableElements',\n value: function updateMainScrollableElements() {\n this.deregisterListeners();\n\n this.leftOverlay.updateMainScrollableElement();\n this.topOverlay.updateMainScrollableElement();\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.updateMainScrollableElement();\n }\n\n this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n\n this.registerListeners();\n }\n\n /**\n *\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.eventManager.destroy();\n this.topOverlay.destroy();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.destroy();\n }\n this.leftOverlay.destroy();\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.destroy();\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.destroy();\n }\n\n if (this.debug) {\n this.debug.destroy();\n }\n this.destroyed = true;\n }\n\n /**\n * @param {Boolean} [fastDraw=false]\n */\n\n }, {\n key: 'refresh',\n value: function refresh() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) {\n var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement;\n var width = container.clientWidth;\n var height = container.clientHeight;\n\n if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {\n this.spreaderLastSize.width = width;\n this.spreaderLastSize.height = height;\n this.adjustElementsSize();\n }\n }\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.refresh(fastDraw);\n }\n\n this.leftOverlay.refresh(fastDraw);\n this.topOverlay.refresh(fastDraw);\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.debug) {\n this.debug.refresh(fastDraw);\n }\n }\n\n /**\n * Adjust overlays elements size and master table size\n *\n * @param {Boolean} [force=false]\n */\n\n }, {\n key: 'adjustElementsSize',\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var totalColumns = this.wot.getSetting('totalColumns');\n var totalRows = this.wot.getSetting('totalRows');\n var headerRowSize = this.wot.wtViewport.getRowHeaderWidth();\n var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight();\n var hiderStyle = this.wot.wtTable.hider.style;\n\n hiderStyle.width = headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns) + 'px';\n hiderStyle.height = headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1 + 'px';\n\n this.topOverlay.adjustElementsSize(force);\n this.leftOverlay.adjustElementsSize(force);\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.adjustElementsSize(force);\n }\n }\n\n /**\n *\n */\n\n }, {\n key: 'applyToDOM',\n value: function applyToDOM() {\n if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n this.topOverlay.applyToDOM();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.applyToDOM();\n }\n\n this.leftOverlay.applyToDOM();\n }\n\n /**\n * Get the parent overlay of the provided element.\n *\n * @param {HTMLElement} element\n * @returns {Object|null}\n */\n\n }, {\n key: 'getParentOverlay',\n value: function getParentOverlay(element) {\n if (!element) {\n return null;\n }\n\n var overlays = [this.topOverlay, this.leftOverlay, this.bottomOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];\n var result = null;\n\n (0, _array.arrayEach)(overlays, function (elem, i) {\n if (!elem) {\n return;\n }\n\n if (elem.clone && elem.clone.wtTable.TABLE.contains(element)) {\n result = elem.clone;\n }\n });\n\n return result;\n }\n }]);\n\n return Overlays;\n}();\n\nexports.default = Overlays;\n\n/***/ }),\n/* 142 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _number = __webpack_require__(6);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Scroll\n */\nvar Scroll = function () {\n /**\n * @param {Walkontable} wotInstance\n */\n function Scroll(wotInstance) {\n _classCallCheck(this, Scroll);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = wotInstance;\n }\n\n /**\n * Scrolls viewport to a cell by minimum number of cells\n *\n * @param {CellCoords} coords\n */\n\n\n _createClass(Scroll, [{\n key: 'scrollViewport',\n value: function scrollViewport(coords) {\n if (!this.wot.drawn) {\n return;\n }\n\n var _getVariables2 = this._getVariables(),\n topOverlay = _getVariables2.topOverlay,\n leftOverlay = _getVariables2.leftOverlay,\n totalRows = _getVariables2.totalRows,\n totalColumns = _getVariables2.totalColumns,\n fixedRowsTop = _getVariables2.fixedRowsTop,\n fixedRowsBottom = _getVariables2.fixedRowsBottom,\n fixedColumnsLeft = _getVariables2.fixedColumnsLeft;\n\n if (coords.row < 0 || coords.row > Math.max(totalRows - 1, 0)) {\n throw new Error('row ' + coords.row + ' does not exist');\n }\n\n if (coords.col < 0 || coords.col > Math.max(totalColumns - 1, 0)) {\n throw new Error('column ' + coords.col + ' does not exist');\n }\n\n if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) {\n topOverlay.scrollTo(coords.row);\n } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) {\n topOverlay.scrollTo(coords.row, true);\n }\n\n if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) {\n leftOverlay.scrollTo(coords.col);\n } else if (coords.col > this.getLastVisibleColumn()) {\n leftOverlay.scrollTo(coords.col, true);\n }\n }\n\n /**\n * Get first visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getFirstVisibleRow',\n value: function getFirstVisibleRow() {\n var _getVariables3 = this._getVariables(),\n topOverlay = _getVariables3.topOverlay,\n wtTable = _getVariables3.wtTable,\n wtViewport = _getVariables3.wtViewport,\n totalRows = _getVariables3.totalRows,\n fixedRowsTop = _getVariables3.fixedRowsTop;\n\n var firstVisibleRow = wtTable.getFirstVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var totalTableHeight = (0, _element.innerHeight)(wtTable.hider);\n var windowHeight = (0, _element.innerHeight)(window);\n var windowScrollTop = (0, _element.getScrollTop)(window);\n\n // Only calculate firstVisibleRow when table didn't filled (from up) whole viewport space\n if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {\n var rowsHeight = wtViewport.getColumnHeaderHeight();\n\n rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);\n\n (0, _number.rangeEachReverse)(totalRows, 1, function (row) {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {\n // Return physical row + 1\n firstVisibleRow = row;\n\n return false;\n }\n });\n }\n }\n\n return firstVisibleRow;\n }\n\n /**\n * Get last visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getLastVisibleRow',\n value: function getLastVisibleRow() {\n var _getVariables4 = this._getVariables(),\n topOverlay = _getVariables4.topOverlay,\n wtTable = _getVariables4.wtTable,\n wtViewport = _getVariables4.wtViewport,\n totalRows = _getVariables4.totalRows;\n\n var lastVisibleRow = wtTable.getLastVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var windowHeight = (0, _element.innerHeight)(window);\n var windowScrollTop = (0, _element.getScrollTop)(window);\n\n // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space\n if (rootElementOffset.top > windowScrollTop) {\n var rowsHeight = wtViewport.getColumnHeaderHeight();\n\n (0, _number.rangeEach)(1, totalRows, function (row) {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {\n // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)\n lastVisibleRow = row - 2;\n\n return false;\n }\n });\n }\n }\n\n return lastVisibleRow;\n }\n\n /**\n * Get first visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getFirstVisibleColumn',\n value: function getFirstVisibleColumn() {\n var _getVariables5 = this._getVariables(),\n leftOverlay = _getVariables5.leftOverlay,\n wtTable = _getVariables5.wtTable,\n wtViewport = _getVariables5.wtViewport,\n totalColumns = _getVariables5.totalColumns,\n fixedColumnsLeft = _getVariables5.fixedColumnsLeft;\n\n var firstVisibleColumn = wtTable.getFirstVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var totalTableWidth = (0, _element.innerWidth)(wtTable.hider);\n var windowWidth = (0, _element.innerWidth)(window);\n var windowScrollLeft = (0, _element.getScrollLeft)(window);\n\n // Only calculate firstVisibleColumn when table didn't filled (from left) whole viewport space\n if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {\n var columnsWidth = wtViewport.getRowHeaderWidth();\n\n (0, _number.rangeEachReverse)(totalColumns, 1, function (column) {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {\n // Return physical column + 1\n firstVisibleColumn = column;\n\n return false;\n }\n });\n }\n }\n\n return firstVisibleColumn;\n }\n\n /**\n * Get last visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getLastVisibleColumn',\n value: function getLastVisibleColumn() {\n var _getVariables6 = this._getVariables(),\n leftOverlay = _getVariables6.leftOverlay,\n wtTable = _getVariables6.wtTable,\n wtViewport = _getVariables6.wtViewport,\n totalColumns = _getVariables6.totalColumns;\n\n var lastVisibleColumn = wtTable.getLastVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var windowWidth = (0, _element.innerWidth)(window);\n var windowScrollLeft = (0, _element.getScrollLeft)(window);\n\n // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space\n if (rootElementOffset.left > windowScrollLeft) {\n var columnsWidth = wtViewport.getRowHeaderWidth();\n\n (0, _number.rangeEach)(1, totalColumns, function (column) {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {\n // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)\n lastVisibleColumn = column - 2;\n\n return false;\n }\n });\n }\n }\n\n return lastVisibleColumn;\n }\n\n /**\n * Returns collection of variables used to rows and columns visibility calculations.\n *\n * @returns {Object}\n * @private\n */\n\n }, {\n key: '_getVariables',\n value: function _getVariables() {\n var wot = this.wot;\n var topOverlay = wot.wtOverlays.topOverlay;\n var leftOverlay = wot.wtOverlays.leftOverlay;\n var wtTable = wot.wtTable;\n var wtViewport = wot.wtViewport;\n var totalRows = wot.getSetting('totalRows');\n var totalColumns = wot.getSetting('totalColumns');\n var fixedRowsTop = wot.getSetting('fixedRowsTop');\n var fixedRowsBottom = wot.getSetting('fixedRowsBottom');\n var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');\n\n return {\n topOverlay: topOverlay,\n leftOverlay: leftOverlay,\n wtTable: wtTable,\n wtViewport: wtViewport,\n totalRows: totalRows,\n totalColumns: totalColumns,\n fixedRowsTop: fixedRowsTop,\n fixedRowsBottom: fixedRowsBottom,\n fixedColumnsLeft: fixedColumnsLeft\n };\n }\n }]);\n\n return Scroll;\n}();\n\nexports.default = Scroll;\n\n/***/ }),\n/* 143 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Settings\n */\nvar Settings = function () {\n /**\n * @param {Walkontable} wotInstance\n * @param {Object} settings\n */\n function Settings(wotInstance, settings) {\n var _this = this;\n\n _classCallCheck(this, Settings);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = wotInstance;\n\n // default settings. void 0 means it is required, null means it can be empty\n this.defaults = {\n table: void 0,\n debug: false, // shows WalkontableDebugOverlay\n\n // presentation mode\n externalRowCalculator: false,\n stretchH: 'none', // values: all, last, none\n currentRowClassName: null,\n currentColumnClassName: null,\n preventOverflow: function preventOverflow() {\n return false;\n },\n\n\n // data source\n data: void 0,\n freezeOverlays: false,\n fixedColumnsLeft: 0,\n fixedRowsTop: 0,\n fixedRowsBottom: 0,\n minSpareRows: 0,\n\n // this must be array of functions: [function (row, TH) {}]\n rowHeaders: function rowHeaders() {\n return [];\n },\n\n\n // this must be array of functions: [function (column, TH) {}]\n columnHeaders: function columnHeaders() {\n return [];\n },\n\n totalRows: void 0,\n totalColumns: void 0,\n cellRenderer: function cellRenderer(row, column, TD) {\n var cellData = _this.getSetting('data', row, column);\n\n (0, _element.fastInnerText)(TD, cellData === void 0 || cellData === null ? '' : cellData);\n },\n\n // columnWidth: 50,\n columnWidth: function columnWidth(col) {\n // return undefined means use default size for the rendered cell content\n },\n rowHeight: function rowHeight(row) {\n // return undefined means use default size for the rendered cell content\n },\n\n defaultRowHeight: 23,\n defaultColumnWidth: 50,\n selections: null,\n hideBorderOnMouseDownOver: false,\n viewportRowCalculatorOverride: null,\n viewportColumnCalculatorOverride: null,\n\n // callbacks\n onCellMouseDown: null,\n onCellMouseOver: null,\n onCellMouseOut: null,\n onCellMouseUp: null,\n\n // onCellMouseOut: null,\n onCellDblClick: null,\n onCellCornerMouseDown: null,\n onCellCornerDblClick: null,\n beforeDraw: null,\n onDraw: null,\n onBeforeDrawBorders: null,\n onScrollVertically: null,\n onScrollHorizontally: null,\n onBeforeTouchScroll: null,\n onAfterMomentumScroll: null,\n onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(width) {\n return width;\n },\n onModifyRowHeaderWidth: null,\n\n // constants\n scrollbarWidth: 10,\n scrollbarHeight: 10,\n\n renderAllRows: false,\n groups: false,\n rowHeaderWidth: null,\n columnHeaderHeight: null,\n headerClassName: null\n };\n\n // reference to settings\n this.settings = {};\n\n for (var i in this.defaults) {\n if ((0, _object.hasOwnProperty)(this.defaults, i)) {\n if (settings[i] !== void 0) {\n this.settings[i] = settings[i];\n } else if (this.defaults[i] === void 0) {\n throw new Error('A required setting \"' + i + '\" was not provided');\n } else {\n this.settings[i] = this.defaults[i];\n }\n }\n }\n }\n\n /**\n * Update settings\n *\n * @param {Object} settings\n * @param {*} value\n * @returns {Walkontable}\n */\n\n\n _createClass(Settings, [{\n key: 'update',\n value: function update(settings, value) {\n if (value === void 0) {\n // settings is object\n for (var i in settings) {\n if ((0, _object.hasOwnProperty)(settings, i)) {\n this.settings[i] = settings[i];\n }\n }\n } else {\n // if value is defined then settings is the key\n this.settings[settings] = value;\n }\n return this.wot;\n }\n\n /**\n * Get setting by name\n *\n * @param {String} key\n * @param {*} param1\n * @param {*} param2\n * @param {*} param3\n * @param {*} param4\n * @returns {*}\n */\n\n }, {\n key: 'getSetting',\n value: function getSetting(key, param1, param2, param3, param4) {\n if (typeof this.settings[key] === 'function') {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.settings[key](param1, param2, param3, param4);\n } else if (param1 !== void 0 && Array.isArray(this.settings[key])) {\n // perhaps this can be removed, it is only used in tests\n return this.settings[key][param1];\n }\n\n return this.settings[key];\n }\n\n /**\n * Checks if setting exists\n *\n * @param {Boolean} key\n * @returns {Boolean}\n */\n\n }, {\n key: 'has',\n value: function has(key) {\n return !!this.settings[key];\n }\n }]);\n\n return Settings;\n}();\n\nexports.default = Settings;\n\n/***/ }),\n/* 144 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _function = __webpack_require__(35);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _range = __webpack_require__(69);\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _column = __webpack_require__(139);\n\nvar _column2 = _interopRequireDefault(_column);\n\nvar _row = __webpack_require__(140);\n\nvar _row2 = _interopRequireDefault(_row);\n\nvar _tableRenderer = __webpack_require__(145);\n\nvar _tableRenderer2 = _interopRequireDefault(_tableRenderer);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n */\nvar Table = function () {\n /**\n * @param {Walkontable} wotInstance\n * @param {HTMLTableElement} table\n */\n function Table(wotInstance, table) {\n var _this = this;\n\n _classCallCheck(this, Table);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = this.wot;\n this.TABLE = table;\n this.TBODY = null;\n this.THEAD = null;\n this.COLGROUP = null;\n this.tableOffset = 0;\n this.holderOffset = 0;\n\n (0, _element.removeTextNodes)(this.TABLE);\n\n this.spreader = this.createSpreader(this.TABLE);\n this.hider = this.createHider(this.spreader);\n this.holder = this.createHolder(this.hider);\n\n this.wtRootElement = this.holder.parentNode;\n this.alignOverlaysWithTrimmingContainer();\n this.fixTableDomTree();\n\n this.colgroupChildrenLength = this.COLGROUP.childNodes.length;\n this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0;\n this.tbodyChildrenLength = this.TBODY.childNodes.length;\n\n this.rowFilter = null;\n this.columnFilter = null;\n this.correctHeaderWidth = false;\n\n var origRowHeaderWidth = this.wot.wtSettings.settings.rowHeaderWidth;\n\n // Fix for jumping row headers (https://github.com/handsontable/handsontable/issues/3850)\n this.wot.wtSettings.settings.rowHeaderWidth = function () {\n return _this._modifyRowHeaderWidth(origRowHeaderWidth);\n };\n }\n\n /**\n *\n */\n\n\n _createClass(Table, [{\n key: 'fixTableDomTree',\n value: function fixTableDomTree() {\n this.TBODY = this.TABLE.querySelector('tbody');\n\n if (!this.TBODY) {\n this.TBODY = document.createElement('tbody');\n this.TABLE.appendChild(this.TBODY);\n }\n this.THEAD = this.TABLE.querySelector('thead');\n\n if (!this.THEAD) {\n this.THEAD = document.createElement('thead');\n this.TABLE.insertBefore(this.THEAD, this.TBODY);\n }\n this.COLGROUP = this.TABLE.querySelector('colgroup');\n\n if (!this.COLGROUP) {\n this.COLGROUP = document.createElement('colgroup');\n this.TABLE.insertBefore(this.COLGROUP, this.THEAD);\n }\n\n if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {\n this.THEAD.appendChild(document.createElement('TR'));\n }\n }\n\n /**\n * @param table\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createSpreader',\n value: function createSpreader(table) {\n var parent = table.parentNode;\n var spreader = void 0;\n\n if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {\n spreader = document.createElement('div');\n spreader.className = 'wtSpreader';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(spreader, table);\n }\n spreader.appendChild(table);\n }\n spreader.style.position = 'relative';\n\n return spreader;\n }\n\n /**\n * @param spreader\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createHider',\n value: function createHider(spreader) {\n var parent = spreader.parentNode;\n var hider = void 0;\n\n if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {\n hider = document.createElement('div');\n hider.className = 'wtHider';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(hider, spreader);\n }\n hider.appendChild(spreader);\n }\n\n return hider;\n }\n\n /**\n *\n * @param hider\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createHolder',\n value: function createHolder(hider) {\n var parent = hider.parentNode;\n var holder = void 0;\n\n if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {\n holder = document.createElement('div');\n holder.style.position = 'relative';\n holder.className = 'wtHolder';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(holder, hider);\n }\n if (!this.isWorkingOnClone()) {\n holder.parentNode.className += 'ht_master handsontable';\n }\n holder.appendChild(hider);\n }\n\n return holder;\n }\n }, {\n key: 'alignOverlaysWithTrimmingContainer',\n value: function alignOverlaysWithTrimmingContainer() {\n var trimmingElement = (0, _element.getTrimmingContainer)(this.wtRootElement);\n\n if (!this.isWorkingOnClone()) {\n this.holder.parentNode.style.position = 'relative';\n\n if (trimmingElement === window) {\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (!preventOverflow) {\n this.holder.style.overflow = 'visible';\n this.wtRootElement.style.overflow = 'visible';\n }\n } else {\n this.holder.style.width = (0, _element.getStyle)(trimmingElement, 'width');\n this.holder.style.height = (0, _element.getStyle)(trimmingElement, 'height');\n this.holder.style.overflow = '';\n }\n }\n }\n }, {\n key: 'isWorkingOnClone',\n value: function isWorkingOnClone() {\n return !!this.wot.cloneSource;\n }\n\n /**\n * Redraws the table\n *\n * @param {Boolean} fastDraw If TRUE, will try to avoid full redraw and only update the border positions. If FALSE or UNDEFINED, will perform a full redraw\n * @returns {Table}\n */\n\n }, {\n key: 'draw',\n value: function draw(fastDraw) {\n var _wot = this.wot,\n wtOverlays = _wot.wtOverlays,\n wtViewport = _wot.wtViewport;\n\n var totalRows = this.instance.getSetting('totalRows');\n var rowHeaders = this.wot.getSetting('rowHeaders').length;\n var columnHeaders = this.wot.getSetting('columnHeaders').length;\n var syncScroll = false;\n\n if (!this.isWorkingOnClone()) {\n this.holderOffset = (0, _element.offset)(this.holder);\n fastDraw = wtViewport.createRenderCalculators(fastDraw);\n\n if (rowHeaders && !this.wot.getSetting('fixedColumnsLeft')) {\n var leftScrollPos = wtOverlays.leftOverlay.getScrollPosition();\n var previousState = this.correctHeaderWidth;\n\n this.correctHeaderWidth = leftScrollPos > 0;\n\n if (previousState !== this.correctHeaderWidth) {\n fastDraw = false;\n }\n }\n }\n\n if (!this.isWorkingOnClone()) {\n syncScroll = wtOverlays.prepareOverlays();\n }\n\n if (fastDraw) {\n if (!this.isWorkingOnClone()) {\n // in case we only scrolled without redraw, update visible rows information in oldRowsCalculator\n wtViewport.createVisibleCalculators();\n }\n if (wtOverlays) {\n wtOverlays.refresh(true);\n }\n } else {\n if (this.isWorkingOnClone()) {\n this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;\n } else {\n this.tableOffset = (0, _element.offset)(this.TABLE);\n }\n var startRow = void 0;\n\n if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_DEBUG) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP_LEFT_CORNER)) {\n startRow = 0;\n } else if (_base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n startRow = Math.max(totalRows - this.wot.getSetting('fixedRowsBottom'), 0);\n } else {\n startRow = wtViewport.rowsRenderCalculator.startRow;\n }\n var startColumn = void 0;\n\n if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_DEBUG) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_LEFT) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP_LEFT_CORNER) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n startColumn = 0;\n } else {\n startColumn = wtViewport.columnsRenderCalculator.startColumn;\n }\n this.rowFilter = new _row2.default(startRow, totalRows, columnHeaders);\n this.columnFilter = new _column2.default(startColumn, this.wot.getSetting('totalColumns'), rowHeaders);\n\n this.alignOverlaysWithTrimmingContainer();\n this._doDraw(); // creates calculator after draw\n }\n this.refreshSelections(fastDraw);\n\n if (!this.isWorkingOnClone()) {\n wtOverlays.topOverlay.resetFixedPosition();\n\n if (wtOverlays.bottomOverlay.clone) {\n wtOverlays.bottomOverlay.resetFixedPosition();\n }\n\n wtOverlays.leftOverlay.resetFixedPosition();\n\n if (wtOverlays.topLeftCornerOverlay) {\n wtOverlays.topLeftCornerOverlay.resetFixedPosition();\n }\n\n if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {\n wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();\n }\n }\n if (syncScroll) {\n wtOverlays.syncScrollWithMaster();\n }\n this.wot.drawn = true;\n\n return this;\n }\n }, {\n key: '_doDraw',\n value: function _doDraw() {\n var wtRenderer = new _tableRenderer2.default(this);\n\n wtRenderer.render();\n }\n }, {\n key: 'removeClassFromCells',\n value: function removeClassFromCells(className) {\n var nodes = this.TABLE.querySelectorAll('.' + className);\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n (0, _element.removeClass)(nodes[i], className);\n }\n }\n }, {\n key: 'refreshSelections',\n value: function refreshSelections(fastDraw) {\n if (!this.wot.selections) {\n return;\n }\n var len = this.wot.selections.length;\n\n if (fastDraw) {\n for (var i = 0; i < len; i++) {\n // there was no rerender, so we need to remove classNames by ourselves\n if (this.wot.selections[i].settings.className) {\n this.removeClassFromCells(this.wot.selections[i].settings.className);\n }\n if (this.wot.selections[i].settings.highlightHeaderClassName) {\n this.removeClassFromCells(this.wot.selections[i].settings.highlightHeaderClassName);\n }\n if (this.wot.selections[i].settings.highlightRowClassName) {\n this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName);\n }\n if (this.wot.selections[i].settings.highlightColumnClassName) {\n this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName);\n }\n }\n }\n for (var _i = 0; _i < len; _i++) {\n this.wot.selections[_i].draw(this.wot, fastDraw);\n }\n }\n\n /**\n * Get cell element at coords.\n *\n * @param {CellCoords} coords\n * @returns {HTMLElement|Number} HTMLElement on success or Number one of the exit codes on error:\n * -1 row before viewport\n * -2 row after viewport\n */\n\n }, {\n key: 'getCell',\n value: function getCell(coords) {\n if (this.isRowBeforeRenderedRows(coords.row)) {\n // row before rendered rows\n return -1;\n } else if (this.isRowAfterRenderedRows(coords.row)) {\n // row after rendered rows\n return -2;\n }\n\n var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)];\n\n if (TR) {\n return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)];\n }\n }\n\n /**\n * getColumnHeader\n *\n * @param {Number} col Column index\n * @param {Number} [level=0] Header level (0 = most distant to the table)\n * @returns {Object} HTMLElement on success or undefined on error\n */\n\n }, {\n key: 'getColumnHeader',\n value: function getColumnHeader(col) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var TR = this.THEAD.childNodes[level];\n\n if (TR) {\n return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];\n }\n }\n\n /**\n * getRowHeader\n *\n * @param {Number} row Row index\n * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table doesn't have row headers`\n */\n\n }, {\n key: 'getRowHeader',\n value: function getRowHeader(row) {\n if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {\n return null;\n }\n var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n\n if (TR) {\n return TR.childNodes[0];\n }\n }\n\n /**\n * Returns cell coords object for a given TD (or a child element of a TD element).\n *\n * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one).\n * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or null, if the provided element is not applicable.\n */\n\n }, {\n key: 'getCoords',\n value: function getCoords(TD) {\n if (TD.nodeName !== 'TD' && TD.nodeName !== 'TH') {\n TD = (0, _element.closest)(TD, ['TD', 'TH']);\n }\n\n if (TD === null) {\n return null;\n }\n\n var TR = TD.parentNode;\n var CONTAINER = TR.parentNode;\n var row = (0, _element.index)(TR);\n var col = TD.cellIndex;\n\n if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_TOP, TD)) {\n if (CONTAINER.nodeName === 'THEAD') {\n row -= CONTAINER.childNodes.length;\n }\n } else if (CONTAINER === this.THEAD) {\n row = this.rowFilter.visibleColHeadedRowToSourceRow(row);\n } else {\n row = this.rowFilter.renderedToSource(row);\n }\n\n if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_LEFT, TD)) {\n col = this.columnFilter.offsettedTH(col);\n } else {\n col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);\n }\n\n return new _coords2.default(row, col);\n }\n }, {\n key: 'getTrForRow',\n value: function getTrForRow(row) {\n return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n }\n }, {\n key: 'getFirstRenderedRow',\n value: function getFirstRenderedRow() {\n return this.wot.wtViewport.rowsRenderCalculator.startRow;\n }\n }, {\n key: 'getFirstVisibleRow',\n value: function getFirstVisibleRow() {\n return this.wot.wtViewport.rowsVisibleCalculator.startRow;\n }\n }, {\n key: 'getFirstRenderedColumn',\n value: function getFirstRenderedColumn() {\n return this.wot.wtViewport.columnsRenderCalculator.startColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no row is visible\n */\n\n }, {\n key: 'getFirstVisibleColumn',\n value: function getFirstVisibleColumn() {\n return this.wot.wtViewport.columnsVisibleCalculator.startColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no row is visible\n */\n\n }, {\n key: 'getLastRenderedRow',\n value: function getLastRenderedRow() {\n return this.wot.wtViewport.rowsRenderCalculator.endRow;\n }\n }, {\n key: 'getLastVisibleRow',\n value: function getLastVisibleRow() {\n return this.wot.wtViewport.rowsVisibleCalculator.endRow;\n }\n }, {\n key: 'getLastRenderedColumn',\n value: function getLastRenderedColumn() {\n return this.wot.wtViewport.columnsRenderCalculator.endColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no column is visible\n */\n\n }, {\n key: 'getLastVisibleColumn',\n value: function getLastVisibleColumn() {\n return this.wot.wtViewport.columnsVisibleCalculator.endColumn;\n }\n }, {\n key: 'isRowBeforeRenderedRows',\n value: function isRowBeforeRenderedRows(row) {\n return this.rowFilter && this.rowFilter.sourceToRendered(row) < 0 && row >= 0;\n }\n }, {\n key: 'isRowAfterViewport',\n value: function isRowAfterViewport(row) {\n return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow();\n }\n }, {\n key: 'isRowAfterRenderedRows',\n value: function isRowAfterRenderedRows(row) {\n return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow();\n }\n }, {\n key: 'isColumnBeforeViewport',\n value: function isColumnBeforeViewport(column) {\n return this.columnFilter && this.columnFilter.sourceToRendered(column) < 0 && column >= 0;\n }\n }, {\n key: 'isColumnAfterViewport',\n value: function isColumnAfterViewport(column) {\n return this.columnFilter && this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn();\n }\n }, {\n key: 'isLastRowFullyVisible',\n value: function isLastRowFullyVisible() {\n return this.getLastVisibleRow() === this.getLastRenderedRow();\n }\n }, {\n key: 'isLastColumnFullyVisible',\n value: function isLastColumnFullyVisible() {\n return this.getLastVisibleColumn() === this.getLastRenderedColumn();\n }\n }, {\n key: 'getRenderedColumnsCount',\n value: function getRenderedColumnsCount() {\n var columnsCount = this.wot.wtViewport.columnsRenderCalculator.count;\n var totalColumns = this.wot.getSetting('totalColumns');\n\n if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {\n columnsCount = totalColumns;\n } else if (this.wot.isOverlayName(_base2.default.CLONE_LEFT) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);\n }\n\n return columnsCount;\n }\n }, {\n key: 'getRenderedRowsCount',\n value: function getRenderedRowsCount() {\n var rowsCount = this.wot.wtViewport.rowsRenderCalculator.count;\n var totalRows = this.wot.getSetting('totalRows');\n\n if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {\n rowsCount = totalRows;\n } else if (this.wot.isOverlayName(_base2.default.CLONE_TOP) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER)) {\n rowsCount = Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);\n } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n rowsCount = Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);\n }\n\n return rowsCount;\n }\n }, {\n key: 'getVisibleRowsCount',\n value: function getVisibleRowsCount() {\n return this.wot.wtViewport.rowsVisibleCalculator.count;\n }\n }, {\n key: 'allRowsInViewport',\n value: function allRowsInViewport() {\n return this.wot.getSetting('totalRows') == this.getVisibleRowsCount();\n }\n\n /**\n * Checks if any of the row's cells content exceeds its initial height, and if so, returns the oversized height\n *\n * @param {Number} sourceRow\n * @returns {Number}\n */\n\n }, {\n key: 'getRowHeight',\n value: function getRowHeight(sourceRow) {\n var height = this.wot.wtSettings.settings.rowHeight(sourceRow);\n var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow];\n\n if (oversizedHeight !== void 0) {\n height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);\n }\n\n return height;\n }\n }, {\n key: 'getColumnHeaderHeight',\n value: function getColumnHeaderHeight(level) {\n var height = this.wot.wtSettings.settings.defaultRowHeight;\n var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];\n\n if (oversizedHeight !== void 0) {\n height = height ? Math.max(height, oversizedHeight) : oversizedHeight;\n }\n\n return height;\n }\n }, {\n key: 'getVisibleColumnsCount',\n value: function getVisibleColumnsCount() {\n return this.wot.wtViewport.columnsVisibleCalculator.count;\n }\n }, {\n key: 'allColumnsInViewport',\n value: function allColumnsInViewport() {\n return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount();\n }\n }, {\n key: 'getColumnWidth',\n value: function getColumnWidth(sourceColumn) {\n var width = this.wot.wtSettings.settings.columnWidth;\n\n if (typeof width === 'function') {\n width = width(sourceColumn);\n } else if ((typeof width === 'undefined' ? 'undefined' : _typeof(width)) === 'object') {\n width = width[sourceColumn];\n }\n\n return width || this.wot.wtSettings.settings.defaultColumnWidth;\n }\n }, {\n key: 'getStretchedColumnWidth',\n value: function getStretchedColumnWidth(sourceColumn) {\n var columnWidth = this.getColumnWidth(sourceColumn);\n var width = columnWidth == null ? this.instance.wtSettings.settings.defaultColumnWidth : columnWidth;\n var calculator = this.wot.wtViewport.columnsRenderCalculator;\n\n if (calculator) {\n var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width);\n\n if (stretchedWidth) {\n width = stretchedWidth;\n }\n }\n\n return width;\n }\n\n /**\n * Modify row header widths provided by user in class contructor.\n *\n * @private\n */\n\n }, {\n key: '_modifyRowHeaderWidth',\n value: function _modifyRowHeaderWidth(rowHeaderWidthFactory) {\n var widths = (0, _function.isFunction)(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;\n\n if (Array.isArray(widths)) {\n widths = [].concat(_toConsumableArray(widths));\n widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);\n } else {\n widths = this._correctRowHeaderWidth(widths);\n }\n\n return widths;\n }\n\n /**\n * Correct row header width if necessary.\n *\n * @private\n */\n\n }, {\n key: '_correctRowHeaderWidth',\n value: function _correctRowHeaderWidth(width) {\n if (typeof width !== 'number') {\n width = this.wot.getSetting('defaultColumnWidth');\n }\n if (this.correctHeaderWidth) {\n width++;\n }\n\n return width;\n }\n }]);\n\n return Table;\n}();\n\nexports.default = Table;\n\n/***/ }),\n/* 145 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar performanceWarningAppeared = false;\n\n/**\n * @class TableRenderer\n */\n\nvar TableRenderer = function () {\n /**\n * @param {WalkontableTable} wtTable\n */\n function TableRenderer(wtTable) {\n _classCallCheck(this, TableRenderer);\n\n this.wtTable = wtTable;\n this.wot = wtTable.instance;\n\n // legacy support\n this.instance = wtTable.instance;\n\n this.rowFilter = wtTable.rowFilter;\n this.columnFilter = wtTable.columnFilter;\n\n this.TABLE = wtTable.TABLE;\n this.THEAD = wtTable.THEAD;\n this.TBODY = wtTable.TBODY;\n this.COLGROUP = wtTable.COLGROUP;\n\n this.rowHeaders = [];\n this.rowHeaderCount = 0;\n this.columnHeaders = [];\n this.columnHeaderCount = 0;\n this.fixedRowsTop = 0;\n this.fixedRowsBottom = 0;\n }\n\n /**\n *\n */\n\n\n _createClass(TableRenderer, [{\n key: 'render',\n value: function render() {\n if (!this.wtTable.isWorkingOnClone()) {\n var skipRender = {};\n this.wot.getSetting('beforeDraw', true, skipRender);\n\n if (skipRender.skipRender === true) {\n return;\n }\n }\n\n this.rowHeaders = this.wot.getSetting('rowHeaders');\n this.rowHeaderCount = this.rowHeaders.length;\n this.fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n this.columnHeaders = this.wot.getSetting('columnHeaders');\n this.columnHeaderCount = this.columnHeaders.length;\n\n var columnsToRender = this.wtTable.getRenderedColumnsCount();\n var rowsToRender = this.wtTable.getRenderedRowsCount();\n var totalColumns = this.wot.getSetting('totalColumns');\n var totalRows = this.wot.getSetting('totalRows');\n var workspaceWidth = void 0;\n var adjusted = false;\n\n if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n\n // do NOT render headers on the bottom or bottom-left corner overlay\n this.columnHeaders = [];\n this.columnHeaderCount = 0;\n }\n\n if (totalColumns >= 0) {\n // prepare COL and TH elements for rendering\n this.adjustAvailableNodes();\n adjusted = true;\n\n // adjust column widths according to user widths settings\n this.renderColumnHeaders();\n\n // Render table rows\n this.renderRows(totalRows, rowsToRender, columnsToRender);\n\n if (!this.wtTable.isWorkingOnClone()) {\n workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();\n this.wot.wtViewport.containerWidth = null;\n }\n\n this.adjustColumnWidths(columnsToRender);\n this.markOversizedColumnHeaders();\n this.adjustColumnHeaderHeights();\n }\n\n if (!adjusted) {\n this.adjustAvailableNodes();\n }\n this.removeRedundantRows(rowsToRender);\n\n if (!this.wtTable.isWorkingOnClone() || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {\n this.markOversizedRows();\n }\n if (!this.wtTable.isWorkingOnClone()) {\n this.wot.wtViewport.createVisibleCalculators();\n this.wot.wtOverlays.refresh(false);\n\n this.wot.wtOverlays.applyToDOM();\n\n var hiderWidth = (0, _element.outerWidth)(this.wtTable.hider);\n var tableWidth = (0, _element.outerWidth)(this.wtTable.TABLE);\n\n if (hiderWidth !== 0 && tableWidth !== hiderWidth) {\n // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.\n this.adjustColumnWidths(columnsToRender);\n }\n\n if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {\n // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching\n this.wot.wtViewport.containerWidth = null;\n\n var firstRendered = this.wtTable.getFirstRenderedColumn();\n var lastRendered = this.wtTable.getLastRenderedColumn();\n var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');\n var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');\n\n rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting != null) {\n for (var i = 0; i < this.rowHeaderCount; i++) {\n var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;\n\n width = width == null ? defaultColumnWidth : width;\n\n this.COLGROUP.childNodes[i].style.width = width + 'px';\n }\n }\n\n for (var _i = firstRendered; _i < lastRendered; _i++) {\n var _width = this.wtTable.getStretchedColumnWidth(_i);\n var renderedIndex = this.columnFilter.sourceToRendered(_i);\n\n this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = _width + 'px';\n }\n }\n\n this.wot.getSetting('onDraw', true);\n } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {\n this.wot.cloneSource.wtOverlays.adjustElementsSize();\n }\n }\n\n /**\n * @param {Number} renderedRowsCount\n */\n\n }, {\n key: 'removeRedundantRows',\n value: function removeRedundantRows(renderedRowsCount) {\n while (this.wtTable.tbodyChildrenLength > renderedRowsCount) {\n this.TBODY.removeChild(this.TBODY.lastChild);\n this.wtTable.tbodyChildrenLength--;\n }\n }\n\n /**\n * @param {Number} totalRows\n * @param {Number} rowsToRender\n * @param {Number} columnsToRender\n */\n\n }, {\n key: 'renderRows',\n value: function renderRows(totalRows, rowsToRender, columnsToRender) {\n var lastTD = void 0,\n TR = void 0;\n var visibleRowIndex = 0;\n var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);\n var isWorkingOnClone = this.wtTable.isWorkingOnClone();\n\n while (sourceRowIndex < totalRows && sourceRowIndex >= 0) {\n if (!performanceWarningAppeared && visibleRowIndex > 1000) {\n performanceWarningAppeared = true;\n console.warn('Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting the number ' + 'of rendered rows by specifying the table height and/or turning off the \"renderAllRows\" option.');\n }\n if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) {\n // We have as much rows as needed for this clone\n break;\n }\n TR = this.getOrCreateTrForRow(visibleRowIndex, TR);\n\n // Render row headers\n this.renderRowHeaders(sourceRowIndex, TR);\n // Add and/or remove TDs to TR to match the desired number\n this.adjustColumns(TR, columnsToRender + this.rowHeaderCount);\n\n lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender);\n\n if (!isWorkingOnClone ||\n // Necessary to refresh oversized row heights after editing cell in overlays\n this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {\n // Reset the oversized row cache for this row\n this.resetOversizedRow(sourceRowIndex);\n }\n\n if (TR.firstChild) {\n // if I have 2 fixed columns with one-line content and the 3rd column has a multiline content, this is\n // the way to make sure that the overlay will has same row height\n var height = this.wot.wtTable.getRowHeight(sourceRowIndex);\n\n if (height) {\n // Decrease height. 1 pixel will be \"replaced\" by 1px border top\n height--;\n TR.firstChild.style.height = height + 'px';\n } else {\n TR.firstChild.style.height = '';\n }\n }\n visibleRowIndex++;\n sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);\n }\n }\n\n /**\n * Reset the oversized row cache for the provided index\n *\n * @param {Number} sourceRow Row index\n */\n\n }, {\n key: 'resetOversizedRow',\n value: function resetOversizedRow(sourceRow) {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) {\n this.wot.wtViewport.oversizedRows[sourceRow] = void 0;\n }\n }\n\n /**\n * Check if any of the rendered rows is higher than expected, and if so, cache them\n */\n\n }, {\n key: 'markOversizedRows',\n value: function markOversizedRows() {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n var rowCount = this.instance.wtTable.TBODY.childNodes.length;\n var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight;\n var actualTableHeight = (0, _element.innerHeight)(this.instance.wtTable.TBODY) - 1;\n var previousRowHeight = void 0;\n var rowInnerHeight = void 0;\n var sourceRowIndex = void 0;\n var currentTr = void 0;\n var rowHeader = void 0;\n var totalRows = this.instance.getSetting('totalRows');\n\n if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) {\n // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them\n return;\n }\n\n while (rowCount) {\n rowCount--;\n sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount);\n previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex);\n currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex);\n rowHeader = currentTr.querySelector('th');\n\n if (rowHeader) {\n rowInnerHeight = (0, _element.innerHeight)(rowHeader);\n } else {\n rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;\n }\n\n if (!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight) {\n this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight;\n }\n }\n }\n\n /**\n * Check if any of the rendered columns is higher than expected, and if so, cache them.\n */\n\n }, {\n key: 'markOversizedColumnHeaders',\n value: function markOversizedColumnHeaders() {\n var overlayName = this.wot.getOverlayName();\n\n if (!this.columnHeaderCount || this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] || this.wtTable.isWorkingOnClone()) {\n return;\n }\n var columnCount = this.wtTable.getRenderedColumnsCount();\n\n for (var i = 0; i < this.columnHeaderCount; i++) {\n for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n this.markIfOversizedColumnHeader(renderedColumnIndex);\n }\n }\n this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] = true;\n }\n\n /**\n *\n */\n\n }, {\n key: 'adjustColumnHeaderHeights',\n value: function adjustColumnHeaderHeights() {\n var columnHeaders = this.wot.getSetting('columnHeaders');\n var children = this.wot.wtTable.THEAD.childNodes;\n var oversizedColumnHeaders = this.wot.wtViewport.oversizedColumnHeaders;\n\n for (var i = 0, len = columnHeaders.length; i < len; i++) {\n if (oversizedColumnHeaders[i]) {\n if (!children[i] || children[i].childNodes.length === 0) {\n return;\n }\n children[i].childNodes[0].style.height = oversizedColumnHeaders[i] + 'px';\n }\n }\n }\n\n /**\n * Check if column header for the specified column is higher than expected, and if so, cache it\n *\n * @param {Number} col Index of column\n */\n\n }, {\n key: 'markIfOversizedColumnHeader',\n value: function markIfOversizedColumnHeader(col) {\n var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);\n var level = this.columnHeaderCount;\n var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n var previousColHeaderHeight = void 0;\n var currentHeader = void 0;\n var currentHeaderHeight = void 0;\n var columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];\n\n while (level) {\n level--;\n\n previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);\n currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);\n\n if (!currentHeader) {\n /* eslint-disable no-continue */\n continue;\n }\n currentHeaderHeight = (0, _element.innerHeight)(currentHeader);\n\n if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;\n }\n\n if (Array.isArray(columnHeaderHeightSetting)) {\n if (columnHeaderHeightSetting[level] != null) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];\n }\n } else if (!isNaN(columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;\n }\n\n if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level] || columnHeaderHeightSetting;\n }\n }\n }\n\n /**\n * @param {Number} sourceRowIndex\n * @param {HTMLTableRowElement} TR\n * @param {Number} columnsToRender\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'renderCells',\n value: function renderCells(sourceRowIndex, TR, columnsToRender) {\n var TD = void 0;\n var sourceColIndex = void 0;\n\n for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) {\n sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex);\n\n if (visibleColIndex === 0) {\n TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)];\n } else {\n TD = TD.nextSibling; // http://jsperf.com/nextsibling-vs-indexed-childnodes\n }\n // If the number of headers has been reduced, we need to replace excess TH with TD\n if (TD.nodeName == 'TH') {\n TD = replaceThWithTd(TD, TR);\n }\n if (!(0, _element.hasClass)(TD, 'hide')) {\n TD.className = '';\n }\n TD.removeAttribute('style');\n this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD);\n }\n\n return TD;\n }\n\n /**\n * @param {Number} columnsToRender Number of columns to render.\n */\n\n }, {\n key: 'adjustColumnWidths',\n value: function adjustColumnWidths(columnsToRender) {\n var scrollbarCompensation = 0;\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');\n var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');\n\n if (mainHolder.offsetHeight < mainHolder.scrollHeight) {\n scrollbarCompensation = (0, _element.getScrollbarWidth)();\n }\n this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation);\n\n rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting != null) {\n for (var i = 0; i < this.rowHeaderCount; i++) {\n var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;\n\n width = width == null ? defaultColumnWidth : width;\n\n this.COLGROUP.childNodes[i].style.width = width + 'px';\n }\n }\n\n for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) {\n var _width2 = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex));\n\n this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = _width2 + 'px';\n }\n }\n\n /**\n * @param {HTMLTableCellElement} TR\n */\n\n }, {\n key: 'appendToTbody',\n value: function appendToTbody(TR) {\n this.TBODY.appendChild(TR);\n this.wtTable.tbodyChildrenLength++;\n }\n\n /**\n * @param {Number} rowIndex\n * @param {HTMLTableRowElement} currentTr\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'getOrCreateTrForRow',\n value: function getOrCreateTrForRow(rowIndex, currentTr) {\n var TR = void 0;\n\n if (rowIndex >= this.wtTable.tbodyChildrenLength) {\n TR = this.createRow();\n this.appendToTbody(TR);\n } else if (rowIndex === 0) {\n TR = this.TBODY.firstChild;\n } else {\n // http://jsperf.com/nextsibling-vs-indexed-childnodes\n TR = currentTr.nextSibling;\n }\n if (TR.className) {\n TR.removeAttribute('class');\n }\n\n return TR;\n }\n\n /**\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'createRow',\n value: function createRow() {\n var TR = document.createElement('TR');\n\n for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {\n TR.appendChild(document.createElement('TH'));\n }\n\n return TR;\n }\n\n /**\n * @param {Number} row\n * @param {Number} col\n * @param {HTMLTableCellElement} TH\n */\n\n }, {\n key: 'renderRowHeader',\n value: function renderRowHeader(row, col, TH) {\n TH.className = '';\n TH.removeAttribute('style');\n this.rowHeaders[col](row, TH, col);\n }\n\n /**\n * @param {Number} row\n * @param {HTMLTableCellElement} TR\n */\n\n }, {\n key: 'renderRowHeaders',\n value: function renderRowHeaders(row, TR) {\n for (var TH = TR.firstChild, visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {\n // If the number of row headers increased we need to create TH or replace an existing TD node with TH\n if (!TH) {\n TH = document.createElement('TH');\n TR.appendChild(TH);\n } else if (TH.nodeName == 'TD') {\n TH = replaceTdWithTh(TH, TR);\n }\n this.renderRowHeader(row, visibleColIndex, TH);\n // http://jsperf.com/nextsibling-vs-indexed-childnodes\n TH = TH.nextSibling;\n }\n }\n\n /**\n * Adjust the number of COL and TH elements to match the number of columns and headers that need to be rendered\n */\n\n }, {\n key: 'adjustAvailableNodes',\n value: function adjustAvailableNodes() {\n this.adjustColGroups();\n this.adjustThead();\n }\n\n /**\n * Renders the column headers\n */\n\n }, {\n key: 'renderColumnHeaders',\n value: function renderColumnHeaders() {\n if (!this.columnHeaderCount) {\n return;\n }\n var columnCount = this.wtTable.getRenderedColumnsCount();\n\n for (var i = 0; i < this.columnHeaderCount; i++) {\n var TR = this.getTrForColumnHeaders(i);\n\n for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex);\n\n this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]);\n }\n }\n }\n\n /**\n * Adjusts the number of COL elements to match the number of columns that need to be rendered\n */\n\n }, {\n key: 'adjustColGroups',\n value: function adjustColGroups() {\n var columnCount = this.wtTable.getRenderedColumnsCount();\n\n while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) {\n this.COLGROUP.appendChild(document.createElement('COL'));\n this.wtTable.colgroupChildrenLength++;\n }\n while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) {\n this.COLGROUP.removeChild(this.COLGROUP.lastChild);\n this.wtTable.colgroupChildrenLength--;\n }\n if (this.rowHeaderCount) {\n (0, _element.addClass)(this.COLGROUP.childNodes[0], 'rowHeader');\n }\n }\n\n /**\n * Adjusts the number of TH elements in THEAD to match the number of headers and columns that need to be rendered\n */\n\n }, {\n key: 'adjustThead',\n value: function adjustThead() {\n var columnCount = this.wtTable.getRenderedColumnsCount();\n var TR = this.THEAD.firstChild;\n\n if (this.columnHeaders.length) {\n for (var i = 0, len = this.columnHeaders.length; i < len; i++) {\n TR = this.THEAD.childNodes[i];\n\n if (!TR) {\n TR = document.createElement('TR');\n this.THEAD.appendChild(TR);\n }\n this.theadChildrenLength = TR.childNodes.length;\n\n while (this.theadChildrenLength < columnCount + this.rowHeaderCount) {\n TR.appendChild(document.createElement('TH'));\n this.theadChildrenLength++;\n }\n while (this.theadChildrenLength > columnCount + this.rowHeaderCount) {\n TR.removeChild(TR.lastChild);\n this.theadChildrenLength--;\n }\n }\n var theadChildrenLength = this.THEAD.childNodes.length;\n\n if (theadChildrenLength > this.columnHeaders.length) {\n for (var _i2 = this.columnHeaders.length; _i2 < theadChildrenLength; _i2++) {\n this.THEAD.removeChild(this.THEAD.lastChild);\n }\n }\n } else if (TR) {\n (0, _element.empty)(TR);\n }\n }\n\n /**\n * @param {Number} index\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'getTrForColumnHeaders',\n value: function getTrForColumnHeaders(index) {\n return this.THEAD.childNodes[index];\n }\n\n /**\n * @param {Number} row\n * @param {Number} col\n * @param {HTMLTableCellElement} TH\n * @returns {*}\n */\n\n }, {\n key: 'renderColumnHeader',\n value: function renderColumnHeader(row, col, TH) {\n TH.className = '';\n TH.removeAttribute('style');\n\n return this.columnHeaders[row](col, TH, row);\n }\n\n /**\n * Add and/or remove the TDs to match the desired number\n *\n * @param {HTMLTableCellElement} TR Table row in question\n * @param {Number} desiredCount The desired number of TDs in the TR\n */\n\n }, {\n key: 'adjustColumns',\n value: function adjustColumns(TR, desiredCount) {\n var count = TR.childNodes.length;\n\n while (count < desiredCount) {\n var TD = document.createElement('TD');\n\n TR.appendChild(TD);\n count++;\n }\n while (count > desiredCount) {\n TR.removeChild(TR.lastChild);\n count--;\n }\n }\n\n /**\n * @param {Number} columnsToRender\n */\n\n }, {\n key: 'removeRedundantColumns',\n value: function removeRedundantColumns(columnsToRender) {\n while (this.wtTable.tbodyChildrenLength > columnsToRender) {\n this.TBODY.removeChild(this.TBODY.lastChild);\n this.wtTable.tbodyChildrenLength--;\n }\n }\n }]);\n\n return TableRenderer;\n}();\n\nfunction replaceTdWithTh(TD, TR) {\n var TH = document.createElement('TH');\n\n TR.insertBefore(TH, TD);\n TR.removeChild(TD);\n\n return TH;\n}\n\nfunction replaceThWithTd(TH, TR) {\n var TD = document.createElement('TD');\n\n TR.insertBefore(TD, TH);\n TR.removeChild(TH);\n\n return TD;\n}\n\nexports.default = TableRenderer;\n\n/***/ }),\n/* 146 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _viewportColumns = __webpack_require__(135);\n\nvar _viewportColumns2 = _interopRequireDefault(_viewportColumns);\n\nvar _viewportRows = __webpack_require__(136);\n\nvar _viewportRows2 = _interopRequireDefault(_viewportRows);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Viewport\n */\nvar Viewport = function () {\n /**\n * @param wotInstance\n */\n function Viewport(wotInstance) {\n var _this = this;\n\n _classCallCheck(this, Viewport);\n\n this.wot = wotInstance;\n // legacy support\n this.instance = this.wot;\n\n this.oversizedRows = [];\n this.oversizedColumnHeaders = [];\n this.hasOversizedColumnHeadersMarked = {};\n this.clientHeight = 0;\n this.containerWidth = NaN;\n this.rowHeaderWidth = NaN;\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n\n this.eventManager = new _eventManager2.default(this.wot);\n this.eventManager.addEventListener(window, 'resize', function () {\n _this.clientHeight = _this.getWorkspaceHeight();\n });\n }\n\n /**\n * @returns {number}\n */\n\n\n _createClass(Viewport, [{\n key: 'getWorkspaceHeight',\n value: function getWorkspaceHeight() {\n var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;\n var elemHeight = void 0;\n var height = 0;\n\n if (trimmingContainer === window) {\n height = document.documentElement.clientHeight;\n } else {\n elemHeight = (0, _element.outerHeight)(trimmingContainer);\n // returns height without DIV scrollbar\n height = elemHeight > 0 && trimmingContainer.clientHeight > 0 ? trimmingContainer.clientHeight : Infinity;\n }\n\n return height;\n }\n }, {\n key: 'getWorkspaceWidth',\n value: function getWorkspaceWidth() {\n var width = void 0;\n var totalColumns = this.wot.getSetting('totalColumns');\n var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;\n var overflow = void 0;\n var stretchSetting = this.wot.getSetting('stretchH');\n var docOffsetWidth = document.documentElement.offsetWidth;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow) {\n return (0, _element.outerWidth)(this.instance.wtTable.wtRootElement);\n }\n\n if (this.wot.getSetting('freezeOverlays')) {\n width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n } else {\n width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n }\n\n if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {\n // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window\n // otherwise continue below, which will allow stretching\n // this is used in `scroll_window.html`\n // TODO test me\n return document.documentElement.clientWidth;\n }\n\n if (trimmingContainer !== window) {\n overflow = (0, _element.getStyle)(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow');\n\n if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') {\n // this is used in `scroll.html`\n // TODO test me\n return Math.max(width, trimmingContainer.clientWidth);\n }\n }\n\n if (stretchSetting === 'none' || !stretchSetting) {\n // if no stretching is used, return the maximum used workspace width\n return Math.max(width, (0, _element.outerWidth)(this.instance.wtTable.TABLE));\n }\n // if stretching is used, return the actual container width, so the columns can fit inside it\n return width;\n }\n\n /**\n * Checks if viewport has vertical scroll\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasVerticalScroll',\n value: function hasVerticalScroll() {\n return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();\n }\n\n /**\n * Checks if viewport has horizontal scroll\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasHorizontalScroll',\n value: function hasHorizontalScroll() {\n return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();\n }\n\n /**\n * @param from\n * @param length\n * @returns {Number}\n */\n\n }, {\n key: 'sumColumnWidths',\n value: function sumColumnWidths(from, length) {\n var sum = 0;\n\n while (from < length) {\n sum += this.wot.wtTable.getColumnWidth(from);\n from++;\n }\n\n return sum;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getContainerFillWidth',\n value: function getContainerFillWidth() {\n if (this.containerWidth) {\n return this.containerWidth;\n }\n var mainContainer = this.instance.wtTable.holder;\n var fillWidth = void 0;\n var dummyElement = void 0;\n\n dummyElement = document.createElement('div');\n dummyElement.style.width = '100%';\n dummyElement.style.height = '1px';\n mainContainer.appendChild(dummyElement);\n fillWidth = dummyElement.offsetWidth;\n\n this.containerWidth = fillWidth;\n mainContainer.removeChild(dummyElement);\n\n return fillWidth;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getWorkspaceOffset',\n value: function getWorkspaceOffset() {\n return (0, _element.offset)(this.wot.wtTable.TABLE);\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getWorkspaceActualHeight',\n value: function getWorkspaceActualHeight() {\n return (0, _element.outerHeight)(this.wot.wtTable.TABLE);\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getWorkspaceActualWidth',\n value: function getWorkspaceActualWidth() {\n return (0, _element.outerWidth)(this.wot.wtTable.TABLE) || (0, _element.outerWidth)(this.wot.wtTable.TBODY) || (0, _element.outerWidth)(this.wot.wtTable.THEAD); // IE8 reports 0 as <table> offsetWidth;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getColumnHeaderHeight',\n value: function getColumnHeaderHeight() {\n if (isNaN(this.columnHeaderHeight)) {\n this.columnHeaderHeight = (0, _element.outerHeight)(this.wot.wtTable.THEAD);\n }\n\n return this.columnHeaderHeight;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getViewportHeight',\n value: function getViewportHeight() {\n var containerHeight = this.getWorkspaceHeight();\n var columnHeaderHeight = void 0;\n\n if (containerHeight === Infinity) {\n return containerHeight;\n }\n columnHeaderHeight = this.getColumnHeaderHeight();\n\n if (columnHeaderHeight > 0) {\n containerHeight -= columnHeaderHeight;\n }\n\n return containerHeight;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getRowHeaderWidth',\n value: function getRowHeaderWidth() {\n var rowHeadersHeightSetting = this.instance.getSetting('rowHeaderWidth');\n var rowHeaders = this.instance.getSetting('rowHeaders');\n\n if (rowHeadersHeightSetting) {\n this.rowHeaderWidth = 0;\n\n for (var i = 0, len = rowHeaders.length; i < len; i++) {\n this.rowHeaderWidth += rowHeadersHeightSetting[i] || rowHeadersHeightSetting;\n }\n }\n\n if (this.wot.cloneSource) {\n return this.wot.cloneSource.wtViewport.getRowHeaderWidth();\n }\n\n if (isNaN(this.rowHeaderWidth)) {\n\n if (rowHeaders.length) {\n var TH = this.instance.wtTable.TABLE.querySelector('TH');\n this.rowHeaderWidth = 0;\n\n for (var _i = 0, _len = rowHeaders.length; _i < _len; _i++) {\n if (TH) {\n this.rowHeaderWidth += (0, _element.outerWidth)(TH);\n TH = TH.nextSibling;\n } else {\n // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.\n // TODO: proper fix\n this.rowHeaderWidth += 50;\n }\n }\n } else {\n this.rowHeaderWidth = 0;\n }\n }\n\n this.rowHeaderWidth = this.instance.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;\n\n return this.rowHeaderWidth;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getViewportWidth',\n value: function getViewportWidth() {\n var containerWidth = this.getWorkspaceWidth();\n var rowHeaderWidth = void 0;\n\n if (containerWidth === Infinity) {\n return containerWidth;\n }\n rowHeaderWidth = this.getRowHeaderWidth();\n\n if (rowHeaderWidth > 0) {\n return containerWidth - rowHeaderWidth;\n }\n\n return containerWidth;\n }\n\n /**\n * Creates:\n * - rowsRenderCalculator (before draw, to qualify rows for rendering)\n * - rowsVisibleCalculator (after draw, to measure which rows are actually visible)\n *\n * @returns {ViewportRowsCalculator}\n */\n\n }, {\n key: 'createRowsCalculator',\n value: function createRowsCalculator() {\n var _this2 = this;\n\n var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var height = void 0;\n var pos = void 0;\n var fixedRowsTop = void 0;\n var scrollbarHeight = void 0;\n var fixedRowsBottom = void 0;\n var fixedRowsHeight = void 0;\n var totalRows = void 0;\n\n this.rowHeaderWidth = NaN;\n\n if (this.wot.wtSettings.settings.renderAllRows) {\n height = Infinity;\n } else {\n height = this.getViewportHeight();\n }\n pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n totalRows = this.wot.getSetting('totalRows');\n\n if (fixedRowsTop) {\n fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);\n pos += fixedRowsHeight;\n height -= fixedRowsHeight;\n }\n\n if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) {\n fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n\n height -= fixedRowsHeight;\n }\n\n if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) {\n scrollbarHeight = 0;\n } else {\n scrollbarHeight = (0, _element.getScrollbarWidth)();\n }\n\n return new _viewportRows2.default(height, pos, this.wot.getSetting('totalRows'), function (sourceRow) {\n return _this2.wot.wtTable.getRowHeight(sourceRow);\n }, visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight);\n }\n\n /**\n * Creates:\n * - columnsRenderCalculator (before draw, to qualify columns for rendering)\n * - columnsVisibleCalculator (after draw, to measure which columns are actually visible)\n *\n * @returns {ViewportRowsCalculator}\n */\n\n }, {\n key: 'createColumnsCalculator',\n value: function createColumnsCalculator() {\n var _this3 = this;\n\n var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var width = this.getViewportWidth();\n var pos = void 0;\n var fixedColumnsLeft = void 0;\n\n this.columnHeaderHeight = NaN;\n\n pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n\n if (fixedColumnsLeft) {\n var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);\n pos += fixedColumnsWidth;\n width -= fixedColumnsWidth;\n }\n if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) {\n width -= (0, _element.getScrollbarWidth)();\n }\n\n return new _viewportColumns2.default(width, pos, this.wot.getSetting('totalColumns'), function (sourceCol) {\n return _this3.wot.wtTable.getColumnWidth(sourceCol);\n }, visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH'), function (stretchedWidth, column) {\n return _this3.wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);\n });\n }\n\n /**\n * Creates rowsRenderCalculator and columnsRenderCalculator (before draw, to determine what rows and\n * cols should be rendered)\n *\n * @param fastDraw {Boolean} If `true`, will try to avoid full redraw and only update the border positions.\n * If `false` or `undefined`, will perform a full redraw\n * @returns fastDraw {Boolean} The fastDraw value, possibly modified\n */\n\n }, {\n key: 'createRenderCalculators',\n value: function createRenderCalculators() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (fastDraw) {\n var proposedRowsVisibleCalculator = this.createRowsCalculator(true);\n var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true);\n\n if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {\n fastDraw = false;\n }\n }\n\n if (!fastDraw) {\n this.rowsRenderCalculator = this.createRowsCalculator();\n this.columnsRenderCalculator = this.createColumnsCalculator();\n }\n // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n\n return fastDraw;\n }\n\n /**\n * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are\n * the actually visible rows and columns)\n */\n\n }, {\n key: 'createVisibleCalculators',\n value: function createVisibleCalculators() {\n this.rowsVisibleCalculator = this.createRowsCalculator(true);\n this.columnsVisibleCalculator = this.createColumnsCalculator(true);\n }\n\n /**\n * Returns information whether proposedRowsVisibleCalculator viewport\n * is contained inside rows rendered in previous draw (cached in rowsRenderCalculator)\n *\n * @param {Object} proposedRowsVisibleCalculator\n * @returns {Boolean} Returns `true` if all proposed visible rows are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible row is not already rendered (meaning: redraw is needed)\n */\n\n }, {\n key: 'areAllProposedVisibleRowsAlreadyRendered',\n value: function areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) {\n if (this.rowsVisibleCalculator) {\n if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0) {\n return false;\n } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1) {\n return false;\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * Returns information whether proposedColumnsVisibleCalculator viewport\n * is contained inside column rendered in previous draw (cached in columnsRenderCalculator)\n *\n * @param {Object} proposedColumnsVisibleCalculator\n * @returns {Boolean} Returns `true` if all proposed visible columns are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible column is not already rendered (meaning: redraw is needed)\n */\n\n }, {\n key: 'areAllProposedVisibleColumnsAlreadyRendered',\n value: function areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator) {\n if (this.columnsVisibleCalculator) {\n if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0) {\n return false;\n } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1) {\n return false;\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * Resets values in keys of the hasOversizedColumnHeadersMarked object after updateSettings.\n */\n\n }, {\n key: 'resetHasOversizedColumnHeadersMarked',\n value: function resetHasOversizedColumnHeadersMarked() {\n (0, _object.objectEach)(this.hasOversizedColumnHeadersMarked, function (value, key, object) {\n object[key] = void 0;\n });\n }\n }]);\n\n return Viewport;\n}();\n\nexports.default = Viewport;\n\n/***/ }),\n/* 147 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _unicode = __webpack_require__(16);\n\nvar _mixed = __webpack_require__(20);\n\nvar _string = __webpack_require__(27);\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _handsontableEditor = __webpack_require__(148);\n\nvar _handsontableEditor2 = _interopRequireDefault(_handsontableEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AutocompleteEditor = _handsontableEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor AutocompleteEditor\n * @class AutocompleteEditor\n * @dependencies HandsontableEditor\n */\nAutocompleteEditor.prototype.init = function () {\n _handsontableEditor2.default.prototype.init.apply(this, arguments);\n this.query = null;\n this.strippedChoices = [];\n this.rawChoices = [];\n};\n\nAutocompleteEditor.prototype.getValue = function () {\n var _this2 = this;\n\n var selectedValue = this.rawChoices.find(function (value) {\n var strippedValue = _this2.stripValueIfNeeded(value);\n\n return strippedValue === _this2.TEXTAREA.value;\n });\n\n if ((0, _mixed.isDefined)(selectedValue)) {\n return selectedValue;\n }\n\n return this.TEXTAREA.value;\n};\n\nAutocompleteEditor.prototype.createElements = function () {\n _handsontableEditor2.default.prototype.createElements.apply(this, arguments);\n\n (0, _element.addClass)(this.htContainer, 'autocompleteEditor');\n (0, _element.addClass)(this.htContainer, window.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');\n};\n\nvar skipOne = false;\nfunction onBeforeKeyDown(event) {\n skipOne = false;\n var editor = this.getActiveEditor();\n\n if ((0, _unicode.isPrintableChar)(event.keyCode) || event.keyCode === _unicode.KEY_CODES.BACKSPACE || event.keyCode === _unicode.KEY_CODES.DELETE || event.keyCode === _unicode.KEY_CODES.INSERT) {\n var timeOffset = 0;\n\n // on ctl+c / cmd+c don't update suggestion list\n if (event.keyCode === _unicode.KEY_CODES.C && (event.ctrlKey || event.metaKey)) {\n return;\n }\n if (!editor.isOpened()) {\n timeOffset += 10;\n }\n\n if (editor.htEditor) {\n editor.instance._registerTimeout(setTimeout(function () {\n editor.queryChoices(editor.TEXTAREA.value);\n skipOne = true;\n }, timeOffset));\n }\n }\n}\n\nAutocompleteEditor.prototype.prepare = function () {\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n _handsontableEditor2.default.prototype.prepare.apply(this, arguments);\n};\n\nAutocompleteEditor.prototype.open = function () {\n // Ugly fix for handsontable which grab window object for autocomplete scroll listener instead table element.\n this.TEXTAREA_PARENT.style.overflow = 'auto';\n _handsontableEditor2.default.prototype.open.apply(this, arguments);\n this.TEXTAREA_PARENT.style.overflow = '';\n\n var choicesListHot = this.htEditor.getInstance();\n var _this = this;\n var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;\n\n this.TEXTAREA.style.visibility = 'visible';\n this.focus();\n\n choicesListHot.updateSettings({\n colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : void 0,\n width: trimDropdown ? (0, _element.outerWidth)(this.TEXTAREA) + (0, _element.getScrollbarWidth)() + 2 : void 0,\n afterRenderer: function afterRenderer(TD, row, col, prop, value, cellProperties) {\n var _this$cellProperties = _this.cellProperties,\n filteringCaseSensitive = _this$cellProperties.filteringCaseSensitive,\n allowHtml = _this$cellProperties.allowHtml;\n\n var indexOfMatch = void 0;\n var match = void 0;\n\n value = (0, _mixed.stringify)(value);\n\n if (value && !allowHtml) {\n indexOfMatch = filteringCaseSensitive === true ? value.indexOf(this.query) : value.toLowerCase().indexOf(_this.query.toLowerCase());\n\n if (indexOfMatch !== -1) {\n match = value.substr(indexOfMatch, _this.query.length);\n value = value.replace(match, '<strong>' + match + '</strong>');\n }\n }\n TD.innerHTML = value;\n },\n\n autoColumnSize: true,\n modifyColWidth: function modifyColWidth(width, col) {\n // workaround for <strong> text overlapping the dropdown, not really accurate\n var autoWidths = this.getPlugin('autoColumnSize').widths;\n\n if (autoWidths[col]) {\n width = autoWidths[col];\n }\n\n return trimDropdown ? width : width + 15;\n }\n });\n\n // Add additional space for autocomplete holder\n this.htEditor.view.wt.wtTable.holder.parentNode.style['padding-right'] = (0, _element.getScrollbarWidth)() + 2 + 'px';\n\n if (skipOne) {\n skipOne = false;\n }\n\n _this.instance._registerTimeout(setTimeout(function () {\n _this.queryChoices(_this.TEXTAREA.value);\n }, 0));\n};\n\nAutocompleteEditor.prototype.close = function () {\n _handsontableEditor2.default.prototype.close.apply(this, arguments);\n};\nAutocompleteEditor.prototype.queryChoices = function (query) {\n var _this3 = this;\n\n this.query = query;\n var source = this.cellProperties.source;\n\n if (typeof source == 'function') {\n source.call(this.cellProperties, query, function (choices) {\n _this3.rawChoices = choices;\n _this3.updateChoicesList(_this3.stripValuesIfNeeded(choices));\n });\n } else if (Array.isArray(source)) {\n this.rawChoices = source;\n this.updateChoicesList(this.stripValuesIfNeeded(source));\n } else {\n this.updateChoicesList([]);\n }\n};\n\nAutocompleteEditor.prototype.updateChoicesList = function (choices) {\n var pos = (0, _element.getCaretPosition)(this.TEXTAREA);\n var endPos = (0, _element.getSelectionEndPosition)(this.TEXTAREA);\n var sortByRelevanceSetting = this.cellProperties.sortByRelevance;\n var filterSetting = this.cellProperties.filter;\n var orderByRelevance = null;\n var highlightIndex = null;\n\n if (sortByRelevanceSetting) {\n orderByRelevance = AutocompleteEditor.sortByRelevance(this.stripValueIfNeeded(this.getValue()), choices, this.cellProperties.filteringCaseSensitive);\n }\n var orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;\n\n if (filterSetting === false) {\n if (orderByRelevanceLength) {\n highlightIndex = orderByRelevance[0];\n }\n } else {\n var sorted = [];\n\n for (var i = 0, choicesCount = choices.length; i < choicesCount; i++) {\n if (sortByRelevanceSetting && orderByRelevanceLength <= i) {\n break;\n }\n if (orderByRelevanceLength) {\n sorted.push(choices[orderByRelevance[i]]);\n } else {\n sorted.push(choices[i]);\n }\n }\n\n highlightIndex = 0;\n choices = sorted;\n }\n\n this.strippedChoices = choices;\n this.htEditor.loadData((0, _array.pivot)([choices]));\n\n this.updateDropdownHeight();\n\n this.flipDropdownIfNeeded();\n\n if (this.cellProperties.strict === true) {\n this.highlightBestMatchingChoice(highlightIndex);\n }\n\n this.instance.listen();\n this.TEXTAREA.focus();\n (0, _element.setCaretPosition)(this.TEXTAREA, pos, pos === endPos ? void 0 : endPos);\n};\n\nAutocompleteEditor.prototype.flipDropdownIfNeeded = function () {\n var textareaOffset = (0, _element.offset)(this.TEXTAREA);\n var textareaHeight = (0, _element.outerHeight)(this.TEXTAREA);\n var dropdownHeight = this.getDropdownHeight();\n var trimmingContainer = (0, _element.getTrimmingContainer)(this.instance.view.wt.wtTable.TABLE);\n var trimmingContainerScrollTop = trimmingContainer.scrollTop;\n var headersHeight = (0, _element.outerHeight)(this.instance.view.wt.wtTable.THEAD);\n var containerOffset = {\n row: 0,\n col: 0\n };\n\n if (trimmingContainer !== window) {\n containerOffset = (0, _element.offset)(trimmingContainer);\n }\n\n var spaceAbove = textareaOffset.top - containerOffset.top - headersHeight + trimmingContainerScrollTop;\n var spaceBelow = trimmingContainer.scrollHeight - spaceAbove - headersHeight - textareaHeight;\n var flipNeeded = dropdownHeight > spaceBelow && spaceAbove > spaceBelow;\n\n if (flipNeeded) {\n this.flipDropdown(dropdownHeight);\n } else {\n this.unflipDropdown();\n }\n\n this.limitDropdownIfNeeded(flipNeeded ? spaceAbove : spaceBelow, dropdownHeight);\n\n return flipNeeded;\n};\n\nAutocompleteEditor.prototype.limitDropdownIfNeeded = function (spaceAvailable, dropdownHeight) {\n if (dropdownHeight > spaceAvailable) {\n var tempHeight = 0;\n var i = 0;\n var lastRowHeight = 0;\n var height = null;\n\n do {\n lastRowHeight = this.htEditor.getRowHeight(i) || this.htEditor.view.wt.wtSettings.settings.defaultRowHeight;\n tempHeight += lastRowHeight;\n i++;\n } while (tempHeight < spaceAvailable);\n\n height = tempHeight - lastRowHeight;\n\n if (this.htEditor.flipped) {\n this.htEditor.rootElement.style.top = parseInt(this.htEditor.rootElement.style.top, 10) + dropdownHeight - height + 'px';\n }\n\n this.setDropdownHeight(tempHeight - lastRowHeight);\n }\n};\n\nAutocompleteEditor.prototype.flipDropdown = function (dropdownHeight) {\n var dropdownStyle = this.htEditor.rootElement.style;\n\n dropdownStyle.position = 'absolute';\n dropdownStyle.top = -dropdownHeight + 'px';\n\n this.htEditor.flipped = true;\n};\n\nAutocompleteEditor.prototype.unflipDropdown = function () {\n var dropdownStyle = this.htEditor.rootElement.style;\n\n if (dropdownStyle.position === 'absolute') {\n dropdownStyle.position = '';\n dropdownStyle.top = '';\n }\n\n this.htEditor.flipped = void 0;\n};\n\nAutocompleteEditor.prototype.updateDropdownHeight = function () {\n var currentDropdownWidth = this.htEditor.getColWidth(0) + (0, _element.getScrollbarWidth)() + 2;\n var trimDropdown = this.cellProperties.trimDropdown;\n\n this.htEditor.updateSettings({\n height: this.getDropdownHeight(),\n width: trimDropdown ? void 0 : currentDropdownWidth\n });\n\n this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer();\n};\n\nAutocompleteEditor.prototype.setDropdownHeight = function (height) {\n this.htEditor.updateSettings({\n height: height\n });\n};\n\nAutocompleteEditor.prototype.finishEditing = function (restoreOriginalValue) {\n if (!restoreOriginalValue) {\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n }\n _handsontableEditor2.default.prototype.finishEditing.apply(this, arguments);\n};\n\nAutocompleteEditor.prototype.highlightBestMatchingChoice = function (index) {\n if (typeof index === 'number') {\n this.htEditor.selectCell(index, 0);\n } else {\n this.htEditor.deselectCell();\n }\n};\n\n/**\n * Filters and sorts by relevance\n * @param value\n * @param choices\n * @param caseSensitive\n * @returns {Array} array of indexes in original choices array\n */\nAutocompleteEditor.sortByRelevance = function (value, choices, caseSensitive) {\n var choicesRelevance = [];\n var currentItem = void 0;\n var valueLength = value.length;\n var valueIndex = void 0;\n var charsLeft = void 0;\n var result = [];\n var i = void 0;\n var choicesCount = choices.length;\n\n if (valueLength === 0) {\n for (i = 0; i < choicesCount; i++) {\n result.push(i);\n }\n return result;\n }\n\n for (i = 0; i < choicesCount; i++) {\n currentItem = (0, _string.stripTags)((0, _mixed.stringify)(choices[i]));\n\n if (caseSensitive) {\n valueIndex = currentItem.indexOf(value);\n } else {\n valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase());\n }\n\n if (valueIndex !== -1) {\n charsLeft = currentItem.length - valueIndex - valueLength;\n\n choicesRelevance.push({\n baseIndex: i,\n index: valueIndex,\n charsLeft: charsLeft,\n value: currentItem\n });\n }\n }\n\n choicesRelevance.sort(function (a, b) {\n\n if (b.index === -1) {\n return -1;\n }\n if (a.index === -1) {\n return 1;\n }\n\n if (a.index < b.index) {\n return -1;\n } else if (b.index < a.index) {\n return 1;\n } else if (a.index === b.index) {\n if (a.charsLeft < b.charsLeft) {\n return -1;\n } else if (a.charsLeft > b.charsLeft) {\n return 1;\n }\n }\n\n return 0;\n });\n\n for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {\n result.push(choicesRelevance[i].baseIndex);\n }\n\n return result;\n};\n\nAutocompleteEditor.prototype.getDropdownHeight = function () {\n var firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23;\n var visibleRows = this.cellProperties.visibleRows;\n\n return this.strippedChoices.length >= visibleRows ? visibleRows * firstRowHeight : this.strippedChoices.length * firstRowHeight + 8;\n};\n\nAutocompleteEditor.prototype.stripValueIfNeeded = function (value) {\n return this.stripValuesIfNeeded([value])[0];\n};\n\nAutocompleteEditor.prototype.stripValuesIfNeeded = function (values) {\n var allowHtml = this.cellProperties.allowHtml;\n\n\n var stringifiedValues = (0, _array.arrayMap)(values, function (value) {\n return (0, _mixed.stringify)(value);\n });\n var strippedValues = (0, _array.arrayMap)(stringifiedValues, function (value) {\n return allowHtml ? value : (0, _string.stripTags)(value);\n });\n\n return strippedValues;\n};\n\nAutocompleteEditor.prototype.allowKeyEventPropagation = function (keyCode) {\n var selected = { row: this.htEditor.getSelectedRange() ? this.htEditor.getSelectedRange().from.row : -1 };\n var allowed = false;\n\n if (keyCode === _unicode.KEY_CODES.ARROW_DOWN && selected.row > 0 && selected.row < this.htEditor.countRows() - 1) {\n allowed = true;\n }\n if (keyCode === _unicode.KEY_CODES.ARROW_UP && selected.row > -1) {\n allowed = true;\n }\n\n return allowed;\n};\n\nAutocompleteEditor.prototype.discardEditor = function (result) {\n _handsontableEditor2.default.prototype.discardEditor.apply(this, arguments);\n\n this.instance.view.render();\n};\n\nexports.default = AutocompleteEditor;\n\n/***/ }),\n/* 148 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _unicode = __webpack_require__(16);\n\nvar _object = __webpack_require__(2);\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HandsontableEditor = _textEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor HandsontableEditor\n * @class HandsontableEditor\n * @dependencies TextEditor\n */\nHandsontableEditor.prototype.createElements = function () {\n _textEditor2.default.prototype.createElements.apply(this, arguments);\n\n var DIV = document.createElement('DIV');\n DIV.className = 'handsontableEditor';\n this.TEXTAREA_PARENT.appendChild(DIV);\n\n this.htContainer = DIV;\n this.assignHooks();\n};\n\nHandsontableEditor.prototype.prepare = function (td, row, col, prop, value, cellProperties) {\n _textEditor2.default.prototype.prepare.apply(this, arguments);\n\n var parent = this;\n var options = {\n startRows: 0,\n startCols: 0,\n minRows: 0,\n minCols: 0,\n className: 'listbox',\n copyPaste: false,\n autoColumnSize: false,\n autoRowSize: false,\n readOnly: true,\n fillHandle: false,\n afterOnCellMouseDown: function afterOnCellMouseDown(_, coords) {\n var value = this.getSourceData(coords.row, coords.col);\n\n // if the value is undefined then it means we don't want to set the value\n if (value !== void 0) {\n parent.setValue(value);\n }\n parent.instance.destroyEditor();\n }\n };\n\n if (this.cellProperties.handsontable) {\n (0, _object.extend)(options, cellProperties.handsontable);\n }\n this.htOptions = options;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n var editor = this.getActiveEditor();\n\n var innerHOT = editor.htEditor.getInstance();\n\n var rowToSelect;\n var selectedRow;\n\n if (event.keyCode == _unicode.KEY_CODES.ARROW_DOWN) {\n if (!innerHOT.getSelected() && !innerHOT.flipped) {\n rowToSelect = 0;\n } else if (innerHOT.getSelected()) {\n if (innerHOT.flipped) {\n rowToSelect = innerHOT.getSelected()[0] + 1;\n } else if (!innerHOT.flipped) {\n selectedRow = innerHOT.getSelected()[0];\n var lastRow = innerHOT.countRows() - 1;\n rowToSelect = Math.min(lastRow, selectedRow + 1);\n }\n }\n } else if (event.keyCode == _unicode.KEY_CODES.ARROW_UP) {\n if (!innerHOT.getSelected() && innerHOT.flipped) {\n rowToSelect = innerHOT.countRows() - 1;\n } else if (innerHOT.getSelected()) {\n if (innerHOT.flipped) {\n selectedRow = innerHOT.getSelected()[0];\n rowToSelect = Math.max(0, selectedRow - 1);\n } else {\n selectedRow = innerHOT.getSelected()[0];\n rowToSelect = selectedRow - 1;\n }\n }\n }\n\n if (rowToSelect !== void 0) {\n if (rowToSelect < 0 || innerHOT.flipped && rowToSelect > innerHOT.countRows() - 1) {\n innerHOT.deselectCell();\n } else {\n innerHOT.selectCell(rowToSelect, 0);\n }\n if (innerHOT.getData().length) {\n event.preventDefault();\n (0, _event.stopImmediatePropagation)(event);\n\n editor.instance.listen();\n editor.TEXTAREA.focus();\n }\n }\n};\n\nHandsontableEditor.prototype.open = function () {\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n\n _textEditor2.default.prototype.open.apply(this, arguments);\n\n if (this.htEditor) {\n this.htEditor.destroy();\n }\n this.htEditor = new Handsontable(this.htContainer, this.htOptions);\n\n if (this.cellProperties.strict) {\n this.htEditor.selectCell(0, 0);\n this.TEXTAREA.style.visibility = 'hidden';\n } else {\n this.htEditor.deselectCell();\n this.TEXTAREA.style.visibility = 'visible';\n }\n\n (0, _element.setCaretPosition)(this.TEXTAREA, 0, this.TEXTAREA.value.length);\n};\n\nHandsontableEditor.prototype.close = function () {\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n this.instance.listen();\n\n _textEditor2.default.prototype.close.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.focus = function () {\n this.instance.listen();\n _textEditor2.default.prototype.focus.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.beginEditing = function (initialValue) {\n var onBeginEditing = this.instance.getSettings().onBeginEditing;\n\n if (onBeginEditing && onBeginEditing() === false) {\n return;\n }\n _textEditor2.default.prototype.beginEditing.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.finishEditing = function (isCancelled, ctrlDown) {\n if (this.htEditor && this.htEditor.isListening()) {\n // if focus is still in the HOT editor\n\n this.instance.listen(); // return the focus to the parent HOT instance\n }\n\n if (this.htEditor && this.htEditor.getSelected()) {\n var value = this.htEditor.getInstance().getValue();\n\n if (value !== void 0) {\n // if the value is undefined then it means we don't want to set the value\n this.setValue(value);\n }\n }\n\n return _textEditor2.default.prototype.finishEditing.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.assignHooks = function () {\n var _this = this;\n\n this.instance.addHook('afterDestroy', function () {\n if (_this.htEditor) {\n _this.htEditor.destroy();\n }\n });\n};\n\nexports.default = HandsontableEditor;\n\n/***/ }),\n/* 149 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar MIXIN_NAME = 'arrayMapper';\n\n/**\n * @type {Object}\n */\nvar arrayMapper = {\n _arrayMap: [],\n\n /**\n * Get value by map index.\n *\n * @param {Number} index Array index.\n * @return {*} Returns value mapped to passed index.\n */\n getValueByIndex: function getValueByIndex(index) {\n var value = void 0;\n\n /* eslint-disable no-cond-assign */\n return (value = this._arrayMap[index]) === void 0 ? null : value;\n },\n\n\n /**\n * Get map index by its value.\n *\n * @param {*} value Value to search.\n * @returns {Number} Returns array index.\n */\n getIndexByValue: function getIndexByValue(value) {\n var index = void 0;\n\n /* eslint-disable no-cond-assign */\n return (index = this._arrayMap.indexOf(value)) === -1 ? null : index;\n },\n\n\n /**\n * Insert new items to array mapper starting at passed index. New entries will be a continuation of last value in the array.\n *\n * @param {Number} index Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n * @returns {Array} Returns added items.\n */\n insertItems: function insertItems(index) {\n var _this = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var newIndex = (0, _array.arrayMax)(this._arrayMap) + 1;\n var addedItems = [];\n\n (0, _number.rangeEach)(amount - 1, function (count) {\n addedItems.push(_this._arrayMap.splice(index + count, 0, newIndex + count));\n });\n\n return addedItems;\n },\n\n\n /**\n * Remove items from array mapper.\n *\n * @param {Number} index Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n * @returns {Array} Returns removed items.\n */\n removeItems: function removeItems(index) {\n var _this2 = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var removedItems = [];\n\n if (Array.isArray(index)) {\n var mapCopy = [].concat(this._arrayMap);\n\n // Sort descending\n index.sort(function (a, b) {\n return b - a;\n });\n\n removedItems = (0, _array.arrayReduce)(index, function (acc, item) {\n _this2._arrayMap.splice(item, 1);\n\n return acc.concat(mapCopy.slice(item, item + 1));\n }, []);\n } else {\n removedItems = this._arrayMap.splice(index, amount);\n }\n\n return removedItems;\n },\n\n\n /**\n * Unshift items (remove and shift chunk of array to the left).\n *\n * @param {Number|Array} index Array index or Array of indexes to unshift.\n * @param {Number} [amount=1] Defines how many items will be removed from an array (when index is passed as number).\n */\n unshiftItems: function unshiftItems(index) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var removedItems = this.removeItems(index, amount);\n\n function countRowShift(logicalRow) {\n // Todo: compare perf between reduce vs sort->each->brake\n return (0, _array.arrayReduce)(removedItems, function (count, removedLogicalRow) {\n if (logicalRow > removedLogicalRow) {\n count++;\n }\n\n return count;\n }, 0);\n }\n\n this._arrayMap = (0, _array.arrayMap)(this._arrayMap, function (logicalRow, physicalRow) {\n var rowShift = countRowShift(logicalRow);\n\n if (rowShift) {\n logicalRow -= rowShift;\n }\n\n return logicalRow;\n });\n },\n\n\n /**\n * Shift (right shifting) items starting at passed index.\n *\n * @param {Number} index Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n */\n shiftItems: function shiftItems(index) {\n var _this3 = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this._arrayMap = (0, _array.arrayMap)(this._arrayMap, function (row) {\n if (row >= index) {\n row += amount;\n }\n\n return row;\n });\n\n (0, _number.rangeEach)(amount - 1, function (count) {\n _this3._arrayMap.splice(index + count, 0, index + count);\n });\n },\n\n\n /**\n * Clear all stored index<->value information from an array.\n */\n clearMap: function clearMap() {\n this._arrayMap.length = 0;\n }\n};\n\n(0, _object.defineGetter)(arrayMapper, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\n\nexports.default = arrayMapper;\n\n/***/ }),\n/* 150 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar MIXIN_NAME = 'localHooks';\n\n/**\n * Mixin object to extend objects functionality for local hooks.\n *\n * @type {Object}\n */\nvar localHooks = {\n /**\n * Internal hooks storage.\n */\n _localHooks: Object.create(null),\n\n /**\n * Add hook to the collection.\n *\n * @param {String} key Hook name.\n * @param {Function} callback Hook callback\n */\n addLocalHook: function addLocalHook(key, callback) {\n if (!this._localHooks[key]) {\n this._localHooks[key] = [];\n }\n this._localHooks[key].push(callback);\n },\n\n\n /**\n * Run hooks.\n *\n * @param {String} key Hook name.\n * @param {*} params\n */\n runLocalHooks: function runLocalHooks(key) {\n var _this = this;\n\n for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n if (this._localHooks[key]) {\n (0, _array.arrayEach)(this._localHooks[key], function (callback) {\n return callback.apply(_this, params);\n });\n }\n },\n\n\n /**\n * Clear all added hooks.\n */\n clearLocalHooks: function clearLocalHooks() {\n this._localHooks = {};\n }\n};\n\n(0, _object.defineGetter)(localHooks, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\n\nexports.default = localHooks;\n\n/***/ }),\n/* 151 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _number = __webpack_require__(6);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar STATE_INITIALIZED = 0;\nvar STATE_BUILT = 1;\nvar STATE_APPENDED = 2;\nvar UNIT = 'px';\n\n/**\n * @class\n * @private\n */\n\nvar BaseUI = function () {\n function BaseUI(hotInstance) {\n _classCallCheck(this, BaseUI);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * DOM element representing the ui element.\n *\n * @type {HTMLElement}\n * @private\n */\n this._element = null;\n /**\n * Flag which determines build state of element.\n *\n * @type {Boolean}\n */\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Add created UI elements to table.\n *\n * @param {HTMLElement} wrapper Element which are parent for our UI element.\n */\n\n\n _createClass(BaseUI, [{\n key: 'appendTo',\n value: function appendTo(wrapper) {\n wrapper.appendChild(this._element);\n\n this.state = STATE_APPENDED;\n }\n\n /**\n * Method for create UI element. Only create, without append to table.\n */\n\n }, {\n key: 'build',\n value: function build() {\n this._element = document.createElement('div');\n this.state = STATE_BUILT;\n }\n\n /**\n * Method for remove UI element.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.isAppended()) {\n this._element.parentElement.removeChild(this._element);\n }\n\n this._element = null;\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Check if UI element are appended.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isAppended',\n value: function isAppended() {\n return this.state === STATE_APPENDED;\n }\n\n /**\n * Check if UI element are built.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isBuilt',\n value: function isBuilt() {\n return this.state >= STATE_BUILT;\n }\n\n /**\n * Setter for position.\n *\n * @param {Number} top New top position of the element.\n * @param {Number} left New left position of the element.\n */\n\n }, {\n key: 'setPosition',\n value: function setPosition(top, left) {\n if ((0, _number.isNumeric)(top)) {\n this._element.style.top = top + UNIT;\n }\n if ((0, _number.isNumeric)(left)) {\n this._element.style.left = left + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains left and top position of the element.\n */\n\n }, {\n key: 'getPosition',\n value: function getPosition() {\n return {\n top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0,\n left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0\n };\n }\n\n /**\n * Setter for the element size.\n *\n * @param {Number} width New width of the element.\n * @param {Number} height New height of the element.\n */\n\n }, {\n key: 'setSize',\n value: function setSize(width, height) {\n if ((0, _number.isNumeric)(width)) {\n this._element.style.width = width + UNIT;\n }\n if ((0, _number.isNumeric)(height)) {\n this._element.style.height = height + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains height and width of the element.\n */\n\n }, {\n key: 'getSize',\n value: function getSize() {\n return {\n width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0,\n height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0\n };\n }\n\n /**\n * Setter for the element offset. Offset means marginTop and marginLeft of the element.\n *\n * @param {Number} top New margin top of the element.\n * @param {Number} left New margin left of the element.\n */\n\n }, {\n key: 'setOffset',\n value: function setOffset(top, left) {\n if ((0, _number.isNumeric)(top)) {\n this._element.style.marginTop = top + UNIT;\n }\n if ((0, _number.isNumeric)(left)) {\n this._element.style.marginLeft = left + UNIT;\n }\n }\n\n /**\n * Getter for the element offset.\n *\n * @returns {Object} Object contains top and left offset of the element.\n */\n\n }, {\n key: 'getOffset',\n value: function getOffset() {\n return {\n top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0,\n left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0\n };\n }\n }]);\n\n return BaseUI;\n}();\n\nexports.default = BaseUI;\n\n/***/ }),\n/* 152 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar STATE_INITIALIZED = 0;\nvar STATE_BUILT = 1;\nvar STATE_APPENDED = 2;\nvar UNIT = 'px';\n\n/**\n * @class\n * @private\n */\n\nvar BaseUI = function () {\n function BaseUI(hotInstance) {\n _classCallCheck(this, BaseUI);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * DOM element representing the ui element.\n *\n * @type {HTMLElement}\n * @private\n */\n this._element = null;\n /**\n * Flag which determines build state of element.\n *\n * @type {Boolean}\n */\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Add created UI elements to table.\n *\n * @param {HTMLElement} wrapper Element which are parent for our UI element.\n */\n\n\n _createClass(BaseUI, [{\n key: 'appendTo',\n value: function appendTo(wrapper) {\n wrapper.appendChild(this._element);\n\n this.state = STATE_APPENDED;\n }\n\n /**\n * Method for create UI element. Only create, without append to table.\n */\n\n }, {\n key: 'build',\n value: function build() {\n this._element = document.createElement('div');\n this.state = STATE_BUILT;\n }\n\n /**\n * Method for remove UI element.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.isAppended()) {\n this._element.parentElement.removeChild(this._element);\n }\n\n this._element = null;\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Check if UI element are appended.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isAppended',\n value: function isAppended() {\n return this.state === STATE_APPENDED;\n }\n\n /**\n * Check if UI element are built.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isBuilt',\n value: function isBuilt() {\n return this.state >= STATE_BUILT;\n }\n\n /**\n * Setter for position.\n *\n * @param {Number} top New top position of the element.\n * @param {Number} left New left position of the element.\n */\n\n }, {\n key: 'setPosition',\n value: function setPosition(top, left) {\n if (top) {\n this._element.style.top = top + UNIT;\n }\n if (left) {\n this._element.style.left = left + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains left and top position of the element.\n */\n\n }, {\n key: 'getPosition',\n value: function getPosition() {\n return {\n top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0,\n left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0\n };\n }\n\n /**\n * Setter for the element size.\n *\n * @param {Number} width New width of the element.\n * @param {Number} height New height of the element.\n */\n\n }, {\n key: 'setSize',\n value: function setSize(width, height) {\n if (width) {\n this._element.style.width = width + UNIT;\n }\n if (height) {\n this._element.style.height = height + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains height and width of the element.\n */\n\n }, {\n key: 'getSize',\n value: function getSize() {\n return {\n width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0,\n height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0\n };\n }\n\n /**\n * Setter for the element offset. Offset means marginTop and marginLeft of the element.\n *\n * @param {Number} top New margin top of the element.\n * @param {Number} left New margin left of the element.\n */\n\n }, {\n key: 'setOffset',\n value: function setOffset(top, left) {\n if (top) {\n this._element.style.marginTop = top + UNIT;\n }\n if (left) {\n this._element.style.marginLeft = left + UNIT;\n }\n }\n\n /**\n * Getter for the element offset.\n *\n * @returns {Object} Object contains top and left offset of the element.\n */\n\n }, {\n key: 'getOffset',\n value: function getOffset() {\n return {\n top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0,\n left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0\n };\n }\n }]);\n\n return BaseUI;\n}();\n\nexports.default = BaseUI;\n\n/***/ }),\n/* 153 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.RecordTranslator = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nexports.registerIdentity = registerIdentity;\nexports.getTranslator = getTranslator;\n\nvar _core = __webpack_require__(64);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _object = __webpack_require__(2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class RecordTranslator\n * @util\n */\nvar RecordTranslator = function () {\n function RecordTranslator(hot) {\n _classCallCheck(this, RecordTranslator);\n\n this.hot = hot;\n }\n\n /**\n * Translate physical row index into visual.\n *\n * @param {Number} row Physical row index.\n * @returns {Number} Returns visual row index.\n */\n\n\n _createClass(RecordTranslator, [{\n key: 'toVisualRow',\n value: function toVisualRow(row) {\n return this.hot.runHooks('unmodifyRow', row);\n }\n\n /**\n * Translate physical column index into visual.\n *\n * @param {Number} column Physical column index.\n * @returns {Number} Returns visual column index.\n */\n\n }, {\n key: 'toVisualColumn',\n value: function toVisualColumn(column) {\n return this.hot.runHooks('unmodifyCol', column);\n }\n\n /**\n * Translate physical coordinates into visual. Can be passed as separate 2 arguments (row, column) or as an object in first\n * argument with `row` and `column` keys.\n *\n * @param {Number|Object} row Physical coordinates or row index.\n * @param {Number} [column] Physical column index.\n * @returns {Object|Array} Returns an object with visual records or an array if coordinates passed as separate arguments.\n */\n\n }, {\n key: 'toVisual',\n value: function toVisual(row, column) {\n var result = void 0;\n\n if ((0, _object.isObject)(row)) {\n result = {\n row: this.toVisualRow(row.row),\n column: this.toVisualColumn(row.column)\n };\n } else {\n result = [this.toVisualRow(row), this.toVisualColumn(column)];\n }\n\n return result;\n }\n\n /**\n * Translate visual row index into physical.\n *\n * @param {Number} row Visual row index.\n * @returns {Number} Returns physical row index.\n */\n\n }, {\n key: 'toPhysicalRow',\n value: function toPhysicalRow(row) {\n return this.hot.runHooks('modifyRow', row);\n }\n\n /**\n * Translate visual column index into physical.\n *\n * @param {Number} column Visual column index.\n * @returns {Number} Returns physical column index.\n */\n\n }, {\n key: 'toPhysicalColumn',\n value: function toPhysicalColumn(column) {\n return this.hot.runHooks('modifyCol', column);\n }\n\n /**\n * Translate visual coordinates into physical. Can be passed as separate 2 arguments (row, column) or as an object in first\n * argument with `row` and `column` keys.\n *\n * @param {Number|Object} row Visual coordinates or row index.\n * @param {Number} [column] Visual column index.\n * @returns {Object|Array} Returns an object with physical records or an array if coordinates passed as separate arguments.\n */\n\n }, {\n key: 'toPhysical',\n value: function toPhysical(row, column) {\n var result = void 0;\n\n if ((0, _object.isObject)(row)) {\n result = {\n row: this.toPhysicalRow(row.row),\n column: this.toPhysicalColumn(row.column)\n };\n } else {\n result = [this.toPhysicalRow(row), this.toPhysicalColumn(column)];\n }\n\n return result;\n }\n }]);\n\n return RecordTranslator;\n}();\n\nexports.RecordTranslator = RecordTranslator;\n\n\nvar identities = new WeakMap();\nvar translatorSingletons = new WeakMap();\n\nfunction registerIdentity(identity, hot) {\n identities.set(identity, hot);\n}\n\nfunction getTranslator(identity) {\n var singleton = void 0;\n\n if (!(identity instanceof _core2.default)) {\n if (!identities.has(identity)) {\n throw Error('Record translator was not registered for this object identity');\n }\n identity = identities.get(identity);\n }\n if (translatorSingletons.has(identity)) {\n singleton = translatorSingletons.get(identity);\n } else {\n singleton = new RecordTranslator(identity);\n translatorSingletons.set(identity, singleton);\n }\n\n return singleton;\n}\n\n/***/ }),\n/* 154 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar _mixed = __webpack_require__(20);\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class SamplesGenerator\n * @util\n */\nvar SamplesGenerator = function () {\n _createClass(SamplesGenerator, null, [{\n key: 'SAMPLE_COUNT',\n\n /**\n * Number of samples to take of each value length.\n *\n * @type {Number}\n */\n get: function get() {\n return 3;\n }\n }]);\n\n function SamplesGenerator(dataFactory) {\n _classCallCheck(this, SamplesGenerator);\n\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Function which give the data to collect samples.\n *\n * @type {Function}\n */\n this.dataFactory = dataFactory;\n /**\n * Custom number of samples to take of each value length.\n *\n * @type {Number}\n * @default {null}\n */\n this.customSampleCount = null;\n /**\n * `true` if duplicate samples collection should be allowed, `false` otherwise.\n *\n * @type {Boolean}\n * @default {false}\n */\n this.allowDuplicates = false;\n }\n\n /**\n * Get the sample count for this instance.\n *\n * @returns {Number}\n */\n\n\n _createClass(SamplesGenerator, [{\n key: 'getSampleCount',\n value: function getSampleCount() {\n if (this.customSampleCount) {\n return this.customSampleCount;\n }\n return SamplesGenerator.SAMPLE_COUNT;\n }\n }, {\n key: 'setSampleCount',\n\n\n /**\n * Set the sample count.\n *\n * @param {Number} sampleCount Number of samples to be collected.\n */\n value: function setSampleCount(sampleCount) {\n this.customSampleCount = sampleCount;\n }\n\n /**\n * Set if the generator should accept duplicate values.\n *\n * @param {Boolean} allowDuplicates `true` to allow duplicate values.\n */\n\n }, {\n key: 'setAllowDuplicates',\n value: function setAllowDuplicates(allowDuplicates) {\n this.allowDuplicates = allowDuplicates;\n }\n\n /**\n * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.\n *\n * @param {Object|Number} rowRange\n * @param {Object} colRange\n * @returns {Object}\n */\n\n }, {\n key: 'generateRowSamples',\n value: function generateRowSamples(rowRange, colRange) {\n return this.generateSamples('row', colRange, rowRange);\n }\n\n /**\n * Generate samples for column. You can control which area should be sampled by passing `colRange` object and `rowRange` object.\n *\n * @param {Object} colRange Column index.\n * @param {Object} rowRange Column index.\n * @returns {Object}\n */\n\n }, {\n key: 'generateColumnSamples',\n value: function generateColumnSamples(colRange, rowRange) {\n return this.generateSamples('col', rowRange, colRange);\n }\n\n /**\n * Generate collection of samples.\n *\n * @param {String} type Type to generate. Can be `col` or `row`.\n * @param {Object} range\n * @param {Object|Number} specifierRange\n * @returns {Map}\n */\n\n }, {\n key: 'generateSamples',\n value: function generateSamples(type, range, specifierRange) {\n var _this = this;\n\n var samples = new Map();\n\n if (typeof specifierRange === 'number') {\n specifierRange = { from: specifierRange, to: specifierRange };\n }\n (0, _number.rangeEach)(specifierRange.from, specifierRange.to, function (index) {\n var sample = _this.generateSample(type, range, index);\n\n samples.set(index, sample);\n });\n\n return samples;\n }\n\n /**\n * Generate sample for specified type (`row` or `col`).\n *\n * @param {String} type Samples type `row` or `col`.\n * @param {Object} range\n * @param {Number} specifierValue\n * @returns {Map}\n */\n\n }, {\n key: 'generateSample',\n value: function generateSample(type, range, specifierValue) {\n var _this2 = this;\n\n var samples = new Map();\n var sampledValues = [];\n var length = void 0;\n\n (0, _number.rangeEach)(range.from, range.to, function (index) {\n var value = void 0;\n\n if (type === 'row') {\n value = _this2.dataFactory(specifierValue, index);\n } else if (type === 'col') {\n value = _this2.dataFactory(index, specifierValue);\n } else {\n throw new Error('Unsupported sample type');\n }\n\n if ((0, _object.isObject)(value)) {\n length = Object.keys(value).length;\n } else if (Array.isArray(value)) {\n length = value.length;\n } else {\n length = (0, _mixed.stringify)(value).length;\n }\n\n if (!samples.has(length)) {\n samples.set(length, {\n needed: _this2.getSampleCount(),\n strings: []\n });\n }\n var sample = samples.get(length);\n\n if (sample.needed) {\n var duplicate = sampledValues.indexOf(value) > -1;\n\n if (!duplicate || _this2.allowDuplicates) {\n var computedKey = type === 'row' ? 'col' : 'row';\n\n sample.strings.push(_defineProperty({ value: value }, computedKey, index));\n sampledValues.push(value);\n sample.needed--;\n }\n }\n });\n\n return samples;\n }\n }]);\n\n return SamplesGenerator;\n}();\n\nexports.default = SamplesGenerator;\n\n/***/ }),\n/* 155 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(23)\n , toLength = __webpack_require__(24)\n , toIndex = __webpack_require__(60);\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n/***/ }),\n/* 156 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(38)\n , TAG = __webpack_require__(10)('toStringTag')\n // ES3 wrong here\n , ARG = cof(function(){ return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function(it, key){\n try {\n return it[key];\n } catch(e){ /* empty */ }\n};\n\nmodule.exports = function(it){\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n/***/ }),\n/* 157 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar dP = __webpack_require__(19).f\n , create = __webpack_require__(78)\n , redefineAll = __webpack_require__(59)\n , ctx = __webpack_require__(29)\n , anInstance = __webpack_require__(52)\n , defined = __webpack_require__(30)\n , forOf = __webpack_require__(56)\n , $iterDefine = __webpack_require__(166)\n , step = __webpack_require__(167)\n , setSpecies = __webpack_require__(172)\n , DESCRIPTORS = __webpack_require__(21)\n , fastKey = __webpack_require__(46).fastKey\n , SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function(that, key){\n // fast case\n var index = fastKey(key), entry;\n if(index !== 'F')return that._i[index];\n // frozen object case\n for(entry = that._f; entry; entry = entry.n){\n if(entry.k == key)return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n anInstance(that, C, NAME, '_i');\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear(){\n for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){\n entry.r = true;\n if(entry.p)entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function(key){\n var that = this\n , entry = getEntry(that, key);\n if(entry){\n var next = entry.n\n , prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if(prev)prev.n = next;\n if(next)next.p = prev;\n if(that._f == entry)that._f = next;\n if(that._l == entry)that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /*, that = undefined */){\n anInstance(this, C, 'forEach');\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)\n , entry;\n while(entry = entry ? entry.n : this._f){\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key){\n return !!getEntry(this, key);\n }\n });\n if(DESCRIPTORS)dP(C.prototype, 'size', {\n get: function(){\n return defined(this[SIZE]);\n }\n });\n return C;\n },\n def: function(that, key, value){\n var entry = getEntry(that, key)\n , prev, index;\n // change existing entry\n if(entry){\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if(!that._f)that._f = entry;\n if(prev)prev.n = entry;\n that[SIZE]++;\n // add to index\n if(index !== 'F')that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function(C, NAME, IS_MAP){\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function(iterated, kind){\n this._t = iterated; // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function(){\n var that = this\n , kind = that._k\n , entry = that._l;\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n // get next entry\n if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if(kind == 'keys' )return step(0, entry.k);\n if(kind == 'values')return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n/***/ }),\n/* 158 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar redefineAll = __webpack_require__(59)\n , getWeak = __webpack_require__(46).getWeak\n , anObject = __webpack_require__(18)\n , isObject = __webpack_require__(15)\n , anInstance = __webpack_require__(52)\n , forOf = __webpack_require__(56)\n , createArrayMethod = __webpack_require__(53)\n , $has = __webpack_require__(22)\n , arrayFind = createArrayMethod(5)\n , arrayFindIndex = createArrayMethod(6)\n , id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function(that){\n return that._l || (that._l = new UncaughtFrozenStore);\n};\nvar UncaughtFrozenStore = function(){\n this.a = [];\n};\nvar findUncaughtFrozen = function(store, key){\n return arrayFind(store.a, function(it){\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function(key){\n var entry = findUncaughtFrozen(this, key);\n if(entry)return entry[1];\n },\n has: function(key){\n return !!findUncaughtFrozen(this, key);\n },\n set: function(key, value){\n var entry = findUncaughtFrozen(this, key);\n if(entry)entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function(key){\n var index = arrayFindIndex(this.a, function(it){\n return it[0] === key;\n });\n if(~index)this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n anInstance(that, C, NAME, '_i');\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function(key){\n if(!isObject(key))return false;\n var data = getWeak(key);\n if(data === true)return uncaughtFrozenStore(this)['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key){\n if(!isObject(key))return false;\n var data = getWeak(key);\n if(data === true)return uncaughtFrozenStore(this).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function(that, key, value){\n var data = getWeak(anObject(key), true);\n if(data === true)uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n\n/***/ }),\n/* 159 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(13).document && document.documentElement;\n\n/***/ }),\n/* 160 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = !__webpack_require__(21) && !__webpack_require__(31)(function(){\n return Object.defineProperty(__webpack_require__(73)('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n/***/ }),\n/* 161 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// check on default Array iterator\nvar Iterators = __webpack_require__(45)\n , ITERATOR = __webpack_require__(10)('iterator')\n , ArrayProto = Array.prototype;\n\nmodule.exports = function(it){\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n/***/ }),\n/* 162 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(38);\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};\n\n/***/ }),\n/* 163 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(15)\n , floor = Math.floor;\nmodule.exports = function isInteger(it){\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n/***/ }),\n/* 164 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.2.8 IsRegExp(argument)\nvar isObject = __webpack_require__(15)\n , cof = __webpack_require__(38)\n , MATCH = __webpack_require__(10)('match');\nmodule.exports = function(it){\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n\n/***/ }),\n/* 165 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(18);\nmodule.exports = function(iterator, fn, value, entries){\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch(e){\n var ret = iterator['return'];\n if(ret !== undefined)anObject(ret.call(iterator));\n throw e;\n }\n};\n\n/***/ }),\n/* 166 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(57)\n , $export = __webpack_require__(3)\n , redefine = __webpack_require__(33)\n , hide = __webpack_require__(32)\n , has = __webpack_require__(22)\n , Iterators = __webpack_require__(45)\n , $iterCreate = __webpack_require__(283)\n , setToStringTag = __webpack_require__(48)\n , getPrototypeOf = __webpack_require__(288)\n , ITERATOR = __webpack_require__(10)('iterator')\n , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`\n , FF_ITERATOR = '@@iterator'\n , KEYS = 'keys'\n , VALUES = 'values';\n\nvar returnThis = function(){ return this; };\n\nmodule.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){\n $iterCreate(Constructor, NAME, next);\n var getMethod = function(kind){\n if(!BUGGY && kind in proto)return proto[kind];\n switch(kind){\n case KEYS: return function keys(){ return new Constructor(this, kind); };\n case VALUES: return function values(){ return new Constructor(this, kind); };\n } return function entries(){ return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator'\n , DEF_VALUES = DEFAULT == VALUES\n , VALUES_BUG = false\n , proto = Base.prototype\n , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]\n , $default = $native || getMethod(DEFAULT)\n , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined\n , $anyNative = NAME == 'Array' ? proto.entries || $native : $native\n , methods, key, IteratorPrototype;\n // Fix native\n if($anyNative){\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base));\n if(IteratorPrototype !== Object.prototype){\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if(DEF_VALUES && $native && $native.name !== VALUES){\n VALUES_BUG = true;\n $default = function values(){ return $native.call(this); };\n }\n // Define iterator\n if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if(DEFAULT){\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if(FORCED)for(key in methods){\n if(!(key in proto))redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n/***/ }),\n/* 167 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(done, value){\n return {value: value, done: !!done};\n};\n\n/***/ }),\n/* 168 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(39)\n , gOPS = __webpack_require__(58)\n , pIE = __webpack_require__(47)\n , toObject = __webpack_require__(41)\n , IObject = __webpack_require__(76)\n , $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(31)(function(){\n var A = {}\n , B = {}\n , S = Symbol()\n , K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function(k){ B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source){ // eslint-disable-line no-unused-vars\n var T = toObject(target)\n , aLen = arguments.length\n , index = 1\n , getSymbols = gOPS.f\n , isEnum = pIE.f;\n while(aLen > index){\n var S = IObject(arguments[index++])\n , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)\n , length = keys.length\n , j = 0\n , key;\n while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];\n } return T;\n} : $assign;\n\n/***/ }),\n/* 169 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar has = __webpack_require__(22)\n , toIObject = __webpack_require__(23)\n , arrayIndexOf = __webpack_require__(155)(false)\n , IE_PROTO = __webpack_require__(81)('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n/***/ }),\n/* 170 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar getKeys = __webpack_require__(39)\n , toIObject = __webpack_require__(23)\n , isEnum = __webpack_require__(47).f;\nmodule.exports = function(isEntries){\n return function(it){\n var O = toIObject(it)\n , keys = getKeys(O)\n , length = keys.length\n , i = 0\n , result = []\n , key;\n while(length > i)if(isEnum.call(O, key = keys[i++])){\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n\n/***/ }),\n/* 171 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(15)\n , anObject = __webpack_require__(18);\nvar check = function(O, proto){\n anObject(O);\n if(!isObject(proto) && proto !== null)throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function(test, buggy, set){\n try {\n set = __webpack_require__(29)(Function.call, __webpack_require__(79).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch(e){ buggy = true; }\n return function setPrototypeOf(O, proto){\n check(O, proto);\n if(buggy)O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n/***/ }),\n/* 172 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(13)\n , dP = __webpack_require__(19)\n , DESCRIPTORS = __webpack_require__(21)\n , SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function(KEY){\n var C = global[KEY];\n if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {\n configurable: true,\n get: function(){ return this; }\n });\n};\n\n/***/ }),\n/* 173 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = __webpack_require__(24)\n , repeat = __webpack_require__(174)\n , defined = __webpack_require__(30);\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n\n\n/***/ }),\n/* 174 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar toInteger = __webpack_require__(61)\n , defined = __webpack_require__(30);\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};\n\n/***/ }),\n/* 175 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports.f = __webpack_require__(10);\n\n/***/ }),\n/* 176 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar classof = __webpack_require__(156)\n , ITERATOR = __webpack_require__(10)('iterator')\n , Iterators = __webpack_require__(45);\nmodule.exports = __webpack_require__(44).getIteratorMethod = function(it){\n if(it != undefined)return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n/***/ }),\n/* 177 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = jQueryWrapper;\nfunction jQueryWrapper(Handsontable) {\n var jQuery = typeof window === 'undefined' ? false : window.jQuery;\n\n if (!jQuery) {\n return;\n }\n\n jQuery.fn.handsontable = function (action) {\n var $this = this.first(); // Use only first element from list\n var instance = $this.data('handsontable');\n\n // Init case\n if (typeof action !== 'string') {\n var userSettings = action || {};\n\n if (instance) {\n instance.updateSettings(userSettings);\n } else {\n instance = new Handsontable.Core($this[0], userSettings);\n $this.data('handsontable', instance);\n instance.init();\n }\n\n return $this;\n }\n\n // Action case\n var args = [];\n var output = void 0;\n\n if (arguments.length > 1) {\n for (var i = 1, ilen = arguments.length; i < ilen; i++) {\n args.push(arguments[i]);\n }\n }\n\n if (instance) {\n if (typeof instance[action] !== 'undefined') {\n output = instance[action].apply(instance, args);\n\n if (action === 'destroy') {\n $this.removeData();\n }\n } else {\n throw new Error('Handsontable do not provide action: ' + action);\n }\n }\n\n return output;\n };\n};\n\n/***/ }),\n/* 178 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.Base = exports.UndoRedo = exports.TouchScroll = exports.Search = exports.PersistentState = exports.ObserveChanges = exports.MultipleSelectionHandles = exports.MergeCells = exports.ManualRowResize = exports.ManualRowMove = exports.ManualColumnResize = exports.ManualColumnMove = exports.ManualColumnFreeze = exports.DragToScroll = exports.CustomBorders = exports.CopyPaste = exports.ContextMenuCopyPaste = exports.ContextMenu = exports.Comments = exports.ColumnSorting = exports.AutoRowSize = exports.AutoFill = exports.AutoColumnSize = undefined;\n\nvar _autoColumnSize = __webpack_require__(211);\n\nvar _autoColumnSize2 = _interopRequireDefault(_autoColumnSize);\n\nvar _autofill = __webpack_require__(213);\n\nvar _autofill2 = _interopRequireDefault(_autofill);\n\nvar _autoRowSize = __webpack_require__(212);\n\nvar _autoRowSize2 = _interopRequireDefault(_autoRowSize);\n\nvar _columnSorting = __webpack_require__(215);\n\nvar _columnSorting2 = _interopRequireDefault(_columnSorting);\n\nvar _comments = __webpack_require__(217);\n\nvar _comments2 = _interopRequireDefault(_comments);\n\nvar _contextMenu = __webpack_require__(219);\n\nvar _contextMenu2 = _interopRequireDefault(_contextMenu);\n\nvar _contextMenuCopyPaste = __webpack_require__(234);\n\nvar _contextMenuCopyPaste2 = _interopRequireDefault(_contextMenuCopyPaste);\n\nvar _copyPaste = __webpack_require__(235);\n\nvar _copyPaste2 = _interopRequireDefault(_copyPaste);\n\nvar _customBorders = __webpack_require__(236);\n\nvar _customBorders2 = _interopRequireDefault(_customBorders);\n\nvar _dragToScroll = __webpack_require__(237);\n\nvar _dragToScroll2 = _interopRequireDefault(_dragToScroll);\n\nvar _manualColumnFreeze = __webpack_require__(240);\n\nvar _manualColumnFreeze2 = _interopRequireDefault(_manualColumnFreeze);\n\nvar _manualColumnMove = __webpack_require__(242);\n\nvar _manualColumnMove2 = _interopRequireDefault(_manualColumnMove);\n\nvar _manualColumnResize = __webpack_require__(245);\n\nvar _manualColumnResize2 = _interopRequireDefault(_manualColumnResize);\n\nvar _manualRowMove = __webpack_require__(246);\n\nvar _manualRowMove2 = _interopRequireDefault(_manualRowMove);\n\nvar _manualRowResize = __webpack_require__(250);\n\nvar _manualRowResize2 = _interopRequireDefault(_manualRowResize);\n\nvar _mergeCells = __webpack_require__(251);\n\nvar _mergeCells2 = _interopRequireDefault(_mergeCells);\n\nvar _multipleSelectionHandles = __webpack_require__(252);\n\nvar _multipleSelectionHandles2 = _interopRequireDefault(_multipleSelectionHandles);\n\nvar _observeChanges = __webpack_require__(254);\n\nvar _observeChanges2 = _interopRequireDefault(_observeChanges);\n\nvar _persistentState = __webpack_require__(256);\n\nvar _persistentState2 = _interopRequireDefault(_persistentState);\n\nvar _search = __webpack_require__(257);\n\nvar _search2 = _interopRequireDefault(_search);\n\nvar _touchScroll = __webpack_require__(258);\n\nvar _touchScroll2 = _interopRequireDefault(_touchScroll);\n\nvar _undoRedo = __webpack_require__(259);\n\nvar _undoRedo2 = _interopRequireDefault(_undoRedo);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.AutoColumnSize = _autoColumnSize2.default;\nexports.AutoFill = _autofill2.default;\nexports.AutoRowSize = _autoRowSize2.default;\nexports.ColumnSorting = _columnSorting2.default;\nexports.Comments = _comments2.default;\nexports.ContextMenu = _contextMenu2.default;\nexports.ContextMenuCopyPaste = _contextMenuCopyPaste2.default;\nexports.CopyPaste = _copyPaste2.default;\nexports.CustomBorders = _customBorders2.default;\nexports.DragToScroll = _dragToScroll2.default;\nexports.ManualColumnFreeze = _manualColumnFreeze2.default;\nexports.ManualColumnMove = _manualColumnMove2.default;\nexports.ManualColumnResize = _manualColumnResize2.default;\nexports.ManualRowMove = _manualRowMove2.default;\nexports.ManualRowResize = _manualRowResize2.default;\nexports.MergeCells = _mergeCells2.default;\nexports.MultipleSelectionHandles = _multipleSelectionHandles2.default;\nexports.ObserveChanges = _observeChanges2.default;\nexports.PersistentState = _persistentState2.default;\nexports.Search = _search2.default;\nexports.TouchScroll = _touchScroll2.default;\nexports.UndoRedo = _undoRedo2.default;\nexports.Base = _base2.default;\n\n/***/ }),\n/* 179 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 180 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 181 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 182 */\n/***/ (function(module, exports) {\n\n\n\n/***/ }),\n/* 183 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * autoResize - resizes a DOM element to the width and height of another DOM element\n *\n * Copyright 2014, Marcin Warpechowski\n * Licensed under the MIT license\n */\n\nfunction autoResize() {\n var defaults = {\n minHeight: 200,\n maxHeight: 300,\n minWidth: 100,\n maxWidth: 300\n },\n el,\n body = document.body,\n text = document.createTextNode(''),\n span = document.createElement('SPAN'),\n observe = function observe(element, event, handler) {\n if (window.attachEvent) {\n element.attachEvent('on' + event, handler);\n } else {\n element.addEventListener(event, handler, false);\n }\n },\n _unObserve = function _unObserve(element, event, handler) {\n if (window.removeEventListener) {\n element.removeEventListener(event, handler, false);\n } else {\n element.detachEvent('on' + event, handler);\n }\n },\n resize = function resize(newChar) {\n var width, scrollHeight;\n\n if (!newChar) {\n newChar = \"\";\n } else if (!/^[a-zA-Z \\.,\\\\\\/\\|0-9]$/.test(newChar)) {\n newChar = \".\";\n }\n\n if (text.textContent !== void 0) {\n text.textContent = el.value + newChar;\n } else {\n text.data = el.value + newChar; //IE8\n }\n span.style.fontSize = getComputedStyle(el).fontSize;\n span.style.fontFamily = getComputedStyle(el).fontFamily;\n span.style.whiteSpace = \"pre\";\n\n body.appendChild(span);\n width = span.clientWidth + 2;\n body.removeChild(span);\n\n el.style.height = defaults.minHeight + 'px';\n\n if (defaults.minWidth > width) {\n el.style.width = defaults.minWidth + 'px';\n } else if (width > defaults.maxWidth) {\n el.style.width = defaults.maxWidth + 'px';\n } else {\n el.style.width = width + 'px';\n }\n scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0;\n\n if (defaults.minHeight > scrollHeight) {\n el.style.height = defaults.minHeight + 'px';\n } else if (defaults.maxHeight < scrollHeight) {\n el.style.height = defaults.maxHeight + 'px';\n el.style.overflowY = 'visible';\n } else {\n el.style.height = scrollHeight + 'px';\n }\n },\n delayedResize = function delayedResize() {\n window.setTimeout(resize, 0);\n },\n extendDefaults = function extendDefaults(config) {\n\n if (config && config.minHeight) {\n if (config.minHeight == 'inherit') {\n defaults.minHeight = el.clientHeight;\n } else {\n var minHeight = parseInt(config.minHeight);\n if (!isNaN(minHeight)) {\n defaults.minHeight = minHeight;\n }\n }\n }\n\n if (config && config.maxHeight) {\n if (config.maxHeight == 'inherit') {\n defaults.maxHeight = el.clientHeight;\n } else {\n var maxHeight = parseInt(config.maxHeight);\n if (!isNaN(maxHeight)) {\n defaults.maxHeight = maxHeight;\n }\n }\n }\n\n if (config && config.minWidth) {\n if (config.minWidth == 'inherit') {\n defaults.minWidth = el.clientWidth;\n } else {\n var minWidth = parseInt(config.minWidth);\n if (!isNaN(minWidth)) {\n defaults.minWidth = minWidth;\n }\n }\n }\n\n if (config && config.maxWidth) {\n if (config.maxWidth == 'inherit') {\n defaults.maxWidth = el.clientWidth;\n } else {\n var maxWidth = parseInt(config.maxWidth);\n if (!isNaN(maxWidth)) {\n defaults.maxWidth = maxWidth;\n }\n }\n }\n\n if (!span.firstChild) {\n span.className = \"autoResize\";\n span.style.display = 'inline-block';\n span.appendChild(text);\n }\n },\n _init = function _init(el_, config, doObserve) {\n el = el_;\n extendDefaults(config);\n\n if (el.nodeName == 'TEXTAREA') {\n\n el.style.resize = 'none';\n el.style.overflowY = '';\n el.style.height = defaults.minHeight + 'px';\n el.style.minWidth = defaults.minWidth + 'px';\n el.style.maxWidth = defaults.maxWidth + 'px';\n el.style.overflowY = 'hidden';\n }\n\n if (doObserve) {\n observe(el, 'change', resize);\n observe(el, 'cut', delayedResize);\n observe(el, 'paste', delayedResize);\n observe(el, 'drop', delayedResize);\n observe(el, 'keydown', delayedResize);\n observe(el, 'focus', resize);\n }\n\n resize();\n };\n\n function getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n }\n\n return {\n init: function init(el_, config, doObserve) {\n _init(el_, config, doObserve);\n },\n unObserve: function unObserve() {\n _unObserve(el, 'change', resize);\n _unObserve(el, 'cut', delayedResize);\n _unObserve(el, 'paste', delayedResize);\n _unObserve(el, 'drop', delayedResize);\n _unObserve(el, 'keydown', delayedResize);\n _unObserve(el, 'focus', resize);\n },\n resize: resize\n };\n}\n\nif (true) {\n module.exports = autoResize;\n}\n\n/***/ }),\n/* 184 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Creates a textarea that stays hidden on the page and gets focused when user presses CTRL while not having a form\n * input focused.\n * In future we may implement a better driver when better APIs are available.\n *\n * @constructor\n * @private\n */\n\nvar instance;\n\nfunction copyPaste() {\n if (!instance) {\n instance = new CopyPasteClass();\n } else if (instance.hasBeenDestroyed()) {\n instance.init();\n }\n instance.refCounter++;\n\n return instance;\n}\n\nif (true) {\n module.exports = copyPaste;\n}\n\nfunction CopyPasteClass() {\n this.refCounter = 0;\n this.init();\n}\n\nCopyPasteClass.prototype.init = function () {\n var style, parent;\n\n this.copyCallbacks = [];\n this.cutCallbacks = [];\n this.pasteCallbacks = [];\n\n // this.listenerElement = document.documentElement;\n parent = document.body;\n\n if (document.getElementById('CopyPasteDiv')) {\n this.elDiv = document.getElementById('CopyPasteDiv');\n this.elTextarea = this.elDiv.firstChild;\n } else {\n this.elDiv = document.createElement('div');\n this.elDiv.id = 'CopyPasteDiv';\n style = this.elDiv.style;\n style.position = 'fixed';\n style.top = '-10000px';\n style.left = '-10000px';\n parent.appendChild(this.elDiv);\n\n this.elTextarea = document.createElement('textarea');\n this.elTextarea.className = 'copyPaste';\n this.elTextarea.onpaste = function (event) {\n var clipboardContents, temp;\n\n if ('WebkitAppearance' in document.documentElement.style) {\n // chrome and safari\n clipboardContents = event.clipboardData.getData(\"Text\");\n\n // Safari adds an additional newline to copied text\n if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {\n temp = clipboardContents.split('\\n');\n\n if (temp[temp.length - 1] === '') {\n temp.pop();\n }\n clipboardContents = temp.join('\\n');\n }\n this.value = clipboardContents;\n\n event.preventDefault();\n }\n };\n style = this.elTextarea.style;\n style.width = '10000px';\n style.height = '10000px';\n style.overflow = 'hidden';\n this.elDiv.appendChild(this.elTextarea);\n\n if (typeof style.opacity !== 'undefined') {\n style.opacity = 0;\n }\n }\n this.onKeyDownRef = this.onKeyDown.bind(this);\n document.documentElement.addEventListener('keydown', this.onKeyDownRef, false);\n};\n\n/**\n * Call method on every key down event\n *\n * @param {Event} event\n */\nCopyPasteClass.prototype.onKeyDown = function (event) {\n var _this = this,\n isCtrlDown = false;\n\n function isActiveElementEditable() {\n var element = document.activeElement;\n\n if (element.shadowRoot && element.shadowRoot.activeElement) {\n element = element.shadowRoot.activeElement;\n }\n\n return ['INPUT', 'SELECT', 'TEXTAREA'].indexOf(element.nodeName) > -1 || element.contentEditable === 'true';\n }\n\n // mac\n if (event.metaKey) {\n isCtrlDown = true;\n }\n // pc\n else if (event.ctrlKey && navigator.userAgent.indexOf('Mac') === -1) {\n isCtrlDown = true;\n }\n if (isCtrlDown) {\n // this is needed by fragmentSelection in Handsontable. Ignore copypaste.js behavior if fragment of cell text is selected\n if (document.activeElement !== this.elTextarea && (this.getSelectionText() !== '' || isActiveElementEditable())) {\n return;\n }\n this.selectNodeText(this.elTextarea);\n setTimeout(function () {\n if (document.activeElement !== _this.elTextarea) {\n _this.selectNodeText(_this.elTextarea);\n }\n }, 0);\n }\n\n if (event.isImmediatePropagationEnabled !== false && isCtrlDown && (event.keyCode === 67 || event.keyCode === 86 || event.keyCode === 88)) {\n // works in all browsers, incl. Opera < 12.12\n if (event.keyCode === 88) {\n setTimeout(function () {\n _this.triggerCut(event);\n }, 0);\n } else if (event.keyCode === 86) {\n setTimeout(function () {\n _this.triggerPaste(event);\n }, 0);\n }\n }\n};\n\n//http://jsperf.com/textara-selection\n//http://stackoverflow.com/questions/1502385/how-can-i-make-this-code-work-in-ie\n/**\n * Select all text contains in passed node element\n *\n * @param {Element} element\n */\nCopyPasteClass.prototype.selectNodeText = function (element) {\n if (element) {\n element.select();\n }\n};\n\n//http://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text\n/**\n * Get selection text\n *\n * @returns {String}\n */\nCopyPasteClass.prototype.getSelectionText = function () {\n var text = '';\n\n if (window.getSelection) {\n text = window.getSelection().toString();\n } else if (document.selection && document.selection.type !== 'Control') {\n text = document.selection.createRange().text;\n }\n\n return text;\n};\n\n/**\n * Make string copyable\n *\n * @param {String} string\n */\nCopyPasteClass.prototype.copyable = function (string) {\n if (typeof string !== 'string' && string.toString === void 0) {\n throw new Error('copyable requires string parameter');\n }\n this.elTextarea.value = string;\n this.selectNodeText(this.elTextarea);\n};\n\n/*CopyPasteClass.prototype.onCopy = function (fn) {\n this.copyCallbacks.push(fn);\n};*/\n\n/**\n * Add function callback to onCut event\n *\n * @param {Function} callback\n */\nCopyPasteClass.prototype.onCut = function (callback) {\n this.cutCallbacks.push(callback);\n};\n\n/**\n * Add function callback to onPaste event\n *\n * @param {Function} callback\n */\nCopyPasteClass.prototype.onPaste = function (callback) {\n this.pasteCallbacks.push(callback);\n};\n\n/**\n * Remove callback from all events\n *\n * @param {Function} callback\n * @returns {Boolean}\n */\nCopyPasteClass.prototype.removeCallback = function (callback) {\n var i, len;\n\n for (i = 0, len = this.copyCallbacks.length; i < len; i++) {\n if (this.copyCallbacks[i] === callback) {\n this.copyCallbacks.splice(i, 1);\n\n return true;\n }\n }\n for (i = 0, len = this.cutCallbacks.length; i < len; i++) {\n if (this.cutCallbacks[i] === callback) {\n this.cutCallbacks.splice(i, 1);\n\n return true;\n }\n }\n for (i = 0, len = this.pasteCallbacks.length; i < len; i++) {\n if (this.pasteCallbacks[i] === callback) {\n this.pasteCallbacks.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * Trigger cut event\n *\n * @param {DOMEvent} event\n */\nCopyPasteClass.prototype.triggerCut = function (event) {\n var _this = this;\n\n if (_this.cutCallbacks) {\n setTimeout(function () {\n for (var i = 0, len = _this.cutCallbacks.length; i < len; i++) {\n _this.cutCallbacks[i](event);\n }\n }, 50);\n }\n};\n\n/**\n * Trigger paste event\n *\n * @param {DOMEvent} event\n * @param {String} string\n */\nCopyPasteClass.prototype.triggerPaste = function (event, string) {\n var _this = this;\n\n if (_this.pasteCallbacks) {\n setTimeout(function () {\n var val = string || _this.elTextarea.value;\n\n for (var i = 0, len = _this.pasteCallbacks.length; i < len; i++) {\n _this.pasteCallbacks[i](val, event);\n }\n }, 50);\n }\n};\n\n/**\n * Destroy instance\n */\nCopyPasteClass.prototype.destroy = function () {\n if (!this.hasBeenDestroyed() && --this.refCounter === 0) {\n if (this.elDiv && this.elDiv.parentNode) {\n this.elDiv.parentNode.removeChild(this.elDiv);\n this.elDiv = null;\n this.elTextarea = null;\n }\n document.documentElement.removeEventListener('keydown', this.onKeyDownRef);\n this.onKeyDownRef = null;\n }\n};\n\n/**\n * Check if instance has been destroyed\n *\n * @returns {Boolean}\n */\nCopyPasteClass.prototype.hasBeenDestroyed = function () {\n return !this.refCounter;\n};\n\n/***/ }),\n/* 185 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A overlay that renders ALL available rows & columns positioned on top of the original Walkontable instance and all other overlays.\n * Used for debugging purposes to see if the other overlays (that render only part of the rows & columns) are positioned correctly\n *\n * @class DebugOverlay\n */\nvar DebugOverlay = function (_Overlay) {\n _inherits(DebugOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function DebugOverlay(wotInstance) {\n _classCallCheck(this, DebugOverlay);\n\n var _this = _possibleConstructorReturn(this, (DebugOverlay.__proto__ || Object.getPrototypeOf(DebugOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_DEBUG);\n _this.clone.wtTable.holder.style.opacity = 0.4;\n _this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000';\n\n (0, _element.addClass)(_this.clone.wtTable.holder.parentNode, 'wtDebugVisible');\n return _this;\n }\n\n return DebugOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_DEBUG, DebugOverlay);\n\nexports.default = DebugOverlay;\n\n/***/ }),\n/* 186 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class LeftOverlay\n */\nvar LeftOverlay = function (_Overlay) {\n _inherits(LeftOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function LeftOverlay(wotInstance) {\n _classCallCheck(this, LeftOverlay);\n\n var _this = _possibleConstructorReturn(this, (LeftOverlay.__proto__ || Object.getPrototypeOf(LeftOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_LEFT);\n return _this;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n\n _createClass(LeftOverlay, [{\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return !!(this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length);\n }\n\n /**\n * Updates the left overlay position\n */\n\n }, {\n key: 'resetFixedPosition',\n value: function resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var headerPosition = 0;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {\n var box = this.wot.wtTable.hider.getBoundingClientRect();\n var left = Math.ceil(box.left);\n var right = Math.ceil(box.right);\n var finalLeft = void 0;\n var finalTop = void 0;\n\n finalTop = this.wot.wtTable.hider.style.top;\n finalTop = finalTop === '' ? 0 : finalTop;\n\n if (left < 0 && right - overlayRoot.offsetWidth > 0) {\n finalLeft = -left;\n } else {\n finalLeft = 0;\n }\n headerPosition = finalLeft;\n finalLeft += 'px';\n\n (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);\n } else {\n headerPosition = this.getScrollPosition();\n (0, _element.resetCssTransform)(overlayRoot);\n }\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }\n\n /**\n * Sets the main overlay's horizontal scroll position\n *\n * @param {Number} pos\n */\n\n }, {\n key: 'setScrollPosition',\n value: function setScrollPosition(pos) {\n if (this.mainTableScrollableElement === window) {\n window.scrollTo(pos, (0, _element.getWindowScrollTop)());\n } else {\n this.mainTableScrollableElement.scrollLeft = pos;\n }\n }\n\n /**\n * Triggers onScroll hook callback\n */\n\n }, {\n key: 'onScroll',\n value: function onScroll() {\n this.wot.getSetting('onScrollVertically');\n }\n\n /**\n * Calculates total sum cells width\n *\n * @param {Number} from Column index which calculates started from\n * @param {Number} to Column index where calculation is finished\n * @returns {Number} Width sum\n */\n\n }, {\n key: 'sumCellSizes',\n value: function sumCellSizes(from, to) {\n var sum = 0;\n var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;\n\n while (from < to) {\n sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth;\n from++;\n }\n\n return sum;\n }\n\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {Boolean} [force=false]\n */\n\n }, {\n key: 'adjustElementsSize',\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n\n if (!force) {\n this.areElementSizesAdjusted = true;\n }\n }\n }\n\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: 'adjustRootElementSize',\n value: function adjustRootElementSize() {\n var masterHolder = this.wot.wtTable.holder;\n var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : (0, _element.getScrollbarWidth)();\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var tableWidth = void 0;\n\n if (this.trimmingContainer !== window || preventOverflow === 'vertical') {\n var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight;\n\n height = Math.min(height, (0, _element.innerHeight)(this.wot.wtTable.wtRootElement));\n\n overlayRootStyle.height = height + 'px';\n } else {\n overlayRootStyle.height = '';\n }\n\n this.clone.wtTable.holder.style.height = overlayRootStyle.height;\n\n tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);\n overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';\n }\n\n /**\n * Adjust overlay root childs size\n */\n\n }, {\n key: 'adjustRootChildrenSize',\n value: function adjustRootChildrenSize() {\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n this.clone.wtTable.hider.style.height = this.hider.style.height;\n this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px';\n }\n\n /**\n * Adjust the overlay dimensions and position\n */\n\n }, {\n key: 'applyToDOM',\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalColumns');\n\n if (!this.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';\n } else if (total === 0) {\n this.spreader.style.left = '0';\n } else {\n throw new Error('Incorrect value of the columnsRenderCalculator');\n }\n this.spreader.style.right = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n\n /**\n * Synchronize calculated top position to an element\n */\n\n }, {\n key: 'syncOverlayOffset',\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';\n } else {\n this.clone.wtTable.spreader.style.top = '';\n }\n }\n\n /**\n * Scrolls horizontally to a column at the left edge of the viewport\n *\n * @param sourceCol {Number} Column index which you want to scroll to\n * @param [beyondRendered=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)\n */\n\n }, {\n key: 'scrollTo',\n value: function scrollTo(sourceCol, beyondRendered) {\n var newX = this.getTableParentOffset();\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var scrollbarCompensation = 0;\n\n if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {\n scrollbarCompensation = (0, _element.getScrollbarWidth)();\n }\n if (beyondRendered) {\n newX += this.sumCellSizes(0, sourceCol + 1);\n newX -= this.wot.wtViewport.getViewportWidth();\n } else {\n newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);\n }\n newX += scrollbarCompensation;\n\n this.setScrollPosition(newX);\n }\n\n /**\n * Gets table parent left position\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getTableParentOffset',\n value: function getTableParentOffset() {\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var offset = 0;\n\n if (!preventOverflow && this.trimmingContainer === window) {\n offset = this.wot.wtTable.holderOffset.left;\n }\n\n return offset;\n }\n\n /**\n * Gets the main overlay's horizontal scroll position\n *\n * @returns {Number} Main table's vertical scroll position\n */\n\n }, {\n key: 'getScrollPosition',\n value: function getScrollPosition() {\n return (0, _element.getScrollLeft)(this.mainTableScrollableElement);\n }\n\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue)\n *\n * @param {Number} position Header X position if trimming container is window or scroll top if not\n */\n\n }, {\n key: 'adjustHeaderBordersPosition',\n value: function adjustHeaderBordersPosition(position) {\n var masterParent = this.wot.wtTable.holder.parentNode;\n var rowHeaders = this.wot.getSetting('rowHeaders');\n var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n var totalRows = this.wot.getSetting('totalRows');\n\n if (totalRows) {\n (0, _element.removeClass)(masterParent, 'emptyRows');\n } else {\n (0, _element.addClass)(masterParent, 'emptyRows');\n }\n\n if (fixedColumnsLeft && !rowHeaders.length) {\n (0, _element.addClass)(masterParent, 'innerBorderLeft');\n } else if (!fixedColumnsLeft && rowHeaders.length) {\n var previousState = (0, _element.hasClass)(masterParent, 'innerBorderLeft');\n\n if (position) {\n (0, _element.addClass)(masterParent, 'innerBorderLeft');\n } else {\n (0, _element.removeClass)(masterParent, 'innerBorderLeft');\n }\n if (!previousState && position || previousState && !position) {\n this.wot.wtOverlays.adjustElementsSize();\n }\n }\n }\n }]);\n\n return LeftOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_LEFT, LeftOverlay);\n\nexports.default = LeftOverlay;\n\n/***/ }),\n/* 187 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class TopOverlay\n */\nvar TopOverlay = function (_Overlay) {\n _inherits(TopOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function TopOverlay(wotInstance) {\n _classCallCheck(this, TopOverlay);\n\n var _this = _possibleConstructorReturn(this, (TopOverlay.__proto__ || Object.getPrototypeOf(TopOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_TOP);\n return _this;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n\n _createClass(TopOverlay, [{\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return !!(this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length);\n }\n\n /**\n * Updates the top overlay position\n */\n\n }, {\n key: 'resetFixedPosition',\n value: function resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var headerPosition = 0;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) {\n var box = this.wot.wtTable.hider.getBoundingClientRect();\n var top = Math.ceil(box.top);\n var bottom = Math.ceil(box.bottom);\n var finalLeft = void 0;\n var finalTop = void 0;\n\n finalLeft = this.wot.wtTable.hider.style.left;\n finalLeft = finalLeft === '' ? 0 : finalLeft;\n\n if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {\n finalTop = -top;\n } else {\n finalTop = 0;\n }\n headerPosition = finalTop;\n finalTop += 'px';\n\n (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);\n } else {\n headerPosition = this.getScrollPosition();\n (0, _element.resetCssTransform)(overlayRoot);\n }\n\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }\n\n /**\n * Sets the main overlay's vertical scroll position\n *\n * @param {Number} pos\n */\n\n }, {\n key: 'setScrollPosition',\n value: function setScrollPosition(pos) {\n if (this.mainTableScrollableElement === window) {\n window.scrollTo((0, _element.getWindowScrollLeft)(), pos);\n } else {\n this.mainTableScrollableElement.scrollTop = pos;\n }\n }\n\n /**\n * Triggers onScroll hook callback\n */\n\n }, {\n key: 'onScroll',\n value: function onScroll() {\n this.wot.getSetting('onScrollHorizontally');\n }\n\n /**\n * Calculates total sum cells height\n *\n * @param {Number} from Row index which calculates started from\n * @param {Number} to Row index where calculation is finished\n * @returns {Number} Height sum\n */\n\n }, {\n key: 'sumCellSizes',\n value: function sumCellSizes(from, to) {\n var sum = 0;\n var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n\n while (from < to) {\n var height = this.wot.wtTable.getRowHeight(from);\n\n sum += height === void 0 ? defaultRowHeight : height;\n from++;\n }\n\n return sum;\n }\n\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {Boolean} [force=false]\n */\n\n }, {\n key: 'adjustElementsSize',\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n\n if (!force) {\n this.areElementSizesAdjusted = true;\n }\n }\n }\n\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: 'adjustRootElementSize',\n value: function adjustRootElementSize() {\n var masterHolder = this.wot.wtTable.holder;\n var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : (0, _element.getScrollbarWidth)();\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var tableHeight = void 0;\n\n if (this.trimmingContainer !== window || preventOverflow === 'horizontal') {\n var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth;\n\n width = Math.min(width, (0, _element.innerWidth)(this.wot.wtTable.wtRootElement));\n\n overlayRootStyle.width = width + 'px';\n } else {\n overlayRootStyle.width = '';\n }\n\n this.clone.wtTable.holder.style.width = overlayRootStyle.width;\n\n tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);\n overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';\n }\n\n /**\n * Adjust overlay root childs size\n */\n\n }, {\n key: 'adjustRootChildrenSize',\n value: function adjustRootChildrenSize() {\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n this.clone.wtTable.hider.style.width = this.hider.style.width;\n this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px';\n }\n\n /**\n * Adjust the overlay dimensions and position\n */\n\n }, {\n key: 'applyToDOM',\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalRows');\n\n if (!this.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';\n } else if (total === 0) {\n // can happen if there are 0 rows\n this.spreader.style.top = '0';\n } else {\n throw new Error('Incorrect value of the rowsRenderCalculator');\n }\n this.spreader.style.bottom = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n\n /**\n * Synchronize calculated left position to an element\n */\n\n }, {\n key: 'syncOverlayOffset',\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';\n } else {\n this.clone.wtTable.spreader.style.left = '';\n }\n }\n\n /**\n * Scrolls vertically to a row\n *\n * @param sourceRow {Number} Row index which you want to scroll to\n * @param [bottomEdge=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)\n */\n\n }, {\n key: 'scrollTo',\n value: function scrollTo(sourceRow, bottomEdge) {\n var newY = this.getTableParentOffset();\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var scrollbarCompensation = 0;\n\n if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {\n scrollbarCompensation = (0, _element.getScrollbarWidth)();\n }\n\n if (bottomEdge) {\n var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n var fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n var totalRows = this.wot.getSetting('totalRows');\n\n newY += this.sumCellSizes(0, sourceRow + 1);\n newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n // Fix 1 pixel offset when cell is selected\n newY += 1;\n } else {\n newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow);\n }\n newY += scrollbarCompensation;\n\n this.setScrollPosition(newY);\n }\n\n /**\n * Gets table parent top position\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getTableParentOffset',\n value: function getTableParentOffset() {\n if (this.mainTableScrollableElement === window) {\n return this.wot.wtTable.holderOffset.top;\n }\n return 0;\n }\n\n /**\n * Gets the main overlay's vertical scroll position\n *\n * @returns {Number} Main table's vertical scroll position\n */\n\n }, {\n key: 'getScrollPosition',\n value: function getScrollPosition() {\n return (0, _element.getScrollTop)(this.mainTableScrollableElement);\n }\n\n /**\n * Redraw borders of selection\n *\n * @param {WalkontableSelection} selection Selection for redraw\n */\n\n }, {\n key: 'redrawSelectionBorders',\n value: function redrawSelectionBorders(selection) {\n if (selection && selection.cellRange) {\n var border = selection.getBorder(this.wot);\n\n if (border) {\n var corners = selection.getCorners();\n border.disappear();\n border.appear(corners);\n }\n }\n }\n\n /**\n * Redrawing borders of all selections\n */\n\n }, {\n key: 'redrawAllSelectionsBorders',\n value: function redrawAllSelectionsBorders() {\n var selections = this.wot.selections;\n\n this.redrawSelectionBorders(selections.current);\n this.redrawSelectionBorders(selections.area);\n this.redrawSelectionBorders(selections.fill);\n this.wot.wtTable.wot.wtOverlays.leftOverlay.refresh();\n }\n\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue)\n *\n * @param {Number} position Header Y position if trimming container is window or scroll top if not\n */\n\n }, {\n key: 'adjustHeaderBordersPosition',\n value: function adjustHeaderBordersPosition(position) {\n var masterParent = this.wot.wtTable.holder.parentNode;\n var totalColumns = this.wot.getSetting('totalColumns');\n\n if (totalColumns) {\n (0, _element.removeClass)(masterParent, 'emptyColumns');\n } else {\n (0, _element.addClass)(masterParent, 'emptyColumns');\n }\n\n if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) {\n var previousState = (0, _element.hasClass)(masterParent, 'innerBorderTop');\n\n if (position || this.wot.getSetting('totalRows') === 0) {\n (0, _element.addClass)(masterParent, 'innerBorderTop');\n } else {\n (0, _element.removeClass)(masterParent, 'innerBorderTop');\n }\n\n if (!previousState && position || previousState && !position) {\n this.wot.wtOverlays.adjustElementsSize();\n\n // cell borders should be positioned once again,\n // because we added / removed 1px border from table header\n this.redrawAllSelectionsBorders();\n }\n }\n\n // nasty workaround for double border in the header, TODO: find a pure-css solution\n if (this.wot.getSetting('rowHeaders').length === 0) {\n var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');\n\n if (secondHeaderCell) {\n for (var i = 0; i < secondHeaderCell.length; i++) {\n secondHeaderCell[i].style['border-left-width'] = 0;\n }\n }\n }\n }\n }]);\n\n return TopOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_TOP, TopOverlay);\n\nexports.default = TopOverlay;\n\n/***/ }),\n/* 188 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class TopLeftCornerOverlay\n */\nvar TopLeftCornerOverlay = function (_Overlay) {\n _inherits(TopLeftCornerOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function TopLeftCornerOverlay(wotInstance) {\n _classCallCheck(this, TopLeftCornerOverlay);\n\n var _this = _possibleConstructorReturn(this, (TopLeftCornerOverlay.__proto__ || Object.getPrototypeOf(TopLeftCornerOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_TOP_LEFT_CORNER);\n return _this;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n\n _createClass(TopLeftCornerOverlay, [{\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return !!((this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length));\n }\n\n /**\n * Updates the corner overlay position\n */\n\n }, {\n key: 'resetFixedPosition',\n value: function resetFixedPosition() {\n this.updateTrimmingContainer();\n\n if (!this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);\n var tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window) {\n var box = this.wot.wtTable.hider.getBoundingClientRect();\n var top = Math.ceil(box.top);\n var left = Math.ceil(box.left);\n var bottom = Math.ceil(box.bottom);\n var right = Math.ceil(box.right);\n var finalLeft = '0';\n var finalTop = '0';\n\n if (!preventOverflow || preventOverflow === 'vertical') {\n if (left < 0 && right - overlayRoot.offsetWidth > 0) {\n finalLeft = -left + 'px';\n }\n }\n\n if (!preventOverflow || preventOverflow === 'horizontal') {\n if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {\n finalTop = -top + 'px';\n }\n }\n (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);\n } else {\n (0, _element.resetCssTransform)(overlayRoot);\n }\n overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';\n overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';\n }\n }]);\n\n return TopLeftCornerOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, TopLeftCornerOverlay);\n\nexports.default = TopLeftCornerOverlay;\n\n/***/ }),\n/* 189 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _border2 = __webpack_require__(134);\n\nvar _border3 = _interopRequireDefault(_border2);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _range = __webpack_require__(69);\n\nvar _range2 = _interopRequireDefault(_range);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Selection\n */\nvar Selection = function () {\n /**\n * @param {Object} settings\n * @param {CellRange} cellRange\n */\n function Selection(settings, cellRange) {\n _classCallCheck(this, Selection);\n\n this.settings = settings;\n this.cellRange = cellRange || null;\n this.instanceBorders = {};\n }\n\n /**\n * Each Walkontable clone requires it's own border for every selection. This method creates and returns selection\n * borders per instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Border}\n */\n\n\n _createClass(Selection, [{\n key: 'getBorder',\n value: function getBorder(wotInstance) {\n if (this.instanceBorders[wotInstance.guid]) {\n return this.instanceBorders[wotInstance.guid];\n }\n\n // where is this returned?\n this.instanceBorders[wotInstance.guid] = new _border3.default(wotInstance, this.settings);\n }\n\n /**\n * Checks if selection is empty\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.cellRange === null;\n }\n\n /**\n * Adds a cell coords to the selection\n *\n * @param {CellCoords} coords\n */\n\n }, {\n key: 'add',\n value: function add(coords) {\n if (this.isEmpty()) {\n this.cellRange = new _range2.default(coords, coords, coords);\n } else {\n this.cellRange.expand(coords);\n }\n }\n\n /**\n * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean\n * information about success\n *\n * @param {CellCoords} oldCoords\n * @param {CellCoords} newCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'replace',\n value: function replace(oldCoords, newCoords) {\n if (!this.isEmpty()) {\n if (this.cellRange.from.isEqual(oldCoords)) {\n this.cellRange.from = newCoords;\n\n return true;\n }\n if (this.cellRange.to.isEqual(oldCoords)) {\n this.cellRange.to = newCoords;\n\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Clears selection\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n this.cellRange = null;\n }\n\n /**\n * Returns the top left (TL) and bottom right (BR) selection coordinates\n *\n * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`\n */\n\n }, {\n key: 'getCorners',\n value: function getCorners() {\n var topLeft = this.cellRange.getTopLeftCorner();\n var bottomRight = this.cellRange.getBottomRightCorner();\n\n return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];\n }\n\n /**\n * Adds class name to cell element at given coords\n *\n * @param {Walkontable} wotInstance Walkontable instance\n * @param {Number} sourceRow Cell row coord\n * @param {Number} sourceColumn Cell column coord\n * @param {String} className Class name\n */\n\n }, {\n key: 'addClassAtCoords',\n value: function addClassAtCoords(wotInstance, sourceRow, sourceColumn, className) {\n var TD = wotInstance.wtTable.getCell(new _coords2.default(sourceRow, sourceColumn));\n\n if ((typeof TD === 'undefined' ? 'undefined' : _typeof(TD)) === 'object') {\n (0, _element.addClass)(TD, className);\n }\n }\n\n /**\n * @param wotInstance\n */\n\n }, {\n key: 'draw',\n value: function draw(wotInstance) {\n if (this.isEmpty()) {\n if (this.settings.border) {\n var border = this.getBorder(wotInstance);\n\n if (border) {\n border.disappear();\n }\n }\n\n return;\n }\n var renderedRows = wotInstance.wtTable.getRenderedRowsCount();\n var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();\n var corners = this.getCorners();\n var sourceRow = void 0,\n sourceCol = void 0,\n TH = void 0;\n\n for (var column = 0; column < renderedColumns; column++) {\n sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);\n\n if (sourceCol >= corners[1] && sourceCol <= corners[3]) {\n TH = wotInstance.wtTable.getColumnHeader(sourceCol);\n\n if (TH) {\n var newClasses = [];\n\n if (this.settings.highlightHeaderClassName) {\n newClasses.push(this.settings.highlightHeaderClassName);\n }\n\n if (this.settings.highlightColumnClassName) {\n newClasses.push(this.settings.highlightColumnClassName);\n }\n\n (0, _element.addClass)(TH, newClasses);\n }\n }\n }\n\n for (var row = 0; row < renderedRows; row++) {\n sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);\n\n if (sourceRow >= corners[0] && sourceRow <= corners[2]) {\n TH = wotInstance.wtTable.getRowHeader(sourceRow);\n\n if (TH) {\n var _newClasses = [];\n\n if (this.settings.highlightHeaderClassName) {\n _newClasses.push(this.settings.highlightHeaderClassName);\n }\n\n if (this.settings.highlightRowClassName) {\n _newClasses.push(this.settings.highlightRowClassName);\n }\n\n (0, _element.addClass)(TH, _newClasses);\n }\n }\n\n for (var _column = 0; _column < renderedColumns; _column++) {\n sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(_column);\n\n if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) {\n // selected cell\n if (this.settings.className) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className);\n }\n } else if (sourceRow >= corners[0] && sourceRow <= corners[2]) {\n // selection is in this row\n if (this.settings.highlightRowClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName);\n }\n } else if (sourceCol >= corners[1] && sourceCol <= corners[3]) {\n // selection is in this column\n if (this.settings.highlightColumnClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName);\n }\n }\n }\n }\n wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);\n\n if (this.settings.border) {\n var _border = this.getBorder(wotInstance);\n\n if (_border) {\n // warning! border.appear modifies corners!\n _border.appear(corners);\n }\n }\n }\n }]);\n\n return Selection;\n}();\n\nexports.default = Selection;\n\n/***/ }),\n/* 190 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'autocomplete';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE),\n validator: (0, _validators.getValidator)(CELL_TYPE)\n};\n\n/***/ }),\n/* 191 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar CELL_TYPE = 'checkbox';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE)\n};\n\n/***/ }),\n/* 192 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'date';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('autocomplete'),\n validator: (0, _validators.getValidator)(CELL_TYPE)\n};\n\n/***/ }),\n/* 193 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'dropdown';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('autocomplete'),\n validator: (0, _validators.getValidator)('autocomplete')\n};\n\n/***/ }),\n/* 194 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar CELL_TYPE = 'handsontable';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('autocomplete')\n};\n\n/***/ }),\n/* 195 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'numeric';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE),\n validator: (0, _validators.getValidator)(CELL_TYPE),\n dataType: 'number'\n};\n\n/***/ }),\n/* 196 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'password';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE),\n copyable: false\n};\n\n/***/ }),\n/* 197 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _browser = __webpack_require__(25);\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar CELL_TYPE = 'text';\n\nexports.default = {\n editor: (0, _browser.isMobileBrowser)() ? (0, _editors.getEditor)('mobile') : (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE)\n};\n\n/***/ }),\n/* 198 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'time';\n\nexports.default = {\n editor: (0, _editors.getEditor)('text'),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('text'),\n validator: (0, _validators.getValidator)(CELL_TYPE)\n};\n\n/***/ }),\n/* 199 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _SheetClip = __webpack_require__(132);\n\nvar _SheetClip2 = _interopRequireDefault(_SheetClip);\n\nvar _data = __webpack_require__(65);\n\nvar _setting = __webpack_require__(66);\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _interval = __webpack_require__(269);\n\nvar _interval2 = _interopRequireDefault(_interval);\n\nvar _number = __webpack_require__(6);\n\nvar _multiMap = __webpack_require__(210);\n\nvar _multiMap2 = _interopRequireDefault(_multiMap);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names\n * @todo refactor arguments of methods getRange, getText to be numbers (not objects)\n * @todo remove priv, GridSettings from object constructor\n *\n * @param {Object} instance Instance of Handsontable\n * @param {*} priv\n * @param {*} GridSettings Grid settings\n * @util\n * @class DataMap\n */\nfunction DataMap(instance, priv, GridSettings) {\n var _this = this;\n\n this.instance = instance;\n this.priv = priv;\n this.GridSettings = GridSettings;\n this.dataSource = this.instance.getSettings().data;\n this.cachedLength = null;\n this.skipCache = false;\n this.latestSourceRowsCount = 0;\n\n if (this.dataSource && this.dataSource[0]) {\n this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]);\n } else {\n this.duckSchema = {};\n }\n this.createMap();\n this.interval = _interval2.default.create(function () {\n return _this.clearLengthCache();\n }, '15fps');\n\n this.instance.addHook('skipLengthCache', function (delay) {\n return _this.onSkipLengthCache(delay);\n });\n this.onSkipLengthCache(500);\n}\n\nDataMap.prototype.DESTINATION_RENDERER = 1;\nDataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2;\n\n/**\n * @param {Object|Array} object\n * @returns {Object|Array}\n */\nDataMap.prototype.recursiveDuckSchema = function (object) {\n return (0, _object.duckSchema)(object);\n};\n\n/**\n * @param {Object} schema\n * @param {Number} lastCol\n * @param {Number} parent\n * @returns {Number}\n */\nDataMap.prototype.recursiveDuckColumns = function (schema, lastCol, parent) {\n var prop, i;\n if (typeof lastCol === 'undefined') {\n lastCol = 0;\n parent = '';\n }\n if ((typeof schema === 'undefined' ? 'undefined' : _typeof(schema)) === 'object' && !Array.isArray(schema)) {\n for (i in schema) {\n if ((0, _object.hasOwnProperty)(schema, i)) {\n if (schema[i] === null) {\n prop = parent + i;\n this.colToPropCache.push(prop);\n this.propToColCache.set(prop, lastCol);\n\n lastCol++;\n } else {\n lastCol = this.recursiveDuckColumns(schema[i], lastCol, i + '.');\n }\n }\n }\n }\n\n return lastCol;\n};\n\nDataMap.prototype.createMap = function () {\n var i = void 0;\n var schema = this.getSchema();\n\n if (typeof schema === 'undefined') {\n throw new Error('trying to create `columns` definition but you didn\\'t provide `schema` nor `data`');\n }\n\n this.colToPropCache = [];\n this.propToColCache = new _multiMap2.default();\n\n var columns = this.instance.getSettings().columns;\n\n if (columns) {\n var maxCols = this.instance.getSettings().maxCols;\n var columnsLen = Math.min(maxCols, columns.length);\n var filteredIndex = 0;\n var columnsAsFunc = false;\n var schemaLen = (0, _object.deepObjectSize)(schema);\n\n if (typeof columns === 'function') {\n columnsLen = schemaLen > 0 ? schemaLen : this.instance.countSourceCols();\n columnsAsFunc = true;\n }\n\n for (i = 0; i < columnsLen; i++) {\n var column = columnsAsFunc ? columns(i) : columns[i];\n\n if ((0, _object.isObject)(column)) {\n if (typeof column.data !== 'undefined') {\n var index = columnsAsFunc ? filteredIndex : i;\n this.colToPropCache[index] = column.data;\n this.propToColCache.set(column.data, index);\n }\n\n filteredIndex++;\n }\n }\n } else {\n this.recursiveDuckColumns(schema);\n }\n};\n\n/**\n * Returns property name that corresponds with the given column index.\n *\n * @param {Number} col\n * @returns {Number}\n */\nDataMap.prototype.colToProp = function (col) {\n col = this.instance.runHooks('modifyCol', col);\n\n if (!isNaN(col) && this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') {\n return this.colToPropCache[col];\n }\n\n return col;\n};\n\n/**\n * @param {Object} prop\n * @fires Hooks#modifyCol\n * @returns {*}\n */\nDataMap.prototype.propToCol = function (prop) {\n var col;\n\n if (typeof this.propToColCache.get(prop) === 'undefined') {\n col = prop;\n } else {\n col = this.propToColCache.get(prop);\n }\n col = this.instance.runHooks('unmodifyCol', col);\n\n return col;\n};\n\n/**\n * @returns {Object}\n */\nDataMap.prototype.getSchema = function () {\n var schema = this.instance.getSettings().dataSchema;\n\n if (schema) {\n if (typeof schema === 'function') {\n return schema();\n }\n return schema;\n }\n\n return this.duckSchema;\n};\n\n/**\n * Creates row at the bottom of the data array.\n *\n * @param {Number} [index] Index of the row before which the new row will be inserted.\n * @param {Number} [amount] An amount of rows to add.\n * @param {String} [source] Source of method call.\n * @fires Hooks#afterCreateRow\n * @returns {Number} Returns number of created rows.\n */\nDataMap.prototype.createRow = function (index, amount, source) {\n var row,\n colCount = this.instance.countCols(),\n numberOfCreatedRows = 0,\n currentIndex;\n\n if (!amount) {\n amount = 1;\n }\n\n if (typeof index !== 'number' || index >= this.instance.countSourceRows()) {\n index = this.instance.countSourceRows();\n }\n this.instance.runHooks('beforeCreateRow', index, amount, source);\n\n currentIndex = index;\n var maxRows = this.instance.getSettings().maxRows;\n\n while (numberOfCreatedRows < amount && this.instance.countSourceRows() < maxRows) {\n if (this.instance.dataType === 'array') {\n if (this.instance.getSettings().dataSchema) {\n // Clone template array\n row = (0, _object.deepClone)(this.getSchema());\n } else {\n row = [];\n /* eslint-disable no-loop-func */\n (0, _number.rangeEach)(colCount - 1, function () {\n return row.push(null);\n });\n }\n } else if (this.instance.dataType === 'function') {\n row = this.instance.getSettings().dataSchema(index);\n } else {\n row = {};\n (0, _object.deepExtend)(row, this.getSchema());\n }\n\n if (index === this.instance.countSourceRows()) {\n this.dataSource.push(row);\n } else {\n this.spliceData(index, 0, row);\n }\n\n numberOfCreatedRows++;\n currentIndex++;\n }\n\n this.instance.runHooks('afterCreateRow', index, numberOfCreatedRows, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedRows;\n};\n\n/**\n * Creates col at the right of the data array.\n *\n * @param {Number} [index] Index of the column before which the new column will be inserted\n * @param {Number} [amount] An amount of columns to add.\n * @param {String} [source] Source of method call.\n * @fires Hooks#afterCreateCol\n * @returns {Number} Returns number of created columns\n */\nDataMap.prototype.createCol = function (index, amount, source) {\n if (!this.instance.isColumnModificationAllowed()) {\n 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.');\n }\n var rlen = this.instance.countSourceRows(),\n data = this.dataSource,\n constructor,\n numberOfCreatedCols = 0,\n currentIndex;\n\n if (!amount) {\n amount = 1;\n }\n\n if (typeof index !== 'number' || index >= this.instance.countCols()) {\n index = this.instance.countCols();\n }\n this.instance.runHooks('beforeCreateCol', index, amount, source);\n\n currentIndex = index;\n\n var maxCols = this.instance.getSettings().maxCols;\n while (numberOfCreatedCols < amount && this.instance.countCols() < maxCols) {\n constructor = (0, _setting.columnFactory)(this.GridSettings, this.priv.columnsSettingConflicts);\n\n if (typeof index !== 'number' || index >= this.instance.countCols()) {\n if (rlen > 0) {\n for (var r = 0; r < rlen; r++) {\n if (typeof data[r] === 'undefined') {\n data[r] = [];\n }\n data[r].push(null);\n }\n } else {\n data.push([null]);\n }\n // Add new column constructor\n this.priv.columnSettings.push(constructor);\n } else {\n for (var _r = 0; _r < rlen; _r++) {\n data[_r].splice(currentIndex, 0, null);\n }\n // Add new column constructor at given index\n this.priv.columnSettings.splice(currentIndex, 0, constructor);\n }\n\n numberOfCreatedCols++;\n currentIndex++;\n }\n\n this.instance.runHooks('afterCreateCol', index, numberOfCreatedCols, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedCols;\n};\n\n/**\n * Removes row from the data array.\n *\n * @param {Number} [index] Index of the row to be removed. If not provided, the last row will be removed\n * @param {Number} [amount] Amount of the rows to be removed. If not provided, one row will be removed\n * @param {String} [source] Source of method call.\n * @fires Hooks#beforeRemoveRow\n * @fires Hooks#afterRemoveRow\n */\nDataMap.prototype.removeRow = function (index, amount, source) {\n if (!amount) {\n amount = 1;\n }\n if (typeof index !== 'number') {\n index = -amount;\n }\n\n amount = this.instance.runHooks('modifyRemovedAmount', amount, index);\n\n index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows();\n\n var logicRows = this.physicalRowsToLogical(index, amount);\n var actionWasNotCancelled = this.instance.runHooks('beforeRemoveRow', index, amount, logicRows, source);\n\n if (actionWasNotCancelled === false) {\n return;\n }\n\n var data = this.dataSource;\n var newData = void 0;\n\n newData = this.filterData(index, amount);\n\n if (newData) {\n data.length = 0;\n Array.prototype.push.apply(data, newData);\n }\n\n this.instance.runHooks('afterRemoveRow', index, amount, logicRows, source);\n\n this.instance.forceFullRender = true; // used when data was changed\n};\n\n/**\n * Removes column from the data array.\n *\n * @param {Number} [index] Index of the column to be removed. If not provided, the last column will be removed\n * @param {Number} [amount] Amount of the columns to be removed. If not provided, one column will be removed\n * @param {String} [source] Source of method call.\n * @fires Hooks#beforeRemoveCol\n * @fires Hooks#afterRemoveCol\n */\nDataMap.prototype.removeCol = function (index, amount, source) {\n if (this.instance.dataType === 'object' || this.instance.getSettings().columns) {\n throw new Error('cannot remove column with object data source or columns option specified');\n }\n if (!amount) {\n amount = 1;\n }\n if (typeof index !== 'number') {\n index = -amount;\n }\n\n index = (this.instance.countCols() + index) % this.instance.countCols();\n\n var logicColumns = this.physicalColumnsToLogical(index, amount);\n var descendingLogicColumns = logicColumns.slice(0).sort(function (a, b) {\n return b - a;\n });\n var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', index, amount, logicColumns, source);\n\n if (actionWasNotCancelled === false) {\n return;\n }\n\n var isTableUniform = true;\n var removedColumnsCount = descendingLogicColumns.length;\n var data = this.dataSource;\n\n for (var c = 0; c < removedColumnsCount; c++) {\n if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) {\n isTableUniform = false;\n }\n }\n\n if (isTableUniform) {\n for (var r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {\n data[r].splice(logicColumns[0], amount);\n }\n } else {\n for (var _r2 = 0, _rlen = this.instance.countSourceRows(); _r2 < _rlen; _r2++) {\n for (var _c = 0; _c < removedColumnsCount; _c++) {\n data[_r2].splice(descendingLogicColumns[_c], 1);\n }\n }\n\n for (var _c2 = 0; _c2 < removedColumnsCount; _c2++) {\n this.priv.columnSettings.splice(logicColumns[_c2], 1);\n }\n }\n\n this.instance.runHooks('afterRemoveCol', index, amount, logicColumns, source);\n\n this.instance.forceFullRender = true; // used when data was changed\n};\n\n/**\n * Add/Removes data from the column.\n *\n * @param {Number} col Index of column in which do you want to do splice\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed\n * @returns {Array} Returns removed portion of columns\n */\nDataMap.prototype.spliceCol = function (col, index, amount /* , elements...*/) {\n var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];\n\n var colData = this.instance.getDataAtCol(col);\n var removed = colData.slice(index, index + amount);\n var after = colData.slice(index + amount);\n\n (0, _array.extendArray)(elements, after);\n var i = 0;\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n i++;\n }\n (0, _array.to2dArray)(elements);\n this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol');\n\n return removed;\n};\n\n/**\n * Add/Removes data from the row.\n *\n * @param {Number} row Index of row in which do you want to do splice\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed\n * @returns {Array} Returns removed portion of rows\n */\nDataMap.prototype.spliceRow = function (row, index, amount /* , elements...*/) {\n var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];\n\n var rowData = this.instance.getSourceDataAtRow(row);\n var removed = rowData.slice(index, index + amount);\n var after = rowData.slice(index + amount);\n\n (0, _array.extendArray)(elements, after);\n var i = 0;\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n i++;\n }\n this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow');\n\n return removed;\n};\n\n/**\n * Add/remove row(s) to/from the data source.\n *\n * @param {Number} index Index of the element to remove.\n * @param {Number} amount Number of rows to add/remove.\n * @param {Object} element Row to add.\n */\nDataMap.prototype.spliceData = function (index, amount, element) {\n var continueSplicing = this.instance.runHooks('beforeDataSplice', index, amount, element);\n\n if (continueSplicing !== false) {\n this.dataSource.splice(index, amount, element);\n }\n};\n\n/**\n * Filter unwanted data elements from the data source.\n *\n * @param {Number} index Index of the element to remove.\n * @param {Number} amount Number of rows to add/remove.\n * @returns {Array}\n */\nDataMap.prototype.filterData = function (index, amount) {\n var logicRows = this.physicalRowsToLogical(index, amount);\n var continueSplicing = this.instance.runHooks('beforeDataFilter', index, amount, logicRows);\n\n if (continueSplicing !== false) {\n var newData = this.dataSource.filter(function (row, index) {\n return logicRows.indexOf(index) == -1;\n });\n\n return newData;\n }\n};\n\n/**\n * Returns single value from the data array.\n *\n * @param {Number} row\n * @param {Number} prop\n */\nDataMap.prototype.get = function (row, prop) {\n row = this.instance.runHooks('modifyRow', row);\n\n var dataRow = this.dataSource[row];\n // TODO: To remove, use 'modifyData' hook instead (see below)\n var modifiedRowData = this.instance.runHooks('modifyRowData', row);\n\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;\n //\n\n var value = null;\n\n // try to get value under property `prop` (includes dot)\n if (dataRow && dataRow.hasOwnProperty && (0, _object.hasOwnProperty)(dataRow, prop)) {\n value = dataRow[prop];\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n var sliced = prop.split('.');\n var out = dataRow;\n\n if (!out) {\n return null;\n }\n for (var i = 0, ilen = sliced.length; i < ilen; i++) {\n out = out[sliced[i]];\n\n if (typeof out === 'undefined') {\n return null;\n }\n }\n value = out;\n } else if (typeof prop === 'function') {\n /**\n * allows for interacting with complex structures, for example\n * d3/jQuery getter/setter properties:\n *\n * {columns: [{\n * data: function(row, value){\n * if(arguments.length === 1){\n * return row.property();\n * }\n * row.property(value);\n * }\n * }]}\n */\n value = prop(this.dataSource.slice(row, row + 1)[0]);\n }\n\n if (this.instance.hasHook('modifyData')) {\n var valueHolder = (0, _object.createObjectPropListener)(value);\n\n this.instance.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'get');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n return value;\n};\n\nvar copyableLookup = (0, _data.cellMethodLookupFactory)('copyable', false);\n\n/**\n * Returns single value from the data array (intended for clipboard copy to an external application).\n *\n * @param {Number} row\n * @param {Number} prop\n * @returns {String}\n */\nDataMap.prototype.getCopyable = function (row, prop) {\n if (copyableLookup.call(this.instance, row, this.propToCol(prop))) {\n return this.get(row, prop);\n }\n return '';\n};\n\n/**\n * Saves single value to the data array.\n *\n * @param {Number} row\n * @param {Number} prop\n * @param {String} value\n * @param {String} [source] Source of hook runner.\n */\nDataMap.prototype.set = function (row, prop, value, source) {\n row = this.instance.runHooks('modifyRow', row, source || 'datamapGet');\n\n var dataRow = this.dataSource[row];\n // TODO: To remove, use 'modifyData' hook instead (see below)\n var modifiedRowData = this.instance.runHooks('modifyRowData', row);\n\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;\n //\n\n if (this.instance.hasHook('modifyData')) {\n var valueHolder = (0, _object.createObjectPropListener)(value);\n\n this.instance.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'set');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n // try to set value under property `prop` (includes dot)\n if (dataRow && dataRow.hasOwnProperty && (0, _object.hasOwnProperty)(dataRow, prop)) {\n dataRow[prop] = value;\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n var sliced = prop.split('.');\n var out = dataRow;\n var i = 0;\n var ilen = void 0;\n\n for (i = 0, ilen = sliced.length - 1; i < ilen; i++) {\n if (typeof out[sliced[i]] === 'undefined') {\n out[sliced[i]] = {};\n }\n out = out[sliced[i]];\n }\n out[sliced[i]] = value;\n } else if (typeof prop === 'function') {\n /* see the `function` handler in `get` */\n prop(this.dataSource.slice(row, row + 1)[0], value);\n } else {\n dataRow[prop] = value;\n }\n};\n\n/**\n * This ridiculous piece of code maps rows Id that are present in table data to those displayed for user.\n * The trick is, the physical row id (stored in settings.data) is not necessary the same\n * as the logical (displayed) row id (e.g. when sorting is applied).\n *\n * @param {Number} index\n * @param {Number} amount\n * @fires Hooks#modifyRow\n * @returns {Number}\n */\nDataMap.prototype.physicalRowsToLogical = function (index, amount) {\n var totalRows = this.instance.countSourceRows();\n var physicRow = (totalRows + index) % totalRows;\n var logicRows = [];\n var rowsToRemove = amount;\n var row;\n\n while (physicRow < totalRows && rowsToRemove) {\n row = this.instance.runHooks('modifyRow', physicRow);\n logicRows.push(row);\n\n rowsToRemove--;\n physicRow++;\n }\n\n return logicRows;\n};\n\n/**\n *\n * @param index\n * @param amount\n * @returns {Array}\n */\nDataMap.prototype.physicalColumnsToLogical = function (index, amount) {\n var totalCols = this.instance.countCols();\n var physicalCol = (totalCols + index) % totalCols;\n var logicalCols = [];\n var colsToRemove = amount;\n\n while (physicalCol < totalCols && colsToRemove) {\n var col = this.instance.runHooks('modifyCol', physicalCol);\n\n logicalCols.push(col);\n\n colsToRemove--;\n physicalCol++;\n }\n\n return logicalCols;\n};\n\n/**\n * Clears the data array.\n */\nDataMap.prototype.clear = function () {\n for (var r = 0; r < this.instance.countSourceRows(); r++) {\n for (var c = 0; c < this.instance.countCols(); c++) {\n this.set(r, this.colToProp(c), '');\n }\n }\n};\n\n/**\n * Clear cached data length.\n */\nDataMap.prototype.clearLengthCache = function () {\n this.cachedLength = null;\n};\n\n/**\n * Get data length.\n *\n * @returns {Number}\n */\nDataMap.prototype.getLength = function () {\n var _this2 = this;\n\n var maxRows = void 0,\n maxRowsFromSettings = this.instance.getSettings().maxRows;\n\n if (maxRowsFromSettings < 0 || maxRowsFromSettings === 0) {\n maxRows = 0;\n } else {\n maxRows = maxRowsFromSettings || Infinity;\n }\n\n var length = this.instance.countSourceRows();\n\n if (this.instance.hasHook('modifyRow')) {\n var reValidate = this.skipCache;\n\n this.interval.start();\n if (length !== this.latestSourceRowsCount) {\n reValidate = true;\n }\n\n this.latestSourceRowsCount = length;\n if (this.cachedLength === null || reValidate) {\n (0, _number.rangeEach)(length - 1, function (row) {\n row = _this2.instance.runHooks('modifyRow', row);\n\n if (row === null) {\n --length;\n }\n });\n this.cachedLength = length;\n } else {\n length = this.cachedLength;\n }\n } else {\n this.interval.stop();\n }\n\n return Math.min(length, maxRows);\n};\n\n/**\n * Returns the data array.\n *\n * @returns {Array}\n */\nDataMap.prototype.getAll = function () {\n var start = {\n row: 0,\n col: 0\n };\n\n var end = {\n row: Math.max(this.instance.countSourceRows() - 1, 0),\n col: Math.max(this.instance.countCols() - 1, 0)\n };\n\n if (start.row - end.row === 0 && !this.instance.countSourceRows()) {\n return [];\n }\n\n return this.getRange(start, end, DataMap.prototype.DESTINATION_RENDERER);\n};\n\n/**\n * Returns data range as array.\n *\n * @param {Object} [start] Start selection position\n * @param {Object} [end] End selection position\n * @param {Number} destination Destination of datamap.get\n * @returns {Array}\n */\nDataMap.prototype.getRange = function (start, end, destination) {\n var r,\n rlen,\n c,\n clen,\n output = [],\n row;\n\n var maxRows = this.instance.getSettings().maxRows;\n var maxCols = this.instance.getSettings().maxCols;\n\n if (maxRows === 0 || maxCols === 0) {\n return [];\n }\n\n var getFn = destination === this.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get;\n\n rlen = Math.min(Math.max(maxRows - 1, 0), Math.max(start.row, end.row));\n clen = Math.min(Math.max(maxCols - 1, 0), Math.max(start.col, end.col));\n\n for (r = Math.min(start.row, end.row); r <= rlen; r++) {\n row = [];\n var physicalRow = this.instance.runHooks('modifyRow', r);\n\n for (c = Math.min(start.col, end.col); c <= clen; c++) {\n\n if (physicalRow === null) {\n break;\n }\n row.push(getFn.call(this, r, this.colToProp(c)));\n }\n if (physicalRow !== null) {\n output.push(row);\n }\n }\n\n return output;\n};\n\n/**\n * Return data as text (tab separated columns).\n *\n * @param {Object} [start] Start selection position\n * @param {Object} [end] End selection position\n * @returns {String}\n */\nDataMap.prototype.getText = function (start, end) {\n return _SheetClip2.default.stringify(this.getRange(start, end, this.DESTINATION_RENDERER));\n};\n\n/**\n * Return data as copyable text (tab separated columns intended for clipboard copy to an external application).\n *\n * @param {Object} [start] Start selection position\n * @param {Object} [end] End selection position\n * @returns {String}\n */\nDataMap.prototype.getCopyableText = function (start, end) {\n return _SheetClip2.default.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR));\n};\n\n/**\n * `skipLengthCache` callback.\n * @private\n * @param {Number} delay Time of the delay in milliseconds.\n */\nDataMap.prototype.onSkipLengthCache = function (delay) {\n var _this3 = this;\n\n this.skipCache = true;\n setTimeout(function () {\n _this3.skipCache = false;\n }, delay);\n};\n\n/**\n * Destroy instance.\n */\nDataMap.prototype.destroy = function () {\n this.interval.stop();\n\n this.interval = null;\n this.instance = null;\n this.priv = null;\n this.GridSettings = null;\n this.dataSource = null;\n this.cachedLength = null;\n this.duckSchema = null;\n};\n\nexports.default = DataMap;\n\n/***/ }),\n/* 200 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class DataSource\n * @private\n */\nvar DataSource = function () {\n function DataSource(hotInstance) {\n var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n _classCallCheck(this, DataSource);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Handsontable}\n */\n this.hot = hotInstance;\n /**\n * Data source\n *\n * @type {Array}\n */\n this.data = dataSource;\n /**\n * Type of data source.\n *\n * @type {String}\n * @default 'array'\n */\n this.dataType = 'array';\n\n this.colToProp = function () {};\n this.propToCol = function () {};\n }\n\n /**\n * Get all data.\n *\n * @param {Boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n\n\n _createClass(DataSource, [{\n key: 'getData',\n value: function getData() {\n var toArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var result = this.data;\n\n if (toArray) {\n result = this.getByRange({ row: 0, col: 0 }, { row: Math.max(this.countRows() - 1, 0), col: Math.max(this.countColumns() - 1, 0) }, true);\n }\n\n return result;\n }\n\n /**\n * Set new data source.\n *\n * @param data {Array}\n */\n\n }, {\n key: 'setData',\n value: function setData(data) {\n this.data = data;\n }\n\n /**\n * Returns array of column values from the data source. `column` is the index of the row in the data source.\n *\n * @param {Number} column\n * @returns {Array}\n */\n\n }, {\n key: 'getAtColumn',\n value: function getAtColumn(column) {\n var _this = this;\n\n var result = [];\n\n (0, _array.arrayEach)(this.data, function (row) {\n var property = _this.colToProp(column);\n\n if (typeof property === 'string') {\n row = (0, _object.getProperty)(row, property);\n } else {\n row = row[property];\n }\n result.push(row);\n });\n\n return result;\n }\n\n /**\n * Returns a single row of the data (array or object, depending on what you have). `row` is the index of the row in the data source.\n *\n * @param {Number} row\n * @returns {Array|Object}\n */\n\n }, {\n key: 'getAtRow',\n value: function getAtRow(row) {\n return this.data[row];\n }\n\n /**\n * Returns a single value from the data.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {*}\n */\n\n }, {\n key: 'getAtCell',\n value: function getAtCell(row, column) {\n var result = null;\n\n var modifyRowData = this.hot.runHooks('modifyRowData', row);\n\n var dataRow = isNaN(modifyRowData) ? modifyRowData : this.data[row];\n\n if (dataRow) {\n var prop = this.colToProp(column);\n\n if (typeof prop === 'string') {\n result = (0, _object.getProperty)(dataRow, prop);\n } else if (typeof prop === 'function') {\n result = prop(this.data.slice(row, row + 1)[0]);\n } else {\n result = dataRow[prop];\n }\n }\n\n return result;\n }\n\n /**\n * Returns source data by passed range.\n *\n * @param {Object} start Object with `row` and `col` keys.\n * @param {Object} end Object with `row` and `col` keys.\n * @param {Boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n\n }, {\n key: 'getByRange',\n value: function getByRange(start, end) {\n var _this2 = this;\n\n var toArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var startRow = Math.min(start.row, end.row);\n var startCol = Math.min(start.col, end.col);\n var endRow = Math.max(start.row, end.row);\n var endCol = Math.max(start.col, end.col);\n var result = [];\n\n (0, _number.rangeEach)(startRow, endRow, function (currentRow) {\n var row = _this2.getAtRow(currentRow);\n var newRow = void 0;\n\n if (_this2.dataType === 'array') {\n newRow = row.slice(startCol, endCol + 1);\n } else if (_this2.dataType === 'object') {\n newRow = toArray ? [] : {};\n\n (0, _number.rangeEach)(startCol, endCol, function (column) {\n var prop = _this2.colToProp(column);\n\n if (toArray) {\n newRow.push(row[prop]);\n } else {\n newRow[prop] = row[prop];\n }\n });\n }\n\n result.push(newRow);\n });\n\n return result;\n }\n\n /**\n * Count number of rows.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'countRows',\n value: function countRows() {\n return Array.isArray(this.data) ? this.data.length : 0;\n }\n\n /**\n * Count number of columns.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'countColumns',\n value: function countColumns() {\n var result = 0;\n\n if (Array.isArray(this.data)) {\n if (this.dataType === 'array') {\n result = this.data[0].length;\n } else if (this.dataType === 'object') {\n result = Object.keys(this.data[0]).length;\n }\n }\n\n return result;\n }\n\n /**\n * Destroy instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.data = null;\n this.hot = null;\n }\n }]);\n\n return DataSource;\n}();\n\nexports.default = DataSource;\n\n/***/ }),\n/* 201 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _src = __webpack_require__(11);\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nvar _editors = __webpack_require__(14);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _baseEditor = __webpack_require__(36);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction EditorManager(instance, priv, selection) {\n var _this = this,\n destroyed = false,\n eventManager,\n activeEditor;\n\n eventManager = new _eventManager2.default(instance);\n\n function moveSelectionAfterEnter(shiftKey) {\n selection.setSelectedHeaders(false, false, false);\n var enterMoves = typeof priv.settings.enterMoves === 'function' ? priv.settings.enterMoves(event) : priv.settings.enterMoves;\n\n if (shiftKey) {\n // move selection up\n selection.transformStart(-enterMoves.row, -enterMoves.col);\n } else {\n // move selection down (add a new row if needed)\n selection.transformStart(enterMoves.row, enterMoves.col, true);\n }\n }\n\n function moveSelectionUp(shiftKey) {\n if (shiftKey) {\n if (selection.selectedHeader.cols) {\n selection.setSelectedHeaders(selection.selectedHeader.rows, false, false);\n }\n selection.transformEnd(-1, 0);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(-1, 0);\n }\n }\n\n function moveSelectionDown(shiftKey) {\n if (shiftKey) {\n // expanding selection down with shift\n selection.transformEnd(1, 0);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(1, 0);\n }\n }\n\n function moveSelectionRight(shiftKey) {\n if (shiftKey) {\n selection.transformEnd(0, 1);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(0, 1);\n }\n }\n\n function moveSelectionLeft(shiftKey) {\n if (shiftKey) {\n if (selection.selectedHeader.rows) {\n selection.setSelectedHeaders(false, selection.selectedHeader.cols, false);\n }\n selection.transformEnd(0, -1);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(0, -1);\n }\n }\n\n function onKeyDown(event) {\n var ctrlDown, rangeModifier;\n\n if (!instance.isListening()) {\n return;\n }\n instance.runHooks('beforeKeyDown', event);\n\n if (destroyed) {\n return;\n }\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n priv.lastKeyCode = event.keyCode;\n\n if (!selection.isSelected()) {\n return;\n }\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (activeEditor && !activeEditor.isWaiting()) {\n if (!(0, _unicode.isMetaKey)(event.keyCode) && !(0, _unicode.isCtrlKey)(event.keyCode) && !ctrlDown && !_this.isEditorOpened()) {\n _this.openEditor('', event);\n\n return;\n }\n }\n rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart;\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.A:\n if (!_this.isEditorOpened() && ctrlDown) {\n selection.selectAll();\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n }\n break;\n\n case _unicode.KEY_CODES.ARROW_UP:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n moveSelectionUp(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.ARROW_DOWN:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionDown(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.ARROW_RIGHT:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionRight(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.ARROW_LEFT:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionLeft(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.TAB:\n selection.setSelectedHeaders(false, false, false);\n var tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves;\n\n if (event.shiftKey) {\n // move selection left\n selection.transformStart(-tabMoves.row, -tabMoves.col);\n } else {\n // move selection right (add a new column if needed)\n selection.transformStart(tabMoves.row, tabMoves.col, true);\n }\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.BACKSPACE:\n case _unicode.KEY_CODES.DELETE:\n selection.empty(event);\n _this.prepareEditor();\n event.preventDefault();\n break;\n\n case _unicode.KEY_CODES.F2:\n /* F2 */\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n event.preventDefault(); // prevent Opera from opening 'Go to Page dialog'\n break;\n\n case _unicode.KEY_CODES.ENTER:\n /* return/enter */\n if (_this.isEditorOpened()) {\n\n if (activeEditor && activeEditor.state !== _baseEditor.EditorState.WAITING) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n moveSelectionAfterEnter(event.shiftKey);\n } else if (instance.getSettings().enterBeginsEditing) {\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n } else {\n moveSelectionAfterEnter(event.shiftKey);\n }\n event.preventDefault(); // don't add newline to field\n (0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor\n break;\n\n case _unicode.KEY_CODES.ESCAPE:\n if (_this.isEditorOpened()) {\n _this.closeEditorAndRestoreOriginalValue(ctrlDown);\n }\n event.preventDefault();\n break;\n\n case _unicode.KEY_CODES.HOME:\n selection.setSelectedHeaders(false, false, false);\n if (event.ctrlKey || event.metaKey) {\n rangeModifier(new _src.CellCoords(0, priv.selRange.from.col));\n } else {\n rangeModifier(new _src.CellCoords(priv.selRange.from.row, 0));\n }\n event.preventDefault(); // don't scroll the window\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.END:\n selection.setSelectedHeaders(false, false, false);\n if (event.ctrlKey || event.metaKey) {\n rangeModifier(new _src.CellCoords(instance.countRows() - 1, priv.selRange.from.col));\n } else {\n rangeModifier(new _src.CellCoords(priv.selRange.from.row, instance.countCols() - 1));\n }\n event.preventDefault(); // don't scroll the window\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.PAGE_UP:\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(-instance.countVisibleRows(), 0);\n event.preventDefault(); // don't page up the window\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.PAGE_DOWN:\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(instance.countVisibleRows(), 0);\n event.preventDefault(); // don't page down the window\n (0, _event.stopPropagation)(event);\n break;\n default:\n break;\n }\n }\n\n function init() {\n instance.addHook('afterDocumentKeyDown', onKeyDown);\n\n eventManager.addEventListener(document.documentElement, 'keydown', function (event) {\n if (!destroyed) {\n instance.runHooks('afterDocumentKeyDown', event);\n }\n });\n\n function onDblClick(event, coords, elem) {\n // may be TD or TH\n if (elem.nodeName == 'TD') {\n _this.openEditor();\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n }\n }\n instance.view.wt.update('onCellDblClick', onDblClick);\n\n instance.addHook('afterDestroy', function () {\n destroyed = true;\n });\n }\n\n /**\n * Destroy current editor, if exists.\n *\n * @function destroyEditor\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} revertOriginal\n */\n this.destroyEditor = function (revertOriginal) {\n this.closeEditor(revertOriginal);\n };\n\n /**\n * Get active editor.\n *\n * @function getActiveEditor\n * @memberof! Handsontable.EditorManager#\n * @returns {*}\n */\n this.getActiveEditor = function () {\n return activeEditor;\n };\n\n /**\n * Prepare text input to be displayed at given grid cell.\n *\n * @function prepareEditor\n * @memberof! Handsontable.EditorManager#\n */\n this.prepareEditor = function () {\n var row, col, prop, td, originalValue, cellProperties, editorClass;\n\n if (activeEditor && activeEditor.isWaiting()) {\n this.closeEditor(false, false, function (dataSaved) {\n if (dataSaved) {\n _this.prepareEditor();\n }\n });\n\n return;\n }\n row = priv.selRange.highlight.row;\n col = priv.selRange.highlight.col;\n prop = instance.colToProp(col);\n td = instance.getCell(row, col);\n\n originalValue = instance.getSourceDataAtCell(instance.runHooks('modifyRow', row), col);\n cellProperties = instance.getCellMeta(row, col);\n editorClass = instance.getCellEditor(cellProperties);\n\n if (editorClass) {\n activeEditor = (0, _editors.getEditorInstance)(editorClass, instance);\n activeEditor.prepare(row, col, prop, td, originalValue, cellProperties);\n } else {\n activeEditor = void 0;\n }\n };\n\n /**\n * Check is editor is opened/showed.\n *\n * @function isEditorOpened\n * @memberof! Handsontable.EditorManager#\n * @returns {Boolean}\n */\n this.isEditorOpened = function () {\n return activeEditor && activeEditor.isOpened();\n };\n\n /**\n * Open editor with initial value.\n *\n * @function openEditor\n * @memberof! Handsontable.EditorManager#\n * @param {String} initialValue\n * @param {DOMEvent} event\n */\n this.openEditor = function (initialValue, event) {\n if (activeEditor && !activeEditor.cellProperties.readOnly) {\n activeEditor.beginEditing(initialValue, event);\n } else if (activeEditor && activeEditor.cellProperties.readOnly) {\n\n // move the selection after opening the editor with ENTER key\n if (event && event.keyCode === _unicode.KEY_CODES.ENTER) {\n moveSelectionAfterEnter();\n }\n }\n };\n\n /**\n * Close editor, finish editing cell.\n *\n * @function closeEditor\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} restoreOriginalValue\n * @param {Boolean} [ctrlDown]\n * @param {Function} [callback]\n */\n this.closeEditor = function (restoreOriginalValue, ctrlDown, callback) {\n if (activeEditor) {\n activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback);\n } else if (callback) {\n callback(false);\n }\n };\n\n /**\n * Close editor and save changes.\n *\n * @function closeEditorAndSaveChanges\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} ctrlDown\n */\n this.closeEditorAndSaveChanges = function (ctrlDown) {\n return this.closeEditor(false, ctrlDown);\n };\n\n /**\n * Close editor and restore original value.\n *\n * @function closeEditorAndRestoreOriginalValue\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} ctrlDown\n */\n this.closeEditorAndRestoreOriginalValue = function (ctrlDown) {\n return this.closeEditor(true, ctrlDown);\n };\n\n init();\n}\n\nexports.default = EditorManager;\n\n/***/ }),\n/* 202 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor CheckboxEditor\n * @class CheckboxEditor\n */\nvar CheckboxEditor = function (_BaseEditor) {\n _inherits(CheckboxEditor, _BaseEditor);\n\n function CheckboxEditor() {\n _classCallCheck(this, CheckboxEditor);\n\n return _possibleConstructorReturn(this, (CheckboxEditor.__proto__ || Object.getPrototypeOf(CheckboxEditor)).apply(this, arguments));\n }\n\n _createClass(CheckboxEditor, [{\n key: 'beginEditing',\n value: function beginEditing(initialValue, event) {\n // editorManager return double click event as undefined\n if (event === void 0) {\n var checkbox = this.TD.querySelector('input[type=\"checkbox\"]');\n\n if (!(0, _element.hasClass)(checkbox, 'htBadValue')) {\n checkbox.click();\n }\n }\n }\n }, {\n key: 'finishEditing',\n value: function finishEditing() {}\n }, {\n key: 'init',\n value: function init() {}\n }, {\n key: 'open',\n value: function open() {}\n }, {\n key: 'close',\n value: function close() {}\n }, {\n key: 'getValue',\n value: function getValue() {}\n }, {\n key: 'setValue',\n value: function setValue() {}\n }, {\n key: 'focus',\n value: function focus() {}\n }]);\n\n return CheckboxEditor;\n}(_baseEditor2.default);\n\nexports.default = CheckboxEditor;\n\n/***/ }),\n/* 203 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _pikaday = __webpack_require__(299);\n\nvar _pikaday2 = _interopRequireDefault(_pikaday);\n\n__webpack_require__(182);\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor DateEditor\n * @class DateEditor\n * @dependencies TextEditor moment pikaday\n */\nvar DateEditor = function (_TextEditor) {\n _inherits(DateEditor, _TextEditor);\n\n /**\n * @param {Core} hotInstance Handsontable instance\n * @private\n */\n function DateEditor(hotInstance) {\n _classCallCheck(this, DateEditor);\n\n // TODO: Move this option to general settings\n var _this = _possibleConstructorReturn(this, (DateEditor.__proto__ || Object.getPrototypeOf(DateEditor)).call(this, hotInstance));\n\n _this.defaultDateFormat = 'DD/MM/YYYY';\n _this.isCellEdited = false;\n _this.parentDestroyed = false;\n return _this;\n }\n\n _createClass(DateEditor, [{\n key: 'init',\n value: function init() {\n var _this2 = this;\n\n if (typeof _moment2.default !== 'function') {\n throw new Error('You need to include moment.js to your project.');\n }\n\n if (typeof _pikaday2.default !== 'function') {\n throw new Error('You need to include Pikaday to your project.');\n }\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'init', this).call(this);\n this.instance.addHook('afterDestroy', function () {\n _this2.parentDestroyed = true;\n _this2.destroyElements();\n });\n }\n\n /**\n * Create data picker instance\n */\n\n }, {\n key: 'createElements',\n value: function createElements() {\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'createElements', this).call(this);\n\n this.datePicker = document.createElement('DIV');\n this.datePickerStyle = this.datePicker.style;\n this.datePickerStyle.position = 'absolute';\n this.datePickerStyle.top = 0;\n this.datePickerStyle.left = 0;\n this.datePickerStyle.zIndex = 9999;\n\n (0, _element.addClass)(this.datePicker, 'htDatepickerHolder');\n document.body.appendChild(this.datePicker);\n\n this.$datePicker = new _pikaday2.default(this.getDatePickerConfig());\n var eventManager = new _eventManager2.default(this);\n\n /**\n * Prevent recognizing clicking on datepicker as clicking outside of table\n */\n eventManager.addEventListener(this.datePicker, 'mousedown', function (event) {\n return (0, _event.stopPropagation)(event);\n });\n this.hideDatepicker();\n }\n\n /**\n * Destroy data picker instance\n */\n\n }, {\n key: 'destroyElements',\n value: function destroyElements() {\n this.$datePicker.destroy();\n }\n\n /**\n * Prepare editor to appear\n *\n * @param {Number} row Row index\n * @param {Number} col Column index\n * @param {String} prop Property name (passed when datasource is an array of objects)\n * @param {HTMLTableCellElement} td Table cell element\n * @param {*} originalValue Original value\n * @param {Object} cellProperties Object with cell properties ({@see Core#getCellMeta})\n */\n\n }, {\n key: 'prepare',\n value: function prepare(row, col, prop, td, originalValue, cellProperties) {\n this._opened = false;\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'prepare', this).call(this, row, col, prop, td, originalValue, cellProperties);\n }\n\n /**\n * Open editor\n *\n * @param {Event} [event=null]\n */\n\n }, {\n key: 'open',\n value: function open() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'open', this).call(this);\n this.showDatepicker(event);\n }\n\n /**\n * Close editor\n */\n\n }, {\n key: 'close',\n value: function close() {\n var _this3 = this;\n\n this._opened = false;\n this.instance._registerTimeout(setTimeout(function () {\n _this3.instance.selection.refreshBorders();\n }, 0));\n\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'close', this).call(this);\n }\n\n /**\n * @param {Boolean} [isCancelled=false]\n * @param {Boolean} [ctrlDown=false]\n */\n\n }, {\n key: 'finishEditing',\n value: function finishEditing() {\n var isCancelled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (isCancelled) {\n // pressed ESC, restore original value\n // var value = this.instance.getDataAtCell(this.row, this.col);\n var value = this.originalValue;\n\n if (value !== void 0) {\n this.setValue(value);\n }\n }\n this.hideDatepicker();\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'finishEditing', this).call(this, isCancelled, ctrlDown);\n }\n\n /**\n * Show data picker\n *\n * @param {Event} event\n */\n\n }, {\n key: 'showDatepicker',\n value: function showDatepicker(event) {\n this.$datePicker.config(this.getDatePickerConfig());\n\n var offset = this.TD.getBoundingClientRect();\n var dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;\n var datePickerConfig = this.$datePicker.config();\n var dateStr = void 0;\n var isMouseDown = this.instance.view.isMouseDown();\n var isMeta = event ? (0, _unicode.isMetaKey)(event.keyCode) : false;\n\n this.datePickerStyle.top = window.pageYOffset + offset.top + (0, _element.outerHeight)(this.TD) + 'px';\n this.datePickerStyle.left = window.pageXOffset + offset.left + 'px';\n\n this.$datePicker._onInputFocus = function () {};\n datePickerConfig.format = dateFormat;\n\n if (this.originalValue) {\n dateStr = this.originalValue;\n\n if ((0, _moment2.default)(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment((0, _moment2.default)(dateStr, dateFormat), true);\n }\n\n // workaround for date/time cells - pikaday resets the cell value to 12:00 AM by default, this will overwrite the value.\n if (this.getValue() !== this.originalValue) {\n this.setValue(this.originalValue);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else if (this.cellProperties.defaultDate) {\n dateStr = this.cellProperties.defaultDate;\n\n datePickerConfig.defaultDate = dateStr;\n\n if ((0, _moment2.default)(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment((0, _moment2.default)(dateStr, dateFormat), true);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else {\n // if a default date is not defined, set a soft-default-date: display the current day and month in the\n // datepicker, but don't fill the editor input\n this.$datePicker.gotoToday();\n }\n\n this.datePickerStyle.display = 'block';\n this.$datePicker.show();\n }\n\n /**\n * Hide data picker\n */\n\n }, {\n key: 'hideDatepicker',\n value: function hideDatepicker() {\n this.datePickerStyle.display = 'none';\n this.$datePicker.hide();\n }\n\n /**\n * Get date picker options.\n *\n * @returns {Object}\n */\n\n }, {\n key: 'getDatePickerConfig',\n value: function getDatePickerConfig() {\n var _this4 = this;\n\n var htInput = this.TEXTAREA;\n var options = {};\n\n if (this.cellProperties && this.cellProperties.datePickerConfig) {\n (0, _object.deepExtend)(options, this.cellProperties.datePickerConfig);\n }\n var origOnSelect = options.onSelect;\n var origOnClose = options.onClose;\n\n options.field = htInput;\n options.trigger = htInput;\n options.container = this.datePicker;\n options.bound = false;\n options.format = options.format || this.defaultDateFormat;\n options.reposition = options.reposition || false;\n options.onSelect = function (dateStr) {\n if (!isNaN(dateStr.getTime())) {\n dateStr = (0, _moment2.default)(dateStr).format(_this4.cellProperties.dateFormat || _this4.defaultDateFormat);\n }\n _this4.setValue(dateStr);\n _this4.hideDatepicker();\n\n if (origOnSelect) {\n origOnSelect();\n }\n };\n options.onClose = function () {\n if (!_this4.parentDestroyed) {\n _this4.finishEditing(false);\n }\n if (origOnClose) {\n origOnClose();\n }\n };\n\n return options;\n }\n }]);\n\n return DateEditor;\n}(_textEditor2.default);\n\nexports.default = DateEditor;\n\n/***/ }),\n/* 204 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _autocompleteEditor = __webpack_require__(147);\n\nvar _autocompleteEditor2 = _interopRequireDefault(_autocompleteEditor);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor DropdownEditor\n * @class DropdownEditor\n * @dependencies AutocompleteEditor\n */\nvar DropdownEditor = function (_AutocompleteEditor) {\n _inherits(DropdownEditor, _AutocompleteEditor);\n\n function DropdownEditor() {\n _classCallCheck(this, DropdownEditor);\n\n return _possibleConstructorReturn(this, (DropdownEditor.__proto__ || Object.getPrototypeOf(DropdownEditor)).apply(this, arguments));\n }\n\n _createClass(DropdownEditor, [{\n key: 'prepare',\n value: function prepare(row, col, prop, td, originalValue, cellProperties) {\n _get(DropdownEditor.prototype.__proto__ || Object.getPrototypeOf(DropdownEditor.prototype), 'prepare', this).call(this, row, col, prop, td, originalValue, cellProperties);\n this.cellProperties.filter = false;\n this.cellProperties.strict = true;\n }\n }]);\n\n return DropdownEditor;\n}(_autocompleteEditor2.default);\n\n_pluginHooks2.default.getSingleton().add('beforeValidate', function (value, row, col, source) {\n var cellMeta = this.getCellMeta(row, this.propToCol(col));\n\n if (cellMeta.editor === DropdownEditor) {\n if (cellMeta.strict === void 0) {\n cellMeta.filter = false;\n cellMeta.strict = true;\n }\n }\n});\n\nexports.default = DropdownEditor;\n\n/***/ }),\n/* 205 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nvar _element = __webpack_require__(0);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MobileTextEditor = _baseEditor2.default.prototype.extend();\nvar domDimensionsCache = {};\n\n/**\n * @private\n * @editor MobileTextEditor\n * @class MobileTextEditor\n */\nvar createControls = function createControls() {\n this.controls = {};\n\n this.controls.leftButton = document.createElement('DIV');\n this.controls.leftButton.className = 'leftButton';\n this.controls.rightButton = document.createElement('DIV');\n this.controls.rightButton.className = 'rightButton';\n this.controls.upButton = document.createElement('DIV');\n this.controls.upButton.className = 'upButton';\n this.controls.downButton = document.createElement('DIV');\n this.controls.downButton.className = 'downButton';\n\n for (var button in this.controls) {\n if (Object.prototype.hasOwnProperty.call(this.controls, button)) {\n this.positionControls.appendChild(this.controls[button]);\n }\n }\n};\n\nMobileTextEditor.prototype.valueChanged = function () {\n return this.initValue != this.getValue();\n};\n\nMobileTextEditor.prototype.init = function () {\n var that = this;\n this.eventManager = new _eventManager2.default(this.instance);\n\n this.createElements();\n this.bindEvents();\n\n this.instance.addHook('afterDestroy', function () {\n that.destroy();\n });\n};\n\nMobileTextEditor.prototype.getValue = function () {\n return this.TEXTAREA.value;\n};\n\nMobileTextEditor.prototype.setValue = function (newValue) {\n this.initValue = newValue;\n\n this.TEXTAREA.value = newValue;\n};\n\nMobileTextEditor.prototype.createElements = function () {\n this.editorContainer = document.createElement('DIV');\n this.editorContainer.className = 'htMobileEditorContainer';\n\n this.cellPointer = document.createElement('DIV');\n this.cellPointer.className = 'cellPointer';\n\n this.moveHandle = document.createElement('DIV');\n this.moveHandle.className = 'moveHandle';\n\n this.inputPane = document.createElement('DIV');\n this.inputPane.className = 'inputs';\n\n this.positionControls = document.createElement('DIV');\n this.positionControls.className = 'positionControls';\n\n this.TEXTAREA = document.createElement('TEXTAREA');\n (0, _element.addClass)(this.TEXTAREA, 'handsontableInput');\n\n this.inputPane.appendChild(this.TEXTAREA);\n\n this.editorContainer.appendChild(this.cellPointer);\n this.editorContainer.appendChild(this.moveHandle);\n this.editorContainer.appendChild(this.inputPane);\n this.editorContainer.appendChild(this.positionControls);\n\n createControls.call(this);\n\n document.body.appendChild(this.editorContainer);\n};\n\nMobileTextEditor.prototype.onBeforeKeyDown = function (event) {\n var instance = this;\n var that = instance.getActiveEditor();\n\n if (event.target !== that.TEXTAREA || (0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ENTER:\n that.close();\n event.preventDefault(); // don't add newline to field\n break;\n case _unicode.KEY_CODES.BACKSPACE:\n (0, _event.stopImmediatePropagation)(event); // backspace, delete, home, end should only work locally when cell is edited (not in table context)\n break;\n default:\n break;\n }\n};\n\nMobileTextEditor.prototype.open = function () {\n this.instance.addHook('beforeKeyDown', this.onBeforeKeyDown);\n\n (0, _element.addClass)(this.editorContainer, 'active');\n (0, _element.removeClass)(this.cellPointer, 'hidden');\n\n this.updateEditorPosition();\n};\n\nMobileTextEditor.prototype.focus = function () {\n this.TEXTAREA.focus();\n (0, _element.setCaretPosition)(this.TEXTAREA, this.TEXTAREA.value.length);\n};\n\nMobileTextEditor.prototype.close = function () {\n this.TEXTAREA.blur();\n this.instance.removeHook('beforeKeyDown', this.onBeforeKeyDown);\n\n (0, _element.removeClass)(this.editorContainer, 'active');\n};\n\nMobileTextEditor.prototype.scrollToView = function () {\n var coords = this.instance.getSelectedRange().highlight;\n this.instance.view.scrollViewport(coords);\n};\n\nMobileTextEditor.prototype.hideCellPointer = function () {\n if (!(0, _element.hasClass)(this.cellPointer, 'hidden')) {\n (0, _element.addClass)(this.cellPointer, 'hidden');\n }\n};\n\nMobileTextEditor.prototype.updateEditorPosition = function (x, y) {\n if (x && y) {\n x = parseInt(x, 10);\n y = parseInt(y, 10);\n\n this.editorContainer.style.top = y + 'px';\n this.editorContainer.style.left = x + 'px';\n } else {\n var selection = this.instance.getSelected(),\n selectedCell = this.instance.getCell(selection[0], selection[1]);\n\n // cache sizes\n if (!domDimensionsCache.cellPointer) {\n domDimensionsCache.cellPointer = {\n height: (0, _element.outerHeight)(this.cellPointer),\n width: (0, _element.outerWidth)(this.cellPointer)\n };\n }\n if (!domDimensionsCache.editorContainer) {\n domDimensionsCache.editorContainer = {\n width: (0, _element.outerWidth)(this.editorContainer)\n };\n }\n\n if (selectedCell !== undefined) {\n var scrollLeft = this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer == window ? 0 : (0, _element.getScrollLeft)(this.instance.view.wt.wtOverlays.leftOverlay.holder);\n var scrollTop = this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer == window ? 0 : (0, _element.getScrollTop)(this.instance.view.wt.wtOverlays.topOverlay.holder);\n\n var selectedCellOffset = (0, _element.offset)(selectedCell),\n selectedCellWidth = (0, _element.outerWidth)(selectedCell),\n currentScrollPosition = {\n x: scrollLeft,\n y: scrollTop\n };\n\n this.editorContainer.style.top = parseInt(selectedCellOffset.top + (0, _element.outerHeight)(selectedCell) - currentScrollPosition.y + domDimensionsCache.cellPointer.height, 10) + 'px';\n this.editorContainer.style.left = parseInt(window.innerWidth / 2 - domDimensionsCache.editorContainer.width / 2, 10) + 'px';\n\n if (selectedCellOffset.left + selectedCellWidth / 2 > parseInt(this.editorContainer.style.left, 10) + domDimensionsCache.editorContainer.width) {\n this.editorContainer.style.left = window.innerWidth - domDimensionsCache.editorContainer.width + 'px';\n } else if (selectedCellOffset.left + selectedCellWidth / 2 < parseInt(this.editorContainer.style.left, 10) + 20) {\n this.editorContainer.style.left = 0 + 'px';\n }\n\n this.cellPointer.style.left = parseInt(selectedCellOffset.left - domDimensionsCache.cellPointer.width / 2 - (0, _element.offset)(this.editorContainer).left + selectedCellWidth / 2 - currentScrollPosition.x, 10) + 'px';\n }\n }\n};\n\nMobileTextEditor.prototype.updateEditorData = function () {\n var selected = this.instance.getSelected(),\n selectedValue = this.instance.getDataAtCell(selected[0], selected[1]);\n\n this.row = selected[0];\n this.col = selected[1];\n this.setValue(selectedValue);\n this.updateEditorPosition();\n};\n\nMobileTextEditor.prototype.prepareAndSave = function () {\n var val;\n\n if (!this.valueChanged()) {\n return;\n }\n\n if (this.instance.getSettings().trimWhitespace) {\n val = [[String.prototype.trim.call(this.getValue())]];\n } else {\n val = [[this.getValue()]];\n }\n\n this.saveValue(val);\n};\n\nMobileTextEditor.prototype.bindEvents = function () {\n var that = this;\n\n this.eventManager.addEventListener(this.controls.leftButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(0, -1, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n this.eventManager.addEventListener(this.controls.rightButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(0, 1, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n this.eventManager.addEventListener(this.controls.upButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(-1, 0, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n this.eventManager.addEventListener(this.controls.downButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(1, 0, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n\n this.eventManager.addEventListener(this.moveHandle, 'touchstart', function (event) {\n if (event.touches.length == 1) {\n var touch = event.touches[0];\n var onTouchPosition = {\n x: that.editorContainer.offsetLeft,\n y: that.editorContainer.offsetTop\n };\n var onTouchOffset = {\n x: touch.pageX - onTouchPosition.x,\n y: touch.pageY - onTouchPosition.y\n };\n\n that.eventManager.addEventListener(this, 'touchmove', function (event) {\n var touch = event.touches[0];\n that.updateEditorPosition(touch.pageX - onTouchOffset.x, touch.pageY - onTouchOffset.y);\n that.hideCellPointer();\n event.preventDefault();\n });\n }\n });\n\n this.eventManager.addEventListener(document.body, 'touchend', function (event) {\n if (!(0, _element.isChildOf)(event.target, that.editorContainer) && !(0, _element.isChildOf)(event.target, that.instance.rootElement)) {\n that.close();\n }\n });\n\n this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.leftOverlay.holder, 'scroll', function (event) {\n if (that.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer != window) {\n that.hideCellPointer();\n }\n });\n\n this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.topOverlay.holder, 'scroll', function (event) {\n if (that.instance.view.wt.wtOverlays.topOverlay.trimmingContainer != window) {\n that.hideCellPointer();\n }\n });\n};\n\nMobileTextEditor.prototype.destroy = function () {\n this.eventManager.clear();\n\n this.editorContainer.parentNode.removeChild(this.editorContainer);\n};\n\nexports.default = MobileTextEditor;\n\n/***/ }),\n/* 206 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _numbro = __webpack_require__(86);\n\nvar _numbro2 = _interopRequireDefault(_numbro);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor NumericEditor\n * @class NumericEditor\n * @dependencies TextEditor numbro\n */\nvar NumericEditor = function (_TextEditor) {\n _inherits(NumericEditor, _TextEditor);\n\n function NumericEditor() {\n _classCallCheck(this, NumericEditor);\n\n return _possibleConstructorReturn(this, (NumericEditor.__proto__ || Object.getPrototypeOf(NumericEditor)).apply(this, arguments));\n }\n\n _createClass(NumericEditor, [{\n key: 'beginEditing',\n\n /**\n * @param {*} initialValue\n */\n value: function beginEditing(initialValue) {\n if (typeof initialValue === 'undefined' && this.originalValue) {\n if (typeof this.cellProperties.language !== 'undefined') {\n _numbro2.default.culture(this.cellProperties.language);\n }\n var decimalDelimiter = _numbro2.default.cultureData().delimiters.decimal;\n initialValue = ('' + this.originalValue).replace('.', decimalDelimiter);\n }\n _get(NumericEditor.prototype.__proto__ || Object.getPrototypeOf(NumericEditor.prototype), 'beginEditing', this).call(this, initialValue);\n }\n }]);\n\n return NumericEditor;\n}(_textEditor2.default);\n\nexports.default = NumericEditor;\n\n/***/ }),\n/* 207 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _element = __webpack_require__(0);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor PasswordEditor\n * @class PasswordEditor\n * @dependencies TextEditor\n */\nvar PasswordEditor = function (_TextEditor) {\n _inherits(PasswordEditor, _TextEditor);\n\n function PasswordEditor() {\n _classCallCheck(this, PasswordEditor);\n\n return _possibleConstructorReturn(this, (PasswordEditor.__proto__ || Object.getPrototypeOf(PasswordEditor)).apply(this, arguments));\n }\n\n _createClass(PasswordEditor, [{\n key: 'createElements',\n value: function createElements() {\n _get(PasswordEditor.prototype.__proto__ || Object.getPrototypeOf(PasswordEditor.prototype), 'createElements', this).call(this);\n\n this.TEXTAREA = document.createElement('input');\n this.TEXTAREA.setAttribute('type', 'password');\n this.TEXTAREA.className = 'handsontableInput';\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n\n (0, _element.empty)(this.TEXTAREA_PARENT);\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n }\n }]);\n\n return PasswordEditor;\n}(_textEditor2.default);\n\nexports.default = PasswordEditor;\n\n/***/ }),\n/* 208 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nvar _unicode = __webpack_require__(16);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SelectEditor = _baseEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor SelectEditor\n * @class SelectEditor\n */\nSelectEditor.prototype.init = function () {\n this.select = document.createElement('SELECT');\n (0, _element.addClass)(this.select, 'htSelectEditor');\n this.select.style.display = 'none';\n this.instance.rootElement.appendChild(this.select);\n this.registerHooks();\n};\n\nSelectEditor.prototype.registerHooks = function () {\n var _this = this;\n\n this.instance.addHook('afterScrollHorizontally', function () {\n return _this.refreshDimensions();\n });\n this.instance.addHook('afterScrollVertically', function () {\n return _this.refreshDimensions();\n });\n this.instance.addHook('afterColumnResize', function () {\n return _this.refreshDimensions();\n });\n this.instance.addHook('afterRowResize', function () {\n return _this.refreshDimensions();\n });\n};\n\nSelectEditor.prototype.prepare = function () {\n _baseEditor2.default.prototype.prepare.apply(this, arguments);\n\n var selectOptions = this.cellProperties.selectOptions;\n var options;\n\n if (typeof selectOptions == 'function') {\n options = this.prepareOptions(selectOptions(this.row, this.col, this.prop));\n } else {\n options = this.prepareOptions(selectOptions);\n }\n\n (0, _element.empty)(this.select);\n\n for (var option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option)) {\n var optionElement = document.createElement('OPTION');\n optionElement.value = option;\n (0, _element.fastInnerHTML)(optionElement, options[option]);\n this.select.appendChild(optionElement);\n }\n }\n};\n\nSelectEditor.prototype.prepareOptions = function (optionsToPrepare) {\n var preparedOptions = {};\n\n if (Array.isArray(optionsToPrepare)) {\n for (var i = 0, len = optionsToPrepare.length; i < len; i++) {\n preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i];\n }\n } else if ((typeof optionsToPrepare === 'undefined' ? 'undefined' : _typeof(optionsToPrepare)) == 'object') {\n preparedOptions = optionsToPrepare;\n }\n\n return preparedOptions;\n};\n\nSelectEditor.prototype.getValue = function () {\n return this.select.value;\n};\n\nSelectEditor.prototype.setValue = function (value) {\n this.select.value = value;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n var instance = this;\n var editor = instance.getActiveEditor();\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ARROW_UP:\n var previousOptionIndex = editor.select.selectedIndex - 1;\n if (previousOptionIndex >= 0) {\n editor.select[previousOptionIndex].selected = true;\n }\n\n (0, _event.stopImmediatePropagation)(event);\n event.preventDefault();\n break;\n\n case _unicode.KEY_CODES.ARROW_DOWN:\n var nextOptionIndex = editor.select.selectedIndex + 1;\n if (nextOptionIndex <= editor.select.length - 1) {\n editor.select[nextOptionIndex].selected = true;\n }\n\n (0, _event.stopImmediatePropagation)(event);\n event.preventDefault();\n break;\n default:\n break;\n }\n};\n\nSelectEditor.prototype.open = function () {\n this._opened = true;\n this.refreshDimensions();\n this.select.style.display = '';\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nSelectEditor.prototype.close = function () {\n this._opened = false;\n this.select.style.display = 'none';\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nSelectEditor.prototype.focus = function () {\n this.select.focus();\n};\n\nSelectEditor.prototype.refreshValue = function () {\n var sourceData = this.instance.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n};\n\nSelectEditor.prototype.refreshDimensions = function () {\n if (this.state !== _baseEditor.EditorState.EDITING) {\n return;\n }\n this.TD = this.getEditedCell();\n\n // TD is outside of the viewport.\n if (!this.TD) {\n this.close();\n\n return;\n }\n var width = (0, _element.outerWidth)(this.TD) + 1,\n height = (0, _element.outerHeight)(this.TD) + 1,\n currentOffset = (0, _element.offset)(this.TD),\n containerOffset = (0, _element.offset)(this.instance.rootElement),\n scrollableContainer = (0, _element.getScrollableElement)(this.TD),\n editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0),\n editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),\n editorSection = this.checkEditorSection(),\n cssTransformOffset;\n\n var settings = this.instance.getSettings();\n var rowHeadersCount = settings.rowHeaders ? 1 : 0;\n var colHeadersCount = settings.colHeaders ? 1 : 0;\n\n switch (editorSection) {\n case 'top':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'left':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'top-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n default:\n break;\n }\n if (this.instance.getSelected()[0] === 0) {\n editTop += 1;\n }\n\n if (this.instance.getSelected()[1] === 0) {\n editLeft += 1;\n }\n\n var selectStyle = this.select.style;\n\n if (cssTransformOffset && cssTransformOffset != -1) {\n selectStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n (0, _element.resetCssTransform)(this.select);\n }\n var cellComputedStyle = (0, _element.getComputedStyle)(this.TD);\n\n if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) {\n height -= 1;\n }\n if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) {\n width -= 1;\n }\n\n selectStyle.height = height + 'px';\n selectStyle.minWidth = width + 'px';\n selectStyle.top = editTop + 'px';\n selectStyle.left = editLeft + 'px';\n selectStyle.margin = '0px';\n};\n\nSelectEditor.prototype.getEditedCell = function () {\n var editorSection = this.checkEditorSection(),\n editedCell;\n\n switch (editorSection) {\n case 'top':\n editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 101;\n break;\n case 'corner':\n editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 103;\n break;\n case 'left':\n editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 102;\n break;\n default:\n editedCell = this.instance.getCell(this.row, this.col);\n this.select.style.zIndex = '';\n break;\n }\n\n return editedCell != -1 && editedCell != -2 ? editedCell : void 0;\n};\n\nexports.default = SelectEditor;\n\n/***/ }),\n/* 209 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(96);\n\n__webpack_require__(113);\n\n__webpack_require__(122);\n\n__webpack_require__(123);\n\n__webpack_require__(107);\n\n__webpack_require__(121);\n\n__webpack_require__(104);\n\n__webpack_require__(105);\n\n__webpack_require__(106);\n\n__webpack_require__(95);\n\n__webpack_require__(118);\n\n__webpack_require__(116);\n\n__webpack_require__(114);\n\n__webpack_require__(119);\n\n__webpack_require__(120);\n\n__webpack_require__(115);\n\n__webpack_require__(117);\n\n__webpack_require__(108);\n\n__webpack_require__(109);\n\n__webpack_require__(110);\n\n__webpack_require__(112);\n\n__webpack_require__(111);\n\n__webpack_require__(93);\n\n__webpack_require__(94);\n\n__webpack_require__(89);\n\n__webpack_require__(92);\n\n__webpack_require__(91);\n\n__webpack_require__(90);\n\n__webpack_require__(68);\n\n__webpack_require__(98);\n\n__webpack_require__(99);\n\n__webpack_require__(101);\n\n__webpack_require__(100);\n\n__webpack_require__(97);\n\n__webpack_require__(103);\n\n__webpack_require__(102);\n\n__webpack_require__(124);\n\n__webpack_require__(127);\n\n__webpack_require__(125);\n\n__webpack_require__(126);\n\n__webpack_require__(129);\n\n__webpack_require__(128);\n\n__webpack_require__(131);\n\n__webpack_require__(130);\n\n__webpack_require__(179);\n\n__webpack_require__(180);\n\n__webpack_require__(181);\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar _cellTypes = __webpack_require__(63);\n\nvar _core = __webpack_require__(64);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _jquery = __webpack_require__(177);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _ghostTable = __webpack_require__(67);\n\nvar _ghostTable2 = _interopRequireDefault(_ghostTable);\n\nvar _array = __webpack_require__(1);\n\nvar arrayHelpers = _interopRequireWildcard(_array);\n\nvar _browser = __webpack_require__(25);\n\nvar browserHelpers = _interopRequireWildcard(_browser);\n\nvar _data = __webpack_require__(65);\n\nvar dataHelpers = _interopRequireWildcard(_data);\n\nvar _date = __webpack_require__(88);\n\nvar dateHelpers = _interopRequireWildcard(_date);\n\nvar _feature = __webpack_require__(34);\n\nvar featureHelpers = _interopRequireWildcard(_feature);\n\nvar _function = __webpack_require__(35);\n\nvar functionHelpers = _interopRequireWildcard(_function);\n\nvar _mixed = __webpack_require__(20);\n\nvar mixedHelpers = _interopRequireWildcard(_mixed);\n\nvar _number = __webpack_require__(6);\n\nvar numberHelpers = _interopRequireWildcard(_number);\n\nvar _object = __webpack_require__(2);\n\nvar objectHelpers = _interopRequireWildcard(_object);\n\nvar _setting = __webpack_require__(66);\n\nvar settingHelpers = _interopRequireWildcard(_setting);\n\nvar _string = __webpack_require__(27);\n\nvar stringHelpers = _interopRequireWildcard(_string);\n\nvar _unicode = __webpack_require__(16);\n\nvar unicodeHelpers = _interopRequireWildcard(_unicode);\n\nvar _element = __webpack_require__(0);\n\nvar domHelpers = _interopRequireWildcard(_element);\n\nvar _event = __webpack_require__(7);\n\nvar domEventHelpers = _interopRequireWildcard(_event);\n\nvar _index = __webpack_require__(178);\n\nvar plugins = _interopRequireWildcard(_index);\n\nvar _plugins = __webpack_require__(5);\n\nvar _defaultSettings = __webpack_require__(87);\n\nvar _defaultSettings2 = _interopRequireDefault(_defaultSettings);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Handsontable(rootElement, userSettings) {\n var instance = new _core2.default(rootElement, userSettings || {});\n\n instance.init();\n\n return instance;\n}\n\n(0, _jquery2.default)(Handsontable);\n\nHandsontable.Core = _core2.default;\nHandsontable.DefaultSettings = _defaultSettings2.default;\nHandsontable.EventManager = _eventManager2.default;\nHandsontable._getListenersCounter = _eventManager.getListenersCounter; // For MemoryLeak tests\n\nHandsontable.buildDate = \"2017-05-30T10:18:32.902Z\";\nHandsontable.packageName = \"handsontable\";\nHandsontable.version = \"0.32.0\";\n\nvar baseVersion = undefined;\n\nif (baseVersion) {\n Handsontable.baseVersion = baseVersion;\n}\n\n// Export Hooks singleton\nHandsontable.hooks = _pluginHooks2.default.getSingleton();\n\n// TODO: Remove this exports after rewrite tests about this module\nHandsontable.__GhostTable = _ghostTable2.default;\n//\n\n// Export all helpers to the Handsontable object\nvar HELPERS = [arrayHelpers, browserHelpers, dataHelpers, dateHelpers, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers];\nvar DOM = [domHelpers, domEventHelpers];\n\nHandsontable.helper = {};\nHandsontable.dom = {};\n\n// Fill general helpers.\narrayHelpers.arrayEach(HELPERS, function (helper) {\n arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) {\n if (key.charAt(0) !== '_') {\n Handsontable.helper[key] = helper[key];\n }\n });\n});\n\n// Fill DOM helpers.\narrayHelpers.arrayEach(DOM, function (helper) {\n arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) {\n if (key.charAt(0) !== '_') {\n Handsontable.dom[key] = helper[key];\n }\n });\n});\n\n// Export cell types.\nHandsontable.cellTypes = {};\n\narrayHelpers.arrayEach((0, _cellTypes.getRegisteredCellTypeNames)(), function (cellTypeName) {\n Handsontable.cellTypes[cellTypeName] = (0, _cellTypes.getCellType)(cellTypeName);\n});\n\nHandsontable.cellTypes.registerCellType = _cellTypes.registerCellType;\nHandsontable.cellTypes.getCellType = _cellTypes.getCellType;\n\n// Export all registered editors from the Handsontable.\nHandsontable.editors = {};\n\narrayHelpers.arrayEach((0, _editors.getRegisteredEditorNames)(), function (editorName) {\n Handsontable.editors[stringHelpers.toUpperCaseFirst(editorName) + 'Editor'] = (0, _editors.getEditor)(editorName);\n});\n\nHandsontable.editors.registerEditor = _editors.registerEditor;\nHandsontable.editors.getEditor = _editors.getEditor;\n\n// Export all registered renderers from the Handsontable.\nHandsontable.renderers = {};\n\narrayHelpers.arrayEach((0, _renderers.getRegisteredRendererNames)(), function (rendererName) {\n var renderer = (0, _renderers.getRenderer)(rendererName);\n\n if (rendererName === 'base') {\n Handsontable.renderers.cellDecorator = renderer;\n }\n Handsontable.renderers[stringHelpers.toUpperCaseFirst(rendererName) + 'Renderer'] = renderer;\n});\n\nHandsontable.renderers.registerRenderer = _renderers.registerRenderer;\nHandsontable.renderers.getRenderer = _renderers.getRenderer;\n\n// Export all registered validators from the Handsontable.\nHandsontable.validators = {};\n\narrayHelpers.arrayEach((0, _validators.getRegisteredValidatorNames)(), function (validatorName) {\n Handsontable.validators[stringHelpers.toUpperCaseFirst(validatorName) + 'Validator'] = (0, _validators.getValidator)(validatorName);\n});\n\nHandsontable.validators.registerValidator = _validators.registerValidator;\nHandsontable.validators.getValidator = _validators.getValidator;\n\n// Export all registered plugins from the Handsontable.\nHandsontable.plugins = {};\n\narrayHelpers.arrayEach(Object.getOwnPropertyNames(plugins), function (pluginName) {\n var plugin = plugins[pluginName];\n\n if (pluginName === 'Base') {\n Handsontable.plugins[pluginName + 'Plugin'] = plugin;\n } else {\n Handsontable.plugins[pluginName] = plugin;\n }\n});\n\nHandsontable.plugins.registerPlugin = _plugins.registerPlugin;\n\n// Export Handsontable\nmodule.exports = Handsontable;\n\n/***/ }),\n/* 210 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction MultiMap() {\n var map = {\n arrayMap: [],\n weakMap: new WeakMap()\n };\n\n return {\n get: function get(key) {\n if (canBeAnArrayMapKey(key)) {\n return map.arrayMap[key];\n } else if (canBeAWeakMapKey(key)) {\n return map.weakMap.get(key);\n }\n },\n set: function set(key, value) {\n if (canBeAnArrayMapKey(key)) {\n map.arrayMap[key] = value;\n } else if (canBeAWeakMapKey(key)) {\n map.weakMap.set(key, value);\n } else {\n throw new Error('Invalid key type');\n }\n },\n delete: function _delete(key) {\n if (canBeAnArrayMapKey(key)) {\n delete map.arrayMap[key];\n } else if (canBeAWeakMapKey(key)) {\n map.weakMap.delete(key);\n }\n }\n };\n\n function canBeAnArrayMapKey(obj) {\n return obj !== null && !isNaNSymbol(obj) && (typeof obj == 'string' || typeof obj == 'number');\n }\n\n function canBeAWeakMapKey(obj) {\n return obj !== null && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == 'object' || typeof obj == 'function');\n }\n\n function isNaNSymbol(obj) {\n /* eslint-disable no-self-compare */\n return obj !== obj; // NaN === NaN is always false\n }\n}\n\nexports.default = MultiMap;\n\n/***/ }),\n/* 211 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _array = __webpack_require__(1);\n\nvar _feature = __webpack_require__(34);\n\nvar _element = __webpack_require__(0);\n\nvar _ghostTable = __webpack_require__(67);\n\nvar _ghostTable2 = _interopRequireDefault(_ghostTable);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nvar _samplesGenerator = __webpack_require__(154);\n\nvar _samplesGenerator2 = _interopRequireDefault(_samplesGenerator);\n\nvar _string = __webpack_require__(27);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar privatePool = new WeakMap();\n\n/**\n * @plugin AutoColumnSize\n *\n * @description\n * This plugin allows to set column widths based on their widest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it enabled (same as if it was declared as `true`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the widths of all cells to\n * resize the columns accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the column widths manually.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ...\n * ```\n *\n * To configure this plugin see {@link Options#autoColumnSize}.\n *\n * @example\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * autoColumnSize: true\n * });\n * // Access to plugin instance:\n * var plugin = hot.getPlugin('autoColumnSize');\n *\n * plugin.getColumnWidth(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ...\n * ```\n */\n\nvar AutoColumnSize = function (_BasePlugin) {\n _inherits(AutoColumnSize, _BasePlugin);\n\n _createClass(AutoColumnSize, null, [{\n key: 'CALCULATION_STEP',\n get: function get() {\n return 50;\n }\n }, {\n key: 'SYNC_CALCULATION_LIMIT',\n get: function get() {\n return 50;\n }\n }]);\n\n function AutoColumnSize(hotInstance) {\n _classCallCheck(this, AutoColumnSize);\n\n var _this = _possibleConstructorReturn(this, (AutoColumnSize.__proto__ || Object.getPrototypeOf(AutoColumnSize)).call(this, hotInstance));\n\n privatePool.set(_this, {\n /**\n * Cached column header names. It is used to diff current column headers with previous state and detect which\n * columns width should be updated.\n *\n * @private\n * @type {Array}\n */\n cachedColumnHeaders: []\n });\n /**\n * Cached columns widths.\n *\n * @type {Array}\n */\n _this.widths = [];\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @type {GhostTable}\n */\n _this.ghostTable = new _ghostTable2.default(_this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for columns width calculations.\n *\n * @type {SamplesGenerator}\n */\n _this.samplesGenerator = new _samplesGenerator2.default(function (row, col) {\n return _this.hot.getDataAtCell(row, col);\n });\n /**\n * `true` only if the first calculation was performed\n *\n * @type {Boolean}\n */\n _this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {Boolean}\n */\n _this.inProgress = false;\n\n // moved to constructor to allow auto-sizing the columns when the plugin is disabled\n _this.addHook('beforeColumnResize', function (col, size, isDblClick) {\n return _this.onBeforeColumnResize(col, size, isDblClick);\n });\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(AutoColumnSize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n var setting = this.hot.getSettings().autoColumnSize;\n\n if (setting && setting.useHeaders != null) {\n this.ghostTable.setSetting('useHeaders', setting.useHeaders);\n }\n\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData();\n });\n this.addHook('beforeChange', function (changes) {\n return _this2.onBeforeChange(changes);\n });\n\n this.addHook('beforeRender', function (force) {\n return _this2.onBeforeRender(force);\n });\n this.addHook('modifyColWidth', function (width, col) {\n return _this2.getColumnWidth(col, width);\n });\n this.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Update plugin state.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n var changedColumns = this.findColumnsWhereHeaderWasChanged();\n\n if (changedColumns.length) {\n this.clearCache(changedColumns);\n }\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Calculate a columns width.\n *\n * @param {Number|Object} colRange Column range object.\n * @param {Number|Object} rowRange Row range object.\n * @param {Boolean} [force=false] If `true` force calculate width even when value was cached earlier.\n */\n\n }, {\n key: 'calculateColumnsWidth',\n value: function calculateColumnsWidth() {\n var colRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countCols() - 1 };\n\n var _this3 = this;\n\n var rowRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { from: 0, to: this.hot.countRows() - 1 };\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof colRange === 'number') {\n colRange = { from: colRange, to: colRange };\n }\n if (typeof rowRange === 'number') {\n rowRange = { from: rowRange, to: rowRange };\n }\n\n (0, _number.rangeEach)(colRange.from, colRange.to, function (col) {\n if (force || _this3.widths[col] === void 0 && !_this3.hot._getColWidthFromSettings(col)) {\n var samples = _this3.samplesGenerator.generateColumnSamples(col, rowRange);\n\n samples.forEach(function (sample, col) {\n return _this3.ghostTable.addColumn(col, sample);\n });\n }\n });\n\n if (this.ghostTable.columns.length) {\n this.ghostTable.getWidths(function (col, width) {\n _this3.widths[col] = width;\n });\n this.ghostTable.clean();\n }\n }\n\n /**\n * Calculate all columns width.\n *\n * @param {Object|Number} rowRange Row range object.\n */\n\n }, {\n key: 'calculateAllColumnsWidth',\n value: function calculateAllColumnsWidth() {\n var _this4 = this;\n\n var rowRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countRows() - 1 };\n\n var current = 0;\n var length = this.hot.countCols() - 1;\n var timer = null;\n\n this.inProgress = true;\n\n var loop = function loop() {\n // When hot was destroyed after calculating finished cancel frame\n if (!_this4.hot) {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n return;\n }\n\n _this4.calculateColumnsWidth({\n from: current,\n to: Math.min(current + AutoColumnSize.CALCULATION_STEP, length)\n }, rowRange);\n\n current = current + AutoColumnSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = (0, _feature.requestAnimationFrame)(loop);\n } else {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n // @TODO Should call once per render cycle, currently fired separately in different plugins\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n // tmp\n if (_this4.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n _this4.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n // sync\n if (this.firstCalculation && this.getSyncCalculationLimit()) {\n this.calculateColumnsWidth({ from: 0, to: this.getSyncCalculationLimit() }, rowRange);\n this.firstCalculation = false;\n current = this.getSyncCalculationLimit() + 1;\n }\n // async\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n }\n }\n\n /**\n * Set the sampling options.\n *\n * @private\n */\n\n }, {\n key: 'setSamplingOptions',\n value: function setSamplingOptions() {\n var setting = this.hot.getSettings().autoColumnSize;\n var samplingRatio = setting && (0, _object.hasOwnProperty)(setting, 'samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0;\n var allowSampleDuplicates = setting && (0, _object.hasOwnProperty)(setting, 'allowSampleDuplicates') ? this.hot.getSettings().autoColumnSize.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n\n /**\n * Recalculate all columns width (overwrite cache values).\n */\n\n }, {\n key: 'recalculateAllColumnsWidth',\n value: function recalculateAllColumnsWidth() {\n if (this.hot.view && (0, _element.isVisible)(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllColumnsWidth();\n }\n }\n\n /**\n * Get value which tells how many columns should be calculated synchronously. Rest of the columns will be calculated asynchronously.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getSyncCalculationLimit',\n value: function getSyncCalculationLimit() {\n /* eslint-disable no-bitwise */\n var limit = AutoColumnSize.SYNC_CALCULATION_LIMIT;\n var colsLimit = this.hot.countCols() - 1;\n\n if ((0, _object.isObject)(this.hot.getSettings().autoColumnSize)) {\n limit = this.hot.getSettings().autoColumnSize.syncLimit;\n\n if ((0, _string.isPercentValue)(limit)) {\n limit = (0, _number.valueAccordingPercent)(colsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, colsLimit);\n }\n\n /**\n * Get the calculated column width.\n *\n * @param {Number} col Column index.\n * @param {Number} [defaultWidth] Default column width. It will be picked up if no calculated width found.\n * @param {Boolean} [keepMinimum=true] If `true` then returned value won't be smaller then 50 (default column width).\n * @returns {Number}\n */\n\n }, {\n key: 'getColumnWidth',\n value: function getColumnWidth(col) {\n var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;\n var keepMinimum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var width = defaultWidth;\n\n if (width === void 0) {\n width = this.widths[col];\n\n if (keepMinimum && typeof width === 'number') {\n width = Math.max(width, _src.ViewportColumnsCalculator.DEFAULT_WIDTH);\n }\n }\n\n return width;\n }\n\n /**\n * Get the first visible column.\n *\n * @returns {Number} Returns column index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getFirstVisibleColumn',\n value: function getFirstVisibleColumn() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleColumn();\n }\n if (wot.wtViewport.columnsRenderCalculator) {\n return wot.wtTable.getFirstRenderedColumn();\n }\n\n return -1;\n }\n\n /**\n * Get the last visible column.\n *\n * @returns {Number} Returns column index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getLastVisibleColumn',\n value: function getLastVisibleColumn() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n return wot.wtTable.getLastVisibleColumn();\n }\n if (wot.wtViewport.columnsRenderCalculator) {\n return wot.wtTable.getLastRenderedColumn();\n }\n\n return -1;\n }\n\n /**\n * Collects all columns which titles has been changed in comparison to the previous state.\n *\n * @returns {Array} It returns an array of physical column indexes.\n */\n\n }, {\n key: 'findColumnsWhereHeaderWasChanged',\n value: function findColumnsWhereHeaderWasChanged() {\n var columnHeaders = this.hot.getColHeader();\n\n var _privatePool$get = privatePool.get(this),\n cachedColumnHeaders = _privatePool$get.cachedColumnHeaders;\n\n var changedColumns = (0, _array.arrayReduce)(columnHeaders, function (acc, columnTitle, physicalColumn) {\n var cachedColumnsLength = cachedColumnHeaders.length;\n\n if (cachedColumnsLength - 1 < physicalColumn || cachedColumnHeaders[physicalColumn] !== columnTitle) {\n acc.push(physicalColumn);\n }\n if (cachedColumnsLength - 1 < physicalColumn) {\n cachedColumnHeaders.push(columnTitle);\n } else {\n cachedColumnHeaders[physicalColumn] = columnTitle;\n }\n\n return acc;\n }, []);\n\n return changedColumns;\n }\n\n /**\n * Clear cache of calculated column widths. If you want to clear only selected columns pass an array with their indexes.\n * Otherwise whole cache will be cleared.\n *\n * @param {Array} [columns=[]] List of column indexes (physical indexes) to clear.\n */\n\n }, {\n key: 'clearCache',\n value: function clearCache() {\n var _this5 = this;\n\n var columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if (columns.length) {\n (0, _array.arrayEach)(columns, function (physicalIndex) {\n _this5.widths[physicalIndex] = void 0;\n });\n } else {\n this.widths.length = 0;\n }\n }\n\n /**\n * Check if all widths were calculated. If not then return `true` (need recalculate).\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNeedRecalculate',\n value: function isNeedRecalculate() {\n return !!(0, _array.arrayFilter)(this.widths, function (item) {\n return item === void 0;\n }).length;\n }\n\n /**\n * On before render listener.\n *\n * @private\n */\n\n }, {\n key: 'onBeforeRender',\n value: function onBeforeRender() {\n var force = this.hot.renderCall;\n var rowsCount = this.hot.countRows();\n\n // Keep last column widths unchanged for situation when all rows was deleted or trimmed (pro #6)\n if (!rowsCount) {\n return;\n }\n\n this.calculateColumnsWidth({ from: this.getFirstVisibleColumn(), to: this.getLastVisibleColumn() }, void 0, force);\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllColumnsWidth();\n }\n }\n\n /**\n * On after load data listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData() {\n var _this6 = this;\n\n if (this.hot.view) {\n this.recalculateAllColumnsWidth();\n } else {\n // first load - initialization\n setTimeout(function () {\n if (_this6.hot) {\n _this6.recalculateAllColumnsWidth();\n }\n }, 0);\n }\n }\n\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes\n */\n\n }, {\n key: 'onBeforeChange',\n value: function onBeforeChange(changes) {\n var _this7 = this;\n\n var changedColumns = (0, _array.arrayMap)(changes, function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n row = _ref2[0],\n column = _ref2[1];\n\n return _this7.hot.propToCol(column);\n });\n\n this.clearCache(changedColumns);\n }\n\n /**\n * On before column resize listener.\n *\n * @private\n * @param {Number} col\n * @param {Number} size\n * @param {Boolean} isDblClick\n * @returns {Number}\n */\n\n }, {\n key: 'onBeforeColumnResize',\n value: function onBeforeColumnResize(col, size, isDblClick) {\n if (isDblClick) {\n this.calculateColumnsWidth(col, void 0, true);\n size = this.getColumnWidth(col, void 0, false);\n }\n\n return size;\n }\n\n /**\n * On after Handsontable init fill plugin with all necessary values.\n *\n * @private\n */\n\n }, {\n key: 'onAfterInit',\n value: function onAfterInit() {\n privatePool.get(this).cachedColumnHeaders = this.hot.getColHeader();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.ghostTable.clean();\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return AutoColumnSize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('autoColumnSize', AutoColumnSize);\n\nexports.default = AutoColumnSize;\n\n/***/ }),\n/* 212 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _array = __webpack_require__(1);\n\nvar _feature = __webpack_require__(34);\n\nvar _element = __webpack_require__(0);\n\nvar _ghostTable = __webpack_require__(67);\n\nvar _ghostTable2 = _interopRequireDefault(_ghostTable);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nvar _samplesGenerator = __webpack_require__(154);\n\nvar _samplesGenerator2 = _interopRequireDefault(_samplesGenerator);\n\nvar _string = __webpack_require__(27);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @plugin AutoRowSize\n *\n * @description\n * This plugin allows to set row heights based on their highest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled (same as if it was declared as `false`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the heights of all cells to\n * resize the rows accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the row heights manually.\n *\n * Row height calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ...\n * ```\n *\n * You can also use the `allowSampleDuplicates` option to allow sampling duplicate values when calculating the row height. Note, that this might have\n * a negative impact on performance.\n *\n * To configure this plugin see {@link Options#autoRowSize}.\n *\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * autoRowSize: true\n * });\n * // Access to plugin instance:\n * var plugin = hot.getPlugin('autoRowSize');\n *\n * plugin.getRowHeight(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ...\n * ```\n */\nvar AutoRowSize = function (_BasePlugin) {\n _inherits(AutoRowSize, _BasePlugin);\n\n _createClass(AutoRowSize, null, [{\n key: 'CALCULATION_STEP',\n get: function get() {\n return 50;\n }\n }, {\n key: 'SYNC_CALCULATION_LIMIT',\n get: function get() {\n return 500;\n }\n }]);\n\n function AutoRowSize(hotInstance) {\n _classCallCheck(this, AutoRowSize);\n\n /**\n * Cached rows heights.\n *\n * @type {Array}\n */\n var _this = _possibleConstructorReturn(this, (AutoRowSize.__proto__ || Object.getPrototypeOf(AutoRowSize)).call(this, hotInstance));\n\n _this.heights = [];\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @type {GhostTable}\n */\n _this.ghostTable = new _ghostTable2.default(_this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for rows height calculations.\n *\n * @type {SamplesGenerator}\n */\n _this.samplesGenerator = new _samplesGenerator2.default(function (row, col) {\n if (row >= 0) {\n return _this.hot.getDataAtCell(row, col);\n } else if (row === -1) {\n return _this.hot.getColHeader(col);\n }\n return null;\n });\n /**\n * `true` if only the first calculation was performed.\n *\n * @type {Boolean}\n */\n _this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {Boolean}\n */\n _this.inProgress = false;\n\n // moved to constructor to allow auto-sizing the rows when the plugin is disabled\n _this.addHook('beforeRowResize', function (row, size, isDblClick) {\n return _this.onBeforeRowResize(row, size, isDblClick);\n });\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(AutoRowSize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().autoRowSize === true || (0, _object.isObject)(this.hot.getSettings().autoRowSize);\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.setSamplingOptions();\n\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData();\n });\n this.addHook('beforeChange', function (changes) {\n return _this2.onBeforeChange(changes);\n });\n this.addHook('beforeColumnMove', function () {\n return _this2.recalculateAllRowsHeight();\n });\n this.addHook('beforeColumnResize', function () {\n return _this2.recalculateAllRowsHeight();\n });\n this.addHook('beforeColumnSort', function () {\n return _this2.clearCache();\n });\n this.addHook('beforeRender', function (force) {\n return _this2.onBeforeRender(force);\n });\n this.addHook('beforeRowMove', function (rowStart, rowEnd) {\n return _this2.onBeforeRowMove(rowStart, rowEnd);\n });\n this.addHook('modifyRowHeight', function (height, row) {\n return _this2.getRowHeight(row, height);\n });\n this.addHook('modifyColumnHeaderHeight', function () {\n return _this2.getColumnHeaderHeight();\n });\n _get(AutoRowSize.prototype.__proto__ || Object.getPrototypeOf(AutoRowSize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(AutoRowSize.prototype.__proto__ || Object.getPrototypeOf(AutoRowSize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Calculate a given rows height.\n *\n * @param {Number|Object} rowRange Row range object.\n * @param {Number|Object} colRange Column range object.\n * @param {Boolean} [force=false] If `true` force calculate height even when value was cached earlier.\n */\n\n }, {\n key: 'calculateRowsHeight',\n value: function calculateRowsHeight() {\n var rowRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countRows() - 1 };\n\n var _this3 = this;\n\n var colRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { from: 0, to: this.hot.countCols() - 1 };\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof rowRange === 'number') {\n rowRange = { from: rowRange, to: rowRange };\n }\n if (typeof colRange === 'number') {\n colRange = { from: colRange, to: colRange };\n }\n\n if (this.hot.getColHeader(0) !== null) {\n var samples = this.samplesGenerator.generateRowSamples(-1, colRange);\n\n this.ghostTable.addColumnHeadersRow(samples.get(-1));\n }\n\n (0, _number.rangeEach)(rowRange.from, rowRange.to, function (row) {\n // For rows we must calculate row height even when user had set height value manually.\n // We can shrink column but cannot shrink rows!\n if (force || _this3.heights[row] === void 0) {\n var _samples = _this3.samplesGenerator.generateRowSamples(row, colRange);\n\n _samples.forEach(function (sample, row) {\n _this3.ghostTable.addRow(row, sample);\n });\n }\n });\n if (this.ghostTable.rows.length) {\n this.ghostTable.getHeights(function (row, height) {\n _this3.heights[row] = height;\n });\n this.ghostTable.clean();\n }\n }\n\n /**\n * Calculate the height of all the rows.\n *\n * @param {Object|Number} colRange Column range object.\n */\n\n }, {\n key: 'calculateAllRowsHeight',\n value: function calculateAllRowsHeight() {\n var _this4 = this;\n\n var colRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countCols() - 1 };\n\n var current = 0;\n var length = this.hot.countRows() - 1;\n var timer = null;\n\n this.inProgress = true;\n\n var loop = function loop() {\n // When hot was destroyed after calculating finished cancel frame\n if (!_this4.hot) {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n return;\n }\n _this4.calculateRowsHeight({ from: current, to: Math.min(current + AutoRowSize.CALCULATION_STEP, length) }, colRange);\n current = current + AutoRowSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = (0, _feature.requestAnimationFrame)(loop);\n } else {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n // @TODO Should call once per render cycle, currently fired separately in different plugins\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n // tmp\n if (_this4.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n _this4.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n // sync\n if (this.firstCalculation && this.getSyncCalculationLimit()) {\n this.calculateRowsHeight({ from: 0, to: this.getSyncCalculationLimit() }, colRange);\n this.firstCalculation = false;\n current = this.getSyncCalculationLimit() + 1;\n }\n // async\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n this.hot.view.wt.wtOverlays.adjustElementsSize(false);\n }\n }\n\n /**\n * Set the sampling options.\n *\n * @private\n */\n\n }, {\n key: 'setSamplingOptions',\n value: function setSamplingOptions() {\n var setting = this.hot.getSettings().autoRowSize;\n var samplingRatio = setting && (0, _object.hasOwnProperty)(setting, 'samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0;\n var allowSampleDuplicates = setting && (0, _object.hasOwnProperty)(setting, 'allowSampleDuplicates') ? this.hot.getSettings().autoRowSize.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n\n /**\n * Recalculate all rows height (overwrite cache values).\n */\n\n }, {\n key: 'recalculateAllRowsHeight',\n value: function recalculateAllRowsHeight() {\n if ((0, _element.isVisible)(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllRowsHeight();\n }\n }\n\n /**\n * Get value which tells how much rows will be calculated synchronously. Rest rows will be calculated asynchronously.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getSyncCalculationLimit',\n value: function getSyncCalculationLimit() {\n /* eslint-disable no-bitwise */\n var limit = AutoRowSize.SYNC_CALCULATION_LIMIT;\n var rowsLimit = this.hot.countRows() - 1;\n\n if ((0, _object.isObject)(this.hot.getSettings().autoRowSize)) {\n limit = this.hot.getSettings().autoRowSize.syncLimit;\n\n if ((0, _string.isPercentValue)(limit)) {\n limit = (0, _number.valueAccordingPercent)(rowsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, rowsLimit);\n }\n\n /**\n * Get the calculated row height.\n *\n * @param {Number} row Row index.\n * @param {Number} [defaultHeight] Default row height. It will be pick up if no calculated height found.\n * @returns {Number}\n */\n\n }, {\n key: 'getRowHeight',\n value: function getRowHeight(row) {\n var defaultHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;\n\n var height = defaultHeight;\n\n if (this.heights[row] !== void 0 && this.heights[row] > (defaultHeight || 0)) {\n height = this.heights[row];\n }\n\n return height;\n }\n\n /**\n * Get the calculated column header height.\n *\n * @returns {Number|undefined}\n */\n\n }, {\n key: 'getColumnHeaderHeight',\n value: function getColumnHeaderHeight() {\n return this.heights[-1];\n }\n\n /**\n * Get the first visible row.\n *\n * @returns {Number} Returns row index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getFirstVisibleRow',\n value: function getFirstVisibleRow() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleRow();\n }\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getFirstRenderedRow();\n }\n\n return -1;\n }\n\n /**\n * Get the last visible row.\n *\n * @returns {Number} Returns row index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getLastVisibleRow',\n value: function getLastVisibleRow() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getLastVisibleRow();\n }\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getLastRenderedRow();\n }\n\n return -1;\n }\n\n /**\n * Clear cached heights.\n */\n\n }, {\n key: 'clearCache',\n value: function clearCache() {\n this.heights.length = 0;\n this.heights[-1] = void 0;\n }\n\n /**\n * Clear cache by range.\n *\n * @param {Object|Number} range Row range object.\n */\n\n }, {\n key: 'clearCacheByRange',\n value: function clearCacheByRange(range) {\n var _this5 = this;\n\n if (typeof range === 'number') {\n range = { from: range, to: range };\n }\n (0, _number.rangeEach)(Math.min(range.from, range.to), Math.max(range.from, range.to), function (row) {\n _this5.heights[row] = void 0;\n });\n }\n\n /**\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNeedRecalculate',\n value: function isNeedRecalculate() {\n return !!(0, _array.arrayFilter)(this.heights, function (item) {\n return item === void 0;\n }).length;\n }\n\n /**\n * On before render listener.\n *\n * @private\n */\n\n }, {\n key: 'onBeforeRender',\n value: function onBeforeRender() {\n var force = this.hot.renderCall;\n this.calculateRowsHeight({ from: this.getFirstVisibleRow(), to: this.getLastVisibleRow() }, void 0, force);\n\n var fixedRowsBottom = this.hot.getSettings().fixedRowsBottom;\n\n // Calculate rows height synchronously for bottom overlay\n if (fixedRowsBottom) {\n var totalRows = this.hot.countRows() - 1;\n this.calculateRowsHeight({ from: totalRows - fixedRowsBottom, to: totalRows });\n }\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllRowsHeight();\n }\n }\n\n /**\n * On before row move listener.\n *\n * @private\n * @param {Number} from Row index where was grabbed.\n * @param {Number} to Destination row index.\n */\n\n }, {\n key: 'onBeforeRowMove',\n value: function onBeforeRowMove(from, to) {\n this.clearCacheByRange({ from: from, to: to });\n this.calculateAllRowsHeight();\n }\n\n /**\n * On before row resize listener.\n *\n * @private\n * @param {Number} row\n * @param {Number} size\n * @param {Boolean} isDblClick\n * @returns {Number}\n */\n\n }, {\n key: 'onBeforeRowResize',\n value: function onBeforeRowResize(row, size, isDblClick) {\n if (isDblClick) {\n this.calculateRowsHeight(row, void 0, true);\n size = this.getRowHeight(row);\n }\n\n return size;\n }\n\n /**\n * On after load data listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData() {\n var _this6 = this;\n\n if (this.hot.view) {\n this.recalculateAllRowsHeight();\n } else {\n // first load - initialization\n setTimeout(function () {\n if (_this6.hot) {\n _this6.recalculateAllRowsHeight();\n }\n }, 0);\n }\n }\n\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes\n */\n\n }, {\n key: 'onBeforeChange',\n value: function onBeforeChange(changes) {\n var range = null;\n\n if (changes.length === 1) {\n range = changes[0][0];\n } else if (changes.length > 1) {\n range = {\n from: changes[0][0],\n to: changes[changes.length - 1][0]\n };\n }\n if (range !== null) {\n this.clearCacheByRange(range);\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.ghostTable.clean();\n _get(AutoRowSize.prototype.__proto__ || Object.getPrototypeOf(AutoRowSize.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return AutoRowSize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('autoRowSize', AutoRowSize);\n\nexports.default = AutoRowSize;\n\n/***/ }),\n/* 213 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _src = __webpack_require__(11);\n\nvar _utils = __webpack_require__(214);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('modifyAutofillRange');\n_pluginHooks2.default.getSingleton().register('beforeAutofill');\n\nvar INSERT_ROW_ALTER_ACTION_NAME = 'insert_row';\nvar INTERVAL_FOR_ADDING_ROW = 200;\n\n/**\n * This plugin provides \"drag-down\" and \"copy-down\" functionalities, both operated\n * using the small square in the right bottom of the cell selection.\n *\n * \"Drag-down\" expands the value of the selected cells to the neighbouring\n * cells when you drag the small square in the corner.\n *\n * \"Copy-down\" copies the value of the selection to all empty cells\n * below when you double click the small square.\n *\n * @class Autofill\n * @plugin Autofill\n */\n\nvar Autofill = function (_BasePlugin) {\n _inherits(Autofill, _BasePlugin);\n\n function Autofill(hotInstance) {\n _classCallCheck(this, Autofill);\n\n /**\n * Event manager\n *\n * @type {EventManager}\n */\n var _this = _possibleConstructorReturn(this, (Autofill.__proto__ || Object.getPrototypeOf(Autofill)).call(this, hotInstance));\n\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Specifies if adding new row started.\n *\n * @type {Boolean}\n */\n _this.addingStarted = false;\n /**\n * Specifies if there was mouse down on the cell corner.\n *\n * @type {Boolean}\n */\n _this.mouseDownOnCellCorner = false;\n /**\n * Specifies if mouse was dragged outside Handsontable.\n *\n * @type {Boolean}\n */\n _this.mouseDragOutside = false;\n /**\n * Specifies how many cell levels were dragged using the handle.\n *\n * @type {Boolean}\n */\n _this.handleDraggedCells = 0;\n /**\n * Specifies allowed directions of drag.\n *\n * @type {Array}\n */\n _this.directions = [];\n /**\n * Specifies if can insert new rows if needed.\n *\n * @type {Boolean}\n */\n _this.autoInsertRow = false;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(Autofill, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().fillHandle;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.mapSettings();\n this.registerEvents();\n\n this.addHook('afterOnCellCornerMouseDown', function (event) {\n return _this2.onAfterCellCornerMouseDown(event);\n });\n this.addHook('afterOnCellCornerDblClick', function (event) {\n return _this2.onCellCornerDblClick(event);\n });\n this.addHook('beforeOnCellMouseOver', function (event, coords, TD) {\n return _this2.onBeforeCellMouseOver(coords);\n });\n\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Update plugin for this Handsontable instance.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n this.clearMappedSettings();\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Get selection data\n *\n * @private\n * @returns {Array} Array with the data.\n */\n\n }, {\n key: 'getSelectionData',\n value: function getSelectionData() {\n var selRange = {\n from: this.hot.getSelectedRange().from,\n to: this.hot.getSelectedRange().to\n };\n\n return this.hot.getData(selRange.from.row, selRange.from.col, selRange.to.row, selRange.to.col);\n }\n\n /**\n * Try to apply fill values to the area in fill border, omitting the selection border.\n *\n * @private\n * @returns {Boolean} reports if fill was applied.\n */\n\n }, {\n key: 'fillIn',\n value: function fillIn() {\n if (this.hot.view.wt.selections.fill.isEmpty()) {\n return false;\n }\n\n var cornersOfSelectionAndDragAreas = this.hot.view.wt.selections.fill.getCorners();\n\n this.resetSelectionOfDraggedArea();\n\n var cornersOfSelectedCells = this.getCornersOfSelectedCells();\n\n var _getDragDirectionAndR = (0, _utils.getDragDirectionAndRange)(cornersOfSelectedCells, cornersOfSelectionAndDragAreas),\n directionOfDrag = _getDragDirectionAndR.directionOfDrag,\n startOfDragCoords = _getDragDirectionAndR.startOfDragCoords,\n endOfDragCoords = _getDragDirectionAndR.endOfDragCoords;\n\n this.hot.runHooks('modifyAutofillRange', cornersOfSelectedCells, cornersOfSelectionAndDragAreas);\n\n if (startOfDragCoords && startOfDragCoords.row > -1 && startOfDragCoords.col > -1) {\n var selectionData = this.getSelectionData();\n var deltas = (0, _utils.getDeltas)(startOfDragCoords, endOfDragCoords, selectionData, directionOfDrag);\n\n this.hot.runHooks('beforeAutofill', startOfDragCoords, endOfDragCoords, selectionData);\n\n this.hot.populateFromArray(startOfDragCoords.row, startOfDragCoords.col, selectionData, endOfDragCoords.row, endOfDragCoords.col, this.pluginName + '.fill', null, directionOfDrag, deltas);\n\n this.setSelection(cornersOfSelectionAndDragAreas);\n } else {\n // reset to avoid some range bug\n this.hot.selection.refreshBorders();\n }\n\n return true;\n }\n\n /**\n * Reduce the selection area if the handle was dragged outside of the table or on headers.\n *\n * @private\n * @param {CellCoords} coords indexes of selection corners.\n * @returns {CellCoords}\n */\n\n }, {\n key: 'reduceSelectionAreaIfNeeded',\n value: function reduceSelectionAreaIfNeeded(coords) {\n if (coords.row < 0) {\n coords.row = 0;\n }\n\n if (coords.col < 0) {\n coords.col = 0;\n }\n return coords;\n }\n\n /**\n * Get the coordinates of the drag & drop borders.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n * @returns {Array}\n */\n\n }, {\n key: 'getCoordsOfDragAndDropBorders',\n value: function getCoordsOfDragAndDropBorders(coordsOfSelection) {\n var topLeftCorner = this.hot.getSelectedRange().getTopLeftCorner();\n var bottomRightCorner = this.hot.getSelectedRange().getBottomRightCorner();\n var coords = void 0;\n\n if (this.directions.includes(_utils.DIRECTIONS.vertical) && (bottomRightCorner.row < coordsOfSelection.row || topLeftCorner.row > coordsOfSelection.row)) {\n coords = new _src.CellCoords(coordsOfSelection.row, bottomRightCorner.col);\n } else if (this.directions.includes(_utils.DIRECTIONS.horizontal)) {\n coords = new _src.CellCoords(bottomRightCorner.row, coordsOfSelection.col);\n } else {\n // wrong direction\n return;\n }\n\n return this.reduceSelectionAreaIfNeeded(coords);\n }\n\n /**\n * Show the fill border.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n */\n\n }, {\n key: 'showBorder',\n value: function showBorder(coordsOfSelection) {\n var coordsOfDragAndDropBorders = this.getCoordsOfDragAndDropBorders(coordsOfSelection);\n\n if (coordsOfDragAndDropBorders) {\n this.redrawBorders(coordsOfDragAndDropBorders);\n }\n }\n\n /**\n * Add new row\n *\n * @private\n */\n\n }, {\n key: 'addRow',\n value: function addRow() {\n var _this3 = this;\n\n this.hot._registerTimeout(setTimeout(function () {\n _this3.hot.alter(INSERT_ROW_ALTER_ACTION_NAME, void 0, 1, _this3.pluginName + '.fill');\n\n _this3.addingStarted = false;\n }, INTERVAL_FOR_ADDING_ROW));\n }\n\n /**\n * Add new rows if they are needed to continue auto-filling values.\n *\n * @private\n */\n\n }, {\n key: 'addNewRowIfNeeded',\n value: function addNewRowIfNeeded() {\n if (this.hot.view.wt.selections.fill.cellRange && this.addingStarted === false && this.autoInsertRow) {\n var cornersOfSelectedCells = this.hot.getSelected();\n var cornersOfSelectedDragArea = this.hot.view.wt.selections.fill.getCorners();\n var nrOfTableRows = this.hot.countRows();\n\n if (cornersOfSelectedCells[2] < nrOfTableRows - 1 && cornersOfSelectedDragArea[2] === nrOfTableRows - 1) {\n this.addingStarted = true;\n\n this.addRow();\n }\n }\n }\n\n /**\n * Get corners of selected cells.\n *\n * @private\n * @returns {Array}\n */\n\n }, {\n key: 'getCornersOfSelectedCells',\n value: function getCornersOfSelectedCells() {\n if (this.hot.selection.isMultiple()) {\n return this.hot.view.wt.selections.area.getCorners();\n }\n return this.hot.view.wt.selections.current.getCorners();\n }\n\n /**\n * Get index of last adjacent filled in row\n *\n * @private\n * @param {Array} cornersOfSelectedCells indexes of selection corners.\n * @returns {Number} gives number greater than or equal to zero when selection adjacent can be applied.\n * or -1 when selection adjacent can't be applied\n */\n\n }, {\n key: 'getIndexOfLastAdjacentFilledInRow',\n value: function getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells) {\n var data = this.hot.getData();\n var nrOfTableRows = this.hot.countRows();\n var lastFilledInRowIndex = void 0;\n\n for (var rowIndex = cornersOfSelectedCells[2] + 1; rowIndex < nrOfTableRows; rowIndex++) {\n for (var columnIndex = cornersOfSelectedCells[1]; columnIndex <= cornersOfSelectedCells[3]; columnIndex++) {\n var dataInCell = data[rowIndex][columnIndex];\n\n if (dataInCell) {\n return -1;\n }\n }\n\n var dataInNextLeftCell = data[rowIndex][cornersOfSelectedCells[1] - 1];\n var dataInNextRightCell = data[rowIndex][cornersOfSelectedCells[3] + 1];\n\n if (!!dataInNextLeftCell || !!dataInNextRightCell) {\n lastFilledInRowIndex = rowIndex;\n }\n }\n return lastFilledInRowIndex;\n }\n\n /**\n * Add a selection from the start area to the specific row index.\n *\n * @private\n * @param {Array} selectStartArea selection area from which we start to create more comprehensive selection.\n * @param {Number} rowIndex\n */\n\n }, {\n key: 'addSelectionFromStartAreaToSpecificRowIndex',\n value: function addSelectionFromStartAreaToSpecificRowIndex(selectStartArea, rowIndex) {\n this.hot.view.wt.selections.fill.clear();\n this.hot.view.wt.selections.fill.add(new _src.CellCoords(selectStartArea[0], selectStartArea[1]));\n this.hot.view.wt.selections.fill.add(new _src.CellCoords(rowIndex, selectStartArea[3]));\n }\n\n /**\n * Set selection based on passed corners.\n *\n * @private\n * @param {Array} cornersOfArea\n */\n\n }, {\n key: 'setSelection',\n value: function setSelection(cornersOfArea) {\n this.hot.selection.setRangeStart(new _src.CellCoords(cornersOfArea[0], cornersOfArea[1]));\n this.hot.selection.setRangeEnd(new _src.CellCoords(cornersOfArea[2], cornersOfArea[3]));\n }\n\n /**\n * Try to select cells down to the last row in the left column and then returns if selection was applied.\n *\n * @private\n * @returns {Boolean}\n */\n\n }, {\n key: 'selectAdjacent',\n value: function selectAdjacent() {\n var cornersOfSelectedCells = this.getCornersOfSelectedCells();\n var lastFilledInRowIndex = this.getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells);\n\n if (lastFilledInRowIndex === -1) {\n return false;\n }\n this.addSelectionFromStartAreaToSpecificRowIndex(cornersOfSelectedCells, lastFilledInRowIndex);\n\n return true;\n }\n\n /**\n * Reset selection of dragged area.\n *\n * @private\n */\n\n }, {\n key: 'resetSelectionOfDraggedArea',\n value: function resetSelectionOfDraggedArea() {\n this.handleDraggedCells = 0;\n\n this.hot.view.wt.selections.fill.clear();\n }\n\n /**\n * Redraw borders.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n\n }, {\n key: 'redrawBorders',\n value: function redrawBorders(coords) {\n this.hot.view.wt.selections.fill.clear();\n this.hot.view.wt.selections.fill.add(this.hot.getSelectedRange().from);\n this.hot.view.wt.selections.fill.add(this.hot.getSelectedRange().to);\n this.hot.view.wt.selections.fill.add(coords);\n this.hot.view.render();\n }\n\n /**\n * Get if mouse was dragged outside.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n * @returns {Boolean}\n */\n\n }, {\n key: 'getIfMouseWasDraggedOutside',\n value: function getIfMouseWasDraggedOutside(event) {\n var tableBottom = (0, _element.offset)(this.hot.table).top - (window.pageYOffset || document.documentElement.scrollTop) + (0, _element.outerHeight)(this.hot.table);\n var tableRight = (0, _element.offset)(this.hot.table).left - (window.pageXOffset || document.documentElement.scrollLeft) + (0, _element.outerWidth)(this.hot.table);\n\n return event.clientY > tableBottom && event.clientX <= tableRight;\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this4 = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function () {\n return _this4.onMouseUp();\n });\n this.eventManager.addEventListener(document.documentElement, 'mousemove', function (event) {\n return _this4.onMouseMove(event);\n });\n }\n\n /**\n * On cell corner double click callback.\n *\n * @private\n */\n\n }, {\n key: 'onCellCornerDblClick',\n value: function onCellCornerDblClick() {\n var selectionApplied = this.selectAdjacent();\n\n if (selectionApplied) {\n this.fillIn();\n }\n }\n\n /**\n * On after cell corner mouse down listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterCellCornerMouseDown',\n value: function onAfterCellCornerMouseDown() {\n this.handleDraggedCells = 1;\n this.mouseDownOnCellCorner = true;\n }\n\n /**\n * On before cell mouse over listener.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n\n }, {\n key: 'onBeforeCellMouseOver',\n value: function onBeforeCellMouseOver(coords) {\n if (this.mouseDownOnCellCorner && !this.hot.view.isMouseDown() && this.handleDraggedCells) {\n this.handleDraggedCells++;\n\n this.showBorder(coords);\n this.addNewRowIfNeeded();\n }\n }\n\n /**\n * On mouse up listener.\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n if (this.handleDraggedCells) {\n if (this.handleDraggedCells > 1) {\n this.fillIn();\n }\n\n this.handleDraggedCells = 0;\n this.mouseDownOnCellCorner = false;\n }\n }\n\n /**\n * On mouse move listener.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var mouseWasDraggedOutside = this.getIfMouseWasDraggedOutside(event);\n\n if (this.addingStarted === false && this.handleDraggedCells > 0 && mouseWasDraggedOutside) {\n this.mouseDragOutside = true;\n this.addingStarted = true;\n } else {\n this.mouseDragOutside = false;\n }\n\n if (this.mouseDragOutside && this.autoInsertRow) {\n this.addRow();\n }\n }\n\n /**\n * Clear mapped settings.\n *\n * @private\n */\n\n }, {\n key: 'clearMappedSettings',\n value: function clearMappedSettings() {\n this.directions.length = 0;\n this.autoInsertRow = false;\n }\n\n /**\n * Map settings.\n *\n * @private\n */\n\n }, {\n key: 'mapSettings',\n value: function mapSettings() {\n var mappedSettings = (0, _utils.getMappedFillHandleSetting)(this.hot.getSettings().fillHandle);\n this.directions = mappedSettings.directions;\n this.autoInsertRow = mappedSettings.autoInsertRow;\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return Autofill;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('autofill', Autofill);\n\nexports.default = Autofill;\n\n/***/ }),\n/* 214 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.DIRECTIONS = undefined;\nexports.getDeltas = getDeltas;\nexports.getDragDirectionAndRange = getDragDirectionAndRange;\nexports.getMappedFillHandleSetting = getMappedFillHandleSetting;\n\nvar _object = __webpack_require__(2);\n\nvar _mixed = __webpack_require__(20);\n\nvar _src = __webpack_require__(11);\n\nvar DIRECTIONS = exports.DIRECTIONS = {\n horizontal: 'horizontal',\n vertical: 'vertical'\n};\n\n/**\n * Get deltas array.\n *\n * @param {CellCoords} start\n * @param {CellCoords} end\n * @param {Array} data\n * @param {String} direction\n * @returns {Array}\n */\nfunction getDeltas(start, end, data, direction) {\n var rowsLength = data.length;\n var columnsLength = data ? data[0].length : 0;\n var deltas = [];\n var diffRow = end.row - start.row;\n var diffCol = end.col - start.col;\n\n if (['down', 'up'].indexOf(direction) !== -1) {\n var arr = [];\n\n for (var col = 0; col <= diffCol; col++) {\n var startValue = parseInt(data[0][col], 10);\n var endValue = parseInt(data[rowsLength - 1][col], 10);\n var delta = (direction === 'down' ? endValue - startValue : startValue - endValue) / (rowsLength - 1) || 0;\n\n arr.push(delta);\n }\n\n deltas.push(arr);\n }\n\n if (['right', 'left'].indexOf(direction) !== -1) {\n for (var row = 0; row <= diffRow; row++) {\n var _startValue = parseInt(data[row][0], 10);\n var _endValue = parseInt(data[row][columnsLength - 1], 10);\n var _delta = (direction === 'right' ? _endValue - _startValue : _startValue - _endValue) / (columnsLength - 1) || 0;\n\n deltas.push([_delta]);\n }\n }\n\n return deltas;\n}\n\n/**\n * Get direction between positions and cords of selections difference (drag area)\n *\n * @param {Array} startSelection\n * @param {Array} endSelection\n * @returns {{direction: String, start: CellCoords, end: CellCoords}}\n */\nfunction getDragDirectionAndRange(startSelection, endSelection) {\n var startOfDragCoords = void 0,\n endOfDragCoords = void 0,\n directionOfDrag = void 0;\n\n if (endSelection[0] === startSelection[0] && endSelection[1] < startSelection[1]) {\n directionOfDrag = 'left';\n\n startOfDragCoords = new _src.CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new _src.CellCoords(endSelection[2], startSelection[1] - 1);\n } else if (endSelection[0] === startSelection[0] && endSelection[3] > startSelection[3]) {\n directionOfDrag = 'right';\n\n startOfDragCoords = new _src.CellCoords(endSelection[0], startSelection[3] + 1);\n endOfDragCoords = new _src.CellCoords(endSelection[2], endSelection[3]);\n } else if (endSelection[0] < startSelection[0] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'up';\n\n startOfDragCoords = new _src.CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new _src.CellCoords(startSelection[0] - 1, endSelection[3]);\n } else if (endSelection[2] > startSelection[2] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'down';\n\n startOfDragCoords = new _src.CellCoords(startSelection[2] + 1, endSelection[1]);\n endOfDragCoords = new _src.CellCoords(endSelection[2], endSelection[3]);\n }\n\n return {\n directionOfDrag: directionOfDrag,\n startOfDragCoords: startOfDragCoords,\n endOfDragCoords: endOfDragCoords\n };\n}\n\n/**\n * Get mapped FillHandle setting containing information about\n * allowed FillHandle directions and if allowed is automatic insertion of rows on drag\n *\n * @param {Boolean|Object} fillHandle property of Handsontable settings\n * @returns {{directions: Array, autoInsertRow: Boolean}} object allowing access to information\n * about FillHandle in more useful way\n */\nfunction getMappedFillHandleSetting(fillHandle) {\n var mappedSettings = {};\n\n if (fillHandle === true) {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n mappedSettings.autoInsertRow = true;\n } else if ((0, _object.isObject)(fillHandle)) {\n if ((0, _mixed.isDefined)(fillHandle.autoInsertRow)) {\n\n // autoInsertRow for horizontal direction will be always false\n\n if (fillHandle.direction === DIRECTIONS.horizontal) {\n mappedSettings.autoInsertRow = false;\n } else {\n mappedSettings.autoInsertRow = fillHandle.autoInsertRow;\n }\n } else {\n mappedSettings.autoInsertRow = false;\n }\n\n if ((0, _mixed.isDefined)(fillHandle.direction)) {\n mappedSettings.directions = [fillHandle.direction];\n } else {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n }\n } else if (typeof fillHandle === 'string') {\n mappedSettings.directions = [fillHandle];\n mappedSettings.autoInsertRow = true;\n } else {\n mappedSettings.directions = [];\n mappedSettings.autoInsertRow = false;\n }\n\n return mappedSettings;\n}\n\n/***/ }),\n/* 215 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _mixed = __webpack_require__(20);\n\nvar _object = __webpack_require__(2);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _plugins = __webpack_require__(5);\n\nvar _mergeSort = __webpack_require__(270);\n\nvar _mergeSort2 = _interopRequireDefault(_mergeSort);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('beforeColumnSort');\n_pluginHooks2.default.getSingleton().register('afterColumnSort');\n\n// TODO: Implement mixin arrayMapper to ColumnSorting plugin.\n\n/**\n * @plugin ColumnSorting\n *\n * @description\n * This plugin sorts the view by a column (but does not sort the data source!).\n * To enable the plugin, set the `columnSorting` property to either:\n * * a boolean value (`true`/`false`),\n * * an object defining the initial sorting order (see the example below).\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * columnSorting: true\n * ...\n * // as a object with initial order (sort ascending column at index 2)\n * columnSorting: {\n * column: 2,\n * sortOrder: true, // true = ascending, false = descending, undefined = original order\n * sortEmptyCells: true // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * }\n * ...\n * ```\n * @dependencies ObserveChanges\n */\n\nvar ColumnSorting = function (_BasePlugin) {\n _inherits(ColumnSorting, _BasePlugin);\n\n function ColumnSorting(hotInstance) {\n _classCallCheck(this, ColumnSorting);\n\n var _this2 = _possibleConstructorReturn(this, (ColumnSorting.__proto__ || Object.getPrototypeOf(ColumnSorting)).call(this, hotInstance));\n\n _this2.sortIndicators = [];\n _this2.lastSortedColumn = null;\n _this2.sortEmptyCells = false;\n return _this2;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ColumnSorting, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().columnSorting;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this3 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.setPluginOptions();\n\n var _this = this;\n this.hot.sortIndex = [];\n\n this.hot.sort = function () {\n var args = Array.prototype.slice.call(arguments);\n\n return _this.sortByColumn.apply(_this, _toConsumableArray(args));\n };\n\n if (typeof this.hot.getSettings().observeChanges === 'undefined') {\n this.enableObserveChangesPlugin();\n }\n\n this.addHook('afterTrimRow', function (row) {\n return _this3.sort();\n });\n this.addHook('afterUntrimRow', function (row) {\n return _this3.sort();\n });\n this.addHook('modifyRow', function (row) {\n return _this3.translateRow(row);\n });\n this.addHook('unmodifyRow', function (row) {\n return _this3.untranslateRow(row);\n });\n this.addHook('afterUpdateSettings', function () {\n return _this3.onAfterUpdateSettings();\n });\n this.addHook('afterGetColHeader', function (col, TH) {\n return _this3.getColHeader(col, TH);\n });\n this.addHook('afterOnCellMouseDown', function (event, target) {\n return _this3.onAfterOnCellMouseDown(event, target);\n });\n this.addHook('afterCreateRow', function () {\n _this.afterCreateRow.apply(_this, arguments);\n });\n this.addHook('afterRemoveRow', function () {\n _this.afterRemoveRow.apply(_this, arguments);\n });\n this.addHook('afterInit', function () {\n return _this3.sortBySettings();\n });\n this.addHook('afterLoadData', function () {\n _this3.hot.sortIndex = [];\n\n if (_this3.hot.view) {\n _this3.sortBySettings();\n }\n });\n if (this.hot.view) {\n this.sortBySettings();\n }\n _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n this.hot.sort = void 0;\n _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * afterUpdateSettings callback.\n *\n * @private\n */\n\n }, {\n key: 'onAfterUpdateSettings',\n value: function onAfterUpdateSettings() {\n this.sortBySettings();\n }\n }, {\n key: 'sortBySettings',\n value: function sortBySettings() {\n var sortingSettings = this.hot.getSettings().columnSorting;\n var loadedSortingState = this.loadSortingState();\n var sortingColumn = void 0;\n var sortingOrder = void 0;\n\n if (typeof loadedSortingState === 'undefined') {\n sortingColumn = sortingSettings.column;\n sortingOrder = sortingSettings.sortOrder;\n } else {\n sortingColumn = loadedSortingState.sortColumn;\n sortingOrder = loadedSortingState.sortOrder;\n }\n if (typeof sortingColumn === 'number') {\n this.lastSortedColumn = sortingColumn;\n this.sortByColumn(sortingColumn, sortingOrder);\n }\n }\n\n /**\n * Set sorted column and order info\n *\n * @param {number} col Sorted column index.\n * @param {boolean|undefined} order Sorting order (`true` for ascending, `false` for descending).\n */\n\n }, {\n key: 'setSortingColumn',\n value: function setSortingColumn(col, order) {\n if (typeof col == 'undefined') {\n this.hot.sortColumn = void 0;\n this.hot.sortOrder = void 0;\n\n return;\n } else if (this.hot.sortColumn === col && typeof order == 'undefined') {\n if (this.hot.sortOrder === false) {\n this.hot.sortOrder = void 0;\n } else {\n this.hot.sortOrder = !this.hot.sortOrder;\n }\n } else {\n this.hot.sortOrder = typeof order === 'undefined' ? true : order;\n }\n\n this.hot.sortColumn = col;\n }\n }, {\n key: 'sortByColumn',\n value: function sortByColumn(col, order) {\n this.setSortingColumn(col, order);\n\n if (typeof this.hot.sortColumn == 'undefined') {\n return;\n }\n\n var allowSorting = this.hot.runHooks('beforeColumnSort', this.hot.sortColumn, this.hot.sortOrder);\n\n if (allowSorting !== false) {\n this.sort();\n }\n this.updateOrderClass();\n this.updateSortIndicator();\n\n this.hot.runHooks('afterColumnSort', this.hot.sortColumn, this.hot.sortOrder);\n\n this.hot.render();\n this.saveSortingState();\n }\n\n /**\n * Save the sorting state\n */\n\n }, {\n key: 'saveSortingState',\n value: function saveSortingState() {\n var sortingState = {};\n\n if (typeof this.hot.sortColumn != 'undefined') {\n sortingState.sortColumn = this.hot.sortColumn;\n }\n\n if (typeof this.hot.sortOrder != 'undefined') {\n sortingState.sortOrder = this.hot.sortOrder;\n }\n\n if ((0, _object.hasOwnProperty)(sortingState, 'sortColumn') || (0, _object.hasOwnProperty)(sortingState, 'sortOrder')) {\n this.hot.runHooks('persistentStateSave', 'columnSorting', sortingState);\n }\n }\n\n /**\n * Load the sorting state.\n *\n * @returns {*} Previously saved sorting state.\n */\n\n }, {\n key: 'loadSortingState',\n value: function loadSortingState() {\n var storedState = {};\n this.hot.runHooks('persistentStateLoad', 'columnSorting', storedState);\n\n return storedState.value;\n }\n\n /**\n * Update sorting class name state.\n */\n\n }, {\n key: 'updateOrderClass',\n value: function updateOrderClass() {\n var orderClass = void 0;\n\n if (this.hot.sortOrder === true) {\n orderClass = 'ascending';\n } else if (this.hot.sortOrder === false) {\n orderClass = 'descending';\n }\n this.sortOrderClass = orderClass;\n }\n }, {\n key: 'enableObserveChangesPlugin',\n value: function enableObserveChangesPlugin() {\n var _this = this;\n\n this.hot._registerTimeout(setTimeout(function () {\n _this.hot.updateSettings({\n observeChanges: true\n });\n }, 0));\n }\n\n /**\n * Default sorting algorithm.\n *\n * @param {Boolean} sortOrder Sorting order - `true` for ascending, `false` for descending.\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The comparing function.\n */\n\n }, {\n key: 'defaultSort',\n value: function defaultSort(sortOrder, columnMeta) {\n return function (a, b) {\n if (typeof a[1] == 'string') {\n a[1] = a[1].toLowerCase();\n }\n if (typeof b[1] == 'string') {\n b[1] = b[1].toLowerCase();\n }\n\n if (a[1] === b[1]) {\n return 0;\n }\n\n if ((0, _mixed.isEmpty)(a[1])) {\n if ((0, _mixed.isEmpty)(b[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? -1 : 1;\n }\n\n return 1;\n }\n if ((0, _mixed.isEmpty)(b[1])) {\n if ((0, _mixed.isEmpty)(a[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? 1 : -1;\n }\n\n return -1;\n }\n\n if (isNaN(a[1]) && !isNaN(b[1])) {\n return sortOrder ? 1 : -1;\n } else if (!isNaN(a[1]) && isNaN(b[1])) {\n return sortOrder ? -1 : 1;\n } else if (!(isNaN(a[1]) || isNaN(b[1]))) {\n a[1] = parseFloat(a[1]);\n b[1] = parseFloat(b[1]);\n }\n if (a[1] < b[1]) {\n return sortOrder ? -1 : 1;\n }\n if (a[1] > b[1]) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Date sorting algorithm\n * @param {Boolean} sortOrder Sorting order (`true` for ascending, `false` for descending).\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The compare function.\n */\n\n }, {\n key: 'dateSort',\n value: function dateSort(sortOrder, columnMeta) {\n return function (a, b) {\n if (a[1] === b[1]) {\n return 0;\n }\n\n if ((0, _mixed.isEmpty)(a[1])) {\n if ((0, _mixed.isEmpty)(b[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? -1 : 1;\n }\n\n return 1;\n }\n\n if ((0, _mixed.isEmpty)(b[1])) {\n if ((0, _mixed.isEmpty)(a[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? 1 : -1;\n }\n\n return -1;\n }\n\n var aDate = (0, _moment2.default)(a[1], columnMeta.dateFormat);\n var bDate = (0, _moment2.default)(b[1], columnMeta.dateFormat);\n\n if (!aDate.isValid()) {\n return 1;\n }\n if (!bDate.isValid()) {\n return -1;\n }\n\n if (bDate.isAfter(aDate)) {\n return sortOrder ? -1 : 1;\n }\n if (bDate.isBefore(aDate)) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Numeric sorting algorithm.\n *\n * @param {Boolean} sortOrder Sorting order (`true` for ascending, `false` for descending).\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The compare function.\n */\n\n }, {\n key: 'numericSort',\n value: function numericSort(sortOrder, columnMeta) {\n return function (a, b) {\n var parsedA = parseFloat(a[1]);\n var parsedB = parseFloat(b[1]);\n\n // Watch out when changing this part of code!\n // Check below returns 0 (as expected) when comparing empty string, null, undefined\n if (parsedA === parsedB || isNaN(parsedA) && isNaN(parsedB)) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n if ((0, _mixed.isEmpty)(a[1])) {\n return sortOrder ? -1 : 1;\n }\n\n if ((0, _mixed.isEmpty)(b[1])) {\n return sortOrder ? 1 : -1;\n }\n }\n\n if (isNaN(parsedA)) {\n return 1;\n }\n\n if (isNaN(parsedB)) {\n return -1;\n }\n\n if (parsedA < parsedB) {\n return sortOrder ? -1 : 1;\n } else if (parsedA > parsedB) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Perform the sorting.\n */\n\n }, {\n key: 'sort',\n value: function sort() {\n if (typeof this.hot.sortOrder == 'undefined') {\n this.hot.sortIndex.length = 0;\n\n return;\n }\n\n var colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);\n var emptyRows = this.hot.countEmptyRows();\n var sortFunction = void 0;\n var nrOfRows = void 0;\n\n this.hot.sortingEnabled = false; // this is required by translateRow plugin hook\n this.hot.sortIndex.length = 0;\n\n if (typeof colMeta.columnSorting.sortEmptyCells === 'undefined') {\n colMeta.columnSorting = { sortEmptyCells: this.sortEmptyCells };\n }\n\n if (this.hot.getSettings().maxRows === Number.POSITIVE_INFINITY) {\n nrOfRows = this.hot.countRows() - this.hot.getSettings().minSpareRows;\n } else {\n nrOfRows = this.hot.countRows() - emptyRows;\n }\n\n for (var i = 0, ilen = nrOfRows; i < ilen; i++) {\n this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]);\n }\n\n if (colMeta.sortFunction) {\n sortFunction = colMeta.sortFunction;\n } else {\n switch (colMeta.type) {\n case 'date':\n sortFunction = this.dateSort;\n break;\n case 'numeric':\n sortFunction = this.numericSort;\n break;\n default:\n sortFunction = this.defaultSort;\n }\n }\n\n (0, _mergeSort2.default)(this.hot.sortIndex, sortFunction(this.hot.sortOrder, colMeta));\n\n // Append spareRows\n for (var _i = this.hot.sortIndex.length; _i < this.hot.countRows(); _i++) {\n this.hot.sortIndex.push([_i, this.hot.getDataAtCell(_i, this.hot.sortColumn)]);\n }\n\n this.hot.sortingEnabled = true; // this is required by translateRow plugin hook\n }\n\n /**\n * Update indicator states.\n */\n\n }, {\n key: 'updateSortIndicator',\n value: function updateSortIndicator() {\n if (typeof this.hot.sortOrder == 'undefined') {\n return;\n }\n var colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);\n\n this.sortIndicators[this.hot.sortColumn] = colMeta.sortIndicator;\n }\n\n /**\n * `modifyRow` hook callback. Translates physical row index to the sorted row index.\n *\n * @param {Number} row Row index.\n * @returns {Number} Sorted row index.\n */\n\n }, {\n key: 'translateRow',\n value: function translateRow(row) {\n if (this.hot.sortingEnabled && typeof this.hot.sortOrder !== 'undefined' && this.hot.sortIndex && this.hot.sortIndex.length && this.hot.sortIndex[row]) {\n return this.hot.sortIndex[row][0];\n }\n\n return row;\n }\n\n /**\n * Translates sorted row index to physical row index.\n *\n * @param {Number} row Sorted row index.\n * @returns {number} Physical row index.\n */\n\n }, {\n key: 'untranslateRow',\n value: function untranslateRow(row) {\n if (this.hot.sortingEnabled && this.hot.sortIndex && this.hot.sortIndex.length) {\n for (var i = 0; i < this.hot.sortIndex.length; i++) {\n if (this.hot.sortIndex[i][0] == row) {\n return i;\n }\n }\n }\n }\n\n /**\n * `afterGetColHeader` callback. Adds column sorting css classes to clickable headers.\n *\n * @private\n * @param {Number} col Column index.\n * @param {Element} TH TH HTML element.\n */\n\n }, {\n key: 'getColHeader',\n value: function getColHeader(col, TH) {\n if (col < 0 || !TH.parentNode) {\n return false;\n }\n\n var headerLink = TH.querySelector('.colHeader');\n var colspan = TH.getAttribute('colspan');\n var TRs = TH.parentNode.parentNode.childNodes;\n var headerLevel = Array.prototype.indexOf.call(TRs, TH.parentNode);\n headerLevel -= TRs.length;\n\n if (!headerLink) {\n return;\n }\n\n if (this.hot.getSettings().columnSorting && col >= 0 && headerLevel === -1) {\n (0, _element.addClass)(headerLink, 'columnSorting');\n }\n (0, _element.removeClass)(headerLink, 'descending');\n (0, _element.removeClass)(headerLink, 'ascending');\n\n if (this.sortIndicators[col]) {\n if (col === this.hot.sortColumn) {\n if (this.sortOrderClass === 'ascending') {\n (0, _element.addClass)(headerLink, 'ascending');\n } else if (this.sortOrderClass === 'descending') {\n (0, _element.addClass)(headerLink, 'descending');\n }\n }\n }\n }\n\n /**\n * Check if any column is in a sorted state.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSorted',\n value: function isSorted() {\n return typeof this.hot.sortColumn != 'undefined';\n }\n\n /**\n * `afterCreateRow` callback. Updates the sorting state after a row have been created.\n *\n * @private\n * @param {Number} index\n * @param {Number} amount\n */\n\n }, {\n key: 'afterCreateRow',\n value: function afterCreateRow(index, amount) {\n if (!this.isSorted()) {\n return;\n }\n\n for (var i = 0; i < this.hot.sortIndex.length; i++) {\n if (this.hot.sortIndex[i][0] >= index) {\n this.hot.sortIndex[i][0] += amount;\n }\n }\n\n for (var _i2 = 0; _i2 < amount; _i2++) {\n this.hot.sortIndex.splice(index + _i2, 0, [index + _i2, this.hot.getSourceData()[index + _i2][this.hot.sortColumn + this.hot.colOffset()]]);\n }\n\n this.saveSortingState();\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n * @param {Number} index\n * @param {Number} amount\n */\n\n }, {\n key: 'afterRemoveRow',\n value: function afterRemoveRow(index, amount) {\n if (!this.isSorted()) {\n return;\n }\n var removedRows = this.hot.sortIndex.splice(index, amount);\n\n removedRows = (0, _array.arrayMap)(removedRows, function (row) {\n return row[0];\n });\n\n function countRowShift(logicalRow) {\n // Todo: compare perf between reduce vs sort->each->brake\n return (0, _array.arrayReduce)(removedRows, function (count, removedLogicalRow) {\n if (logicalRow > removedLogicalRow) {\n count++;\n }\n\n return count;\n }, 0);\n }\n\n this.hot.sortIndex = (0, _array.arrayMap)(this.hot.sortIndex, function (logicalRow, physicalRow) {\n var rowShift = countRowShift(logicalRow[0]);\n\n if (rowShift) {\n logicalRow[0] -= rowShift;\n }\n\n return logicalRow;\n });\n\n this.saveSortingState();\n }\n\n /**\n * Set options by passed settings\n *\n * @private\n */\n\n }, {\n key: 'setPluginOptions',\n value: function setPluginOptions() {\n var columnSorting = this.hot.getSettings().columnSorting;\n\n if ((typeof columnSorting === 'undefined' ? 'undefined' : _typeof(columnSorting)) === 'object') {\n this.sortEmptyCells = columnSorting.sortEmptyCells || false;\n } else {\n this.sortEmptyCells = false;\n }\n }\n\n /**\n * `onAfterOnCellMouseDown` hook callback.\n *\n * @private\n * @param {Event} event Event which are provided by hook.\n * @param {CellCoords} coords Coords of the selected cell.\n */\n\n }, {\n key: 'onAfterOnCellMouseDown',\n value: function onAfterOnCellMouseDown(event, coords) {\n if (coords.row > -1) {\n return;\n }\n\n if ((0, _element.hasClass)(event.realTarget, 'columnSorting')) {\n // reset order state on every new column header click\n if (coords.col !== this.lastSortedColumn) {\n this.hot.sortOrder = true;\n }\n\n this.lastSortedColumn = coords.col;\n\n this.sortByColumn(coords.col);\n }\n }\n }]);\n\n return ColumnSorting;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('columnSorting', ColumnSorting);\n\nexports.default = ColumnSorting;\n\n/***/ }),\n/* 216 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Comment editor for the Comments plugin.\n *\n * @class CommentEditor\n * @plugin Comments\n */\nvar CommentEditor = function () {\n _createClass(CommentEditor, null, [{\n key: 'CLASS_EDITOR_CONTAINER',\n get: function get() {\n return 'htCommentsContainer';\n }\n }, {\n key: 'CLASS_EDITOR',\n get: function get() {\n return 'htComments';\n }\n }, {\n key: 'CLASS_INPUT',\n get: function get() {\n return 'htCommentTextArea';\n }\n }, {\n key: 'CLASS_CELL',\n get: function get() {\n return 'htCommentCell';\n }\n }]);\n\n function CommentEditor() {\n _classCallCheck(this, CommentEditor);\n\n this.editor = this.createEditor();\n this.editorStyle = this.editor.style;\n\n this.hidden = true;\n\n this.hide();\n }\n\n /**\n * Set position of the comments editor according to the provided x and y coordinates.\n *\n * @param {Number} x X position (in pixels).\n * @param {Number} y Y position (in pixels).\n */\n\n\n _createClass(CommentEditor, [{\n key: 'setPosition',\n value: function setPosition(x, y) {\n this.editorStyle.left = x + 'px';\n this.editorStyle.top = y + 'px';\n }\n\n /**\n * Set the editor size according to the provided arguments.\n *\n * @param {Number} width Width in pixels.\n * @param {Number} height Height in pixels.\n */\n\n }, {\n key: 'setSize',\n value: function setSize(width, height) {\n if (width && height) {\n var input = this.getInputElement();\n\n input.style.width = width + 'px';\n input.style.height = height + 'px';\n }\n }\n\n /**\n * Reset the editor size to its initial state.\n */\n\n }, {\n key: 'resetSize',\n value: function resetSize() {\n var input = this.getInputElement();\n\n input.style.width = '';\n input.style.height = '';\n }\n\n /**\n * Set the read-only state for the comments editor.\n *\n * @param {Boolean} state The new read only state.\n */\n\n }, {\n key: 'setReadOnlyState',\n value: function setReadOnlyState(state) {\n var input = this.getInputElement();\n\n input.readOnly = state;\n }\n\n /**\n * Show the comments editor.\n */\n\n }, {\n key: 'show',\n value: function show() {\n this.editorStyle.display = 'block';\n this.hidden = false;\n }\n\n /**\n * Hide the comments editor.\n */\n\n }, {\n key: 'hide',\n value: function hide() {\n this.editorStyle.display = 'none';\n this.hidden = true;\n }\n\n /**\n * Checks if the editor is visible.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isVisible',\n value: function isVisible() {\n return this.editorStyle.display === 'block';\n }\n\n /**\n * Set the comment value.\n *\n * @param {String} [value] The value to use.\n */\n\n }, {\n key: 'setValue',\n value: function setValue() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n value = value || '';\n this.getInputElement().value = value;\n }\n\n /**\n * Get the comment value.\n *\n * @returns {String}\n */\n\n }, {\n key: 'getValue',\n value: function getValue() {\n return this.getInputElement().value;\n }\n\n /**\n * Checks if the comment input element is focused.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFocused',\n value: function isFocused() {\n return document.activeElement === this.getInputElement();\n }\n\n /**\n * Focus the comments input element.\n */\n\n }, {\n key: 'focus',\n value: function focus() {\n this.getInputElement().focus();\n }\n\n /**\n * Create the `textarea` to be used as a comments editor.\n *\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createEditor',\n value: function createEditor() {\n var container = document.querySelector('.' + CommentEditor.CLASS_EDITOR_CONTAINER);\n var editor = void 0;\n var textArea = void 0;\n\n if (!container) {\n container = document.createElement('div');\n (0, _element.addClass)(container, CommentEditor.CLASS_EDITOR_CONTAINER);\n document.body.appendChild(container);\n }\n editor = document.createElement('div');\n (0, _element.addClass)(editor, CommentEditor.CLASS_EDITOR);\n\n textArea = document.createElement('textarea');\n (0, _element.addClass)(textArea, CommentEditor.CLASS_INPUT);\n\n editor.appendChild(textArea);\n container.appendChild(editor);\n\n return editor;\n }\n\n /**\n * Get the input element.\n *\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'getInputElement',\n value: function getInputElement() {\n return this.editor.querySelector('.' + CommentEditor.CLASS_INPUT);\n }\n\n /**\n * Destroy the comments editor.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.editor.parentNode.removeChild(this.editor);\n this.editor = null;\n this.editorStyle = null;\n }\n }]);\n\n return CommentEditor;\n}();\n\nexports.default = CommentEditor;\n\n/***/ }),\n/* 217 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _function = __webpack_require__(35);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _src = __webpack_require__(11);\n\nvar _plugins = __webpack_require__(5);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _commentEditor = __webpack_require__(216);\n\nvar _commentEditor2 = _interopRequireDefault(_commentEditor);\n\nvar _utils = __webpack_require__(17);\n\n__webpack_require__(294);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar privatePool = new WeakMap();\nvar META_COMMENT = 'comment';\nvar META_COMMENT_VALUE = 'value';\nvar META_STYLE = 'style';\nvar META_READONLY = 'readOnly';\n\n/**\n * @plugin Comments\n *\n * @description\n * This plugin allows setting and managing cell comments by either an option in the context menu or with the use of the API.\n *\n * To enable the plugin, you'll need to set the comments property of the config object to `true`:\n * ```js\n * ...\n * comments: true\n * ...\n * ```\n *\n * To add comments at the table initialization, define the `comment` property in the `cell` config array as in an example below.\n *\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * comments: true,\n * cell: [\n * {row: 1, col: 1, comment: {value: 'Foo'}},\n * {row: 2, col: 2, comment: {value: 'Bar'}}\n * ]\n * });\n *\n * // Access to the Comments plugin instance:\n * var commentsPlugin = hot.getPlugin('comments');\n *\n * // Manage comments programmatically:\n * commentsPlugin.editor.setCommentAtCell(1, 6, 'Comment contents');\n * commentsPlugin.showAtCell(1, 6);\n * commentsPlugin.removeCommentAtCell(1, 6);\n *\n * // You can also set range once and use proper methods:\n * commentsPlugin.setRange({row: 1, col: 6});\n * commentsPlugin.setComment('Comment contents');\n * commentsPlugin.show();\n * commentsPlugin.removeComment();\n * ...\n * ```\n */\n\nvar Comments = function (_BasePlugin) {\n _inherits(Comments, _BasePlugin);\n\n function Comments(hotInstance) {\n _classCallCheck(this, Comments);\n\n /**\n * Instance of {@link CommentEditor}.\n *\n * @type {CommentEditor}\n */\n var _this = _possibleConstructorReturn(this, (Comments.__proto__ || Object.getPrototypeOf(Comments)).call(this, hotInstance));\n\n _this.editor = null;\n /**\n * Instance of {@link EventManager}.\n *\n * @private\n * @type {EventManager}\n */\n _this.eventManager = null;\n /**\n * Current cell range.\n *\n * @type {Object}\n */\n _this.range = {};\n /**\n * @private\n * @type {Boolean}\n */\n _this.mouseDown = false;\n /**\n * @private\n * @type {Boolean}\n */\n _this.contextMenuEvent = false;\n /**\n * @private\n * @type {*}\n */\n _this.timer = null;\n /**\n * Delay used when showing/hiding the comments (in milliseconds).\n *\n * @type {Number}\n */\n _this.displayDelay = 250;\n\n privatePool.set(_this, {\n tempEditorDimensions: {},\n cellBelowCursor: null\n });\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(Comments, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().comments;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n if (!this.editor) {\n this.editor = new _commentEditor2.default();\n }\n\n if (!this.eventManager) {\n this.eventManager = new _eventManager2.default(this);\n }\n\n this.addHook('afterContextMenuDefaultOptions', function (options) {\n return _this2.addToContextMenu(options);\n });\n this.addHook('afterRenderer', function (TD, row, col, prop, value, cellProperties) {\n return _this2.onAfterRenderer(TD, cellProperties);\n });\n this.addHook('afterScrollHorizontally', function () {\n return _this2.hide();\n });\n this.addHook('afterScrollVertically', function () {\n return _this2.hide();\n });\n\n this.addHook('afterBeginEditing', function (args) {\n return _this2.onAfterBeginEditing(args);\n });\n\n this.registerListeners();\n\n _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Register all necessary DOM listeners.\n *\n * @private\n */\n\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n var _this3 = this;\n\n this.eventManager.addEventListener(document, 'mouseover', function (event) {\n return _this3.onMouseOver(event);\n });\n this.eventManager.addEventListener(document, 'mousedown', function (event) {\n return _this3.onMouseDown(event);\n });\n this.eventManager.addEventListener(document, 'mouseup', function (event) {\n return _this3.onMouseUp(event);\n });\n this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', function (event) {\n return _this3.onEditorBlur(event);\n });\n this.eventManager.addEventListener(this.editor.getInputElement(), 'mousedown', function (event) {\n return _this3.onEditorMouseDown(event);\n });\n this.eventManager.addEventListener(this.editor.getInputElement(), 'mouseup', function (event) {\n return _this3.onEditorMouseUp(event);\n });\n }\n\n /**\n * Set current cell range to be able to use general methods like {@link Comments#setComment},\n * {@link Comments#removeComment}, {@link Comments#show}.\n *\n * @param {Object} range Object with `from` and `to` properties, each with `row` and `col` properties.\n */\n\n }, {\n key: 'setRange',\n value: function setRange(range) {\n this.range = range;\n }\n\n /**\n * Clear the currently selected cell.\n */\n\n }, {\n key: 'clearRange',\n value: function clearRange() {\n this.range = {};\n }\n\n /**\n * Check if the event target is a cell containing a comment.\n *\n * @param {Event} event DOM event\n * @returns {Boolean}\n */\n\n }, {\n key: 'targetIsCellWithComment',\n value: function targetIsCellWithComment(event) {\n var closestCell = (0, _element.closest)(event.target, 'TD', 'TBODY');\n\n return !!(closestCell && (0, _element.hasClass)(closestCell, 'htCommentCell') && (0, _element.closest)(closestCell, [this.hot.rootElement]));\n }\n\n /**\n * Check if the event target is a comment textarea.\n *\n * @param {Event} event DOM event.\n * @returns {Boolean}\n */\n\n }, {\n key: 'targetIsCommentTextArea',\n value: function targetIsCommentTextArea(event) {\n return this.editor.getInputElement() === event.target;\n }\n\n /**\n * Set a comment for a cell according to the previously set range (see {@link Comments#setRange}).\n *\n * @param {String} value Comment contents.\n */\n\n }, {\n key: 'setComment',\n value: function setComment(value) {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n var editorValue = this.editor.getValue();\n var comment = '';\n\n if (value != null) {\n comment = value;\n } else if (editorValue != null) {\n comment = editorValue;\n }\n\n var row = this.range.from.row;\n var col = this.range.from.col;\n\n this.updateCommentMeta(row, col, _defineProperty({}, META_COMMENT_VALUE, comment));\n this.hot.render();\n }\n\n /**\n * Set a comment for a cell.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} value Comment contents.\n */\n\n }, {\n key: 'setCommentAtCell',\n value: function setCommentAtCell(row, col, value) {\n this.setRange({\n from: new _src.CellCoords(row, col)\n });\n this.setComment(value);\n }\n\n /**\n * Remove a comment from a cell according to previously set range (see {@link Comments#setRange}).\n *\n * @param {Boolean} [forceRender = true] If set to `true`, the table will be re-rendered at the end of the operation.\n */\n\n }, {\n key: 'removeComment',\n value: function removeComment() {\n var forceRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n\n this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT, void 0);\n\n if (forceRender) {\n this.hot.render();\n }\n\n this.hide();\n }\n\n /**\n * Remove comment from a cell.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Boolean} [forceRender = true] If `true`, the table will be re-rendered at the end of the operation.\n */\n\n }, {\n key: 'removeCommentAtCell',\n value: function removeCommentAtCell(row, col) {\n var forceRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n this.setRange({\n from: new _src.CellCoords(row, col)\n });\n this.removeComment(forceRender);\n }\n\n /**\n * Get comment from a cell at the predefined range.\n */\n\n }, {\n key: 'getComment',\n value: function getComment() {\n var row = this.range.from.row;\n var column = this.range.from.col;\n\n return this.getCommentMeta(row, column, META_COMMENT_VALUE);\n }\n\n /**\n * Get comment from a cell at the provided coordinates.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'getCommentAtCell',\n value: function getCommentAtCell(row, column) {\n return this.getCommentMeta(row, column, META_COMMENT_VALUE);\n }\n\n /**\n * Show the comment editor accordingly to the previously set range (see {@link Comments#setRange}).\n *\n * @returns {Boolean} Returns `true` if comment editor was shown.\n */\n\n }, {\n key: 'show',\n value: function show() {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);\n\n this.refreshEditor(true);\n this.editor.setValue(meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : false || '');\n\n if (this.editor.hidden) {\n this.editor.show();\n }\n\n return true;\n }\n\n /**\n * Show comment editor according to cell coordinates.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Boolean} Returns `true` if comment editor was shown.\n */\n\n }, {\n key: 'showAtCell',\n value: function showAtCell(row, col) {\n this.setRange({\n from: new _src.CellCoords(row, col)\n });\n\n return this.show();\n }\n\n /**\n * Hide the comment editor.\n */\n\n }, {\n key: 'hide',\n value: function hide() {\n if (!this.editor.hidden) {\n this.editor.hide();\n }\n }\n\n /**\n * Refresh comment editor position and styling.\n *\n * @param {Boolean} [force=false] If `true` then recalculation will be forced.\n */\n\n }, {\n key: 'refreshEditor',\n value: function refreshEditor() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!force && (!this.range.from || !this.editor.isVisible())) {\n return;\n }\n var scrollableElement = (0, _element.getScrollableElement)(this.hot.view.wt.wtTable.TABLE);\n var TD = this.hot.view.wt.wtTable.getCell(this.range.from);\n var row = this.range.from.row;\n var column = this.range.from.col;\n var cellOffset = (0, _element.offset)(TD);\n var lastColWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(column);\n var cellTopOffset = cellOffset.top < 0 ? 0 : cellOffset.top;\n var cellLeftOffset = cellOffset.left;\n\n if (this.hot.view.wt.wtViewport.hasVerticalScroll() && scrollableElement !== window) {\n cellTopOffset -= this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition();\n }\n\n if (this.hot.view.wt.wtViewport.hasHorizontalScroll() && scrollableElement !== window) {\n cellLeftOffset -= this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition();\n }\n\n var x = cellLeftOffset + lastColWidth;\n var y = cellTopOffset;\n\n var commentStyle = this.getCommentMeta(row, column, META_STYLE);\n var readOnly = this.getCommentMeta(row, column, META_READONLY);\n\n if (commentStyle) {\n this.editor.setSize(commentStyle.width, commentStyle.height);\n } else {\n this.editor.resetSize();\n }\n\n this.editor.setReadOnlyState(readOnly);\n\n this.editor.setPosition(x, y);\n }\n\n /**\n * Check if there is a comment for selected range.\n *\n * @private\n * @returns {Boolean}\n */\n\n }, {\n key: 'checkSelectionCommentsConsistency',\n value: function checkSelectionCommentsConsistency() {\n var selected = this.hot.getSelectedRange();\n\n if (!selected) {\n return false;\n }\n var hasComment = false;\n var cell = selected.from; // IN EXCEL THERE IS COMMENT ONLY FOR TOP LEFT CELL IN SELECTION\n\n if (this.getCommentMeta(cell.row, cell.col, META_COMMENT_VALUE)) {\n hasComment = true;\n }\n\n return hasComment;\n }\n\n /**\n * Set or update the comment-related cell meta.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @param {Object} metaObject Object defining all the comment-related meta information.\n */\n\n }, {\n key: 'updateCommentMeta',\n value: function updateCommentMeta(row, column, metaObject) {\n var oldComment = this.hot.getCellMeta(row, column)[META_COMMENT];\n var newComment = void 0;\n\n if (oldComment) {\n newComment = (0, _object.deepClone)(oldComment);\n (0, _object.deepExtend)(newComment, metaObject);\n } else {\n newComment = metaObject;\n }\n\n this.hot.setCellMeta(row, column, META_COMMENT, newComment);\n }\n\n /**\n * Get the comment related meta information.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @param {String} property Cell meta property.\n * @returns {Mixed}\n */\n\n }, {\n key: 'getCommentMeta',\n value: function getCommentMeta(row, column, property) {\n var cellMeta = this.hot.getCellMeta(row, column);\n\n if (!cellMeta[META_COMMENT]) {\n return void 0;\n }\n\n return cellMeta[META_COMMENT][property];\n }\n\n /**\n * `mousedown` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mousedown` event.\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown(event) {\n this.mouseDown = true;\n\n if (!this.hot.view || !this.hot.view.wt) {\n return;\n }\n\n if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event)) {\n var eventCell = (0, _element.closest)(event.target, 'TD', 'TBODY');\n var coordinates = null;\n\n if (eventCell) {\n coordinates = this.hot.view.wt.wtTable.getCoords(eventCell);\n }\n\n if (!eventCell || this.range.from && coordinates && (this.range.from.row !== coordinates.row || this.range.from.col !== coordinates.col)) {\n this.hide();\n }\n }\n this.contextMenuEvent = false;\n }\n\n /**\n * `mouseover` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mouseover` event.\n */\n\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n var _this4 = this;\n\n if (this.mouseDown || this.editor.isFocused()) {\n return;\n }\n var priv = privatePool.get(this);\n priv.cellBelowCursor = document.elementFromPoint(event.clientX, event.clientY);\n\n (0, _function.debounce)(function () {\n if ((0, _element.hasClass)(event.target, 'wtBorder') || priv.cellBelowCursor !== event.target || !_this4.editor) {\n return;\n }\n\n if (_this4.targetIsCellWithComment(event)) {\n var coordinates = _this4.hot.view.wt.wtTable.getCoords(event.target);\n var range = {\n from: new _src.CellCoords(coordinates.row, coordinates.col)\n };\n\n _this4.setRange(range);\n _this4.show();\n } else if ((0, _element.isChildOf)(event.target, document) && !_this4.targetIsCommentTextArea(event) && !_this4.editor.isFocused()) {\n _this4.hide();\n }\n }, this.displayDelay)();\n }\n\n /**\n * `mouseup` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mouseup` event.\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n this.mouseDown = false;\n }\n\n /** *\n * The `afterRenderer` hook callback..\n *\n * @private\n * @param {HTMLTableCellElement} TD The rendered `TD` element.\n * @param {Object} cellProperties The rendered cell's property object.\n */\n\n }, {\n key: 'onAfterRenderer',\n value: function onAfterRenderer(TD, cellProperties) {\n if (cellProperties[META_COMMENT] && cellProperties[META_COMMENT][META_COMMENT_VALUE]) {\n (0, _element.addClass)(TD, cellProperties.commentedCellClassName);\n }\n }\n\n /**\n * `blur` event callback for the comment editor.\n *\n * @private\n * @param {Event} event The `blur` event.\n */\n\n }, {\n key: 'onEditorBlur',\n value: function onEditorBlur(event) {\n this.setComment();\n }\n\n /**\n * `mousedown` hook. Along with `onEditorMouseUp` used to simulate the textarea resizing event.\n *\n * @private\n * @param {MouseEvent} event The `mousedown` event.\n */\n\n }, {\n key: 'onEditorMouseDown',\n value: function onEditorMouseDown(event) {\n var priv = privatePool.get(this);\n\n priv.tempEditorDimensions = {\n width: (0, _element.outerWidth)(event.target),\n height: (0, _element.outerHeight)(event.target)\n };\n }\n\n /**\n * `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event.\n *\n * @private\n * @param {MouseEvent} event The `mouseup` event.\n */\n\n }, {\n key: 'onEditorMouseUp',\n value: function onEditorMouseUp(event) {\n var priv = privatePool.get(this);\n var currentWidth = (0, _element.outerWidth)(event.target);\n var currentHeight = (0, _element.outerHeight)(event.target);\n\n if (currentWidth !== priv.tempEditorDimensions.width + 1 || currentHeight !== priv.tempEditorDimensions.height + 2) {\n this.updateCommentMeta(this.range.from.row, this.range.from.col, _defineProperty({}, META_STYLE, {\n width: currentWidth,\n height: currentHeight\n }));\n }\n }\n\n /**\n * Context Menu's \"Add comment\" callback. Results in showing the comment editor.\n *\n * @private\n */\n\n }, {\n key: 'onContextMenuAddComment',\n value: function onContextMenuAddComment() {\n var _this5 = this;\n\n var coords = this.hot.getSelectedRange();\n\n this.contextMenuEvent = true;\n this.setRange({\n from: coords.from\n });\n this.show();\n setTimeout(function () {\n if (_this5.hot) {\n _this5.hot.deselectCell();\n _this5.editor.focus();\n }\n }, 10);\n }\n\n /**\n * Context Menu's \"remove comment\" callback.\n *\n * @private\n * @param {Object} selection The current selection.\n */\n\n }, {\n key: 'onContextMenuRemoveComment',\n value: function onContextMenuRemoveComment(selection) {\n this.contextMenuEvent = true;\n\n for (var i = selection.start.row; i <= selection.end.row; i++) {\n for (var j = selection.start.col; j <= selection.end.col; j++) {\n this.removeCommentAtCell(i, j, false);\n }\n }\n\n this.hot.render();\n }\n\n /**\n * Context Menu's \"make comment read-only\" callback.\n *\n * @private\n * @param {Object} selection The current selection.\n */\n\n }, {\n key: 'onContextMenuMakeReadOnly',\n value: function onContextMenuMakeReadOnly(selection) {\n this.contextMenuEvent = true;\n\n for (var i = selection.start.row; i <= selection.end.row; i++) {\n for (var j = selection.start.col; j <= selection.end.col; j++) {\n var currentState = !!this.getCommentMeta(i, j, META_READONLY);\n\n this.updateCommentMeta(i, j, _defineProperty({}, META_READONLY, !currentState));\n }\n }\n }\n\n /**\n * Add Comments plugin options to the Context Menu.\n *\n * @private\n * @param {Object} defaultOptions\n */\n\n }, {\n key: 'addToContextMenu',\n value: function addToContextMenu(defaultOptions) {\n var _this6 = this;\n\n defaultOptions.items.push((0, _plugins.getPlugin)(this.hot, 'contextMenu').constructor.SEPARATOR, {\n key: 'commentsAddEdit',\n name: function name() {\n return _this6.checkSelectionCommentsConsistency() ? 'Edit comment' : 'Add comment';\n },\n callback: function callback() {\n return _this6.onContextMenuAddComment();\n },\n disabled: function disabled() {\n return !(this.getSelected() && !this.selection.selectedHeader.corner);\n }\n }, {\n key: 'commentsRemove',\n name: function name() {\n return 'Delete comment';\n },\n\n callback: function callback(key, selection) {\n return _this6.onContextMenuRemoveComment(selection);\n },\n disabled: function disabled() {\n return _this6.hot.selection.selectedHeader.corner;\n }\n }, {\n key: 'commentsReadOnly',\n name: function name() {\n var _this7 = this;\n\n var label = 'Read only comment';\n var hasProperty = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var readOnlyProperty = _this7.getCellMeta(row, col)[META_COMMENT];\n if (readOnlyProperty) {\n readOnlyProperty = readOnlyProperty[META_READONLY];\n }\n\n if (readOnlyProperty) {\n return true;\n }\n });\n\n if (hasProperty) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n\n callback: function callback(key, selection) {\n return _this6.onContextMenuMakeReadOnly(selection);\n },\n disabled: function disabled() {\n return _this6.hot.selection.selectedHeader.corner || !_this6.checkSelectionCommentsConsistency();\n }\n });\n }\n\n /**\n * `afterBeginEditing` hook callback.\n *\n * @private\n * @param {Number} row Row index of the currently edited cell.\n * @param {Number} column Column index of the currently edited cell.\n */\n\n }, {\n key: 'onAfterBeginEditing',\n value: function onAfterBeginEditing(row, column) {\n this.hide();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.editor) {\n this.editor.destroy();\n }\n _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return Comments;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('comments', Comments);\n\nexports.default = Comments;\n\n/***/ }),\n/* 218 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Command executor for ContextMenu.\n *\n * @class CommandExecutor\n * @plugin ContextMenu\n */\nvar CommandExecutor = function () {\n function CommandExecutor(hotInstance) {\n _classCallCheck(this, CommandExecutor);\n\n this.hot = hotInstance;\n this.commands = {};\n this.commonCallback = null;\n }\n\n /**\n * Register command.\n *\n * @param {String} name Command name.\n * @param {Object} commandDescriptor Command descriptor object with properties like `key` (command id),\n * `callback` (task to execute), `name` (command name), `disabled` (command availability).\n */\n\n\n _createClass(CommandExecutor, [{\n key: 'registerCommand',\n value: function registerCommand(name, commandDescriptor) {\n this.commands[name] = commandDescriptor;\n }\n\n /**\n * Set common callback which will be trigger on every executed command.\n *\n * @param {Function} callback Function which will be fired on every command execute.\n */\n\n }, {\n key: 'setCommonCallback',\n value: function setCommonCallback(callback) {\n this.commonCallback = callback;\n }\n\n /**\n * Execute command by its name.\n *\n * @param {String} commandName Command id.\n * @param {*} params Arguments passed to command task.\n */\n\n }, {\n key: 'execute',\n value: function execute(commandName) {\n var _this = this;\n\n for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n var commandSplit = commandName.split(':');\n commandName = commandSplit[0];\n\n var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null;\n var command = this.commands[commandName];\n\n if (!command) {\n throw new Error('Menu command \\'' + commandName + '\\' not exists.');\n }\n if (subCommandName && command.submenu) {\n command = findSubCommand(subCommandName, command.submenu.items);\n }\n if (command.disabled === true) {\n return;\n }\n if (typeof command.disabled == 'function' && command.disabled.call(this.hot) === true) {\n return;\n }\n if ((0, _object.hasOwnProperty)(command, 'submenu')) {\n return;\n }\n var callbacks = [];\n\n if (typeof command.callback === 'function') {\n callbacks.push(command.callback);\n }\n if (typeof this.commonCallback === 'function') {\n callbacks.push(this.commonCallback);\n }\n params.unshift(commandSplit.join(':'));\n (0, _array.arrayEach)(callbacks, function (callback) {\n return callback.apply(_this.hot, params);\n });\n }\n }]);\n\n return CommandExecutor;\n}();\n\nfunction findSubCommand(subCommandName, subCommands) {\n var command = void 0;\n\n (0, _array.arrayEach)(subCommands, function (cmd) {\n var cmds = cmd.key ? cmd.key.split(':') : null;\n\n if (Array.isArray(cmds) && cmds[1] === subCommandName) {\n command = cmd;\n\n return false;\n }\n });\n\n return command;\n}\n\nexports.default = CommandExecutor;\n\n/***/ }),\n/* 219 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _commandExecutor = __webpack_require__(218);\n\nvar _commandExecutor2 = _interopRequireDefault(_commandExecutor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _itemsFactory = __webpack_require__(221);\n\nvar _itemsFactory2 = _interopRequireDefault(_itemsFactory);\n\nvar _menu = __webpack_require__(222);\n\nvar _menu2 = _interopRequireDefault(_menu);\n\nvar _plugins = __webpack_require__(5);\n\nvar _event = __webpack_require__(7);\n\nvar _element = __webpack_require__(0);\n\nvar _predefinedItems = __webpack_require__(50);\n\n__webpack_require__(295);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('afterContextMenuDefaultOptions');\n_pluginHooks2.default.getSingleton().register('afterContextMenuShow');\n_pluginHooks2.default.getSingleton().register('afterContextMenuHide');\n_pluginHooks2.default.getSingleton().register('afterContextMenuExecute');\n\n/**\n * @description\n * This plugin creates the Handsontable Context Menu. It allows to create a new row or\n * column at any place in the grid among [other features](http://docs.handsontable.com/demo-context-menu.html).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n *\n * or array of any available strings:\n * * `[\"row_above\", \"row_below\", \"col_left\", \"col_right\",\n * \"remove_row\", \"remove_col\", \"---------\", \"undo\", \"redo\"]`.\n *\n * See [the context menu demo](http://docs.handsontable.com/demo-context-menu.html) for examples.\n *\n * @example\n * ```js\n * ...\n * // as a boolean\n * contextMenu: true\n * ...\n * // as a array\n * contextMenu: ['row_above', 'row_below', '---------', 'undo', 'redo']\n * ...\n * ```\n *\n * @plugin ContextMenu\n */\n\nvar ContextMenu = function (_BasePlugin) {\n _inherits(ContextMenu, _BasePlugin);\n\n _createClass(ContextMenu, null, [{\n key: 'DEFAULT_ITEMS',\n\n /**\n * Default menu items order when `contextMenu` is enabled by `true`.\n *\n * @returns {Array}\n */\n get: function get() {\n return [_predefinedItems.ROW_ABOVE, _predefinedItems.ROW_BELOW, _predefinedItems.SEPARATOR, _predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_ROW, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.UNDO, _predefinedItems.REDO, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT];\n }\n }]);\n\n function ContextMenu(hotInstance) {\n _classCallCheck(this, ContextMenu);\n\n /**\n * Instance of {@link EventManager}.\n *\n * @type {EventManager}\n */\n var _this = _possibleConstructorReturn(this, (ContextMenu.__proto__ || Object.getPrototypeOf(ContextMenu)).call(this, hotInstance));\n\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Instance of {@link CommandExecutor}.\n *\n * @type {CommandExecutor}\n */\n _this.commandExecutor = new _commandExecutor2.default(_this.hot);\n /**\n * Instance of {@link ItemsFactory}.\n *\n * @type {ItemsFactory}\n */\n _this.itemsFactory = null;\n /**\n * Instance of {@link Menu}.\n *\n * @type {Menu}\n */\n _this.menu = null;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ContextMenu, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().contextMenu;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n this.itemsFactory = new _itemsFactory2.default(this.hot, ContextMenu.DEFAULT_ITEMS);\n\n var settings = this.hot.getSettings().contextMenu;\n var predefinedItems = {\n items: this.itemsFactory.getItems(settings)\n };\n this.registerEvents();\n\n if (typeof settings.callback === 'function') {\n this.commandExecutor.setCommonCallback(settings.callback);\n }\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'enablePlugin', this).call(this);\n\n this.callOnPluginsReady(function () {\n _this2.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems);\n\n _this2.itemsFactory.setPredefinedItems(predefinedItems.items);\n var menuItems = _this2.itemsFactory.getItems(settings);\n\n _this2.menu = new _menu2.default(_this2.hot, {\n className: 'htContextMenu',\n keepInViewport: true\n });\n _this2.hot.runHooks('beforeContextMenuSetItems', menuItems);\n\n _this2.menu.setMenuItems(menuItems);\n\n _this2.menu.addLocalHook('afterOpen', function () {\n return _this2.onMenuAfterOpen();\n });\n _this2.menu.addLocalHook('afterClose', function () {\n return _this2.onMenuAfterClose();\n });\n _this2.menu.addLocalHook('executeCommand', function () {\n for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) {\n params[_key] = arguments[_key];\n }\n\n return _this2.executeCommand.apply(_this2, params);\n });\n\n // Register all commands. Predefined and added by user or by plugins\n (0, _array.arrayEach)(menuItems, function (command) {\n return _this2.commandExecutor.registerCommand(command.key, command);\n });\n });\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n this.close();\n\n if (this.menu) {\n this.menu.destroy();\n this.menu = null;\n }\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Register dom listeners.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this3 = this;\n\n this.eventManager.addEventListener(this.hot.rootElement, 'contextmenu', function (event) {\n return _this3.onContextMenu(event);\n });\n }\n\n /**\n * Open menu and re-position it based on dom event object.\n *\n * @param {Event} event The event object.\n */\n\n }, {\n key: 'open',\n value: function open(event) {\n if (!this.menu) {\n return;\n }\n this.menu.open();\n this.menu.setPosition({\n top: parseInt((0, _event.pageY)(event), 10) - (0, _element.getWindowScrollTop)(),\n left: parseInt((0, _event.pageX)(event), 10) - (0, _element.getWindowScrollLeft)()\n });\n\n // ContextMenu is not detected HotTableEnv correctly because is injected outside hot-table\n this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv;\n // Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv;\n }\n\n /**\n * Close menu.\n */\n\n }, {\n key: 'close',\n value: function close() {\n if (!this.menu) {\n return;\n }\n this.menu.close();\n }\n\n /**\n * Execute context menu command.\n *\n * You can execute all predefined commands:\n * * `'row_above'` - Insert row above\n * * `'row_below'` - Insert row below\n * * `'col_left'` - Insert column on the left\n * * `'col_right'` - Insert column on the right\n * * `'clear_column'` - Clear selected column\n * * `'remove_row'` - Remove row\n * * `'remove_col'` - Remove column\n * * `'undo'` - Undo last action\n * * `'redo'` - Redo last action\n * * `'make_read_only'` - Make cell read only\n * * `'alignment:left'` - Alignment to the left\n * * `'alignment:top'` - Alignment to the top\n * * `'alignment:right'` - Alignment to the right\n * * `'alignment:bottom'` - Alignment to the bottom\n * * `'alignment:middle'` - Alignment to the middle\n * * `'alignment:center'` - Alignment to the center (justify)\n *\n * Or you can execute command registered in settings where `key` is your command name.\n *\n * @param {String} commandName\n * @param {*} params\n */\n\n }, {\n key: 'executeCommand',\n value: function executeCommand() {\n for (var _len2 = arguments.length, params = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n params[_key2] = arguments[_key2];\n }\n\n this.commandExecutor.execute.apply(this.commandExecutor, params);\n }\n\n /**\n * On context menu listener.\n *\n * @private\n * @param {Event} event\n */\n\n }, {\n key: 'onContextMenu',\n value: function onContextMenu(event) {\n var settings = this.hot.getSettings();\n var showRowHeaders = settings.rowHeaders;\n var showColHeaders = settings.colHeaders;\n\n function isValidElement(element) {\n return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';\n }\n // if event is from hot-table we must get web component element not element inside him\n var element = event.realTarget;\n this.close();\n\n if ((0, _element.hasClass)(element, 'handsontableInput')) {\n return;\n }\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n\n if (!(showRowHeaders || showColHeaders)) {\n if (!isValidElement(element) && !((0, _element.hasClass)(element, 'current') && (0, _element.hasClass)(element, 'wtBorder'))) {\n return;\n }\n }\n\n this.open(event);\n }\n\n /**\n * On menu after open listener.\n *\n * @private\n */\n\n }, {\n key: 'onMenuAfterOpen',\n value: function onMenuAfterOpen() {\n this.hot.runHooks('afterContextMenuShow', this);\n }\n\n /**\n * On menu after close listener.\n *\n * @private\n */\n\n }, {\n key: 'onMenuAfterClose',\n value: function onMenuAfterClose() {\n this.hot.listen();\n this.hot.runHooks('afterContextMenuHide', this);\n }\n\n /**\n * Destroy instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.close();\n\n if (this.menu) {\n this.menu.destroy();\n }\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ContextMenu;\n}(_base2.default);\n\nContextMenu.SEPARATOR = {\n name: _predefinedItems.SEPARATOR\n};\n\n(0, _plugins.registerPlugin)('contextMenu', ContextMenu);\n\nexports.default = ContextMenu;\n\n/***/ }),\n/* 220 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class for checking if element will fit at the desired side of cursor.\n *\n * @class Cursor\n * @plugin ContextMenu\n */\nvar Cursor = function () {\n function Cursor(object) {\n _classCallCheck(this, Cursor);\n\n var windowScrollTop = (0, _element.getWindowScrollTop)();\n var windowScrollLeft = (0, _element.getWindowScrollLeft)();\n var top = void 0,\n topRelative = void 0;\n var left = void 0,\n leftRelative = void 0;\n var cellHeight = void 0,\n cellWidth = void 0;\n\n this.type = this.getSourceType(object);\n\n if (this.type === 'literal') {\n top = parseInt(object.top, 10);\n left = parseInt(object.left, 10);\n cellHeight = object.height || 0;\n cellWidth = object.width || 0;\n topRelative = top;\n leftRelative = left;\n top += windowScrollTop;\n left += windowScrollLeft;\n } else if (this.type === 'event') {\n top = parseInt((0, _event.pageY)(object), 10);\n left = parseInt((0, _event.pageX)(object), 10);\n cellHeight = object.target.clientHeight;\n cellWidth = object.target.clientWidth;\n topRelative = top - windowScrollTop;\n leftRelative = left - windowScrollLeft;\n }\n\n this.top = top;\n this.topRelative = topRelative;\n this.left = left;\n this.leftRelative = leftRelative;\n this.scrollTop = windowScrollTop;\n this.scrollLeft = windowScrollLeft;\n this.cellHeight = cellHeight;\n this.cellWidth = cellWidth;\n }\n\n /**\n * Get source type name.\n *\n * @param {*} object Event or Object with coordinates.\n * @returns {String} Returns one of this values: `'literal'`, `'event'`.\n */\n\n\n _createClass(Cursor, [{\n key: 'getSourceType',\n value: function getSourceType(object) {\n var type = 'literal';\n\n if (object instanceof Event) {\n type = 'event';\n }\n\n return type;\n }\n\n /**\n * Checks if element can be placed above the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit above the cursor.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsAbove',\n value: function fitsAbove(element) {\n return this.topRelative >= element.offsetHeight;\n }\n\n /**\n * Checks if element can be placed below the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit below the cursor.\n * @param {Number} [viewportHeight] The viewport height.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsBelow',\n value: function fitsBelow(element) {\n var viewportHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerHeight;\n\n return this.topRelative + element.offsetHeight <= viewportHeight;\n }\n\n /**\n * Checks if element can be placed on the right of the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit on the right of the cursor.\n * @param {Number} [viewportWidth] The viewport width.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsOnRight',\n value: function fitsOnRight(element) {\n var viewportWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerWidth;\n\n return this.leftRelative + this.cellWidth + element.offsetWidth <= viewportWidth;\n }\n\n /**\n * Checks if element can be placed on the left on the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit on the left of the cursor.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsOnLeft',\n value: function fitsOnLeft(element) {\n return this.leftRelative >= element.offsetWidth;\n }\n }]);\n\n return Cursor;\n}();\n\nexports.default = Cursor;\n\n/***/ }),\n/* 221 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _predefinedItems = __webpack_require__(50);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Predefined items class factory for menu items.\n *\n * @class ItemsFactory\n * @plugin ContextMenu\n */\nvar ItemsFactory = function () {\n function ItemsFactory(hotInstance) {\n var orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, ItemsFactory);\n\n this.hot = hotInstance;\n this.predefinedItems = (0, _predefinedItems.predefinedItems)();\n this.defaultOrderPattern = orderPattern;\n }\n\n /**\n * Set predefined items.\n *\n * @param {Array} predefinedItems Array of predefined items.\n */\n\n\n _createClass(ItemsFactory, [{\n key: 'setPredefinedItems',\n value: function setPredefinedItems(predefinedItems) {\n var _this = this;\n\n var items = {};\n\n this.defaultOrderPattern.length = 0;\n\n (0, _object.objectEach)(predefinedItems, function (value, key) {\n var menuItemKey = '';\n\n if (value.name === _predefinedItems.SEPARATOR) {\n items[_predefinedItems.SEPARATOR] = value;\n menuItemKey = _predefinedItems.SEPARATOR;\n\n // Menu item added as a property to array\n } else if (isNaN(parseInt(key, 10))) {\n value.key = value.key === void 0 ? key : value.key;\n items[key] = value;\n menuItemKey = value.key;\n } else {\n items[value.key] = value;\n menuItemKey = value.key;\n }\n _this.defaultOrderPattern.push(menuItemKey);\n });\n this.predefinedItems = items;\n }\n\n /**\n * Get all menu items based on pattern.\n *\n * @param {Array|Object|Boolean} pattern Pattern which you can define by displaying menu items order. If `true` default\n * pattern will be used.\n * @returns {Array}\n */\n\n }, {\n key: 'getItems',\n value: function getItems() {\n var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n return _getItems(pattern, this.defaultOrderPattern, this.predefinedItems);\n }\n }]);\n\n return ItemsFactory;\n}();\n\nfunction _getItems() {\n var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var defaultPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var items = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var result = [];\n\n if (pattern && pattern.items) {\n pattern = pattern.items;\n } else if (!Array.isArray(pattern)) {\n pattern = defaultPattern;\n }\n if ((0, _object.isObject)(pattern)) {\n (0, _object.objectEach)(pattern, function (value, key) {\n var item = items[typeof value === 'string' ? value : key];\n\n if (!item) {\n item = value;\n }\n if ((0, _object.isObject)(value)) {\n (0, _object.extend)(item, value);\n } else if (typeof item === 'string') {\n item = { name: item };\n }\n if (item.key === void 0) {\n item.key = key;\n }\n result.push(item);\n });\n } else {\n (0, _array.arrayEach)(pattern, function (name, key) {\n var item = items[name];\n\n // Item deleted from settings `allowInsertRow: false` etc.\n if (!item && _predefinedItems.ITEMS.indexOf(name) >= 0) {\n return;\n }\n if (!item) {\n item = { name: name, key: '' + key };\n }\n if ((0, _object.isObject)(name)) {\n (0, _object.extend)(item, name);\n }\n if (item.key === void 0) {\n item.key = key;\n }\n result.push(item);\n });\n }\n\n return result;\n}\n\nexports.default = ItemsFactory;\n\n/***/ }),\n/* 222 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(64);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _cursor = __webpack_require__(220);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _object = __webpack_require__(2);\n\nvar _function = __webpack_require__(35);\n\nvar _utils = __webpack_require__(17);\n\nvar _unicode = __webpack_require__(16);\n\nvar _localHooks = __webpack_require__(150);\n\nvar _localHooks2 = _interopRequireDefault(_localHooks);\n\nvar _predefinedItems = __webpack_require__(50);\n\nvar _event = __webpack_require__(7);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Menu\n * @plugin ContextMenu\n */\nvar Menu = function () {\n function Menu(hotInstance, options) {\n _classCallCheck(this, Menu);\n\n this.hot = hotInstance;\n this.options = options || {\n parent: null,\n name: null,\n className: '',\n keepInViewport: true,\n standalone: false\n };\n this.eventManager = new _eventManager2.default(this);\n this.container = this.createContainer(this.options.name);\n this.hotMenu = null;\n this.hotSubMenus = {};\n this.parentMenu = this.options.parent || null;\n this.menuItems = null;\n this.origOutsideClickDeselects = null;\n this.keyEvent = false;\n\n this.offset = {\n above: 0,\n below: 0,\n left: 0,\n right: 0\n };\n this._afterScrollCallback = null;\n\n this.registerEvents();\n }\n\n /**\n * Register event listeners.\n *\n * @private\n */\n\n\n _createClass(Menu, [{\n key: 'registerEvents',\n value: function registerEvents() {\n var _this = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mousedown', function (event) {\n return _this.onDocumentMouseDown(event);\n });\n }\n\n /**\n * Set array of objects which defines menu items.\n *\n * @param {Array} menuItems Menu items to display.\n */\n\n }, {\n key: 'setMenuItems',\n value: function setMenuItems(menuItems) {\n this.menuItems = menuItems;\n }\n\n /**\n * Set offset menu position for specified area (`above`, `below`, `left` or `right`).\n *\n * @param {String} area Specified area name (`above`, `below`, `left` or `right`).\n * @param {Number} offset Offset value.\n */\n\n }, {\n key: 'setOffset',\n value: function setOffset(area) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n this.offset[area] = offset;\n }\n\n /**\n * Check if menu is using as sub-menu.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSubMenu',\n value: function isSubMenu() {\n return this.parentMenu !== null;\n }\n\n /**\n * Open menu.\n */\n\n }, {\n key: 'open',\n value: function open() {\n var _this2 = this;\n\n this.container.removeAttribute('style');\n this.container.style.display = 'block';\n\n var delayedOpenSubMenu = (0, _function.debounce)(function (row) {\n return _this2.openSubMenu(row);\n }, 300);\n\n var filteredItems = (0, _array.arrayFilter)(this.menuItems, function (item) {\n return (0, _utils.isItemHidden)(item, _this2.hot);\n });\n\n filteredItems = (0, _utils.filterSeparators)(filteredItems, _predefinedItems.SEPARATOR);\n\n var settings = {\n data: filteredItems,\n colHeaders: false,\n colWidths: [200],\n autoRowSize: false,\n readOnly: true,\n copyPaste: false,\n columns: [{\n data: 'name',\n renderer: function renderer(hot, TD, row, col, prop, value) {\n return _this2.menuItemRenderer(hot, TD, row, col, prop, value);\n }\n }],\n renderAllRows: true,\n fragmentSelection: 'cell',\n disableVisualSelection: 'area',\n beforeKeyDown: function beforeKeyDown(event) {\n return _this2.onBeforeKeyDown(event);\n },\n afterOnCellMouseOver: function afterOnCellMouseOver(event, coords, TD) {\n if (_this2.isAllSubMenusClosed()) {\n delayedOpenSubMenu(coords.row);\n } else {\n _this2.openSubMenu(coords.row);\n }\n },\n rowHeights: function rowHeights(row) {\n return filteredItems[row].name === _predefinedItems.SEPARATOR ? 1 : 23;\n }\n };\n this.origOutsideClickDeselects = this.hot.getSettings().outsideClickDeselects;\n this.hot.getSettings().outsideClickDeselects = false;\n this.hotMenu = new _core2.default(this.container, settings);\n this.hotMenu.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n this.hotMenu.addHook('afterSelection', function (r, c, r2, c2, preventScrolling) {\n return _this2.onAfterSelection(r, c, r2, c2, preventScrolling);\n });\n this.hotMenu.init();\n this.hotMenu.listen();\n this.blockMainTableCallbacks();\n this.runLocalHooks('afterOpen');\n }\n\n /**\n * Close menu.\n *\n * @param {Boolean} [closeParent=false] if `true` try to close parent menu if exists.\n */\n\n }, {\n key: 'close',\n value: function close() {\n var closeParent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this.isOpened()) {\n return;\n }\n if (closeParent && this.parentMenu) {\n this.parentMenu.close();\n } else {\n this.closeAllSubMenus();\n this.container.style.display = 'none';\n this.releaseMainTableCallbacks();\n this.hotMenu.destroy();\n this.hotMenu = null;\n this.hot.getSettings().outsideClickDeselects = this.origOutsideClickDeselects;\n this.runLocalHooks('afterClose');\n\n if (this.parentMenu) {\n this.parentMenu.hotMenu.listen();\n }\n }\n }\n\n /**\n * Open sub menu at the provided row index.\n *\n * @param {Number} row Row index.\n * @returns {Menu|Boolean} Returns created menu or `false` if no one menu was created.\n */\n\n }, {\n key: 'openSubMenu',\n value: function openSubMenu(row) {\n if (!this.hotMenu) {\n return false;\n }\n var cell = this.hotMenu.getCell(row, 0);\n\n this.closeAllSubMenus();\n\n if (!cell || !(0, _utils.hasSubMenu)(cell)) {\n return false;\n }\n var dataItem = this.hotMenu.getSourceDataAtRow(row);\n var subMenu = new Menu(this.hot, {\n parent: this,\n name: dataItem.name,\n className: this.options.className,\n keepInViewport: true\n });\n subMenu.setMenuItems(dataItem.submenu.items);\n subMenu.open();\n subMenu.setPosition(cell.getBoundingClientRect());\n this.hotSubMenus[dataItem.key] = subMenu;\n\n return subMenu;\n }\n\n /**\n * Close sub menu at row index.\n *\n * @param {Number} row Row index.\n */\n\n }, {\n key: 'closeSubMenu',\n value: function closeSubMenu(row) {\n var dataItem = this.hotMenu.getSourceDataAtRow(row);\n var menus = this.hotSubMenus[dataItem.key];\n\n if (menus) {\n menus.destroy();\n delete this.hotSubMenus[dataItem.key];\n }\n }\n\n /**\n * Close all opened sub menus.\n */\n\n }, {\n key: 'closeAllSubMenus',\n value: function closeAllSubMenus() {\n var _this3 = this;\n\n (0, _array.arrayEach)(this.hotMenu.getData(), function (value, row) {\n return _this3.closeSubMenu(row);\n });\n }\n\n /**\n * Checks if all created and opened sub menus are closed.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isAllSubMenusClosed',\n value: function isAllSubMenusClosed() {\n return Object.keys(this.hotSubMenus).length === 0;\n }\n\n /**\n * Destroy instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.clearLocalHooks();\n this.close();\n this.parentMenu = null;\n this.eventManager.destroy();\n }\n\n /**\n * Checks if menu was opened.\n *\n * @returns {Boolean} Returns `true` if menu was opened.\n */\n\n }, {\n key: 'isOpened',\n value: function isOpened() {\n return this.hotMenu !== null;\n }\n\n /**\n * Execute menu command.\n *\n * @param {Event} [event]\n */\n\n }, {\n key: 'executeCommand',\n value: function executeCommand(event) {\n if (!this.isOpened() || !this.hotMenu.getSelected()) {\n return;\n }\n var selectedItem = this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);\n\n this.runLocalHooks('select', selectedItem, event);\n\n if (selectedItem.isCommand === false || selectedItem.name === _predefinedItems.SEPARATOR) {\n return;\n }\n var selRange = this.hot.getSelectedRange();\n var normalizedSelection = selRange ? (0, _utils.normalizeSelection)(selRange) : {};\n var autoClose = true;\n\n // Don't close context menu if item is disabled or it has submenu\n if (selectedItem.disabled === true || typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true || selectedItem.submenu) {\n autoClose = false;\n }\n\n this.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);\n\n if (this.isSubMenu()) {\n this.parentMenu.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);\n }\n\n if (autoClose) {\n this.close(true);\n }\n }\n\n /**\n * Set menu position based on dom event or based on literal object.\n *\n * @param {Event|Object} coords Event or literal Object with coordinates.\n */\n\n }, {\n key: 'setPosition',\n value: function setPosition(coords) {\n var cursor = new _cursor2.default(coords);\n\n if (this.options.keepInViewport) {\n if (cursor.fitsBelow(this.container)) {\n this.setPositionBelowCursor(cursor);\n } else if (cursor.fitsAbove(this.container)) {\n this.setPositionAboveCursor(cursor);\n } else {\n this.setPositionBelowCursor(cursor);\n }\n if (cursor.fitsOnRight(this.container)) {\n this.setPositionOnRightOfCursor(cursor);\n } else {\n this.setPositionOnLeftOfCursor(cursor);\n }\n } else {\n this.setPositionBelowCursor(cursor);\n this.setPositionOnRightOfCursor(cursor);\n }\n }\n\n /**\n * Set menu position above cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionAboveCursor',\n value: function setPositionAboveCursor(cursor) {\n var top = this.offset.above + cursor.top - this.container.offsetHeight;\n\n if (this.isSubMenu()) {\n top = cursor.top + cursor.cellHeight - this.container.offsetHeight + 3;\n }\n this.container.style.top = top + 'px';\n }\n\n /**\n * Set menu position below cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionBelowCursor',\n value: function setPositionBelowCursor(cursor) {\n var top = this.offset.below + cursor.top;\n\n if (this.isSubMenu()) {\n top = cursor.top - 1;\n }\n this.container.style.top = top + 'px';\n }\n\n /**\n * Set menu position on the right of cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionOnRightOfCursor',\n value: function setPositionOnRightOfCursor(cursor) {\n var left = void 0;\n\n if (this.isSubMenu()) {\n left = 1 + cursor.left + cursor.cellWidth;\n } else {\n left = this.offset.right + 1 + cursor.left;\n }\n\n this.container.style.left = left + 'px';\n }\n\n /**\n * Set menu position on the left of cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionOnLeftOfCursor',\n value: function setPositionOnLeftOfCursor(cursor) {\n var left = this.offset.left + cursor.left - this.container.offsetWidth + (0, _element.getScrollbarWidth)() + 4;\n\n this.container.style.left = left + 'px';\n }\n\n /**\n * Select first cell in opened menu.\n */\n\n }, {\n key: 'selectFirstCell',\n value: function selectFirstCell() {\n var cell = this.hotMenu.getCell(0, 0);\n\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectNextCell(0, 0);\n } else {\n this.hotMenu.selectCell(0, 0);\n }\n }\n\n /**\n * Select last cell in opened menu.\n */\n\n }, {\n key: 'selectLastCell',\n value: function selectLastCell() {\n var lastRow = this.hotMenu.countRows() - 1;\n var cell = this.hotMenu.getCell(lastRow, 0);\n\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectPrevCell(lastRow, 0);\n } else {\n this.hotMenu.selectCell(lastRow, 0);\n }\n }\n\n /**\n * Select next cell in opened menu.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n\n }, {\n key: 'selectNextCell',\n value: function selectNextCell(row, col) {\n var nextRow = row + 1;\n var cell = nextRow < this.hotMenu.countRows() ? this.hotMenu.getCell(nextRow, col) : null;\n\n if (!cell) {\n return;\n }\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectNextCell(nextRow, col);\n } else {\n this.hotMenu.selectCell(nextRow, col);\n }\n }\n\n /**\n * Select previous cell in opened menu.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n\n }, {\n key: 'selectPrevCell',\n value: function selectPrevCell(row, col) {\n var prevRow = row - 1;\n var cell = prevRow >= 0 ? this.hotMenu.getCell(prevRow, col) : null;\n\n if (!cell) {\n return;\n }\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectPrevCell(prevRow, col);\n } else {\n this.hotMenu.selectCell(prevRow, col);\n }\n }\n\n /**\n * Menu item renderer.\n *\n * @private\n */\n\n }, {\n key: 'menuItemRenderer',\n value: function menuItemRenderer(hot, TD, row, col, prop, value) {\n var _this4 = this;\n\n var item = hot.getSourceDataAtRow(row);\n var wrapper = document.createElement('div');\n\n var isSubMenu = function isSubMenu(item) {\n return (0, _object.hasOwnProperty)(item, 'submenu');\n };\n var itemIsSeparator = function itemIsSeparator(item) {\n return new RegExp(_predefinedItems.SEPARATOR, 'i').test(item.name);\n };\n var itemIsDisabled = function itemIsDisabled(item) {\n return item.disabled === true || typeof item.disabled == 'function' && item.disabled.call(_this4.hot) === true;\n };\n var itemIsSelectionDisabled = function itemIsSelectionDisabled(item) {\n return item.disableSelection;\n };\n\n if (typeof value === 'function') {\n value = value.call(this.hot);\n }\n (0, _element.empty)(TD);\n (0, _element.addClass)(wrapper, 'htItemWrapper');\n TD.appendChild(wrapper);\n\n if (itemIsSeparator(item)) {\n (0, _element.addClass)(TD, 'htSeparator');\n } else if (typeof item.renderer === 'function') {\n (0, _element.addClass)(TD, 'htCustomMenuRenderer');\n TD.appendChild(item.renderer(hot, wrapper, row, col, prop, value));\n } else {\n (0, _element.fastInnerHTML)(wrapper, value);\n }\n if (itemIsDisabled(item)) {\n (0, _element.addClass)(TD, 'htDisabled');\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else if (itemIsSelectionDisabled(item)) {\n (0, _element.addClass)(TD, 'htSelectionDisabled');\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else if (isSubMenu(item)) {\n (0, _element.addClass)(TD, 'htSubmenu');\n\n if (itemIsSelectionDisabled(item)) {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.selectCell(row, col, void 0, void 0, false, false);\n });\n }\n } else {\n (0, _element.removeClass)(TD, 'htSubmenu');\n (0, _element.removeClass)(TD, 'htDisabled');\n\n if (itemIsSelectionDisabled(item)) {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.selectCell(row, col, void 0, void 0, false, false);\n });\n }\n }\n }\n\n /**\n * Create container/wrapper for handsontable.\n *\n * @private\n * @param {String} [name] Class name.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createContainer',\n value: function createContainer() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (name) {\n name = name.replace(/[^A-z0-9]/g, '_');\n name = this.options.className + 'Sub_' + name;\n }\n var container = void 0;\n\n if (name) {\n container = document.querySelector('.' + this.options.className + '.' + name);\n } else {\n container = document.querySelector('.' + this.options.className);\n }\n if (!container) {\n container = document.createElement('div');\n (0, _element.addClass)(container, 'htMenu ' + this.options.className);\n\n if (name) {\n (0, _element.addClass)(container, name);\n }\n document.getElementsByTagName('body')[0].appendChild(container);\n }\n\n return container;\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'blockMainTableCallbacks',\n value: function blockMainTableCallbacks() {\n this._afterScrollCallback = function () {};\n this.hot.addHook('afterScrollVertically', this._afterScrollCallback);\n this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback);\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'releaseMainTableCallbacks',\n value: function releaseMainTableCallbacks() {\n if (this._afterScrollCallback) {\n this.hot.removeHook('afterScrollVertically', this._afterScrollCallback);\n this.hot.removeHook('afterScrollHorizontally', this._afterScrollCallback);\n this._afterScrollCallback = null;\n }\n }\n\n /**\n * On before key down listener.\n *\n * @private\n * @param {Event} event\n */\n\n }, {\n key: 'onBeforeKeyDown',\n value: function onBeforeKeyDown(event) {\n var selection = this.hotMenu.getSelected();\n var stopEvent = false;\n this.keyEvent = true;\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ESCAPE:\n this.close();\n stopEvent = true;\n break;\n\n case _unicode.KEY_CODES.ENTER:\n if (selection) {\n if (this.hotMenu.getSourceDataAtRow(selection[0]).submenu) {\n stopEvent = true;\n } else {\n this.executeCommand(event);\n this.close(true);\n }\n }\n break;\n\n case _unicode.KEY_CODES.ARROW_DOWN:\n if (selection) {\n this.selectNextCell(selection[0], selection[1]);\n } else {\n this.selectFirstCell();\n }\n stopEvent = true;\n break;\n\n case _unicode.KEY_CODES.ARROW_UP:\n if (selection) {\n this.selectPrevCell(selection[0], selection[1]);\n } else {\n this.selectLastCell();\n }\n stopEvent = true;\n break;\n\n case _unicode.KEY_CODES.ARROW_RIGHT:\n if (selection) {\n var menu = this.openSubMenu(selection[0]);\n\n if (menu) {\n menu.selectFirstCell();\n }\n }\n stopEvent = true;\n\n break;\n\n case _unicode.KEY_CODES.ARROW_LEFT:\n if (selection && this.isSubMenu()) {\n this.close();\n\n if (this.parentMenu) {\n this.parentMenu.hotMenu.listen();\n }\n stopEvent = true;\n }\n break;\n default:\n break;\n }\n if (stopEvent) {\n event.preventDefault();\n (0, _event.stopImmediatePropagation)(event);\n }\n\n this.keyEvent = false;\n }\n\n /**\n * On after init listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterInit',\n value: function onAfterInit() {\n var data = this.hotMenu.getSettings().data;\n var hiderStyle = this.hotMenu.view.wt.wtTable.hider.style;\n var holderStyle = this.hotMenu.view.wt.wtTable.holder.style;\n var currentHiderWidth = parseInt(hiderStyle.width, 10);\n\n var realHeight = (0, _array.arrayReduce)(data, function (accumulator, value) {\n return accumulator + (value.name === _predefinedItems.SEPARATOR ? 1 : 26);\n }, 0);\n\n holderStyle.width = currentHiderWidth + 22 + 'px';\n holderStyle.height = realHeight + 4 + 'px';\n hiderStyle.height = holderStyle.height;\n }\n\n /**\n * On after selection listener.\n *\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n */\n\n }, {\n key: 'onAfterSelection',\n value: function onAfterSelection(r, c, r2, c2, preventScrolling) {\n if (this.keyEvent === false) {\n preventScrolling.value = true;\n }\n }\n\n /**\n * Document mouse down listener.\n *\n * @private\n * @param {Event} event\n */\n\n }, {\n key: 'onDocumentMouseDown',\n value: function onDocumentMouseDown(event) {\n if (!this.isOpened()) {\n return;\n }\n if (this.container && (0, _element.isChildOf)(event.target, this.container)) {\n this.executeCommand(event);\n }\n // Close menu when clicked element is not belongs to menu itself\n if (this.options.standalone && this.hotMenu && !(0, _element.isChildOf)(event.target, this.hotMenu.rootElement)) {\n this.close(true);\n\n // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)\n } else if ((this.isAllSubMenusClosed() || this.isSubMenu()) && !(0, _element.isChildOf)(event.target, '.htMenu') && (0, _element.isChildOf)(event.target, document)) {\n this.close(true);\n }\n }\n }]);\n\n return Menu;\n}();\n\n(0, _object.mixin)(Menu, _localHooks2.default);\n\nexports.default = Menu;\n\n/***/ }),\n/* 223 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = alignmentItem;\n\nvar _utils = __webpack_require__(17);\n\nvar _separator = __webpack_require__(70);\n\nvar KEY = exports.KEY = 'alignment';\n\nfunction alignmentItem() {\n return {\n key: KEY,\n name: 'Alignment',\n disabled: function disabled() {\n return !(this.getSelectedRange() && !this.selection.selectedHeader.corner);\n },\n\n submenu: {\n items: [{\n key: KEY + ':left',\n name: function name() {\n var _this = this;\n\n var label = 'Left';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htLeft') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this2 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this2.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htLeft';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this2.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this2.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':center',\n name: function name() {\n var _this3 = this;\n\n var label = 'Center';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this3.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htCenter') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this4 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this4.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htCenter';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this4.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this4.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':right',\n name: function name() {\n var _this5 = this;\n\n var label = 'Right';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this5.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htRight') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this6 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this6.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htRight';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this6.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this6.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':justify',\n name: function name() {\n var _this7 = this;\n\n var label = 'Justify';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this7.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htJustify') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this8 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this8.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htJustify';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this8.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this8.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n name: _separator.KEY\n }, {\n key: KEY + ':top',\n name: function name() {\n var _this9 = this;\n\n var label = 'Top';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this9.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htTop') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n return label;\n },\n callback: function callback() {\n var _this10 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this10.getCellMeta(row, col).className;\n });\n var type = 'vertical';\n var alignment = 'htTop';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this10.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this10.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':middle',\n name: function name() {\n var _this11 = this;\n\n var label = 'Middle';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this11.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htMiddle') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this12 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this12.getCellMeta(row, col).className;\n });\n var type = 'vertical';\n var alignment = 'htMiddle';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this12.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this12.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':bottom',\n name: function name() {\n var _this13 = this;\n\n var label = 'Bottom';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this13.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htBottom') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this14 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this14.getCellMeta(row, col).className;\n });\n var type = 'vertical';\n var alignment = 'htBottom';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this14.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this14.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }]\n }\n };\n}\n\n/***/ }),\n/* 224 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = clearColumnItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'clear_column';\n\nfunction clearColumnItem() {\n return {\n key: KEY,\n name: 'Clear column',\n\n callback: function callback(key, selection) {\n var column = selection.start.col;\n\n if (this.countRows()) {\n this.populateFromArray(0, column, [[null]], Math.max(selection.start.row, selection.end.row), column, 'ContextMenu.clearColumn');\n }\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n if (!selected) {\n return true;\n }\n var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];\n var rowSelected = entireRowSelection.join(',') == selected.join(',');\n\n return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected;\n }\n };\n}\n\n/***/ }),\n/* 225 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = columnLeftItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'col_left';\n\nfunction columnLeftItem() {\n return {\n key: KEY,\n name: 'Insert column on the left',\n callback: function callback(key, selection) {\n this.alter('insert_col', selection.start.col, 1, 'ContextMenu.columnLeft');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n if (!selected) {\n return true;\n }\n if (!this.isColumnModificationAllowed()) {\n return true;\n }\n var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];\n var rowSelected = entireRowSelection.join(',') == selected.join(',');\n var onlyOneColumn = this.countCols() === 1;\n\n return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || !onlyOneColumn && rowSelected;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertColumn;\n }\n };\n}\n\n/***/ }),\n/* 226 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = columnRightItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'col_right';\n\nfunction columnRightItem() {\n return {\n key: KEY,\n name: 'Insert column on the right',\n\n callback: function callback(key, selection) {\n this.alter('insert_col', selection.end.col + 1, 1, 'ContextMenu.columnRight');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n if (!selected) {\n return true;\n }\n if (!this.isColumnModificationAllowed()) {\n return true;\n }\n var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];\n var rowSelected = entireRowSelection.join(',') == selected.join(',');\n var onlyOneColumn = this.countCols() === 1;\n\n return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || !onlyOneColumn && rowSelected;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertColumn;\n }\n };\n}\n\n/***/ }),\n/* 227 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = readOnlyItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'make_read_only';\n\nfunction readOnlyItem() {\n return {\n key: KEY,\n name: function name() {\n var _this = this;\n\n var label = 'Read only';\n var atLeastOneReadOnly = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n return _this.getCellMeta(row, col).readOnly;\n });\n\n if (atLeastOneReadOnly) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this2 = this;\n\n var range = this.getSelectedRange();\n var atLeastOneReadOnly = (0, _utils.checkSelectionConsistency)(range, function (row, col) {\n return _this2.getCellMeta(row, col).readOnly;\n });\n\n range.forAll(function (row, col) {\n _this2.setCellMeta(row, col, 'readOnly', !atLeastOneReadOnly);\n });\n this.render();\n },\n disabled: function disabled() {\n return !(this.getSelectedRange() && !this.selection.selectedHeader.corner);\n }\n };\n}\n\n/***/ }),\n/* 228 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = redoItem;\nvar KEY = exports.KEY = 'redo';\n\nfunction redoItem() {\n return {\n key: KEY,\n name: 'Redo',\n\n callback: function callback() {\n this.redo();\n },\n disabled: function disabled() {\n return this.undoRedo && !this.undoRedo.isRedoAvailable();\n }\n };\n}\n\n/***/ }),\n/* 229 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = removeColumnItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'remove_col';\n\nfunction removeColumnItem() {\n return {\n key: KEY,\n name: 'Remove column',\n\n callback: function callback(key, selection) {\n var amount = selection.end.col - selection.start.col + 1;\n\n this.alter('remove_col', selection.start.col, amount, 'ContextMenu.removeColumn');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n var totalColumns = this.countCols();\n\n return !selected || this.selection.selectedHeader.rows || this.selection.selectedHeader.corner || !this.isColumnModificationAllowed() || !totalColumns;\n },\n hidden: function hidden() {\n return !this.getSettings().allowRemoveColumn;\n }\n };\n}\n\n/***/ }),\n/* 230 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = removeRowItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'remove_row';\n\nfunction removeRowItem() {\n return {\n key: KEY,\n name: 'Remove row',\n\n callback: function callback(key, selection) {\n var amount = selection.end.row - selection.start.row + 1;\n\n this.alter('remove_row', selection.start.row, amount, 'ContextMenu.removeRow');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n var totalRows = this.countRows();\n\n return !selected || this.selection.selectedHeader.cols || this.selection.selectedHeader.corner || !totalRows;\n },\n hidden: function hidden() {\n return !this.getSettings().allowRemoveRow;\n }\n };\n}\n\n/***/ }),\n/* 231 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = rowAboveItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'row_above';\n\nfunction rowAboveItem() {\n return {\n key: KEY,\n name: 'Insert row above',\n\n callback: function callback(key, selection) {\n this.alter('insert_row', selection.start.row, 1, 'ContextMenu.rowAbove');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n return !selected || this.selection.selectedHeader.cols || this.countRows() >= this.getSettings().maxRows;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertRow;\n }\n };\n}\n\n/***/ }),\n/* 232 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = rowBelowItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'row_below';\n\nfunction rowBelowItem() {\n return {\n key: KEY,\n name: 'Insert row below',\n\n callback: function callback(key, selection) {\n this.alter('insert_row', selection.end.row + 1, 1, 'ContextMenu.rowBelow');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n return !selected || this.selection.selectedHeader.cols || this.countRows() >= this.getSettings().maxRows;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertRow;\n }\n };\n}\n\n/***/ }),\n/* 233 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = undoItem;\nvar KEY = exports.KEY = 'undo';\n\nfunction undoItem() {\n return {\n key: KEY,\n name: 'Undo',\n\n callback: function callback() {\n this.undo();\n },\n disabled: function disabled() {\n return this.undoRedo && !this.undoRedo.isUndoAvailable();\n }\n };\n}\n\n/***/ }),\n/* 234 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _zeroclipboard = __webpack_require__(300);\n\nvar _zeroclipboard2 = _interopRequireDefault(_zeroclipboard);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _predefinedItems = __webpack_require__(50);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @description\n * This plugin adds a copy/paste functionality to the context menu. Due to browser restrictions, it uses ZeroClipboard to allow\n * copying data with a click.\n *\n * @plugin ContextMenuCopyPaste\n * @dependencies ContextMenu\n */\nvar ContextMenuCopyPaste = function (_BasePlugin) {\n _inherits(ContextMenuCopyPaste, _BasePlugin);\n\n /**\n * @param {Object} hotInstance\n */\n function ContextMenuCopyPaste(hotInstance) {\n _classCallCheck(this, ContextMenuCopyPaste);\n\n /**\n * Instance of {@link EventManager}.\n *\n * @type {EventManager}\n */\n var _this = _possibleConstructorReturn(this, (ContextMenuCopyPaste.__proto__ || Object.getPrototypeOf(ContextMenuCopyPaste)).call(this, hotInstance));\n\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Path to swf file which is necessary for ZeroClipboard.\n *\n * @type {String}\n */\n _this.swfPath = null;\n /**\n * outsideClickDeselectsCache setting cache.\n *\n * @type {Boolean}\n */\n _this.outsideClickDeselectsCache = null;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ContextMenuCopyPaste, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().contextMenuCopyPaste;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n if (_typeof(this.hot.getSettings().contextMenuCopyPaste) === 'object') {\n this.swfPath = this.hot.getSettings().contextMenuCopyPaste.swfPath;\n }\n if (typeof _zeroclipboard2.default === 'undefined') {\n 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.');\n }\n try {\n /* eslint-disable no-new */\n new ActiveXObject('ShockwaveFlash.ShockwaveFlash');\n } catch (exception) {\n if (typeof navigator.mimeTypes['application/x-shockwave-flash'] == 'undefined') {\n console.error('To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.');\n }\n }\n if (this.swfPath) {\n _zeroclipboard2.default.config({\n swfPath: this.swfPath\n });\n }\n this.hot.addHook('afterContextMenuShow', function () {\n return _this2.onAfterContextMenuShow();\n });\n this.hot.addHook('afterContextMenuDefaultOptions', function (options) {\n return _this2.onAfterContextMenuDefaultOptions(options);\n });\n this.registerEvents();\n _get(ContextMenuCopyPaste.prototype.__proto__ || Object.getPrototypeOf(ContextMenuCopyPaste.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(ContextMenuCopyPaste.prototype.__proto__ || Object.getPrototypeOf(ContextMenuCopyPaste.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this3 = this;\n\n this.eventManager.addEventListener(document, 'mouseenter', function () {\n return _this3.removeCurrentClass();\n });\n this.eventManager.addEventListener(document, 'mouseleave', function () {\n return _this3.removeZeroClipboardClass();\n });\n }\n\n /**\n * Get a value to copy.\n *\n * @returns {String}\n */\n\n }, {\n key: 'getCopyValue',\n value: function getCopyValue() {\n this.hot.copyPaste.setCopyableText();\n this.hot.copyPaste.copyPasteInstance.triggerCopy();\n return this.hot.copyPaste.copyPasteInstance.elTextarea.value;\n }\n\n /**\n * Add Copy and Paste functionality to the context menu.\n *\n * @private\n * @param {Object} defaultOptions\n */\n\n }, {\n key: 'onAfterContextMenuDefaultOptions',\n value: function onAfterContextMenuDefaultOptions(defaultOptions) {\n defaultOptions.items.unshift({\n key: 'copy',\n name: 'Copy',\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n }\n }, {\n key: 'paste',\n name: 'Paste',\n callback: function callback() {\n this.copyPaste.triggerPaste();\n },\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n }\n }, { name: _predefinedItems.SEPARATOR });\n }\n\n /**\n * After context menu show listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterContextMenuShow',\n value: function onAfterContextMenuShow() {\n var _this4 = this;\n\n var contextMenu = this.hot.getPlugin('contextMenu');\n var data = contextMenu.menu.hotMenu.getSourceData();\n\n // find position of 'copy' option.\n (0, _array.arrayEach)(data, function (item, index) {\n if (item.key === 'copy') {\n var zeroClipboardInstance = new _zeroclipboard2.default(contextMenu.menu.hotMenu.getCell(index, 0));\n\n zeroClipboardInstance.off();\n zeroClipboardInstance.on('copy', function (event) {\n var clipboard = event.clipboardData;\n\n clipboard.setData('text/plain', _this4.getCopyValue());\n _this4.hot.getSettings().outsideClickDeselects = _this4.outsideClickDeselectsCache;\n });\n\n return false;\n }\n });\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'removeCurrentClass',\n value: function removeCurrentClass() {\n var contextMenu = this.hot.getPlugin('contextMenu');\n\n if (!contextMenu.enabled) {\n return;\n }\n if (contextMenu.menu.isOpened()) {\n var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.current');\n\n if (element) {\n (0, _element.removeClass)(element, 'current');\n }\n }\n this.outsideClickDeselectsCache = this.hot.getSettings().outsideClickDeselects;\n this.hot.getSettings().outsideClickDeselects = false;\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'removeZeroClipboardClass',\n value: function removeZeroClipboardClass() {\n var contextMenu = this.hot.getPlugin('contextMenu');\n\n if (!contextMenu.enabled) {\n return;\n }\n if (contextMenu.menu.isOpened()) {\n var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.zeroclipboard-is-hover');\n\n if (element) {\n (0, _element.removeClass)(element, 'zeroclipboard-is-hover');\n }\n }\n this.hot.getSettings().outsideClickDeselects = this.outsideClickDeselectsCache;\n }\n }]);\n\n return ContextMenuCopyPaste;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('contextMenuCopyPaste', ContextMenuCopyPaste);\n\nexports.default = ContextMenuCopyPaste;\n\n/***/ }),\n/* 235 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _copyPaste = __webpack_require__(184);\n\nvar _copyPaste2 = _interopRequireDefault(_copyPaste);\n\nvar _SheetClip = __webpack_require__(132);\n\nvar _SheetClip2 = _interopRequireDefault(_SheetClip);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _unicode = __webpack_require__(16);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _event = __webpack_require__(7);\n\nvar _element = __webpack_require__(0);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_pluginHooks2.default.getSingleton().register('afterCopyLimit');\n_pluginHooks2.default.getSingleton().register('modifyCopyableRange');\n_pluginHooks2.default.getSingleton().register('beforeCut');\n_pluginHooks2.default.getSingleton().register('afterCut');\n_pluginHooks2.default.getSingleton().register('beforePaste');\n_pluginHooks2.default.getSingleton().register('afterPaste');\n_pluginHooks2.default.getSingleton().register('beforeCopy');\n_pluginHooks2.default.getSingleton().register('afterCopy');\n\n/**\n * @description\n * This plugin enables the copy/paste functionality in Handsontable.\n *\n * @example\n * ```js\n * ...\n * copyPaste: true,\n * ...\n * ```\n * @class CopyPaste\n * @plugin CopyPaste\n */\nfunction CopyPastePlugin(instance) {\n var _this = this;\n\n this.copyPasteInstance = (0, _copyPaste2.default)();\n this.copyPasteInstance.onCut(onCut);\n this.copyPasteInstance.triggerCopy = callCopyAction;\n this.copyPasteInstance.onPaste(onPaste);\n this.onPaste = onPaste; // for paste testing purposes\n this.copyableRanges = [];\n\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n\n function onCut() {\n instance.isListening();\n }\n\n function callCutAction() {\n var rangedData = _this.getRangedData(_this.copyableRanges);\n\n if (instance.getSettings().fragmentSelection && _SheetClip2.default.stringify(rangedData) != (0, _element.getSelectionText)()) {\n return;\n }\n\n var allowCuttingOut = !!instance.runHooks('beforeCut', rangedData, _this.copyableRanges);\n\n if (allowCuttingOut) {\n instance.copyPaste.copyPasteInstance.copyable(_SheetClip2.default.stringify(rangedData));\n instance.selection.empty();\n instance.runHooks('afterCut', rangedData, _this.copyableRanges);\n } else {\n instance.copyPaste.copyPasteInstance.copyable('');\n }\n }\n\n function callCopyAction() {\n if (!instance.isListening()) {\n return;\n }\n\n var rangedData = _this.getRangedData(_this.copyableRanges);\n\n if (instance.getSettings().fragmentSelection && _SheetClip2.default.stringify(rangedData) != (0, _element.getSelectionText)()) {\n return;\n }\n\n var allowCopying = !!instance.runHooks('beforeCopy', rangedData, _this.copyableRanges);\n\n if (allowCopying) {\n instance.copyPaste.copyPasteInstance.copyable(_SheetClip2.default.stringify(rangedData));\n instance.runHooks('afterCopy', rangedData, _this.copyableRanges);\n } else {\n instance.copyPaste.copyPasteInstance.copyable('');\n }\n }\n\n function onPaste(str) {\n var input, inputArray, selected, coordsFrom, coordsTo, cellRange, topLeftCorner, bottomRightCorner, areaStart, areaEnd;\n\n if (!instance.isListening() || !instance.selection.isSelected()) {\n return;\n }\n input = str;\n inputArray = _SheetClip2.default.parse(input);\n selected = instance.getSelected();\n coordsFrom = new _src.CellCoords(selected[0], selected[1]);\n coordsTo = new _src.CellCoords(selected[2], selected[3]);\n cellRange = new _src.CellRange(coordsFrom, coordsFrom, coordsTo);\n topLeftCorner = cellRange.getTopLeftCorner();\n bottomRightCorner = cellRange.getBottomRightCorner();\n areaStart = topLeftCorner;\n areaEnd = new _src.CellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col));\n\n var isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1;\n var isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1;\n\n instance.addHookOnce('afterChange', function (changes, source) {\n var changesLength = changes ? changes.length : 0;\n\n if (changesLength) {\n var offset = { row: 0, col: 0 };\n var highestColumnIndex = -1;\n\n (0, _array.arrayEach)(changes, function (change, index) {\n var nextChange = changesLength > index + 1 ? changes[index + 1] : null;\n\n if (nextChange) {\n if (!isSelRowAreaCoverInputValue) {\n offset.row += Math.max(nextChange[0] - change[0] - 1, 0);\n }\n if (!isSelColAreaCoverInputValue && change[1] > highestColumnIndex) {\n highestColumnIndex = change[1];\n offset.col += Math.max(nextChange[1] - change[1] - 1, 0);\n }\n }\n });\n instance.selectCell(areaStart.row, areaStart.col, areaEnd.row + offset.row, areaEnd.col + offset.col);\n }\n });\n\n var allowPasting = !!instance.runHooks('beforePaste', inputArray, _this.copyableRanges);\n\n if (allowPasting) {\n instance.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'CopyPaste.paste', instance.getSettings().pasteMode);\n instance.runHooks('afterPaste', inputArray, _this.copyableRanges);\n }\n }\n\n function onBeforeKeyDown(event) {\n if (!instance.getSelected()) {\n return;\n }\n if (instance.getActiveEditor() && instance.getActiveEditor().isOpened()) {\n return;\n }\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n if ((0, _unicode.isCtrlKey)(event.keyCode)) {\n // When fragmentSelection is enabled and some text is selected then don't blur selection calling 'setCopyableText'\n if (instance.getSettings().fragmentSelection && (0, _element.getSelectionText)()) {\n return;\n }\n // when CTRL is pressed, prepare selectable text in textarea\n _this.setCopyableText();\n (0, _event.stopImmediatePropagation)(event);\n\n return;\n }\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode == _unicode.KEY_CODES.A) {\n instance._registerTimeout(setTimeout(_this.setCopyableText.bind(_this), 0));\n }\n if (event.keyCode == _unicode.KEY_CODES.X) {\n callCutAction();\n }\n if (event.keyCode == _unicode.KEY_CODES.C) {\n callCopyAction();\n }\n }\n }\n\n /**\n * Destroy plugin instance.\n *\n * @function destroy\n * @memberof CopyPaste#\n */\n this.destroy = function () {\n if (this.copyPasteInstance) {\n this.copyPasteInstance.removeCallback(onCut);\n this.copyPasteInstance.removeCallback(onPaste);\n this.copyPasteInstance.destroy();\n this.copyPasteInstance = null;\n }\n instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n };\n\n instance.addHook('afterDestroy', this.destroy.bind(this));\n\n /**\n * @function triggerPaste\n * @memberof CopyPaste#\n */\n this.triggerPaste = this.copyPasteInstance.triggerPaste.bind(this.copyPasteInstance);\n\n /**\n * @function triggerCut\n * @memberof CopyPaste#\n */\n this.triggerCut = this.copyPasteInstance.triggerCut.bind(this.copyPasteInstance);\n\n /**\n * Prepares copyable text in the invisible textarea.\n *\n * @function setCopyable\n * @memberof CopyPaste#\n */\n this.setCopyableText = function () {\n var settings = instance.getSettings();\n var copyRowsLimit = settings.copyRowsLimit;\n var copyColsLimit = settings.copyColsLimit;\n\n var selRange = instance.getSelectedRange();\n var topLeft = selRange.getTopLeftCorner();\n var bottomRight = selRange.getBottomRightCorner();\n var startRow = topLeft.row;\n var startCol = topLeft.col;\n var endRow = bottomRight.row;\n var endCol = bottomRight.col;\n var finalEndRow = Math.min(endRow, startRow + copyRowsLimit - 1);\n var finalEndCol = Math.min(endCol, startCol + copyColsLimit - 1);\n\n this.copyableRanges.length = 0;\n\n this.copyableRanges.push({\n startRow: startRow,\n startCol: startCol,\n endRow: finalEndRow,\n endCol: finalEndCol\n });\n\n this.copyableRanges = instance.runHooks('modifyCopyableRange', this.copyableRanges);\n\n var copyableData = this.getRangedCopyableData(this.copyableRanges);\n\n instance.copyPaste.copyPasteInstance.copyable(copyableData);\n\n if (endRow !== finalEndRow || endCol !== finalEndCol) {\n instance.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, copyRowsLimit, copyColsLimit);\n }\n };\n\n /**\n * Create copyable text releated to range objects.\n *\n * @since 0.19.0\n * @param {Array} ranges Array of Objects with properties `startRow`, `endRow`, `startCol` and `endCol`.\n * @returns {String} Returns string which will be copied into clipboard.\n */\n this.getRangedCopyableData = function (ranges) {\n var dataSet = [];\n var copyableRows = [];\n var copyableColumns = [];\n\n // Count all copyable rows and columns\n (0, _array.arrayEach)(ranges, function (range) {\n (0, _number.rangeEach)(range.startRow, range.endRow, function (row) {\n if (copyableRows.indexOf(row) === -1) {\n copyableRows.push(row);\n }\n });\n (0, _number.rangeEach)(range.startCol, range.endCol, function (column) {\n if (copyableColumns.indexOf(column) === -1) {\n copyableColumns.push(column);\n }\n });\n });\n // Concat all rows and columns data defined in ranges into one copyable string\n (0, _array.arrayEach)(copyableRows, function (row) {\n var rowSet = [];\n\n (0, _array.arrayEach)(copyableColumns, function (column) {\n rowSet.push(instance.getCopyableData(row, column));\n });\n\n dataSet.push(rowSet);\n });\n\n return _SheetClip2.default.stringify(dataSet);\n };\n\n /**\n * Create copyable text releated to range objects.\n *\n * @since 0.31.1\n * @param {Array} ranges Array of Objects with properties `startRow`, `startCol`, `endRow` and `endCol`.\n * @returns {Array} Returns array of arrays which will be copied into clipboard.\n */\n this.getRangedData = function (ranges) {\n var dataSet = [];\n var copyableRows = [];\n var copyableColumns = [];\n\n // Count all copyable rows and columns\n (0, _array.arrayEach)(ranges, function (range) {\n (0, _number.rangeEach)(range.startRow, range.endRow, function (row) {\n if (copyableRows.indexOf(row) === -1) {\n copyableRows.push(row);\n }\n });\n (0, _number.rangeEach)(range.startCol, range.endCol, function (column) {\n if (copyableColumns.indexOf(column) === -1) {\n copyableColumns.push(column);\n }\n });\n });\n // Concat all rows and columns data defined in ranges into one copyable string\n (0, _array.arrayEach)(copyableRows, function (row) {\n var rowSet = [];\n\n (0, _array.arrayEach)(copyableColumns, function (column) {\n rowSet.push(instance.getCopyableData(row, column));\n });\n\n dataSet.push(rowSet);\n });\n\n return dataSet;\n };\n}\n\n/**\n * Init plugin.\n *\n * @function init\n * @memberof CopyPaste#\n */\nfunction init() {\n var instance = this,\n pluginEnabled = instance.getSettings().copyPaste !== false;\n\n if (pluginEnabled && !instance.copyPaste) {\n /**\n * Instance of CopyPaste Plugin {@link Handsontable.CopyPaste}\n *\n * @alias copyPaste\n * @memberof! Handsontable.Core#\n * @type {CopyPaste}\n */\n instance.copyPaste = new CopyPastePlugin(instance);\n } else if (!pluginEnabled && instance.copyPaste) {\n instance.copyPaste.destroy();\n instance.copyPaste = null;\n }\n}\n\n_pluginHooks2.default.getSingleton().add('afterInit', init);\n_pluginHooks2.default.getSingleton().add('afterUpdateSettings', init);\n\nexports.default = CopyPastePlugin;\n\n/***/ }),\n/* 236 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _plugins = __webpack_require__(5);\n\nvar _object = __webpack_require__(2);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction CustomBorders() {}\n/** *\n * Current instance (table where borders should be placed)\n */\nvar instance;\n\n/**\n * This plugin enables an option to apply custom borders through the context menu (configurable with context menu key `borders`).\n *\n * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](http://docs.handsontable.com/demo-custom-borders.html) demo for more examples.\n *\n * @example\n * ```js\n * ...\n * customBorders: [\n * {range: {\n * from: {row: 1, col: 1},\n * to: {row: 3, col: 4}},\n * left: {},\n * right: {},\n * top: {},\n * bottom: {}\n * }\n * ],\n * ...\n *\n * // or\n * ...\n * customBorders: [\n * {row: 2, col: 2, left: {width: 2, color: 'red'},\n * right: {width: 1, color: 'green'}, top: '', bottom: ''}\n * ],\n * ...\n * ```\n * @private\n * @class CustomBorders\n * @plugin CustomBorders\n */\n\n/** *\n * Check if plugin should be enabled.\n */\nvar checkEnable = function checkEnable(customBorders) {\n if (typeof customBorders === 'boolean') {\n if (customBorders === true) {\n return true;\n }\n }\n if ((typeof customBorders === 'undefined' ? 'undefined' : _typeof(customBorders)) === 'object') {\n if (customBorders.length > 0) {\n return true;\n }\n }\n\n return false;\n};\n\n/** *\n * Initialize plugin.\n */\nvar init = function init() {\n if (checkEnable(this.getSettings().customBorders)) {\n if (!this.customBorders) {\n instance = this;\n this.customBorders = new CustomBorders();\n }\n }\n};\n\n/** *\n * Get index of border from the settings.\n *\n * @param {String} className\n * @returns {Number}\n */\nvar getSettingIndex = function getSettingIndex(className) {\n for (var i = 0; i < instance.view.wt.selections.length; i++) {\n if (instance.view.wt.selections[i].settings.className == className) {\n return i;\n }\n }\n\n return -1;\n};\n\n/** *\n * Insert WalkontableSelection instance into Walkontable settings.\n *\n * @param border\n */\nvar insertBorderIntoSettings = function insertBorderIntoSettings(border) {\n var coordinates = {\n row: border.row,\n col: border.col\n };\n var selection = new _src.Selection(border, new _src.CellRange(coordinates, coordinates, coordinates));\n var index = getSettingIndex(border.className);\n\n if (index >= 0) {\n instance.view.wt.selections[index] = selection;\n } else {\n instance.view.wt.selections.push(selection);\n }\n};\n\n/** *\n * Prepare borders from setting (single cell).\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param borderObj\n */\nvar prepareBorderFromCustomAdded = function prepareBorderFromCustomAdded(row, col, borderObj) {\n var border = createEmptyBorders(row, col);\n border = extendDefaultBorder(border, borderObj);\n this.setCellMeta(row, col, 'borders', border);\n\n insertBorderIntoSettings(border);\n};\n\n/** *\n * Prepare borders from setting (object).\n *\n * @param {Object} rowObj\n */\nvar prepareBorderFromCustomAddedRange = function prepareBorderFromCustomAddedRange(rowObj) {\n var range = rowObj.range;\n\n for (var row = range.from.row; row <= range.to.row; row++) {\n for (var col = range.from.col; col <= range.to.col; col++) {\n var border = createEmptyBorders(row, col);\n var add = 0;\n\n if (row == range.from.row) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'top')) {\n border.top = rowObj.top;\n }\n }\n\n if (row == range.to.row) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'bottom')) {\n border.bottom = rowObj.bottom;\n }\n }\n\n if (col == range.from.col) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'left')) {\n border.left = rowObj.left;\n }\n }\n\n if (col == range.to.col) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'right')) {\n border.right = rowObj.right;\n }\n }\n\n if (add > 0) {\n this.setCellMeta(row, col, 'borders', border);\n insertBorderIntoSettings(border);\n }\n }\n }\n};\n\n/** *\n * Create separated class name for borders for each cell.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {String}\n */\nvar createClassName = function createClassName(row, col) {\n return 'border_row' + row + 'col' + col;\n};\n\n/** *\n * Create default single border for each position (top/right/bottom/left).\n *\n * @returns {Object} `{{width: number, color: string}}`\n */\nvar createDefaultCustomBorder = function createDefaultCustomBorder() {\n return {\n width: 1,\n color: '#000'\n };\n};\n\n/** *\n * Create default object for empty border.\n *\n * @returns {Object} `{{hide: boolean}}`\n */\nvar createSingleEmptyBorder = function createSingleEmptyBorder() {\n return {\n hide: true\n };\n};\n\n/** *\n * Create default Handsontable border object.\n *\n * @returns {Object} `{{width: number, color: string, cornerVisible: boolean}}`\n */\nvar createDefaultHtBorder = function createDefaultHtBorder() {\n return {\n width: 1,\n color: '#000',\n cornerVisible: false\n };\n};\n\n/** *\n * Prepare empty border for each cell with all custom borders hidden.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Object} `{{className: *, border: *, row: *, col: *, top: {hide: boolean}, right: {hide: boolean}, bottom: {hide: boolean}, left: {hide: boolean}}}`\n */\nvar createEmptyBorders = function createEmptyBorders(row, col) {\n return {\n className: createClassName(row, col),\n border: createDefaultHtBorder(),\n row: row,\n col: col,\n top: createSingleEmptyBorder(),\n right: createSingleEmptyBorder(),\n bottom: createSingleEmptyBorder(),\n left: createSingleEmptyBorder()\n };\n};\n\nvar extendDefaultBorder = function extendDefaultBorder(defaultBorder, customBorder) {\n if ((0, _object.hasOwnProperty)(customBorder, 'border')) {\n defaultBorder.border = customBorder.border;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'top')) {\n defaultBorder.top = customBorder.top;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'right')) {\n defaultBorder.right = customBorder.right;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'bottom')) {\n defaultBorder.bottom = customBorder.bottom;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'left')) {\n defaultBorder.left = customBorder.left;\n }\n\n return defaultBorder;\n};\n\n/**\n * Remove borders divs from DOM.\n *\n * @param borderClassName\n */\nvar removeBordersFromDom = function removeBordersFromDom(borderClassName) {\n var borders = document.querySelectorAll('.' + borderClassName);\n\n for (var i = 0; i < borders.length; i++) {\n if (borders[i]) {\n if (borders[i].nodeName != 'TD') {\n var parent = borders[i].parentNode;\n\n if (parent.parentNode) {\n parent.parentNode.removeChild(parent);\n }\n }\n }\n }\n};\n\n/** *\n * Remove border (triggered from context menu).\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\nvar removeAllBorders = function removeAllBorders(row, col) {\n var borderClassName = createClassName(row, col);\n removeBordersFromDom(borderClassName);\n this.removeCellMeta(row, col, 'borders');\n};\n\n/** *\n * Set borders for each cell re. to border position\n *\n * @param row\n * @param col\n * @param place\n * @param remove\n */\nvar setBorder = function setBorder(row, col, place, remove) {\n\n var bordersMeta = this.getCellMeta(row, col).borders;\n\n if (!bordersMeta || bordersMeta.border == undefined) {\n bordersMeta = createEmptyBorders(row, col);\n }\n\n if (remove) {\n bordersMeta[place] = createSingleEmptyBorder();\n } else {\n bordersMeta[place] = createDefaultCustomBorder();\n }\n\n this.setCellMeta(row, col, 'borders', bordersMeta);\n\n var borderClassName = createClassName(row, col);\n removeBordersFromDom(borderClassName);\n insertBorderIntoSettings(bordersMeta);\n\n this.render();\n};\n\n/** *\n * Prepare borders based on cell and border position\n *\n * @param range\n * @param place\n * @param remove\n */\nvar prepareBorder = function prepareBorder(range, place, remove) {\n\n if (range.from.row == range.to.row && range.from.col == range.to.col) {\n if (place == 'noBorders') {\n removeAllBorders.call(this, range.from.row, range.from.col);\n } else {\n setBorder.call(this, range.from.row, range.from.col, place, remove);\n }\n } else {\n switch (place) {\n case 'noBorders':\n for (var column = range.from.col; column <= range.to.col; column++) {\n for (var row = range.from.row; row <= range.to.row; row++) {\n removeAllBorders.call(this, row, column);\n }\n }\n break;\n case 'top':\n for (var topCol = range.from.col; topCol <= range.to.col; topCol++) {\n setBorder.call(this, range.from.row, topCol, place, remove);\n }\n break;\n case 'right':\n for (var rowRight = range.from.row; rowRight <= range.to.row; rowRight++) {\n setBorder.call(this, rowRight, range.to.col, place);\n }\n break;\n case 'bottom':\n for (var bottomCol = range.from.col; bottomCol <= range.to.col; bottomCol++) {\n setBorder.call(this, range.to.row, bottomCol, place);\n }\n break;\n case 'left':\n for (var rowLeft = range.from.row; rowLeft <= range.to.row; rowLeft++) {\n setBorder.call(this, rowLeft, range.from.col, place);\n }\n break;\n default:\n break;\n }\n }\n};\n\n/** *\n * Check if selection has border by className\n *\n * @param hot\n * @param direction\n */\nvar checkSelectionBorders = function checkSelectionBorders(hot, direction) {\n var atLeastOneHasBorder = false;\n\n hot.getSelectedRange().forAll(function (r, c) {\n var metaBorders = hot.getCellMeta(r, c).borders;\n\n if (metaBorders) {\n if (direction) {\n if (!(0, _object.hasOwnProperty)(metaBorders[direction], 'hide')) {\n atLeastOneHasBorder = true;\n return false; // breaks forAll\n }\n } else {\n atLeastOneHasBorder = true;\n return false; // breaks forAll\n }\n }\n });\n return atLeastOneHasBorder;\n};\n\n/** *\n * Mark label in contextMenu as selected\n *\n * @param label\n * @returns {string}\n */\nvar markSelected = function markSelected(label) {\n return '<span class=\"selected\">' + String.fromCharCode(10003) + '</span>' + label; // workaround for https://github.com/handsontable/handsontable/issues/1946\n};\n\n/** *\n * Add border options to context menu\n *\n * @param defaultOptions\n */\nvar addBordersOptionsToContextMenu = function addBordersOptionsToContextMenu(defaultOptions) {\n if (!this.getSettings().customBorders) {\n return;\n }\n\n defaultOptions.items.push({\n name: '---------'\n });\n defaultOptions.items.push({\n key: 'borders',\n name: 'Borders',\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n },\n\n submenu: {\n items: [{\n key: 'borders:top',\n name: function name() {\n var label = 'Top';\n var hasBorder = checkSelectionBorders(this, 'top');\n if (hasBorder) {\n label = markSelected(label);\n }\n\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'top');\n prepareBorder.call(this, this.getSelectedRange(), 'top', hasBorder);\n }\n }, {\n key: 'borders:right',\n name: function name() {\n var label = 'Right';\n var hasBorder = checkSelectionBorders(this, 'right');\n if (hasBorder) {\n label = markSelected(label);\n }\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'right');\n prepareBorder.call(this, this.getSelectedRange(), 'right', hasBorder);\n }\n }, {\n key: 'borders:bottom',\n name: function name() {\n var label = 'Bottom';\n var hasBorder = checkSelectionBorders(this, 'bottom');\n if (hasBorder) {\n label = markSelected(label);\n }\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'bottom');\n prepareBorder.call(this, this.getSelectedRange(), 'bottom', hasBorder);\n }\n }, {\n key: 'borders:left',\n name: function name() {\n var label = 'Left';\n var hasBorder = checkSelectionBorders(this, 'left');\n if (hasBorder) {\n label = markSelected(label);\n }\n\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'left');\n prepareBorder.call(this, this.getSelectedRange(), 'left', hasBorder);\n }\n }, {\n key: 'borders:no_borders',\n name: 'Remove border(s)',\n callback: function callback() {\n prepareBorder.call(this, this.getSelectedRange(), 'noBorders');\n },\n disabled: function disabled() {\n return !checkSelectionBorders(this);\n }\n }]\n }\n });\n};\n\n_pluginHooks2.default.getSingleton().add('beforeInit', init);\n_pluginHooks2.default.getSingleton().add('afterContextMenuDefaultOptions', addBordersOptionsToContextMenu);\n_pluginHooks2.default.getSingleton().add('afterInit', function () {\n var customBorders = this.getSettings().customBorders;\n\n if (customBorders) {\n for (var i = 0; i < customBorders.length; i++) {\n if (customBorders[i].range) {\n prepareBorderFromCustomAddedRange.call(this, customBorders[i]);\n } else {\n prepareBorderFromCustomAdded.call(this, customBorders[i].row, customBorders[i].col, customBorders[i]);\n }\n }\n\n this.render();\n this.view.wt.draw(true);\n }\n});\n\n/***/ }),\n/* 237 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @description\n * Plugin used to scroll Handsontable by selecting a cell and dragging outside of the visible viewport.\n *\n * @private\n * @class DragToScroll\n * @plugin DragToScroll\n */\nfunction DragToScroll() {\n this.boundaries = null;\n this.callback = null;\n}\n\n/**\n * @param boundaries {Object} compatible with getBoundingClientRect\n */\nDragToScroll.prototype.setBoundaries = function (boundaries) {\n this.boundaries = boundaries;\n};\n\n/**\n * @param callback {Function}\n */\nDragToScroll.prototype.setCallback = function (callback) {\n this.callback = callback;\n};\n\n/**\n * Check if mouse position (x, y) is outside of the viewport\n * @param x\n * @param y\n */\nDragToScroll.prototype.check = function (x, y) {\n var diffX = 0;\n var diffY = 0;\n\n if (y < this.boundaries.top) {\n // y is less than top\n diffY = y - this.boundaries.top;\n } else if (y > this.boundaries.bottom) {\n // y is more than bottom\n diffY = y - this.boundaries.bottom;\n }\n\n if (x < this.boundaries.left) {\n // x is less than left\n diffX = x - this.boundaries.left;\n } else if (x > this.boundaries.right) {\n // x is more than right\n diffX = x - this.boundaries.right;\n }\n\n this.callback(diffX, diffY);\n};\n\nvar dragToScroll;\nvar instance;\n\nvar setupListening = function setupListening(instance) {\n instance.dragToScrollListening = false;\n var scrollHandler = instance.view.wt.wtTable.holder; // native scroll\n dragToScroll = new DragToScroll();\n\n if (scrollHandler === window) {\n // not much we can do currently\n return;\n }\n\n dragToScroll.setBoundaries(scrollHandler.getBoundingClientRect());\n dragToScroll.setCallback(function (scrollX, scrollY) {\n if (scrollX < 0) {\n scrollHandler.scrollLeft -= 50;\n } else if (scrollX > 0) {\n scrollHandler.scrollLeft += 50;\n }\n\n if (scrollY < 0) {\n scrollHandler.scrollTop -= 20;\n } else if (scrollY > 0) {\n scrollHandler.scrollTop += 20;\n }\n });\n\n instance.dragToScrollListening = true;\n};\n\n_pluginHooks2.default.getSingleton().add('afterInit', function () {\n var instance = this;\n var eventManager = new _eventManager2.default(this);\n\n eventManager.addEventListener(document, 'mouseup', function () {\n instance.dragToScrollListening = false;\n });\n\n eventManager.addEventListener(document, 'mousemove', function (event) {\n if (instance.dragToScrollListening) {\n dragToScroll.check(event.clientX, event.clientY);\n }\n });\n});\n\n_pluginHooks2.default.getSingleton().add('afterDestroy', function () {\n new _eventManager2.default(this).clear();\n});\n\n_pluginHooks2.default.getSingleton().add('afterOnCellMouseDown', function () {\n setupListening(this);\n});\n\n_pluginHooks2.default.getSingleton().add('afterOnCellCornerMouseDown', function () {\n setupListening(this);\n});\n\nexports.default = DragToScroll;\n\n/***/ }),\n/* 238 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = freezeColumnItem;\nfunction freezeColumnItem(manualColumnFreezePlugin) {\n return {\n key: 'freeze_column',\n name: 'Freeze this column',\n callback: function callback() {\n var selectedColumn = this.getSelectedRange().from.col;\n\n manualColumnFreezePlugin.freezeColumn(selectedColumn);\n\n this.render();\n this.view.wt.wtOverlays.adjustElementsSize(true);\n },\n hidden: function hidden() {\n var selection = this.getSelectedRange();\n var hide = false;\n\n if (selection === void 0) {\n hide = true;\n } else if (selection.from.col !== selection.to.col || selection.from.col <= this.getSettings().fixedColumnsLeft - 1) {\n hide = true;\n }\n\n return hide;\n }\n };\n}\n\n/***/ }),\n/* 239 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = unfreezeColumnItem;\nfunction unfreezeColumnItem(manualColumnFreezePlugin) {\n return {\n key: 'unfreeze_column',\n name: 'Unfreeze this column',\n callback: function callback() {\n var selectedColumn = this.getSelectedRange().from.col;\n\n manualColumnFreezePlugin.unfreezeColumn(selectedColumn);\n\n this.render();\n this.view.wt.wtOverlays.adjustElementsSize(true);\n },\n hidden: function hidden() {\n var selection = this.getSelectedRange();\n var hide = false;\n\n if (selection === void 0) {\n hide = true;\n } else if (selection.from.col !== selection.to.col || selection.from.col >= this.getSettings().fixedColumnsLeft) {\n hide = true;\n }\n\n return hide;\n }\n };\n}\n\n/***/ }),\n/* 240 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _plugins = __webpack_require__(5);\n\nvar _array = __webpack_require__(1);\n\nvar _freezeColumn = __webpack_require__(238);\n\nvar _freezeColumn2 = _interopRequireDefault(_freezeColumn);\n\nvar _unfreezeColumn = __webpack_require__(239);\n\nvar _unfreezeColumn2 = _interopRequireDefault(_unfreezeColumn);\n\n__webpack_require__(296);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar privatePool = new WeakMap();\n/**\n * This plugin allows to manually \"freeze\" and \"unfreeze\" a column using an entry in the Context Menu.\n * You can turn it on by setting a `manualColumnFreeze` property to `true`.\n *\n * @plugin ManualColumnFreeze\n * @dependencies ManualColumnMove\n */\n\nvar ManualColumnFreeze = function (_BasePlugin) {\n _inherits(ManualColumnFreeze, _BasePlugin);\n\n function ManualColumnFreeze(hotInstance) {\n _classCallCheck(this, ManualColumnFreeze);\n\n var _this = _possibleConstructorReturn(this, (ManualColumnFreeze.__proto__ || Object.getPrototypeOf(ManualColumnFreeze)).call(this, hotInstance));\n\n privatePool.set(_this, {\n moveByFreeze: false,\n afterFirstUse: false\n });\n /**\n * Original column positions\n *\n * @type {Array}\n */\n _this.frozenColumnsBasePositions = [];\n /**\n * Reference to the `ManualColumnMove` plugin.\n */\n _this.manualColumnMovePlugin = void 0;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualColumnFreeze, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().manualColumnFreeze;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterContextMenuDefaultOptions', function (options) {\n return _this2.addContextMenuEntry(options);\n });\n this.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n this.addHook('beforeColumnMove', function (rows, target) {\n return _this2.onBeforeColumnMove(rows, target);\n });\n\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n var priv = privatePool.get(this);\n\n priv.afterFirstUse = false;\n priv.moveByFreeze = false;\n\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Freeze the given column (add it to fixed columns).\n *\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'freezeColumn',\n value: function freezeColumn(column) {\n var priv = privatePool.get(this);\n var settings = this.hot.getSettings();\n\n if (!priv.afterFirstUse) {\n priv.afterFirstUse = true;\n }\n\n if (settings.fixedColumnsLeft === this.hot.countCols() || column <= settings.fixedColumnsLeft - 1) {\n return; // already fixed\n }\n\n priv.moveByFreeze = true;\n\n if (column !== this.getMovePlugin().columnsMapper.getValueByIndex(column)) {\n this.frozenColumnsBasePositions[settings.fixedColumnsLeft] = column;\n }\n\n this.getMovePlugin().moveColumn(column, settings.fixedColumnsLeft++);\n }\n\n /**\n * Unfreeze the given column (remove it from fixed columns and bring to it's previous position).\n *\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'unfreezeColumn',\n value: function unfreezeColumn(column) {\n var priv = privatePool.get(this);\n var settings = this.hot.getSettings();\n\n if (!priv.afterFirstUse) {\n priv.afterFirstUse = true;\n }\n\n if (settings.fixedColumnsLeft <= 0 || column > settings.fixedColumnsLeft - 1) {\n return; // not fixed\n }\n\n var returnCol = this.getBestColumnReturnPosition(column);\n\n priv.moveByFreeze = true;\n settings.fixedColumnsLeft--;\n\n this.getMovePlugin().moveColumn(column, returnCol + 1);\n }\n\n /**\n * Get the reference to the ManualColumnMove plugin.\n *\n * @private\n * @returns {Object}\n */\n\n }, {\n key: 'getMovePlugin',\n value: function getMovePlugin() {\n if (!this.manualColumnMovePlugin) {\n this.manualColumnMovePlugin = this.hot.getPlugin('manualColumnMove');\n }\n\n return this.manualColumnMovePlugin;\n }\n\n /**\n * Estimates the most fitting return position for unfrozen column.\n *\n * @private\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'getBestColumnReturnPosition',\n value: function getBestColumnReturnPosition(column) {\n var movePlugin = this.getMovePlugin();\n var settings = this.hot.getSettings();\n var i = settings.fixedColumnsLeft;\n var j = movePlugin.columnsMapper.getValueByIndex(i);\n var initialCol = void 0;\n\n if (this.frozenColumnsBasePositions[column] == null) {\n initialCol = movePlugin.columnsMapper.getValueByIndex(column);\n\n while (j < initialCol) {\n i++;\n j = movePlugin.columnsMapper.getValueByIndex(i);\n }\n } else {\n initialCol = this.frozenColumnsBasePositions[column];\n this.frozenColumnsBasePositions[column] = void 0;\n\n while (j <= initialCol) {\n i++;\n j = movePlugin.columnsMapper.getValueByIndex(i);\n }\n i = j;\n }\n\n return i - 1;\n }\n /**\n * Add the manualColumnFreeze context menu entries.\n *\n * @private\n * @param {Object} options Context menu options.\n */\n\n }, {\n key: 'addContextMenuEntry',\n value: function addContextMenuEntry(options) {\n options.items.push({ name: '---------' }, (0, _freezeColumn2.default)(this), (0, _unfreezeColumn2.default)(this));\n }\n\n /**\n * Enabling `manualColumnMove` plugin on `afterInit` hook.\n *\n * @private\n */\n\n }, {\n key: 'onAfterInit',\n value: function onAfterInit() {\n if (!this.getMovePlugin().isEnabled()) {\n this.getMovePlugin().enablePlugin();\n }\n }\n\n /**\n * Prevent moving the rows from/to fixed area.\n *\n * @private\n * @param {Array} rows\n * @param {Number} target\n */\n\n }, {\n key: 'onBeforeColumnMove',\n value: function onBeforeColumnMove(rows, target) {\n var priv = privatePool.get(this);\n\n if (priv.afterFirstUse && !priv.moveByFreeze) {\n var frozenLen = this.hot.getSettings().fixedColumnsLeft;\n var disallowMoving = target < frozenLen;\n\n if (!disallowMoving) {\n (0, _array.arrayEach)(rows, function (value, index, array) {\n if (value < frozenLen) {\n disallowMoving = true;\n return false;\n }\n });\n }\n\n if (disallowMoving) {\n return false;\n }\n }\n\n if (priv.moveByFreeze) {\n priv.moveByFreeze = false;\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ManualColumnFreeze;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('manualColumnFreeze', ManualColumnFreeze);\n\nexports.default = ManualColumnFreeze;\n\n/***/ }),\n/* 241 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _arrayMapper = __webpack_require__(149);\n\nvar _arrayMapper2 = _interopRequireDefault(_arrayMapper);\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class ColumnsMapper\n * @plugin ManualColumnMove\n */\nvar ColumnsMapper = function () {\n function ColumnsMapper(manualColumnMove) {\n _classCallCheck(this, ColumnsMapper);\n\n /**\n * Instance of ManualColumnMove plugin.\n *\n * @type {ManualColumnMove}\n */\n this.manualColumnMove = manualColumnMove;\n }\n\n /**\n * Reset current map array and create new one.\n *\n * @param {Number} [length] Custom generated map length.\n */\n\n\n _createClass(ColumnsMapper, [{\n key: 'createMap',\n value: function createMap(length) {\n var _this = this;\n\n var originLength = length === void 0 ? this._arrayMap.length : length;\n\n this._arrayMap.length = 0;\n\n (0, _number.rangeEach)(originLength - 1, function (itemIndex) {\n _this._arrayMap[itemIndex] = itemIndex;\n });\n }\n\n /**\n * Destroy class.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._arrayMap = null;\n }\n\n /**\n * Moving elements in columnsMapper.\n *\n * @param {Number} from Column index to move.\n * @param {Number} to Target index.\n */\n\n }, {\n key: 'moveColumn',\n value: function moveColumn(from, to) {\n var indexToMove = this._arrayMap[from];\n this._arrayMap[from] = null;\n this._arrayMap.splice(to, 0, indexToMove);\n }\n\n /**\n * Clearing arrayMap from `null` entries.\n */\n\n }, {\n key: 'clearNull',\n value: function clearNull() {\n this._arrayMap = (0, _array.arrayFilter)(this._arrayMap, function (i) {\n return i !== null;\n });\n }\n }]);\n\n return ColumnsMapper;\n}();\n\n(0, _object.mixin)(ColumnsMapper, _arrayMapper2.default);\n\nexports.default = ColumnsMapper;\n\n/***/ }),\n/* 242 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _number = __webpack_require__(6);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _columnsMapper = __webpack_require__(241);\n\nvar _columnsMapper2 = _interopRequireDefault(_columnsMapper);\n\nvar _backlight = __webpack_require__(243);\n\nvar _backlight2 = _interopRequireDefault(_backlight);\n\nvar _guideline = __webpack_require__(244);\n\nvar _guideline2 = _interopRequireDefault(_guideline);\n\nvar _src = __webpack_require__(11);\n\n__webpack_require__(297);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('beforeColumnMove');\n_pluginHooks2.default.getSingleton().register('afterColumnMove');\n_pluginHooks2.default.getSingleton().register('unmodifyCol');\n\nvar privatePool = new WeakMap();\nvar CSS_PLUGIN = 'ht__manualColumnMove';\nvar CSS_SHOW_UI = 'show-ui';\nvar CSS_ON_MOVING = 'on-moving--columns';\nvar CSS_AFTER_SELECTION = 'after-selection--columns';\n\n/**\n * @plugin ManualColumnMove\n *\n * @description\n * This plugin allows to change columns order.\n *\n * API:\n * - moveColumn - move single column to the new position.\n * - moveColumns - move many columns (as an array of indexes) to the new position.\n *\n * If you want apply visual changes, you have to call manually the render() method on the instance of Handsontable.\n *\n * UI components:\n * - backlight - highlight of selected columns.\n * - guideline - line which shows where rows has been moved.\n *\n * @class ManualColumnMove\n * @plugin ManualColumnMove\n */\n\nvar ManualColumnMove = function (_BasePlugin) {\n _inherits(ManualColumnMove, _BasePlugin);\n\n function ManualColumnMove(hotInstance) {\n _classCallCheck(this, ManualColumnMove);\n\n /**\n * Set up WeakMap of plugin to sharing private parameters;\n */\n var _this = _possibleConstructorReturn(this, (ManualColumnMove.__proto__ || Object.getPrototypeOf(ManualColumnMove)).call(this, hotInstance));\n\n privatePool.set(_this, {\n columnsToMove: [],\n countCols: 0,\n fixedColumns: 0,\n pressed: void 0,\n disallowMoving: void 0,\n target: {\n eventPageX: void 0,\n coords: void 0,\n TD: void 0,\n col: void 0\n }\n });\n\n /**\n * List of last removed row indexes.\n *\n * @type {Array}\n */\n _this.removedColumns = [];\n /**\n * Object containing visual row indexes mapped to data source indexes.\n *\n * @type {RowsMapper}\n */\n _this.columnsMapper = new _columnsMapper2.default(_this);\n /**\n * Event Manager object.\n *\n * @type {Object}\n */\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Backlight UI object.\n *\n * @type {Object}\n */\n _this.backlight = new _backlight2.default(hotInstance);\n /**\n * Guideline UI object.\n *\n * @type {Object}\n */\n _this.guideline = new _guideline2.default(hotInstance);\n return _this;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualColumnMove, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().manualColumnMove;\n }\n\n /**\n * Enable the plugin.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('beforeOnCellMouseDown', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations);\n });\n this.addHook('beforeOnCellMouseOver', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations);\n });\n this.addHook('afterScrollVertically', function () {\n return _this2.onAfterScrollVertically();\n });\n this.addHook('modifyCol', function (row, source) {\n return _this2.onModifyCol(row, source);\n });\n this.addHook('beforeRemoveCol', function (index, amount) {\n return _this2.onBeforeRemoveCol(index, amount);\n });\n this.addHook('afterRemoveCol', function (index, amount) {\n return _this2.onAfterRemoveCol(index, amount);\n });\n this.addHook('afterCreateCol', function (index, amount) {\n return _this2.onAfterCreateCol(index, amount);\n });\n this.addHook('afterLoadData', function (firstTime) {\n return _this2.onAfterLoadData(firstTime);\n });\n this.addHook('unmodifyCol', function (column) {\n return _this2.onUnmodifyCol(column);\n });\n\n this.registerEvents();\n\n // TODO: move adding plugin classname to BasePlugin.\n (0, _element.addClass)(this.hot.rootElement, CSS_PLUGIN);\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.onAfterPluginsInitialized();\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n var pluginSettings = this.hot.getSettings().manualColumnMove;\n\n if (Array.isArray(pluginSettings)) {\n this.columnsMapper.clearMap();\n }\n\n (0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);\n\n this.unregisterEvents();\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Move a single column.\n *\n * @param {Number} column Visual column index to be moved.\n * @param {Number} target Visual column index being a target for the moved column.\n */\n\n }, {\n key: 'moveColumn',\n value: function moveColumn(column, target) {\n this.moveColumns([column], target);\n }\n\n /**\n * Move multiple columns.\n *\n * @param {Array} columns Array of visual column indexes to be moved.\n * @param {Number} target Visual column index being a target for the moved columns.\n */\n\n }, {\n key: 'moveColumns',\n value: function moveColumns(columns, target) {\n var _this3 = this;\n\n var priv = privatePool.get(this);\n var beforeColumnHook = this.hot.runHooks('beforeColumnMove', columns, target);\n\n priv.disallowMoving = !beforeColumnHook;\n\n if (beforeColumnHook !== false) {\n // first we need to rewrite an visual indexes to logical for save reference after move\n (0, _array.arrayEach)(columns, function (column, index, array) {\n array[index] = _this3.columnsMapper.getValueByIndex(column);\n });\n\n // next, when we have got an logical indexes, we can move columns\n (0, _array.arrayEach)(columns, function (column, index) {\n var actualPosition = _this3.columnsMapper.getIndexByValue(column);\n\n if (actualPosition !== target) {\n _this3.columnsMapper.moveColumn(actualPosition, target + index);\n }\n });\n\n // after moving we have to clear columnsMapper from null entries\n this.columnsMapper.clearNull();\n }\n\n this.hot.runHooks('afterColumnMove', columns, target);\n }\n\n /**\n * Correct the cell selection after the move action. Fired only when action was made with a mouse.\n * That means that changing the column order using the API won't correct the selection.\n *\n * @private\n * @param {Number} startColumn Visual column index for the start of the selection.\n * @param {Number} endColumn Visual column index for the end of the selection.\n */\n\n }, {\n key: 'changeSelection',\n value: function changeSelection(startColumn, endColumn) {\n var selection = this.hot.selection;\n var lastRowIndex = this.hot.countRows() - 1;\n\n selection.setRangeStartOnly(new _src.CellCoords(0, startColumn));\n selection.setRangeEnd(new _src.CellCoords(lastRowIndex, endColumn), false);\n }\n\n /**\n * Get the sum of the widths of columns in the provided range.\n *\n * @private\n * @param {Number} from Visual column index.\n * @param {Number} to Visual column index.\n * @returns {Number}\n */\n\n }, {\n key: 'getColumnsWidth',\n value: function getColumnsWidth(from, to) {\n var width = 0;\n\n for (var i = from; i < to; i++) {\n var columnWidth = 0;\n\n if (i < 0) {\n columnWidth = this.hot.view.wt.wtTable.getColumnWidth(i) || 0;\n } else {\n columnWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(i) || 0;\n }\n\n width += columnWidth;\n }\n\n return width;\n }\n\n /**\n * Load initial settings when persistent state is saved or when plugin was initialized as an array.\n *\n * @private\n */\n\n }, {\n key: 'initialSettings',\n value: function initialSettings() {\n var pluginSettings = this.hot.getSettings().manualColumnMove;\n\n if (Array.isArray(pluginSettings)) {\n this.moveColumns(pluginSettings, 0);\n } else if (pluginSettings !== void 0) {\n this.persistentStateLoad();\n }\n }\n\n /**\n * Check if the provided column is in the fixedColumnsLeft section.\n *\n * @private\n * @param {Number} column Visual column index to check.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFixedColumnsLeft',\n value: function isFixedColumnsLeft(column) {\n return column < this.hot.getSettings().fixedColumnsLeft;\n }\n\n /**\n * Save the manual column positions to the persistent state.\n *\n * @private\n */\n\n }, {\n key: 'persistentStateSave',\n value: function persistentStateSave() {\n this.hot.runHooks('persistentStateSave', 'manualColumnMove', this.columnsMapper._arrayMap);\n }\n\n /**\n * Load the manual column positions from the persistent state.\n *\n * @private\n */\n\n }, {\n key: 'persistentStateLoad',\n value: function persistentStateLoad() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualColumnMove', storedState);\n\n if (storedState.value) {\n this.columnsMapper._arrayMap = storedState.value;\n }\n }\n\n /**\n * Prepare array of indexes based on actual selection.\n *\n * @private\n * @returns {Array}\n */\n\n }, {\n key: 'prepareColumnsToMoving',\n value: function prepareColumnsToMoving(start, end) {\n var selectedColumns = [];\n\n (0, _number.rangeEach)(start, end, function (i) {\n selectedColumns.push(i);\n });\n\n return selectedColumns;\n }\n\n /**\n * Update the UI visual position.\n *\n * @private\n */\n\n }, {\n key: 'refreshPositions',\n value: function refreshPositions() {\n var priv = privatePool.get(this);\n var firstVisible = this.hot.view.wt.wtTable.getFirstVisibleColumn();\n var lastVisible = this.hot.view.wt.wtTable.getLastVisibleColumn();\n var wtTable = this.hot.view.wt.wtTable;\n var scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement;\n var scrollLeft = typeof scrollableElement.scrollX === 'number' ? scrollableElement.scrollX : scrollableElement.scrollLeft;\n var tdOffsetLeft = this.hot.view.THEAD.offsetLeft + this.getColumnsWidth(0, priv.coordsColumn);\n var mouseOffsetLeft = priv.target.eventPageX - (priv.rootElementOffset - (scrollableElement.scrollX === void 0 ? scrollLeft : 0));\n var hiderWidth = wtTable.hider.offsetWidth;\n var tbodyOffsetLeft = wtTable.TBODY.offsetLeft;\n var backlightElemMarginLeft = this.backlight.getOffset().left;\n var backlightElemWidth = this.backlight.getSize().width;\n var rowHeaderWidth = 0;\n\n if (priv.rootElementOffset + wtTable.holder.offsetWidth + scrollLeft < priv.target.eventPageX) {\n if (priv.coordsColumn < priv.countCols) {\n priv.coordsColumn++;\n }\n }\n\n if (priv.hasRowHeaders) {\n rowHeaderWidth = this.hot.view.wt.wtOverlays.leftOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth;\n }\n if (this.isFixedColumnsLeft(priv.coordsColumn)) {\n tdOffsetLeft += scrollLeft;\n }\n tdOffsetLeft += rowHeaderWidth;\n\n if (priv.coordsColumn < 0) {\n // if hover on rowHeader\n if (priv.fixedColumns > 0) {\n priv.target.col = 0;\n } else {\n priv.target.col = firstVisible > 0 ? firstVisible - 1 : firstVisible;\n }\n } else if (priv.target.TD.offsetWidth / 2 + tdOffsetLeft <= mouseOffsetLeft) {\n var newCoordsCol = priv.coordsColumn >= priv.countCols ? priv.countCols - 1 : priv.coordsColumn;\n // if hover on right part of TD\n priv.target.col = newCoordsCol + 1;\n // unfortunately first column is bigger than rest\n tdOffsetLeft += priv.target.TD.offsetWidth;\n\n if (priv.target.col > lastVisible) {\n this.hot.scrollViewportTo(void 0, lastVisible + 1, void 0, true);\n }\n } else {\n // elsewhere on table\n priv.target.col = priv.coordsColumn;\n\n if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns) {\n this.hot.scrollViewportTo(void 0, firstVisible - 1);\n }\n }\n\n if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns) {\n this.hot.scrollViewportTo(void 0, firstVisible - 1);\n }\n\n var backlightLeft = mouseOffsetLeft;\n var guidelineLeft = tdOffsetLeft;\n\n if (mouseOffsetLeft + backlightElemWidth + backlightElemMarginLeft >= hiderWidth) {\n // prevent display backlight on the right side of the table\n backlightLeft = hiderWidth - backlightElemWidth - backlightElemMarginLeft;\n } else if (mouseOffsetLeft + backlightElemMarginLeft < tbodyOffsetLeft + rowHeaderWidth) {\n // prevent display backlight on the left side of the table\n backlightLeft = tbodyOffsetLeft + rowHeaderWidth + Math.abs(backlightElemMarginLeft);\n }\n\n if (tdOffsetLeft >= hiderWidth - 1) {\n // prevent display guideline outside the table\n guidelineLeft = hiderWidth - 1;\n } else if (guidelineLeft === 0) {\n // guideline has got `margin-left: -1px` as default\n guidelineLeft = 1;\n } else if (scrollableElement.scrollX !== void 0 && priv.coordsColumn < priv.fixedColumns) {\n guidelineLeft -= priv.rootElementOffset <= scrollableElement.scrollX ? priv.rootElementOffset : 0;\n }\n\n this.backlight.setPosition(null, backlightLeft);\n this.guideline.setPosition(null, guidelineLeft);\n }\n\n /**\n * This method checks arrayMap from columnsMapper and updates the columnsMapper if it's necessary.\n *\n * @private\n */\n\n }, {\n key: 'updateColumnsMapper',\n value: function updateColumnsMapper() {\n var countCols = this.hot.countSourceCols();\n var columnsMapperLen = this.columnsMapper._arrayMap.length;\n\n if (columnsMapperLen === 0) {\n this.columnsMapper.createMap(countCols || this.hot.getSettings().startCols);\n } else if (columnsMapperLen < countCols) {\n var diff = countCols - columnsMapperLen;\n\n this.columnsMapper.insertItems(columnsMapperLen, diff);\n } else if (columnsMapperLen > countCols) {\n var maxIndex = countCols - 1;\n var columnsToRemove = [];\n\n (0, _array.arrayEach)(this.columnsMapper._arrayMap, function (value, index, array) {\n if (value > maxIndex) {\n columnsToRemove.push(index);\n }\n });\n\n this.columnsMapper.removeItems(columnsToRemove);\n }\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this4 = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mousemove', function (event) {\n return _this4.onMouseMove(event);\n });\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function () {\n return _this4.onMouseUp();\n });\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'unregisterEvents',\n value: function unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * Change the behavior of selection / dragging.\n *\n * @private\n * @param {MouseEvent} event\n * @param {CellCoords} coords\n * @param {HTMLElement} TD\n * @param {Object} blockCalculations\n */\n\n }, {\n key: 'onBeforeOnCellMouseDown',\n value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) {\n var wtTable = this.hot.view.wt.wtTable;\n var isHeaderSelection = this.hot.selection.selectedHeader.cols;\n var selection = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n var isSortingElement = event.realTarget.className.indexOf('columnSorting') > -1;\n\n if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0 || isSortingElement) {\n priv.pressed = false;\n priv.columnsToMove.length = 0;\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);\n return;\n }\n\n var guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended();\n var backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended();\n\n if (guidelineIsNotReady && backlightIsNotReady) {\n this.guideline.appendTo(wtTable.hider);\n this.backlight.appendTo(wtTable.hider);\n }\n\n var from = selection.from,\n to = selection.to;\n\n var start = Math.min(from.col, to.col);\n var end = Math.max(from.col, to.col);\n\n if (coords.row < 0 && coords.col >= start && coords.col <= end) {\n blockCalculations.column = true;\n priv.pressed = true;\n priv.target.eventPageX = event.pageX;\n priv.coordsColumn = coords.col;\n priv.target.TD = TD;\n priv.target.col = coords.col;\n priv.columnsToMove = this.prepareColumnsToMoving(start, end);\n priv.hasRowHeaders = !!this.hot.getSettings().rowHeaders;\n priv.countCols = this.hot.countCols();\n priv.fixedColumns = this.hot.getSettings().fixedColumnsLeft;\n priv.rootElementOffset = (0, _element.offset)(this.hot.rootElement).left;\n\n var countColumnsFrom = priv.hasRowHeaders ? -1 : 0;\n var topPos = wtTable.holder.scrollTop + wtTable.getColumnHeaderHeight(0) + 1;\n var fixedColumns = coords.col < priv.fixedColumns;\n var scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement;\n var wrapperIsWindow = scrollableElement.scrollX ? scrollableElement.scrollX - priv.rootElementOffset : 0;\n\n var mouseOffset = event.layerX - (fixedColumns ? wrapperIsWindow : 0);\n var leftOffset = Math.abs(this.getColumnsWidth(start, coords.col) + mouseOffset);\n\n this.backlight.setPosition(topPos, this.getColumnsWidth(countColumnsFrom, start) + leftOffset);\n this.backlight.setSize(this.getColumnsWidth(start, end + 1), wtTable.hider.offsetHeight - topPos);\n this.backlight.setOffset(null, leftOffset * -1);\n\n (0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);\n } else {\n (0, _element.removeClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n priv.pressed = false;\n priv.columnsToMove.length = 0;\n }\n }\n\n /**\n * 'mouseMove' event callback. Fired when pointer move on document.documentElement.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var priv = privatePool.get(this);\n\n if (!priv.pressed) {\n return;\n }\n\n // callback for browser which doesn't supports CSS pointer-event: none\n if (event.realTarget === this.backlight.element) {\n var width = this.backlight.getSize().width;\n this.backlight.setSize(0);\n\n setTimeout(function () {\n this.backlight.setPosition(width);\n });\n }\n\n priv.target.eventPageX = event.pageX;\n this.refreshPositions();\n }\n\n /**\n * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell.\n *\n * @private\n * @param {MouseEvent} event `mouseover` event properties.\n * @param {CellCoords} coords Cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n\n }, {\n key: 'onBeforeOnCellMouseOver',\n value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) {\n var selectedRange = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n\n if (!selectedRange || !priv.pressed) {\n return;\n }\n\n if (priv.columnsToMove.indexOf(coords.col) > -1) {\n (0, _element.removeClass)(this.hot.rootElement, CSS_SHOW_UI);\n } else {\n (0, _element.addClass)(this.hot.rootElement, CSS_SHOW_UI);\n }\n\n blockCalculations.row = true;\n blockCalculations.column = true;\n blockCalculations.cell = true;\n priv.coordsColumn = coords.col;\n priv.target.TD = TD;\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n var priv = privatePool.get(this);\n\n priv.coordsColumn = void 0;\n priv.pressed = false;\n priv.backlightWidth = 0;\n\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]);\n\n if (this.hot.selection.selectedHeader.cols) {\n (0, _element.addClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n }\n if (priv.columnsToMove.length < 1 || priv.target.col === void 0 || priv.columnsToMove.indexOf(priv.target.col) > -1) {\n return;\n }\n\n this.moveColumns(priv.columnsToMove, priv.target.col);\n this.persistentStateSave();\n this.hot.render();\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n\n if (!priv.disallowMoving) {\n var selectionStart = this.columnsMapper.getIndexByValue(priv.columnsToMove[0]);\n var selectionEnd = this.columnsMapper.getIndexByValue(priv.columnsToMove[priv.columnsToMove.length - 1]);\n this.changeSelection(selectionStart, selectionEnd);\n }\n\n priv.columnsToMove.length = 0;\n }\n\n /**\n * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally.\n *\n * @private\n */\n\n }, {\n key: 'onAfterScrollVertically',\n value: function onAfterScrollVertically() {\n var wtTable = this.hot.view.wt.wtTable;\n var headerHeight = wtTable.getColumnHeaderHeight(0) + 1;\n var scrollTop = wtTable.holder.scrollTop;\n var posTop = headerHeight + scrollTop;\n\n this.backlight.setPosition(posTop);\n this.backlight.setSize(null, wtTable.hider.offsetHeight - posTop);\n }\n\n /**\n * `afterCreateCol` hook callback.\n *\n * @private\n * @param {Number} index Index of the created column.\n * @param {Number} amount Amount of created columns.\n */\n\n }, {\n key: 'onAfterCreateCol',\n value: function onAfterCreateCol(index, amount) {\n this.columnsMapper.shiftItems(index, amount);\n }\n\n /**\n * On before remove column listener.\n *\n * @private\n * @param {Number} index Column index.\n * @param {Number} amount Defines how many columns removed.\n */\n\n }, {\n key: 'onBeforeRemoveCol',\n value: function onBeforeRemoveCol(index, amount) {\n var _this5 = this;\n\n this.removedColumns.length = 0;\n\n if (index !== false) {\n // Collect physical row index.\n (0, _number.rangeEach)(index, index + amount - 1, function (removedIndex) {\n _this5.removedColumns.push(_this5.hot.runHooks('modifyCol', removedIndex, _this5.pluginName));\n });\n }\n }\n\n /**\n * `afterRemoveCol` hook callback.\n *\n * @private\n * @param {Number} index Index of the removed column.\n * @param {Number} amount Amount of removed columns.\n */\n\n }, {\n key: 'onAfterRemoveCol',\n value: function onAfterRemoveCol(index, amount) {\n this.columnsMapper.unshiftItems(this.removedColumns);\n }\n\n /**\n * `afterLoadData` hook callback.\n *\n * @private\n * @param {Boolean} firstTime True if that was loading data during the initialization.\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData(firstTime) {\n this.updateColumnsMapper();\n }\n\n /**\n * 'modifyRow' hook callback.\n *\n * @private\n * @param {Number} column Visual column index.\n * @returns {Number} Modified column index.\n */\n\n }, {\n key: 'onModifyCol',\n value: function onModifyCol(column, source) {\n if (source !== this.pluginName) {\n // ugly fix for try to insert new, needed columns after pasting data\n var columnInMapper = this.columnsMapper.getValueByIndex(column);\n column = columnInMapper === null ? column : columnInMapper;\n }\n\n return column;\n }\n\n /**\n * 'unmodifyCol' hook callback.\n *\n * @private\n * @param {Number} column Visual column index.\n * @returns {Number} Logical column index.\n */\n\n }, {\n key: 'onUnmodifyCol',\n value: function onUnmodifyCol(column) {\n var indexInMapper = this.columnsMapper.getIndexByValue(column);\n\n return indexInMapper === null ? column : indexInMapper;\n }\n\n /**\n * `afterPluginsInitialized` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onAfterPluginsInitialized',\n value: function onAfterPluginsInitialized() {\n this.updateColumnsMapper();\n this.initialSettings();\n this.backlight.build();\n this.guideline.build();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ManualColumnMove;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('ManualColumnMove', ManualColumnMove);\n\nexports.default = ManualColumnMove;\n\n/***/ }),\n/* 243 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(151);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualColumnMove--backlight';\n\n/**\n * @class BacklightUI\n * @util\n */\n\nvar BacklightUI = function (_BaseUI) {\n _inherits(BacklightUI, _BaseUI);\n\n function BacklightUI() {\n _classCallCheck(this, BacklightUI);\n\n return _possibleConstructorReturn(this, (BacklightUI.__proto__ || Object.getPrototypeOf(BacklightUI)).apply(this, arguments));\n }\n\n _createClass(BacklightUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(BacklightUI.prototype.__proto__ || Object.getPrototypeOf(BacklightUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return BacklightUI;\n}(_base2.default);\n\nexports.default = BacklightUI;\n\n/***/ }),\n/* 244 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(151);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualColumnMove--guideline';\n\n/**\n * @class GuidelineUI\n * @util\n */\n\nvar GuidelineUI = function (_BaseUI) {\n _inherits(GuidelineUI, _BaseUI);\n\n function GuidelineUI() {\n _classCallCheck(this, GuidelineUI);\n\n return _possibleConstructorReturn(this, (GuidelineUI.__proto__ || Object.getPrototypeOf(GuidelineUI)).apply(this, arguments));\n }\n\n _createClass(GuidelineUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(GuidelineUI.prototype.__proto__ || Object.getPrototypeOf(GuidelineUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return GuidelineUI;\n}(_base2.default);\n\nexports.default = GuidelineUI;\n\n/***/ }),\n/* 245 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _event = __webpack_require__(7);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js\n\n/**\n * @description\n * ManualColumnResize Plugin.\n *\n * Has 2 UI components:\n * - handle - the draggable element that sets the desired width of the column.\n * - guide - the helper guide that shows the desired width as a vertical guide.\n *\n * @plugin ManualColumnResize\n */\nvar ManualColumnResize = function (_BasePlugin) {\n _inherits(ManualColumnResize, _BasePlugin);\n\n function ManualColumnResize(hotInstance) {\n _classCallCheck(this, ManualColumnResize);\n\n var _this = _possibleConstructorReturn(this, (ManualColumnResize.__proto__ || Object.getPrototypeOf(ManualColumnResize)).call(this, hotInstance));\n\n _this.currentTH = null;\n _this.currentCol = null;\n _this.selectedCols = [];\n _this.currentWidth = null;\n _this.newSize = null;\n _this.startY = null;\n _this.startWidth = null;\n _this.startOffset = null;\n _this.handle = document.createElement('DIV');\n _this.guide = document.createElement('DIV');\n _this.eventManager = new _eventManager2.default(_this);\n _this.pressed = null;\n _this.dblclick = 0;\n _this.autoresizeTimeout = null;\n _this.manualColumnWidths = [];\n\n (0, _element.addClass)(_this.handle, 'manualColumnResizer');\n (0, _element.addClass)(_this.guide, 'manualColumnResizerGuide');\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualColumnResize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().manualColumnResize;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.manualColumnWidths = [];\n var initialColumnWidth = this.hot.getSettings().manualColumnResize;\n var loadedManualColumnWidths = this.loadManualColumnWidths();\n\n this.addHook('modifyColWidth', function (width, col) {\n return _this2.onModifyColWidth(width, col);\n });\n this.addHook('beforeStretchingColumnWidth', function (stretchedWidth, column) {\n return _this2.onBeforeStretchingColumnWidth(stretchedWidth, column);\n });\n this.addHook('beforeColumnResize', function (currentColumn, newSize, isDoubleClick) {\n return _this2.onBeforeColumnResize(currentColumn, newSize, isDoubleClick);\n });\n\n if (typeof loadedManualColumnWidths != 'undefined') {\n this.manualColumnWidths = loadedManualColumnWidths;\n } else if (Array.isArray(initialColumnWidth)) {\n this.manualColumnWidths = initialColumnWidth;\n } else {\n this.manualColumnWidths = [];\n }\n\n // Handsontable.hooks.register('beforeColumnResize');\n // Handsontable.hooks.register('afterColumnResize');\n\n this.bindEvents();\n\n _get(ManualColumnResize.prototype.__proto__ || Object.getPrototypeOf(ManualColumnResize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n var initialColumnWidth = this.hot.getSettings().manualColumnResize;\n\n if (Array.isArray(initialColumnWidth)) {\n this.manualColumnWidths = initialColumnWidth;\n } else if (!initialColumnWidth) {\n this.manualColumnWidths = [];\n }\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(ManualColumnResize.prototype.__proto__ || Object.getPrototypeOf(ManualColumnResize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Save the current sizes using the persistentState plugin.\n */\n\n }, {\n key: 'saveManualColumnWidths',\n value: function saveManualColumnWidths() {\n this.hot.runHooks('persistentStateSave', 'manualColumnWidths', this.manualColumnWidths);\n }\n\n /**\n * Load the previously saved sizes using the persistentState plugin.\n *\n * @returns {Array}\n */\n\n }, {\n key: 'loadManualColumnWidths',\n value: function loadManualColumnWidths() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualColumnWidths', storedState);\n\n return storedState.value;\n }\n\n /**\n * Set the resize handle position.\n *\n * @param {HTMLCellElement} TH TH HTML element.\n */\n\n }, {\n key: 'setupHandlePosition',\n value: function setupHandlePosition(TH) {\n var _this3 = this;\n\n if (!TH.parentNode) {\n return false;\n }\n\n this.currentTH = TH;\n\n var col = this.hot.view.wt.wtTable.getCoords(TH).col; // getCoords returns CellCoords\n var headerHeight = (0, _element.outerHeight)(this.currentTH);\n\n if (col >= 0) {\n // if not col header\n var box = this.currentTH.getBoundingClientRect();\n\n this.currentCol = col;\n this.selectedCols = [];\n\n if (this.hot.selection.isSelected() && this.hot.selection.selectedHeader.cols) {\n var _hot$getSelectedRange = this.hot.getSelectedRange(),\n from = _hot$getSelectedRange.from,\n to = _hot$getSelectedRange.to;\n\n var start = from.col;\n var end = to.col;\n\n if (start >= end) {\n start = to.col;\n end = from.col;\n }\n\n if (this.currentCol >= start && this.currentCol <= end) {\n (0, _number.rangeEach)(start, end, function (i) {\n return _this3.selectedCols.push(i);\n });\n } else {\n this.selectedCols.push(this.currentCol);\n }\n } else {\n this.selectedCols.push(this.currentCol);\n }\n\n this.startOffset = box.left - 6;\n this.startWidth = parseInt(box.width, 10);\n this.handle.style.top = box.top + 'px';\n this.handle.style.left = this.startOffset + this.startWidth + 'px';\n this.handle.style.height = headerHeight + 'px';\n this.hot.rootElement.appendChild(this.handle);\n }\n }\n\n /**\n * Refresh the resize handle position.\n */\n\n }, {\n key: 'refreshHandlePosition',\n value: function refreshHandlePosition() {\n this.handle.style.left = this.startOffset + this.currentWidth + 'px';\n }\n\n /**\n * Set the resize guide position.\n */\n\n }, {\n key: 'setupGuidePosition',\n value: function setupGuidePosition() {\n var handleHeight = parseInt((0, _element.outerHeight)(this.handle), 10);\n var handleBottomPosition = parseInt(this.handle.style.top, 10) + handleHeight;\n var maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);\n\n (0, _element.addClass)(this.handle, 'active');\n (0, _element.addClass)(this.guide, 'active');\n\n this.guide.style.top = handleBottomPosition + 'px';\n this.guide.style.left = this.handle.style.left;\n this.guide.style.height = maximumVisibleElementHeight - handleHeight + 'px';\n this.hot.rootElement.appendChild(this.guide);\n }\n\n /**\n * Refresh the resize guide position.\n */\n\n }, {\n key: 'refreshGuidePosition',\n value: function refreshGuidePosition() {\n this.guide.style.left = this.handle.style.left;\n }\n\n /**\n * Hide both the resize handle and resize guide.\n */\n\n }, {\n key: 'hideHandleAndGuide',\n value: function hideHandleAndGuide() {\n (0, _element.removeClass)(this.handle, 'active');\n (0, _element.removeClass)(this.guide, 'active');\n }\n\n /**\n * Check if provided element is considered a column header.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {Boolean}\n */\n\n }, {\n key: 'checkIfColumnHeader',\n value: function checkIfColumnHeader(element) {\n if (element != this.hot.rootElement) {\n var parent = element.parentNode;\n\n if (parent.tagName === 'THEAD') {\n return true;\n }\n\n return this.checkIfColumnHeader(parent);\n }\n\n return false;\n }\n\n /**\n * Get the TH element from the provided element.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'getTHFromTargetElement',\n value: function getTHFromTargetElement(element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH') {\n return element;\n }\n return this.getTHFromTargetElement(element.parentNode);\n }\n\n return null;\n }\n\n /**\n * 'mouseover' event callback - set the handle position.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n if (this.checkIfColumnHeader(event.target)) {\n var th = this.getTHFromTargetElement(event.target);\n\n if (!th) {\n return;\n }\n\n var colspan = th.getAttribute('colspan');\n\n if (th && (colspan === null || colspan === 1)) {\n if (!this.pressed) {\n this.setupHandlePosition(th);\n }\n }\n }\n }\n\n /**\n * Auto-size row after doubleclick - callback.\n *\n * @private\n */\n\n }, {\n key: 'afterMouseDownTimeout',\n value: function afterMouseDownTimeout() {\n var _this4 = this;\n\n var render = function render() {\n _this4.hot.forceFullRender = true;\n _this4.hot.view.render(); // updates all\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var resize = function resize(selectedCol, forceRender) {\n var hookNewSize = _this4.hot.runHooks('beforeColumnResize', selectedCol, _this4.newSize, true);\n\n if (hookNewSize !== void 0) {\n _this4.newSize = hookNewSize;\n }\n\n if (_this4.hot.getSettings().stretchH === 'all') {\n _this4.clearManualSize(selectedCol);\n } else {\n _this4.setManualSize(selectedCol, _this4.newSize); // double click sets by auto row size plugin\n }\n\n if (forceRender) {\n render();\n }\n\n _this4.saveManualColumnWidths();\n\n _this4.hot.runHooks('afterColumnResize', selectedCol, _this4.newSize, true);\n };\n\n if (this.dblclick >= 2) {\n var selectedColsLength = this.selectedCols.length;\n\n if (selectedColsLength > 1) {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol, true);\n });\n }\n }\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n }\n\n /**\n * 'mousedown' event callback.\n *\n * @private\n * @param {MouseEvent} e\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown(event) {\n var _this5 = this;\n\n if ((0, _element.hasClass)(event.target, 'manualColumnResizer')) {\n this.setupGuidePosition();\n this.pressed = this.hot;\n\n if (this.autoresizeTimeout === null) {\n this.autoresizeTimeout = setTimeout(function () {\n return _this5.afterMouseDownTimeout();\n }, 500);\n\n this.hot._registerTimeout(this.autoresizeTimeout);\n }\n this.dblclick++;\n\n this.startX = (0, _event.pageX)(event);\n this.newSize = this.startWidth;\n }\n }\n\n /**\n * 'mousemove' event callback - refresh the handle and guide positions, cache the new column width.\n *\n * @private\n * @param {MouseEvent} e\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var _this6 = this;\n\n if (this.pressed) {\n this.currentWidth = this.startWidth + ((0, _event.pageX)(event) - this.startX);\n\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n _this6.newSize = _this6.setManualSize(selectedCol, _this6.currentWidth);\n });\n\n this.refreshHandlePosition();\n this.refreshGuidePosition();\n }\n }\n\n /**\n * 'mouseup' event callback - apply the column resizing.\n *\n * @private\n * @param {MouseEvent} e\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n var _this7 = this;\n\n var render = function render() {\n _this7.hot.forceFullRender = true;\n _this7.hot.view.render(); // updates all\n _this7.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var resize = function resize(selectedCol, forceRender) {\n _this7.hot.runHooks('beforeColumnResize', selectedCol, _this7.newSize);\n\n if (forceRender) {\n render();\n }\n\n _this7.saveManualColumnWidths();\n\n _this7.hot.runHooks('afterColumnResize', selectedCol, _this7.newSize);\n };\n\n if (this.pressed) {\n this.hideHandleAndGuide();\n this.pressed = false;\n\n if (this.newSize != this.startWidth) {\n var selectedColsLength = this.selectedCols.length;\n\n if (selectedColsLength > 1) {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol, true);\n });\n }\n }\n\n this.setupHandlePosition(this.currentTH);\n }\n }\n\n /**\n * Bind the mouse events.\n *\n * @private\n */\n\n }, {\n key: 'bindEvents',\n value: function bindEvents() {\n var _this8 = this;\n\n this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', function (e) {\n return _this8.onMouseOver(e);\n });\n this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', function (e) {\n return _this8.onMouseDown(e);\n });\n this.eventManager.addEventListener(window, 'mousemove', function (e) {\n return _this8.onMouseMove(e);\n });\n this.eventManager.addEventListener(window, 'mouseup', function (e) {\n return _this8.onMouseUp(e);\n });\n }\n\n /**\n * Cache the current column width.\n *\n * @param {Number} column Column index.\n * @param {Number} width Column width.\n * @returns {Number}\n */\n\n }, {\n key: 'setManualSize',\n value: function setManualSize(column, width) {\n width = Math.max(width, 20);\n\n /**\n * We need to run col through modifyCol hook, in case the order of displayed columns is different than the order\n * in data source. For instance, this order can be modified by manualColumnMove plugin.\n */\n column = this.hot.runHooks('modifyCol', column);\n\n this.manualColumnWidths[column] = width;\n\n return width;\n }\n\n /**\n * Clear cache for the current column index.\n *\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'clearManualSize',\n value: function clearManualSize(column) {\n column = this.hot.runHooks('modifyCol', column);\n\n this.manualColumnWidths[column] = void 0;\n }\n\n /**\n * Modify the provided column width, based on the plugin settings\n *\n * @private\n * @param {Number} width Column width.\n * @param {Number} column Column index.\n * @returns {Number}\n */\n\n }, {\n key: 'onModifyColWidth',\n value: function onModifyColWidth(width, column) {\n if (this.enabled) {\n column = this.hot.runHooks('modifyCol', column);\n\n if (this.hot.getSettings().manualColumnResize && this.manualColumnWidths[column]) {\n return this.manualColumnWidths[column];\n }\n }\n\n return width;\n }\n\n /**\n * Modify the provided column stretched width. This hook decides if specified column should be stretched or not.\n *\n * @private\n * @param {Number} stretchedWidth Stretched width.\n * @param {Number} column Column index.\n * @returns {Number}\n */\n\n }, {\n key: 'onBeforeStretchingColumnWidth',\n value: function onBeforeStretchingColumnWidth(stretchedWidth, column) {\n var width = this.manualColumnWidths[column];\n\n if (width === void 0) {\n width = stretchedWidth;\n }\n\n return width;\n }\n\n /**\n * `beforeColumnResize` hook callback.\n *\n * @private\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n\n }, {\n key: 'onBeforeColumnResize',\n value: function onBeforeColumnResize() {\n // clear the header height cache information\n this.hot.view.wt.wtViewport.hasOversizedColumnHeadersMarked = {};\n }\n }]);\n\n return ManualColumnResize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('manualColumnResize', ManualColumnResize);\n\nexports.default = ManualColumnResize;\n\n/***/ }),\n/* 246 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _number = __webpack_require__(6);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _rowsMapper = __webpack_require__(247);\n\nvar _rowsMapper2 = _interopRequireDefault(_rowsMapper);\n\nvar _backlight = __webpack_require__(248);\n\nvar _backlight2 = _interopRequireDefault(_backlight);\n\nvar _guideline = __webpack_require__(249);\n\nvar _guideline2 = _interopRequireDefault(_guideline);\n\nvar _src = __webpack_require__(11);\n\n__webpack_require__(298);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('beforeRowMove');\n_pluginHooks2.default.getSingleton().register('afterRowMove');\n_pluginHooks2.default.getSingleton().register('unmodifyRow');\n\nvar privatePool = new WeakMap();\nvar CSS_PLUGIN = 'ht__manualRowMove';\nvar CSS_SHOW_UI = 'show-ui';\nvar CSS_ON_MOVING = 'on-moving--rows';\nvar CSS_AFTER_SELECTION = 'after-selection--rows';\n\n/**\n * @plugin ManualRowMove\n *\n * @description\n * This plugin allows to change rows order.\n *\n * API:\n * - moveRow - move single row to the new position.\n * - moveRows - move many rows (as an array of indexes) to the new position.\n *\n * If you want apply visual changes, you have to call manually the render() method on the instance of handsontable.\n *\n * UI components:\n * - backlight - highlight of selected rows.\n * - guideline - line which shows where rows has been moved.\n *\n * @class ManualRowMove\n * @plugin ManualRowMove\n */\n\nvar ManualRowMove = function (_BasePlugin) {\n _inherits(ManualRowMove, _BasePlugin);\n\n function ManualRowMove(hotInstance) {\n _classCallCheck(this, ManualRowMove);\n\n /**\n * Set up WeakMap of plugin to sharing private parameters;\n */\n var _this = _possibleConstructorReturn(this, (ManualRowMove.__proto__ || Object.getPrototypeOf(ManualRowMove)).call(this, hotInstance));\n\n privatePool.set(_this, {\n rowsToMove: [],\n pressed: void 0,\n disallowMoving: void 0,\n target: {\n eventPageY: void 0,\n coords: void 0,\n TD: void 0,\n row: void 0\n }\n });\n\n /**\n * List of last removed row indexes.\n *\n * @type {Array}\n */\n _this.removedRows = [];\n /**\n * Object containing visual row indexes mapped to data source indexes.\n *\n * @type {RowsMapper}\n */\n _this.rowsMapper = new _rowsMapper2.default(_this);\n /**\n * Event Manager object.\n *\n * @type {Object}\n */\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Backlight UI object.\n *\n * @type {Object}\n */\n _this.backlight = new _backlight2.default(hotInstance);\n /**\n * Guideline UI object.\n *\n * @type {Object}\n */\n _this.guideline = new _guideline2.default(hotInstance);\n return _this;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualRowMove, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().manualRowMove;\n }\n\n /**\n * Enable the plugin.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('beforeOnCellMouseDown', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations);\n });\n this.addHook('beforeOnCellMouseOver', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations);\n });\n this.addHook('afterScrollHorizontally', function () {\n return _this2.onAfterScrollHorizontally();\n });\n this.addHook('modifyRow', function (row, source) {\n return _this2.onModifyRow(row, source);\n });\n this.addHook('beforeRemoveRow', function (index, amount) {\n return _this2.onBeforeRemoveRow(index, amount);\n });\n this.addHook('afterRemoveRow', function (index, amount) {\n return _this2.onAfterRemoveRow(index, amount);\n });\n this.addHook('afterCreateRow', function (index, amount) {\n return _this2.onAfterCreateRow(index, amount);\n });\n this.addHook('afterLoadData', function (firstTime) {\n return _this2.onAfterLoadData(firstTime);\n });\n this.addHook('beforeColumnSort', function (column, order) {\n return _this2.onBeforeColumnSort(column, order);\n });\n this.addHook('unmodifyRow', function (row) {\n return _this2.onUnmodifyRow(row);\n });\n\n this.registerEvents();\n\n // TODO: move adding plugin classname to BasePlugin.\n (0, _element.addClass)(this.hot.rootElement, CSS_PLUGIN);\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.onAfterPluginsInitialized();\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n var pluginSettings = this.hot.getSettings().manualRowMove;\n\n if (Array.isArray(pluginSettings)) {\n this.rowsMapper.clearMap();\n }\n\n (0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);\n\n this.unregisterEvents();\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Move a single row.\n *\n * @param {Number} row Visual row index to be moved.\n * @param {Number} target Visual row index being a target for the moved row.\n */\n\n }, {\n key: 'moveRow',\n value: function moveRow(row, target) {\n this.moveRows([row], target);\n }\n\n /**\n * Move multiple rows.\n *\n * @param {Array} rows Array of visual row indexes to be moved.\n * @param {Number} target Visual row index being a target for the moved rows.\n */\n\n }, {\n key: 'moveRows',\n value: function moveRows(rows, target) {\n var _this3 = this;\n\n var priv = privatePool.get(this);\n var beforeMoveHook = this.hot.runHooks('beforeRowMove', rows, target);\n\n priv.disallowMoving = beforeMoveHook === false;\n\n if (!priv.disallowMoving) {\n // first we need to rewrite an visual indexes to logical for save reference after move\n (0, _array.arrayEach)(rows, function (row, index, array) {\n array[index] = _this3.rowsMapper.getValueByIndex(row);\n });\n\n // next, when we have got an logical indexes, we can move rows\n (0, _array.arrayEach)(rows, function (row, index) {\n var actualPosition = _this3.rowsMapper.getIndexByValue(row);\n\n if (actualPosition !== target) {\n _this3.rowsMapper.moveRow(actualPosition, target + index);\n }\n });\n\n // after moving we have to clear rowsMapper from null entries\n this.rowsMapper.clearNull();\n }\n\n this.hot.runHooks('afterRowMove', rows, target);\n }\n\n /**\n * Correct the cell selection after the move action. Fired only when action was made with a mouse.\n * That means that changing the row order using the API won't correct the selection.\n *\n * @private\n * @param {Number} startRow Visual row index for the start of the selection.\n * @param {Number} endRow Visual row index for the end of the selection.\n */\n\n }, {\n key: 'changeSelection',\n value: function changeSelection(startRow, endRow) {\n var selection = this.hot.selection;\n var lastColIndex = this.hot.countCols() - 1;\n\n selection.setRangeStartOnly(new _src.CellCoords(startRow, 0));\n selection.setRangeEnd(new _src.CellCoords(endRow, lastColIndex), false);\n }\n\n /**\n * Get the sum of the heights of rows in the provided range.\n *\n * @private\n * @param {Number} from Visual row index.\n * @param {Number} to Visual row index.\n * @returns {Number}\n */\n\n }, {\n key: 'getRowsHeight',\n value: function getRowsHeight(from, to) {\n var height = 0;\n\n for (var i = from; i < to; i++) {\n var rowHeight = this.hot.view.wt.wtTable.getRowHeight(i) || 23;\n\n height += rowHeight;\n }\n\n return height;\n }\n\n /**\n * Load initial settings when persistent state is saved or when plugin was initialized as an array.\n *\n * @private\n */\n\n }, {\n key: 'initialSettings',\n value: function initialSettings() {\n var pluginSettings = this.hot.getSettings().manualRowMove;\n\n if (Array.isArray(pluginSettings)) {\n this.moveRows(pluginSettings, 0);\n } else if (pluginSettings !== void 0) {\n var persistentState = this.persistentStateLoad();\n\n if (persistentState.length) {\n this.moveRows(persistentState, 0);\n }\n }\n }\n\n /**\n * Check if the provided row is in the fixedRowsTop section.\n *\n * @private\n * @param {Number} row Visual row index to check.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFixedRowTop',\n value: function isFixedRowTop(row) {\n return row < this.hot.getSettings().fixedRowsTop;\n }\n\n /**\n * Check if the provided row is in the fixedRowsBottom section.\n *\n * @private\n * @param {Number} row Visual row index to check.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFixedRowBottom',\n value: function isFixedRowBottom(row) {\n return row > this.hot.getSettings().fixedRowsBottom;\n }\n\n /**\n * Save the manual row positions to the persistent state.\n *\n * @private\n */\n\n }, {\n key: 'persistentStateSave',\n value: function persistentStateSave() {\n this.hot.runHooks('persistentStateSave', 'manualRowMove', this.rowsMapper._arrayMap);\n }\n\n /**\n * Load the manual row positions from the persistent state.\n *\n * @private\n * @returns {Array} Stored state.\n */\n\n }, {\n key: 'persistentStateLoad',\n value: function persistentStateLoad() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualRowMove', storedState);\n\n return storedState.value ? storedState.value : [];\n }\n\n /**\n * Prepare array of indexes based on actual selection.\n *\n * @private\n * @returns {Array}\n */\n\n }, {\n key: 'prepareRowsToMoving',\n value: function prepareRowsToMoving() {\n var selection = this.hot.getSelectedRange();\n var selectedRows = [];\n\n if (!selection) {\n return selectedRows;\n }\n\n var from = selection.from,\n to = selection.to;\n\n var start = Math.min(from.row, to.row);\n var end = Math.max(from.row, to.row);\n\n (0, _number.rangeEach)(start, end, function (i) {\n selectedRows.push(i);\n });\n\n return selectedRows;\n }\n\n /**\n * Update the UI visual position.\n *\n * @private\n */\n\n }, {\n key: 'refreshPositions',\n value: function refreshPositions() {\n var priv = privatePool.get(this);\n var coords = priv.target.coords;\n var firstVisible = this.hot.view.wt.wtTable.getFirstVisibleRow();\n var lastVisible = this.hot.view.wt.wtTable.getLastVisibleRow();\n var fixedRows = this.hot.getSettings().fixedRowsTop;\n var countRows = this.hot.countRows();\n\n if (coords.row < fixedRows && firstVisible > 0) {\n this.hot.scrollViewportTo(firstVisible - 1);\n }\n if (coords.row >= lastVisible && lastVisible < countRows) {\n this.hot.scrollViewportTo(lastVisible + 1, undefined, true);\n }\n\n var wtTable = this.hot.view.wt.wtTable;\n var TD = priv.target.TD;\n var rootElementOffset = (0, _element.offset)(this.hot.rootElement);\n var tdOffsetTop = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row);\n var mouseOffsetTop = priv.target.eventPageY - rootElementOffset.top + wtTable.holder.scrollTop;\n var hiderHeight = wtTable.hider.offsetHeight;\n var tbodyOffsetTop = wtTable.TBODY.offsetTop;\n var backlightElemMarginTop = this.backlight.getOffset().top;\n var backlightElemHeight = this.backlight.getSize().height;\n\n if (rootElementOffset.top + wtTable.holder.offsetHeight < priv.target.eventPageY) {\n priv.target.coords.row++;\n }\n\n if (this.isFixedRowTop(coords.row)) {\n tdOffsetTop += wtTable.holder.scrollTop;\n }\n\n // todo: fixedRowsBottom\n // if (this.isFixedRowBottom(coords.row)) {\n //\n // }\n\n if (coords.row < 0) {\n // if hover on colHeader\n priv.target.row = firstVisible > 0 ? firstVisible - 1 : firstVisible;\n } else if (TD.offsetHeight / 2 + tdOffsetTop <= mouseOffsetTop) {\n // if hover on lower part of TD\n priv.target.row = coords.row + 1;\n // unfortunately first row is bigger than rest\n tdOffsetTop += coords.row === 0 ? TD.offsetHeight - 1 : TD.offsetHeight;\n } else {\n // elsewhere on table\n priv.target.row = coords.row;\n }\n\n var backlightTop = mouseOffsetTop;\n var guidelineTop = tdOffsetTop;\n\n if (mouseOffsetTop + backlightElemHeight + backlightElemMarginTop >= hiderHeight) {\n // prevent display backlight below table\n backlightTop = hiderHeight - backlightElemHeight - backlightElemMarginTop;\n } else if (mouseOffsetTop + backlightElemMarginTop < tbodyOffsetTop) {\n // prevent display above below table\n backlightTop = tbodyOffsetTop + Math.abs(backlightElemMarginTop);\n }\n\n if (tdOffsetTop >= hiderHeight - 1) {\n // prevent display guideline below table\n guidelineTop = hiderHeight - 1;\n }\n\n var topOverlayHeight = 0;\n if (this.hot.view.wt.wtOverlays.topOverlay) {\n topOverlayHeight = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.TABLE.offsetHeight;\n }\n\n if (coords.row >= fixedRows && guidelineTop - wtTable.holder.scrollTop < topOverlayHeight) {\n this.hot.scrollViewportTo(coords.row);\n }\n\n this.backlight.setPosition(backlightTop);\n this.guideline.setPosition(guidelineTop);\n }\n\n /**\n * This method checks arrayMap from rowsMapper and updates the rowsMapper if it's necessary.\n *\n * @private\n */\n\n }, {\n key: 'updateRowsMapper',\n value: function updateRowsMapper() {\n var countRows = this.hot.countSourceRows();\n var rowsMapperLen = this.rowsMapper._arrayMap.length;\n\n if (rowsMapperLen === 0) {\n this.rowsMapper.createMap(countRows || this.hot.getSettings().startRows);\n } else if (rowsMapperLen < countRows) {\n var diff = countRows - rowsMapperLen;\n\n this.rowsMapper.insertItems(rowsMapperLen, diff);\n } else if (rowsMapperLen > countRows) {\n var maxIndex = countRows - 1;\n var rowsToRemove = [];\n\n (0, _array.arrayEach)(this.rowsMapper._arrayMap, function (value, index, array) {\n if (value > maxIndex) {\n rowsToRemove.push(index);\n }\n });\n\n this.rowsMapper.removeItems(rowsToRemove);\n }\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this4 = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mousemove', function (event) {\n return _this4.onMouseMove(event);\n });\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function () {\n return _this4.onMouseUp();\n });\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'unregisterEvents',\n value: function unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * `beforeColumnSort` hook callback. If user uses the sorting, manual row moving is disabled.\n *\n * @private\n * @param {Number} column Column index where soring is present\n * @param {*} order State of sorting. ASC/DESC/None\n */\n\n }, {\n key: 'onBeforeColumnSort',\n value: function onBeforeColumnSort(column, order) {\n var priv = privatePool.get(this);\n\n priv.disallowMoving = order !== void 0;\n }\n\n /**\n * Change the behavior of selection / dragging.\n *\n * @private\n * @param {MouseEvent} event\n * @param {CellCoords} coords\n * @param {HTMLElement} TD\n * @param {Object} blockCalculations\n */\n\n }, {\n key: 'onBeforeOnCellMouseDown',\n value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) {\n var wtTable = this.hot.view.wt.wtTable;\n var isHeaderSelection = this.hot.selection.selectedHeader.rows;\n var selection = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n\n if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0) {\n priv.pressed = false;\n priv.rowsToMove.length = 0;\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);\n return;\n }\n\n var guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended();\n var backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended();\n\n if (guidelineIsNotReady && backlightIsNotReady) {\n this.guideline.appendTo(wtTable.hider);\n this.backlight.appendTo(wtTable.hider);\n }\n\n var from = selection.from,\n to = selection.to;\n\n var start = Math.min(from.row, to.row);\n var end = Math.max(from.row, to.row);\n\n if (coords.col < 0 && coords.row >= start && coords.row <= end) {\n blockCalculations.row = true;\n priv.pressed = true;\n priv.target.eventPageY = event.pageY;\n priv.target.coords = coords;\n priv.target.TD = TD;\n priv.rowsToMove = this.prepareRowsToMoving();\n\n var leftPos = wtTable.holder.scrollLeft + wtTable.getColumnWidth(-1);\n\n this.backlight.setPosition(null, leftPos);\n this.backlight.setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end + 1));\n this.backlight.setOffset((this.getRowsHeight(start, coords.row) + event.layerY) * -1, null);\n\n (0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);\n\n this.refreshPositions();\n } else {\n (0, _element.removeClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n priv.pressed = false;\n priv.rowsToMove.length = 0;\n }\n }\n\n /**\n * 'mouseMove' event callback. Fired when pointer move on document.documentElement.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var priv = privatePool.get(this);\n\n if (!priv.pressed) {\n return;\n }\n\n // callback for browser which doesn't supports CSS pointer-event: none\n if (event.realTarget === this.backlight.element) {\n var height = this.backlight.getSize().height;\n this.backlight.setSize(null, 0);\n\n setTimeout(function () {\n this.backlight.setPosition(null, height);\n });\n }\n\n priv.target.eventPageY = event.pageY;\n this.refreshPositions();\n }\n\n /**\n * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell.\n *\n * @private\n * @param {MouseEvent} event `mouseover` event properties.\n * @param {CellCoords} coords Cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n\n }, {\n key: 'onBeforeOnCellMouseOver',\n value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) {\n var selectedRange = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n\n if (!selectedRange || !priv.pressed) {\n return;\n }\n\n if (priv.rowsToMove.indexOf(coords.row) > -1) {\n (0, _element.removeClass)(this.hot.rootElement, CSS_SHOW_UI);\n } else {\n (0, _element.addClass)(this.hot.rootElement, CSS_SHOW_UI);\n }\n\n blockCalculations.row = true;\n blockCalculations.column = true;\n blockCalculations.cell = true;\n priv.target.coords = coords;\n priv.target.TD = TD;\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n var priv = privatePool.get(this);\n var target = priv.target.row;\n var rowsLen = priv.rowsToMove.length;\n\n priv.pressed = false;\n priv.backlightHeight = 0;\n\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]);\n\n if (this.hot.selection.selectedHeader.rows) {\n (0, _element.addClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n }\n\n if (rowsLen < 1 || target === void 0 || priv.rowsToMove.indexOf(target) > -1 || priv.rowsToMove[rowsLen - 1] === target - 1) {\n return;\n }\n\n this.moveRows(priv.rowsToMove, target);\n\n this.persistentStateSave();\n this.hot.render();\n\n if (!priv.disallowMoving) {\n var selectionStart = this.rowsMapper.getIndexByValue(priv.rowsToMove[0]);\n var selectionEnd = this.rowsMapper.getIndexByValue(priv.rowsToMove[rowsLen - 1]);\n this.changeSelection(selectionStart, selectionEnd);\n }\n\n priv.rowsToMove.length = 0;\n }\n\n /**\n * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally.\n *\n * @private\n */\n\n }, {\n key: 'onAfterScrollHorizontally',\n value: function onAfterScrollHorizontally() {\n var wtTable = this.hot.view.wt.wtTable;\n var headerWidth = wtTable.getColumnWidth(-1);\n var scrollLeft = wtTable.holder.scrollLeft;\n var posLeft = headerWidth + scrollLeft;\n\n this.backlight.setPosition(null, posLeft);\n this.backlight.setSize(wtTable.hider.offsetWidth - posLeft);\n }\n\n /**\n * `afterCreateRow` hook callback.\n *\n * @private\n * @param {Number} index Index of the created row.\n * @param {Number} amount Amount of created rows.\n */\n\n }, {\n key: 'onAfterCreateRow',\n value: function onAfterCreateRow(index, amount) {\n this.rowsMapper.shiftItems(index, amount);\n }\n\n /**\n * On before remove row listener.\n *\n * @private\n * @param {Number} index Row index.\n * @param {Number} amount Defines how many rows removed.\n */\n\n }, {\n key: 'onBeforeRemoveRow',\n value: function onBeforeRemoveRow(index, amount) {\n var _this5 = this;\n\n this.removedRows.length = 0;\n\n if (index !== false) {\n // Collect physical row index.\n (0, _number.rangeEach)(index, index + amount - 1, function (removedIndex) {\n _this5.removedRows.push(_this5.hot.runHooks('modifyRow', removedIndex, _this5.pluginName));\n });\n }\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n * @param {Number} index Index of the removed row.\n * @param {Number} amount Amount of removed rows.\n */\n\n }, {\n key: 'onAfterRemoveRow',\n value: function onAfterRemoveRow(index, amount) {\n this.rowsMapper.unshiftItems(this.removedRows);\n }\n\n /**\n * `afterLoadData` hook callback.\n *\n * @private\n * @param {Boolean} firstTime True if that was loading data during the initialization.\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData(firstTime) {\n this.updateRowsMapper();\n }\n\n /**\n * 'modifyRow' hook callback.\n *\n * @private\n * @param {Number} row Visual Row index.\n * @returns {Number} Modified row index.\n */\n\n }, {\n key: 'onModifyRow',\n value: function onModifyRow(row, source) {\n if (source !== this.pluginName) {\n var rowInMapper = this.rowsMapper.getValueByIndex(row);\n row = rowInMapper === null ? row : rowInMapper;\n }\n\n return row;\n }\n\n /**\n * 'unmodifyRow' hook callback.\n *\n * @private\n * @param {Number} row Visual row index.\n * @returns {Number} Logical row index.\n */\n\n }, {\n key: 'onUnmodifyRow',\n value: function onUnmodifyRow(row) {\n var indexInMapper = this.rowsMapper.getIndexByValue(row);\n\n return indexInMapper === null ? row : indexInMapper;\n }\n\n /**\n * `afterPluginsInitialized` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onAfterPluginsInitialized',\n value: function onAfterPluginsInitialized() {\n this.updateRowsMapper();\n this.initialSettings();\n this.backlight.build();\n this.guideline.build();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ManualRowMove;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('ManualRowMove', ManualRowMove);\n\nexports.default = ManualRowMove;\n\n/***/ }),\n/* 247 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _arrayMapper = __webpack_require__(149);\n\nvar _arrayMapper2 = _interopRequireDefault(_arrayMapper);\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class RowsMapper\n * @plugin ManualRowMove\n */\nvar RowsMapper = function () {\n function RowsMapper(manualRowMove) {\n _classCallCheck(this, RowsMapper);\n\n /**\n * Instance of ManualRowMove plugin.\n *\n * @type {ManualRowMove}\n */\n this.manualRowMove = manualRowMove;\n }\n\n /**\n * Reset current map array and create new one.\n *\n * @param {Number} [length] Custom generated map length.\n */\n\n\n _createClass(RowsMapper, [{\n key: 'createMap',\n value: function createMap(length) {\n var _this = this;\n\n var originLength = length === void 0 ? this._arrayMap.length : length;\n\n this._arrayMap.length = 0;\n\n (0, _number.rangeEach)(originLength - 1, function (itemIndex) {\n _this._arrayMap[itemIndex] = itemIndex;\n });\n }\n\n /**\n * Destroy class.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._arrayMap = null;\n }\n\n /**\n * Moving elements in rowsMapper.\n *\n * @param {Number} from Row index to move.\n * @param {Number} to Target index.\n */\n\n }, {\n key: 'moveRow',\n value: function moveRow(from, to) {\n var indexToMove = this._arrayMap[from];\n this._arrayMap[from] = null;\n this._arrayMap.splice(to, 0, indexToMove);\n }\n\n /**\n * Clearing arrayMap from `null` entries.\n */\n\n }, {\n key: 'clearNull',\n value: function clearNull() {\n this._arrayMap = (0, _array.arrayFilter)(this._arrayMap, function (i) {\n return i !== null;\n });\n }\n }]);\n\n return RowsMapper;\n}();\n\n(0, _object.mixin)(RowsMapper, _arrayMapper2.default);\n\nexports.default = RowsMapper;\n\n/***/ }),\n/* 248 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(152);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualRowMove--backlight';\n\n/**\n * @class BacklightUI\n * @util\n */\n\nvar BacklightUI = function (_BaseUI) {\n _inherits(BacklightUI, _BaseUI);\n\n function BacklightUI() {\n _classCallCheck(this, BacklightUI);\n\n return _possibleConstructorReturn(this, (BacklightUI.__proto__ || Object.getPrototypeOf(BacklightUI)).apply(this, arguments));\n }\n\n _createClass(BacklightUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(BacklightUI.prototype.__proto__ || Object.getPrototypeOf(BacklightUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return BacklightUI;\n}(_base2.default);\n\nexports.default = BacklightUI;\n\n/***/ }),\n/* 249 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(152);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualRowMove--guideline';\n\n/**\n * @class GuidelineUI\n * @util\n */\n\nvar GuidelineUI = function (_BaseUI) {\n _inherits(GuidelineUI, _BaseUI);\n\n function GuidelineUI() {\n _classCallCheck(this, GuidelineUI);\n\n return _possibleConstructorReturn(this, (GuidelineUI.__proto__ || Object.getPrototypeOf(GuidelineUI)).apply(this, arguments));\n }\n\n _createClass(GuidelineUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(GuidelineUI.prototype.__proto__ || Object.getPrototypeOf(GuidelineUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return GuidelineUI;\n}(_base2.default);\n\nexports.default = GuidelineUI;\n\n/***/ }),\n/* 250 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _event = __webpack_require__(7);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js\n\n/**\n * @description\n * ManualRowResize Plugin.\n *\n * Has 2 UI components:\n * - handle - the draggable element that sets the desired height of the row.\n * - guide - the helper guide that shows the desired height as a horizontal guide.\n *\n * @plugin ManualRowResize\n */\nvar ManualRowResize = function (_BasePlugin) {\n _inherits(ManualRowResize, _BasePlugin);\n\n function ManualRowResize(hotInstance) {\n _classCallCheck(this, ManualRowResize);\n\n var _this = _possibleConstructorReturn(this, (ManualRowResize.__proto__ || Object.getPrototypeOf(ManualRowResize)).call(this, hotInstance));\n\n _this.currentTH = null;\n _this.currentRow = null;\n _this.selectedRows = [];\n _this.currentHeight = null;\n _this.newSize = null;\n _this.startY = null;\n _this.startHeight = null;\n _this.startOffset = null;\n _this.handle = document.createElement('DIV');\n _this.guide = document.createElement('DIV');\n _this.eventManager = new _eventManager2.default(_this);\n _this.pressed = null;\n _this.dblclick = 0;\n _this.autoresizeTimeout = null;\n _this.manualRowHeights = [];\n\n (0, _element.addClass)(_this.handle, 'manualRowResizer');\n (0, _element.addClass)(_this.guide, 'manualRowResizerGuide');\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualRowResize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().manualRowResize;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.manualRowHeights = [];\n\n var initialRowHeights = this.hot.getSettings().manualRowResize;\n var loadedManualRowHeights = this.loadManualRowHeights();\n\n if (typeof loadedManualRowHeights != 'undefined') {\n this.manualRowHeights = loadedManualRowHeights;\n } else if (Array.isArray(initialRowHeights)) {\n this.manualRowHeights = initialRowHeights;\n } else {\n this.manualRowHeights = [];\n }\n\n this.addHook('modifyRowHeight', function (height, row) {\n return _this2.onModifyRowHeight(height, row);\n });\n\n // Handsontable.hooks.register('beforeRowResize');\n // Handsontable.hooks.register('afterRowResize');\n\n this.bindEvents();\n\n _get(ManualRowResize.prototype.__proto__ || Object.getPrototypeOf(ManualRowResize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n var initialRowHeights = this.hot.getSettings().manualRowResize;\n\n if (Array.isArray(initialRowHeights)) {\n this.manualRowHeights = initialRowHeights;\n } else if (!initialRowHeights) {\n this.manualRowHeights = [];\n }\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(ManualRowResize.prototype.__proto__ || Object.getPrototypeOf(ManualRowResize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Save the current sizes using the persistentState plugin.\n */\n\n }, {\n key: 'saveManualRowHeights',\n value: function saveManualRowHeights() {\n this.hot.runHooks('persistentStateSave', 'manualRowHeights', this.manualRowHeights);\n }\n\n /**\n * Load the previously saved sizes using the persistentState plugin.\n *\n * @returns {Array}\n */\n\n }, {\n key: 'loadManualRowHeights',\n value: function loadManualRowHeights() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualRowHeights', storedState);\n\n return storedState.value;\n }\n\n /**\n * Set the resize handle position.\n *\n * @param {HTMLCellElement} TH TH HTML element.\n */\n\n }, {\n key: 'setupHandlePosition',\n value: function setupHandlePosition(TH) {\n var _this3 = this;\n\n this.currentTH = TH;\n var row = this.hot.view.wt.wtTable.getCoords(TH).row; // getCoords returns CellCoords\n var headerWidth = (0, _element.outerWidth)(this.currentTH);\n\n if (row >= 0) {\n // if not col header\n var box = this.currentTH.getBoundingClientRect();\n\n this.currentRow = row;\n this.selectedRows = [];\n\n if (this.hot.selection.isSelected() && this.hot.selection.selectedHeader.rows) {\n var _hot$getSelectedRange = this.hot.getSelectedRange(),\n from = _hot$getSelectedRange.from,\n to = _hot$getSelectedRange.to;\n\n var start = from.row;\n var end = to.row;\n\n if (start >= end) {\n start = to.row;\n end = from.row;\n }\n\n if (this.currentRow >= start && this.currentRow <= end) {\n (0, _number.rangeEach)(start, end, function (i) {\n return _this3.selectedRows.push(i);\n });\n } else {\n this.selectedRows.push(this.currentRow);\n }\n } else {\n this.selectedRows.push(this.currentRow);\n }\n\n this.startOffset = box.top - 6;\n this.startHeight = parseInt(box.height, 10);\n this.handle.style.left = box.left + 'px';\n this.handle.style.top = this.startOffset + this.startHeight + 'px';\n this.handle.style.width = headerWidth + 'px';\n this.hot.rootElement.appendChild(this.handle);\n }\n }\n\n /**\n * Refresh the resize handle position.\n */\n\n }, {\n key: 'refreshHandlePosition',\n value: function refreshHandlePosition() {\n this.handle.style.top = this.startOffset + this.currentHeight + 'px';\n }\n\n /**\n * Set the resize guide position.\n */\n\n }, {\n key: 'setupGuidePosition',\n value: function setupGuidePosition() {\n var handleWidth = parseInt((0, _element.outerWidth)(this.handle), 10);\n var handleRightPosition = parseInt(this.handle.style.left, 10) + handleWidth;\n var maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);\n (0, _element.addClass)(this.handle, 'active');\n (0, _element.addClass)(this.guide, 'active');\n\n this.guide.style.top = this.handle.style.top;\n this.guide.style.left = handleRightPosition + 'px';\n this.guide.style.width = maximumVisibleElementWidth - handleWidth + 'px';\n this.hot.rootElement.appendChild(this.guide);\n }\n\n /**\n * Refresh the resize guide position.\n */\n\n }, {\n key: 'refreshGuidePosition',\n value: function refreshGuidePosition() {\n this.guide.style.top = this.handle.style.top;\n }\n\n /**\n * Hide both the resize handle and resize guide.\n */\n\n }, {\n key: 'hideHandleAndGuide',\n value: function hideHandleAndGuide() {\n (0, _element.removeClass)(this.handle, 'active');\n (0, _element.removeClass)(this.guide, 'active');\n }\n\n /**\n * Check if provided element is considered as a row header.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {Boolean}\n */\n\n }, {\n key: 'checkIfRowHeader',\n value: function checkIfRowHeader(element) {\n if (element != this.hot.rootElement) {\n var parent = element.parentNode;\n\n if (parent.tagName === 'TBODY') {\n return true;\n }\n\n return this.checkIfRowHeader(parent);\n }\n\n return false;\n }\n\n /**\n * Get the TH element from the provided element.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'getTHFromTargetElement',\n value: function getTHFromTargetElement(element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH') {\n return element;\n }\n return this.getTHFromTargetElement(element.parentNode);\n }\n\n return null;\n }\n\n /**\n * 'mouseover' event callback - set the handle position.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n if (this.checkIfRowHeader(event.target)) {\n var th = this.getTHFromTargetElement(event.target);\n\n if (th) {\n if (!this.pressed) {\n this.setupHandlePosition(th);\n }\n }\n }\n }\n\n /**\n * Auto-size row after doubleclick - callback.\n *\n * @private\n */\n\n }, {\n key: 'afterMouseDownTimeout',\n value: function afterMouseDownTimeout() {\n var _this4 = this;\n\n var render = function render() {\n _this4.hot.forceFullRender = true;\n _this4.hot.view.render(); // updates all\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var resize = function resize(selectedRow, forceRender) {\n var hookNewSize = _this4.hot.runHooks('beforeRowResize', selectedRow, _this4.newSize, true);\n\n if (hookNewSize !== void 0) {\n _this4.newSize = hookNewSize;\n }\n\n _this4.setManualSize(selectedRow, _this4.newSize); // double click sets auto row size\n\n if (forceRender) {\n render();\n }\n\n _this4.hot.runHooks('afterRowResize', selectedRow, _this4.newSize, true);\n };\n\n if (this.dblclick >= 2) {\n var selectedRowsLength = this.selectedRows.length;\n\n if (selectedRowsLength > 1) {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n resize(selectedRow);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n resize(selectedRow, true);\n });\n }\n }\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n }\n\n /**\n * 'mousedown' event callback.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown(event) {\n var _this5 = this;\n\n if ((0, _element.hasClass)(event.target, 'manualRowResizer')) {\n this.setupGuidePosition();\n this.pressed = this.hot;\n\n if (this.autoresizeTimeout == null) {\n this.autoresizeTimeout = setTimeout(function () {\n return _this5.afterMouseDownTimeout();\n }, 500);\n\n this.hot._registerTimeout(this.autoresizeTimeout);\n }\n this.dblclick++;\n\n this.startY = (0, _event.pageY)(event);\n this.newSize = this.startHeight;\n }\n }\n\n /**\n * 'mousemove' event callback - refresh the handle and guide positions, cache the new row height.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var _this6 = this;\n\n if (this.pressed) {\n this.currentHeight = this.startHeight + ((0, _event.pageY)(event) - this.startY);\n\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n _this6.newSize = _this6.setManualSize(selectedRow, _this6.currentHeight);\n });\n\n this.refreshHandlePosition();\n this.refreshGuidePosition();\n }\n }\n\n /**\n * 'mouseup' event callback - apply the row resizing.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n var _this7 = this;\n\n var render = function render() {\n _this7.hot.forceFullRender = true;\n _this7.hot.view.render(); // updates all\n _this7.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var runHooks = function runHooks(selectedRow, forceRender) {\n _this7.hot.runHooks('beforeRowResize', selectedRow, _this7.newSize);\n\n if (forceRender) {\n render();\n }\n\n _this7.saveManualRowHeights();\n\n _this7.hot.runHooks('afterRowResize', selectedRow, _this7.newSize);\n };\n if (this.pressed) {\n this.hideHandleAndGuide();\n this.pressed = false;\n\n if (this.newSize != this.startHeight) {\n var selectedRowsLength = this.selectedRows.length;\n\n if (selectedRowsLength > 1) {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n runHooks(selectedRow);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n runHooks(selectedRow, true);\n });\n }\n }\n\n this.setupHandlePosition(this.currentTH);\n }\n }\n\n /**\n * Bind the mouse events.\n *\n * @private\n */\n\n }, {\n key: 'bindEvents',\n value: function bindEvents() {\n var _this8 = this;\n\n this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', function (e) {\n return _this8.onMouseOver(e);\n });\n this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', function (e) {\n return _this8.onMouseDown(e);\n });\n this.eventManager.addEventListener(window, 'mousemove', function (e) {\n return _this8.onMouseMove(e);\n });\n this.eventManager.addEventListener(window, 'mouseup', function (e) {\n return _this8.onMouseUp(e);\n });\n }\n\n /**\n * Cache the current row height.\n *\n * @param {Number} row Row index.\n * @param {Number} height Row height.\n * @returns {Number}\n */\n\n }, {\n key: 'setManualSize',\n value: function setManualSize(row, height) {\n row = this.hot.runHooks('modifyRow', row);\n this.manualRowHeights[row] = height;\n\n return height;\n }\n\n /**\n * Modify the provided row height, based on the plugin settings.\n *\n * @private\n * @param {Number} height Row height.\n * @param {Number} row Row index.\n * @returns {Number}\n */\n\n }, {\n key: 'onModifyRowHeight',\n value: function onModifyRowHeight(height, row) {\n if (this.enabled) {\n var autoRowSizePlugin = this.hot.getPlugin('autoRowSize');\n var autoRowHeightResult = autoRowSizePlugin ? autoRowSizePlugin.heights[row] : null;\n\n row = this.hot.runHooks('modifyRow', row);\n\n var manualRowHeight = this.manualRowHeights[row];\n\n if (manualRowHeight !== void 0 && (manualRowHeight === autoRowHeightResult || manualRowHeight > (height || 0))) {\n return manualRowHeight;\n }\n }\n\n return height;\n }\n }]);\n\n return ManualRowResize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('manualRowResize', ManualRowResize);\n\nexports.default = ManualRowResize;\n\n/***/ }),\n/* 251 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _plugins = __webpack_require__(5);\n\nvar _event = __webpack_require__(7);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction CellInfoCollection() {\n var collection = [];\n\n collection.getInfo = function (row, col) {\n for (var i = 0, ilen = this.length; i < ilen; i++) {\n 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) {\n return this[i];\n }\n }\n };\n\n collection.setInfo = function (info) {\n for (var i = 0, ilen = this.length; i < ilen; i++) {\n if (this[i].row === info.row && this[i].col === info.col) {\n this[i] = info;\n return;\n }\n }\n this.push(info);\n };\n\n collection.removeInfo = function (row, col) {\n for (var i = 0, ilen = this.length; i < ilen; i++) {\n if (this[i].row === row && this[i].col === col) {\n this.splice(i, 1);\n break;\n }\n }\n };\n\n return collection;\n}\n\n/**\n * Plugin used to merge cells in Handsontable.\n *\n * @private\n * @plugin MergeCells\n * @class MergeCells\n */\nfunction MergeCells(mergeCellsSetting) {\n this.mergedCellInfoCollection = new CellInfoCollection();\n\n if (Array.isArray(mergeCellsSetting)) {\n for (var i = 0, ilen = mergeCellsSetting.length; i < ilen; i++) {\n this.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]);\n }\n }\n}\n\n/**\n * @param cellRange (CellRange)\n */\nMergeCells.prototype.canMergeRange = function (cellRange) {\n // is more than one cell selected\n return !cellRange.isSingle();\n};\n\nMergeCells.prototype.mergeRange = function (cellRange) {\n if (!this.canMergeRange(cellRange)) {\n return;\n }\n\n // normalize top left corner\n var topLeft = cellRange.getTopLeftCorner();\n var bottomRight = cellRange.getBottomRightCorner();\n\n var mergeParent = {};\n mergeParent.row = topLeft.row;\n mergeParent.col = topLeft.col;\n // TD has rowspan == 1 by default. rowspan == 2 means spread over 2 cells\n mergeParent.rowspan = bottomRight.row - topLeft.row + 1;\n mergeParent.colspan = bottomRight.col - topLeft.col + 1;\n this.mergedCellInfoCollection.setInfo(mergeParent);\n};\n\nMergeCells.prototype.mergeOrUnmergeSelection = function (cellRange) {\n var info = this.mergedCellInfoCollection.getInfo(cellRange.from.row, cellRange.from.col);\n if (info) {\n // unmerge\n this.unmergeSelection(cellRange.from);\n } else {\n // merge\n this.mergeSelection(cellRange);\n }\n};\n\nMergeCells.prototype.mergeSelection = function (cellRange) {\n this.mergeRange(cellRange);\n};\n\nMergeCells.prototype.unmergeSelection = function (cellRange) {\n var info = this.mergedCellInfoCollection.getInfo(cellRange.row, cellRange.col);\n this.mergedCellInfoCollection.removeInfo(info.row, info.col);\n};\n\nMergeCells.prototype.applySpanProperties = function (TD, row, col) {\n var info = this.mergedCellInfoCollection.getInfo(row, col);\n\n if (info) {\n if (info.row === row && info.col === col) {\n TD.setAttribute('rowspan', info.rowspan);\n TD.setAttribute('colspan', info.colspan);\n } else {\n TD.removeAttribute('rowspan');\n TD.removeAttribute('colspan');\n\n TD.style.display = 'none';\n }\n } else {\n TD.removeAttribute('rowspan');\n TD.removeAttribute('colspan');\n }\n};\n\nMergeCells.prototype.modifyTransform = function (hook, currentSelectedRange, delta) {\n var sameRowspan = function sameRowspan(merged, coords) {\n if (coords.row >= merged.row && coords.row <= merged.row + merged.rowspan - 1) {\n return true;\n }\n return false;\n },\n sameColspan = function sameColspan(merged, coords) {\n if (coords.col >= merged.col && coords.col <= merged.col + merged.colspan - 1) {\n return true;\n }\n return false;\n },\n getNextPosition = function getNextPosition(newDelta) {\n return new _src.CellCoords(currentSelectedRange.to.row + newDelta.row, currentSelectedRange.to.col + newDelta.col);\n };\n\n var newDelta = {\n row: delta.row,\n col: delta.col\n };\n\n if (hook == 'modifyTransformStart') {\n /* eslint-disable block-scoped-var */\n var nextPosition;\n\n if (!this.lastDesiredCoords) {\n this.lastDesiredCoords = new _src.CellCoords(null, null);\n }\n var currentPosition = new _src.CellCoords(currentSelectedRange.highlight.row, currentSelectedRange.highlight.col),\n\n // if current position's parent is a merged range, returns it\n mergedParent = this.mergedCellInfoCollection.getInfo(currentPosition.row, currentPosition.col),\n currentRangeContainsMerge; // if current range contains a merged range\n\n for (var i = 0, mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) {\n var range = this.mergedCellInfoCollection[i];\n range = new _src.CellCoords(range.row + range.rowspan - 1, range.col + range.colspan - 1);\n if (currentSelectedRange.includes(range)) {\n currentRangeContainsMerge = true;\n break;\n }\n }\n\n if (mergedParent) {\n // only merge selected\n var mergeTopLeft = new _src.CellCoords(mergedParent.row, mergedParent.col);\n var mergeBottomRight = new _src.CellCoords(mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1);\n var mergeRange = new _src.CellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight);\n\n if (!mergeRange.includes(this.lastDesiredCoords)) {\n this.lastDesiredCoords = new _src.CellCoords(null, null); // reset outdated version of lastDesiredCoords\n }\n\n newDelta.row = this.lastDesiredCoords.row ? this.lastDesiredCoords.row - currentPosition.row : newDelta.row;\n newDelta.col = this.lastDesiredCoords.col ? this.lastDesiredCoords.col - currentPosition.col : newDelta.col;\n\n if (delta.row > 0) {\n // moving down\n newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row;\n } else if (delta.row < 0) {\n // moving up\n newDelta.row = currentPosition.row - mergedParent.row + delta.row;\n }\n if (delta.col > 0) {\n // moving right\n newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col;\n } else if (delta.col < 0) {\n // moving left\n newDelta.col = currentPosition.col - mergedParent.col + delta.col;\n }\n }\n\n nextPosition = new _src.CellCoords(currentSelectedRange.highlight.row + newDelta.row, currentSelectedRange.highlight.col + newDelta.col);\n\n var nextParentIsMerged = this.mergedCellInfoCollection.getInfo(nextPosition.row, nextPosition.col);\n\n if (nextParentIsMerged) {\n // skipping the invisible cells in the merge range\n this.lastDesiredCoords = nextPosition;\n newDelta = {\n row: nextParentIsMerged.row - currentPosition.row,\n col: nextParentIsMerged.col - currentPosition.col\n };\n }\n } else if (hook == 'modifyTransformEnd') {\n for (var _i = 0, _mergesLength = this.mergedCellInfoCollection.length; _i < _mergesLength; _i++) {\n var currentMerge = this.mergedCellInfoCollection[_i];\n var _mergeTopLeft = new _src.CellCoords(currentMerge.row, currentMerge.col);\n var _mergeBottomRight = new _src.CellCoords(currentMerge.row + currentMerge.rowspan - 1, currentMerge.col + currentMerge.colspan - 1);\n var mergedRange = new _src.CellRange(_mergeTopLeft, _mergeTopLeft, _mergeBottomRight);\n var sharedBorders = currentSelectedRange.getBordersSharedWith(mergedRange);\n\n if (mergedRange.isEqual(currentSelectedRange)) {\n // only the merged range is selected\n currentSelectedRange.setDirection('NW-SE');\n } else if (sharedBorders.length > 0) {\n var mergeHighlighted = currentSelectedRange.highlight.isEqual(mergedRange.from);\n\n if (sharedBorders.indexOf('top') > -1) {\n // if range shares a border with the merged section, change range direction accordingly\n if (currentSelectedRange.to.isSouthEastOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('NW-SE');\n } else if (currentSelectedRange.to.isSouthWestOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('NE-SW');\n }\n } else if (sharedBorders.indexOf('bottom') > -1) {\n if (currentSelectedRange.to.isNorthEastOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('SW-NE');\n } else if (currentSelectedRange.to.isNorthWestOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('SE-NW');\n }\n }\n }\n\n nextPosition = getNextPosition(newDelta);\n var withinRowspan = sameRowspan(currentMerge, nextPosition),\n withinColspan = sameColspan(currentMerge, nextPosition);\n\n if (currentSelectedRange.includesRange(mergedRange) && (mergedRange.includes(nextPosition) || withinRowspan || withinColspan)) {\n // if next step overlaps a merged range, jump past it\n if (withinRowspan) {\n if (newDelta.row < 0) {\n newDelta.row -= currentMerge.rowspan - 1;\n } else if (newDelta.row > 0) {\n newDelta.row += currentMerge.rowspan - 1;\n }\n }\n if (withinColspan) {\n if (newDelta.col < 0) {\n newDelta.col -= currentMerge.colspan - 1;\n } else if (newDelta.col > 0) {\n newDelta.col += currentMerge.colspan - 1;\n }\n }\n }\n }\n }\n\n if (newDelta.row !== 0) {\n delta.row = newDelta.row;\n }\n if (newDelta.col !== 0) {\n delta.col = newDelta.col;\n }\n};\n\nMergeCells.prototype.shiftCollection = function (direction, index, count) {\n var shiftVector = [0, 0];\n\n switch (direction) {\n case 'right':\n shiftVector[0] += 1;\n\n break;\n case 'left':\n shiftVector[0] -= 1;\n\n break;\n case 'down':\n shiftVector[1] += 1;\n\n break;\n case 'up':\n shiftVector[1] -= 1;\n\n break;\n default:\n break;\n }\n\n for (var i = 0; i < this.mergedCellInfoCollection.length; i++) {\n var currentMerge = this.mergedCellInfoCollection[i];\n\n if (direction === 'right' || direction === 'left') {\n if (index <= currentMerge.col) {\n currentMerge.col += shiftVector[0];\n }\n } else if (index <= currentMerge.row) {\n currentMerge.row += shiftVector[1];\n }\n }\n};\n\nvar beforeInit = function beforeInit() {\n var instance = this;\n var mergeCellsSetting = instance.getSettings().mergeCells;\n\n if (mergeCellsSetting) {\n if (!instance.mergeCells) {\n instance.mergeCells = new MergeCells(mergeCellsSetting);\n }\n }\n};\n\nvar afterInit = function afterInit() {\n var instance = this;\n if (instance.mergeCells) {\n /**\n * Monkey patch Table.prototype.getCell to return TD for merged cell parent if asked for TD of a cell that is\n * invisible due to the merge. This is not the cleanest solution but there is a test case for it (merged cells scroll) so feel free to refactor it!\n */\n instance.view.wt.wtTable.getCell = function (coords) {\n if (instance.getSettings().mergeCells) {\n var mergeParent = instance.mergeCells.mergedCellInfoCollection.getInfo(coords.row, coords.col);\n if (mergeParent) {\n coords = mergeParent;\n }\n }\n return _src.Table.prototype.getCell.call(this, coords);\n };\n }\n};\n\nvar afterUpdateSettings = function afterUpdateSettings() {\n var instance = this;\n var mergeCellsSetting = instance.getSettings().mergeCells;\n\n if (mergeCellsSetting) {\n if (instance.mergeCells) {\n instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection();\n\n if (Array.isArray(mergeCellsSetting)) {\n for (var i = 0, ilen = mergeCellsSetting.length; i < ilen; i++) {\n instance.mergeCells.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]);\n }\n }\n } else {\n instance.mergeCells = new MergeCells(mergeCellsSetting);\n }\n } else if (instance.mergeCells) {\n // it doesn't actually turn off the plugin, just resets the settings. Need to refactor.\n instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection();\n }\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n if (!this.mergeCells) {\n return;\n }\n\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode === 77) {\n // CTRL + M\n this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange());\n this.render();\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n};\n\nvar addMergeActionsToContextMenu = function addMergeActionsToContextMenu(defaultOptions) {\n if (!this.getSettings().mergeCells) {\n return;\n }\n\n defaultOptions.items.push({ name: '---------' });\n defaultOptions.items.push({\n key: 'mergeCells',\n name: function name() {\n var sel = this.getSelected();\n var info = this.mergeCells.mergedCellInfoCollection.getInfo(sel[0], sel[1]);\n if (info) {\n return 'Unmerge cells';\n }\n return 'Merge cells';\n },\n callback: function callback() {\n this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange());\n this.render();\n },\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n }\n });\n};\n\nvar afterRenderer = function afterRenderer(TD, row, col, prop, value, cellProperties) {\n if (this.mergeCells) {\n this.mergeCells.applySpanProperties(TD, row, col);\n }\n};\n\nvar modifyTransformFactory = function modifyTransformFactory(hook) {\n return function (delta) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var currentSelectedRange = this.getSelectedRange();\n this.mergeCells.modifyTransform(hook, currentSelectedRange, delta);\n\n if (hook === 'modifyTransformEnd') {\n // sanitize \"from\" (core.js will sanitize to)\n var totalRows = this.countRows();\n var totalCols = this.countCols();\n if (currentSelectedRange.from.row < 0) {\n currentSelectedRange.from.row = 0;\n } else if (currentSelectedRange.from.row > 0 && currentSelectedRange.from.row >= totalRows) {\n currentSelectedRange.from.row = currentSelectedRange.from - 1;\n }\n\n if (currentSelectedRange.from.col < 0) {\n currentSelectedRange.from.col = 0;\n } else if (currentSelectedRange.from.col > 0 && currentSelectedRange.from.col >= totalCols) {\n currentSelectedRange.from.col = totalCols - 1;\n }\n }\n }\n };\n};\n\n/**\n * While selecting cells with keyboard or mouse, make sure that rectangular area is expanded to the extent of the merged cell\n * @param coords\n */\nvar beforeSetRangeEnd = function beforeSetRangeEnd(coords) {\n\n this.lastDesiredCoords = null; // unset lastDesiredCoords when selection is changed with mouse\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var selRange = this.getSelectedRange();\n selRange.highlight = new _src.CellCoords(selRange.highlight.row, selRange.highlight.col); // clone in case we will modify its reference\n selRange.to = coords;\n\n var rangeExpanded = false;\n do {\n rangeExpanded = false;\n\n for (var i = 0, ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) {\n var cellInfo = this.mergeCells.mergedCellInfoCollection[i];\n var mergedCellTopLeft = new _src.CellCoords(cellInfo.row, cellInfo.col);\n var mergedCellBottomRight = new _src.CellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1);\n\n var mergedCellRange = new _src.CellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);\n if (selRange.expandByRange(mergedCellRange)) {\n coords.row = selRange.to.row;\n coords.col = selRange.to.col;\n\n rangeExpanded = true;\n }\n }\n } while (rangeExpanded);\n }\n};\n\n/**\n * Returns correct coordinates for merged start / end cells in selection for area borders\n * @param corners\n * @param className\n */\nvar beforeDrawAreaBorders = function beforeDrawAreaBorders(corners, className) {\n if (className && className == 'area') {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var selRange = this.getSelectedRange();\n var startRange = new _src.CellRange(selRange.from, selRange.from, selRange.from);\n var stopRange = new _src.CellRange(selRange.to, selRange.to, selRange.to);\n\n for (var i = 0, ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) {\n var cellInfo = this.mergeCells.mergedCellInfoCollection[i];\n var mergedCellTopLeft = new _src.CellCoords(cellInfo.row, cellInfo.col);\n var mergedCellBottomRight = new _src.CellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1);\n var mergedCellRange = new _src.CellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);\n\n if (startRange.expandByRange(mergedCellRange)) {\n corners[0] = startRange.from.row;\n corners[1] = startRange.from.col;\n }\n\n if (stopRange.expandByRange(mergedCellRange)) {\n corners[2] = stopRange.from.row;\n corners[3] = stopRange.from.col;\n }\n }\n }\n }\n};\n\nvar afterGetCellMeta = function afterGetCellMeta(row, col, cellProperties) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(row, col);\n if (mergeParent && (mergeParent.row != row || mergeParent.col != col)) {\n cellProperties.copyable = false;\n }\n }\n};\n\nvar afterViewportRowCalculatorOverride = function afterViewportRowCalculatorOverride(calc) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var colCount = this.countCols();\n var mergeParent;\n for (var c = 0; c < colCount; c++) {\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.startRow, c);\n if (mergeParent) {\n if (mergeParent.row < calc.startRow) {\n calc.startRow = mergeParent.row;\n return afterViewportRowCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.endRow, c);\n if (mergeParent) {\n var mergeEnd = mergeParent.row + mergeParent.rowspan - 1;\n if (mergeEnd > calc.endRow) {\n calc.endRow = mergeEnd;\n return afterViewportRowCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n }\n }\n};\n\nvar afterViewportColumnCalculatorOverride = function afterViewportColumnCalculatorOverride(calc) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var rowCount = this.countRows();\n var mergeParent;\n for (var r = 0; r < rowCount; r++) {\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.startColumn);\n\n if (mergeParent) {\n if (mergeParent.col < calc.startColumn) {\n calc.startColumn = mergeParent.col;\n return afterViewportColumnCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.endColumn);\n if (mergeParent) {\n var mergeEnd = mergeParent.col + mergeParent.colspan - 1;\n if (mergeEnd > calc.endColumn) {\n calc.endColumn = mergeEnd;\n return afterViewportColumnCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n }\n }\n};\n\nvar isMultipleSelection = function isMultipleSelection(isMultiple) {\n if (isMultiple && this.mergeCells) {\n var mergedCells = this.mergeCells.mergedCellInfoCollection,\n selectionRange = this.getSelectedRange();\n\n for (var group in mergedCells) {\n 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) {\n return false;\n }\n }\n }\n return isMultiple;\n};\n\nfunction modifyAutofillRange(select, drag) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n\n if (!mergeCellsSetting || this.selection.isMultiple()) {\n return;\n }\n var info = this.mergeCells.mergedCellInfoCollection.getInfo(select[0], select[1]);\n\n if (info) {\n select[0] = info.row;\n select[1] = info.col;\n select[2] = info.row + info.rowspan - 1;\n select[3] = info.col + info.colspan - 1;\n }\n}\n\nfunction onAfterCreateCol(col, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('right', col, count);\n }\n}\n\nfunction onAfterRemoveCol(col, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('left', col, count);\n }\n}\n\nfunction onAfterCreateRow(row, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('down', row, count);\n }\n}\n\nfunction onAfterRemoveRow(row, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('up', row, count);\n }\n}\n\nvar hook = _pluginHooks2.default.getSingleton();\n\nhook.add('beforeInit', beforeInit);\nhook.add('afterInit', afterInit);\nhook.add('afterUpdateSettings', afterUpdateSettings);\nhook.add('beforeKeyDown', onBeforeKeyDown);\nhook.add('modifyTransformStart', modifyTransformFactory('modifyTransformStart'));\nhook.add('modifyTransformEnd', modifyTransformFactory('modifyTransformEnd'));\nhook.add('beforeSetRangeEnd', beforeSetRangeEnd);\nhook.add('beforeDrawBorders', beforeDrawAreaBorders);\nhook.add('afterIsMultipleSelection', isMultipleSelection);\nhook.add('afterRenderer', afterRenderer);\nhook.add('afterContextMenuDefaultOptions', addMergeActionsToContextMenu);\nhook.add('afterGetCellMeta', afterGetCellMeta);\nhook.add('afterViewportRowCalculatorOverride', afterViewportRowCalculatorOverride);\nhook.add('afterViewportColumnCalculatorOverride', afterViewportColumnCalculatorOverride);\nhook.add('modifyAutofillRange', modifyAutofillRange);\nhook.add('afterCreateCol', onAfterCreateCol);\nhook.add('afterRemoveCol', onAfterRemoveCol);\nhook.add('afterCreateRow', onAfterCreateRow);\nhook.add('afterRemoveRow', onAfterRemoveRow);\n\nexports.default = MergeCells;\n\n/***/ }),\n/* 252 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _element = __webpack_require__(0);\n\nvar _browser = __webpack_require__(25);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @plugin MultipleSelectionHandles\n */\nvar MultipleSelectionHandles = function (_BasePlugin) {\n _inherits(MultipleSelectionHandles, _BasePlugin);\n\n /**\n * @param {Object} hotInstance\n */\n function MultipleSelectionHandles(hotInstance) {\n _classCallCheck(this, MultipleSelectionHandles);\n\n /**\n * @type {Array}\n */\n var _this2 = _possibleConstructorReturn(this, (MultipleSelectionHandles.__proto__ || Object.getPrototypeOf(MultipleSelectionHandles)).call(this, hotInstance));\n\n _this2.dragged = [];\n /**\n * Instance of EventManager.\n *\n * @type {EventManager}\n */\n _this2.eventManager = null;\n /**\n * @type {null}\n */\n _this2.lastSetCell = null;\n return _this2;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(MultipleSelectionHandles, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return (0, _browser.isMobileBrowser)();\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n if (this.enabled) {\n return;\n }\n if (!this.eventManager) {\n this.eventManager = new _eventManager2.default(this);\n }\n this.registerListeners();\n _get(MultipleSelectionHandles.prototype.__proto__ || Object.getPrototypeOf(MultipleSelectionHandles.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Bind the touch events\n * @private\n */\n\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n var _this = this;\n\n function removeFromDragged(query) {\n\n if (_this.dragged.length === 1) {\n // clear array\n _this.dragged.splice(0, _this.dragged.length);\n\n return true;\n }\n\n var entryPosition = _this.dragged.indexOf(query);\n\n if (entryPosition == -1) {\n return false;\n } else if (entryPosition === 0) {\n _this.dragged = _this.dragged.slice(0, 1);\n } else if (entryPosition == 1) {\n _this.dragged = _this.dragged.slice(-1);\n }\n }\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchstart', function (event) {\n var selectedRange = void 0;\n\n if ((0, _element.hasClass)(event.target, 'topLeftSelectionHandle-HitArea')) {\n selectedRange = _this.hot.getSelectedRange();\n\n _this.dragged.push('topLeft');\n\n _this.touchStartRange = {\n width: selectedRange.getWidth(),\n height: selectedRange.getHeight(),\n direction: selectedRange.getDirection()\n };\n\n event.preventDefault();\n return false;\n } else if ((0, _element.hasClass)(event.target, 'bottomRightSelectionHandle-HitArea')) {\n selectedRange = _this.hot.getSelectedRange();\n\n _this.dragged.push('bottomRight');\n\n _this.touchStartRange = {\n width: selectedRange.getWidth(),\n height: selectedRange.getHeight(),\n direction: selectedRange.getDirection()\n };\n\n event.preventDefault();\n return false;\n }\n });\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchend', function (event) {\n if ((0, _element.hasClass)(event.target, 'topLeftSelectionHandle-HitArea')) {\n removeFromDragged.call(_this, 'topLeft');\n\n _this.touchStartRange = void 0;\n\n event.preventDefault();\n return false;\n } else if ((0, _element.hasClass)(event.target, 'bottomRightSelectionHandle-HitArea')) {\n removeFromDragged.call(_this, 'bottomRight');\n\n _this.touchStartRange = void 0;\n\n event.preventDefault();\n return false;\n }\n });\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchmove', function (event) {\n var scrollTop = (0, _element.getWindowScrollTop)(),\n scrollLeft = (0, _element.getWindowScrollLeft)(),\n endTarget = void 0,\n targetCoords = void 0,\n selectedRange = void 0,\n rangeWidth = void 0,\n rangeHeight = void 0,\n rangeDirection = void 0,\n newRangeCoords = void 0;\n\n if (_this.dragged.length === 0) {\n return;\n }\n\n endTarget = document.elementFromPoint(event.touches[0].screenX - scrollLeft, event.touches[0].screenY - scrollTop);\n\n if (!endTarget || endTarget === _this.lastSetCell) {\n return;\n }\n\n if (endTarget.nodeName == 'TD' || endTarget.nodeName == 'TH') {\n targetCoords = _this.hot.getCoords(endTarget);\n\n if (targetCoords.col == -1) {\n targetCoords.col = 0;\n }\n\n selectedRange = _this.hot.getSelectedRange();\n rangeWidth = selectedRange.getWidth();\n rangeHeight = selectedRange.getHeight();\n rangeDirection = selectedRange.getDirection();\n\n if (rangeWidth == 1 && rangeHeight == 1) {\n _this.hot.selection.setRangeEnd(targetCoords);\n }\n\n newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]);\n\n if (newRangeCoords.start !== null) {\n _this.hot.selection.setRangeStart(newRangeCoords.start);\n }\n\n _this.hot.selection.setRangeEnd(newRangeCoords.end);\n\n _this.lastSetCell = endTarget;\n }\n\n event.preventDefault();\n });\n }\n }, {\n key: 'getCurrentRangeCoords',\n value: function getCurrentRangeCoords(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) {\n var topLeftCorner = selectedRange.getTopLeftCorner(),\n bottomRightCorner = selectedRange.getBottomRightCorner(),\n bottomLeftCorner = selectedRange.getBottomLeftCorner(),\n topRightCorner = selectedRange.getTopRightCorner();\n\n var newCoords = {\n start: null,\n end: null\n };\n\n switch (touchStartDirection) {\n case 'NE-SW':\n switch (currentDirection) {\n case 'NE-SW':\n case 'NW-SE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, selectedRange.highlight.col),\n end: new _src.CellCoords(bottomLeftCorner.row, currentTouch.col)\n };\n } else {\n newCoords = {\n start: new _src.CellCoords(selectedRange.highlight.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, topLeftCorner.col)\n };\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new _src.CellCoords(bottomRightCorner.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, topLeftCorner.col)\n };\n }\n break;\n default:\n break;\n }\n break;\n case 'NW-SE':\n switch (currentDirection) {\n case 'NE-SW':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: bottomLeftCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'NW-SE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: bottomRightCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: topLeftCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: topRightCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n default:\n break;\n }\n break;\n case 'SW-NE':\n switch (currentDirection) {\n case 'NW-SE':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, topLeftCorner.col),\n end: new _src.CellCoords(bottomLeftCorner.row, currentTouch.col)\n };\n } else {\n newCoords = {\n start: new _src.CellCoords(topLeftCorner.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, bottomRightCorner.col)\n };\n }\n break;\n // case 'NE-SW':\n //\n // break;\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: new _src.CellCoords(selectedRange.highlight.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, bottomRightCorner.col)\n };\n } else {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, topLeftCorner.col),\n end: new _src.CellCoords(topLeftCorner.row, currentTouch.col)\n };\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, topRightCorner.col),\n end: new _src.CellCoords(topLeftCorner.row, currentTouch.col)\n };\n } else if (draggedHandle == 'topLeft') {\n newCoords = {\n start: bottomLeftCorner,\n end: currentTouch\n };\n }\n break;\n default:\n break;\n }\n break;\n case 'SE-NW':\n switch (currentDirection) {\n case 'NW-SE':\n case 'NE-SW':\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords.end = currentTouch;\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'topLeft') {\n newCoords.end = currentTouch;\n } else {\n newCoords = {\n start: currentTouch,\n end: topLeftCorner\n };\n }\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return newCoords;\n }\n\n /**\n * Check if user is currently dragging the handle.\n *\n * @returns {boolean} Dragging state\n */\n\n }, {\n key: 'isDragged',\n value: function isDragged() {\n return this.dragged.length > 0;\n }\n }]);\n\n return MultipleSelectionHandles;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('multipleSelectionHandles', MultipleSelectionHandles);\n\nexports.default = MultipleSelectionHandles;\n\n/***/ }),\n/* 253 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _jsonPatchDuplex = __webpack_require__(133);\n\nvar _jsonPatchDuplex2 = _interopRequireDefault(_jsonPatchDuplex);\n\nvar _localHooks = __webpack_require__(150);\n\nvar _localHooks2 = _interopRequireDefault(_localHooks);\n\nvar _object = __webpack_require__(2);\n\nvar _utils = __webpack_require__(255);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class DataObserver\n * @plugin ObserveChanges\n */\nvar DataObserver = function () {\n function DataObserver(observedData) {\n _classCallCheck(this, DataObserver);\n\n /**\n * Observed source data.\n *\n * @type {Array}\n */\n this.observedData = null;\n /**\n * JsonPatch observer.\n *\n * @type {Object}\n */\n this.observer = null;\n /**\n * Flag which determines if observer is paused or not. Paused observer doesn't emit `change` hooks.\n *\n * @type {Boolean}\n * @default false\n */\n this.paused = false;\n\n this.setObservedData(observedData);\n }\n\n /**\n * Set data to observe.\n *\n * @param {*} observedData\n */\n\n\n _createClass(DataObserver, [{\n key: 'setObservedData',\n value: function setObservedData(observedData) {\n var _this = this;\n\n if (this.observer) {\n _jsonPatchDuplex2.default.unobserve(this.observedData, this.observer);\n }\n this.observedData = observedData;\n this.observer = _jsonPatchDuplex2.default.observe(this.observedData, function (patches) {\n return _this.onChange(patches);\n });\n }\n\n /**\n * Check if observer was paused.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isPaused',\n value: function isPaused() {\n return this.paused;\n }\n\n /**\n * Pause observer (stop emitting all detected changes).\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n }\n\n /**\n * Resume observer (emit all detected changes).\n */\n\n }, {\n key: 'resume',\n value: function resume() {\n this.paused = false;\n }\n\n /**\n * JsonPatch on change listener.\n *\n * @private\n * @param {Array} patches An array of object passed from jsonpatch.\n */\n\n }, {\n key: 'onChange',\n value: function onChange(patches) {\n this.runLocalHooks('change', (0, _utils.cleanPatches)(patches));\n }\n\n /**\n * Destroy observer instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _jsonPatchDuplex2.default.unobserve(this.observedData, this.observer);\n this.observedData = null;\n this.observer = null;\n }\n }]);\n\n return DataObserver;\n}();\n\n(0, _object.mixin)(DataObserver, _localHooks2.default);\n\nexports.default = DataObserver;\n\n/***/ }),\n/* 254 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _jsonPatchDuplex = __webpack_require__(133);\n\nvar _jsonPatchDuplex2 = _interopRequireDefault(_jsonPatchDuplex);\n\nvar _dataObserver = __webpack_require__(253);\n\nvar _dataObserver2 = _interopRequireDefault(_dataObserver);\n\nvar _array = __webpack_require__(1);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Handsontable.hooks.register('afterChangesObserved');\n\n/**\n * @plugin ObserveChanges\n *\n * @description\n * This plugin allows to observe data source changes.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled.\n * Enabling this plugin switches the table into one-way data binding where changes are applied into the data source (outside from the table)\n * will be automatically reflected in the table.\n *\n * ```js\n * ...\n * // as a boolean\n * observeChanges: true,\n * ...\n * ```\n *\n * To configure this plugin see {@link Options#observeChanges}.\n */\nvar ObserveChanges = function (_BasePlugin) {\n _inherits(ObserveChanges, _BasePlugin);\n\n function ObserveChanges(hotInstance) {\n _classCallCheck(this, ObserveChanges);\n\n /**\n * Instance of {@link DataObserver}.\n *\n * @type {DataObserver}\n */\n var _this = _possibleConstructorReturn(this, (ObserveChanges.__proto__ || Object.getPrototypeOf(ObserveChanges)).call(this, hotInstance));\n\n _this.observer = null;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ObserveChanges, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().observeChanges;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n if (!this.observer) {\n this.observer = new _dataObserver2.default(this.hot.getSourceData());\n this._exposePublicApi();\n }\n\n this.observer.addLocalHook('change', function (patches) {\n return _this2.onDataChange(patches);\n });\n this.addHook('afterCreateRow', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterRemoveRow', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterCreateCol', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterRemoveCol', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterChange', function (changes, source) {\n return _this2.onAfterTableAlter(source);\n });\n this.addHook('afterLoadData', function (firstRun) {\n return _this2.onAfterLoadData(firstRun);\n });\n\n _get(ObserveChanges.prototype.__proto__ || Object.getPrototypeOf(ObserveChanges.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n if (this.observer) {\n this.observer.destroy();\n this.observer = null;\n this._deletePublicApi();\n }\n\n _get(ObserveChanges.prototype.__proto__ || Object.getPrototypeOf(ObserveChanges.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Data change observer.\n *\n * @private\n * @param {Array} patches An array of objects which every item defines coordinates where data was changed.\n */\n\n }, {\n key: 'onDataChange',\n value: function onDataChange(patches) {\n var _this3 = this;\n\n if (!this.observer.isPaused()) {\n var sourceName = this.pluginName + '.change';\n var actions = {\n add: function add(patch) {\n if (isNaN(patch.col)) {\n _this3.hot.runHooks('afterCreateRow', patch.row, 1, sourceName);\n } else {\n _this3.hot.runHooks('afterCreateCol', patch.col, 1, sourceName);\n }\n },\n remove: function remove(patch) {\n if (isNaN(patch.col)) {\n _this3.hot.runHooks('afterRemoveRow', patch.row, 1, sourceName);\n } else {\n _this3.hot.runHooks('afterRemoveCol', patch.col, 1, sourceName);\n }\n },\n replace: function replace(patch) {\n _this3.hot.runHooks('afterChange', [patch.row, patch.col, null, patch.value], sourceName);\n }\n };\n\n (0, _array.arrayEach)(patches, function (patch) {\n if (actions[patch.op]) {\n actions[patch.op](patch);\n }\n });\n this.hot.render();\n }\n\n this.hot.runHooks('afterChangesObserved');\n }\n\n /**\n * On after table alter listener. Prevents infinity loop between internal and external data changing.\n *\n * @private\n * @param source\n */\n\n }, {\n key: 'onAfterTableAlter',\n value: function onAfterTableAlter(source) {\n var _this4 = this;\n\n if (source !== 'loadData') {\n this.observer.pause();\n this.hot.addHookOnce('afterChangesObserved', function () {\n return _this4.observer.resume();\n });\n }\n }\n\n /**\n * On after load data listener.\n *\n * @private\n * @param {Boolean} firstRun `true` if event was fired first time.\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData(firstRun) {\n if (!firstRun) {\n this.observer.setObservedData(this.hot.getSourceData());\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.observer) {\n this.observer.destroy();\n this._deletePublicApi();\n }\n _get(ObserveChanges.prototype.__proto__ || Object.getPrototypeOf(ObserveChanges.prototype), 'destroy', this).call(this);\n }\n\n /**\n * Expose plugins methods to the core.\n *\n * @private\n */\n\n }, {\n key: '_exposePublicApi',\n value: function _exposePublicApi() {\n var _this5 = this;\n\n var hot = this.hot;\n\n hot.pauseObservingChanges = function () {\n return _this5.observer.pause();\n };\n hot.resumeObservingChanges = function () {\n return _this5.observer.resume();\n };\n hot.isPausedObservingChanges = function () {\n return _this5.observer.isPaused();\n };\n }\n\n /**\n * Delete all previously exposed methods.\n *\n * @private\n */\n\n }, {\n key: '_deletePublicApi',\n value: function _deletePublicApi() {\n var hot = this.hot;\n\n delete hot.pauseObservingChanges;\n delete hot.resumeObservingChanges;\n delete hot.isPausedObservingChanges;\n }\n }]);\n\n return ObserveChanges;\n}(_base2.default);\n\nexports.default = ObserveChanges;\n\n\n(0, _plugins.registerPlugin)('observeChanges', ObserveChanges);\n\n/***/ }),\n/* 255 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.cleanPatches = cleanPatches;\nexports.parsePath = parsePath;\n\nvar _array = __webpack_require__(1);\n\n/**\n * Clean and extend patches from jsonpatch observer.\n *\n * @param {Array} patches\n * @returns {Array}\n */\nfunction cleanPatches(patches) {\n var newOrRemovedColumns = [];\n\n /**\n * If observeChanges uses native Object.observe method, then it produces patches for length property. Filter them.\n * If path can't be parsed. Filter it.\n */\n patches = (0, _array.arrayFilter)(patches, function (patch) {\n if (/[/]length/ig.test(patch.path)) {\n return false;\n }\n if (!parsePath(patch.path)) {\n return false;\n }\n\n return true;\n });\n /**\n * Extend patches with changed cells coords\n */\n patches = (0, _array.arrayMap)(patches, function (patch) {\n var coords = parsePath(patch.path);\n\n patch.row = coords.row;\n patch.col = coords.col;\n\n return patch;\n });\n /**\n * Removing or adding column will produce one patch for each table row.\n * Leaves only one patch for each column add/remove operation.\n */\n patches = (0, _array.arrayFilter)(patches, function (patch) {\n if (['add', 'remove'].indexOf(patch.op) !== -1 && !isNaN(patch.col)) {\n if (newOrRemovedColumns.indexOf(patch.col) !== -1) {\n return false;\n }\n newOrRemovedColumns.push(patch.col);\n }\n\n return true;\n });\n newOrRemovedColumns.length = 0;\n\n return patches;\n}\n\n/**\n * Extract coordinates from path where data was changed.\n *\n * @param {String} path Path describing where data was changed.\n * @returns {Object|null} Returns an object with `row` and `col` properties or `null` if path doesn't have necessary information.\n */\nfunction parsePath(path) {\n var match = path.match(/^\\/(\\d+)\\/?(.*)?$/);\n\n if (!match) {\n return null;\n }\n\n var _match = _slicedToArray(match, 3),\n row = _match[1],\n column = _match[2];\n\n return {\n row: parseInt(row, 10),\n col: /^\\d*$/.test(column) ? parseInt(column, 10) : column\n };\n}\n\n/***/ }),\n/* 256 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _plugins = __webpack_require__(5);\n\nvar _object = __webpack_require__(2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Storage(prefix) {\n var savedKeys;\n\n var saveSavedKeys = function saveSavedKeys() {\n window.localStorage[prefix + '__persistentStateKeys'] = JSON.stringify(savedKeys);\n };\n\n var loadSavedKeys = function loadSavedKeys() {\n var keysJSON = window.localStorage[prefix + '__persistentStateKeys'];\n var keys = typeof keysJSON == 'string' ? JSON.parse(keysJSON) : void 0;\n savedKeys = keys ? keys : [];\n };\n\n var clearSavedKeys = function clearSavedKeys() {\n savedKeys = [];\n saveSavedKeys();\n };\n\n loadSavedKeys();\n\n this.saveValue = function (key, value) {\n window.localStorage[prefix + '_' + key] = JSON.stringify(value);\n if (savedKeys.indexOf(key) == -1) {\n savedKeys.push(key);\n saveSavedKeys();\n }\n };\n\n this.loadValue = function (key, defaultValue) {\n\n key = typeof key === 'undefined' ? defaultValue : key;\n\n var value = window.localStorage[prefix + '_' + key];\n\n return typeof value == 'undefined' ? void 0 : JSON.parse(value);\n };\n\n this.reset = function (key) {\n window.localStorage.removeItem(prefix + '_' + key);\n };\n\n this.resetAll = function () {\n for (var index = 0; index < savedKeys.length; index++) {\n window.localStorage.removeItem(prefix + '_' + savedKeys[index]);\n }\n\n clearSavedKeys();\n };\n}\n\n/**\n * @private\n * @class PersistentState\n * @plugin PersistentState\n */\nfunction HandsontablePersistentState() {\n var plugin = this;\n\n this.init = function () {\n var instance = this,\n pluginSettings = instance.getSettings().persistentState;\n\n plugin.enabled = !!pluginSettings;\n\n if (!plugin.enabled) {\n removeHooks.call(instance);\n return;\n }\n\n if (!instance.storage) {\n instance.storage = new Storage(instance.rootElement.id);\n }\n\n instance.resetState = plugin.resetValue;\n\n addHooks.call(instance);\n };\n\n this.saveValue = function (key, value) {\n var instance = this;\n\n instance.storage.saveValue(key, value);\n };\n\n this.loadValue = function (key, saveTo) {\n var instance = this;\n\n saveTo.value = instance.storage.loadValue(key);\n };\n\n this.resetValue = function (key) {\n var instance = this;\n\n if (typeof key === 'undefined') {\n instance.storage.resetAll();\n } else {\n instance.storage.reset(key);\n }\n };\n\n var hooks = {\n persistentStateSave: plugin.saveValue,\n persistentStateLoad: plugin.loadValue,\n persistentStateReset: plugin.resetValue\n };\n\n for (var hookName in hooks) {\n if ((0, _object.hasOwnProperty)(hooks, hookName)) {\n _pluginHooks2.default.getSingleton().register(hookName);\n }\n }\n\n function addHooks() {\n var instance = this;\n\n for (var hookName in hooks) {\n if ((0, _object.hasOwnProperty)(hooks, hookName)) {\n instance.addHook(hookName, hooks[hookName]);\n }\n }\n }\n\n function removeHooks() {\n var instance = this;\n\n for (var hookName in hooks) {\n if ((0, _object.hasOwnProperty)(hooks, hookName)) {\n instance.removeHook(hookName, hooks[hookName]);\n }\n }\n }\n}\n\nvar htPersistentState = new HandsontablePersistentState();\n\n_pluginHooks2.default.getSingleton().add('beforeInit', htPersistentState.init);\n_pluginHooks2.default.getSingleton().add('afterUpdateSettings', htPersistentState.init);\n\nexports.default = HandsontablePersistentState;\n\n/***/ }),\n/* 257 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _element = __webpack_require__(0);\n\nvar _renderers = __webpack_require__(9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n * @plugin Search\n */\nfunction Search(instance) {\n this.query = function (queryStr, callback, queryMethod) {\n var rowCount = instance.countRows();\n var colCount = instance.countCols();\n var queryResult = [];\n\n if (!callback) {\n callback = Search.global.getDefaultCallback();\n }\n\n if (!queryMethod) {\n queryMethod = Search.global.getDefaultQueryMethod();\n }\n\n for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n for (var colIndex = 0; colIndex < colCount; colIndex++) {\n var cellData = instance.getDataAtCell(rowIndex, colIndex);\n var cellProperties = instance.getCellMeta(rowIndex, colIndex);\n var cellCallback = cellProperties.search.callback || callback;\n var cellQueryMethod = cellProperties.search.queryMethod || queryMethod;\n var testResult = cellQueryMethod(queryStr, cellData);\n\n if (testResult) {\n var singleResult = {\n row: rowIndex,\n col: colIndex,\n data: cellData\n };\n\n queryResult.push(singleResult);\n }\n\n if (cellCallback) {\n cellCallback(instance, rowIndex, colIndex, cellData, testResult);\n }\n }\n }\n\n return queryResult;\n };\n};\n\nSearch.DEFAULT_CALLBACK = function (instance, row, col, data, testResult) {\n instance.getCellMeta(row, col).isSearchResult = testResult;\n};\n\nSearch.DEFAULT_QUERY_METHOD = function (query, value) {\n if (typeof query == 'undefined' || query == null || !query.toLowerCase || query.length === 0) {\n return false;\n }\n if (typeof value == 'undefined' || value == null) {\n return false;\n }\n\n return value.toString().toLowerCase().indexOf(query.toLowerCase()) != -1;\n};\n\nSearch.DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult';\n\nSearch.global = function () {\n\n var defaultCallback = Search.DEFAULT_CALLBACK;\n var defaultQueryMethod = Search.DEFAULT_QUERY_METHOD;\n var defaultSearchResultClass = Search.DEFAULT_SEARCH_RESULT_CLASS;\n\n return {\n getDefaultCallback: function getDefaultCallback() {\n return defaultCallback;\n },\n setDefaultCallback: function setDefaultCallback(newDefaultCallback) {\n defaultCallback = newDefaultCallback;\n },\n getDefaultQueryMethod: function getDefaultQueryMethod() {\n return defaultQueryMethod;\n },\n setDefaultQueryMethod: function setDefaultQueryMethod(newDefaultQueryMethod) {\n defaultQueryMethod = newDefaultQueryMethod;\n },\n getDefaultSearchResultClass: function getDefaultSearchResultClass() {\n return defaultSearchResultClass;\n },\n setDefaultSearchResultClass: function setDefaultSearchResultClass(newSearchResultClass) {\n defaultSearchResultClass = newSearchResultClass;\n }\n };\n}();\n\nfunction SearchCellDecorator(instance, TD, row, col, prop, value, cellProperties) {\n var searchResultClass = cellProperties.search !== null && _typeof(cellProperties.search) == 'object' && cellProperties.search.searchResultClass || Search.global.getDefaultSearchResultClass();\n\n if (cellProperties.isSearchResult) {\n (0, _element.addClass)(TD, searchResultClass);\n } else {\n (0, _element.removeClass)(TD, searchResultClass);\n }\n};\n\nvar originalBaseRenderer = (0, _renderers.getRenderer)('base');\n\n(0, _renderers.registerRenderer)('base', function (instance, TD, row, col, prop, value, cellProperties) {\n originalBaseRenderer.apply(this, arguments);\n SearchCellDecorator.apply(this, arguments);\n});\n\nfunction init() {\n var instance = this;\n\n var pluginEnabled = !!instance.getSettings().search;\n\n if (pluginEnabled) {\n instance.search = new Search(instance);\n } else {\n delete instance.search;\n }\n}\n\n_pluginHooks2.default.getSingleton().add('afterInit', init);\n_pluginHooks2.default.getSingleton().add('afterUpdateSettings', init);\n\nexports.default = Search;\n\n/***/ }),\n/* 258 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _plugins = __webpack_require__(5);\n\nvar _feature = __webpack_require__(34);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @plugin TouchScroll\n * @class TouchScroll\n */\nvar TouchScroll = function (_BasePlugin) {\n _inherits(TouchScroll, _BasePlugin);\n\n function TouchScroll(hotInstance) {\n _classCallCheck(this, TouchScroll);\n\n /**\n * Collection of scrollbars to update.\n *\n * @type {Array}\n */\n var _this = _possibleConstructorReturn(this, (TouchScroll.__proto__ || Object.getPrototypeOf(TouchScroll)).call(this, hotInstance));\n\n _this.scrollbars = [];\n /**\n * Collection of overlays to update.\n *\n * @type {Array}\n */\n _this.clones = [];\n /**\n * Flag which determines if collection of overlays should be refilled on every table render.\n *\n * @type {Boolean}\n * @default false\n */\n _this.lockedCollection = false;\n /**\n * Flag which determines if walkontable should freeze overlays while scrolling.\n *\n * @type {Boolean}\n * @default false\n */\n _this.freezeOverlays = false;\n return _this;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(TouchScroll, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return (0, _feature.isTouchSupported)();\n }\n\n /**\n * Enable the plugin.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterRender', function () {\n return _this2.onAfterRender();\n });\n this.registerEvents();\n\n _get(TouchScroll.prototype.__proto__ || Object.getPrototypeOf(TouchScroll.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.lockedCollection = false;\n\n _get(TouchScroll.prototype.__proto__ || Object.getPrototypeOf(TouchScroll.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(TouchScroll.prototype.__proto__ || Object.getPrototypeOf(TouchScroll.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Register all necessary events.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this3 = this;\n\n this.addHook('beforeTouchScroll', function () {\n return _this3.onBeforeTouchScroll();\n });\n this.addHook('afterMomentumScroll', function () {\n return _this3.onAfterMomentumScroll();\n });\n }\n\n /**\n * After render listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterRender',\n value: function onAfterRender() {\n if (this.lockedCollection) {\n return;\n }\n\n var _hot$view$wt$wtOverla = this.hot.view.wt.wtOverlays,\n topOverlay = _hot$view$wt$wtOverla.topOverlay,\n bottomOverlay = _hot$view$wt$wtOverla.bottomOverlay,\n leftOverlay = _hot$view$wt$wtOverla.leftOverlay,\n topLeftCornerOverlay = _hot$view$wt$wtOverla.topLeftCornerOverlay,\n bottomLeftCornerOverlay = _hot$view$wt$wtOverla.bottomLeftCornerOverlay;\n\n\n this.lockedCollection = true;\n this.scrollbars.length = 0;\n this.scrollbars.push(topOverlay);\n\n if (bottomOverlay.clone) {\n this.scrollbars.push(bottomOverlay);\n }\n this.scrollbars.push(leftOverlay);\n\n if (topLeftCornerOverlay) {\n this.scrollbars.push(topLeftCornerOverlay);\n }\n if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) {\n this.scrollbars.push(bottomLeftCornerOverlay);\n }\n\n this.clones.length = 0;\n\n if (topOverlay.needFullRender) {\n this.clones.push(topOverlay.clone.wtTable.holder.parentNode);\n }\n if (bottomOverlay.needFullRender) {\n this.clones.push(bottomOverlay.clone.wtTable.holder.parentNode);\n }\n if (leftOverlay.needFullRender) {\n this.clones.push(leftOverlay.clone.wtTable.holder.parentNode);\n }\n if (topLeftCornerOverlay) {\n this.clones.push(topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n }\n if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) {\n this.clones.push(bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n }\n }\n\n /**\n * Touch scroll listener.\n *\n * @private\n */\n\n }, {\n key: 'onBeforeTouchScroll',\n value: function onBeforeTouchScroll() {\n this.freezeOverlays = true;\n\n (0, _array.arrayEach)(this.clones, function (clone) {\n (0, _element.addClass)(clone, 'hide-tween');\n });\n }\n\n /**\n * After momentum scroll listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterMomentumScroll',\n value: function onAfterMomentumScroll() {\n var _this4 = this;\n\n this.freezeOverlays = false;\n\n (0, _array.arrayEach)(this.clones, function (clone) {\n (0, _element.removeClass)(clone, 'hide-tween');\n (0, _element.addClass)(clone, 'show-tween');\n });\n\n setTimeout(function () {\n (0, _array.arrayEach)(_this4.clones, function (clone) {\n (0, _element.removeClass)(clone, 'show-tween');\n });\n }, 400);\n\n (0, _array.arrayEach)(this.scrollbars, function (scrollbar) {\n scrollbar.refresh();\n scrollbar.resetFixedPosition();\n });\n\n this.hot.view.wt.wtOverlays.syncScrollWithMaster();\n }\n }]);\n\n return TouchScroll;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('touchScroll', TouchScroll);\n\nexports.default = TouchScroll;\n\n/***/ }),\n/* 259 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _object = __webpack_require__(2);\n\nvar _event = __webpack_require__(7);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @description\n * Handsontable UndoRedo plugin. It allows to undo and redo certain actions done in the table.\n * Please note, that not all actions are currently undo-able.\n *\n * @example\n * ```js\n * ...\n * undo: true\n * ...\n * ```\n * @class UndoRedo\n * @plugin UndoRedo\n */\n/**\n * Handsontable UndoRedo class\n */\nfunction UndoRedo(instance) {\n var plugin = this;\n this.instance = instance;\n this.doneActions = [];\n this.undoneActions = [];\n this.ignoreNewActions = false;\n\n instance.addHook('afterChange', function (changes, source) {\n if (changes && source !== 'UndoRedo.undo' && source !== 'UndoRedo.redo') {\n plugin.done(new UndoRedo.ChangeAction(changes));\n }\n });\n\n instance.addHook('afterCreateRow', function (index, amount, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.undo' || source === 'auto') {\n return;\n }\n\n var action = new UndoRedo.CreateRowAction(index, amount);\n plugin.done(action);\n });\n\n instance.addHook('beforeRemoveRow', function (index, amount, logicRows, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n var originalData = plugin.instance.getSourceDataArray();\n\n index = (originalData.length + index) % originalData.length;\n\n var removedData = (0, _object.deepClone)(originalData.slice(index, index + amount));\n\n plugin.done(new UndoRedo.RemoveRowAction(index, removedData));\n });\n\n instance.addHook('afterCreateCol', function (index, amount, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n plugin.done(new UndoRedo.CreateColumnAction(index, amount));\n });\n\n instance.addHook('beforeRemoveCol', function (index, amount, logicColumns, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n var originalData = plugin.instance.getSourceDataArray();\n\n index = (plugin.instance.countCols() + index) % plugin.instance.countCols();\n\n var removedData = [];\n var headers = [];\n var indexes = [];\n\n (0, _number.rangeEach)(originalData.length - 1, function (i) {\n var column = [];\n var origRow = originalData[i];\n\n (0, _number.rangeEach)(index, index + (amount - 1), function (j) {\n column.push(origRow[instance.runHooks('modifyCol', j)]);\n });\n removedData.push(column);\n });\n\n (0, _number.rangeEach)(amount - 1, function (i) {\n indexes.push(instance.runHooks('modifyCol', index + i));\n });\n\n if (Array.isArray(instance.getSettings().colHeaders)) {\n (0, _number.rangeEach)(amount - 1, function (i) {\n headers.push(instance.getSettings().colHeaders[instance.runHooks('modifyCol', index + i)] || null);\n });\n }\n\n var manualColumnMovePlugin = plugin.instance.getPlugin('manualColumnMove');\n\n var columnsMap = manualColumnMovePlugin.isEnabled() ? manualColumnMovePlugin.columnsMapper.__arrayMap : [];\n var action = new UndoRedo.RemoveColumnAction(index, indexes, removedData, headers, columnsMap);\n\n plugin.done(action);\n });\n\n instance.addHook('beforeCellAlignment', function (stateBefore, range, type, alignment) {\n var action = new UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment);\n plugin.done(action);\n });\n\n instance.addHook('beforeFilter', function (formulaStacks) {\n plugin.done(new UndoRedo.FiltersAction(formulaStacks));\n });\n\n instance.addHook('beforeRowMove', function (movedRows, target) {\n if (movedRows === false) {\n return;\n }\n\n plugin.done(new UndoRedo.RowMoveAction(movedRows, target));\n });\n};\n\nUndoRedo.prototype.done = function (action) {\n if (!this.ignoreNewActions) {\n this.doneActions.push(action);\n this.undoneActions.length = 0;\n }\n};\n\n/**\n * Undo last edit.\n *\n * @function undo\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.undo = function () {\n if (this.isUndoAvailable()) {\n var action = this.doneActions.pop();\n var actionClone = (0, _object.deepClone)(action);\n var instance = this.instance;\n\n var continueAction = instance.runHooks('beforeUndo', actionClone);\n\n if (continueAction === false) {\n return;\n }\n\n this.ignoreNewActions = true;\n var that = this;\n action.undo(this.instance, function () {\n that.ignoreNewActions = false;\n that.undoneActions.push(action);\n });\n\n instance.runHooks('afterUndo', actionClone);\n }\n};\n\n/**\n * Redo edit (used to reverse an undo).\n *\n * @function redo\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.redo = function () {\n if (this.isRedoAvailable()) {\n var action = this.undoneActions.pop();\n var actionClone = (0, _object.deepClone)(action);\n var instance = this.instance;\n\n var continueAction = instance.runHooks('beforeRedo', actionClone);\n\n if (continueAction === false) {\n return;\n }\n\n this.ignoreNewActions = true;\n var that = this;\n action.redo(this.instance, function () {\n that.ignoreNewActions = false;\n that.doneActions.push(action);\n });\n\n instance.runHooks('afterRedo', actionClone);\n }\n};\n\n/**\n * Check if undo action is available.\n *\n * @function isUndoAvailable\n * @memberof UndoRedo#\n * @return {Boolean} Return `true` if undo can be performed, `false` otherwise\n */\nUndoRedo.prototype.isUndoAvailable = function () {\n return this.doneActions.length > 0;\n};\n\n/**\n * Check if redo action is available.\n *\n * @function isRedoAvailable\n * @memberof UndoRedo#\n * @return {Boolean} Return `true` if redo can be performed, `false` otherwise.\n */\nUndoRedo.prototype.isRedoAvailable = function () {\n return this.undoneActions.length > 0;\n};\n\n/**\n * Clears undo history.\n *\n * @function clear\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.clear = function () {\n this.doneActions.length = 0;\n this.undoneActions.length = 0;\n};\n\nUndoRedo.Action = function () {};\nUndoRedo.Action.prototype.undo = function () {};\nUndoRedo.Action.prototype.redo = function () {};\n\n/**\n * Change action.\n */\nUndoRedo.ChangeAction = function (changes) {\n this.changes = changes;\n this.actionType = 'change';\n};\n(0, _object.inherit)(UndoRedo.ChangeAction, UndoRedo.Action);\n\nUndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) {\n var data = (0, _object.deepClone)(this.changes),\n emptyRowsAtTheEnd = instance.countEmptyRows(true),\n emptyColsAtTheEnd = instance.countEmptyCols(true);\n\n for (var i = 0, len = data.length; i < len; i++) {\n data[i].splice(3, 1);\n }\n\n instance.addHookOnce('afterChange', undoneCallback);\n\n instance.setDataAtRowProp(data, null, null, 'UndoRedo.undo');\n\n for (var _i = 0, _len = data.length; _i < _len; _i++) {\n if (instance.getSettings().minSpareRows && data[_i][0] + 1 + instance.getSettings().minSpareRows === instance.countRows() && emptyRowsAtTheEnd == instance.getSettings().minSpareRows) {\n\n instance.alter('remove_row', parseInt(data[_i][0] + 1, 10), instance.getSettings().minSpareRows);\n instance.undoRedo.doneActions.pop();\n }\n\n if (instance.getSettings().minSpareCols && data[_i][1] + 1 + instance.getSettings().minSpareCols === instance.countCols() && emptyColsAtTheEnd == instance.getSettings().minSpareCols) {\n\n instance.alter('remove_col', parseInt(data[_i][1] + 1, 10), instance.getSettings().minSpareCols);\n instance.undoRedo.doneActions.pop();\n }\n }\n};\nUndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) {\n var data = (0, _object.deepClone)(this.changes);\n\n for (var i = 0, len = data.length; i < len; i++) {\n data[i].splice(2, 1);\n }\n\n instance.addHookOnce('afterChange', onFinishCallback);\n instance.setDataAtRowProp(data, null, null, 'UndoRedo.redo');\n};\n\n/**\n * Create row action.\n */\nUndoRedo.CreateRowAction = function (index, amount) {\n this.index = index;\n this.amount = amount;\n this.actionType = 'insert_row';\n};\n(0, _object.inherit)(UndoRedo.CreateRowAction, UndoRedo.Action);\n\nUndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {\n var rowCount = instance.countRows(),\n minSpareRows = instance.getSettings().minSpareRows;\n\n if (this.index >= rowCount && this.index - minSpareRows < rowCount) {\n this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change\n }\n\n instance.addHookOnce('afterRemoveRow', undoneCallback);\n instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');\n};\nUndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterCreateRow', redoneCallback);\n instance.alter('insert_row', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Remove row action.\n */\nUndoRedo.RemoveRowAction = function (index, data) {\n this.index = index;\n this.data = data;\n this.actionType = 'remove_row';\n};\n(0, _object.inherit)(UndoRedo.RemoveRowAction, UndoRedo.Action);\n\nUndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {\n instance.alter('insert_row', this.index, this.data.length, 'UndoRedo.undo');\n instance.addHookOnce('afterRender', undoneCallback);\n instance.populateFromArray(this.index, 0, this.data, void 0, void 0, 'UndoRedo.undo');\n};\nUndoRedo.RemoveRowAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterRemoveRow', redoneCallback);\n instance.alter('remove_row', this.index, this.data.length, 'UndoRedo.redo');\n};\n\n/**\n * Create column action.\n */\nUndoRedo.CreateColumnAction = function (index, amount) {\n this.index = index;\n this.amount = amount;\n this.actionType = 'insert_col';\n};\n(0, _object.inherit)(UndoRedo.CreateColumnAction, UndoRedo.Action);\n\nUndoRedo.CreateColumnAction.prototype.undo = function (instance, undoneCallback) {\n instance.addHookOnce('afterRemoveCol', undoneCallback);\n instance.alter('remove_col', this.index, this.amount, 'UndoRedo.undo');\n};\nUndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterCreateCol', redoneCallback);\n instance.alter('insert_col', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Remove column action.\n */\nUndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions) {\n this.index = index;\n this.indexes = indexes;\n this.data = data;\n this.amount = this.data[0].length;\n this.headers = headers;\n this.columnPositions = columnPositions.slice(0);\n this.actionType = 'remove_col';\n};\n(0, _object.inherit)(UndoRedo.RemoveColumnAction, UndoRedo.Action);\n\nUndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) {\n var _this = this;\n\n var row = void 0;\n var ascendingIndexes = this.indexes.slice(0).sort();\n var sortByIndexes = function sortByIndexes(elem, j, arr) {\n return arr[_this.indexes.indexOf(ascendingIndexes[j])];\n };\n\n var sortedData = [];\n (0, _number.rangeEach)(this.data.length - 1, function (i) {\n sortedData[i] = (0, _array.arrayMap)(_this.data[i], sortByIndexes);\n });\n\n var sortedHeaders = [];\n sortedHeaders = (0, _array.arrayMap)(this.headers, sortByIndexes);\n\n var changes = [];\n\n // TODO: Temporary hook for undo/redo mess\n instance.runHooks('beforeCreateCol', this.indexes[0], this.indexes[this.indexes.length - 1], 'UndoRedo.undo');\n\n (0, _number.rangeEach)(this.data.length - 1, function (i) {\n row = instance.getSourceDataAtRow(i);\n\n (0, _number.rangeEach)(ascendingIndexes.length - 1, function (j) {\n row.splice(ascendingIndexes[j], 0, sortedData[i][j]);\n changes.push([i, ascendingIndexes[j], null, sortedData[i][j]]);\n });\n });\n\n // TODO: Temporary hook for undo/redo mess\n if (instance.getPlugin('formulas')) {\n instance.getPlugin('formulas').onAfterSetDataAtCell(changes);\n }\n\n if (typeof this.headers !== 'undefined') {\n (0, _number.rangeEach)(sortedHeaders.length - 1, function (j) {\n instance.getSettings().colHeaders.splice(ascendingIndexes[j], 0, sortedHeaders[j]);\n });\n }\n\n if (instance.getPlugin('manualColumnMove')) {\n instance.getPlugin('manualColumnMove').columnsMapper.__arrayMap = this.columnPositions;\n }\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n // TODO: Temporary hook for undo/redo mess\n instance.runHooks('afterCreateCol', this.indexes[0], this.indexes[this.indexes.length - 1], 'UndoRedo.undo');\n\n if (instance.getPlugin('formulas')) {\n instance.getPlugin('formulas').recalculateFull();\n }\n\n instance.render();\n};\n\nUndoRedo.RemoveColumnAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterRemoveCol', redoneCallback);\n instance.alter('remove_col', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Cell alignment action.\n */\nUndoRedo.CellAlignmentAction = function (stateBefore, range, type, alignment) {\n this.stateBefore = stateBefore;\n this.range = range;\n this.type = type;\n this.alignment = alignment;\n};\nUndoRedo.CellAlignmentAction.prototype.undo = function (instance, undoneCallback) {\n if (!instance.getPlugin('contextMenu').isEnabled()) {\n return;\n }\n for (var row = this.range.from.row; row <= this.range.to.row; row++) {\n for (var col = this.range.from.col; col <= this.range.to.col; col++) {\n instance.setCellMeta(row, col, 'className', this.stateBefore[row][col] || ' htLeft');\n }\n }\n\n instance.addHookOnce('afterRender', undoneCallback);\n instance.render();\n};\nUndoRedo.CellAlignmentAction.prototype.redo = function (instance, undoneCallback) {\n if (!instance.getPlugin('contextMenu').isEnabled()) {\n return;\n }\n instance.selectCell(this.range.from.row, this.range.from.col, this.range.to.row, this.range.to.col);\n instance.getPlugin('contextMenu').executeCommand('alignment:' + this.alignment.replace('ht', '').toLowerCase());\n\n instance.addHookOnce('afterRender', undoneCallback);\n instance.render();\n};\n\n/**\n * Filters action.\n */\nUndoRedo.FiltersAction = function (formulaStacks) {\n this.formulaStacks = formulaStacks;\n this.actionType = 'filter';\n};\n(0, _object.inherit)(UndoRedo.FiltersAction, UndoRedo.Action);\n\nUndoRedo.FiltersAction.prototype.undo = function (instance, undoneCallback) {\n var filters = instance.getPlugin('filters');\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n filters.formulaCollection.importAllFormulas(this.formulaStacks.slice(0, this.formulaStacks.length - 1));\n filters.filter();\n};\nUndoRedo.FiltersAction.prototype.redo = function (instance, redoneCallback) {\n var filters = instance.getPlugin('filters');\n\n instance.addHookOnce('afterRender', redoneCallback);\n\n filters.formulaCollection.importAllFormulas(this.formulaStacks);\n filters.filter();\n};\n\n/**\n * ManualRowMove action.\n * @TODO: removeRow undo should works on logical index\n */\nUndoRedo.RowMoveAction = function (movedRows, target) {\n this.rows = movedRows.slice();\n this.target = target;\n};\n(0, _object.inherit)(UndoRedo.RowMoveAction, UndoRedo.Action);\n\nUndoRedo.RowMoveAction.prototype.undo = function (instance, undoneCallback) {\n var manualRowMove = instance.getPlugin('manualRowMove');\n\n instance.addHookOnce('afterRender', undoneCallback);\n var mod = this.rows[0] < this.target ? -1 * this.rows.length : 0;\n var newTarget = this.rows[0] > this.target ? this.rows[0] + this.rows.length : this.rows[0];\n var newRows = [];\n var rowsLen = this.rows.length + mod;\n\n for (var i = mod; i < rowsLen; i++) {\n newRows.push(this.target + i);\n }\n manualRowMove.moveRows(newRows.slice(), newTarget);\n instance.render();\n\n instance.selection.setRangeStartOnly(new _src.CellCoords(this.rows[0], 0));\n instance.selection.setRangeEnd(new _src.CellCoords(this.rows[this.rows.length - 1], instance.countCols() - 1));\n};\nUndoRedo.RowMoveAction.prototype.redo = function (instance, redoneCallback) {\n var manualRowMove = instance.getPlugin('manualRowMove');\n\n instance.addHookOnce('afterRender', redoneCallback);\n manualRowMove.moveRows(this.rows.slice(), this.target);\n instance.render();\n var startSelection = this.rows[0] < this.target ? this.target - this.rows.length : this.target;\n instance.selection.setRangeStartOnly(new _src.CellCoords(startSelection, 0));\n instance.selection.setRangeEnd(new _src.CellCoords(startSelection + this.rows.length - 1, instance.countCols() - 1));\n};\n\nfunction init() {\n var instance = this;\n var pluginEnabled = typeof instance.getSettings().undo == 'undefined' || instance.getSettings().undo;\n\n if (pluginEnabled) {\n if (!instance.undoRedo) {\n /**\n * Instance of Handsontable.UndoRedo Plugin {@link Handsontable.UndoRedo}\n *\n * @alias undoRedo\n * @memberof! Handsontable.Core#\n * @type {UndoRedo}\n */\n instance.undoRedo = new UndoRedo(instance);\n\n exposeUndoRedoMethods(instance);\n\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n instance.addHook('afterChange', onAfterChange);\n }\n } else if (instance.undoRedo) {\n delete instance.undoRedo;\n\n removeExposedUndoRedoMethods(instance);\n\n instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n instance.removeHook('afterChange', onAfterChange);\n }\n}\n\nfunction onBeforeKeyDown(event) {\n var instance = this;\n\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode === 89 || event.shiftKey && event.keyCode === 90) {\n // CTRL + Y or CTRL + SHIFT + Z\n instance.undoRedo.redo();\n (0, _event.stopImmediatePropagation)(event);\n } else if (event.keyCode === 90) {\n // CTRL + Z\n instance.undoRedo.undo();\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n}\n\nfunction onAfterChange(changes, source) {\n var instance = this;\n if (source === 'loadData') {\n return instance.undoRedo.clear();\n }\n}\n\nfunction exposeUndoRedoMethods(instance) {\n /**\n * {@link UndoRedo#undo}\n * @alias undo\n * @memberof! Handsontable.Core#\n */\n instance.undo = function () {\n return instance.undoRedo.undo();\n };\n\n /**\n * {@link UndoRedo#redo}\n * @alias redo\n * @memberof! Handsontable.Core#\n */\n instance.redo = function () {\n return instance.undoRedo.redo();\n };\n\n /**\n * {@link UndoRedo#isUndoAvailable}\n * @alias isUndoAvailable\n * @memberof! Handsontable.Core#\n */\n instance.isUndoAvailable = function () {\n return instance.undoRedo.isUndoAvailable();\n };\n\n /**\n * {@link UndoRedo#isRedoAvailable}\n * @alias isRedoAvailable\n * @memberof! Handsontable.Core#\n */\n instance.isRedoAvailable = function () {\n return instance.undoRedo.isRedoAvailable();\n };\n\n /**\n * {@link UndoRedo#clear}\n * @alias clearUndo\n * @memberof! Handsontable.Core#\n */\n instance.clearUndo = function () {\n return instance.undoRedo.clear();\n };\n}\n\nfunction removeExposedUndoRedoMethods(instance) {\n delete instance.undo;\n delete instance.redo;\n delete instance.isUndoAvailable;\n delete instance.isRedoAvailable;\n delete instance.clearUndo;\n}\n\nvar hook = _pluginHooks2.default.getSingleton();\n\nhook.add('afterInit', init);\nhook.add('afterUpdateSettings', init);\n\nhook.register('beforeUndo');\nhook.register('afterUndo');\nhook.register('beforeRedo');\nhook.register('afterRedo');\n\n/***/ }),\n/* 260 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nfunction cellDecorator(instance, TD, row, col, prop, value, cellProperties) {\n if (cellProperties.className) {\n if (TD.className) {\n TD.className = TD.className + ' ' + cellProperties.className;\n } else {\n TD.className = cellProperties.className;\n }\n }\n\n if (cellProperties.readOnly) {\n (0, _element.addClass)(TD, cellProperties.readOnlyCellClassName);\n }\n\n if (cellProperties.valid === false && cellProperties.invalidCellClassName) {\n (0, _element.addClass)(TD, cellProperties.invalidCellClassName);\n } else {\n (0, _element.removeClass)(TD, cellProperties.invalidCellClassName);\n }\n\n if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) {\n (0, _element.addClass)(TD, cellProperties.noWordWrapClassName);\n }\n\n if (!value && cellProperties.placeholder) {\n (0, _element.addClass)(TD, cellProperties.placeholderCellClassName);\n }\n} /**\n * Adds appropriate CSS class to table cell, based on cellProperties\n */\nexports.default = cellDecorator;\n\n/***/ }),\n/* 261 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _src = __webpack_require__(11);\n\nvar _index = __webpack_require__(9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar clonableWRAPPER = document.createElement('DIV');\nclonableWRAPPER.className = 'htAutocompleteWrapper';\n\nvar clonableARROW = document.createElement('DIV');\nclonableARROW.className = 'htAutocompleteArrow';\n// workaround for https://github.com/handsontable/handsontable/issues/1946\n// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\nclonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660)));\n\nvar wrapTdContentWithWrapper = function wrapTdContentWithWrapper(TD, WRAPPER) {\n WRAPPER.innerHTML = TD.innerHTML;\n (0, _element.empty)(TD);\n TD.appendChild(WRAPPER);\n};\n\n/**\n * Autocomplete renderer\n *\n * @private\n * @renderer AutocompleteRenderer\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properites (shared by cell renderer and editor)\n */\nfunction autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var WRAPPER = clonableWRAPPER.cloneNode(true); // this is faster than createElement\n var ARROW = clonableARROW.cloneNode(true); // this is faster than createElement\n\n if (cellProperties.allowHtml) {\n (0, _index.getRenderer)('html').apply(this, arguments);\n } else {\n (0, _index.getRenderer)('text').apply(this, arguments);\n }\n\n TD.appendChild(ARROW);\n (0, _element.addClass)(TD, 'htAutocomplete');\n\n if (!TD.firstChild) {\n // http://jsperf.com/empty-node-if-needed\n // otherwise empty fields appear borderless in demo/renderers.html (IE)\n TD.appendChild(document.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n }\n\n if (!instance.acArrowListener) {\n var eventManager = new _eventManager2.default(instance);\n\n // not very elegant but easy and fast\n instance.acArrowListener = function (event) {\n if ((0, _element.hasClass)(event.target, 'htAutocompleteArrow')) {\n instance.view.wt.getSetting('onCellDblClick', null, new _src.CellCoords(row, col), TD);\n }\n };\n\n eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener);\n\n // We need to unbind the listener after the table has been destroyed\n instance.addHookOnce('afterDestroy', function () {\n eventManager.destroy();\n });\n }\n}\n\nexports.default = autocompleteRenderer;\n\n/***/ }),\n/* 262 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _string = __webpack_require__(27);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _unicode = __webpack_require__(16);\n\nvar _function = __webpack_require__(35);\n\nvar _event = __webpack_require__(7);\n\nvar _index = __webpack_require__(9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar isListeningKeyDownEvent = new WeakMap();\nvar isCheckboxListenerAdded = new WeakMap();\nvar BAD_VALUE_CLASS = 'htBadValue';\n\n/**\n * Checkbox renderer\n *\n * @private\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('base').apply(this, arguments);\n\n var eventManager = registerEvents(instance);\n var input = createInput();\n var labelOptions = cellProperties.label;\n var badValue = false;\n\n if (typeof cellProperties.checkedTemplate === 'undefined') {\n cellProperties.checkedTemplate = true;\n }\n if (typeof cellProperties.uncheckedTemplate === 'undefined') {\n cellProperties.uncheckedTemplate = false;\n }\n\n (0, _element.empty)(TD); // TODO identify under what circumstances this line can be removed\n\n if (value === cellProperties.checkedTemplate || (0, _string.equalsIgnoreCase)(value, cellProperties.checkedTemplate)) {\n input.checked = true;\n } else if (value === cellProperties.uncheckedTemplate || (0, _string.equalsIgnoreCase)(value, cellProperties.uncheckedTemplate)) {\n input.checked = false;\n } else if (value === null) {\n // default value\n (0, _element.addClass)(input, 'noValue');\n } else {\n input.style.display = 'none';\n (0, _element.addClass)(input, BAD_VALUE_CLASS);\n badValue = true;\n }\n\n input.setAttribute('data-row', row);\n input.setAttribute('data-col', col);\n\n if (!badValue && labelOptions) {\n var labelText = '';\n\n if (labelOptions.value) {\n labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value;\n } else if (labelOptions.property) {\n labelText = instance.getDataAtRowProp(row, labelOptions.property);\n }\n var label = createLabel(labelText);\n\n if (labelOptions.position === 'before') {\n label.appendChild(input);\n } else {\n label.insertBefore(input, label.firstChild);\n }\n input = label;\n }\n\n TD.appendChild(input);\n\n if (badValue) {\n TD.appendChild(document.createTextNode('#bad-value#'));\n }\n\n if (!isListeningKeyDownEvent.has(instance)) {\n isListeningKeyDownEvent.set(instance, true);\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n }\n\n /**\n * On before key down DOM listener.\n *\n * @private\n * @param {Event} event\n */\n function onBeforeKeyDown(event) {\n var toggleKeys = 'SPACE|ENTER';\n var switchOffKeys = 'DELETE|BACKSPACE';\n var isKeyCode = (0, _function.partial)(_unicode.isKey, event.keyCode);\n\n if (isKeyCode(toggleKeys + '|' + switchOffKeys) && !(0, _event.isImmediatePropagationStopped)(event)) {\n eachSelectedCheckboxCell(function () {\n (0, _event.stopImmediatePropagation)(event);\n event.preventDefault();\n });\n }\n if (isKeyCode(toggleKeys)) {\n changeSelectedCheckboxesState();\n }\n if (isKeyCode(switchOffKeys)) {\n changeSelectedCheckboxesState(true);\n }\n }\n\n /**\n * Change checkbox checked property\n *\n * @private\n * @param {Boolean} [uncheckCheckbox=false]\n */\n function changeSelectedCheckboxesState() {\n var uncheckCheckbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var selRange = instance.getSelectedRange();\n\n if (!selRange) {\n return;\n }\n\n var topLeft = selRange.getTopLeftCorner();\n var bottomRight = selRange.getBottomRightCorner();\n var changes = [];\n\n for (var _row = topLeft.row; _row <= bottomRight.row; _row += 1) {\n for (var _col = topLeft.col; _col <= bottomRight.col; _col += 1) {\n var _cellProperties = instance.getCellMeta(_row, _col);\n\n if (_cellProperties.type !== 'checkbox') {\n return;\n }\n\n /* eslint-disable no-continue */\n if (_cellProperties.readOnly === true) {\n continue;\n }\n\n if (typeof _cellProperties.checkedTemplate === 'undefined') {\n _cellProperties.checkedTemplate = true;\n }\n if (typeof _cellProperties.uncheckedTemplate === 'undefined') {\n _cellProperties.uncheckedTemplate = false;\n }\n\n var dataAtCell = instance.getDataAtCell(_row, _col);\n\n if (uncheckCheckbox === false) {\n if (dataAtCell === _cellProperties.checkedTemplate) {\n changes.push([_row, _col, _cellProperties.uncheckedTemplate]);\n } else if ([_cellProperties.uncheckedTemplate, null, void 0].indexOf(dataAtCell) !== -1) {\n changes.push([_row, _col, _cellProperties.checkedTemplate]);\n }\n } else {\n changes.push([_row, _col, _cellProperties.uncheckedTemplate]);\n }\n }\n }\n\n if (changes.length > 0) {\n instance.setDataAtCell(changes);\n }\n }\n\n /**\n * Call callback for each found selected cell with checkbox type.\n *\n * @private\n * @param {Function} callback\n */\n function eachSelectedCheckboxCell(callback) {\n var selRange = instance.getSelectedRange();\n\n if (!selRange) {\n return;\n }\n var topLeft = selRange.getTopLeftCorner();\n var bottomRight = selRange.getBottomRightCorner();\n\n for (var _row2 = topLeft.row; _row2 <= bottomRight.row; _row2++) {\n for (var _col2 = topLeft.col; _col2 <= bottomRight.col; _col2++) {\n var _cellProperties2 = instance.getCellMeta(_row2, _col2);\n\n if (_cellProperties2.type !== 'checkbox') {\n return;\n }\n\n var cell = instance.getCell(_row2, _col2);\n\n if (cell == null) {\n\n callback(_row2, _col2, _cellProperties2);\n } else {\n var checkboxes = cell.querySelectorAll('input[type=checkbox]');\n\n if (checkboxes.length > 0 && !_cellProperties2.readOnly) {\n callback(checkboxes);\n }\n }\n }\n }\n }\n}\n\n/**\n * Register checkbox listeners.\n *\n * @param {Handsontable} instance Handsontable instance.\n * @returns {EventManager}\n */\nfunction registerEvents(instance) {\n var eventManager = isCheckboxListenerAdded.get(instance);\n\n if (!eventManager) {\n eventManager = new _eventManager2.default(instance);\n eventManager.addEventListener(instance.rootElement, 'click', function (event) {\n return onClick(event, instance);\n });\n eventManager.addEventListener(instance.rootElement, 'mouseup', function (event) {\n return onMouseUp(event, instance);\n });\n eventManager.addEventListener(instance.rootElement, 'change', function (event) {\n return onChange(event, instance);\n });\n\n isCheckboxListenerAdded.set(instance, eventManager);\n }\n\n return eventManager;\n}\n\n/**\n * Create input element.\n *\n * @returns {Node}\n */\nfunction createInput() {\n var input = document.createElement('input');\n\n input.className = 'htCheckboxRendererInput';\n input.type = 'checkbox';\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('tabindex', '-1');\n\n return input.cloneNode(false);\n}\n\n/**\n * Create label element.\n *\n * @returns {Node}\n */\nfunction createLabel(text) {\n var label = document.createElement('label');\n\n label.className = 'htCheckboxRendererLabel';\n label.appendChild(document.createTextNode(text));\n\n return label.cloneNode(true);\n}\n\n/**\n * `mouseup` callback.\n *\n * @private\n * @param {Event} event `mouseup` event.\n * @param {Object} instance Handsontable instance.\n */\nfunction onMouseUp(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return;\n }\n setTimeout(instance.listen, 10);\n}\n\n/**\n * `click` callback.\n *\n * @private\n * @param {Event} event `click` event.\n * @param {Object} instance Handsontable instance.\n */\nfunction onClick(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return false;\n }\n\n var row = parseInt(event.target.getAttribute('data-row'), 10);\n var col = parseInt(event.target.getAttribute('data-col'), 10);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.readOnly) {\n event.preventDefault();\n }\n}\n\n/**\n * `change` callback.\n *\n * @param {Event} event `change` event.\n * @param {Object} instance Handsontable instance.\n * @param {Object} cellProperties Reference to cell properties.\n * @returns {Boolean}\n */\nfunction onChange(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return false;\n }\n\n var row = parseInt(event.target.getAttribute('data-row'), 10);\n var col = parseInt(event.target.getAttribute('data-col'), 10);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (!cellProperties.readOnly) {\n var newCheckboxValue = null;\n\n if (event.target.checked) {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? true : cellProperties.checkedTemplate;\n } else {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? false : cellProperties.uncheckedTemplate;\n }\n\n instance.setDataAtCell(row, col, newCheckboxValue);\n }\n}\n\n/**\n * Check if the provided element is the checkbox input.\n *\n * @private\n * @param {HTMLElement} element The element in question.\n * @returns {Boolean}\n */\nfunction isCheckboxInput(element) {\n return element.tagName === 'INPUT' && element.getAttribute('type') === 'checkbox';\n}\n\nexports.default = checkboxRenderer;\n\n/***/ }),\n/* 263 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _index = __webpack_require__(9);\n\n/**\n * @private\n * @renderer HtmlRenderer\n * @param instance\n * @param TD\n * @param row\n * @param col\n * @param prop\n * @param value\n * @param cellProperties\n */\nfunction htmlRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('base').apply(this, arguments);\n\n if (value === null || value === void 0) {\n value = '';\n }\n\n (0, _element.fastInnerHTML)(TD, value);\n}\n\nexports.default = htmlRenderer;\n\n/***/ }),\n/* 264 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _numbro = __webpack_require__(86);\n\nvar _numbro2 = _interopRequireDefault(_numbro);\n\nvar _index = __webpack_require__(9);\n\nvar _number = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Numeric cell renderer\n *\n * @private\n * @renderer NumericRenderer\n * @dependencies numbro\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction numericRenderer(instance, TD, row, col, prop, value, cellProperties) {\n if ((0, _number.isNumeric)(value)) {\n if (typeof cellProperties.language !== 'undefined') {\n _numbro2.default.culture(cellProperties.language);\n }\n\n value = (0, _numbro2.default)(value).format(cellProperties.format || '0');\n\n var className = cellProperties.className || '';\n\n var classArr = className.length ? className.split(' ') : [];\n\n if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 && classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) {\n classArr.push('htRight');\n }\n\n if (classArr.indexOf('htNumeric') < 0) {\n classArr.push('htNumeric');\n }\n\n cellProperties.className = classArr.join(' ');\n }\n\n (0, _index.getRenderer)('text')(instance, TD, row, col, prop, value, cellProperties);\n}\n\nexports.default = numericRenderer;\n\n/***/ }),\n/* 265 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _index = __webpack_require__(9);\n\nvar _number = __webpack_require__(6);\n\n/**\n * @private\n * @renderer PasswordRenderer\n * @param instance\n * @param TD\n * @param row\n * @param col\n * @param prop\n * @param value\n * @param cellProperties\n */\nfunction passwordRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('text').apply(this, arguments);\n\n value = TD.innerHTML;\n\n var hashLength = cellProperties.hashLength || value.length;\n var hashSymbol = cellProperties.hashSymbol || '*';\n\n var hash = '';\n\n (0, _number.rangeEach)(hashLength - 1, function () {\n hash += hashSymbol;\n });\n (0, _element.fastInnerHTML)(TD, hash);\n}\n\nexports.default = passwordRenderer;\n\n/***/ }),\n/* 266 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _mixed = __webpack_require__(20);\n\nvar _index = __webpack_require__(9);\n\n/**\n * Default text renderer\n *\n * @private\n * @renderer TextRenderer\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction textRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('base').apply(this, arguments);\n\n if (!value && cellProperties.placeholder) {\n value = cellProperties.placeholder;\n }\n\n var escaped = (0, _mixed.stringify)(value);\n\n if (!instance.getSettings().trimWhitespace) {\n escaped = escaped.replace(/ /g, String.fromCharCode(160));\n }\n\n if (cellProperties.rendererTemplate) {\n (0, _element.empty)(TD);\n var TEMPLATE = document.createElement('TEMPLATE');\n TEMPLATE.setAttribute('bind', '{{}}');\n TEMPLATE.innerHTML = cellProperties.rendererTemplate;\n HTMLTemplateElement.decorate(TEMPLATE);\n TEMPLATE.model = instance.getSourceDataAtRow(row);\n TD.appendChild(TEMPLATE);\n } else {\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n (0, _element.fastInnerText)(TD, escaped);\n }\n}\n\nexports.default = textRenderer;\n\n/***/ }),\n/* 267 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _event = __webpack_require__(7);\n\nvar _src = __webpack_require__(11);\n\nvar _src2 = _interopRequireDefault(_src);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Handsontable TableView constructor\n * @param {Object} instance\n */\nfunction TableView(instance) {\n var _this = this;\n\n var that = this;\n\n this.eventManager = new _eventManager2.default(instance);\n this.instance = instance;\n this.settings = instance.getSettings();\n this.selectionMouseDown = false;\n\n var originalStyle = instance.rootElement.getAttribute('style');\n\n if (originalStyle) {\n instance.rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions\n }\n\n (0, _element.addClass)(instance.rootElement, 'handsontable');\n\n var table = document.createElement('TABLE');\n (0, _element.addClass)(table, 'htCore');\n\n if (instance.getSettings().tableClassName) {\n (0, _element.addClass)(table, instance.getSettings().tableClassName);\n }\n this.THEAD = document.createElement('THEAD');\n table.appendChild(this.THEAD);\n this.TBODY = document.createElement('TBODY');\n table.appendChild(this.TBODY);\n\n instance.table = table;\n\n instance.container.insertBefore(table, instance.container.firstChild);\n\n this.eventManager.addEventListener(instance.rootElement, 'mousedown', function (event) {\n this.selectionMouseDown = true;\n\n if (!that.isTextSelectionAllowed(event.target)) {\n clearTextSelection();\n event.preventDefault();\n window.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.\n }\n });\n this.eventManager.addEventListener(instance.rootElement, 'mouseup', function (event) {\n this.selectionMouseDown = false;\n });\n this.eventManager.addEventListener(instance.rootElement, 'mousemove', function (event) {\n if (this.selectionMouseDown && !that.isTextSelectionAllowed(event.target)) {\n clearTextSelection();\n event.preventDefault();\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'keyup', function (event) {\n if (instance.selection.isInProgress() && !event.shiftKey) {\n instance.selection.finish();\n }\n });\n\n var isMouseDown;\n this.isMouseDown = function () {\n return isMouseDown;\n };\n\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function (event) {\n if (instance.selection.isInProgress() && event.which === 1) {\n // is left mouse button\n instance.selection.finish();\n }\n\n isMouseDown = false;\n\n if ((0, _element.isOutsideInput)(document.activeElement)) {\n instance.unlisten();\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'mousedown', function (event) {\n var originalTarget = event.target;\n var next = event.target;\n var eventX = event.x || event.clientX;\n var eventY = event.y || event.clientY;\n\n if (isMouseDown || !instance.rootElement) {\n return; // it must have been started in a cell\n }\n\n // immediate click on \"holder\" means click on the right side of vertical scrollbar\n if (next === instance.view.wt.wtTable.holder) {\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n if (document.elementFromPoint(eventX + scrollbarWidth, eventY) !== instance.view.wt.wtTable.holder || document.elementFromPoint(eventX, eventY + scrollbarWidth) !== instance.view.wt.wtTable.holder) {\n return;\n }\n } else {\n while (next !== document.documentElement) {\n if (next === null) {\n if (event.isTargetWebComponent) {\n break;\n }\n // click on something that was a row but now is detached (possibly because your click triggered a rerender)\n return;\n }\n if (next === instance.rootElement) {\n // click inside container\n return;\n }\n next = next.parentNode;\n }\n }\n\n // function did not return until here, we have an outside click!\n\n var outsideClickDeselects = typeof that.settings.outsideClickDeselects === 'function' ? that.settings.outsideClickDeselects(originalTarget) : that.settings.outsideClickDeselects;\n\n if (outsideClickDeselects) {\n instance.deselectCell();\n } else {\n instance.destroyEditor();\n }\n });\n\n this.eventManager.addEventListener(table, 'selectstart', function (event) {\n if (that.settings.fragmentSelection || (0, _element.isInput)(event.target)) {\n return;\n }\n // https://github.com/handsontable/handsontable/issues/160\n // Prevent text from being selected when performing drag down.\n event.preventDefault();\n });\n\n var clearTextSelection = function clearTextSelection() {\n // http://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript\n if (window.getSelection) {\n if (window.getSelection().empty) {\n // Chrome\n window.getSelection().empty();\n } else if (window.getSelection().removeAllRanges) {\n // Firefox\n window.getSelection().removeAllRanges();\n }\n } else if (document.selection) {\n // IE?\n document.selection.empty();\n }\n };\n\n var selections = [new _src.Selection({\n className: 'current',\n border: {\n width: 2,\n color: '#5292F7',\n // style: 'solid', // not used\n cornerVisible: function cornerVisible() {\n return that.settings.fillHandle && !that.isCellEdited() && !instance.selection.isMultiple();\n },\n multipleSelectionHandlesVisible: function multipleSelectionHandlesVisible() {\n return !that.isCellEdited() && !instance.selection.isMultiple();\n }\n }\n }), new _src.Selection({\n className: 'area',\n border: {\n width: 1,\n color: '#89AFF9',\n // style: 'solid', // not used\n cornerVisible: function cornerVisible() {\n return that.settings.fillHandle && !that.isCellEdited() && instance.selection.isMultiple();\n },\n multipleSelectionHandlesVisible: function multipleSelectionHandlesVisible() {\n return !that.isCellEdited() && instance.selection.isMultiple();\n }\n }\n }), new _src.Selection({\n className: 'highlight',\n highlightHeaderClassName: that.settings.currentHeaderClassName,\n highlightRowClassName: that.settings.currentRowClassName,\n highlightColumnClassName: that.settings.currentColClassName\n }), new _src.Selection({\n className: 'fill',\n border: {\n width: 1,\n color: 'red'\n }\n })];\n selections.current = selections[0];\n selections.area = selections[1];\n selections.highlight = selections[2];\n selections.fill = selections[3];\n\n var walkontableConfig = {\n debug: function debug() {\n return that.settings.debug;\n },\n externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(),\n table: table,\n preventOverflow: function preventOverflow() {\n return _this.settings.preventOverflow;\n },\n stretchH: function stretchH() {\n return that.settings.stretchH;\n },\n data: instance.getDataAtCell,\n totalRows: function totalRows() {\n return instance.countRows();\n },\n totalColumns: function totalColumns() {\n return instance.countCols();\n },\n fixedColumnsLeft: function fixedColumnsLeft() {\n return that.settings.fixedColumnsLeft;\n },\n fixedRowsTop: function fixedRowsTop() {\n return that.settings.fixedRowsTop;\n },\n fixedRowsBottom: function fixedRowsBottom() {\n return that.settings.fixedRowsBottom;\n },\n minSpareRows: function minSpareRows() {\n return that.settings.minSpareRows;\n },\n renderAllRows: that.settings.renderAllRows,\n rowHeaders: function rowHeaders() {\n var headerRenderers = [];\n\n if (instance.hasRowHeaders()) {\n headerRenderers.push(function (row, TH) {\n that.appendRowHeader(row, TH);\n });\n }\n instance.runHooks('afterGetRowHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnHeaders: function columnHeaders() {\n var headerRenderers = [];\n\n if (instance.hasColHeaders()) {\n headerRenderers.push(function (column, TH) {\n that.appendColHeader(column, TH);\n });\n }\n instance.runHooks('afterGetColumnHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnWidth: instance.getColWidth,\n rowHeight: instance.getRowHeight,\n cellRenderer: function cellRenderer(row, col, TD) {\n var cellProperties = that.instance.getCellMeta(row, col);\n var prop = that.instance.colToProp(col);\n var value = that.instance.getDataAtRowProp(row, prop);\n\n if (that.instance.hasHook('beforeValueRender')) {\n value = that.instance.runHooks('beforeValueRender', value);\n }\n\n that.instance.runHooks('beforeRenderer', TD, row, col, prop, value, cellProperties);\n that.instance.getCellRenderer(cellProperties)(that.instance, TD, row, col, prop, value, cellProperties);\n that.instance.runHooks('afterRenderer', TD, row, col, prop, value, cellProperties);\n },\n selections: selections,\n hideBorderOnMouseDownOver: function hideBorderOnMouseDownOver() {\n return that.settings.fragmentSelection;\n },\n onCellMouseDown: function onCellMouseDown(event, coords, TD, wt) {\n var blockCalculations = {\n row: false,\n column: false,\n cells: false\n };\n\n instance.listen();\n\n that.activeWt = wt;\n isMouseDown = true;\n\n instance.runHooks('beforeOnCellMouseDown', event, coords, TD, blockCalculations);\n\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n var actualSelection = instance.getSelectedRange();\n var selection = instance.selection;\n var selectedHeader = selection.selectedHeader;\n\n if (event.shiftKey && actualSelection) {\n if (coords.row >= 0 && coords.col >= 0 && !blockCalculations.cells) {\n selection.setSelectedHeaders(false, false);\n selection.setRangeEnd(coords);\n } else if ((selectedHeader.cols || selectedHeader.rows) && coords.row >= 0 && coords.col >= 0 && !blockCalculations.cells) {\n selection.setSelectedHeaders(false, false);\n selection.setRangeEnd(new _src.CellCoords(coords.row, coords.col));\n } else if (selectedHeader.cols && coords.row < 0 && !blockCalculations.column) {\n selection.setRangeEnd(new _src.CellCoords(actualSelection.to.row, coords.col));\n } else if (selectedHeader.rows && coords.col < 0 && !blockCalculations.row) {\n selection.setRangeEnd(new _src.CellCoords(coords.row, actualSelection.to.col));\n } else if ((!selectedHeader.cols && !selectedHeader.rows && coords.col < 0 || selectedHeader.cols && coords.col < 0) && !blockCalculations.row) {\n selection.setSelectedHeaders(true, false);\n selection.setRangeStartOnly(new _src.CellCoords(actualSelection.from.row, 0));\n selection.setRangeEnd(new _src.CellCoords(coords.row, instance.countCols() - 1));\n } else if ((!selectedHeader.cols && !selectedHeader.rows && coords.row < 0 || selectedHeader.rows && coords.row < 0) && !blockCalculations.column) {\n selection.setSelectedHeaders(false, true);\n selection.setRangeStartOnly(new _src.CellCoords(0, actualSelection.from.col));\n selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, coords.col));\n }\n } else {\n var doNewSelection = true;\n\n if (actualSelection) {\n var from = actualSelection.from,\n to = actualSelection.to;\n\n var coordsNotInSelection = !selection.inInSelection(coords);\n\n if (coords.row < 0 && selectedHeader.cols) {\n var start = Math.min(from.col, to.col);\n var end = Math.max(from.col, to.col);\n\n doNewSelection = coords.col < start || coords.col > end;\n } else if (coords.col < 0 && selectedHeader.rows) {\n var _start = Math.min(from.row, to.row);\n var _end = Math.max(from.row, to.row);\n\n doNewSelection = coords.row < _start || coords.row > _end;\n } else {\n doNewSelection = coordsNotInSelection;\n }\n }\n\n var rightClick = (0, _event.isRightClick)(event);\n var leftClick = (0, _event.isLeftClick)(event) || event.type === 'touchstart';\n\n // clicked row header and when some column was selected\n if (coords.row < 0 && coords.col >= 0 && !blockCalculations.column) {\n selection.setSelectedHeaders(false, true);\n\n if (leftClick || rightClick && doNewSelection) {\n selection.setRangeStartOnly(new _src.CellCoords(0, coords.col));\n selection.setRangeEnd(new _src.CellCoords(Math.max(instance.countRows() - 1, 0), coords.col), false);\n }\n\n // clicked column header and when some row was selected\n } else if (coords.col < 0 && coords.row >= 0 && !blockCalculations.row) {\n selection.setSelectedHeaders(true, false);\n\n if (leftClick || rightClick && doNewSelection) {\n selection.setRangeStartOnly(new _src.CellCoords(coords.row, 0));\n selection.setRangeEnd(new _src.CellCoords(coords.row, Math.max(instance.countCols() - 1, 0)), false);\n }\n } else if (coords.col >= 0 && coords.row >= 0 && !blockCalculations.cells) {\n if (leftClick || rightClick && doNewSelection) {\n selection.setSelectedHeaders(false, false);\n selection.setRangeStart(coords);\n }\n } else if (coords.col < 0 && coords.row < 0) {\n coords.row = 0;\n coords.col = 0;\n\n selection.setSelectedHeaders(false, false, true);\n selection.setRangeStart(coords);\n }\n }\n\n instance.runHooks('afterOnCellMouseDown', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseOut: function onCellMouseOut(event, coords, TD, wt) {\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseOut', event, coords, TD);\n\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n instance.runHooks('afterOnCellMouseOut', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseOver: function onCellMouseOver(event, coords, TD, wt) {\n var blockCalculations = {\n row: false,\n column: false,\n cell: false\n };\n\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseOver', event, coords, TD, blockCalculations);\n\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n if (event.button === 0 && isMouseDown) {\n if (coords.row >= 0 && coords.col >= 0) {\n // is not a header\n if (instance.selection.selectedHeader.cols && !blockCalculations.column) {\n instance.selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, coords.col), false);\n } else if (instance.selection.selectedHeader.rows && !blockCalculations.row) {\n instance.selection.setRangeEnd(new _src.CellCoords(coords.row, instance.countCols() - 1), false);\n } else if (!blockCalculations.cell) {\n instance.selection.setRangeEnd(coords);\n }\n } else {\n /* eslint-disable no-lonely-if */\n if (instance.selection.selectedHeader.cols && !blockCalculations.column) {\n instance.selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, coords.col), false);\n } else if (instance.selection.selectedHeader.rows && !blockCalculations.row) {\n instance.selection.setRangeEnd(new _src.CellCoords(coords.row, instance.countCols() - 1), false);\n } else if (!blockCalculations.cell) {\n instance.selection.setRangeEnd(coords);\n }\n }\n }\n\n instance.runHooks('afterOnCellMouseOver', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseUp: function onCellMouseUp(event, coords, TD, wt) {\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseUp', event, coords, TD);\n\n instance.runHooks('afterOnCellMouseUp', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellCornerMouseDown: function onCellCornerMouseDown(event) {\n event.preventDefault();\n instance.runHooks('afterOnCellCornerMouseDown', event);\n },\n onCellCornerDblClick: function onCellCornerDblClick(event) {\n event.preventDefault();\n instance.runHooks('afterOnCellCornerDblClick', event);\n },\n beforeDraw: function beforeDraw(force, skipRender) {\n that.beforeRender(force, skipRender);\n },\n onDraw: function onDraw(force) {\n that.onDraw(force);\n },\n onScrollVertically: function onScrollVertically() {\n instance.runHooks('afterScrollVertically');\n },\n onScrollHorizontally: function onScrollHorizontally() {\n instance.runHooks('afterScrollHorizontally');\n },\n onBeforeDrawBorders: function onBeforeDrawBorders(corners, borderClassName) {\n instance.runHooks('beforeDrawBorders', corners, borderClassName);\n },\n onBeforeTouchScroll: function onBeforeTouchScroll() {\n instance.runHooks('beforeTouchScroll');\n },\n onAfterMomentumScroll: function onAfterMomentumScroll() {\n instance.runHooks('afterMomentumScroll');\n },\n onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(stretchedWidth, column) {\n return instance.runHooks('beforeStretchingColumnWidth', stretchedWidth, column);\n },\n onModifyRowHeaderWidth: function onModifyRowHeaderWidth(rowHeaderWidth) {\n return instance.runHooks('modifyRowHeaderWidth', rowHeaderWidth);\n },\n viewportRowCalculatorOverride: function viewportRowCalculatorOverride(calc) {\n var rows = instance.countRows();\n var viewportOffset = that.settings.viewportRowRenderingOffset;\n\n if (viewportOffset === 'auto' && that.settings.fixedRowsTop) {\n viewportOffset = 10;\n }\n if (typeof viewportOffset === 'number') {\n calc.startRow = Math.max(calc.startRow - viewportOffset, 0);\n calc.endRow = Math.min(calc.endRow + viewportOffset, rows - 1);\n }\n if (viewportOffset === 'auto') {\n var center = calc.startRow + calc.endRow - calc.startRow;\n var offset = Math.ceil(center / rows * 12);\n\n calc.startRow = Math.max(calc.startRow - offset, 0);\n calc.endRow = Math.min(calc.endRow + offset, rows - 1);\n }\n instance.runHooks('afterViewportRowCalculatorOverride', calc);\n },\n viewportColumnCalculatorOverride: function viewportColumnCalculatorOverride(calc) {\n var cols = instance.countCols();\n var viewportOffset = that.settings.viewportColumnRenderingOffset;\n\n if (viewportOffset === 'auto' && that.settings.fixedColumnsLeft) {\n viewportOffset = 10;\n }\n if (typeof viewportOffset === 'number') {\n calc.startColumn = Math.max(calc.startColumn - viewportOffset, 0);\n calc.endColumn = Math.min(calc.endColumn + viewportOffset, cols - 1);\n }\n if (viewportOffset === 'auto') {\n var center = calc.startColumn + calc.endColumn - calc.startColumn;\n var offset = Math.ceil(center / cols * 12);\n\n calc.startRow = Math.max(calc.startColumn - offset, 0);\n calc.endColumn = Math.min(calc.endColumn + offset, cols - 1);\n }\n instance.runHooks('afterViewportColumnCalculatorOverride', calc);\n },\n rowHeaderWidth: function rowHeaderWidth() {\n return that.settings.rowHeaderWidth;\n },\n columnHeaderHeight: function columnHeaderHeight() {\n var columnHeaderHeight = instance.runHooks('modifyColumnHeaderHeight');\n return that.settings.columnHeaderHeight || columnHeaderHeight;\n }\n };\n\n instance.runHooks('beforeInitWalkontable', walkontableConfig);\n\n this.wt = new _src2.default(walkontableConfig);\n this.activeWt = this.wt;\n\n if (!(0, _browser.isChrome)() && !(0, _browser.isSafari)()) {\n this.eventManager.addEventListener(instance.rootElement, 'wheel', function (event) {\n event.preventDefault();\n\n var lineHeight = parseInt((0, _element.getComputedStyle)(document.body)['font-size'], 10);\n var holder = that.wt.wtOverlays.scrollableElement;\n\n var deltaY = event.wheelDeltaY || event.deltaY;\n var deltaX = event.wheelDeltaX || event.deltaX;\n\n switch (event.deltaMode) {\n case 0:\n holder.scrollLeft += deltaX;\n holder.scrollTop += deltaY;\n break;\n\n case 1:\n holder.scrollLeft += deltaX * lineHeight;\n holder.scrollTop += deltaY * lineHeight;\n break;\n\n default:\n break;\n }\n });\n }\n\n this.eventManager.addEventListener(that.wt.wtTable.spreader, 'mousedown', function (event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === that.wt.wtTable.spreader && event.which === 3) {\n (0, _event.stopPropagation)(event);\n }\n });\n\n this.eventManager.addEventListener(that.wt.wtTable.spreader, 'contextmenu', function (event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === that.wt.wtTable.spreader && event.which === 3) {\n (0, _event.stopPropagation)(event);\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'click', function () {\n if (that.settings.observeDOMVisibility) {\n if (that.wt.drawInterrupted) {\n that.instance.forceFullRender = true;\n that.render();\n }\n }\n });\n}\n\nTableView.prototype.isTextSelectionAllowed = function (el) {\n if ((0, _element.isInput)(el)) {\n return true;\n }\n var isChildOfTableBody = (0, _element.isChildOf)(el, this.instance.view.wt.wtTable.spreader);\n\n if (this.settings.fragmentSelection === true && isChildOfTableBody) {\n return true;\n }\n if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {\n return true;\n }\n if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Check if selected only one cell.\n *\n * @returns {Boolean}\n */\nTableView.prototype.isSelectedOnlyCell = function () {\n var _ref = this.instance.getSelected() || [],\n _ref2 = _slicedToArray(_ref, 4),\n row = _ref2[0],\n col = _ref2[1],\n rowEnd = _ref2[2],\n colEnd = _ref2[3];\n\n return row !== void 0 && row === rowEnd && col === colEnd;\n};\n\nTableView.prototype.isCellEdited = function () {\n var activeEditor = this.instance.getActiveEditor();\n\n return activeEditor && activeEditor.isOpened();\n};\n\nTableView.prototype.beforeRender = function (force, skipRender) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('beforeRender', this.instance.forceFullRender, skipRender);\n }\n};\n\nTableView.prototype.onDraw = function (force) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('afterRender', this.instance.forceFullRender);\n }\n};\n\nTableView.prototype.render = function () {\n this.wt.draw(!this.instance.forceFullRender);\n this.instance.forceFullRender = false;\n this.instance.renderCall = false;\n};\n\n/**\n * Returns td object given coordinates\n *\n * @param {CellCoords} coords\n * @param {Boolean} topmost\n */\nTableView.prototype.getCellAtCoords = function (coords, topmost) {\n var td = this.wt.getCell(coords, topmost);\n\n if (td < 0) {\n // there was an exit code (cell is out of bounds)\n return null;\n }\n\n return td;\n};\n\n/**\n * Scroll viewport to selection.\n *\n * @param {CellCoords} coords\n */\nTableView.prototype.scrollViewport = function (coords) {\n this.wt.scrollViewport(coords);\n};\n\n/**\n * Append row header to a TH element\n * @param row\n * @param TH\n */\nTableView.prototype.appendRowHeader = function (row, TH) {\n if (TH.firstChild) {\n var container = TH.firstChild;\n\n if (!(0, _element.hasClass)(container, 'relative')) {\n (0, _element.empty)(TH);\n this.appendRowHeader(row, TH);\n\n return;\n }\n this.updateCellHeader(container.querySelector('.rowHeader'), row, this.instance.getRowHeader);\n } else {\n var div = document.createElement('div');\n var span = document.createElement('span');\n\n div.className = 'relative';\n span.className = 'rowHeader';\n this.updateCellHeader(span, row, this.instance.getRowHeader);\n\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetRowHeader', row, TH);\n};\n\n/**\n * Append column header to a TH element\n * @param col\n * @param TH\n */\nTableView.prototype.appendColHeader = function (col, TH) {\n if (TH.firstChild) {\n var container = TH.firstChild;\n\n if ((0, _element.hasClass)(container, 'relative')) {\n this.updateCellHeader(container.querySelector('.colHeader'), col, this.instance.getColHeader);\n } else {\n (0, _element.empty)(TH);\n this.appendColHeader(col, TH);\n }\n } else {\n var div = document.createElement('div');\n var span = document.createElement('span');\n\n div.className = 'relative';\n span.className = 'colHeader';\n this.updateCellHeader(span, col, this.instance.getColHeader);\n\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetColHeader', col, TH);\n};\n\n/**\n * Update header cell content\n *\n * @since 0.15.0-beta4\n * @param {HTMLElement} element Element to update\n * @param {Number} index Row index or column index\n * @param {Function} content Function which should be returns content for this cell\n */\nTableView.prototype.updateCellHeader = function (element, index, content) {\n var renderedIndex = index;\n var parentOverlay = this.wt.wtOverlays.getParentOverlay(element) || this.wt;\n\n // prevent wrong calculations from SampleGenerator\n if (element.parentNode) {\n if ((0, _element.hasClass)(element, 'colHeader')) {\n renderedIndex = parentOverlay.wtTable.columnFilter.sourceToRendered(index);\n } else if ((0, _element.hasClass)(element, 'rowHeader')) {\n renderedIndex = parentOverlay.wtTable.rowFilter.sourceToRendered(index);\n }\n }\n\n if (renderedIndex > -1) {\n (0, _element.fastInnerHTML)(element, content(index));\n } else {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n (0, _element.fastInnerText)(element, String.fromCharCode(160));\n (0, _element.addClass)(element, 'cornerHeader');\n }\n};\n\n/**\n * Given a element's left position relative to the viewport, returns maximum element width until the right\n * edge of the viewport (before scrollbar)\n *\n * @param {Number} leftOffset\n * @return {Number}\n */\nTableView.prototype.maximumVisibleElementWidth = function (leftOffset) {\n var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth();\n var maxWidth = workspaceWidth - leftOffset;\n return maxWidth > 0 ? maxWidth : 0;\n};\n\n/**\n * Given a element's top position relative to the viewport, returns maximum element height until the bottom\n * edge of the viewport (before scrollbar)\n *\n * @param {Number} topOffset\n * @return {Number}\n */\nTableView.prototype.maximumVisibleElementHeight = function (topOffset) {\n var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight();\n var maxHeight = workspaceHeight - topOffset;\n return maxHeight > 0 ? maxHeight : 0;\n};\n\nTableView.prototype.mainViewIsActive = function () {\n return this.wt === this.activeWt;\n};\n\nTableView.prototype.destroy = function () {\n this.wt.destroy();\n this.eventManager.destroy();\n};\n\nexports.default = TableView;\n\n/***/ }),\n/* 268 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Refactored implementation of LinkedList (part of javascript-algorithms project) by Github users:\n * mgechev, AndriiHeonia, Microfed and Jakeh (part of javascript-algorithms project - all project contributors\n * at repository website)\n *\n * Link to repository: https://github.com/mgechev/javascript-algorithms\n */\n\n/**\n * Linked list node.\n *\n * @class NodeStructure\n * @util\n */\nvar NodeStructure = function NodeStructure(data) {\n _classCallCheck(this, NodeStructure);\n\n /**\n * Data of the node.\n * @member {Object}\n */\n this.data = data;\n /**\n * Next node.\n * @member {NodeStructure}\n */\n this.next = null;\n /**\n * Previous node.\n * @member {NodeStructure}\n */\n this.prev = null;\n};\n\n/**\n * Linked list.\n *\n * @class LinkedList\n * @util\n */\n\n\nvar LinkedList = function () {\n function LinkedList() {\n _classCallCheck(this, LinkedList);\n\n this.first = null;\n this.last = null;\n }\n\n /**\n * Add data to the end of linked list.\n *\n * @param {Object} data Data which should be added.\n */\n\n\n _createClass(LinkedList, [{\n key: \"push\",\n value: function push(data) {\n var node = new NodeStructure(data);\n\n if (this.first === null) {\n this.first = node;\n this.last = node;\n } else {\n var temp = this.last;\n\n this.last = node;\n node.prev = temp;\n temp.next = node;\n }\n }\n\n /**\n * Add data to the beginning of linked list.\n *\n * @param {Object} data Data which should be added.\n */\n\n }, {\n key: \"unshift\",\n value: function unshift(data) {\n var node = new NodeStructure(data);\n\n if (this.first === null) {\n this.first = node;\n this.last = node;\n } else {\n var temp = this.first;\n\n this.first = node;\n node.next = temp;\n temp.prev = node;\n }\n }\n\n /**\n * In order traversal of the linked list.\n *\n * @param {Function} callback Callback which should be executed on each node.\n */\n\n }, {\n key: \"inorder\",\n value: function inorder(callback) {\n var temp = this.first;\n\n while (temp) {\n callback(temp);\n temp = temp.next;\n }\n }\n\n /**\n * Remove data from the linked list.\n *\n * @param {Object} data Data which should be removed.\n * @returns {Boolean} Returns true if data has been removed.\n */\n\n }, {\n key: \"remove\",\n value: function remove(data) {\n if (this.first === null) {\n return false;\n }\n\n var temp = this.first;\n var next = void 0;\n var prev = void 0;\n\n while (temp) {\n if (temp.data === data) {\n next = temp.next;\n prev = temp.prev;\n\n if (next) {\n next.prev = prev;\n }\n\n if (prev) {\n prev.next = next;\n }\n\n if (temp === this.first) {\n this.first = next;\n }\n\n if (temp === this.last) {\n this.last = prev;\n }\n\n return true;\n }\n\n temp = temp.next;\n }\n\n return false;\n }\n\n /**\n * Check if linked list contains cycle.\n *\n * @returns {Boolean} Returns true if linked list contains cycle.\n */\n\n }, {\n key: \"hasCycle\",\n value: function hasCycle() {\n var fast = this.first;\n var slow = this.first;\n\n while (true) {\n if (fast === null) {\n return false;\n }\n\n fast = fast.next;\n\n if (fast === null) {\n return false;\n }\n\n fast = fast.next;\n slow = slow.next;\n\n if (fast === slow) {\n return true;\n }\n }\n }\n }, {\n key: \"pop\",\n\n\n /**\n * Return last node from the linked list.\n *\n * @returns {NodeStructure} Last node.\n */\n value: function pop() {\n if (this.last === null) {\n return null;\n }\n\n var temp = this.last;\n this.last = this.last.prev;\n\n return temp;\n }\n }, {\n key: \"shift\",\n\n\n /**\n * Return first node from the linked list.\n *\n * @returns {NodeStructure} First node.\n */\n value: function shift() {\n if (this.first === null) {\n return null;\n }\n\n var temp = this.first;\n this.first = this.first.next;\n\n return temp;\n }\n }, {\n key: \"recursiveReverse\",\n\n\n /**\n * Reverses the linked list recursively\n */\n value: function recursiveReverse() {\n function inverse(current, next) {\n if (!next) {\n return;\n }\n inverse(next, next.next);\n next.next = current;\n }\n\n if (!this.first) {\n return;\n }\n\n inverse(this.first, this.first.next);\n\n this.first.next = null;\n var temp = this.first;\n this.first = this.last;\n this.last = temp;\n }\n }, {\n key: \"reverse\",\n\n\n /**\n * Reverses the linked list iteratively\n */\n value: function reverse() {\n if (!this.first || !this.first.next) {\n return;\n }\n\n var current = this.first.next;\n var prev = this.first;\n var temp = void 0;\n\n while (current) {\n temp = current.next;\n current.next = prev;\n prev.prev = current;\n prev = current;\n current = temp;\n }\n\n this.first.next = null;\n this.last.prev = null;\n temp = this.first;\n this.first = prev;\n this.last = temp;\n }\n }]);\n\n return LinkedList;\n}();\n\n;\n\nexports.NodeStructure = NodeStructure;\nexports.default = LinkedList;\n\n/***/ }),\n/* 269 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nexports.parseDelay = parseDelay;\n\nvar _feature = __webpack_require__(34);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Interval\n * @util\n */\nvar Interval = function () {\n _createClass(Interval, null, [{\n key: 'create',\n value: function create(func, delay) {\n return new Interval(func, delay);\n }\n }]);\n\n function Interval(func, delay) {\n var _this = this;\n\n _classCallCheck(this, Interval);\n\n /**\n * Animation frame request id.\n *\n * @type {Number}\n */\n this.timer = null;\n /**\n * Function to invoke repeatedly.\n *\n * @type {Function}\n */\n this.func = func;\n /**\n * Number of milliseconds that function should wait before next call.\n */\n this.delay = parseDelay(delay);\n /**\n * Flag which indicates if interval object was stopped.\n *\n * @type {Boolean}\n * @default true\n */\n this.stopped = true;\n /**\n * Interval time (in milliseconds) of the last callback call.\n *\n * @private\n * @type {Number}\n */\n this._then = null;\n /**\n * Bounded function `func`.\n *\n * @private\n * @type {Function}\n */\n this._callback = function () {\n return _this.__callback();\n };\n }\n\n /**\n * Start loop.\n *\n * @returns {Interval}\n */\n\n\n _createClass(Interval, [{\n key: 'start',\n value: function start() {\n if (this.stopped) {\n this._then = Date.now();\n this.stopped = false;\n this.timer = (0, _feature.requestAnimationFrame)(this._callback);\n }\n\n return this;\n }\n\n /**\n * Stop looping.\n *\n * @returns {Interval}\n */\n\n }, {\n key: 'stop',\n value: function stop() {\n if (!this.stopped) {\n this.stopped = true;\n (0, _feature.cancelAnimationFrame)(this.timer);\n this.timer = null;\n }\n\n return this;\n }\n\n /**\n * Loop callback, fired on every animation frame.\n *\n * @private\n */\n\n }, {\n key: '__callback',\n value: function __callback() {\n this.timer = (0, _feature.requestAnimationFrame)(this._callback);\n\n if (this.delay) {\n var now = Date.now();\n var elapsed = now - this._then;\n\n if (elapsed > this.delay) {\n this._then = now - elapsed % this.delay;\n this.func();\n }\n } else {\n this.func();\n }\n }\n }]);\n\n return Interval;\n}();\n\nexports.default = Interval;\nfunction parseDelay(delay) {\n if (typeof delay === 'string' && /fps$/.test(delay)) {\n delay = 1000 / parseInt(delay.replace('fps', '') || 0, 10);\n }\n\n return delay;\n}\n\n/***/ }),\n/* 270 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = mergeSort;\nexports.merge = merge;\n\nvar _linkedList = __webpack_require__(268);\n\nvar _linkedList2 = _interopRequireDefault(_linkedList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Refactored implementation of mergeSort (part of javascript-algorithms project) by Github users:\n * mgechev, AndriiHeonia and lekkas (part of javascript-algorithms project - all project contributors\n * at repository website)\n *\n * Link to repository: https://github.com/mgechev/javascript-algorithms\n */\n\n/**\n * Specifies a function that defines the sort order. The array is sorted according to each\n * character's Unicode code point value, according to the string conversion of each element.\n *\n * @param a {*} first compared element.\n * @param b {*} second compared element.\n * @returns {Number}\n */\nvar defaultCompareFunction = function defaultCompareFunction(a, b) {\n // sort lexically\n\n var firstValue = a.toString();\n var secondValue = b.toString();\n\n if (firstValue === secondValue) {\n return 0;\n } else if (firstValue < secondValue) {\n return -1;\n }\n return 1;\n};\n\n/**\n * Mergesort method which is recursively called for sorting the input array.\n *\n * @param {Array} array The array which should be sorted.\n * @param {Function} compareFunction Compares two items in an array. If compareFunction is not supplied,\n * elements are sorted by converting them to strings and comparing strings in Unicode code point order.\n * @param {Number} startIndex Left side of the subarray.\n * @param {Number} endIndex Right side of the subarray.\n * @returns {Array} Array with sorted subarray.\n */\nfunction mergeSort(array) {\n var compareFunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultCompareFunction;\n var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length;\n\n if (Math.abs(endIndex - startIndex) <= 1) {\n return [];\n }\n\n var middleIndex = Math.ceil((startIndex + endIndex) / 2);\n\n mergeSort(array, compareFunction, startIndex, middleIndex);\n mergeSort(array, compareFunction, middleIndex, endIndex);\n\n return merge(array, compareFunction, startIndex, middleIndex, endIndex);\n}\n\n/**\n * Devides and sort merges two subarrays of given array\n *\n * @param {Array} array The array which subarrays should be sorted.\n * @param {Number} startIndex The start of the first subarray.\n * This subarray is with end middle - 1.\n * @param {Number} middleIndex The start of the second array.\n * @param {Number} endIndex end - 1 is the end of the second array.\n * @returns {Array} The array with sorted subarray.\n */\nfunction merge(array, compareFunction, startIndex, middleIndex, endIndex) {\n var leftElements = new _linkedList2.default();\n var rightElements = new _linkedList2.default();\n var leftSize = middleIndex - startIndex;\n var rightSize = endIndex - middleIndex;\n var maxSize = Math.max(leftSize, rightSize);\n var size = endIndex - startIndex;\n\n for (var _i = 0; _i < maxSize; _i += 1) {\n if (_i < leftSize) {\n leftElements.push(array[startIndex + _i]);\n }\n\n if (_i < rightSize) {\n rightElements.push(array[middleIndex + _i]);\n }\n }\n\n var i = 0;\n\n while (i < size) {\n if (leftElements.first && rightElements.first) {\n if (compareFunction(leftElements.first.data, rightElements.first.data) > 0) {\n array[startIndex + i] = rightElements.shift().data;\n } else {\n array[startIndex + i] = leftElements.shift().data;\n }\n } else if (leftElements.first) {\n\n array[startIndex + i] = leftElements.shift().data;\n } else {\n\n array[startIndex + i] = rightElements.shift().data;\n }\n\n i += 1;\n }\n\n return array;\n};\n\n/***/ }),\n/* 271 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = autocompleteValidator;\n/**\n * Autocomplete cell validator.\n *\n * @private\n * @validator AutocompleteValidator\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction autocompleteValidator(value, callback) {\n if (value == null) {\n value = '';\n }\n\n if (this.allowEmpty && value === '') {\n callback(true);\n\n return;\n }\n\n if (this.strict && this.source) {\n if (typeof this.source === 'function') {\n this.source(value, process(value, callback));\n } else {\n process(value, callback)(this.source);\n }\n } else {\n callback(true);\n }\n};\n\n/**\n * Function responsible for validation of autocomplete value.\n *\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction process(value, callback) {\n var originalVal = value;\n\n return function (source) {\n var found = false;\n\n for (var s = 0, slen = source.length; s < slen; s++) {\n if (originalVal === source[s]) {\n found = true; // perfect match\n break;\n }\n }\n\n callback(found);\n };\n}\n\n/***/ }),\n/* 272 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = dateValidator;\nexports.correctFormat = correctFormat;\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _date = __webpack_require__(88);\n\nvar _editors = __webpack_require__(14);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Date cell validator\n *\n * @private\n * @validator DateValidator\n * @dependencies moment\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction dateValidator(value, callback) {\n var valid = true;\n var dateEditor = (0, _editors.getEditorInstance)('date', this.instance);\n\n if (value == null) {\n value = '';\n }\n var isValidDate = (0, _moment2.default)(new Date(value)).isValid() || (0, _moment2.default)(value, dateEditor.defaultDateFormat).isValid();\n // is it in the specified format\n var isValidFormat = (0, _moment2.default)(value, this.dateFormat || dateEditor.defaultDateFormat, true).isValid();\n\n if (this.allowEmpty && value === '') {\n isValidDate = true;\n isValidFormat = true;\n }\n if (!isValidDate) {\n valid = false;\n }\n if (!isValidDate && isValidFormat) {\n valid = true;\n }\n\n if (isValidDate && !isValidFormat) {\n if (this.correctFormat === true) {\n // if format correction is enabled\n var correctedValue = correctFormat(value, this.dateFormat);\n var row = this.instance.runHooks('unmodifyRow', this.row);\n var column = this.instance.runHooks('unmodifyCol', this.col);\n\n this.instance.setDataAtCell(row, column, correctedValue, 'dateValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n};\n\n/**\n * Format the given string using moment.js' format feature\n *\n * @param {String} value\n * @param {String} dateFormat\n * @returns {String}\n */\nfunction correctFormat(value, dateFormat) {\n var dateFromDate = (0, _moment2.default)((0, _date.getNormalizedDate)(value));\n var dateFromMoment = (0, _moment2.default)(value, dateFormat);\n var isAlphanumeric = value.search(/[A-z]/g) > -1;\n var date = void 0;\n\n if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) {\n date = dateFromDate;\n } else {\n date = dateFromMoment;\n }\n\n return date.format(dateFormat);\n};\n\n/***/ }),\n/* 273 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = numericValidator;\n/**\n * Numeric cell validator\n *\n * @private\n * @validator NumericValidator\n * @param {*} value - Value of edited cell\n * @param {*} callback - Callback called with validation result\n */\nfunction numericValidator(value, callback) {\n if (value == null) {\n value = '';\n }\n if (this.allowEmpty && value === '') {\n callback(true);\n } else if (value === '') {\n callback(false);\n } else {\n callback(/^-?\\d*(\\.|,)?\\d*$/.test(value));\n }\n};\n\n/***/ }),\n/* 274 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = timeValidator;\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Formats which are correctly parsed to time (supported by momentjs)\nvar STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ', 'X', // Unix timestamp\n'x' // Unix ms timestamp\n];\n\n/**\n * Time cell validator\n *\n * @private\n * @validator TimeValidator\n * @dependencies moment\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction timeValidator(value, callback) {\n var valid = true;\n var timeFormat = this.timeFormat || 'h:mm:ss a';\n\n if (value === null) {\n value = '';\n }\n\n value = /^\\d{3,}$/.test(value) ? parseInt(value, 10) : value;\n\n var twoDigitValue = /^\\d{1,2}$/.test(value);\n\n if (twoDigitValue) {\n value += ':00';\n }\n\n var date = (0, _moment2.default)(value, STRICT_FORMATS, true).isValid() ? (0, _moment2.default)(value) : (0, _moment2.default)(value, timeFormat);\n var isValidTime = date.isValid();\n\n // is it in the specified format\n var isValidFormat = (0, _moment2.default)(value, timeFormat, true).isValid() && !twoDigitValue;\n\n if (this.allowEmpty && value === '') {\n isValidTime = true;\n isValidFormat = true;\n }\n if (!isValidTime) {\n valid = false;\n }\n if (!isValidTime && isValidFormat) {\n valid = true;\n }\n if (isValidTime && !isValidFormat) {\n if (this.correctFormat === true) {\n // if format correction is enabled\n var correctedValue = date.format(timeFormat);\n var row = this.instance.runHooks('unmodifyRow', this.row);\n var column = this.instance.runHooks('unmodifyCol', this.col);\n\n this.instance.setDataAtCell(row, column, correctedValue, 'timeValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n};\n\n/***/ }),\n/* 275 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n\nvar toObject = __webpack_require__(41)\n , toIndex = __webpack_require__(60)\n , toLength = __webpack_require__(24);\n\nmodule.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){\n var O = toObject(this)\n , len = toLength(O.length)\n , to = toIndex(target, len)\n , from = toIndex(start, len)\n , end = arguments.length > 2 ? arguments[2] : undefined\n , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)\n , inc = 1;\n if(from < to && to < from + count){\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while(count-- > 0){\n if(from in O)O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n\n/***/ }),\n/* 276 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n\nvar toObject = __webpack_require__(41)\n , toIndex = __webpack_require__(60)\n , toLength = __webpack_require__(24);\nmodule.exports = function fill(value /*, start = 0, end = @length */){\n var O = toObject(this)\n , length = toLength(O.length)\n , aLen = arguments.length\n , index = toIndex(aLen > 1 ? arguments[1] : undefined, length)\n , end = aLen > 2 ? arguments[2] : undefined\n , endPos = end === undefined ? length : toIndex(end, length);\n while(endPos > index)O[index++] = value;\n return O;\n};\n\n/***/ }),\n/* 277 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15)\n , isArray = __webpack_require__(162)\n , SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n/***/ }),\n/* 278 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = __webpack_require__(277);\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};\n\n/***/ }),\n/* 279 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(39)\n , gOPS = __webpack_require__(58)\n , pIE = __webpack_require__(47);\nmodule.exports = function(it){\n var result = getKeys(it)\n , getSymbols = gOPS.f;\n if(getSymbols){\n var symbols = getSymbols(it)\n , isEnum = pIE.f\n , i = 0\n , key;\n while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);\n } return result;\n};\n\n/***/ }),\n/* 280 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = __webpack_require__(18);\nmodule.exports = function(){\n var that = anObject(this)\n , result = '';\n if(that.global) result += 'g';\n if(that.ignoreCase) result += 'i';\n if(that.multiline) result += 'm';\n if(that.unicode) result += 'u';\n if(that.sticky) result += 'y';\n return result;\n};\n\n/***/ }),\n/* 281 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15)\n , setPrototypeOf = __webpack_require__(171).set;\nmodule.exports = function(that, target, C){\n var P, S = target.constructor;\n if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){\n setPrototypeOf(that, P);\n } return that;\n};\n\n/***/ }),\n/* 282 */\n/***/ (function(module, exports) {\n\n// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n/***/ }),\n/* 283 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar create = __webpack_require__(78)\n , descriptor = __webpack_require__(40)\n , setToStringTag = __webpack_require__(48)\n , IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(32)(IteratorPrototype, __webpack_require__(10)('iterator'), function(){ return this; });\n\nmodule.exports = function(Constructor, NAME, next){\n Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n/***/ }),\n/* 284 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar getKeys = __webpack_require__(39)\n , toIObject = __webpack_require__(23);\nmodule.exports = function(object, el){\n var O = toIObject(object)\n , keys = getKeys(O)\n , length = keys.length\n , index = 0\n , key;\n while(length > index)if(O[key = keys[index++]] === el)return key;\n};\n\n/***/ }),\n/* 285 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , macrotask = __webpack_require__(84).set\n , Observer = global.MutationObserver || global.WebKitMutationObserver\n , process = global.process\n , Promise = global.Promise\n , isNode = __webpack_require__(38)(process) == 'process';\n\nmodule.exports = function(){\n var head, last, notify;\n\n var flush = function(){\n var parent, fn;\n if(isNode && (parent = process.domain))parent.exit();\n while(head){\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch(e){\n if(head)notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if(parent)parent.enter();\n };\n\n // Node.js\n if(isNode){\n notify = function(){\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if(Observer){\n var toggle = true\n , node = document.createTextNode('');\n new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new\n notify = function(){\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if(Promise && Promise.resolve){\n var promise = Promise.resolve();\n notify = function(){\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function(){\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function(fn){\n var task = {fn: fn, next: undefined};\n if(last)last.next = task;\n if(!head){\n head = task;\n notify();\n } last = task;\n };\n};\n\n/***/ }),\n/* 286 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(19)\n , anObject = __webpack_require__(18)\n , getKeys = __webpack_require__(39);\n\nmodule.exports = __webpack_require__(21) ? Object.defineProperties : function defineProperties(O, Properties){\n anObject(O);\n var keys = getKeys(Properties)\n , length = keys.length\n , i = 0\n , P;\n while(length > i)dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n/***/ }),\n/* 287 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(23)\n , gOPN = __webpack_require__(80).f\n , toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function(it){\n try {\n return gOPN(it);\n } catch(e){\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it){\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n/***/ }),\n/* 288 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(22)\n , toObject = __webpack_require__(41)\n , IE_PROTO = __webpack_require__(81)('IE_PROTO')\n , ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function(O){\n O = toObject(O);\n if(has(O, IE_PROTO))return O[IE_PROTO];\n if(typeof O.constructor == 'function' && O instanceof O.constructor){\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n/***/ }),\n/* 289 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all object keys, includes non-enumerable and symbols\nvar gOPN = __webpack_require__(80)\n , gOPS = __webpack_require__(58)\n , anObject = __webpack_require__(18)\n , Reflect = __webpack_require__(13).Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it){\n var keys = gOPN.f(anObject(it))\n , getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n\n/***/ }),\n/* 290 */\n/***/ (function(module, exports) {\n\n// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y){\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n\n/***/ }),\n/* 291 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(18)\n , aFunction = __webpack_require__(71)\n , SPECIES = __webpack_require__(10)('species');\nmodule.exports = function(O, D){\n var C = anObject(O).constructor, S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n/***/ }),\n/* 292 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(61)\n , defined = __webpack_require__(30);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function(TO_STRING){\n return function(that, pos){\n var s = String(defined(that))\n , i = toInteger(pos)\n , l = s.length\n , a, b;\n if(i < 0 || i >= l)return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n/***/ }),\n/* 293 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , core = __webpack_require__(44)\n , LIBRARY = __webpack_require__(57)\n , wksExt = __webpack_require__(175)\n , defineProperty = __webpack_require__(19).f;\nmodule.exports = function(name){\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});\n};\n\n/***/ }),\n/* 294 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 295 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 296 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 297 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 298 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 299 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_299__;\n\n/***/ }),\n/* 300 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_300__;\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=handsontable.js.map\n\n//# sourceURL=webpack:///./node_modules/.pnpm/handsontable@0.32.0/node_modules/handsontable/dist/handsontable.js?");
  555. /***/ })
  556. }]);