"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.callDateMath = callDateMath; var _datemath = _interopRequireDefault(require("@kbn/datemath")); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ function callDateMath(value) { const DEFAULT_RETURN_VALUE = 0; if (typeof value === 'string') { var _datemath$parse$value, _datemath$parse; return (_datemath$parse$value = (_datemath$parse = _datemath.default.parse(value)) === null || _datemath$parse === void 0 ? void 0 : _datemath$parse.valueOf()) !== null && _datemath$parse$value !== void 0 ? _datemath$parse$value : DEFAULT_RETURN_VALUE; } return DEFAULT_RETURN_VALUE; }