{"version":3,"file":"index-DVamZWt0.mjs","sources":["../../../node_modules/lodash-es/flatten.js","../../../node_modules/lodash-es/_flatRest.js","../../../node_modules/lodash-es/_baseSlice.js","../../../node_modules/lodash-es/_parent.js","../../../node_modules/lodash-es/_baseUnset.js","../../../node_modules/lodash-es/_customOmitClone.js","../../../node_modules/lodash-es/omit.js","../../../node_modules/d3-scale/src/log.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/basis.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/basisClosed.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/basisOpen.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/bundle.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinal.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinalClosed.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/cardinalOpen.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRom.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRomClosed.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/catmullRomOpen.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/monotone.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/natural.js","../../../node_modules/d3/node_modules/d3-shape/src/curve/step.js","../src/services/canvas-zoom.ts","../src/services/essentials/events.ts","../src/services/essentials/files.ts","../src/services/essentials/transitions.ts","../../../node_modules/date-fns/compareAsc.js","../../../node_modules/date-fns/differenceInCalendarYears.js","../../../node_modules/date-fns/differenceInYears.js","../../../node_modules/date-fns/addMonths.js","../../../node_modules/date-fns/addYears.js","../../../node_modules/date-fns/subYears.js","../../../node_modules/date-fns/differenceInCalendarMonths.js","../../../node_modules/date-fns/endOfDay.js","../../../node_modules/date-fns/endOfMonth.js","../../../node_modules/date-fns/isLastDayOfMonth.js","../../../node_modules/date-fns/differenceInMonths.js","../../../node_modules/date-fns/subMonths.js","../../../node_modules/date-fns/differenceInDays.js","../../../node_modules/date-fns/addDays.js","../../../node_modules/date-fns/subDays.js","../../../node_modules/date-fns/_lib/getRoundingMethod.js","../../../node_modules/date-fns/differenceInHours.js","../../../node_modules/date-fns/addMilliseconds.js","../../../node_modules/date-fns/addHours.js","../../../node_modules/date-fns/subHours.js","../../../node_modules/date-fns/differenceInMilliseconds.js","../../../node_modules/date-fns/differenceInMinutes.js","../../../node_modules/date-fns/addMinutes.js","../../../node_modules/date-fns/subMinutes.js","../../../node_modules/date-fns/differenceInSeconds.js","../../../node_modules/date-fns/addSeconds.js","../../../node_modules/date-fns/subSeconds.js","../src/services/scales-cartesian.ts","../src/services/curves.ts","../src/services/zoom.ts"],"sourcesContent":["import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n  var length = array == null ? 0 : array.length;\n  return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n","import flatten from './flatten.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n  return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nexport default flatRest;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n  var index = -1,\n      length = array.length;\n\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = end > length ? length : end;\n  if (end < 0) {\n    end += length;\n  }\n  length = start > end ? 0 : ((end - start) >>> 0);\n  start >>>= 0;\n\n  var result = Array(length);\n  while (++index < length) {\n    result[index] = array[index + start];\n  }\n  return result;\n}\n\nexport default baseSlice;\n","import baseGet from './_baseGet.js';\nimport baseSlice from './_baseSlice.js';\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n  return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nexport default parent;\n","import castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n  path = castPath(path, object);\n\n  // Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg\n  var index = -1,\n      length = path.length;\n\n  if (!length) {\n    return true;\n  }\n\n  var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');\n\n  while (++index < length) {\n    var key = path[index];\n\n    // skip non-string keys (e.g., Symbols, numbers)\n    if (typeof key !== 'string') {\n      continue;\n    }\n\n    // Always block \"__proto__\" anywhere in the path if it's not expected\n    if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {\n      return false;\n    }\n\n    // Block \"constructor.prototype\" chains\n    if (key === 'constructor' &&\n        (index + 1) < length &&\n        typeof path[index + 1] === 'string' &&\n        path[index + 1] === 'prototype') {\n\n      // Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')\n      if (isRootPrimitive && index === 0) {\n        continue;\n      }\n\n      return false;\n    }\n  }\n\n  var obj = parent(object, path);\n  return obj == null || delete obj[toKey(last(path))];\n}\n\nexport default baseUnset;\n","import isPlainObject from './isPlainObject.js';\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n  return isPlainObject(value) ? undefined : value;\n}\n\nexport default customOmitClone;\n","import arrayMap from './_arrayMap.js';\nimport baseClone from './_baseClone.js';\nimport baseUnset from './_baseUnset.js';\nimport castPath from './_castPath.js';\nimport copyObject from './_copyObject.js';\nimport customOmitClone from './_customOmitClone.js';\nimport flatRest from './_flatRest.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n  var result = {};\n  if (object == null) {\n    return result;\n  }\n  var isDeep = false;\n  paths = arrayMap(paths, function(path) {\n    path = castPath(path, object);\n    isDeep || (isDeep = path.length > 1);\n    return path;\n  });\n  copyObject(object, getAllKeysIn(object), result);\n  if (isDeep) {\n    result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n  }\n  var length = paths.length;\n  while (length--) {\n    baseUnset(result, paths[length]);\n  }\n  return result;\n});\n\nexport default omit;\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n  return Math.log(x);\n}\n\nfunction transformExp(x) {\n  return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n  return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n  return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n  return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n  return base === 10 ? pow10\n      : base === Math.E ? Math.exp\n      : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n  return base === Math.E ? Math.log\n      : base === 10 && Math.log10\n      || base === 2 && Math.log2\n      || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n  return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n  const scale = transform(transformLog, transformExp);\n  const domain = scale.domain;\n  let base = 10;\n  let logs;\n  let pows;\n\n  function rescale() {\n    logs = logp(base), pows = powp(base);\n    if (domain()[0] < 0) {\n      logs = reflect(logs), pows = reflect(pows);\n      transform(transformLogn, transformExpn);\n    } else {\n      transform(transformLog, transformExp);\n    }\n    return scale;\n  }\n\n  scale.base = function(_) {\n    return arguments.length ? (base = +_, rescale()) : base;\n  };\n\n  scale.domain = function(_) {\n    return arguments.length ? (domain(_), rescale()) : domain();\n  };\n\n  scale.ticks = count => {\n    const d = domain();\n    let u = d[0];\n    let v = d[d.length - 1];\n    const r = v < u;\n\n    if (r) ([u, v] = [v, u]);\n\n    let i = logs(u);\n    let j = logs(v);\n    let k;\n    let t;\n    const n = count == null ? 10 : +count;\n    let z = [];\n\n    if (!(base % 1) && j - i < n) {\n      i = Math.floor(i), j = Math.ceil(j);\n      if (u > 0) for (; i <= j; ++i) {\n        for (k = 1; k < base; ++k) {\n          t = i < 0 ? k / pows(-i) : k * pows(i);\n          if (t < u) continue;\n          if (t > v) break;\n          z.push(t);\n        }\n      } else for (; i <= j; ++i) {\n        for (k = base - 1; k >= 1; --k) {\n          t = i > 0 ? k / pows(-i) : k * pows(i);\n          if (t < u) continue;\n          if (t > v) break;\n          z.push(t);\n        }\n      }\n      if (z.length * 2 < n) z = ticks(u, v, n);\n    } else {\n      z = ticks(i, j, Math.min(j - i, n)).map(pows);\n    }\n    return r ? z.reverse() : z;\n  };\n\n  scale.tickFormat = (count, specifier) => {\n    if (count == null) count = 10;\n    if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n    if (typeof specifier !== \"function\") {\n      if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n      specifier = format(specifier);\n    }\n    if (count === Infinity) return specifier;\n    const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n    return d => {\n      let i = d / pows(Math.round(logs(d)));\n      if (i * base < base - 0.5) i *= base;\n      return i <= k ? specifier(d) : \"\";\n    };\n  };\n\n  scale.nice = () => {\n    return domain(nice(domain(), {\n      floor: x => pows(Math.floor(logs(x))),\n      ceil: x => pows(Math.ceil(logs(x)))\n    }));\n  };\n\n  return scale;\n}\n\nexport default function log() {\n  const scale = loggish(transformer()).domain([1, 10]);\n  scale.copy = () => copy(scale, log()).base(scale.base());\n  initRange.apply(scale, arguments);\n  return scale;\n}\n","export function point(that, x, y) {\n  that._context.bezierCurveTo(\n    (2 * that._x0 + that._x1) / 3,\n    (2 * that._y0 + that._y1) / 3,\n    (that._x0 + 2 * that._x1) / 3,\n    (that._y0 + 2 * that._y1) / 3,\n    (that._x0 + 4 * that._x1 + x) / 6,\n    (that._y0 + 4 * that._y1 + y) / 6\n  );\n}\n\nexport function Basis(context) {\n  this._context = context;\n}\n\nBasis.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 =\n    this._y0 = this._y1 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 3: point(this, this._x1, this._y1); // falls through\n      case 2: this._context.lineTo(this._x1, this._y1); break;\n    }\n    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n      case 1: this._point = 2; break;\n      case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n      default: point(this, x, y); break;\n    }\n    this._x0 = this._x1, this._x1 = x;\n    this._y0 = this._y1, this._y1 = y;\n  }\n};\n\nexport default function(context) {\n  return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n  this._context = context;\n}\n\nBasisClosed.prototype = {\n  areaStart: noop,\n  areaEnd: noop,\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n    this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 1: {\n        this._context.moveTo(this._x2, this._y2);\n        this._context.closePath();\n        break;\n      }\n      case 2: {\n        this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n        this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n        this._context.closePath();\n        break;\n      }\n      case 3: {\n        this.point(this._x2, this._y2);\n        this.point(this._x3, this._y3);\n        this.point(this._x4, this._y4);\n        break;\n      }\n    }\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n      case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n      case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n      default: point(this, x, y); break;\n    }\n    this._x0 = this._x1, this._x1 = x;\n    this._y0 = this._y1, this._y1 = y;\n  }\n};\n\nexport default function(context) {\n  return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n  this._context = context;\n}\n\nBasisOpen.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 =\n    this._y0 = this._y1 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; break;\n      case 1: this._point = 2; break;\n      case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n      case 3: this._point = 4; // falls through\n      default: point(this, x, y); break;\n    }\n    this._x0 = this._x1, this._x1 = x;\n    this._y0 = this._y1, this._y1 = y;\n  }\n};\n\nexport default function(context) {\n  return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n  this._basis = new Basis(context);\n  this._beta = beta;\n}\n\nBundle.prototype = {\n  lineStart: function() {\n    this._x = [];\n    this._y = [];\n    this._basis.lineStart();\n  },\n  lineEnd: function() {\n    var x = this._x,\n        y = this._y,\n        j = x.length - 1;\n\n    if (j > 0) {\n      var x0 = x[0],\n          y0 = y[0],\n          dx = x[j] - x0,\n          dy = y[j] - y0,\n          i = -1,\n          t;\n\n      while (++i <= j) {\n        t = i / j;\n        this._basis.point(\n          this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n          this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n        );\n      }\n    }\n\n    this._x = this._y = null;\n    this._basis.lineEnd();\n  },\n  point: function(x, y) {\n    this._x.push(+x);\n    this._y.push(+y);\n  }\n};\n\nexport default (function custom(beta) {\n\n  function bundle(context) {\n    return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n  }\n\n  bundle.beta = function(beta) {\n    return custom(+beta);\n  };\n\n  return bundle;\n})(0.85);\n","export function point(that, x, y) {\n  that._context.bezierCurveTo(\n    that._x1 + that._k * (that._x2 - that._x0),\n    that._y1 + that._k * (that._y2 - that._y0),\n    that._x2 + that._k * (that._x1 - x),\n    that._y2 + that._k * (that._y1 - y),\n    that._x2,\n    that._y2\n  );\n}\n\nexport function Cardinal(context, tension) {\n  this._context = context;\n  this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 =\n    this._y0 = this._y1 = this._y2 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 2: this._context.lineTo(this._x2, this._y2); break;\n      case 3: point(this, this._x1, this._y1); break;\n    }\n    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n      case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n      case 2: this._point = 3; // falls through\n      default: point(this, x, y); break;\n    }\n    this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n    this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n  }\n};\n\nexport default (function custom(tension) {\n\n  function cardinal(context) {\n    return new Cardinal(context, tension);\n  }\n\n  cardinal.tension = function(tension) {\n    return custom(+tension);\n  };\n\n  return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n  this._context = context;\n  this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n  areaStart: noop,\n  areaEnd: noop,\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n    this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 1: {\n        this._context.moveTo(this._x3, this._y3);\n        this._context.closePath();\n        break;\n      }\n      case 2: {\n        this._context.lineTo(this._x3, this._y3);\n        this._context.closePath();\n        break;\n      }\n      case 3: {\n        this.point(this._x3, this._y3);\n        this.point(this._x4, this._y4);\n        this.point(this._x5, this._y5);\n        break;\n      }\n    }\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n      case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n      case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n      default: point(this, x, y); break;\n    }\n    this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n    this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n  }\n};\n\nexport default (function custom(tension) {\n\n  function cardinal(context) {\n    return new CardinalClosed(context, tension);\n  }\n\n  cardinal.tension = function(tension) {\n    return custom(+tension);\n  };\n\n  return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n  this._context = context;\n  this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 =\n    this._y0 = this._y1 = this._y2 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; break;\n      case 1: this._point = 2; break;\n      case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n      case 3: this._point = 4; // falls through\n      default: point(this, x, y); break;\n    }\n    this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n    this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n  }\n};\n\nexport default (function custom(tension) {\n\n  function cardinal(context) {\n    return new CardinalOpen(context, tension);\n  }\n\n  cardinal.tension = function(tension) {\n    return custom(+tension);\n  };\n\n  return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n  var x1 = that._x1,\n      y1 = that._y1,\n      x2 = that._x2,\n      y2 = that._y2;\n\n  if (that._l01_a > epsilon) {\n    var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n        n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n    x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n    y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n  }\n\n  if (that._l23_a > epsilon) {\n    var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n        m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n    x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n    y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n  }\n\n  that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n  this._context = context;\n  this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 =\n    this._y0 = this._y1 = this._y2 = NaN;\n    this._l01_a = this._l12_a = this._l23_a =\n    this._l01_2a = this._l12_2a = this._l23_2a =\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 2: this._context.lineTo(this._x2, this._y2); break;\n      case 3: this.point(this._x2, this._y2); break;\n    }\n    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n\n    if (this._point) {\n      var x23 = this._x2 - x,\n          y23 = this._y2 - y;\n      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n    }\n\n    switch (this._point) {\n      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n      case 1: this._point = 2; break;\n      case 2: this._point = 3; // falls through\n      default: point(this, x, y); break;\n    }\n\n    this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n    this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n    this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n    this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n  }\n};\n\nexport default (function custom(alpha) {\n\n  function catmullRom(context) {\n    return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n  }\n\n  catmullRom.alpha = function(alpha) {\n    return custom(+alpha);\n  };\n\n  return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n  this._context = context;\n  this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n  areaStart: noop,\n  areaEnd: noop,\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n    this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n    this._l01_a = this._l12_a = this._l23_a =\n    this._l01_2a = this._l12_2a = this._l23_2a =\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 1: {\n        this._context.moveTo(this._x3, this._y3);\n        this._context.closePath();\n        break;\n      }\n      case 2: {\n        this._context.lineTo(this._x3, this._y3);\n        this._context.closePath();\n        break;\n      }\n      case 3: {\n        this.point(this._x3, this._y3);\n        this.point(this._x4, this._y4);\n        this.point(this._x5, this._y5);\n        break;\n      }\n    }\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n\n    if (this._point) {\n      var x23 = this._x2 - x,\n          y23 = this._y2 - y;\n      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n    }\n\n    switch (this._point) {\n      case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n      case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n      case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n      default: point(this, x, y); break;\n    }\n\n    this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n    this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n    this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n    this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n  }\n};\n\nexport default (function custom(alpha) {\n\n  function catmullRom(context) {\n    return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n  }\n\n  catmullRom.alpha = function(alpha) {\n    return custom(+alpha);\n  };\n\n  return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n  this._context = context;\n  this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 = this._x2 =\n    this._y0 = this._y1 = this._y2 = NaN;\n    this._l01_a = this._l12_a = this._l23_a =\n    this._l01_2a = this._l12_2a = this._l23_2a =\n    this._point = 0;\n  },\n  lineEnd: function() {\n    if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n\n    if (this._point) {\n      var x23 = this._x2 - x,\n          y23 = this._y2 - y;\n      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n    }\n\n    switch (this._point) {\n      case 0: this._point = 1; break;\n      case 1: this._point = 2; break;\n      case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n      case 3: this._point = 4; // falls through\n      default: point(this, x, y); break;\n    }\n\n    this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n    this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n    this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n    this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n  }\n};\n\nexport default (function custom(alpha) {\n\n  function catmullRom(context) {\n    return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n  }\n\n  catmullRom.alpha = function(alpha) {\n    return custom(+alpha);\n  };\n\n  return catmullRom;\n})(0.5);\n","function sign(x) {\n  return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n  var h0 = that._x1 - that._x0,\n      h1 = x2 - that._x1,\n      s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n      s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n      p = (s0 * h1 + s1 * h0) / (h0 + h1);\n  return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n  var h = that._x1 - that._x0;\n  return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n  var x0 = that._x0,\n      y0 = that._y0,\n      x1 = that._x1,\n      y1 = that._y1,\n      dx = (x1 - x0) / 3;\n  that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n  this._context = context;\n}\n\nMonotoneX.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x0 = this._x1 =\n    this._y0 = this._y1 =\n    this._t0 = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    switch (this._point) {\n      case 2: this._context.lineTo(this._x1, this._y1); break;\n      case 3: point(this, this._t0, slope2(this, this._t0)); break;\n    }\n    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    var t1 = NaN;\n\n    x = +x, y = +y;\n    if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n    switch (this._point) {\n      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n      case 1: this._point = 2; break;\n      case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n      default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n    }\n\n    this._x0 = this._x1, this._x1 = x;\n    this._y0 = this._y1, this._y1 = y;\n    this._t0 = t1;\n  }\n}\n\nfunction MonotoneY(context) {\n  this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n  MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n  this._context = context;\n}\n\nReflectContext.prototype = {\n  moveTo: function(x, y) { this._context.moveTo(y, x); },\n  closePath: function() { this._context.closePath(); },\n  lineTo: function(x, y) { this._context.lineTo(y, x); },\n  bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n  return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n  return new MonotoneY(context);\n}\n","function Natural(context) {\n  this._context = context;\n}\n\nNatural.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x = [];\n    this._y = [];\n  },\n  lineEnd: function() {\n    var x = this._x,\n        y = this._y,\n        n = x.length;\n\n    if (n) {\n      this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n      if (n === 2) {\n        this._context.lineTo(x[1], y[1]);\n      } else {\n        var px = controlPoints(x),\n            py = controlPoints(y);\n        for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n          this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n        }\n      }\n    }\n\n    if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n    this._line = 1 - this._line;\n    this._x = this._y = null;\n  },\n  point: function(x, y) {\n    this._x.push(+x);\n    this._y.push(+y);\n  }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n  var i,\n      n = x.length - 1,\n      m,\n      a = new Array(n),\n      b = new Array(n),\n      r = new Array(n);\n  a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n  for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n  a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n  for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n  a[n - 1] = r[n - 1] / b[n - 1];\n  for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n  b[n - 1] = (x[n] + a[n - 1]) / 2;\n  for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n  return [a, b];\n}\n\nexport default function(context) {\n  return new Natural(context);\n}\n","function Step(context, t) {\n  this._context = context;\n  this._t = t;\n}\n\nStep.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._x = this._y = NaN;\n    this._point = 0;\n  },\n  lineEnd: function() {\n    if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n    if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n      case 1: this._point = 2; // falls through\n      default: {\n        if (this._t <= 0) {\n          this._context.lineTo(this._x, y);\n          this._context.lineTo(x, y);\n        } else {\n          var x1 = this._x * (1 - this._t) + x * this._t;\n          this._context.lineTo(x1, this._y);\n          this._context.lineTo(x1, y);\n        }\n        break;\n      }\n    }\n    this._x = x, this._y = y;\n  }\n};\n\nexport default function(context) {\n  return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n  return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n  return new Step(context, 1);\n}\n","import { select } from 'd3'\nimport { Service } from './service'\nimport { Events } from '@/interfaces/enums'\nimport { canvasZoomSettings } from '@/configuration'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class CanvasZoom extends Service {\n\tprotected model: any\n\n\t/**\n\t * focal:  object to zoom into\n\t * canvasElements: all the elements to translate and zoom on the chart area\n\t * zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours\n\t *  */\n\tzoomIn(focal: any, canvasElements: any, zoomSettings?: any) {\n\t\tlet x: number\n\t\tlet y: number\n\t\tlet zoomLevel: number\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\n\t\tif (focal) {\n\t\t\tx = focal.x\n\t\t\ty = focal.y\n\t\t\tzoomLevel = 2\n\t\t}\n\n\t\t// the 'viewport' size of the chart\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.services.domUtils.getHolder(), {\n\t\t\tuseClientDimensions: true\n\t\t})\n\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(${width / 2}, ${height / 2}) scale(${zoomLevel}) translate(${-x},${-y})`\n\t\t\t)\n\n\t\t// Dispatch canvas zoom in event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_IN, {\n\t\t\telement: select(focal)\n\t\t})\n\t}\n\n\tzoomOut(canvasElements: any, zoomSettings?: any) {\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr('transform', '')\n\n\t\t// Dispatch canvas zoom out event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_OUT)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class Events extends Service {\n\t// DOM Event target\n\tdocumentFragment: DocumentFragment\n\n\tinit() {\n\t\t// Setup the event fragment on the DOM\n\t\tthis.documentFragment = document.createDocumentFragment()\n\t}\n\n\taddEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.addEventListener(type, listener)\n\t}\n\n\tremoveEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.removeEventListener(type, listener)\n\t}\n\n\tdispatchEvent(eventType: string, eventDetail?: object) {\n\t\tlet newEvent: any\n\t\tif (eventDetail) {\n\t\t\tnewEvent = new CustomEvent(eventType, {\n\t\t\t\tdetail: eventDetail\n\t\t\t})\n\t\t} else {\n\t\t\tnewEvent = document.createEvent('Event')\n\t\t\tnewEvent.initEvent(eventType, false, true)\n\t\t}\n\n\t\tthis.documentFragment.dispatchEvent(newEvent)\n\t}\n}\n","import { Service } from '@/services/service'\nimport { ChartModel } from '@/model/model'\n\nexport class Files extends Service {\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tdownloadCSV(content: any, filename: string) {\n\t\tconst anchor = document.createElement('a')\n\t\tconst mimeType = 'text/csv;encoding:utf-8'\n\n\t\tif (navigator['msSaveBlob']) {\n\t\t\t// Internet Explorer 10\n\t\t\tnavigator['msSaveBlob'](\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t}),\n\t\t\t\tfilename\n\t\t\t)\n\t\t} else if (URL && 'download' in anchor) {\n\t\t\t// HTML5\n\t\t\tconst href = URL.createObjectURL(\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t})\n\t\t\t)\n\t\t\tanchor.href = href\n\t\t\tanchor.setAttribute('download', filename)\n\n\t\t\t// Add anchor to body\n\t\t\tdocument.body.appendChild(anchor)\n\n\t\t\t// Click anchor\n\t\t\tanchor.click()\n\n\t\t\t// Remove anchor from body\n\t\t\tdocument.body.removeChild(anchor)\n\t\t\tURL.revokeObjectURL(href)\n\t\t} else {\n\t\t\tlocation.href = `data:application/octet-stream,${encodeURIComponent(content)}`\n\t\t}\n\t}\n\n\tdownloadImage(uri: string, name: string) {\n\t\tconst link = document.createElement('a')\n\t\tlink.download = name\n\t\tlink.href = uri\n\t\tdocument.body.appendChild(link)\n\t\tlink.click()\n\t\tdocument.body.removeChild(link)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { transitions as transitionConfigs } from '@/configuration'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\nimport type { Transition } from 'd3'\n\nexport interface setupTransitionConfigs {\n\ttransition?: any // d3 types are causing issues here, hence why using `any`\n\tname?: string\n\tanimate?: boolean\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions: Record<number, Transition<any, any, any, any>> = {}\n\n\tinit() {\n\t\tthis.services.events?.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {}\n\t\t})\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id]\n\t\t})\n\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn t.duration(0)\n\t\t}\n\n\t\treturn t.duration(\n\t\t\tgetProperty(transitionConfigs, name, 'duration') || transitionConfigs.default.duration\n\t\t)\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions\n\t}\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n *   new Date(1995, 6, 2),\n *   new Date(1987, 1, 11),\n *   new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * //   Wed Feb 11 1987 00:00:00,\n * //   Mon Jul 10 1989 00:00:00,\n * //   Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n  const diff = +toDate(dateLeft) - +toDate(dateRight);\n\n  if (diff < 0) return -1;\n  else if (diff > 0) return 1;\n\n  // Return 0 if diff is 0; return NaN if diff is NaN\n  return diff;\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarYears} function options.\n */\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n *   new Date(2015, 1, 11),\n *   new Date(2013, 11, 31)\n * );\n * //=> 2\n */\nexport function differenceInCalendarYears(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n  return laterDate_.getFullYear() - earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.js\";\n\n/**\n * The {@link differenceInYears} function options.\n */\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport function differenceInYears(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n\n  // -1 if the left date is earlier than the right date\n  // 2023-12-31 - 2024-01-01 = -1\n  const sign = compareAsc(laterDate_, earlierDate_);\n\n  // First calculate the difference in calendar years\n  // 2024-01-01 - 2023-12-31 = 1 year\n  const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));\n\n  // Now we need to calculate if the difference is full. To do that we set\n  // both dates to the same year and check if the both date's month and day\n  // form a full year.\n  laterDate_.setFullYear(1584);\n  earlierDate_.setFullYear(1584);\n\n  // For it to be true, when the later date is indeed later than the earlier date\n  // (2026-02-01 - 2023-12-10 = 3 years), the difference is full if\n  // the normalized later date is also later than the normalized earlier date.\n  // In our example, 1584-02-01 is earlier than 1584-12-10, so the difference\n  // is partial, hence we need to subtract 1 from the difference 3 - 1 = 2.\n  const partial = compareAsc(laterDate_, earlierDate_) === -sign;\n\n  const result = sign * (diff - +partial);\n\n  // Prevent negative zero\n  return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInYears;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMonths} function options.\n */\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n * @param options - The options object\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount, options) {\n  const _date = toDate(date, options?.in);\n  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n  if (!amount) {\n    // If 0 months, no-op to avoid changing times in the hour before end of DST\n    return _date;\n  }\n  const dayOfMonth = _date.getDate();\n\n  // The JS Date object supports date math by accepting out-of-bounds values for\n  // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n  // new Date(2020, 13, 1) returns 1 Feb 2021.  This is *almost* the behavior we\n  // want except that dates will wrap around the end of a month, meaning that\n  // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n  // we'll default to the end of the desired month by adding 1 to the desired\n  // month and using a date of 0 to back up one day to the end of the desired\n  // month.\n  const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n  endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n  const daysInMonth = endOfDesiredMonth.getDate();\n  if (dayOfMonth >= daysInMonth) {\n    // If we're already at the end of the month, then this is the correct date\n    // and we're done.\n    return endOfDesiredMonth;\n  } else {\n    // Otherwise, we now know that setting the original day-of-month value won't\n    // cause an overflow, so set the desired day-of-month. Note that we can't\n    // just set the date of `endOfDesiredMonth` because that object may have had\n    // its time changed in the unusual case where where a DST transition was on\n    // the last day of the month and its local time was in the hour skipped or\n    // repeated next to a DST transition.  So we use `date` instead which is\n    // guaranteed to still have the original time.\n    _date.setFullYear(\n      endOfDesiredMonth.getFullYear(),\n      endOfDesiredMonth.getMonth(),\n      dayOfMonth,\n    );\n    return _date;\n  }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n  return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n","import { addYears } from \"./addYears.js\";\n\n/**\n * The {@link subYears} function options.\n */\n\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the years subtracted\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nexport function subYears(date, amount, options) {\n  return addYears(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subYears;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n *   new Date(2014, 8, 1),\n *   new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n\n  const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n  const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n  return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfDay} function options.\n */\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date, options) {\n  const _date = toDate(date, options?.in);\n  _date.setHours(23, 59, 59, 999);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfMonth} function options.\n */\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date, options) {\n  const _date = toDate(date, options?.in);\n  const month = _date.getMonth();\n  _date.setFullYear(_date.getFullYear(), month + 1, 0);\n  _date.setHours(23, 59, 59, 999);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { endOfDay } from \"./endOfDay.js\";\nimport { endOfMonth } from \"./endOfMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date, options) {\n  const _date = toDate(date, options?.in);\n  return +endOfDay(_date, options) === +endOfMonth(_date, options);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.js\";\n\n/**\n * The {@link differenceInMonths} function options.\n */\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(laterDate, earlierDate, options) {\n  const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    laterDate,\n    earlierDate,\n  );\n\n  const sign = compareAsc(workingLaterDate, earlierDate_);\n  const difference = Math.abs(\n    differenceInCalendarMonths(workingLaterDate, earlierDate_),\n  );\n\n  if (difference < 1) return 0;\n\n  if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)\n    workingLaterDate.setDate(30);\n\n  workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);\n\n  let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;\n\n  if (\n    isLastDayOfMonth(laterDate_) &&\n    difference === 1 &&\n    compareAsc(laterDate_, earlierDate_) === 1\n  ) {\n    isLastMonthNotFull = false;\n  }\n\n  const result = sign * (difference - +isLastMonthNotFull);\n  return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { addMonths } from \"./addMonths.js\";\n\n/**\n * The subMonths function options.\n */\n\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function subMonths(date, amount, options) {\n  return addMonths(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subMonths;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\n\n/**\n * The {@link differenceInDays} function options.\n */\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full days according to the local timezone\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n *   new Date(2012, 6, 2, 0, 0),\n *   new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n *   new Date(2011, 6, 3, 0, 1),\n *   new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n *\n * @example\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n *   new Date(2020, 5, 1),\n *   new Date(2020, 2, 1)\n * )\n * //=> 92\n */\nexport function differenceInDays(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n\n  const sign = compareLocalAsc(laterDate_, earlierDate_);\n  const difference = Math.abs(\n    differenceInCalendarDays(laterDate_, earlierDate_),\n  );\n\n  laterDate_.setDate(laterDate_.getDate() - sign * difference);\n\n  // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n  // If so, result must be decreased by 1 in absolute value\n  const isLastDayNotFull = Number(\n    compareLocalAsc(laterDate_, earlierDate_) === -sign,\n  );\n\n  const result = sign * (difference - isLastDayNotFull);\n  // Prevent negative zero\n  return result === 0 ? 0 : result;\n}\n\n// Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(laterDate, earlierDate) {\n  const diff =\n    laterDate.getFullYear() - earlierDate.getFullYear() ||\n    laterDate.getMonth() - earlierDate.getMonth() ||\n    laterDate.getDate() - earlierDate.getDate() ||\n    laterDate.getHours() - earlierDate.getHours() ||\n    laterDate.getMinutes() - earlierDate.getMinutes() ||\n    laterDate.getSeconds() - earlierDate.getSeconds() ||\n    laterDate.getMilliseconds() - earlierDate.getMilliseconds();\n\n  if (diff < 0) return -1;\n  if (diff > 0) return 1;\n\n  // Return 0 if diff is 0; return NaN if diff is NaN\n  return diff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInDays;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n  const _date = toDate(date, options?.in);\n  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n  // If 0 days, no-op to avoid changing times in the hour before end of DST\n  if (!amount) return _date;\n\n  _date.setDate(_date.getDate() + amount);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link subDays} function options.\n */\n\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport function subDays(date, amount, options) {\n  return addDays(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subDays;\n","export function getRoundingMethod(method) {\n  return (number) => {\n    const round = method ? Math[method] : Math.trunc;\n    const result = round(number);\n    // Prevent negative zero\n    return result === 0 ? 0 : result;\n  };\n}\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n *   new Date(2014, 6, 2, 19, 0),\n *   new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(laterDate, earlierDate, options) {\n  const [laterDate_, earlierDate_] = normalizeDates(\n    options?.in,\n    laterDate,\n    earlierDate,\n  );\n  const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;\n  return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMilliseconds} function options.\n */\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n * @param options - The options object\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount, options) {\n  return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n","import { addMilliseconds } from \"./addMilliseconds.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link addHours} function options.\n */\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be added\n * @param options - An object with options\n *\n * @returns The new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport function addHours(date, amount, options) {\n  return addMilliseconds(date, amount * millisecondsInHour, options);\n}\n\n// Fallback for modularized imports:\nexport default addHours;\n","import { addHours } from \"./addHours.js\";\n\n/**\n * The {@link subHours} function options.\n */\n\n/**\n * @name subHours\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be subtracted.\n * @param options - The options\n *\n * @returns The new date with the hours subtracted\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * const result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nexport function subHours(date, amount, options) {\n  return addHours(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n *   new Date(2014, 6, 2, 12, 30, 21, 700),\n *   new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n  return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { millisecondsInMinute } from \"./constants.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n *   new Date(2014, 6, 2, 12, 20, 0),\n *   new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n *   new Date(2000, 0, 1, 10, 0, 0),\n *   new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n  const diff =\n    differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n  return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { millisecondsInMinute } from \"./constants.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMinutes} function options.\n */\n\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be added.\n * @param options - An object with options\n *\n * @returns The new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nexport function addMinutes(date, amount, options) {\n  const _date = toDate(date, options?.in);\n  _date.setTime(_date.getTime() + amount * millisecondsInMinute);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default addMinutes;\n","import { addMinutes } from \"./addMinutes.js\";\n\n/**\n * The {@link subMinutes} function options.\n */\n\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of minutes to be subtracted.\n * @param options - An object with options\n *\n * @returns The new date with the minutes subtracted\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nexport function subMinutes(date, amount, options) {\n  return addMinutes(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subMinutes;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n *   new Date(2014, 6, 2, 12, 30, 20, 0),\n *   new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n  const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n  return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { addMilliseconds } from \"./addMilliseconds.js\";\n\n/**\n * The {@link addSeconds} function options.\n */\n\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be added.\n * @param options - An object with options\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport function addSeconds(date, amount, options) {\n  return addMilliseconds(date, amount * 1000, options);\n}\n\n// Fallback for modularized imports:\nexport default addSeconds;\n","import { addSeconds } from \"./addSeconds.js\";\n\n/**\n * The {@link subSeconds} function options.\n */\n\n/**\n * Subtract the specified number of seconds from the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of seconds to be subtracted.\n * @param options - The options\n *\n * @returns The new date with the seconds subtracted\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nexport function subSeconds(date, amount, options) {\n  return addSeconds(date, -amount, options);\n}\n\n// Fallback for modularized imports:\nexport default subSeconds;\n","import {\n\textent,\n\tmax,\n\tscaleBand,\n\tscaleLinear,\n\tscaleTime,\n\tscaleLog,\n\ttype ScaleTime,\n\ttype ScaleBand,\n\ttype ScaleLinear\n} from 'd3'\nimport { differenceInYears } from 'date-fns/differenceInYears'\nimport { addYears } from 'date-fns/addYears'\nimport { subYears } from 'date-fns/subYears'\nimport { differenceInMonths } from 'date-fns/differenceInMonths'\nimport { addMonths } from 'date-fns/addMonths'\nimport { subMonths } from 'date-fns/subMonths'\nimport { differenceInDays } from 'date-fns/differenceInDays'\nimport { addDays } from 'date-fns/addDays'\nimport { subDays } from 'date-fns/subDays'\nimport { differenceInHours } from 'date-fns/differenceInHours'\nimport { addHours } from 'date-fns/addHours'\nimport { subHours } from 'date-fns/subHours'\nimport { differenceInMinutes } from 'date-fns/differenceInMinutes'\nimport { addMinutes } from 'date-fns/addMinutes'\nimport { subMinutes } from 'date-fns/subMinutes'\nimport { differenceInSeconds } from 'date-fns/differenceInSeconds'\nimport { subSeconds } from 'date-fns/subSeconds'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { flatten, omit, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Service } from './service'\nimport { AxisPositions, CartesianOrientations, ScaleTypes } from '@/interfaces/enums'\nimport { ThresholdOptions } from '@/interfaces/components'\n\nexport type ScaleFunction =\n\t| ScaleTime<number, number, never>\n\t| ScaleBand<string>\n\t| ScaleLinear<number, number, never>\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null as ScaleTypes,\n\t\tright: null as ScaleTypes,\n\t\tbottom: null as ScaleTypes,\n\t\tleft: null as ScaleTypes\n\t}\n\n\tprotected scales = {\n\t\t// null or function\n\t\ttop: null as ScaleLinear<number, number, never>,\n\t\tright: null as ScaleLinear<number, number, never>,\n\t\tbottom: null as ScaleLinear<number, number, never>,\n\t\tleft: null as ScaleLinear<number, number, never>\n\t}\n\n\tprotected domainAxisPosition: AxisPositions\n\tprotected rangeAxisPosition: AxisPositions\n\tprotected secondaryDomainAxisPosition: AxisPositions\n\tprotected secondaryRangeAxisPosition: AxisPositions\n\n\tprotected dualAxes: boolean\n\n\tprotected orientation: CartesianOrientations\n\n\tgetDomainAxisPosition({ datum = null }: { datum?: any } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axesOptions = getProperty(options, 'axes', this.secondaryDomainAxisPosition)\n\t\t\tconst dataset = datum[groupMapsTo]\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null }: { datum?: any; groups?: any } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axisOptions = getProperty(options, 'axes', this.secondaryRangeAxisPosition)\n\t\t\tlet dataset\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo]\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0]\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn getProperty(this.model.getOptions(), 'axes', position)\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getAxisOptions(domainAxisPosition)\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getAxisOptions(rangeAxisPosition)\n\t}\n\n\tgetScaleLabel(position: AxisPositions) {\n\t\tconst axisOptions = this.getAxisOptions(position)\n\t\tconst title: string = axisOptions.title\n\t\tif (!title) {\n\t\t\tif (position === AxisPositions.BOTTOM || position === AxisPositions.TOP) {\n\t\t\t\treturn 'x-value'\n\t\t\t}\n\t\t\treturn 'y-value'\n\t\t}\n\t\treturn title\n\t}\n\n\tgetDomainLabel() {\n\t\treturn this.getScaleLabel(this.getDomainAxisPosition())\n\t}\n\n\tgetRangeLabel() {\n\t\treturn this.getScaleLabel(this.getRangeAxisPosition())\n\t}\n\n\tupdate() {\n\t\tthis.determineAxisDuality()\n\t\tthis.findDomainAndRangeAxes()\n\t\tthis.determineOrientation()\n\t\tconst axisPositions: AxisPositions[] = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey: string) => AxisPositions[axisPositionKey as keyof typeof AxisPositions]\n\t\t)\n\t\taxisPositions.forEach(axisPosition => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition) as ScaleLinear<\n\t\t\t\tnumber,\n\t\t\t\tnumber,\n\t\t\t\tnever\n\t\t\t>\n\t\t})\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions()\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions()\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t)\n\n\t\tthis.domainAxisPosition = domainAndRangeAxesPositions.primaryDomainAxisPosition\n\t\tthis.rangeAxisPosition = domainAndRangeAxesPositions.primaryRangeAxisPosition\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition = domainAndRangeAxesPositions.secondaryDomainAxisPosition\n\t\t\tthis.secondaryRangeAxisPosition = domainAndRangeAxesPositions.secondaryRangeAxisPosition\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets && axesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true\n\t\t}\n\t}\n\n\tgetCustomDomainValuesByposition(axisPosition: AxisPositions) {\n\t\tconst domain = getProperty(this.model.getOptions(), 'axes', axisPosition, 'domain')\n\n\t\t// Check if domain is an array\n\t\tif (domain && !Array.isArray(domain)) {\n\t\t\tthrow new Error(`Domain in ${axisPosition} axis is not a valid array`)\n\t\t}\n\n\t\t// Determine number of elements passed in domain depending on scale types\n\t\tif (Array.isArray(domain)) {\n\t\t\tif (\n\t\t\t\t(this.scaleTypes[axisPosition] === ScaleTypes.LINEAR ||\n\t\t\t\t\tthis.scaleTypes[axisPosition] === ScaleTypes.TIME) &&\n\t\t\t\tdomain.length !== 2\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`There can only be 2 elements in domain for scale type: ${this.scaleTypes[axisPosition]}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition]\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition]\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition)\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition)\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition]\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition]\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [AxisPositions.BOTTOM, AxisPositions.TOP]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\tposition => possibleXAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [AxisPositions.LEFT, AxisPositions.RIGHT]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\tposition => possibleYAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()]\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()]\n\t}\n\n\tgetValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = getProperty(datum, mapsTo) !== null ? datum[mapsTo] : datum\n\t\tlet scaledValue: number\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2\n\t\t\t\tbreak\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value))\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value)\n\t\t}\n\t\treturn scaledValue\n\t}\n\n\tgetBoundedScaledValues(datum: any): number[] {\n\t\tconst { bounds } = this.model.getOptions()\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum })\n\t\tconst scale = this.scales[axisPosition]\n\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.upperBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.lowerBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t)\n\t\t]\n\n\t\treturn boundedValues\n\t}\n\n\tgetValueThroughAxisPosition(axisPosition: AxisPositions, datum: any) {\n\t\tconst scaleType = this.scaleTypes[axisPosition] as ScaleTypes\n\t\tconst scale = this.scales[axisPosition]\n\n\t\treturn this.getValueFromScale(scale, scaleType, axisPosition, datum)\n\t}\n\n\tgetDomainValue(d: string | object) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetRangeValue(d: number | string | object) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition())\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition())\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getDomainAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getRangeAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges)\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(domain, axisConfigs.paddingRatio, axisOptions.scaleType)\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.LEFT, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT }\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.TOP, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.BOTTOM, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP }\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions: any,\n\t\thorizontalAxesPositions: any\n\t) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst mainVerticalAxisOptions = getProperty(options, 'axes', verticalAxesPositions.primary)\n\t\tconst mainHorizontalAxisOptions = getProperty(options, 'axes', horizontalAxesPositions.primary)\n\n\t\tconst mainVerticalScaleType = mainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR\n\t\tconst mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null as AxisPositions,\n\t\t\tsecondaryDomainAxisPosition: null as AxisPositions,\n\t\t\tprimaryRangeAxisPosition: null as AxisPositions,\n\t\t\tsecondaryRangeAxisPosition: null as AxisPositions\n\t\t}\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast  one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS || mainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition = verticalAxesPositions.secondary\n\t\t\tresult.secondaryRangeAxisPosition = horizontalAxesPositions.secondary\n\t\t}\n\n\t\treturn result\n\t}\n\n\tgetScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst { includeZero } = axisOptions\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (axisOptions.binned) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\n\t\t\treturn [0, max(bins, (d: any) => d.length)]\n\t\t} else if (axisOptions.limitDomainToBins) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\t\t\tconst stackKeys = this.model.getStackKeys({ bins })\n\n\t\t\treturn [stackKeys[0].split(':')[0], stackKeys[stackKeys.length - 1].split(':')[1]]\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst { extendLinearDomainBy, mapsTo, percentage, thresholds } = axisOptions\n\t\tconst { reference: ratioReference, compareTo: ratioCompareTo } = axisConfigs.ratio\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d: any) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain)\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100]\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn uniq(displayData.map((d: any) => d[mapsTo]))\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain: any\n\t\tlet allDataValues: any\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\tif (scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\treturn displayData.map((datum: any) => `${datum[ratioReference]}/${datum[ratioCompareTo]}`)\n\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map((datum: any) => +new Date(datum[mapsTo]))\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tallDataValues.push(datum[mapsTo])\n\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo])\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo])\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys({\n\t\t\t\tgroups: dataGroupNames\n\t\t\t})\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum: any) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t)\n\n\t\t\tconst stackedValues: any[] = []\n\t\t\tdataValuesGroupedByKeys.forEach((dataValues: any) => {\n\t\t\t\tconst { ...numericalValues } = dataValues\n\n\t\t\t\tlet positiveSum = 0,\n\t\t\t\t\tnegativeSum = 0\n\t\t\t\tObject.values(omit(numericalValues, 'sharedStackKey')).forEach((value: number) => {\n\t\t\t\t\tif (!isNaN(value)) {\n\t\t\t\t\t\tif (value < 0) {\n\t\t\t\t\t\t\tnegativeSum += value\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositiveSum += value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tstackedValues.push([negativeSum, positiveSum])\n\t\t\t})\n\n\t\t\tallDataValues = [\n\t\t\t\t...flatten(stackedValues),\n\t\t\t\t...nonStackedGroupsData.map((datum: any) => datum[mapsTo])\n\t\t\t]\n\t\t} else {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tconst value = datum[mapsTo]\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\tallDataValues.push(value[0])\n\t\t\t\t\tallDataValues.push(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tif (extendLinearDomainBy) {\n\t\t\t\t\t\tallDataValues.push(Math.max(datum[mapsTo], datum[extendLinearDomainBy]))\n\t\t\t\t\t}\n\t\t\t\t\tallDataValues.push(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Time can never be 0 and log of base 0 is -Infinity\n\t\tif (scaleType !== ScaleTypes.TIME && scaleType !== ScaleTypes.LOG && includeZero) {\n\t\t\tallDataValues.push(0)\n\t\t}\n\n\t\t// Add threshold values into the scale\n\t\tif (thresholds && thresholds.length > 0) {\n\t\t\tthresholds.forEach((threshold: any) => {\n\t\t\t\tconst thresholdValue = getProperty(threshold, 'value')\n\t\t\t\tif (thresholdValue !== null) allDataValues.push(thresholdValue)\n\t\t\t})\n\t\t}\n\n\t\tdomain = extent(allDataValues)\n\t\tdomain = this.extendsDomain(axisPosition, domain)\n\n\t\treturn domain\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\n\t\tif (!axisOptions) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\t\tthis.scaleTypes[axisPosition] = scaleType\n\n\t\tlet scale: ScaleFunction\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime()\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10)\n\t\t} else if (scaleType === ScaleTypes.LABELS || scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale = scaleBand()\n\t\t} else {\n\t\t\tscale = scaleLinear()\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition))\n\n\t\treturn scale\n\t}\n\n\tgetDomainLowerBound(position: any): number {\n\t\tlet domainRange: number[]\n\t\tlet lowerBound = 0\n\n\t\t// get domain ranges based on orientations\n\t\tif (this.getOrientation() === CartesianOrientations.VERTICAL) {\n\t\t\tdomainRange = this.getMainYScale().domain() as number[]\n\t\t} else {\n\t\t\tdomainRange = this.getMainXScale().domain() as number[]\n\t\t}\n\n\t\tif (getProperty(this.model.getOptions(), 'axes', position, 'includeZero') === false) {\n\t\t\t// get domain lowerBound if all are positive values\n\t\t\tif (domainRange[0] > 0 && domainRange[1] > 0) {\n\t\t\t\tlowerBound = domainRange[0]\n\t\t\t}\n\t\t}\n\n\t\treturn lowerBound\n\t}\n\n\tgetHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale()\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition)\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' || highestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value)\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value)\n\t\t}\n\t}\n\n\tgetHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale()\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value)\n\t\t}\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0])\n\tconst endDate = new Date(domain[1])\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [subYears(startDate, spaceToAddToEdges), addYears(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [subMonths(startDate, spaceToAddToEdges), addMonths(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [subDays(startDate, spaceToAddToEdges), addDays(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [subHours(startDate, spaceToAddToEdges), addHours(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30)\n\t\t]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [subMinutes(startDate, spaceToAddToEdges), addMinutes(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15)\n\t\t]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [subSeconds(startDate, spaceToAddToEdges), addSeconds(endDate, spaceToAddToEdges)]\n\t}\n\n\treturn [startDate, endDate]\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number,\n\tscaleType?: ScaleTypes\n) {\n\tconst domainLength = upper - lower\n\tconst padding = domainLength * paddingRatio\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding\n\t// If padding crosses 0, keep 0 as new lower bound\n\tlet newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding\n\n\t// Log of base 0 or a negative number is -Infinity\n\tif (scaleType === ScaleTypes.LOG && newLower <= 0) {\n\t\tif (lower <= 0) {\n\t\t\tthrow Error('Data must have values greater than 0 if log scale type is used.')\n\t\t}\n\t\tnewLower = lower\n\t}\n\n\treturn [newLower, newUpper]\n}\n","import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore\n} from 'd3'\nimport { Service } from './service'\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore\n\t}\n\n\tgetD3Curve() {\n\t\tlet curveName = 'curveLinear' as keyof typeof this.curveTypes\n\t\tconst curveOptions = this.model.getOptions().curve\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === 'string') {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions as keyof typeof this.curveTypes\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName] as any\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach(optionName => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn curve\n\t\t}\n\n\t\tconsole.warn(`The curve type '${curveName}' is invalid, using 'curveLinear' instead`)\n\t\treturn this.curveTypes['curveLinear']\n\t}\n}\n","import { extent } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport { Service } from './service'\n\nimport type { ChartModelCartesian } from '../model'\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (!getProperty(this.model.getOptions(), 'zoomBar', 'top', 'enabled')) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t)\n\n\t\treturn mainXAxisPosition === AxisPositions.BOTTOM && mainXScaleType === ScaleTypes.TIME\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData()\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData()\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?: any) {\n\t\tif (!this.services.zoom) throw new Error('Services zoom not defined')\n\t\tconst allZoomBarData = zoomBarData || this.services.zoom.getZoomBarData()\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst customDomain = getProperty(this.model.getOptions(), 'axes', mainXAxisPosition, 'domain')\n\n\t\t// return custom domain if exists && valid\n\t\tif (Array.isArray(customDomain) && customDomain.length === 2) {\n\t\t\treturn customDomain\n\t\t}\n\n\t\t// default to full range with extended domain\n\t\tif (!mainXAxisPosition) throw new Error('Not defined: mainXAxisPosition')\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t)\n\t}\n\n\thandleDomainChange(\n\t\tnewDomain: any,\n\t\tconfigs = { dispatchEvent: true, type: 'manual' as 'in' | 'out' | 'reset' | 'manual' }\n\t) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false })\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events?.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain,\n\t\t\t\ttype: configs.type\n\t\t\t})\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', 'zoomRatio')\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tconst shouldUpdateRangeAxis = getProperty(this.model.getOptions(), 'zoomBar', 'updateRangeAxis')\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales?.getDomainIdentifier()\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum: any) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t)\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\t\tconst xScale = this.services.cartesianScales?.getMainXScale().copy()\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn\n\t\t}\n\t\tconst fullRange = xScale.range()\n\t\tconst gap = currentX1 - currentX0\n\t\tconst diff = Math.min(((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2), gap / 2)\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff\n\t\tlet newX1 = currentX1 - diff\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain, { dispatchEvent: true, type: 'in' })\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy()\n\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\tconst fullRange = xScale.range()\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2)\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0])\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1])\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain, { dispatchEvent: true, type: 'out' })\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst newDomain = this.getDefaultZoomBarDomain()\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain, { dispatchEvent: true, type: 'reset' })\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst currentZoomDomainPeriod = currentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf()\n\t\tconst maxZoomDomainPeriod = maxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf()\n\t\tconst minZoomRatio = getProperty(this.model.getOptions(), 'zoomBar', 'minZoomRatio')\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0\n\t}\n\n\tisZoomBarLoading(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'loading')\n\t}\n\n\tisZoomBarLocked(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'locked')\n\t}\n}\n"],"names":["flatten","array","length","baseFlatten","flatRest","func","setToString","overRest","baseSlice","start","end","index","result","parent","object","path","baseGet","objectProto","hasOwnProperty","baseUnset","castPath","isRootPrimitive","key","obj","toKey","last","customOmitClone","value","isPlainObject","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","omit","paths","isDeep","arrayMap","copyObject","getAllKeysIn","baseClone","transformLog","x","transformExp","transformLogn","transformExpn","pow10","powp","base","logp","reflect","f","k","loggish","transform","scale","domain","logs","pows","rescale","_","count","d","u","v","r","i","j","t","n","z","ticks","specifier","formatSpecifier","format","nice","log","transformer","copy","initRange","point","that","y","Basis","context","curveBasis","BasisClosed","noop","curveBasisClosed","BasisOpen","x0","y0","curveBasisOpen","Bundle","beta","dx","dy","curveBundle","custom","bundle","Cardinal","tension","curveCardinal","cardinal","CardinalClosed","curveCardinalClosed","CardinalOpen","curveCardinalOpen","x1","y1","x2","y2","epsilon","a","b","m","CatmullRom","alpha","x23","y23","curveCatmullRom","catmullRom","CatmullRomClosed","curveCatmullRomClosed","CatmullRomOpen","curveCatmullRomOpen","sign","slope3","h0","h1","s0","s1","p","slope2","h","t0","t1","MonotoneX","MonotoneY","ReflectContext","monotoneX","monotoneY","Natural","px","controlPoints","py","i0","i1","curveNatural","Step","curveStep","stepBefore","stepAfter","CanvasZoom","Service","focal","canvasElements","zoomSettings","zoomLevel","settings","canvasZoomSettings","width","height","DOMUtils","Events","select","type","listener","eventType","eventDetail","newEvent","Files","model","services","content","filename","anchor","mimeType","href","uri","name","link","Transitions","animate","getProperty","transitionConfigs","compareAsc","dateLeft","dateRight","diff","toDate","differenceInCalendarYears","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","differenceInYears","partial","addMonths","date","amount","_date","constructFrom","dayOfMonth","endOfDesiredMonth","daysInMonth","addYears","subYears","differenceInCalendarMonths","yearsDiff","monthsDiff","endOfDay","endOfMonth","month","isLastDayOfMonth","differenceInMonths","workingLaterDate","difference","isLastMonthNotFull","subMonths","differenceInDays","compareLocalAsc","differenceInCalendarDays","isLastDayNotFull","addDays","subDays","getRoundingMethod","method","number","differenceInHours","millisecondsInHour","addMilliseconds","addHours","subHours","differenceInMilliseconds","differenceInMinutes","millisecondsInMinute","addMinutes","subMinutes","differenceInSeconds","addSeconds","subSeconds","CartesianScales","datum","groupMapsTo","axesOptions","dataset","groups","axisOptions","position","domainAxisPosition","rangeAxisPosition","title","AxisPositions","axisPositionKey","axisPosition","verticalAxesPositions","horizontalAxesPositions","domainAndRangeAxesPositions","CartesianOrientations","ScaleTypes","possibleXAxisPositions","possibleYAxisPositions","scaleType","mapsTo","scaledValue","bounds","spaceToAddToEdges","addSpacingToTimeDomain","addSpacingToContinuousDomain","axisConfigs","dualAxes","mainVerticalAxisOptions","mainHorizontalAxisOptions","mainVerticalScaleType","mainHorizontalScaleType","includeZero","bins","max","stackKeys","displayData","extendLinearDomainBy","percentage","thresholds","ratioReference","ratioCompareTo","uniq","allDataValues","dataGroupNames","dataValuesGroupedByKeys","nonStackedGroupsData","stackedValues","dataValues","numericalValues","positiveSum","negativeSum","threshold","thresholdValue","extent","scaleTime","scaleLog","scaleBand","scaleLinear","domainRange","lowerBound","domainScale","highestThreshold","rangeScale","startDate","endDate","lower","upper","paddingRatio","padding","newUpper","newLower","Curves","curveLinear","curveLinearClosed","curveMonotoneX","curveMonotoneY","curveStepAfter","curveStepBefore","curveName","curveOptions","curve","optionName","Zoom","mainXAxisPosition","mainXScaleType","customZoomBarData","zoomBarData","allZoomBarData","cartesianScales","domainIdentifier","customDomain","newDomain","configs","zoomDomain","mergedConfigs","shouldUpdateRangeAxis","filteredData","zoomRatio","currentZoomDomain","handleWidth","zoomBarConfigs","xScale","currentX0","currentX1","fullRange","gap","newX0","newX1","maxZoomDomain","currentZoomDomainPeriod","maxZoomDomainPeriod","minZoomRatio"],"mappings":";;;AAgBA,SAASA,GAAQC,GAAO;AACtB,MAAIC,IAASD,KAAS,OAAO,IAAIA,EAAM;AACvC,SAAOC,IAASC,GAAYF,GAAO,CAAC,IAAI,CAAA;AAC1C;ACRA,SAASG,GAASC,GAAM;AACtB,SAAOC,GAAYC,GAASF,GAAM,QAAWL,EAAO,GAAGK,IAAO,EAAE;AAClE;ACJA,SAASG,GAAUP,GAAOQ,GAAOC,GAAK;AACpC,MAAIC,IAAQ,IACRT,IAASD,EAAM;AAEnB,EAAIQ,IAAQ,MACVA,IAAQ,CAACA,IAAQP,IAAS,IAAKA,IAASO,IAE1CC,IAAMA,IAAMR,IAASA,IAASQ,GAC1BA,IAAM,MACRA,KA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