/*!
 * Copyright © 2024 Splunk Inc.
 * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
 * in part without a valid written license from Splunk Inc. is PROHIBITED.
 */
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 75);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {

module.exports = require("@splunk/ui-utils/i18n");

/***/ }),
/* 1 */
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/toConsumableArray");

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VizBehavior = void 0;
var VizBehavior;

(function (VizBehavior) {
  /**
   * Dynamic Options Behavior.
   * This allows visualization options to be powered by data
   *
   * **Example**
   *
   * sparklineValues: ">primary|seriesByIndex(0)"
   * would configure sparklineValues with an array of data points
   * coming from the first series in the primary datasource
   *
   */
  VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
  VizBehavior["EVENTS"] = "events";
  VizBehavior["DOWNSAMPLING"] = "downsampling";
  /**
   * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
   * missing.
   * @type {string}
   */

  VizBehavior["PLACEHOLDER"] = "placeholder";
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
  VizBehavior["TRELLIS"] = "trellis";
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));

/***/ }),
/* 3 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualizations-shared/schemaUtils");

/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _toConsumableArray = __webpack_require__(1);

var _defineProperty = __webpack_require__(7);

var __rest = this && this.__rest || function (s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;

var lodash_1 = __webpack_require__(6);

var schemaUtils_1 = __webpack_require__(3);

var VizBehavior_1 = __webpack_require__(2);

var dynamicOptionsDSLType = {
  type: 'string',
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
};
/**
 * Helper function to extend an options schema with dynamic options DSL
 * @param optionsSchema a visualization's options schema
 * @returns an updated options schema that additionally allows strings starting with > for each option
 */

function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
  var enhancedOptionsSchema = {};
  Object.keys(optionsSchema).forEach(function (key) {
    var _a = optionsSchema[key],
        title = _a.title,
        description = _a.description,
        readOnly = _a.readOnly,
        writeOnly = _a.writeOnly,
        examples = _a.examples,
        defaultValue = _a.default,
        type = _a.type,
        properties = _a.properties,
        patternProperties = _a.patternProperties,
        remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);

    var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
      title: title
    }), description !== undefined && {
      description: description
    }), readOnly !== undefined && {
      readOnly: readOnly
    }), writeOnly !== undefined && {
      writeOnly: writeOnly
    }), examples !== undefined && {
      examples: examples
    }), defaultValue !== undefined && {
      default: defaultValue
    });

    if (type === 'object') {
      enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
        type: type
      }), properties && {
        properties: enhanceOptionsSchemaWithDynamicOptions(properties)
      });

      if (patternProperties) {
        var enhancedPatternProperties = {};
        Object.keys(patternProperties).forEach(function (opt) {
          enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
        });
        enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
      }
    } else {
      enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
        anyOf: [Object.assign(Object.assign({}, type !== undefined && {
          type: type
        }), remainingSchemaEntry), dynamicOptionsDSLType]
      });
    }
  });
  return enhancedOptionsSchema;
}

exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
/**
 * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
 * this function also collapse all editor panels
 * @param vizConfig a Visualization Config
 * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
 * and containing `open: false` for all editor panels in editorConfig
 */

function enhanceConfig(vizConfig) {
  var enhancedConfig = Object.assign({}, vizConfig);

  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
    enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
  }

  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
    return Object.assign(Object.assign({}, config), {
      open: config.open || false
    });
  });
  return enhancedConfig;
}

exports.enhanceConfig = enhanceConfig;
/**
 * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
 * Created for editor unit tests
 * @param vizConfig a Visualization Config
 * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
 */

function uncollapseEditorConfig(vizConfig) {
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
    return Object.assign(Object.assign({}, config), {
      open: true
    });
  });
  return editorPanelUncollapsedConfig;
}

exports.uncollapseEditorConfig = uncollapseEditorConfig;

function isDynamicOption(option) {
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
}

exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset

/**
 * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
 * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
 * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
 * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
 *
 * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
 */

function hasCompatibleContexts(vizContext, presetContext) {
  var presetContextKeys = Object.keys(presetContext);
  return presetContextKeys.every(function (contextKey) {
    return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
  });
}
/**
 * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
 */


function hasCompatibleOptions(vizOptions, presetOptions) {
  var presetOptionKeys = Object.keys(presetOptions);
  return presetOptionKeys.every(function (optionKey) {
    return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
  });
}
/**
 * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
 * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
 *
 * @param {Object} vizContext - the current vizContext definition
 * @param {Object} vizOptions - the current vizOptions definition
 * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
 */


function getInitialPreset(vizContext, vizOptions, presets) {
  return presets.find(function (preset) {
    var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
    var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
    var presetContextKeys = Object.keys(presetContext);
    var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
    // if not, then the preset is invalid in config.ts

    if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
    return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
  });
}

exports.getInitialPreset = getInitialPreset;
/**
 * generates number precision values for a Select editor
 *
 * @param {Number} numPrecisionValues - number of integer precision values to generate
 * @returns {{ label: string; value; string  }[]} array of { label, value } tuples
 */

function generatePrecisionValues(numPrecisionValues) {
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
    return {
      label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
      value: i
    };
  });
}

exports.generatePrecisionValues = generatePrecisionValues;
/**
 * insert layout in layout array, return a new layout array instead of updating the original
 *
 * @param {EditorLayoutConfig[][]} layout - editor layout
 * @param {Number} index - the index to insert layout item(s)
 * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
 * @returns {EditorLayoutConfig[][]} new editor layout with insertion
 */

var insertLayout = function insertLayout(layout, index) {
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    layoutItems[_key - 2] = arguments[_key];
  }

  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
};

exports.insertLayout = insertLayout;

/***/ }),
/* 5 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualizations-shared/configUtils");

/***/ }),
/* 6 */
/***/ (function(module, exports) {

module.exports = require("lodash");

/***/ }),
/* 7 */
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/defineProperty");

/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VizCategory = void 0;
var VizCategory;

(function (VizCategory) {
  VizCategory["SINGLE_VALUE"] = "Single Value";
  VizCategory["TRENDS"] = "Trends";
  VizCategory["COMPARISONS"] = "Comparisons";
  VizCategory["TABLE"] = "Table";
  VizCategory["GAUGE"] = "Gauge";
  VizCategory["DISTRIBUTIONS"] = "Distributions";
  VizCategory["CHOROPLETH"] = "Choropleth Maps";
  VizCategory["SHAPES"] = "Shapes";
  VizCategory["MISC"] = "misc";
  VizCategory["FLOW"] = "Flow";
  VizCategory["CORRELATION"] = "Correlation";
  VizCategory["SPATIAL"] = "Spatial";
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));

/***/ }),
/* 9 */
/***/ (function(module, exports) {

module.exports = require("@splunk/themes/pick");

/***/ }),
/* 10 */
/***/ (function(module, exports) {

module.exports = require("@splunk/themes/variables");

/***/ }),
/* 11 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-icons/placeholders");

/***/ }),
/* 12 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-icons");

/***/ }),
/* 13 */,
/* 14 */,
/* 15 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");

/***/ }),
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */,
/* 21 */,
/* 22 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LAYOUT_TYPE = void 0;
var LAYOUT_TYPE;

(function (LAYOUT_TYPE) {
  LAYOUT_TYPE["Off"] = "off";
  LAYOUT_TYPE["Trellis"] = "trellis";
})(LAYOUT_TYPE = exports.LAYOUT_TYPE || (exports.LAYOUT_TYPE = {}));

/***/ }),
/* 23 */,
/* 24 */,
/* 25 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);


var StaticBackgroundColorEditor = {
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background'),
  option: 'backgroundColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
  }
};
/* harmony default export */ __webpack_exports__["default"] = (StaticBackgroundColorEditor);

/***/ }),
/* 26 */,
/* 27 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);


var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
  var defaultContext = _ref.defaultContext,
      defaultPalettesConfig = _ref.defaultPalettesConfig;
  return {
    label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
    option: 'trendColor',
    context: 'trendColorEditorConfig',
    editor: 'editor.dynamicColor',
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
    },
    editorProps: {
      labelPosition: 'top',
      flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: trend value'),
      formatters: [{
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
        value: 'rangeValue',
        defaults: {
          trendValue: defaultContext.trendColorConfig
        }
      }],
      dataSelectors: [{
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
        value: 'trendValue'
      }],
      defaultPalettesConfig: defaultPalettesConfig
    }
  };
};

/***/ }),
/* 28 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicBackgroundColorEditor", function() { return getDynamicBackgroundColorEditor; });
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);


var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_ref) {
  var defaultContext = _ref.defaultContext,
      defaultPalettesConfig = _ref.defaultPalettesConfig;
  return {
    label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background'),
    option: 'backgroundColor',
    context: 'backgroundColorEditorConfig',
    editor: 'editor.dynamicColor',
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
    },
    editorProps: {
      labelPosition: 'top',
      flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: background'),
      formatters: [{
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
        value: 'rangeValue',
        defaults: {
          majorValue: defaultContext.majorColorConfig,
          trendValue: defaultContext.trendColorConfig
        }
      }, {
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
        value: 'matchValue',
        defaults: {
          majorValue: defaultContext.majorColorMatchConfig
        }
      }],
      dataSelectors: [{
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major Value'),
        value: 'majorValue'
      }, {
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend'),
        value: 'trendValue'
      }],
      defaultPalettesConfig: defaultPalettesConfig
    }
  };
};

/***/ }),
/* 29 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);

var StaticMajorAndTrendLayout = [[{
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Unit position'),
  // todo: we need a new editor combining unit and position
  option: 'unitPosition',
  editor: 'editor.select',
  editorProps: {
    values: [{
      label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Before'),
      value: 'before'
    }, {
      label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('After'),
      value: 'after'
    }]
  },
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return options.showValue || options.showValue === undefined;
  }
}, {
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Unit label'),
  option: 'unit',
  editor: 'editor.text',
  showEditor: function showEditor(_ref2) {
    var options = _ref2.options;
    return options.showValue || options.showValue === undefined;
  }
}], [{
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Precision'),
  option: 'numberPrecision',
  editor: 'editor.number',
  editorProps: {
    min: 0,
    max: 20
  },
  showEditor: function showEditor(_ref3) {
    var options = _ref3.options;
    return options.showValue || options.showValue === undefined;
  }
}]];
/* harmony default export */ __webpack_exports__["default"] = (StaticMajorAndTrendLayout);

/***/ }),
/* 30 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);


var StaticMajorColorEditor = {
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
  option: 'majorColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
  }
};
/* harmony default export */ __webpack_exports__["default"] = (StaticMajorColorEditor);

/***/ }),
/* 31 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);


var StaticTrendColorEditor = {
  label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
  option: 'trendColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
  },
  isDisabled: function isDisabled(_ref2) {
    var options = _ref2.options;
    return options.trendDisplay === 'off';
  }
};
/* harmony default export */ __webpack_exports__["default"] = (StaticTrendColorEditor);

/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TrellisBackgroundColorEditor = exports.TrellisEditorConfig = void 0;

var React = __webpack_require__(33);

var i18n_1 = __webpack_require__(0);

var FeatureFlagContext_1 = __webpack_require__(34);

var layoutUtils_1 = __webpack_require__(22);
/* eslint-disable react-hooks/rules-of-hooks */


exports.TrellisEditorConfig = [[{
  label: (0, i18n_1._)('Trellis layout'),
  option: 'splitByLayout',
  editor: 'editor.toggle',
  showEditor: function showEditor() {
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn;
  }
}], [{
  label: (0, i18n_1._)('Split by'),
  option: 'trellisSplitBy',
  editor: 'editor.trellisSplitBy',
  editorProps: {
    dataSourceKey: 'primary'
  },
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
  }
}], [{
  label: (0, i18n_1._)('Number of columns'),
  option: 'trellisColumns',
  editor: 'editor.number',
  editorProps: {
    min: 1
  },
  placeholder: (0, i18n_1._)('Auto'),
  showEditor: function showEditor(_ref2) {
    var options = _ref2.options;
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
  }
}], [{
  label: (0, i18n_1._)('Min column width'),
  option: 'trellisMinColumnWidth',
  editor: 'editor.number',
  editorProps: {
    min: 1
  },
  showEditor: function showEditor(_ref3) {
    var options = _ref3.options;
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
  }
}, {
  label: (0, i18n_1._)('Row height'),
  option: 'trellisRowHeight',
  editor: 'editor.number',
  editorProps: {
    min: 1
  },
  showEditor: function showEditor(_ref4) {
    var options = _ref4.options;
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
  }
}], [{
  label: (0, i18n_1._)('Max number of components per page'),
  option: 'trellisPageCount',
  editor: 'editor.number',
  editorProps: {
    min: 1
  },
  showEditor: function showEditor(_ref5) {
    var options = _ref5.options;
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
  }
}]];
exports.TrellisBackgroundColorEditor = {
  label: (0, i18n_1._)('Trellis background'),
  option: 'trellisBackgroundColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref6) {
    var options = _ref6.options;
    var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
    var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
    return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
  }
};

/***/ }),
/* 33 */
/***/ (function(module, exports) {

module.exports = require("react");

/***/ }),
/* 34 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-context/FeatureFlagContext");

/***/ }),
/* 35 */,
/* 36 */,
/* 37 */,
/* 38 */,
/* 39 */,
/* 40 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.defaultContext = void 0;
exports.defaultContext = {
  trendColorConfig: [{
    to: 0,
    value: '#9E2520'
  }, {
    from: 0,
    value: '#1C6B2D'
  }],
  majorColorConfig: [{
    to: 20,
    value: '#D41F1F'
  }, {
    from: 20,
    to: 40,
    value: '#D94E17'
  }, {
    from: 40,
    to: 60,
    value: '#CBA700'
  }, {
    from: 60,
    to: 80,
    value: '#669922'
  }, {
    from: 80,
    value: '#118832'
  }],
  majorColorMatchConfig: [{
    match: '',
    value: '#5C33FF'
  }]
};

/***/ }),
/* 41 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);


var getDynamicMajorColorEditor = function getDynamicMajorColorEditor(_ref) {
  var defaultContext = _ref.defaultContext,
      defaultPalettesConfig = _ref.defaultPalettesConfig;
  return {
    label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
    option: 'majorColor',
    context: 'majorColorEditorConfig',
    editor: 'editor.dynamicColor',
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
    },
    editorProps: {
      labelPosition: 'top',
      flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
      formatters: [{
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
        value: 'rangeValue',
        defaults: {
          majorValue: defaultContext.majorColorConfig
        }
      }, {
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
        value: 'matchValue',
        defaults: {
          majorValue: defaultContext.majorColorMatchConfig
        }
      }],
      dataSelectors: [{
        label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
        value: 'majorValue'
      }],
      defaultPalettesConfig: defaultPalettesConfig
    }
  };
};

/***/ }),
/* 42 */,
/* 43 */,
/* 44 */,
/* 45 */,
/* 46 */,
/* 47 */,
/* 48 */,
/* 49 */,
/* 50 */,
/* 51 */,
/* 52 */,
/* 53 */,
/* 54 */,
/* 55 */,
/* 56 */,
/* 57 */,
/* 58 */,
/* 59 */,
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
/* 64 */,
/* 65 */,
/* 66 */,
/* 67 */,
/* 68 */,
/* 69 */,
/* 70 */,
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
/* 75 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _toConsumableArray = __webpack_require__(1);

Object.defineProperty(exports, "__esModule", {
  value: true
});

var i18n_1 = __webpack_require__(0);

var schemaUtils_1 = __webpack_require__(3);

var PresetPalettes_1 = __webpack_require__(15);

var variables_1 = __webpack_require__(76);

var pick_1 = __webpack_require__(9);

var variables_2 = __webpack_require__(10);

var visualization_icons_1 = __webpack_require__(12);

var placeholders_1 = __webpack_require__(11);

var singleValueContext_1 = __webpack_require__(40);

var VizBehavior_1 = __webpack_require__(2);

var DynamicMajorColorEditor_1 = __webpack_require__(41);

var DynamicTrendColorEditor_1 = __webpack_require__(27);

var DynamicBackgroundColorEditor_1 = __webpack_require__(28);

var StaticMajorAndTrendLayout_1 = __webpack_require__(29);

var StaticMajorColorEditor_1 = __webpack_require__(30);

var StaticTrendColorEditor_1 = __webpack_require__(31);

var StaticBackgroundColorEditor_1 = __webpack_require__(25);

var configUtils_1 = __webpack_require__(4);

var TrellisEditors_1 = __webpack_require__(32);

var VizCategory_1 = __webpack_require__(8);

var layoutUtils_1 = __webpack_require__(22);

var dataContract = {
  requiredDataSources: [{
    name: 'primary',
    description: 'DataSource that powers the visualization'
  }],
  optionalDataSources: [],
  initialRequestParams: {
    primary: {
      offset: 0,
      count: 10000
    }
  }
};
var size = {
  initialWidth: 250,
  initialHeight: 250
};
var optionsSchema = {
  align: {
    default: 'center',
    description: 'Specify how to align the center content.',
    pattern: (0, schemaUtils_1.getPattern)(['left', 'center', 'right']),
    type: 'string'
  },
  backgroundColor: {
    default: '> themes.defaultBackgroundColor',
    description: 'Specify the color for the background. You may use a dataSource to apply the color. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  majorColor: {
    default: '> themes.defaultFontColor',
    description: 'Specify the color for the major value.  You may use a dataSource to apply the color. The hex value format should be “#FFFFFF”. The default for enterprise light is "#000000". The default for enterprise dark is "#ffffff". The default for prisma dark is "rgba(255, 255, 255, 0.98)".',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  majorFontSize: {
    description: 'Specify the font size (px) for the major value. By default the major value font size is calculated dynamically based on the available space.',
    type: 'number'
  },
  majorValue: {
    default: '> sparklineValues|lastPoint()',
    description: 'The major value to display in the visualization.',
    type: ['string', 'number']
  },
  majorValueField: {
    default: '> majorValue | getField()',
    description: 'The field name of major value.',
    type: 'string'
  },
  numberPrecision: {
    default: 0,
    maximum: 20,
    minimum: 0,
    description: 'Specify the number of decimal places to display. For example, to display 3 decimal places, use a value of 3. Values can range from 0 to 20.',
    type: 'number'
  },
  shouldAbbreviateTrendValue: {
    default: false,
    description: 'Specify whether to abbreviate the trend value to 2 decimal points. A magnitude unit will be displayed.',
    type: 'boolean'
  },
  shouldSparklineAcceptNullData: {
    default: true,
    description: 'Specify whether to convert null and non-numeric values in the sparkline to 0.',
    type: 'boolean'
  },
  shouldUseThousandSeparators: {
    default: true,
    description: 'Specify whether numeric values use commas as thousandths separators.',
    type: 'boolean'
  },
  showSparklineAreaGraph: {
    default: false,
    description: 'Specify whether to show the sparkline as an area graph rather than a line.',
    type: 'boolean'
  },
  showSparklineTooltip: {
    default: false,
    description: 'Show a tooltip to display values on the sparkline.',
    type: 'boolean'
  },
  splitByLayout: {
    default: 'off',
    description: 'Specify the layout method by which to display the visualization, which splits the data into individual visualizations based on a certain category.',
    type: 'string',
    pattern: (0, schemaUtils_1.getPattern)([layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]),
    enum: [layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]
  },
  sparklineAreaColor: {
    default: '> sparklineStrokeColor',
    description: 'Specify the color for the sparkline area fill. You may use a dataSource to apply the color. The hex value format should be “#FFFFFF”. The graph area will have an opacity of 20% and will blend with the background color.',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  sparklineDisplay: {
    default: 'below',
    description: 'Specify how to display a sparkline.',
    pattern: (0, schemaUtils_1.getPattern)(['before', 'after', 'below', 'off']),
    type: 'string'
  },
  sparklineHighlightDots: {
    default: 0,
    description: 'Specify the number of markers, or dots, to display at the top of a sparkline area graph.',
    type: 'number'
  },
  sparklineHighlightSegments: {
    default: 0,
    description: 'Specify the number of segments to be highlighted at the top of a sparkline area graph.',
    type: 'number'
  },
  sparklineStrokeColor: {
    default: '> themes.defaultSparklineStrokeColor',
    description: 'Specify the color for the sparkline stroke. You may use a dataSource to apply the color. The hex value format should be “#FFFFFF”. The default for enterprise light is "#000000". The default for enterprise dark is "#ffffff". The default for prisma dark is "rgba(255, 255, 255, 0.98)".',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  sparklineValues: {
    default: '> primary|seriesByPrioritizedTypes("number", "string", "time")',
    description: 'List of numerical values to display on a sparkline. If the values are string type, the sparkline will not be shown.',
    type: 'array',
    items: {
      type: ['string', 'number']
    }
  },
  trendColor: {
    default: '> themes.defaultFontColor',
    description: 'Specify the color for the trend value. You may use a dataSource to apply the color. The hex value format should be “#FFFFFF”. The default for enterprise light is "#000000". The default for enterprise dark is "#ffffff". The default for prisma dark is "rgba(255, 255, 255, 0.98)".',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  trendDisplay: {
    default: 'absolute',
    description: 'Specify how to display the trend value.',
    pattern: (0, schemaUtils_1.getPattern)(['percent', 'absolute', 'off']),
    type: 'string'
  },
  trendFontSize: {
    description: 'Specify the font size (px) for the trend value. By default the trend value font size is calculated dynamically based on the available space.',
    type: 'number'
  },
  trendValue: {
    default: '> sparklineValues|delta(-2)',
    description: 'The trend value to display in the visualization.',
    type: 'number'
  },
  trellisBackgroundColor: {
    default: '> themes.defaultBackgroundColor',
    description: 'Specify the color used for the trellis container background by using a hexadecimal code. For example, #0000FF.',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  trellisColumns: {
    description: 'Specify the number of visualizations to display in a given row of the trellis container. The remaining visualizations will wrap accordingly. If nothing is specified, it will be auto-set based on the trellisMinColumnWidth. The minimum value is 1.',
    type: 'number',
    minimum: 1
  },
  trellisMinColumnWidth: {
    default: 100,
    minimum: 1,
    description: 'Specify the minimum width, in pixels, of each visualization in the trellis container. If the window or panel is resized, the remaining visualizations may be viewed by scrolling. The minimum value is 1.',
    type: 'number'
  },
  trellisPageCount: {
    default: 20,
    minimum: 1,
    description: 'Specify the maximum number of visualizations to display in a single page in the trellis container. The remaining visualizations will paginate accordingly. The minimum value is 1.',
    type: 'number'
  },
  trellisRowHeight: {
    default: 70,
    minimum: 1,
    description: 'Specify the height, in pixels, of each visualization in the trellis container. If the window or panel is resized, the remaining visualizations may be viewed by scrolling. The minimum value is 1.',
    type: 'number'
  },
  trellisSplitBy: {
    description: 'Specify the field name of the column with categories used, or “aggregations”, to split the data into individual visualizations for trellis display, if applicable. If a SPL `timechart` command is used, this may default to the SPL `by` clause field. If a SPL `chart` command is used, this may default to the first string field.',
    type: 'string'
  },
  underLabel: {
    description: 'Specify the text that appears below the major value.',
    type: 'string'
  },
  underLabelFontSize: {
    default: 12,
    description: 'Specify the font size (px) for the under label text.',
    type: 'number'
  },
  unit: {
    description: 'Specify text to show next to the major value.',
    type: 'string'
  },
  unitPosition: {
    default: 'after',
    description: 'Specify whether the unit text should appear before or after the major value.',
    pattern: (0, schemaUtils_1.getPattern)(['before', 'after']),
    type: 'string'
  }
};
var basePresetContext = {
  majorColorEditorConfig: undefined,
  trendColorEditorConfig: undefined,
  backgroundColorEditorConfig: undefined
};
var basePresetOptions = {
  majorColor: undefined,
  trendColor: undefined,
  backgroundColor: undefined
};
var presets = [{
  // dummy context variables to allow for resetting of unused context states
  label: (0, i18n_1._)('None'),
  name: 'singleValue.none',
  value: {
    context: Object.assign({}, basePresetContext),
    options: Object.assign({}, basePresetOptions)
  }
}, {
  label: (0, i18n_1._)('Major value'),
  name: 'singleValue.majorValue',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
    })
  }
}, {
  label: (0, i18n_1._)('Trend value'),
  name: 'singleValue.trend',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
    })
  }
}, {
  label: (0, i18n_1._)('Major value and Trend value'),
  name: 'singleValue.majorValueAndTrend',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig,
      trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      majorColor: '> majorValue | rangeValue(majorColorEditorConfig)',
      trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
    })
  }
}, {
  label: (0, i18n_1._)('Background'),
  name: 'singleValue.background',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      backgroundColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
    })
  }
}]; // @TODO(pwied):
// remove once react-visualizations/SV was deprecated
// including unused sparklineFillColor

var LIGHTMODE_SPARKLINE_AREA_COLOR = '#171D21';
var DARKMODE_SPARKLINE_AREA_COLOR = '#FFFFFF';
var themes = {
  defaultFontColor: function defaultFontColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_2.default.textColor(props),
        light: variables_2.default.gray20(props)
      },
      prisma: variables_2.default.contentColorActive(props)
    })(props);
  },
  defaultBlockFontColor: function defaultBlockFontColor(props) {
    return (0, pick_1.default)({
      enterprise: variables_2.default.white(props),
      prisma: variables_2.default.contentColorActive(props)
    })(props);
  },
  defaultBackgroundColor: function defaultBackgroundColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_2.default.black(props),
        light: variables_2.default.backgroundColor(props)
      },
      prisma: variables_2.default.backgroundColorSidebar(props)
    })(props);
  },
  defaultSparklineStrokeColor: function defaultSparklineStrokeColor(props) {
    return (0, pick_1.default)({
      enterprise: variables_2.default.textColor(props),
      prisma: variables_2.default.contentColorActive(props)
    })(props);
  },
  // TODO(fkurniawan): update with SCP-36839
  sparklineSeverityColors: function sparklineSeverityColors(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: JSON.stringify({
          none: {
            background: variables_1.enterpriseDark.gray60,
            stroke: variables_1.enterpriseDark.white
          },
          low: {
            background: variables_1.enterpriseDark.successColorD50,
            stroke: variables_1.enterpriseDark.white
          },
          guarded: {
            background: variables_1.enterpriseDark.infoColorD50,
            stroke: variables_1.enterpriseDark.white
          },
          elevated: {
            background: variables_1.enterpriseDark.warningColorD50,
            stroke: variables_1.enterpriseDark.white
          },
          high: {
            background: variables_1.enterpriseDark.alertColorD50,
            stroke: variables_1.enterpriseDark.white
          },
          severe: {
            background: variables_1.enterpriseDark.errorColorD50,
            stroke: variables_1.enterpriseDark.white
          }
        }),
        light: JSON.stringify({
          none: {
            background: variables_1.enterprise.gray60,
            stroke: variables_1.enterprise.gray20
          },
          low: {
            background: variables_1.enterprise.successColorD50,
            stroke: variables_1.enterprise.white
          },
          guarded: {
            background: variables_1.enterprise.infoColorD50,
            stroke: variables_1.enterprise.white
          },
          elevated: {
            background: variables_1.enterprise.warningColorD50,
            stroke: variables_1.enterprise.white
          },
          high: {
            background: variables_1.enterprise.alertColorD50,
            stroke: variables_1.enterprise.white
          },
          severe: {
            background: variables_1.enterprise.errorColorD50,
            stroke: variables_1.enterprise.white
          }
        })
      },
      prisma: JSON.stringify({
        none: {
          background: variables_1.scp.gray52,
          stroke: variables_1.scp.white
        },
        low: {
          background: variables_1.scp.successColorD50,
          stroke: variables_1.scp.white
        },
        guarded: {
          background: variables_1.scp.infoColorD50,
          stroke: variables_1.scp.white
        },
        elevated: {
          background: variables_1.scp.warningColorD50,
          stroke: variables_1.scp.white
        },
        high: {
          background: variables_1.scp.alertColorD50,
          stroke: variables_1.scp.white
        },
        severe: {
          background: variables_1.scp.errorColorD50,
          stroke: variables_1.scp.white
        }
      })
    })(props);
  },
  // TODO(fkurniawan): update with SCP-36839
  sparklineFillColor: function sparklineFillColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        light: LIGHTMODE_SPARKLINE_AREA_COLOR,
        dark: DARKMODE_SPARKLINE_AREA_COLOR
      },
      prisma: DARKMODE_SPARKLINE_AREA_COLOR
    })(props);
  }
};
var editorConfig = [{
  label: (0, i18n_1._)('Data configurations'),
  layout: [[{
    label: (0, i18n_1._)('Value'),
    editor: 'editor.columnSelector',
    option: 'sparklineValues',
    context: 'sparklineValuesContext',
    editorProps: {
      dataSourceKey: 'primary',
      prepareValue: function prepareValue(definition) {
        var sparklineValues = definition.options.sparklineValues;
        return {
          context: {},
          options: {
            majorValue: "> sparklineValues | lastPoint()",
            trendValue: "> sparklineValues | delta(-2)",
            sparklineValues: sparklineValues
          }
        };
      }
    },
    isDisabled: function isDisabled(_ref) {
      var options = _ref.options;
      return options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
    }
  }]]
}, {
  label: (0, i18n_1._)('Data display'),
  layout: [].concat(_toConsumableArray(StaticMajorAndTrendLayout_1.default), [[{
    label: (0, i18n_1._)('Trend display'),
    option: 'trendDisplay',
    editor: 'editor.select',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Percent'),
        value: 'percent'
      }, {
        label: (0, i18n_1._)('Absolute'),
        value: 'absolute'
      }, {
        label: (0, i18n_1._)('Off'),
        value: 'off'
      }]
    },
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return options.showValue || options.showValue === undefined;
    }
  }, {
    label: (0, i18n_1._)('Sparkline display'),
    option: 'sparklineDisplay',
    editor: 'editor.select',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Off'),
        value: 'off'
      }, {
        label: (0, i18n_1._)('Before'),
        value: 'before'
      }, {
        label: (0, i18n_1._)('Below'),
        value: 'below'
      }, {
        label: (0, i18n_1._)('After'),
        value: 'after'
      }]
    }
  }]], _toConsumableArray(TrellisEditors_1.TrellisEditorConfig))
}, {
  label: (0, i18n_1._)('Color and style'),
  layout: [[{
    label: (0, i18n_1._)('Dynamic elements'),
    key: 'presetSelector',
    editor: 'editor.presetSelector',
    editorProps: {
      presets: presets,
      value: function value(_ref3) {
        var context = _ref3.context,
            options = _ref3.options;
        var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
        return initialPreset && initialPreset.label || null;
      }
    }
  }], [Object.assign(Object.assign({}, StaticMajorColorEditor_1.default), {
    editorProps: {
      themes: themes
    }
  })], [(0, DynamicMajorColorEditor_1.getDynamicMajorColorEditor)({
    defaultContext: singleValueContext_1.defaultContext,
    defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
  })], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
    editorProps: {
      themes: themes
    }
  })], [(0, DynamicTrendColorEditor_1.getDynamicTrendColorEditor)({
    defaultContext: singleValueContext_1.defaultContext,
    defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
  })], [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
    editorProps: {
      themes: themes
    }
  })], [Object.assign(Object.assign({}, TrellisEditors_1.TrellisBackgroundColorEditor), {
    editorProps: {
      themes: themes
    }
  })], [(0, DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor)({
    defaultContext: singleValueContext_1.defaultContext,
    defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
  })], [{
    label: (0, i18n_1._)('Major value size (px)'),
    option: 'majorFontSize',
    editor: 'editor.number',
    editorProps: {
      min: 1
    },
    placeholder: (0, i18n_1._)('Auto'),
    showEditor: function showEditor(_ref4) {
      var options = _ref4.options;
      return options.showValue || options.showValue === undefined;
    }
  }, {
    label: (0, i18n_1._)('Trend value size (px)'),
    option: 'trendFontSize',
    editor: 'editor.number',
    editorProps: {
      min: 1
    },
    placeholder: (0, i18n_1._)('Auto'),
    showEditor: function showEditor(_ref5) {
      var options = _ref5.options;
      return options.showValue || options.showValue === undefined;
    },
    isDisabled: function isDisabled(_ref6) {
      var options = _ref6.options;
      return options.trendDisplay === 'off';
    }
  }], [{
    label: (0, i18n_1._)('Alignment'),
    editor: 'editor.radioBar',
    option: 'align',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Left'),
        value: 'left'
      }, {
        label: (0, i18n_1._)('Center'),
        value: 'center'
      }, {
        label: (0, i18n_1._)('Right'),
        value: 'right'
      }]
    },
    showEditor: function showEditor(_ref7) {
      var options = _ref7.options;
      return options.showValue || options.showValue === undefined;
    }
  }]]
}];
/**
 * visualization configuration
 */

var config = {
  /**
   * unique viz key
   */
  key: 'splunk.singlevalue',

  /**
   * viz name
   */
  name: (0, i18n_1._)('Single value'),
  category: VizCategory_1.VizCategory.SINGLE_VALUE,

  /**
   * viz icon
   */
  icon: visualization_icons_1.SingleValue,
  placeholderIcon: placeholders_1.SingleValue,
  dataContract: dataContract,
  size: size,
  defaultContext: singleValueContext_1.defaultContext,
  optionsSchema: optionsSchema,
  editorConfig: editorConfig,
  events: {
    'value.click': {
      description: 'trigger when user clicks major value',
      payloadKeys: ['majorValue', 'trendValue']
    }
  },
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER, VizBehavior_1.VizBehavior.TRELLIS],
  themes: themes,
  requiredProps: ['majorValue']
};
exports.default = (0, configUtils_1.enhanceConfig)(config);

/***/ }),
/* 76 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-themes/variables");

/***/ })
/******/ ]);
//# sourceMappingURL=SingleValue.config.js.map