/*!
 * 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 = 50);
/******/ })
/************************************************************************/
/******/ ([
/* 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 */,
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var background = function background(_ref) {
  var label = _ref.label,
      themes = _ref.themes,
      labelPosition = _ref.labelPosition;
  return [{
    label: (0, i18n_1._)(label || 'Background'),
    option: 'backgroundColor',
    editor: 'editor.color',
    editorProps: {
      labelPosition: labelPosition || 'top',
      themes: themes
    }
  }];
};

exports.default = background;

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

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

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

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

/***/ }),
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */,
/* 21 */,
/* 22 */,
/* 23 */,
/* 24 */,
/* 25 */,
/* 26 */,
/* 27 */,
/* 28 */,
/* 29 */,
/* 30 */,
/* 31 */,
/* 32 */,
/* 33 */,
/* 34 */,
/* 35 */,
/* 36 */,
/* 37 */,
/* 38 */,
/* 39 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var gauge = {
  label: (0, i18n_1._)('Data display'),
  layout: [[{
    label: (0, i18n_1._)('Value display'),
    option: 'valueDisplay',
    editor: 'editor.radioBar',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Number'),
        value: 'number'
      }, {
        label: (0, i18n_1._)('Percentage'),
        value: 'percentage'
      }, {
        label: (0, i18n_1._)('Off'),
        value: 'off'
      }]
    }
  }], [{
    label: (0, i18n_1._)('Label display'),
    option: 'labelDisplay',
    editor: 'editor.radioBar',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Numbers'),
        value: 'number'
      }, {
        label: (0, i18n_1._)('Percentages'),
        value: 'percentage'
      }, {
        label: (0, i18n_1._)('Off'),
        value: 'off'
      }]
    }
  }], [{
    label: (0, i18n_1._)('Orientation'),
    option: 'orientation',
    editor: 'editor.radioBar',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Vertical'),
        value: 'vertical'
      }, {
        label: (0, i18n_1._)('Horizontal'),
        value: 'horizontal'
      }]
    }
  }]]
};
exports.default = gauge;

/***/ }),
/* 40 */,
/* 41 */,
/* 42 */,
/* 43 */,
/* 44 */,
/* 45 */,
/* 46 */,
/* 47 */,
/* 48 */,
/* 49 */,
/* 50 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var schemaUtils_1 = __webpack_require__(3);

var pick_1 = __webpack_require__(9);

var variables_1 = __webpack_require__(10);

var visualization_color_palettes_1 = __webpack_require__(14);

var PresetPalettes_1 = __webpack_require__(15);

var GaugeFiller_1 = __webpack_require__(51);

var placeholders_1 = __webpack_require__(11);

var VizBehavior_1 = __webpack_require__(2);

var VizCategory_1 = __webpack_require__(8);

var configUtils_1 = __webpack_require__(4);

var Gauge_1 = __webpack_require__(39);

var BackgroundColor_1 = __webpack_require__(13);

var DynamicGaugeColorEditor_1 = __webpack_require__(52);

var StaticGaugeColorEditor_1 = __webpack_require__(53);

var dataContract = {
  requiredDataSources: [{
    name: 'primary',
    description: 'DataSource that powers the visualization'
  }],
  optionalDataSources: [],
  initialRequestParams: {
    primary: {
      offset: 0,
      count: 10000
    }
  }
};
var size = {
  initialWidth: 300,
  initialHeight: 300
};
var defaultContext = {
  gaugeColorConfig: [{
    to: 9,
    value: '#118832'
  }, {
    from: 10,
    to: 29,
    value: '#669922'
  }, {
    from: 30,
    to: 49,
    value: '#CBA700'
  }, {
    from: 50,
    to: 69,
    value: '#D94E17'
  }, {
    from: 70,
    value: '#D41F1F'
  }]
};
var optionsSchema = {
  backgroundColor: {
    default: '> themes.defaultBackgroundColor',
    description: 'Specify the color used for the background. 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'
  },
  gaugeColor: {
    default: visualization_color_palettes_1.CATEGORICAL[0],
    description: 'Specify the color for the gauge color of the filler gauge. You may use a dataSource to apply the color. The hex value format should be "#FFFFFF".',
    type: 'string'
  },
  labelDisplay: {
    default: 'number',
    description: 'Specify whether to display the labels as numbers, percentages, or off. The label right aligns to the value for horizontal orientation, and top aligns for vertical.',
    pattern: (0, schemaUtils_1.getPattern)(['number', 'percentage', 'off']),
    type: 'string'
  },
  majorTickInterval: {
    description: 'Specify, in pixels, the spacing between major tick marks.',
    default: 'auto',
    type: ['string', 'number']
  },
  orientation: {
    default: 'vertical',
    description: 'Specify the axis orientation of the gauge.',
    pattern: (0, schemaUtils_1.getPattern)(['vertical', 'horizontal']),
    type: 'string'
  },
  value: {
    default: '> primary | seriesByType("number") | lastPoint()',
    description: 'Specify the dataSource applied to the value of the filler gauge.',
    type: 'number'
  },
  valueDisplay: {
    default: 'number',
    description: 'Specify whether to display the value as a number, percentage, or off.',
    pattern: (0, schemaUtils_1.getPattern)(['number', 'percentage', 'off']),
    type: 'string'
  }
};
var themes = {
  defaultBackgroundColor: function defaultBackgroundColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.black(props),
        light: variables_1.default.backgroundColor(props)
      },
      prisma: variables_1.default.backgroundColorSidebar(props)
    })(props);
  },
  defaultBackgroundBarFillColor: function defaultBackgroundBarFillColor(props) {
    return (0, pick_1.default)({
      enterprise: variables_1.default.backgroundColorHover(props),
      prisma: {
        light: variables_1.default.contentColorActive(props),
        dark: variables_1.default.neutral100(props)
      }
    })(props);
  },
  majorTickFillColor: function majorTickFillColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        light: variables_1.default.gray30(props),
        dark: variables_1.default.textGray(props) // was #D7DAE0

      },
      prisma: {
        // TODO: missed colors :(
        light: variables_1.default.neutral100(props),
        dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor

      }
    })(props);
  },
  majorTickStrokeColor: function majorTickStrokeColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        light: variables_1.default.textGray(props),
        dark: variables_1.default.contentColorMuted(props)
      },
      prisma: variables_1.default.contentColorMuted(props)
    })(props);
  },
  valueMarkerFillColor: function valueMarkerFillColor(props) {
    return (0, pick_1.default)({
      enterprise: variables_1.default.textColor(props),
      prisma: {
        dark: variables_1.default.white(props),
        light: variables_1.default.black(props)
      }
    })(props);
  },
  valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        light: variables_1.default.gray96(props),
        dark: variables_1.default.black(props)
      },
      prisma: variables_1.default.black(props)
    })(props);
  }
};
var basePresetContext = {
  gaugeColorEditorConfig: undefined
};
var basePresetOptions = {
  gaugeColor: visualization_color_palettes_1.CATEGORICAL[0]
};
var presets = [{
  // dummy context variables to allow for resetting of unused context states
  label: (0, i18n_1._)('None'),
  name: 'fillerGauge.none',
  value: {
    context: Object.assign({}, basePresetContext),
    options: Object.assign({}, basePresetOptions)
  }
}, {
  label: (0, i18n_1._)('Gauge'),
  name: 'fillerGauge.gauge',
  value: {
    context: {
      gaugeColorEditorConfig: defaultContext.gaugeColorConfig
    },
    options: {
      gaugeColor: '> value | rangeValue(gaugeColorEditorConfig)'
    }
  }
}];
var editorConfig = [{
  label: (0, i18n_1._)('Data configurations'),
  layout: [[{
    label: (0, i18n_1._)('Value'),
    editor: 'editor.columnSelector',
    option: 'value',
    context: 'defaultContext',
    editorProps: {
      dataSourceKey: 'primary',
      prepareValue: function prepareValue(definition) {
        var value = definition.options.value;
        return {
          context: {},
          options: {
            value: "".concat(value, " | lastPoint()")
          }
        };
      }
    }
  }]]
}, Gauge_1.default, {
  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(_ref) {
        var context = _ref.context,
            options = _ref.options;
        var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
        return initialPreset && initialPreset.label || null;
      }
    }
  }], [(0, DynamicGaugeColorEditor_1.getDynamicGaugeColorEditor)({
    defaultContext: defaultContext,
    defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
  })], [Object.assign(Object.assign({}, StaticGaugeColorEditor_1.default), {
    editorProps: {
      themes: themes
    }
  })], (0, BackgroundColor_1.default)({
    themes: themes
  })]
}];
/**
 * visualization configuration
 */

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

  /**
   * viz name
   */
  name: (0, i18n_1._)('Filler gauge'),
  category: VizCategory_1.VizCategory.GAUGE,

  /**
   * viz icon
   */
  icon: GaugeFiller_1.default,
  placeholderIcon: placeholders_1.FillerGauge,
  dataContract: dataContract,
  size: size,
  defaultContext: defaultContext,
  optionsSchema: optionsSchema,
  editorConfig: editorConfig,
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
  themes: themes
};
exports.default = (0, configUtils_1.enhanceConfig)(config);

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

module.exports = require("@splunk/react-icons/enterprise/GaugeFiller");

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

"use strict";


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

var i18n_1 = __webpack_require__(0);

var configUtils_1 = __webpack_require__(5);

var getDynamicGaugeColorEditor = function getDynamicGaugeColorEditor(_ref) {
  var defaultContext = _ref.defaultContext,
      defaultPalettesConfig = _ref.defaultPalettesConfig;
  return {
    label: (0, i18n_1._)('Gauge'),
    option: 'gaugeColor',
    context: 'gaugeColorConfig',
    editor: 'editor.dynamicColor',
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return (0, configUtils_1.isDynamicOption)(options.gaugeColor);
    },
    editorProps: {
      labelPosition: 'top',
      flyoutTitle: (0, i18n_1._)('Dynamic coloring: gauge'),
      formatters: [{
        label: (0, i18n_1._)('Ranges'),
        value: 'rangeValue',
        defaults: {
          value: defaultContext.gaugeColorConfig
        }
      }],
      dataSelectors: [{
        label: (0, i18n_1._)('Value'),
        value: 'value'
      }],
      defaultPalettesConfig: defaultPalettesConfig
    }
  };
};

exports.getDynamicGaugeColorEditor = getDynamicGaugeColorEditor;

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

"use strict";


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

var i18n_1 = __webpack_require__(0);

var configUtils_1 = __webpack_require__(5);

var StaticGaugeColorEditor = {
  label: (0, i18n_1._)('Gauge'),
  option: 'gaugeColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return !(0, configUtils_1.isDynamicOption)(options.gaugeColor);
  }
};
exports.default = StaticGaugeColorEditor;

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