diff --git a/apps/splunk_instrumentation/README/alert_actions.conf.spec b/apps/splunk_instrumentation/README/alert_actions.conf.spec new file mode 100755 index 00000000..f129cf8c --- /dev/null +++ b/apps/splunk_instrumentation/README/alert_actions.conf.spec @@ -0,0 +1,22 @@ +[outputtelemetry] + +param.support = +* Whether data is part of support usage + +param.anonymous = +* Whether data is part of anonymous usage + +param.license = +* Whether data is part of license usage + +param.optinrequired = +* Opt-in level required + +param.component = +* Component name + +param.input = +* input name that has the JSON payload + +param.type = [aggregate|event] +* Data type diff --git a/apps/splunk_instrumentation/README/savedsearches.conf.spec b/apps/splunk_instrumentation/README/savedsearches.conf.spec new file mode 100755 index 00000000..05968fd6 --- /dev/null +++ b/apps/splunk_instrumentation/README/savedsearches.conf.spec @@ -0,0 +1,28 @@ +# Output to Telemetry alert settings + +action.outputtelemetry = [0|1] +* Enable output to telemetry action + +action.outputtelemetry.param.support = +* Whether data is part of support usage +* (optional) + +action.outputtelemetry.param.anonymous = +* Whether data is part of anonymous usage +* (optional) + +action.outputtelemetry.param.license = +* Whether data is part of license usage +* (optional) + +action.outputtelemetry.param.optinrequired = +* Opt-in level required +* (required) + +action.outputtelemetry.param.component = +* Component name +* (required) + +action.outputtelemetry.param.type = [aggregate|event] +* Data type +* (optional) diff --git a/apps/splunk_instrumentation/README/telemetry.conf.example b/apps/splunk_instrumentation/README/telemetry.conf.example new file mode 100755 index 00000000..df1ae7ee --- /dev/null +++ b/apps/splunk_instrumentation/README/telemetry.conf.example @@ -0,0 +1,24 @@ +# This file contains possible attributes and values for configuring global +# telemetry settings. Please note that enabling these settings would enable +# apps to collect telemetry data about app usage and other properties. +# +# There is no global, default telemetry.conf. Instead, a telemetry.conf may +# exist in each app in Splunk Enterprise. +# +# To learn more about configuration files (including precedence) please see +# the documentation located at +# http://docs.splunk.com/Documentation/Splunk/latest/Admin/Aboutconfigurationfiles + +[general] +sendLicenseUsage = false +sendAnonymizedUsage = false +sendAnonymizedWebAnalytics = false +precheckSendAnonymizedUsage = false +precheckSendLicenseUsage = true +showOptInModal = true +deprecatedConfig = false +scheduledHour = 16 +reportStartDate = 2017-10-27 +scheduledDay = 4 +bufferFlushTimeout = 600 +onCloudInstance = false diff --git a/apps/splunk_instrumentation/README/telemetry.conf.spec b/apps/splunk_instrumentation/README/telemetry.conf.spec new file mode 100755 index 00000000..164693e8 --- /dev/null +++ b/apps/splunk_instrumentation/README/telemetry.conf.spec @@ -0,0 +1,128 @@ +# This file contains possible attributes and values for configuring global +# telemetry settings. Please note that enabling these settings would enable +# apps to collect telemetry data about app usage and other properties. +# +# There is no global, default telemetry.conf. Instead, a telemetry.conf may +# exist in each app in Splunk Enterprise. +# +# To learn more about configuration files (including precedence) please see +# the documentation located at +# http://docs.splunk.com/Documentation/Splunk/latest/Admin/Aboutconfigurationfiles + +# GLOBAL SETTINGS +# Use the [default] stanza to define any global settings. +# * You can also define global settings outside of any stanza, at the top +# of the file. +# * Each conf file should have at most one default stanza. If there are +# multiple default stanzas, attributes are combined. In the case of +# multiple definitions of the same attribute, the last definition in the +# file wins. +# * If an attribute is defined at both the global level and in a specific +# stanza, the value in the specific stanza takes precedence. + +[general] +optInVersion = +* An integer that identifies the set of telemetry data to be collected +* Incremented upon installation if the data set collected by Splunk has changed +* This field was introduced for version 2 of the telemetry data set. So, + when this field is missing, version 1 is assumed. +* Should not be changed manually + +optInVersionAcknowledged = +* The latest optInVersion acknowledged by a user on this deployment +* While this value is less than the current optInVersion, a prompt for + data collection opt-in will be shown to users with the + edit_telemetry_settings capability at login +* Once a user confirms interaction with this login - regardless of + opt-in choice - this number will be set to the value of optInVersion +* This gets set regardless of whether the user opts in using the opt-in + dialog or the Settings > Instrumentation page +* If manually decreased or deleted, then a user that previously acknowledged + the opt-in dialog will not be shown the dialog the next time they log in + unless the related settings (dismissedInstrumentationOptInVersion and + hideInstrumentationOptInModal) in their user-prefs.conf are also changed. +* Unset by default + +sendLicenseUsage = true|false +* Send the licensing usage information of splunk/app to the app owner +* Defaults to true + +sendAnonymizedUsage = true|false +* Send the anonymized usage information about various categories like + infrastructure, utilization etc of splunk/app to Splunk, Inc +* Defaults to true + +sendSupportUsage = true|false +* Send the support usage information about various categories like + infrastructure, utilization etc of splunk/app to Splunk, Inc +* Defaults to false + +sendAnonymizedWebAnalytics = true|false +* Send the anonymized usage information about user interaction with + splunk performed through the web UI +* Defaults to true + +precheckSendLicenseUsage = true|false +* Default value for sending license usage in opt in modal +* Defaults to true + +precheckSendAnonymizedUsage = true|false +* Default value for sending anonymized usage in opt in modal +* Defaults to true + +precheckSendSupportUsage = true|false +* Default value for sending support usage in opt in modal +* Defaults to true + +showOptInModal = true|false +* DEPRECATED - see optInVersion and optInVersionAcknowledged settings +* Shows the opt in modal. DO NOT SET! When a user opts in, it will + automatically be set to false to not show the modal again. +* Defaults to true + +deploymentID = +* A uuid used to correlate telemetry data for a single splunk + deployment over time. The value is generated the first time + a user opts in to sharing telemetry data. + +deprecatedConfig = true|false +* Setting to determine whether the splunk deployment is following + best practices for the platform as well as the app +* Defaults to false + +retryTransaction = +* Setting that is created if the telemetry conf updates cannot be delivered to + the cluster master for the splunk_instrumentation app. +* Defaults to an empty string + +swaEndpoint = +* The URL to which swajs will forward UI analytics events +* If blank, swajs sends events to the Splunk MINT CDS endpoint. +* Blank by default + +telemetrySalt = +* A salt used to hash certain fields before transmission +* Autogenerated as a random UUID when splunk starts + +scheduledHour = +* Time of day, on a 24 hour clock, that the scripted input responsible for collecting telemetry data starts. +* The script begins at the top of the hour and completes, including running searches on the primary instance in your deployment, after a few minutes. +* Defaults to 3 + +scheduledDay = +* Number representing the weekday on which telemetry data collection is executed +* 0 represents Monday +* Defaults to every day (*) + +reportStartDate = +* Start date for the next telemetry data collection +* Uses format YYYY-MM-DD +* Defaults to empty string + +bufferFlushTimeout = +* Timeout for buffer flush, number in seconds +* Defaults to 600s + +onCloudInstance = true|false +* Whether the instance is on cloud or on prem +* Defaults to false diff --git a/apps/splunk_instrumentation/appserver/controllers/swa_injector.py b/apps/splunk_instrumentation/appserver/controllers/swa_injector.py new file mode 100755 index 00000000..ee14496e --- /dev/null +++ b/apps/splunk_instrumentation/appserver/controllers/swa_injector.py @@ -0,0 +1,17 @@ +import logging +import traceback +import cherrypy +from splunk_instrumentation.swa_injection_tool import SwaInitScriptRenderer +from splunk.appserver.mrsparkle.lib.htmlinjectiontoolfactory import HtmlInjectionToolFactory + +logger = logging.getLogger(__name__) + +try: + + swaInitScriptRenderer = SwaInitScriptRenderer(cherrypy) + HtmlInjectionToolFactory.singleton().register_head_injection_hook(swaInitScriptRenderer) + +except Exception: + + logger.error('ERROR while loading swa_injector.py: ' + traceback.format_exc()) + raise diff --git a/apps/splunk_instrumentation/appserver/static/build/pages/inst.js b/apps/splunk_instrumentation/appserver/static/build/pages/inst.js new file mode 100755 index 00000000..71eca947 --- /dev/null +++ b/apps/splunk_instrumentation/appserver/static/build/pages/inst.js @@ -0,0 +1,155627 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 17795: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $s: () => (/* binding */ AnimatedObject), +/* harmony export */ Ao: () => (/* binding */ getAnimated), +/* harmony export */ De: () => (/* binding */ createHost), +/* harmony export */ SJ: () => (/* binding */ getAnimatedType), +/* harmony export */ nm: () => (/* binding */ getPayload), +/* harmony export */ pS: () => (/* binding */ AnimatedString), +/* harmony export */ rf: () => (/* binding */ AnimatedValue), +/* harmony export */ uX: () => (/* binding */ setAnimated) +/* harmony export */ }); +/* unused harmony exports Animated, AnimatedArray, isAnimated */ +/* harmony import */ var _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16544); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96540); + + + + +const $node = Symbol.for('Animated:node'); +const isAnimated = value => !!value && value[$node] === value; +const getAnimated = owner => owner && owner[$node]; +const setAnimated = (owner, node) => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .defineHidden */ .OX)(owner, $node, node); +const getPayload = owner => owner && owner[$node] && owner[$node].getPayload(); +class Animated { + constructor() { + this.payload = void 0; + setAnimated(this, this); + } + + getPayload() { + return this.payload || []; + } + +} + +class AnimatedValue extends Animated { + constructor(_value) { + super(); + this.done = true; + this.elapsedTime = void 0; + this.lastPosition = void 0; + this.lastVelocity = void 0; + this.v0 = void 0; + this.durationProgress = 0; + this._value = _value; + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.num(this._value)) { + this.lastPosition = this._value; + } + } + + static create(value) { + return new AnimatedValue(value); + } + + getPayload() { + return [this]; + } + + getValue() { + return this._value; + } + + setValue(value, step) { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.num(value)) { + this.lastPosition = value; + + if (step) { + value = Math.round(value / step) * step; + + if (this.done) { + this.lastPosition = value; + } + } + } + + if (this._value === value) { + return false; + } + + this._value = value; + return true; + } + + reset() { + const { + done + } = this; + this.done = false; + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.num(this._value)) { + this.elapsedTime = 0; + this.durationProgress = 0; + this.lastPosition = this._value; + if (done) this.lastVelocity = null; + this.v0 = null; + } + } + +} + +class AnimatedString extends AnimatedValue { + constructor(value) { + super(0); + this._string = null; + this._toString = void 0; + this._toString = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .createInterpolator */ .kx)({ + output: [value, value] + }); + } + + static create(value) { + return new AnimatedString(value); + } + + getValue() { + let value = this._string; + return value == null ? this._string = this._toString(this._value) : value; + } + + setValue(value) { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.str(value)) { + if (value == this._string) { + return false; + } + + this._string = value; + this._value = 1; + } else if (super.setValue(value)) { + this._string = null; + } else { + return false; + } + + return true; + } + + reset(goal) { + if (goal) { + this._toString = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .createInterpolator */ .kx)({ + output: [this.getValue(), goal] + }); + } + + this._value = 0; + super.reset(); + } + +} + +const TreeContext = { + dependencies: null +}; + +class AnimatedObject extends Animated { + constructor(source) { + super(); + this.source = source; + this.setValue(source); + } + + getValue(animated) { + const values = {}; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(this.source, (source, key) => { + if (isAnimated(source)) { + values[key] = source.getValue(animated); + } else if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(source)) { + values[key] = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(source); + } else if (!animated) { + values[key] = source; + } + }); + return values; + } + + setValue(source) { + this.source = source; + this.payload = this._makePayload(source); + } + + reset() { + if (this.payload) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(this.payload, node => node.reset()); + } + } + + _makePayload(source) { + if (source) { + const payload = new Set(); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(source, this._addToPayload, payload); + return Array.from(payload); + } + } + + _addToPayload(source) { + if (TreeContext.dependencies && (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(source)) { + TreeContext.dependencies.add(source); + } + + const payload = getPayload(source); + + if (payload) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(payload, node => this.add(node)); + } + } + +} + +class AnimatedArray extends AnimatedObject { + constructor(source) { + super(source); + } + + static create(source) { + return new AnimatedArray(source); + } + + getValue() { + return this.source.map(node => node.getValue()); + } + + setValue(source) { + const payload = this.getPayload(); + + if (source.length == payload.length) { + return payload.map((node, i) => node.setValue(source[i])).some(Boolean); + } + + super.setValue(source.map(makeAnimated)); + return true; + } + +} + +function makeAnimated(value) { + const nodeType = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isAnimatedString */ .$7)(value) ? AnimatedString : AnimatedValue; + return nodeType.create(value); +} + +function getAnimatedType(value) { + const parentNode = getAnimated(value); + return parentNode ? parentNode.constructor : _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(value) ? AnimatedArray : (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isAnimatedString */ .$7)(value) ? AnimatedString : AnimatedValue; +} + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +const withAnimated = (Component, host) => { + const hasInstance = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(Component) || Component.prototype && Component.prototype.isReactComponent; + return (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((givenProps, givenRef) => { + const instanceRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); + const ref = hasInstance && (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(value => { + instanceRef.current = updateRef(givenRef, value); + }, [givenRef]); + const [props, deps] = getAnimatedState(givenProps, host); + const forceUpdate = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useForceUpdate */ .CH)(); + + const callback = () => { + const instance = instanceRef.current; + + if (hasInstance && !instance) { + return; + } + + const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false; + + if (didUpdate === false) { + forceUpdate(); + } + }; + + const observer = new PropsObserver(callback, deps); + const observerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + const lastObserver = observerRef.current; + observerRef.current = observer; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(deps, dep => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .addFluidObserver */ .Ec)(dep, observer)); + + if (lastObserver) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(lastObserver.deps, dep => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .removeFluidObserver */ .DV)(dep, lastObserver)); + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.cancel(lastObserver.update); + } + }); + (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(callback, []); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useOnce */ .H5)(() => () => { + const observer = observerRef.current; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(observer.deps, dep => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .removeFluidObserver */ .DV)(dep, observer)); + }); + const usedProps = host.getComponentProps(props.getValue()); + return react__WEBPACK_IMPORTED_MODULE_1__.createElement(Component, _extends({}, usedProps, { + ref: ref + })); + }); +}; + +class PropsObserver { + constructor(update, deps) { + this.update = update; + this.deps = deps; + } + + eventObserved(event) { + if (event.type == 'change') { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.write(this.update); + } + } + +} + +function getAnimatedState(props, host) { + const dependencies = new Set(); + TreeContext.dependencies = dependencies; + if (props.style) props = _extends({}, props, { + style: host.createAnimatedStyle(props.style) + }); + props = new AnimatedObject(props); + TreeContext.dependencies = null; + return [props, dependencies]; +} + +function updateRef(ref, value) { + if (ref) { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(ref)) ref(value);else ref.current = value; + } + + return value; +} + +const cacheKey = Symbol.for('AnimatedComponent'); +const createHost = (components, { + applyAnimatedValues: _applyAnimatedValues = () => false, + createAnimatedStyle: _createAnimatedStyle = style => new AnimatedObject(style), + getComponentProps: _getComponentProps = props => props +} = {}) => { + const hostConfig = { + applyAnimatedValues: _applyAnimatedValues, + createAnimatedStyle: _createAnimatedStyle, + getComponentProps: _getComponentProps + }; + + const animated = Component => { + const displayName = getDisplayName(Component) || 'Anonymous'; + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.str(Component)) { + Component = animated[Component] || (animated[Component] = withAnimated(Component, hostConfig)); + } else { + Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig)); + } + + Component.displayName = `Animated(${displayName})`; + return Component; + }; + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(components, (Component, key) => { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(components)) { + key = getDisplayName(Component); + } + + animated[key] = animated(Component); + }); + return { + animated + }; +}; + +const getDisplayName = arg => _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.str(arg) ? arg : arg && _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.str(arg.displayName) ? arg.displayName : _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(arg) && arg.name || null; + + + + +/***/ }), + +/***/ 71935: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BailSignal: () => (/* binding */ BailSignal), +/* harmony export */ Controller: () => (/* binding */ Controller), +/* harmony export */ FrameValue: () => (/* binding */ FrameValue), +/* harmony export */ Globals: () => (/* reexport safe */ _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.RV), +/* harmony export */ Interpolation: () => (/* binding */ Interpolation), +/* harmony export */ Spring: () => (/* binding */ Spring), +/* harmony export */ SpringContext: () => (/* binding */ SpringContext), +/* harmony export */ SpringRef: () => (/* binding */ SpringRef), +/* harmony export */ SpringValue: () => (/* binding */ SpringValue), +/* harmony export */ Trail: () => (/* binding */ Trail), +/* harmony export */ Transition: () => (/* binding */ Transition), +/* harmony export */ config: () => (/* binding */ config), +/* harmony export */ createInterpolator: () => (/* reexport safe */ _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.kx), +/* harmony export */ inferTo: () => (/* binding */ inferTo), +/* harmony export */ interpolate: () => (/* binding */ interpolate), +/* harmony export */ to: () => (/* binding */ to), +/* harmony export */ update: () => (/* binding */ update), +/* harmony export */ useChain: () => (/* binding */ useChain), +/* harmony export */ useSpring: () => (/* binding */ useSpring), +/* harmony export */ useSpringRef: () => (/* binding */ useSpringRef), +/* harmony export */ useSprings: () => (/* binding */ useSprings), +/* harmony export */ useTrail: () => (/* binding */ useTrail), +/* harmony export */ useTransition: () => (/* binding */ useTransition) +/* harmony export */ }); +/* harmony import */ var _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16544); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96540); +/* harmony import */ var _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17795); +/* harmony import */ var _react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77569); +/* harmony import */ var _react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3__); +/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; +/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3__) if(["default","Globals","createInterpolator","BailSignal","Controller","FrameValue","Interpolation","Spring","SpringContext","SpringRef","SpringValue","Trail","Transition","config","inferTo","interpolate","to","update","useChain","useSpring","useSpringRef","useSprings","useTrail","useTransition"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _react_spring_types_animated__WEBPACK_IMPORTED_MODULE_3__[__WEBPACK_IMPORT_KEY__] +/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); +/* harmony import */ var _react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49072); +/* harmony import */ var _react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4__); +/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; +/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4__) if(["default","Globals","createInterpolator","BailSignal","Controller","FrameValue","Interpolation","Spring","SpringContext","SpringRef","SpringValue","Trail","Transition","config","inferTo","interpolate","to","update","useChain","useSpring","useSpringRef","useSprings","useTrail","useTransition"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _react_spring_types_interpolation__WEBPACK_IMPORTED_MODULE_4__[__WEBPACK_IMPORT_KEY__] +/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); + + + + + + + + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function callProp(value, ...args) { + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(value) ? value(...args) : value; +} +const matchProp = (value, key) => value === true || !!(key && value && (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(value) ? value(key) : (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(value).includes(key))); +const resolveProp = (prop, key) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(prop) ? key && prop[key] : prop; +const getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : undefined; + +const noopTransform = value => value; + +const getDefaultProps = (props, transform = noopTransform) => { + let keys = DEFAULT_PROPS; + + if (props.default && props.default !== true) { + props = props.default; + keys = Object.keys(props); + } + + const defaults = {}; + + for (const key of keys) { + const value = transform(props[key], key); + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(value)) { + defaults[key] = value; + } + } + + return defaults; +}; +const DEFAULT_PROPS = ['config', 'onProps', 'onStart', 'onChange', 'onPause', 'onResume', 'onRest']; +const RESERVED_PROPS = { + config: 1, + from: 1, + to: 1, + ref: 1, + loop: 1, + reset: 1, + pause: 1, + cancel: 1, + reverse: 1, + immediate: 1, + default: 1, + delay: 1, + onProps: 1, + onStart: 1, + onChange: 1, + onPause: 1, + onResume: 1, + onRest: 1, + onResolve: 1, + items: 1, + trail: 1, + sort: 1, + expires: 1, + initial: 1, + enter: 1, + update: 1, + leave: 1, + children: 1, + onDestroyed: 1, + keys: 1, + callId: 1, + parentId: 1 +}; + +function getForwardProps(props) { + const forward = {}; + let count = 0; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(props, (value, prop) => { + if (!RESERVED_PROPS[prop]) { + forward[prop] = value; + count++; + } + }); + + if (count) { + return forward; + } +} + +function inferTo(props) { + const to = getForwardProps(props); + + if (to) { + const out = { + to + }; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(props, (val, key) => key in to || (out[key] = val)); + return out; + } + + return _extends({}, props); +} +function computeGoal(value) { + value = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(value); + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(value) ? value.map(computeGoal) : (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isAnimatedString */ .$7)(value) ? _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.createStringInterpolator({ + range: [0, 1], + output: [value, value] + })(1) : value; +} +function hasProps(props) { + for (const _ in props) return true; + + return false; +} +function isAsyncTo(to) { + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(to) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(to) && _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(to[0]); +} +function detachRefs(ctrl, ref) { + var _ctrl$ref; + + (_ctrl$ref = ctrl.ref) == null ? void 0 : _ctrl$ref.delete(ctrl); + ref == null ? void 0 : ref.delete(ctrl); +} +function replaceRef(ctrl, ref) { + if (ref && ctrl.ref !== ref) { + var _ctrl$ref2; + + (_ctrl$ref2 = ctrl.ref) == null ? void 0 : _ctrl$ref2.delete(ctrl); + ref.add(ctrl); + ctrl.ref = ref; + } +} + +function useChain(refs, timeSteps, timeFrame = 1000) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + if (timeSteps) { + let prevDelay = 0; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(refs, (ref, i) => { + const controllers = ref.current; + + if (controllers.length) { + let delay = timeFrame * timeSteps[i]; + if (isNaN(delay)) delay = prevDelay;else prevDelay = delay; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(controllers, ctrl => { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(ctrl.queue, props => { + const memoizedDelayProp = props.delay; + + props.delay = key => delay + callProp(memoizedDelayProp || 0, key); + }); + ctrl.start(); + }); + } + }); + } else { + let p = Promise.resolve(); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(refs, ref => { + const controllers = ref.current; + + if (controllers.length) { + const queues = controllers.map(ctrl => { + const q = ctrl.queue; + ctrl.queue = []; + return q; + }); + p = p.then(() => { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(controllers, (ctrl, i) => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(queues[i] || [], update => ctrl.queue.push(update))); + return Promise.all(ref.start()); + }); + } + }); + } + }); +} + +const config = { + default: { + tension: 170, + friction: 26 + }, + gentle: { + tension: 120, + friction: 14 + }, + wobbly: { + tension: 180, + friction: 12 + }, + stiff: { + tension: 210, + friction: 20 + }, + slow: { + tension: 280, + friction: 60 + }, + molasses: { + tension: 280, + friction: 120 + } +}; + +const linear = t => t; + +const defaults = _extends({}, config.default, { + mass: 1, + damping: 1, + easing: linear, + clamp: false +}); + +class AnimationConfig { + constructor() { + this.tension = void 0; + this.friction = void 0; + this.frequency = void 0; + this.damping = void 0; + this.mass = void 0; + this.velocity = 0; + this.restVelocity = void 0; + this.precision = void 0; + this.progress = void 0; + this.duration = void 0; + this.easing = void 0; + this.clamp = void 0; + this.bounce = void 0; + this.decay = void 0; + this.round = void 0; + Object.assign(this, defaults); + } + +} +function mergeConfig(config, newConfig, defaultConfig) { + if (defaultConfig) { + defaultConfig = _extends({}, defaultConfig); + sanitizeConfig(defaultConfig, newConfig); + newConfig = _extends({}, defaultConfig, newConfig); + } + + sanitizeConfig(config, newConfig); + Object.assign(config, newConfig); + + for (const key in defaults) { + if (config[key] == null) { + config[key] = defaults[key]; + } + } + + let { + mass, + frequency, + damping + } = config; + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(frequency)) { + if (frequency < 0.01) frequency = 0.01; + if (damping < 0) damping = 0; + config.tension = Math.pow(2 * Math.PI / frequency, 2) * mass; + config.friction = 4 * Math.PI * damping * mass / frequency; + } + + return config; +} + +function sanitizeConfig(config, props) { + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.decay)) { + config.duration = undefined; + } else { + const isTensionConfig = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.tension) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.friction); + + if (isTensionConfig || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.frequency) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.damping) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.mass)) { + config.duration = undefined; + config.decay = undefined; + } + + if (isTensionConfig) { + config.frequency = undefined; + } + } +} + +const emptyArray = []; +class Animation { + constructor() { + this.changed = false; + this.values = emptyArray; + this.toValues = null; + this.fromValues = emptyArray; + this.to = void 0; + this.from = void 0; + this.config = new AnimationConfig(); + this.immediate = false; + } + +} + +function scheduleProps(callId, { + key, + props, + defaultProps, + state, + actions +}) { + return new Promise((resolve, reject) => { + var _props$cancel; + + let delay; + let timeout; + let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key); + + if (cancel) { + onStart(); + } else { + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.pause)) { + state.paused = matchProp(props.pause, key); + } + + let pause = defaultProps == null ? void 0 : defaultProps.pause; + + if (pause !== true) { + pause = state.paused || matchProp(pause, key); + } + + delay = callProp(props.delay || 0, key); + + if (pause) { + state.resumeQueue.add(onResume); + actions.pause(); + } else { + actions.resume(); + onResume(); + } + } + + function onPause() { + state.resumeQueue.add(onResume); + state.timeouts.delete(timeout); + timeout.cancel(); + delay = timeout.time - _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.now(); + } + + function onResume() { + if (delay > 0) { + timeout = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.setTimeout(onStart, delay); + state.pauseQueue.add(onPause); + state.timeouts.add(timeout); + } else { + onStart(); + } + } + + function onStart() { + state.pauseQueue.delete(onPause); + state.timeouts.delete(timeout); + + if (callId <= (state.cancelId || 0)) { + cancel = true; + } + + try { + actions.start(_extends({}, props, { + callId, + cancel + }), resolve); + } catch (err) { + reject(err); + } + } + }); +} + +const getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some(result => result.cancelled) ? getCancelledResult(target.get()) : results.every(result => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every(result => result.finished)); +const getNoopResult = value => ({ + value, + noop: true, + finished: true, + cancelled: false +}); +const getFinishedResult = (value, finished, cancelled = false) => ({ + value, + finished, + cancelled +}); +const getCancelledResult = value => ({ + value, + cancelled: true, + finished: false +}); + +function runAsync(to, props, state, target) { + const { + callId, + parentId, + onRest + } = props; + const { + asyncTo: prevTo, + promise: prevPromise + } = state; + + if (!parentId && to === prevTo && !props.reset) { + return prevPromise; + } + + return state.promise = (async () => { + state.asyncId = callId; + state.asyncTo = to; + const defaultProps = getDefaultProps(props, (value, key) => key === 'onRest' ? undefined : value); + let preventBail; + let bail; + const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject)); + + const bailIfEnded = bailSignal => { + const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false); + + if (bailResult) { + bailSignal.result = bailResult; + bail(bailSignal); + throw bailSignal; + } + }; + + const animate = (arg1, arg2) => { + const bailSignal = new BailSignal(); + const skipAnimationSignal = new SkipAniamtionSignal(); + return (async () => { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.skipAnimation) { + stopAsync(state); + skipAnimationSignal.result = getFinishedResult(target, false); + bail(skipAnimationSignal); + throw skipAnimationSignal; + } + + bailIfEnded(bailSignal); + const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, { + to: arg1 + }); + props.parentId = callId; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(defaultProps, (value, key) => { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props[key])) { + props[key] = value; + } + }); + const result = await target.start(props); + bailIfEnded(bailSignal); + + if (state.paused) { + await new Promise(resume => { + state.resumeQueue.add(resume); + }); + } + + return result; + })(); + }; + + let result; + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.skipAnimation) { + stopAsync(state); + return getFinishedResult(target, false); + } + + try { + let animating; + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(to)) { + animating = (async queue => { + for (const props of queue) { + await animate(props); + } + })(to); + } else { + animating = Promise.resolve(to(animate, target.stop.bind(target))); + } + + await Promise.all([animating.then(preventBail), bailPromise]); + result = getFinishedResult(target.get(), true, false); + } catch (err) { + if (err instanceof BailSignal) { + result = err.result; + } else if (err instanceof SkipAniamtionSignal) { + result = err.result; + } else { + throw err; + } + } finally { + if (callId == state.asyncId) { + state.asyncId = parentId; + state.asyncTo = parentId ? prevTo : undefined; + state.promise = parentId ? prevPromise : undefined; + } + } + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(onRest)) { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => { + onRest(result, target, target.item); + }); + } + + return result; + })(); +} +function stopAsync(state, cancelId) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flush */ .bX)(state.timeouts, t => t.cancel()); + state.pauseQueue.clear(); + state.resumeQueue.clear(); + state.asyncId = state.asyncTo = state.promise = undefined; + if (cancelId) state.cancelId = cancelId; +} +class BailSignal extends Error { + constructor() { + super('An async animation has been interrupted. You see this error because you ' + 'forgot to use `await` or `.catch(...)` on its returned promise.'); + this.result = void 0; + } + +} +class SkipAniamtionSignal extends Error { + constructor() { + super('SkipAnimationSignal'); + this.result = void 0; + } + +} + +const isFrameValue = value => value instanceof FrameValue; +let nextId$1 = 1; +class FrameValue extends _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .FluidValue */ .aq { + constructor(...args) { + super(...args); + this.id = nextId$1++; + this.key = void 0; + this._priority = 0; + } + + get priority() { + return this._priority; + } + + set priority(priority) { + if (this._priority != priority) { + this._priority = priority; + + this._onPriorityChange(priority); + } + } + + get() { + const node = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this); + return node && node.getValue(); + } + + to(...args) { + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.to(this, args); + } + + interpolate(...args) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .deprecateInterpolate */ .ZJ)(); + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.to(this, args); + } + + toJSON() { + return this.get(); + } + + observerAdded(count) { + if (count == 1) this._attach(); + } + + observerRemoved(count) { + if (count == 0) this._detach(); + } + + _attach() {} + + _detach() {} + + _onChange(value, idle = false) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .callFluidObservers */ .MI)(this, { + type: 'change', + parent: this, + value, + idle + }); + } + + _onPriorityChange(priority) { + if (!this.idle) { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .frameLoop */ .WU.sort(this); + } + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .callFluidObservers */ .MI)(this, { + type: 'priority', + parent: this, + priority + }); + } + +} + +const $P = Symbol.for('SpringPhase'); +const HAS_ANIMATED = 1; +const IS_ANIMATING = 2; +const IS_PAUSED = 4; +const hasAnimated = target => (target[$P] & HAS_ANIMATED) > 0; +const isAnimating = target => (target[$P] & IS_ANIMATING) > 0; +const isPaused = target => (target[$P] & IS_PAUSED) > 0; +const setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING; +const setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED; + +class SpringValue extends FrameValue { + constructor(arg1, arg2) { + super(); + this.key = void 0; + this.animation = new Animation(); + this.queue = void 0; + this.defaultProps = {}; + this._state = { + paused: false, + pauseQueue: new Set(), + resumeQueue: new Set(), + timeouts: new Set() + }; + this._pendingCalls = new Set(); + this._lastCallId = 0; + this._lastToId = 0; + this._memoizedDuration = 0; + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(arg1) || !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(arg2)) { + const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(arg1) ? _extends({}, arg1) : _extends({}, arg2, { + from: arg1 + }); + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.default)) { + props.default = true; + } + + this.start(props); + } + } + + get idle() { + return !(isAnimating(this) || this._state.asyncTo) || isPaused(this); + } + + get goal() { + return (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(this.animation.to); + } + + get velocity() { + const node = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this); + return node instanceof _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .AnimatedValue */ .rf ? node.lastVelocity || 0 : node.getPayload().map(node => node.lastVelocity || 0); + } + + get hasAnimated() { + return hasAnimated(this); + } + + get isAnimating() { + return isAnimating(this); + } + + get isPaused() { + return isPaused(this); + } + + advance(dt) { + let idle = true; + let changed = false; + const anim = this.animation; + let { + config, + toValues + } = anim; + const payload = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getPayload */ .nm)(anim.to); + + if (!payload && (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(anim.to)) { + toValues = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(anim.to)); + } + + anim.values.forEach((node, i) => { + if (node.done) return; + const to = node.constructor == _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .AnimatedString */ .pS ? 1 : payload ? payload[i].lastPosition : toValues[i]; + let finished = anim.immediate; + let position = to; + + if (!finished) { + position = node.lastPosition; + + if (config.tension <= 0) { + node.done = true; + return; + } + + let elapsed = node.elapsedTime += dt; + const from = anim.fromValues[i]; + const v0 = node.v0 != null ? node.v0 : node.v0 = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(config.velocity) ? config.velocity[i] : config.velocity; + let velocity; + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(config.duration)) { + let p = 1; + + if (config.duration > 0) { + if (this._memoizedDuration !== config.duration) { + this._memoizedDuration = config.duration; + + if (node.durationProgress > 0) { + node.elapsedTime = config.duration * node.durationProgress; + elapsed = node.elapsedTime += dt; + } + } + + p = (config.progress || 0) + elapsed / this._memoizedDuration; + p = p > 1 ? 1 : p < 0 ? 0 : p; + node.durationProgress = p; + } + + position = from + config.easing(p) * (to - from); + velocity = (position - node.lastPosition) / dt; + finished = p == 1; + } else if (config.decay) { + const decay = config.decay === true ? 0.998 : config.decay; + const e = Math.exp(-(1 - decay) * elapsed); + position = from + v0 / (1 - decay) * (1 - e); + finished = Math.abs(node.lastPosition - position) < 0.1; + velocity = v0 * e; + } else { + velocity = node.lastVelocity == null ? v0 : node.lastVelocity; + const precision = config.precision || (from == to ? 0.005 : Math.min(1, Math.abs(to - from) * 0.001)); + const restVelocity = config.restVelocity || precision / 10; + const bounceFactor = config.clamp ? 0 : config.bounce; + const canBounce = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(bounceFactor); + const isGrowing = from == to ? node.v0 > 0 : from < to; + let isMoving; + let isBouncing = false; + const step = 1; + const numSteps = Math.ceil(dt / step); + + for (let n = 0; n < numSteps; ++n) { + isMoving = Math.abs(velocity) > restVelocity; + + if (!isMoving) { + finished = Math.abs(to - position) <= precision; + + if (finished) { + break; + } + } + + if (canBounce) { + isBouncing = position == to || position > to == isGrowing; + + if (isBouncing) { + velocity = -velocity * bounceFactor; + position = to; + } + } + + const springForce = -config.tension * 0.000001 * (position - to); + const dampingForce = -config.friction * 0.001 * velocity; + const acceleration = (springForce + dampingForce) / config.mass; + velocity = velocity + acceleration * step; + position = position + velocity * step; + } + } + + node.lastVelocity = velocity; + + if (Number.isNaN(position)) { + console.warn(`Got NaN while animating:`, this); + finished = true; + } + } + + if (payload && !payload[i].done) { + finished = false; + } + + if (finished) { + node.done = true; + } else { + idle = false; + } + + if (node.setValue(position, config.round)) { + changed = true; + } + }); + const node = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this); + const currVal = node.getValue(); + + if (idle) { + const finalVal = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(anim.to); + + if ((currVal !== finalVal || changed) && !config.decay) { + node.setValue(finalVal); + + this._onChange(finalVal); + } else if (changed && config.decay) { + this._onChange(currVal); + } + + this._stop(); + } else if (changed) { + this._onChange(currVal); + } + } + + set(value) { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => { + this._stop(); + + this._focus(value); + + this._set(value); + }); + return this; + } + + pause() { + this._update({ + pause: true + }); + } + + resume() { + this._update({ + pause: false + }); + } + + finish() { + if (isAnimating(this)) { + const { + to, + config + } = this.animation; + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => { + this._onStart(); + + if (!config.decay) { + this._set(to, false); + } + + this._stop(); + }); + } + + return this; + } + + update(props) { + const queue = this.queue || (this.queue = []); + queue.push(props); + return this; + } + + start(to, arg2) { + let queue; + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(to)) { + queue = [_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(to) ? to : _extends({}, arg2, { + to + })]; + } else { + queue = this.queue || []; + this.queue = []; + } + + return Promise.all(queue.map(props => this._update(props))).then(results => getCombinedResult(this, results)); + } + + stop(cancel) { + const { + to + } = this.animation; + + this._focus(this.get()); + + stopAsync(this._state, cancel && this._lastCallId); + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => this._stop(to, cancel)); + return this; + } + + reset() { + this._update({ + reset: true + }); + } + + eventObserved(event) { + if (event.type == 'change') { + this._start(); + } else if (event.type == 'priority') { + this.priority = event.priority + 1; + } + } + + _prepareNode(props) { + const key = this.key || ''; + let { + to, + from + } = props; + to = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(to) ? to[key] : to; + + if (to == null || isAsyncTo(to)) { + to = undefined; + } + + from = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(from) ? from[key] : from; + + if (from == null) { + from = undefined; + } + + const range = { + to, + from + }; + + if (!hasAnimated(this)) { + if (props.reverse) [to, from] = [from, to]; + from = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(from); + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(from)) { + this._set(from); + } else if (!(0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this)) { + this._set(to); + } + } + + return range; + } + + _update(_ref, isLoop) { + let props = _extends({}, _ref); + + const { + key, + defaultProps + } = this; + if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value)); + mergeActiveFn(this, props, 'onProps'); + sendEvent(this, 'onProps', props, this); + + const range = this._prepareNode(props); + + if (Object.isFrozen(this)) { + throw Error('Cannot animate a `SpringValue` object that is frozen. ' + 'Did you forget to pass your component to `animated(...)` before animating its props?'); + } + + const state = this._state; + return scheduleProps(++this._lastCallId, { + key, + props, + defaultProps, + state, + actions: { + pause: () => { + if (!isPaused(this)) { + setPausedBit(this, true); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flushCalls */ .Wd)(state.pauseQueue); + sendEvent(this, 'onPause', getFinishedResult(this, checkFinished(this, this.animation.to)), this); + } + }, + resume: () => { + if (isPaused(this)) { + setPausedBit(this, false); + + if (isAnimating(this)) { + this._resume(); + } + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flushCalls */ .Wd)(state.resumeQueue); + sendEvent(this, 'onResume', getFinishedResult(this, checkFinished(this, this.animation.to)), this); + } + }, + start: this._merge.bind(this, range) + } + }).then(result => { + if (props.loop && result.finished && !(isLoop && result.noop)) { + const nextProps = createLoopUpdate(props); + + if (nextProps) { + return this._update(nextProps, true); + } + } + + return result; + }); + } + + _merge(range, props, resolve) { + if (props.cancel) { + this.stop(true); + return resolve(getCancelledResult(this)); + } + + const hasToProp = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(range.to); + const hasFromProp = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(range.from); + + if (hasToProp || hasFromProp) { + if (props.callId > this._lastToId) { + this._lastToId = props.callId; + } else { + return resolve(getCancelledResult(this)); + } + } + + const { + key, + defaultProps, + animation: anim + } = this; + const { + to: prevTo, + from: prevFrom + } = anim; + let { + to = prevTo, + from = prevFrom + } = range; + + if (hasFromProp && !hasToProp && (!props.default || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(to))) { + to = from; + } + + if (props.reverse) [to, from] = [from, to]; + const hasFromChanged = !(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(from, prevFrom); + + if (hasFromChanged) { + anim.from = from; + } + + from = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(from); + const hasToChanged = !(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(to, prevTo); + + if (hasToChanged) { + this._focus(to); + } + + const hasAsyncTo = isAsyncTo(props.to); + const { + config + } = anim; + const { + decay, + velocity + } = config; + + if (hasToProp || hasFromProp) { + config.velocity = 0; + } + + if (props.config && !hasAsyncTo) { + mergeConfig(config, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0); + } + + let node = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this); + + if (!node || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(to)) { + return resolve(getFinishedResult(this, true)); + } + + const reset = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.reset) ? hasFromProp && !props.default : !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(from) && matchProp(props.reset, key); + const value = reset ? from : this.get(); + const goal = computeGoal(to); + const isAnimatable = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.num(goal) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(goal) || (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isAnimatedString */ .$7)(goal); + const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key)); + + if (hasToChanged) { + const nodeType = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimatedType */ .SJ)(to); + + if (nodeType !== node.constructor) { + if (immediate) { + node = this._set(goal); + } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`); + } + } + + const goalType = node.constructor; + let started = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(to); + let finished = false; + + if (!started) { + const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged; + + if (hasToChanged || hasValueChanged) { + finished = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(computeGoal(value), goal); + started = !finished; + } + + if (!(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(anim.immediate, immediate) && !immediate || !(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(config.decay, decay) || !(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(config.velocity, velocity)) { + started = true; + } + } + + if (finished && isAnimating(this)) { + if (anim.changed && !reset) { + started = true; + } else if (!started) { + this._stop(prevTo); + } + } + + if (!hasAsyncTo) { + if (started || (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(prevTo)) { + anim.values = node.getPayload(); + anim.toValues = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(to) ? null : goalType == _react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .AnimatedString */ .pS ? [1] : (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(goal); + } + + if (anim.immediate != immediate) { + anim.immediate = immediate; + + if (!immediate && !reset) { + this._set(prevTo); + } + } + + if (started) { + const { + onRest + } = anim; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(ACTIVE_EVENTS, type => mergeActiveFn(this, props, type)); + const result = getFinishedResult(this, checkFinished(this, prevTo)); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flushCalls */ .Wd)(this._pendingCalls, result); + + this._pendingCalls.add(resolve); + + if (anim.changed) _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => { + anim.changed = !reset; + onRest == null ? void 0 : onRest(result, this); + + if (reset) { + callProp(defaultProps.onRest, result); + } else { + anim.onStart == null ? void 0 : anim.onStart(result, this); + } + }); + } + } + + if (reset) { + this._set(value); + } + + if (hasAsyncTo) { + resolve(runAsync(props.to, props, this._state, this)); + } else if (started) { + this._start(); + } else if (isAnimating(this) && !hasToChanged) { + this._pendingCalls.add(resolve); + } else { + resolve(getNoopResult(value)); + } + } + + _focus(value) { + const anim = this.animation; + + if (value !== anim.to) { + if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidObservers */ .Wg)(this)) { + this._detach(); + } + + anim.to = value; + + if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidObservers */ .Wg)(this)) { + this._attach(); + } + } + } + + _attach() { + let priority = 0; + const { + to + } = this.animation; + + if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(to)) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .addFluidObserver */ .Ec)(to, this); + + if (isFrameValue(to)) { + priority = to.priority + 1; + } + } + + this.priority = priority; + } + + _detach() { + const { + to + } = this.animation; + + if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(to)) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .removeFluidObserver */ .DV)(to, this); + } + } + + _set(arg, idle = true) { + const value = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(arg); + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(value)) { + const oldNode = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this); + + if (!oldNode || !(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(value, oldNode.getValue())) { + const nodeType = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimatedType */ .SJ)(value); + + if (!oldNode || oldNode.constructor != nodeType) { + (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .setAnimated */ .uX)(this, nodeType.create(value)); + } else { + oldNode.setValue(value); + } + + if (oldNode) { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => { + this._onChange(value, idle); + }); + } + } + } + + return (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this); + } + + _onStart() { + const anim = this.animation; + + if (!anim.changed) { + anim.changed = true; + sendEvent(this, 'onStart', getFinishedResult(this, checkFinished(this, anim.to)), this); + } + } + + _onChange(value, idle) { + if (!idle) { + this._onStart(); + + callProp(this.animation.onChange, value, this); + } + + callProp(this.defaultProps.onChange, value, this); + + super._onChange(value, idle); + } + + _start() { + const anim = this.animation; + (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this).reset((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(anim.to)); + + if (!anim.immediate) { + anim.fromValues = anim.values.map(node => node.lastPosition); + } + + if (!isAnimating(this)) { + setActiveBit(this, true); + + if (!isPaused(this)) { + this._resume(); + } + } + } + + _resume() { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.skipAnimation) { + this.finish(); + } else { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .frameLoop */ .WU.start(this); + } + } + + _stop(goal, cancel) { + if (isAnimating(this)) { + setActiveBit(this, false); + const anim = this.animation; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(anim.values, node => { + node.done = true; + }); + + if (anim.toValues) { + anim.onChange = anim.onPause = anim.onResume = undefined; + } + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .callFluidObservers */ .MI)(this, { + type: 'idle', + parent: this + }); + const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to)); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flushCalls */ .Wd)(this._pendingCalls, result); + + if (anim.changed) { + anim.changed = false; + sendEvent(this, 'onRest', result, this); + } + } + } + +} + +function checkFinished(target, to) { + const goal = computeGoal(to); + const value = computeGoal(target.get()); + return (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(value, goal); +} + +function createLoopUpdate(props, loop = props.loop, to = props.to) { + let loopRet = callProp(loop); + + if (loopRet) { + const overrides = loopRet !== true && inferTo(loopRet); + const reverse = (overrides || props).reverse; + const reset = !overrides || overrides.reset; + return createUpdate(_extends({}, props, { + loop, + default: false, + pause: undefined, + to: !reverse || isAsyncTo(to) ? to : undefined, + from: reset ? props.from : undefined, + reset + }, overrides)); + } +} +function createUpdate(props) { + const { + to, + from + } = props = inferTo(props); + const keys = new Set(); + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(to)) findDefined(to, keys); + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(from)) findDefined(from, keys); + props.keys = keys.size ? Array.from(keys) : null; + return props; +} +function declareUpdate(props) { + const update = createUpdate(props); + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(update.default)) { + update.default = getDefaultProps(update); + } + + return update; +} + +function findDefined(values, keys) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(values, (value, key) => value != null && keys.add(key)); +} + +const ACTIVE_EVENTS = ['onStart', 'onRest', 'onChange', 'onPause', 'onResume']; + +function mergeActiveFn(target, props, type) { + target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : undefined; +} + +function sendEvent(target, type, ...args) { + var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps; + + (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args); + (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args); +} + +const BATCHED_EVENTS = ['onStart', 'onChange', 'onRest']; +let nextId = 1; +class Controller { + constructor(props, flush) { + this.id = nextId++; + this.springs = {}; + this.queue = []; + this.ref = void 0; + this._flush = void 0; + this._initialProps = void 0; + this._lastAsyncId = 0; + this._active = new Set(); + this._changed = new Set(); + this._started = false; + this._item = void 0; + this._state = { + paused: false, + pauseQueue: new Set(), + resumeQueue: new Set(), + timeouts: new Set() + }; + this._events = { + onStart: new Map(), + onChange: new Map(), + onRest: new Map() + }; + this._onFrame = this._onFrame.bind(this); + + if (flush) { + this._flush = flush; + } + + if (props) { + this.start(_extends({ + default: true + }, props)); + } + } + + get idle() { + return !this._state.asyncTo && Object.values(this.springs).every(spring => spring.idle); + } + + get item() { + return this._item; + } + + set item(item) { + this._item = item; + } + + get() { + const values = {}; + this.each((spring, key) => values[key] = spring.get()); + return values; + } + + set(values) { + for (const key in values) { + const value = values[key]; + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(value)) { + this.springs[key].set(value); + } + } + } + + update(props) { + if (props) { + this.queue.push(createUpdate(props)); + } + + return this; + } + + start(props) { + let { + queue + } = this; + + if (props) { + queue = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(props).map(createUpdate); + } else { + this.queue = []; + } + + if (this._flush) { + return this._flush(this, queue); + } + + prepareKeys(this, queue); + return flushUpdateQueue(this, queue); + } + + stop(arg, keys) { + if (arg !== !!arg) { + keys = arg; + } + + if (keys) { + const springs = this.springs; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(keys), key => springs[key].stop(!!arg)); + } else { + stopAsync(this._state, this._lastAsyncId); + this.each(spring => spring.stop(!!arg)); + } + + return this; + } + + pause(keys) { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(keys)) { + this.start({ + pause: true + }); + } else { + const springs = this.springs; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(keys), key => springs[key].pause()); + } + + return this; + } + + resume(keys) { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(keys)) { + this.start({ + pause: false + }); + } else { + const springs = this.springs; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(keys), key => springs[key].resume()); + } + + return this; + } + + each(iterator) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(this.springs, iterator); + } + + _onFrame() { + const { + onStart, + onChange, + onRest + } = this._events; + const active = this._active.size > 0; + const changed = this._changed.size > 0; + + if (active && !this._started || changed && !this._started) { + this._started = true; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flush */ .bX)(onStart, ([onStart, result]) => { + result.value = this.get(); + onStart(result, this, this._item); + }); + } + + const idle = !active && this._started; + const values = changed || idle && onRest.size ? this.get() : null; + + if (changed && onChange.size) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flush */ .bX)(onChange, ([onChange, result]) => { + result.value = values; + onChange(result, this, this._item); + }); + } + + if (idle) { + this._started = false; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flush */ .bX)(onRest, ([onRest, result]) => { + result.value = values; + onRest(result, this, this._item); + }); + } + } + + eventObserved(event) { + if (event.type == 'change') { + this._changed.add(event.parent); + + if (!event.idle) { + this._active.add(event.parent); + } + } else if (event.type == 'idle') { + this._active.delete(event.parent); + } else return; + + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.onFrame(this._onFrame); + } + +} +function flushUpdateQueue(ctrl, queue) { + return Promise.all(queue.map(props => flushUpdate(ctrl, props))).then(results => getCombinedResult(ctrl, results)); +} +async function flushUpdate(ctrl, props, isLoop) { + const { + keys, + to, + from, + loop, + onRest, + onResolve + } = props; + const defaults = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(props.default) && props.default; + + if (loop) { + props.loop = false; + } + + if (to === false) props.to = null; + if (from === false) props.from = null; + const asyncTo = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(to) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(to) ? to : undefined; + + if (asyncTo) { + props.to = undefined; + props.onRest = undefined; + + if (defaults) { + defaults.onRest = undefined; + } + } else { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(BATCHED_EVENTS, key => { + const handler = props[key]; + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(handler)) { + const queue = ctrl['_events'][key]; + + props[key] = ({ + finished, + cancelled + }) => { + const result = queue.get(handler); + + if (result) { + if (!finished) result.finished = false; + if (cancelled) result.cancelled = true; + } else { + queue.set(handler, { + value: null, + finished: finished || false, + cancelled: cancelled || false + }); + } + }; + + if (defaults) { + defaults[key] = props[key]; + } + } + }); + } + + const state = ctrl['_state']; + + if (props.pause === !state.paused) { + state.paused = props.pause; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .flushCalls */ .Wd)(props.pause ? state.pauseQueue : state.resumeQueue); + } else if (state.paused) { + props.pause = true; + } + + const promises = (keys || Object.keys(ctrl.springs)).map(key => ctrl.springs[key].start(props)); + const cancel = props.cancel === true || getDefaultProp(props, 'cancel') === true; + + if (asyncTo || cancel && state.asyncId) { + promises.push(scheduleProps(++ctrl['_lastAsyncId'], { + props, + state, + actions: { + pause: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .noop */ .lQ, + resume: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .noop */ .lQ, + + start(props, resolve) { + if (cancel) { + stopAsync(state, ctrl['_lastAsyncId']); + resolve(getCancelledResult(ctrl)); + } else { + props.onRest = onRest; + resolve(runAsync(asyncTo, props, state, ctrl)); + } + } + + } + })); + } + + if (state.paused) { + await new Promise(resume => { + state.resumeQueue.add(resume); + }); + } + + const result = getCombinedResult(ctrl, await Promise.all(promises)); + + if (loop && result.finished && !(isLoop && result.noop)) { + const nextProps = createLoopUpdate(props, loop, to); + + if (nextProps) { + prepareKeys(ctrl, [nextProps]); + return flushUpdate(ctrl, nextProps, true); + } + } + + if (onResolve) { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => onResolve(result, ctrl, ctrl.item)); + } + + return result; +} +function getSprings(ctrl, props) { + const springs = _extends({}, ctrl.springs); + + if (props) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(props), props => { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props.keys)) { + props = createUpdate(props); + } + + if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(props.to)) { + props = _extends({}, props, { + to: undefined + }); + } + + prepareSprings(springs, props, key => { + return createSpring(key); + }); + }); + } + + setSprings(ctrl, springs); + return springs; +} +function setSprings(ctrl, springs) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .eachProp */ .FI)(springs, (spring, key) => { + if (!ctrl.springs[key]) { + ctrl.springs[key] = spring; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .addFluidObserver */ .Ec)(spring, ctrl); + } + }); +} + +function createSpring(key, observer) { + const spring = new SpringValue(); + spring.key = key; + + if (observer) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .addFluidObserver */ .Ec)(spring, observer); + } + + return spring; +} + +function prepareSprings(springs, props, create) { + if (props.keys) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(props.keys, key => { + const spring = springs[key] || (springs[key] = create(key)); + spring['_prepareNode'](props); + }); + } +} + +function prepareKeys(ctrl, queue) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(queue, props => { + prepareSprings(ctrl.springs, props, key => { + return createSpring(key, ctrl); + }); + }); +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const _excluded$3 = ["children"]; +const SpringContext = _ref => { + let { + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded$3); + + const inherited = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ctx); + const pause = props.pause || !!inherited.pause, + immediate = props.immediate || !!inherited.immediate; + props = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useMemoOne */ .MA)(() => ({ + pause, + immediate + }), [pause, immediate]); + const { + Provider + } = ctx; + return react__WEBPACK_IMPORTED_MODULE_1__.createElement(Provider, { + value: props + }, children); +}; +const ctx = makeContext(SpringContext, {}); +SpringContext.Provider = ctx.Provider; +SpringContext.Consumer = ctx.Consumer; + +function makeContext(target, init) { + Object.assign(target, react__WEBPACK_IMPORTED_MODULE_1__.createContext(init)); + target.Provider._context = target; + target.Consumer._context = target; + return target; +} + +const SpringRef = () => { + const current = []; + + const SpringRef = function SpringRef(props) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .deprecateDirectCall */ .HX)(); + const results = []; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, (ctrl, i) => { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props)) { + results.push(ctrl.start()); + } else { + const update = _getProps(props, ctrl, i); + + if (update) { + results.push(ctrl.start(update)); + } + } + }); + return results; + }; + + SpringRef.current = current; + + SpringRef.add = function (ctrl) { + if (!current.includes(ctrl)) { + current.push(ctrl); + } + }; + + SpringRef.delete = function (ctrl) { + const i = current.indexOf(ctrl); + if (~i) current.splice(i, 1); + }; + + SpringRef.pause = function () { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, ctrl => ctrl.pause(...arguments)); + return this; + }; + + SpringRef.resume = function () { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, ctrl => ctrl.resume(...arguments)); + return this; + }; + + SpringRef.set = function (values) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, ctrl => ctrl.set(values)); + }; + + SpringRef.start = function (props) { + const results = []; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, (ctrl, i) => { + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(props)) { + results.push(ctrl.start()); + } else { + const update = this._getProps(props, ctrl, i); + + if (update) { + results.push(ctrl.start(update)); + } + } + }); + return results; + }; + + SpringRef.stop = function () { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, ctrl => ctrl.stop(...arguments)); + return this; + }; + + SpringRef.update = function (props) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i))); + return this; + }; + + const _getProps = function _getProps(arg, ctrl, index) { + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(arg) ? arg(index, ctrl) : arg; + }; + + SpringRef._getProps = _getProps; + return SpringRef; +}; + +function useSprings(length, props, deps) { + const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(props) && props; + if (propsFn && !deps) deps = []; + const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []); + const layoutId = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0); + const forceUpdate = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useForceUpdate */ .CH)(); + const state = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({ + ctrls: [], + queue: [], + + flush(ctrl, updates) { + const springs = getSprings(ctrl, updates); + const canFlushSync = layoutId.current > 0 && !state.queue.length && !Object.keys(springs).some(key => !ctrl.springs[key]); + return canFlushSync ? flushUpdateQueue(ctrl, updates) : new Promise(resolve => { + setSprings(ctrl, springs); + state.queue.push(() => { + resolve(flushUpdateQueue(ctrl, updates)); + }); + forceUpdate(); + }); + } + + }), []); + const ctrls = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([...state.ctrls]); + const updates = []; + const prevLength = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .usePrev */ .NQ)(length) || 0; + (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(ctrls.current.slice(length, prevLength), ctrl => { + detachRefs(ctrl, ref); + ctrl.stop(true); + }); + ctrls.current.length = length; + declareUpdates(prevLength, length); + }, [length]); + (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => { + declareUpdates(0, Math.min(prevLength, length)); + }, deps); + + function declareUpdates(startIndex, endIndex) { + for (let i = startIndex; i < endIndex; i++) { + const ctrl = ctrls.current[i] || (ctrls.current[i] = new Controller(null, state.flush)); + const update = propsFn ? propsFn(i, ctrl) : props[i]; + + if (update) { + updates[i] = declareUpdate(update); + } + } + } + + const springs = ctrls.current.map((ctrl, i) => getSprings(ctrl, updates[i])); + const context = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(SpringContext); + const prevContext = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .usePrev */ .NQ)(context); + const hasContext = context !== prevContext && hasProps(context); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + layoutId.current++; + state.ctrls = ctrls.current; + const { + queue + } = state; + + if (queue.length) { + state.queue = []; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(queue, cb => cb()); + } + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(ctrls.current, (ctrl, i) => { + ref == null ? void 0 : ref.add(ctrl); + + if (hasContext) { + ctrl.start({ + default: context + }); + } + + const update = updates[i]; + + if (update) { + replaceRef(ctrl, update.ref); + + if (ctrl.ref) { + ctrl.queue.push(update); + } else { + ctrl.start(update); + } + } + }); + }); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useOnce */ .H5)(() => () => { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(state.ctrls, ctrl => ctrl.stop(true)); + }); + const values = springs.map(x => _extends({}, x)); + return ref ? [values, ref] : values; +} + +function useSpring(props, deps) { + const isFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(props); + const [[values], ref] = useSprings(1, isFn ? props : [props], isFn ? deps || [] : deps); + return isFn || arguments.length == 2 ? [values, ref] : values; +} + +const initSpringRef = () => SpringRef(); + +const useSpringRef = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initSpringRef)[0]; + +function useTrail(length, propsArg, deps) { + const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(propsArg) && propsArg; + if (propsFn && !deps) deps = []; + let reverse = true; + const result = useSprings(length, (i, ctrl) => { + const props = propsFn ? propsFn(i, ctrl) : propsArg; + reverse = reverse && props.reverse; + return props; + }, deps || [{}]); + const ref = result[1]; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(ref.current, (ctrl, i) => { + const parent = ref.current[i + (reverse ? 1 : -1)]; + if (parent) ctrl.start({ + to: parent.springs + }); + }); + }, deps); + + if (propsFn || arguments.length == 3) { + ref['_getProps'] = (propsArg, ctrl, i) => { + const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(propsArg) ? propsArg(i, ctrl) : propsArg; + + if (props) { + const parent = ref.current[i + (props.reverse ? 1 : -1)]; + if (parent) props.to = parent.springs; + return props; + } + }; + + return result; + } + + return result[0]; +} + +let TransitionPhase; + +(function (TransitionPhase) { + TransitionPhase["MOUNT"] = "mount"; + TransitionPhase["ENTER"] = "enter"; + TransitionPhase["UPDATE"] = "update"; + TransitionPhase["LEAVE"] = "leave"; +})(TransitionPhase || (TransitionPhase = {})); + +function useTransition(data, props, deps) { + const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(props) && props; + const { + reset, + sort, + trail = 0, + expires = true, + onDestroyed, + ref: propsRef, + config: propsConfig + } = propsFn ? propsFn() : props; + const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => propsFn || arguments.length == 3 ? SpringRef() : void 0, []); + const items = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(data); + const transitions = []; + const usedTransitions = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); + const prevTransitions = reset ? null : usedTransitions.current; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + usedTransitions.current = transitions; + }); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useOnce */ .H5)(() => () => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(usedTransitions.current, t => { + if (t.expired) { + clearTimeout(t.expirationId); + } + + detachRefs(t.ctrl, ref); + t.ctrl.stop(true); + })); + const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions); + const expired = reset && usedTransitions.current || []; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(expired, ({ + ctrl, + item, + key + }) => { + detachRefs(ctrl, ref); + callProp(onDestroyed, item, key); + })); + const reused = []; + if (prevTransitions) (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(prevTransitions, (t, i) => { + if (t.expired) { + clearTimeout(t.expirationId); + expired.push(t); + } else { + i = reused[i] = keys.indexOf(t.key); + if (~i) transitions[i] = t; + } + }); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(items, (item, i) => { + if (!transitions[i]) { + transitions[i] = { + key: keys[i], + item, + phase: TransitionPhase.MOUNT, + ctrl: new Controller() + }; + transitions[i].ctrl.item = item; + } + }); + + if (reused.length) { + let i = -1; + const { + leave + } = propsFn ? propsFn() : props; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(reused, (keyIndex, prevIndex) => { + const t = prevTransitions[prevIndex]; + + if (~keyIndex) { + i = transitions.indexOf(t); + transitions[i] = _extends({}, t, { + item: items[keyIndex] + }); + } else if (leave) { + transitions.splice(++i, 0, t); + } + }); + } + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(sort)) { + transitions.sort((a, b) => sort(a.item, b.item)); + } + + let delay = -trail; + const forceUpdate = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useForceUpdate */ .CH)(); + const defaultProps = getDefaultProps(props); + const changes = new Map(); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(transitions, (t, i) => { + const key = t.key; + const prevPhase = t.phase; + const p = propsFn ? propsFn() : props; + let to; + let phase; + let propsDelay = callProp(p.delay || 0, key); + + if (prevPhase == TransitionPhase.MOUNT) { + to = p.enter; + phase = TransitionPhase.ENTER; + } else { + const isLeave = keys.indexOf(key) < 0; + + if (prevPhase != TransitionPhase.LEAVE) { + if (isLeave) { + to = p.leave; + phase = TransitionPhase.LEAVE; + } else if (to = p.update) { + phase = TransitionPhase.UPDATE; + } else return; + } else if (!isLeave) { + to = p.enter; + phase = TransitionPhase.ENTER; + } else return; + } + + to = callProp(to, t.item, i); + to = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.obj(to) ? inferTo(to) : { + to + }; + + if (!to.config) { + const config = propsConfig || defaultProps.config; + to.config = callProp(config, t.item, i, phase); + } + + delay += trail; + + const payload = _extends({}, defaultProps, { + delay: propsDelay + delay, + ref: propsRef, + immediate: p.immediate, + reset: false + }, to); + + if (phase == TransitionPhase.ENTER && _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(payload.from)) { + const _p = propsFn ? propsFn() : props; + + const from = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(_p.initial) || prevTransitions ? _p.from : _p.initial; + payload.from = callProp(from, t.item, i); + } + + const { + onResolve + } = payload; + + payload.onResolve = result => { + callProp(onResolve, result); + const transitions = usedTransitions.current; + const t = transitions.find(t => t.key === key); + if (!t) return; + + if (result.cancelled && t.phase != TransitionPhase.UPDATE) { + return; + } + + if (t.ctrl.idle) { + const idle = transitions.every(t => t.ctrl.idle); + + if (t.phase == TransitionPhase.LEAVE) { + const expiry = callProp(expires, t.item); + + if (expiry !== false) { + const expiryMs = expiry === true ? 0 : expiry; + t.expired = true; + + if (!idle && expiryMs > 0) { + if (expiryMs <= 0x7fffffff) t.expirationId = setTimeout(forceUpdate, expiryMs); + return; + } + } + } + + if (idle && transitions.some(t => t.expired)) { + forceUpdate(); + } + } + }; + + const springs = getSprings(t.ctrl, payload); + changes.set(t, { + phase, + springs, + payload + }); + }); + const context = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(SpringContext); + const prevContext = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .usePrev */ .NQ)(context); + const hasContext = context !== prevContext && hasProps(context); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + if (hasContext) (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(transitions, t => { + t.ctrl.start({ + default: context + }); + }); + }, [context]); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .useLayoutEffect */ .Nf)(() => { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)(changes, ({ + phase, + payload + }, t) => { + const { + ctrl + } = t; + t.phase = phase; + ref == null ? void 0 : ref.add(ctrl); + + if (hasContext && phase == TransitionPhase.ENTER) { + ctrl.start({ + default: context + }); + } + + if (payload) { + replaceRef(ctrl, payload.ref); + + if (ctrl.ref) { + ctrl.update(payload); + } else { + ctrl.start(payload); + } + } + }); + }, reset ? void 0 : deps); + + const renderTransitions = render => react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, transitions.map((t, i) => { + const { + springs + } = changes.get(t) || t.ctrl; + const elem = render(_extends({}, springs), t.item, t, i); + return elem && elem.type ? react__WEBPACK_IMPORTED_MODULE_1__.createElement(elem.type, _extends({}, elem.props, { + key: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.str(t.key) || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.num(t.key) ? t.key : t.ctrl.id, + ref: elem.ref + })) : elem; + })); + + return ref ? [renderTransitions, ref] : renderTransitions; +} +let nextKey = 1; + +function getKeys(items, { + key, + keys = key +}, prevTransitions) { + if (keys === null) { + const reused = new Set(); + return items.map(item => { + const t = prevTransitions && prevTransitions.find(t => t.item === item && t.phase !== TransitionPhase.LEAVE && !reused.has(t)); + + if (t) { + reused.add(t); + return t.key; + } + + return nextKey++; + }); + } + + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.und(keys) ? items : _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(keys) ? items.map(keys) : (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(keys); +} + +const _excluded$2 = ["children"]; +function Spring(_ref) { + let { + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded$2); + + return children(useSpring(props)); +} + +const _excluded$1 = ["items", "children"]; +function Trail(_ref) { + let { + items, + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded$1); + + const trails = useTrail(items.length, props); + return items.map((item, index) => { + const result = children(item, index); + return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.fun(result) ? result(trails[index]) : result; + }); +} + +const _excluded = ["items", "children"]; +function Transition(_ref) { + let { + items, + children + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded); + + return useTransition(items, props)(children); +} + +class Interpolation extends FrameValue { + constructor(source, args) { + super(); + this.key = void 0; + this.idle = true; + this.calc = void 0; + this._active = new Set(); + this.source = source; + this.calc = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .createInterpolator */ .kx)(...args); + + const value = this._get(); + + const nodeType = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimatedType */ .SJ)(value); + (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .setAnimated */ .uX)(this, nodeType.create(value)); + } + + advance(_dt) { + const value = this._get(); + + const oldValue = this.get(); + + if (!(0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .isEqual */ .n4)(value, oldValue)) { + (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getAnimated */ .Ao)(this).setValue(value); + + this._onChange(value, this.idle); + } + + if (!this.idle && checkIdle(this._active)) { + becomeIdle(this); + } + } + + _get() { + const inputs = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__.is.arr(this.source) ? this.source.map(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq) : (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .getFluidValue */ .oq)(this.source)); + return this.calc(...inputs); + } + + _start() { + if (this.idle && !checkIdle(this._active)) { + this.idle = false; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getPayload */ .nm)(this), node => { + node.done = false; + }); + + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.skipAnimation) { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .raf */ .er.batchedUpdates(() => this.advance()); + becomeIdle(this); + } else { + _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .frameLoop */ .WU.start(this); + } + } + } + + _attach() { + let priority = 1; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(this.source), source => { + if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(source)) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .addFluidObserver */ .Ec)(source, this); + } + + if (isFrameValue(source)) { + if (!source.idle) { + this._active.add(source); + } + + priority = Math.max(priority, source.priority + 1); + } + }); + this.priority = priority; + + this._start(); + } + + _detach() { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(this.source), source => { + if ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .hasFluidValue */ .at)(source)) { + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .removeFluidObserver */ .DV)(source, this); + } + }); + + this._active.clear(); + + becomeIdle(this); + } + + eventObserved(event) { + if (event.type == 'change') { + if (event.idle) { + this.advance(); + } else { + this._active.add(event.parent); + + this._start(); + } + } else if (event.type == 'idle') { + this._active.delete(event.parent); + } else if (event.type == 'priority') { + this.priority = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .toArray */ .$r)(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0); + } + } + +} + +function isIdle(source) { + return source.idle !== false; +} + +function checkIdle(active) { + return !active.size || Array.from(active).every(isIdle); +} + +function becomeIdle(self) { + if (!self.idle) { + self.idle = true; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .each */ .__)((0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__/* .getPayload */ .nm)(self), node => { + node.done = true; + }); + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .callFluidObservers */ .MI)(self, { + type: 'idle', + parent: self + }); + } +} + +const to = (source, ...args) => new Interpolation(source, args); +const interpolate = (source, ...args) => ((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .deprecateInterpolate */ .ZJ)(), new Interpolation(source, args)); + +_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .Globals */ .RV.assign({ + createStringInterpolator: _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .createStringInterpolator */ .Rs, + to: (source, args) => new Interpolation(source, args) +}); +const update = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__/* .frameLoop */ .WU.advance; + + + + +/***/ }), + +/***/ 16544: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + aq: () => (/* binding */ FluidValue), + RV: () => (/* binding */ globals), + Ec: () => (/* binding */ addFluidObserver), + MI: () => (/* binding */ callFluidObservers), + Tj: () => (/* binding */ colors), + kx: () => (/* binding */ createInterpolator), + Rs: () => (/* binding */ createStringInterpolator), + OX: () => (/* binding */ defineHidden), + HX: () => (/* binding */ deprecateDirectCall), + ZJ: () => (/* binding */ deprecateInterpolate), + __: () => (/* binding */ each), + FI: () => (/* binding */ eachProp), + bX: () => (/* binding */ flush), + Wd: () => (/* binding */ flushCalls), + WU: () => (/* binding */ frameLoop), + Wg: () => (/* binding */ getFluidObservers), + oq: () => (/* binding */ getFluidValue), + at: () => (/* binding */ hasFluidValue), + is: () => (/* binding */ is), + $7: () => (/* binding */ isAnimatedString), + n4: () => (/* binding */ isEqual), + lQ: () => (/* binding */ noop), + er: () => (/* reexport */ raf), + DV: () => (/* binding */ removeFluidObserver), + $r: () => (/* binding */ toArray), + CH: () => (/* binding */ useForceUpdate), + Nf: () => (/* binding */ useLayoutEffect), + MA: () => (/* binding */ useMemoOne), + H5: () => (/* binding */ useOnce), + NQ: () => (/* binding */ usePrev) +}); + +// UNUSED EXPORTS: callFluidObserver, colorToRgba, hex3, hex4, hex6, hex8, hsl, hsla, rgb, rgba, setFluidGetter + +;// ./node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js +let updateQueue = makeQueue(); +const raf = fn => schedule(fn, updateQueue); +let writeQueue = makeQueue(); + +raf.write = fn => schedule(fn, writeQueue); + +let onStartQueue = makeQueue(); + +raf.onStart = fn => schedule(fn, onStartQueue); + +let onFrameQueue = makeQueue(); + +raf.onFrame = fn => schedule(fn, onFrameQueue); + +let onFinishQueue = makeQueue(); + +raf.onFinish = fn => schedule(fn, onFinishQueue); + +let timeouts = []; + +raf.setTimeout = (handler, ms) => { + let time = raf.now() + ms; + + let cancel = () => { + let i = timeouts.findIndex(t => t.cancel == cancel); + if (~i) timeouts.splice(i, 1); + __raf.count -= ~i ? 1 : 0; + }; + + let timeout = { + time, + handler, + cancel + }; + timeouts.splice(findTimeout(time), 0, timeout); + __raf.count += 1; + start(); + return timeout; +}; + +let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length); + +raf.cancel = fn => { + updateQueue.delete(fn); + writeQueue.delete(fn); +}; + +raf.sync = fn => { + sync = true; + raf.batchedUpdates(fn); + sync = false; +}; + +raf.throttle = fn => { + let lastArgs; + + function queuedFn() { + try { + fn(...lastArgs); + } finally { + lastArgs = null; + } + } + + function throttled(...args) { + lastArgs = args; + raf.onStart(queuedFn); + } + + throttled.handler = fn; + + throttled.cancel = () => { + onStartQueue.delete(queuedFn); + lastArgs = null; + }; + + return throttled; +}; + +let nativeRaf = typeof window != 'undefined' ? window.requestAnimationFrame : () => {}; + +raf.use = impl => nativeRaf = impl; + +raf.now = typeof performance != 'undefined' ? () => performance.now() : Date.now; + +raf.batchedUpdates = fn => fn(); + +raf.catch = console.error; +raf.frameLoop = 'always'; + +raf.advance = () => { + if (raf.frameLoop !== 'demand') { + console.warn('Cannot call the manual advancement of rafz whilst frameLoop is not set as demand'); + } else { + update(); + } +}; + +let ts = -1; +let sync = false; + +function schedule(fn, queue) { + if (sync) { + queue.delete(fn); + fn(0); + } else { + queue.add(fn); + start(); + } +} + +function start() { + if (ts < 0) { + ts = 0; + + if (raf.frameLoop !== 'demand') { + nativeRaf(loop); + } + } +} + +function loop() { + if (~ts) { + nativeRaf(loop); + raf.batchedUpdates(update); + } +} + +function update() { + let prevTs = ts; + ts = raf.now(); + let count = findTimeout(ts); + + if (count) { + eachSafely(timeouts.splice(0, count), t => t.handler()); + __raf.count -= count; + } + + onStartQueue.flush(); + updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667); + onFrameQueue.flush(); + writeQueue.flush(); + onFinishQueue.flush(); +} + +function makeQueue() { + let next = new Set(); + let current = next; + return { + add(fn) { + __raf.count += current == next && !next.has(fn) ? 1 : 0; + next.add(fn); + }, + + delete(fn) { + __raf.count -= current == next && next.has(fn) ? 1 : 0; + return next.delete(fn); + }, + + flush(arg) { + if (current.size) { + next = new Set(); + __raf.count -= current.size; + eachSafely(current, fn => fn(arg) && next.add(fn)); + __raf.count += next.size; + current = next; + } + } + + }; +} + +function eachSafely(values, each) { + values.forEach(value => { + try { + each(value); + } catch (e) { + raf.catch(e); + } + }); +} + +const __raf = { + count: 0, + + clear() { + ts = -1; + timeouts = []; + onStartQueue = makeQueue(); + updateQueue = makeQueue(); + onFrameQueue = makeQueue(); + writeQueue = makeQueue(); + onFinishQueue = makeQueue(); + __raf.count = 0; + } + +}; + + + +// EXTERNAL MODULE: ./node_modules/react/index.js +var react = __webpack_require__(96540); +;// ./node_modules/@react-spring/shared/dist/react-spring-shared.esm.js + + + + + +function noop() {} +const defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { + value, + writable: true, + configurable: true +}); +const is = { + arr: Array.isArray, + obj: a => !!a && a.constructor.name === 'Object', + fun: a => typeof a === 'function', + str: a => typeof a === 'string', + num: a => typeof a === 'number', + und: a => a === undefined +}; +function isEqual(a, b) { + if (is.arr(a)) { + if (!is.arr(b) || a.length !== b.length) return false; + + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + + return true; + } + + return a === b; +} +const each = (obj, fn) => obj.forEach(fn); +function eachProp(obj, fn, ctx) { + if (is.arr(obj)) { + for (let i = 0; i < obj.length; i++) { + fn.call(ctx, obj[i], `${i}`); + } + + return; + } + + for (const key in obj) { + if (obj.hasOwnProperty(key)) { + fn.call(ctx, obj[key], key); + } + } +} +const toArray = a => is.und(a) ? [] : is.arr(a) ? a : [a]; +function flush(queue, iterator) { + if (queue.size) { + const items = Array.from(queue); + queue.clear(); + each(items, iterator); + } +} +const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args)); + +let createStringInterpolator$1; +let to; +let colors$1 = null; +let skipAnimation = false; +let willAdvance = noop; +const react_spring_shared_esm_assign = globals => { + if (globals.to) to = globals.to; + if (globals.now) raf.now = globals.now; + if (globals.colors !== undefined) colors$1 = globals.colors; + if (globals.skipAnimation != null) skipAnimation = globals.skipAnimation; + if (globals.createStringInterpolator) createStringInterpolator$1 = globals.createStringInterpolator; + if (globals.requestAnimationFrame) raf.use(globals.requestAnimationFrame); + if (globals.batchedUpdates) raf.batchedUpdates = globals.batchedUpdates; + if (globals.willAdvance) willAdvance = globals.willAdvance; + if (globals.frameLoop) raf.frameLoop = globals.frameLoop; +}; + +var globals = /*#__PURE__*/Object.freeze({ + __proto__: null, + get createStringInterpolator () { return createStringInterpolator$1; }, + get to () { return to; }, + get colors () { return colors$1; }, + get skipAnimation () { return skipAnimation; }, + get willAdvance () { return willAdvance; }, + assign: react_spring_shared_esm_assign +}); + +const startQueue = new Set(); +let currentFrame = []; +let prevFrame = []; +let priority = 0; +const frameLoop = { + get idle() { + return !startQueue.size && !currentFrame.length; + }, + + start(animation) { + if (priority > animation.priority) { + startQueue.add(animation); + raf.onStart(flushStartQueue); + } else { + startSafely(animation); + raf(advance); + } + }, + + advance, + + sort(animation) { + if (priority) { + raf.onFrame(() => frameLoop.sort(animation)); + } else { + const prevIndex = currentFrame.indexOf(animation); + + if (~prevIndex) { + currentFrame.splice(prevIndex, 1); + startUnsafely(animation); + } + } + }, + + clear() { + currentFrame = []; + startQueue.clear(); + } + +}; + +function flushStartQueue() { + startQueue.forEach(startSafely); + startQueue.clear(); + raf(advance); +} + +function startSafely(animation) { + if (!currentFrame.includes(animation)) startUnsafely(animation); +} + +function startUnsafely(animation) { + currentFrame.splice(findIndex(currentFrame, other => other.priority > animation.priority), 0, animation); +} + +function advance(dt) { + const nextFrame = prevFrame; + + for (let i = 0; i < currentFrame.length; i++) { + const animation = currentFrame[i]; + priority = animation.priority; + + if (!animation.idle) { + willAdvance(animation); + animation.advance(dt); + + if (!animation.idle) { + nextFrame.push(animation); + } + } + } + + priority = 0; + prevFrame = currentFrame; + prevFrame.length = 0; + currentFrame = nextFrame; + return currentFrame.length > 0; +} + +function findIndex(arr, test) { + const index = arr.findIndex(test); + return index < 0 ? arr.length : index; +} + +const colors = { + transparent: 0x00000000, + aliceblue: 0xf0f8ffff, + antiquewhite: 0xfaebd7ff, + aqua: 0x00ffffff, + aquamarine: 0x7fffd4ff, + azure: 0xf0ffffff, + beige: 0xf5f5dcff, + bisque: 0xffe4c4ff, + black: 0x000000ff, + blanchedalmond: 0xffebcdff, + blue: 0x0000ffff, + blueviolet: 0x8a2be2ff, + brown: 0xa52a2aff, + burlywood: 0xdeb887ff, + burntsienna: 0xea7e5dff, + cadetblue: 0x5f9ea0ff, + chartreuse: 0x7fff00ff, + chocolate: 0xd2691eff, + coral: 0xff7f50ff, + cornflowerblue: 0x6495edff, + cornsilk: 0xfff8dcff, + crimson: 0xdc143cff, + cyan: 0x00ffffff, + darkblue: 0x00008bff, + darkcyan: 0x008b8bff, + darkgoldenrod: 0xb8860bff, + darkgray: 0xa9a9a9ff, + darkgreen: 0x006400ff, + darkgrey: 0xa9a9a9ff, + darkkhaki: 0xbdb76bff, + darkmagenta: 0x8b008bff, + darkolivegreen: 0x556b2fff, + darkorange: 0xff8c00ff, + darkorchid: 0x9932ccff, + darkred: 0x8b0000ff, + darksalmon: 0xe9967aff, + darkseagreen: 0x8fbc8fff, + darkslateblue: 0x483d8bff, + darkslategray: 0x2f4f4fff, + darkslategrey: 0x2f4f4fff, + darkturquoise: 0x00ced1ff, + darkviolet: 0x9400d3ff, + deeppink: 0xff1493ff, + deepskyblue: 0x00bfffff, + dimgray: 0x696969ff, + dimgrey: 0x696969ff, + dodgerblue: 0x1e90ffff, + firebrick: 0xb22222ff, + floralwhite: 0xfffaf0ff, + forestgreen: 0x228b22ff, + fuchsia: 0xff00ffff, + gainsboro: 0xdcdcdcff, + ghostwhite: 0xf8f8ffff, + gold: 0xffd700ff, + goldenrod: 0xdaa520ff, + gray: 0x808080ff, + green: 0x008000ff, + greenyellow: 0xadff2fff, + grey: 0x808080ff, + honeydew: 0xf0fff0ff, + hotpink: 0xff69b4ff, + indianred: 0xcd5c5cff, + indigo: 0x4b0082ff, + ivory: 0xfffff0ff, + khaki: 0xf0e68cff, + lavender: 0xe6e6faff, + lavenderblush: 0xfff0f5ff, + lawngreen: 0x7cfc00ff, + lemonchiffon: 0xfffacdff, + lightblue: 0xadd8e6ff, + lightcoral: 0xf08080ff, + lightcyan: 0xe0ffffff, + lightgoldenrodyellow: 0xfafad2ff, + lightgray: 0xd3d3d3ff, + lightgreen: 0x90ee90ff, + lightgrey: 0xd3d3d3ff, + lightpink: 0xffb6c1ff, + lightsalmon: 0xffa07aff, + lightseagreen: 0x20b2aaff, + lightskyblue: 0x87cefaff, + lightslategray: 0x778899ff, + lightslategrey: 0x778899ff, + lightsteelblue: 0xb0c4deff, + lightyellow: 0xffffe0ff, + lime: 0x00ff00ff, + limegreen: 0x32cd32ff, + linen: 0xfaf0e6ff, + magenta: 0xff00ffff, + maroon: 0x800000ff, + mediumaquamarine: 0x66cdaaff, + mediumblue: 0x0000cdff, + mediumorchid: 0xba55d3ff, + mediumpurple: 0x9370dbff, + mediumseagreen: 0x3cb371ff, + mediumslateblue: 0x7b68eeff, + mediumspringgreen: 0x00fa9aff, + mediumturquoise: 0x48d1ccff, + mediumvioletred: 0xc71585ff, + midnightblue: 0x191970ff, + mintcream: 0xf5fffaff, + mistyrose: 0xffe4e1ff, + moccasin: 0xffe4b5ff, + navajowhite: 0xffdeadff, + navy: 0x000080ff, + oldlace: 0xfdf5e6ff, + olive: 0x808000ff, + olivedrab: 0x6b8e23ff, + orange: 0xffa500ff, + orangered: 0xff4500ff, + orchid: 0xda70d6ff, + palegoldenrod: 0xeee8aaff, + palegreen: 0x98fb98ff, + paleturquoise: 0xafeeeeff, + palevioletred: 0xdb7093ff, + papayawhip: 0xffefd5ff, + peachpuff: 0xffdab9ff, + peru: 0xcd853fff, + pink: 0xffc0cbff, + plum: 0xdda0ddff, + powderblue: 0xb0e0e6ff, + purple: 0x800080ff, + rebeccapurple: 0x663399ff, + red: 0xff0000ff, + rosybrown: 0xbc8f8fff, + royalblue: 0x4169e1ff, + saddlebrown: 0x8b4513ff, + salmon: 0xfa8072ff, + sandybrown: 0xf4a460ff, + seagreen: 0x2e8b57ff, + seashell: 0xfff5eeff, + sienna: 0xa0522dff, + silver: 0xc0c0c0ff, + skyblue: 0x87ceebff, + slateblue: 0x6a5acdff, + slategray: 0x708090ff, + slategrey: 0x708090ff, + snow: 0xfffafaff, + springgreen: 0x00ff7fff, + steelblue: 0x4682b4ff, + tan: 0xd2b48cff, + teal: 0x008080ff, + thistle: 0xd8bfd8ff, + tomato: 0xff6347ff, + turquoise: 0x40e0d0ff, + violet: 0xee82eeff, + wheat: 0xf5deb3ff, + white: 0xffffffff, + whitesmoke: 0xf5f5f5ff, + yellow: 0xffff00ff, + yellowgreen: 0x9acd32ff +}; + +const NUMBER = '[-+]?\\d*\\.?\\d+'; +const PERCENTAGE = NUMBER + '%'; + +function call(...parts) { + return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)'; +} + +const rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)); +const rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)); +const hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)); +const hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)); +const hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; +const hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; +const hex6 = /^#([0-9a-fA-F]{6})$/; +const hex8 = /^#([0-9a-fA-F]{8})$/; + +function normalizeColor(color) { + let match; + + if (typeof color === 'number') { + return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null; + } + + if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0; + + if (colors$1 && colors$1[color] !== undefined) { + return colors$1[color]; + } + + if (match = rgb.exec(color)) { + return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 0x000000ff) >>> 0; + } + + if (match = rgba.exec(color)) { + return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0; + } + + if (match = hex3.exec(color)) { + return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + 'ff', 16) >>> 0; + } + + if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0; + + if (match = hex4.exec(color)) { + return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0; + } + + if (match = hsl.exec(color)) { + return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 0x000000ff) >>> 0; + } + + if (match = hsla.exec(color)) { + return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0; + } + + return null; +} + +function hue2rgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; +} + +function hslToRgb(h, s, l) { + const q = l < 0.5 ? l * (1 + s) : l + s - l * s; + const p = 2 * l - q; + const r = hue2rgb(p, q, h + 1 / 3); + const g = hue2rgb(p, q, h); + const b = hue2rgb(p, q, h - 1 / 3); + return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8; +} + +function parse255(str) { + const int = parseInt(str, 10); + if (int < 0) return 0; + if (int > 255) return 255; + return int; +} + +function parse360(str) { + const int = parseFloat(str); + return (int % 360 + 360) % 360 / 360; +} + +function parse1(str) { + const num = parseFloat(str); + if (num < 0) return 0; + if (num > 1) return 255; + return Math.round(num * 255); +} + +function parsePercentage(str) { + const int = parseFloat(str); + if (int < 0) return 0; + if (int > 100) return 1; + return int / 100; +} + +function colorToRgba(input) { + let int32Color = normalizeColor(input); + if (int32Color === null) return input; + int32Color = int32Color || 0; + let r = (int32Color & 0xff000000) >>> 24; + let g = (int32Color & 0x00ff0000) >>> 16; + let b = (int32Color & 0x0000ff00) >>> 8; + let a = (int32Color & 0x000000ff) / 255; + return `rgba(${r}, ${g}, ${b}, ${a})`; +} + +const createInterpolator = (range, output, extrapolate) => { + if (is.fun(range)) { + return range; + } + + if (is.arr(range)) { + return createInterpolator({ + range, + output: output, + extrapolate + }); + } + + if (is.str(range.output[0])) { + return createStringInterpolator$1(range); + } + + const config = range; + const outputRange = config.output; + const inputRange = config.range || [0, 1]; + const extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend'; + const extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend'; + + const easing = config.easing || (t => t); + + return input => { + const range = findRange(input, inputRange); + return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map); + }; +}; + +function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) { + let result = map ? map(input) : input; + + if (result < inputMin) { + if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin; + } + + if (result > inputMax) { + if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax; + } + + if (outputMin === outputMax) return outputMin; + if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; + if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); + result = easing(result); + if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin; + return result; +} + +function findRange(input, inputRange) { + for (var i = 1; i < inputRange.length - 1; ++i) if (inputRange[i] >= input) break; + + return i - 1; +} + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +const $get = Symbol.for('FluidValue.get'); +const $observers = Symbol.for('FluidValue.observers'); + +const hasFluidValue = arg => Boolean(arg && arg[$get]); + +const getFluidValue = arg => arg && arg[$get] ? arg[$get]() : arg; + +const getFluidObservers = target => target[$observers] || null; + +function callFluidObserver(observer, event) { + if (observer.eventObserved) { + observer.eventObserved(event); + } else { + observer(event); + } +} + +function callFluidObservers(target, event) { + let observers = target[$observers]; + + if (observers) { + observers.forEach(observer => { + callFluidObserver(observer, event); + }); + } +} + +class FluidValue { + constructor(get) { + this[$get] = void 0; + this[$observers] = void 0; + + if (!get && !(get = this.get)) { + throw Error('Unknown getter'); + } + + setFluidGetter(this, get); + } + +} + +const setFluidGetter = (target, get) => setHidden(target, $get, get); + +function addFluidObserver(target, observer) { + if (target[$get]) { + let observers = target[$observers]; + + if (!observers) { + setHidden(target, $observers, observers = new Set()); + } + + if (!observers.has(observer)) { + observers.add(observer); + + if (target.observerAdded) { + target.observerAdded(observers.size, observer); + } + } + } + + return observer; +} + +function removeFluidObserver(target, observer) { + let observers = target[$observers]; + + if (observers && observers.has(observer)) { + const count = observers.size - 1; + + if (count) { + observers.delete(observer); + } else { + target[$observers] = null; + } + + if (target.observerRemoved) { + target.observerRemoved(count, observer); + } + } +} + +const setHidden = (target, key, value) => Object.defineProperty(target, key, { + value, + writable: true, + configurable: true +}); + +const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; +const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; +let namedColorRegex; +const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; + +const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`; + +const createStringInterpolator = config => { + if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/; + const output = config.output.map(value => getFluidValue(value).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba)); + const keyframes = output.map(value => value.match(numberRegex).map(Number)); + const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => { + if (!(i in values)) { + throw Error('The arity of each "output" value must be equal'); + } + + return values[i]; + })); + const interpolators = outputRanges.map(output => createInterpolator(_extends({}, config, { + output + }))); + return input => { + let i = 0; + return output[0].replace(numberRegex, () => String(interpolators[i++](input))).replace(rgbaRegex, rgbaRound); + }; +}; + +const prefix = 'react-spring: '; + +const once = fn => { + const func = fn; + let called = false; + + if (typeof func != 'function') { + throw new TypeError(`${prefix}once requires a function parameter`); + } + + return (...args) => { + if (!called) { + func(...args); + called = true; + } + }; +}; + +const warnInterpolate = once(console.warn); +function deprecateInterpolate() { + warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`); +} +const warnDirectCall = once(console.warn); +function deprecateDirectCall() { + warnDirectCall(`${prefix}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`); +} + +function isAnimatedString(value) { + return is.str(value) && (value[0] == '#' || /\d/.test(value) || value in (colors$1 || {})); +} + +const useOnce = effect => (0,react.useEffect)(effect, emptyDeps); +const emptyDeps = []; + +function useForceUpdate() { + const update = (0,react.useState)()[1]; + const mounted = (0,react.useState)(makeMountedRef)[0]; + useOnce(mounted.unmount); + return () => { + if (mounted.current) { + update({}); + } + }; +} + +function makeMountedRef() { + const mounted = { + current: true, + unmount: () => () => { + mounted.current = false; + } + }; + return mounted; +} + +function useMemoOne(getResult, inputs) { + const [initial] = (0,react.useState)(() => ({ + inputs, + result: getResult() + })); + const committed = (0,react.useRef)(); + const prevCache = committed.current; + let cache = prevCache; + + if (cache) { + const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs)); + + if (!useCache) { + cache = { + inputs, + result: getResult() + }; + } + } else { + cache = initial; + } + + (0,react.useEffect)(() => { + committed.current = cache; + + if (prevCache == initial) { + initial.inputs = initial.result = undefined; + } + }, [cache]); + return cache.result; +} + +function areInputsEqual(next, prev) { + if (next.length !== prev.length) { + return false; + } + + for (let i = 0; i < next.length; i++) { + if (next[i] !== prev[i]) { + return false; + } + } + + return true; +} + +function usePrev(value) { + const prevRef = (0,react.useRef)(); + (0,react.useEffect)(() => { + prevRef.current = value; + }); + return prevRef.current; +} + +const useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? react.useLayoutEffect : react.useEffect; + + + + +/***/ }), + +/***/ 77569: +/***/ (() => { + + + +/***/ }), + +/***/ 49072: +/***/ (() => { + + + +/***/ }), + +/***/ 98321: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ a: () => (/* binding */ animated), +/* harmony export */ animated: () => (/* binding */ animated) +/* harmony export */ }); +/* harmony import */ var _react_spring_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71935); +/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; +/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _react_spring_core__WEBPACK_IMPORTED_MODULE_0__) if(["default","a","animated"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _react_spring_core__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] +/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(40961); +/* harmony import */ var _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16544); +/* harmony import */ var _react_spring_animated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17795); + + + + + + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +const _excluded$2 = ["style", "children", "scrollTop", "scrollLeft"]; +const isCustomPropRE = /^--/; + +function dangerousStyleValue(name, value) { + if (value == null || typeof value === 'boolean' || value === '') return ''; + if (typeof value === 'number' && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; + return ('' + value).trim(); +} + +const attributeCache = {}; +function applyAnimatedValues(instance, props) { + if (!instance.nodeType || !instance.setAttribute) { + return false; + } + + const isFilterElement = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter'; + + const _ref = props, + { + style, + children, + scrollTop, + scrollLeft + } = _ref, + attributes = _objectWithoutPropertiesLoose(_ref, _excluded$2); + + const values = Object.values(attributes); + const names = Object.keys(attributes).map(name => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, n => '-' + n.toLowerCase()))); + + if (children !== void 0) { + instance.textContent = children; + } + + for (let name in style) { + if (style.hasOwnProperty(name)) { + const value = dangerousStyleValue(name, style[name]); + + if (isCustomPropRE.test(name)) { + instance.style.setProperty(name, value); + } else { + instance.style[name] = value; + } + } + } + + names.forEach((name, i) => { + instance.setAttribute(name, values[i]); + }); + + if (scrollTop !== void 0) { + instance.scrollTop = scrollTop; + } + + if (scrollLeft !== void 0) { + instance.scrollLeft = scrollLeft; + } +} +let isUnitlessNumber = { + animationIterationCount: true, + borderImageOutset: true, + borderImageSlice: true, + borderImageWidth: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + columns: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, + gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + fillOpacity: true, + floodOpacity: true, + stopOpacity: true, + strokeDasharray: true, + strokeDashoffset: true, + strokeMiterlimit: true, + strokeOpacity: true, + strokeWidth: true +}; + +const prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1); + +const prefixes = ['Webkit', 'Ms', 'Moz', 'O']; +isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => { + prefixes.forEach(prefix => acc[prefixKey(prefix, prop)] = acc[prop]); + return acc; +}, isUnitlessNumber); + +const _excluded$1 = ["x", "y", "z"]; +const domTransforms = /^(matrix|translate|scale|rotate|skew)/; +const pxTransforms = /^(translate)/; +const degTransforms = /^(rotate|skew)/; + +const addUnit = (value, unit) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__.is.num(value) && value !== 0 ? value + unit : value; + +const isValueIdentity = (value, id) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__.is.arr(value) ? value.every(v => isValueIdentity(v, id)) : _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__.is.num(value) ? value === id : parseFloat(value) === id; + +class AnimatedStyle extends _react_spring_animated__WEBPACK_IMPORTED_MODULE_3__/* .AnimatedObject */ .$s { + constructor(_ref) { + let { + x, + y, + z + } = _ref, + style = _objectWithoutPropertiesLoose(_ref, _excluded$1); + + const inputs = []; + const transforms = []; + + if (x || y || z) { + inputs.push([x || 0, y || 0, z || 0]); + transforms.push(xyz => [`translate3d(${xyz.map(v => addUnit(v, 'px')).join(',')})`, isValueIdentity(xyz, 0)]); + } + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .eachProp */ .FI)(style, (value, key) => { + if (key === 'transform') { + inputs.push([value || '']); + transforms.push(transform => [transform, transform === '']); + } else if (domTransforms.test(key)) { + delete style[key]; + if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__.is.und(value)) return; + const unit = pxTransforms.test(key) ? 'px' : degTransforms.test(key) ? 'deg' : ''; + inputs.push((0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .toArray */ .$r)(value)); + transforms.push(key === 'rotate3d' ? ([x, y, z, deg]) => [`rotate3d(${x},${y},${z},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : input => [`${key}(${input.map(v => addUnit(v, unit)).join(',')})`, isValueIdentity(input, key.startsWith('scale') ? 1 : 0)]); + } + }); + + if (inputs.length) { + style.transform = new FluidTransform(inputs, transforms); + } + + super(style); + } + +} + +class FluidTransform extends _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .FluidValue */ .aq { + constructor(inputs, transforms) { + super(); + this._value = null; + this.inputs = inputs; + this.transforms = transforms; + } + + get() { + return this._value || (this._value = this._get()); + } + + _get() { + let transform = ''; + let identity = true; + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .each */ .__)(this.inputs, (input, i) => { + const arg1 = (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .getFluidValue */ .oq)(input[0]); + const [t, id] = this.transforms[i](_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__.is.arr(arg1) ? arg1 : input.map(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .getFluidValue */ .oq)); + transform += ' ' + t; + identity = identity && id; + }); + return identity ? 'none' : transform; + } + + observerAdded(count) { + if (count == 1) (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .each */ .__)(this.inputs, input => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .each */ .__)(input, value => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .hasFluidValue */ .at)(value) && (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .addFluidObserver */ .Ec)(value, this))); + } + + observerRemoved(count) { + if (count == 0) (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .each */ .__)(this.inputs, input => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .each */ .__)(input, value => (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .hasFluidValue */ .at)(value) && (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .removeFluidObserver */ .DV)(value, this))); + } + + eventObserved(event) { + if (event.type == 'change') { + this._value = null; + } + + (0,_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .callFluidObservers */ .MI)(this, event); + } + +} + +const primitives = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; + +const _excluded = ["scrollTop", "scrollLeft"]; +_react_spring_core__WEBPACK_IMPORTED_MODULE_0__.Globals.assign({ + batchedUpdates: react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates, + createStringInterpolator: _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .createStringInterpolator */ .Rs, + colors: _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__/* .colors */ .Tj +}); +const host = (0,_react_spring_animated__WEBPACK_IMPORTED_MODULE_3__/* .createHost */ .De)(primitives, { + applyAnimatedValues, + createAnimatedStyle: style => new AnimatedStyle(style), + getComponentProps: _ref => { + let props = _objectWithoutPropertiesLoose(_ref, _excluded); + + return props; + } +}); +const animated = host.animated; + + + + +/***/ }), + +/***/ 27184: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); + + var styles = {"enterprise":".diag-server-table_DiagModal__guid__bb18c5{margin-top:1em}.diag-server-table-pagination-container_DiagModal__guid__bb18c5{-webkit-box-pack:end;justify-content:flex-end}.diag-server-table-count-paginator-container_DiagModal__guid__bb18c5{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}.title_DiagModal__guid__bb18c5{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:medium none currentColor;border-collapse:separate;-webkit-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;box-shadow:none;caption-side:top;clear:none;clip:auto;-webkit-columns:auto;columns:auto;-webkit-column-count:auto;column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1px;column-span:1px;-webkit-column-width:auto;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;empty-cells:show;float:none;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;pointer-events:auto;position:static;right:auto;-moz-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;vertical-align:baseline;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#3c444d;box-sizing:border-box;display:block;border-width:1px;visibility:inherit;outline:medium none #00a4fd;font-size:20px;line-height:22px;margin:0;overflow-wrap:break-word;padding:25px 28px 0;font-weight:500}.subtitle_DiagModal__guid__bb18c5{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:medium none currentColor;border-collapse:separate;-webkit-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;box-shadow:none;caption-side:top;clear:none;clip:auto;-webkit-columns:auto;columns:auto;-webkit-column-count:auto;column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1px;column-span:1px;-webkit-column-width:auto;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;empty-cells:show;float:none;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;pointer-events:auto;position:static;right:auto;-moz-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;vertical-align:baseline;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;color:#3c444d;box-sizing:border-box;display:block;border-width:1px;visibility:inherit;outline:medium none #00a4fd;font-size:14px;line-height:20px;padding:15px 28px;overflow-wrap:break-word;font-weight:500}","lite":".diag-server-table_DiagModal__guid__bb18c5{margin-top:1em}.diag-server-table-pagination-container_DiagModal__guid__bb18c5{-webkit-box-pack:end;justify-content:flex-end}.diag-server-table-count-paginator-container_DiagModal__guid__bb18c5{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between}.title_DiagModal__guid__bb18c5{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:medium none currentColor;border-collapse:separate;-webkit-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;box-shadow:none;caption-side:top;clear:none;clip:auto;-webkit-columns:auto;columns:auto;-webkit-column-count:auto;column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1px;column-span:1px;-webkit-column-width:auto;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;empty-cells:show;float:none;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;pointer-events:auto;position:static;right:auto;-moz-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;vertical-align:baseline;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#3c444d;box-sizing:border-box;display:block;border-width:1px;visibility:inherit;outline:medium none #00a4fd;font-size:20px;line-height:22px;margin:0;overflow-wrap:break-word;padding:25px 28px 0;font-weight:500}.subtitle_DiagModal__guid__bb18c5{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:medium none currentColor;border-collapse:separate;-webkit-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;box-shadow:none;caption-side:top;clear:none;clip:auto;-webkit-columns:auto;columns:auto;-webkit-column-count:auto;column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1px;column-span:1px;-webkit-column-width:auto;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;empty-cells:show;float:none;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;pointer-events:auto;position:static;right:auto;-moz-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;vertical-align:baseline;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;color:#3c444d;box-sizing:border-box;display:block;border-width:1px;visibility:inherit;outline:medium none #00a4fd;font-size:14px;line-height:20px;padding:15px 28px;overflow-wrap:break-word;font-weight:500}"}; + var themeLocals = {"enterprise":{"diag-server-table":"diag-server-table_DiagModal__guid__bb18c5","diag-server-table-pagination-container":"diag-server-table-pagination-container_DiagModal__guid__bb18c5","diag-server-table-count-paginator-container":"diag-server-table-count-paginator-container_DiagModal__guid__bb18c5","title":"title_DiagModal__guid__bb18c5","subtitle":"subtitle_DiagModal__guid__bb18c5"},"lite":{"diag-server-table":"diag-server-table_DiagModal__guid__bb18c5","diag-server-table-pagination-container":"diag-server-table-pagination-container_DiagModal__guid__bb18c5","diag-server-table-count-paginator-container":"diag-server-table-count-paginator-container_DiagModal__guid__bb18c5","title":"title_DiagModal__guid__bb18c5","subtitle":"subtitle_DiagModal__guid__bb18c5"}}; + var win = typeof window !== 'undefined' ? window : {}; + var partialsTheme = + win.__splunkd_partials__ && + win.__splunkd_partials__['/services/server/info'] && + win.__splunkd_partials__['/services/server/info'] + .entry[0].content.product_type; + var windowTheme = win.__splunk_ui_theme__; + var cTheme = win.$C && win.$C.SPLUNK_UI_THEME; + var targetTheme = windowTheme || cTheme || partialsTheme; + + /* Ensure theme defaults to 'enterprise'. It's possible targetTheme is set to an + /* unsupported value, such as 'splunkbase', 'enterprise2018' or false. */ + var theme = targetTheme === 'lite' ? 'lite' : 'enterprise'; + + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + var guid = module.guid || s4() + s4() + s4() + s4(); + // Add guid to locals + Object.keys(themeLocals[theme]).forEach(function(className) { + var value = themeLocals[theme][className]; + themeLocals[theme][className] = + value.replace(/_guid_/g, guid); + }); + // Add guid to styles + styles[theme] = styles[theme].replace(/_guid_/g, guid); + module.exports = [[module.id, styles[theme], '']]; + module.exports.locals = themeLocals[theme]; + module.guid = guid; + + +/***/ }), + +/***/ 5238: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); + + var styles = {"enterprise":"dt[data-test=optin-status-dl-term]:after{content:none}","lite":"dt[data-test=optin-status-dl-term]:after{content:none}"}; + var themeLocals = {"enterprise":{"borderColor":"#c3cbd4"},"lite":{"borderColor":"#c3cbd4"}}; + var win = typeof window !== 'undefined' ? window : {}; + var partialsTheme = + win.__splunkd_partials__ && + win.__splunkd_partials__['/services/server/info'] && + win.__splunkd_partials__['/services/server/info'] + .entry[0].content.product_type; + var windowTheme = win.__splunk_ui_theme__; + var cTheme = win.$C && win.$C.SPLUNK_UI_THEME; + var targetTheme = windowTheme || cTheme || partialsTheme; + + /* Ensure theme defaults to 'enterprise'. It's possible targetTheme is set to an + /* unsupported value, such as 'splunkbase', 'enterprise2018' or false. */ + var theme = targetTheme === 'lite' ? 'lite' : 'enterprise'; + + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + var guid = module.guid || s4() + s4() + s4() + s4(); + // Add guid to locals + Object.keys(themeLocals[theme]).forEach(function(className) { + var value = themeLocals[theme][className]; + themeLocals[theme][className] = + value.replace(/_guid_/g, guid); + }); + // Add guid to styles + styles[theme] = styles[theme].replace(/_guid_/g, guid); + module.exports = [[module.id, styles[theme], '']]; + module.exports.locals = themeLocals[theme]; + module.guid = guid; + + +/***/ }), + +/***/ 97081: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); + + var styles = {"enterprise":".license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5{display:table}.license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5>*{display:table-cell}.license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5>.alert-warning_LicenseDataOptOutModal__guid__bb18c5{vertical-align:middle;font-size:2em;padding-right:20px}","lite":".license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5{display:table}.license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5>*{display:table-cell}.license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5>.alert-warning_LicenseDataOptOutModal__guid__bb18c5{vertical-align:middle;font-size:2em;padding-right:20px}"}; + var themeLocals = {"enterprise":{"license-opt-out-modal-body":"license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5","alert-warning":"alert-warning_LicenseDataOptOutModal__guid__bb18c5"},"lite":{"license-opt-out-modal-body":"license-opt-out-modal-body_LicenseDataOptOutModal__guid__bb18c5","alert-warning":"alert-warning_LicenseDataOptOutModal__guid__bb18c5"}}; + var win = typeof window !== 'undefined' ? window : {}; + var partialsTheme = + win.__splunkd_partials__ && + win.__splunkd_partials__['/services/server/info'] && + win.__splunkd_partials__['/services/server/info'] + .entry[0].content.product_type; + var windowTheme = win.__splunk_ui_theme__; + var cTheme = win.$C && win.$C.SPLUNK_UI_THEME; + var targetTheme = windowTheme || cTheme || partialsTheme; + + /* Ensure theme defaults to 'enterprise'. It's possible targetTheme is set to an + /* unsupported value, such as 'splunkbase', 'enterprise2018' or false. */ + var theme = targetTheme === 'lite' ? 'lite' : 'enterprise'; + + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + var guid = module.guid || s4() + s4() + s4() + s4(); + // Add guid to locals + Object.keys(themeLocals[theme]).forEach(function(className) { + var value = themeLocals[theme][className]; + themeLocals[theme][className] = + value.replace(/_guid_/g, guid); + }); + // Add guid to styles + styles[theme] = styles[theme].replace(/_guid_/g, guid); + module.exports = [[module.id, styles[theme], '']]; + module.exports.locals = themeLocals[theme]; + module.guid = guid; + + +/***/ }), + +/***/ 61605: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports=function(e){var a={};function n(t){if(a[t])return a[t].exports;var c=a[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=a,n.d=function(e,a,t){n.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,a){if(1&a&&(e=n(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var c in e)n.d(t,c,function(a){return e[a]}.bind(null,c));return t},n.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(a,"a",a),a},n.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},n.p="",n(n.s=138)}([function(e,a,n){(function(e){e.exports=function(){"use strict";var a,t;function c(){return a.apply(null,arguments)}function M(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e){return void 0===e}function i(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,a){var n,t=[];for(n=0;n>>0,t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,c)).toString().substr(1)+t}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,C=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},x={};function F(e,a,n,t){var c=t;"string"==typeof t&&(c=function(){return this[t]()}),e&&(x[e]=c),a&&(x[a[0]]=function(){return j(c.apply(this,arguments),a[1],a[2])}),n&&(x[n]=function(){return this.localeData().ordinal(c.apply(this,arguments),e)})}function I(e,a){return e.isValid()?(a=U(a,e.localeData()),R[a]=R[a]||function(e){var a,n,t,c=e.match(P);for(a=0,n=c.length;a=0&&C.test(e);)e=e.replace(C,t),C.lastIndex=0,n-=1;return e}var J=/\d/,G=/\d\d/,K=/\d{3}/,V=/\d{4}/,Q=/[+-]?\d{6}/,Z=/\d\d?/,$=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,ae=/\d{1,3}/,ne=/\d{1,4}/,te=/[+-]?\d{1,6}/,ce=/\d+/,Me=/[+-]?\d+/,se=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,ie=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,re={};function de(e,a,n){re[e]=N(a)?a:function(e,t){return e&&n?n:a}}function _e(e,a){return _(re,e)?re[e](a._strict,a._locale):new RegExp(ue(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,a,n,t,c){return a||n||t||c}))))}function ue(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var me={};function le(e,a){var n,t=a;for("string"==typeof e&&(e=[e]),i(a)&&(t=function(e,n){n[a]=T(e)}),n=0;n68?1900:2e3)};var fe,ze=he("FullYear",!0);function he(e,a){return function(n){return null!=n?(Te(this,e,n),c.updateOffset(this,a),this):Ye(this,e)}}function Ye(e,a){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+a]():NaN}function Te(e,a,n){e.isValid()&&!isNaN(n)&&("FullYear"===a&&Ae(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+a](n,e.month(),ye(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+a](n))}function ye(e,a){if(isNaN(e)||isNaN(a))return NaN;var n,t=(a%(n=12)+n)%n;return e+=(a-t)/12,1===t?Ae(e)?29:28:31-t%7%2}fe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var a;for(a=0;a=0?(o=new Date(e+400,a,n,t,c,M,s),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,a,n,t,c,M,s),o}function Be(e){var a;if(e<100&&e>=0){var n=Array.prototype.slice.call(arguments);n[0]=e+400,a=new Date(Date.UTC.apply(null,n)),isFinite(a.getUTCFullYear())&&a.setUTCFullYear(e)}else a=new Date(Date.UTC.apply(null,arguments));return a}function ve(e,a,n){var t=7+a-n;return-(7+Be(e,0,t).getUTCDay()-a)%7+t-1}function He(e,a,n,t,c){var M,s,o=1+7*(a-1)+(7+n-t)%7+ve(e,t,c);return o<=0?s=be(M=e-1)+o:o>be(e)?(M=e+1,s=o-be(e)):(M=e,s=o),{year:M,dayOfYear:s}}function Ee(e,a,n){var t,c,M=ve(e.year(),a,n),s=Math.floor((e.dayOfYear()-M-1)/7)+1;return s<1?t=s+je(c=e.year()-1,a,n):s>je(e.year(),a,n)?(t=s-je(e.year(),a,n),c=e.year()+1):(c=e.year(),t=s),{week:t,year:c}}function je(e,a,n){var t=ve(e,a,n),c=ve(e+1,a,n);return(be(e)-t+c)/7}function Pe(e,a){return e.slice(a,7).concat(e.slice(0,a))}F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),X("week","w"),X("isoWeek","W"),E("week",5),E("isoWeek",5),de("w",Z),de("ww",Z,G),de("W",Z),de("WW",Z,G),pe(["w","ww","W","WW"],(function(e,a,n,t){a[t.substr(0,1)]=T(e)})),F("d",0,"do","day"),F("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),F("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),F("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),X("day","d"),X("weekday","e"),X("isoWeekday","E"),E("day",11),E("weekday",11),E("isoWeekday",11),de("d",Z),de("e",Z),de("E",Z),de("dd",(function(e,a){return a.weekdaysMinRegex(e)})),de("ddd",(function(e,a){return a.weekdaysShortRegex(e)})),de("dddd",(function(e,a){return a.weekdaysRegex(e)})),pe(["dd","ddd","dddd"],(function(e,a,n,t){var c=n._locale.weekdaysParse(e,t,n._strict);null!=c?a.d=c:l(n).invalidWeekday=e})),pe(["d","e","E"],(function(e,a,n,t){a[t]=T(e)}));var Ce="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Re="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Fe(e,a,n){var t,c,M,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],t=0;t<7;++t)M=m([2e3,1]).day(t),this._minWeekdaysParse[t]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[t]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[t]=this.weekdays(M,"").toLocaleLowerCase();return n?"dddd"===a?-1!==(c=fe.call(this._weekdaysParse,s))?c:null:"ddd"===a?-1!==(c=fe.call(this._shortWeekdaysParse,s))?c:null:-1!==(c=fe.call(this._minWeekdaysParse,s))?c:null:"dddd"===a?-1!==(c=fe.call(this._weekdaysParse,s))||-1!==(c=fe.call(this._shortWeekdaysParse,s))||-1!==(c=fe.call(this._minWeekdaysParse,s))?c:null:"ddd"===a?-1!==(c=fe.call(this._shortWeekdaysParse,s))||-1!==(c=fe.call(this._weekdaysParse,s))||-1!==(c=fe.call(this._minWeekdaysParse,s))?c:null:-1!==(c=fe.call(this._minWeekdaysParse,s))||-1!==(c=fe.call(this._weekdaysParse,s))||-1!==(c=fe.call(this._shortWeekdaysParse,s))?c:null}var Ie=ie,Ue=ie,Je=ie;function Ge(){function e(e,a){return a.length-e.length}var a,n,t,c,M,s=[],o=[],i=[],r=[];for(a=0;a<7;a++)n=m([2e3,1]).day(a),t=this.weekdaysMin(n,""),c=this.weekdaysShort(n,""),M=this.weekdays(n,""),s.push(t),o.push(c),i.push(M),r.push(t),r.push(c),r.push(M);for(s.sort(e),o.sort(e),i.sort(e),r.sort(e),a=0;a<7;a++)o[a]=ue(o[a]),i[a]=ue(i[a]),r[a]=ue(r[a]);this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Ve(e,a){F(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)}))}function Qe(e,a){return a._meridiemParse}F("H",["HH",2],0,"hour"),F("h",["hh",2],0,Ke),F("k",["kk",2],0,(function(){return this.hours()||24})),F("hmm",0,0,(function(){return""+Ke.apply(this)+j(this.minutes(),2)})),F("hmmss",0,0,(function(){return""+Ke.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)})),F("Hmm",0,0,(function(){return""+this.hours()+j(this.minutes(),2)})),F("Hmmss",0,0,(function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)})),Ve("a",!0),Ve("A",!1),X("hour","h"),E("hour",13),de("a",Qe),de("A",Qe),de("H",Z),de("h",Z),de("k",Z),de("HH",Z,G),de("hh",Z,G),de("kk",Z,G),de("hmm",$),de("hmmss",ee),de("Hmm",$),de("Hmmss",ee),le(["H","HH"],3),le(["k","kk"],(function(e,a,n){var t=T(e);a[3]=24===t?0:t})),le(["a","A"],(function(e,a,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),le(["h","hh"],(function(e,a,n){a[3]=T(e),l(n).bigHour=!0})),le("hmm",(function(e,a,n){var t=e.length-2;a[3]=T(e.substr(0,t)),a[4]=T(e.substr(t)),l(n).bigHour=!0})),le("hmmss",(function(e,a,n){var t=e.length-4,c=e.length-2;a[3]=T(e.substr(0,t)),a[4]=T(e.substr(t,2)),a[5]=T(e.substr(c)),l(n).bigHour=!0})),le("Hmm",(function(e,a,n){var t=e.length-2;a[3]=T(e.substr(0,t)),a[4]=T(e.substr(t))})),le("Hmmss",(function(e,a,n){var t=e.length-4,c=e.length-2;a[3]=T(e.substr(0,t)),a[4]=T(e.substr(t,2)),a[5]=T(e.substr(c))}));var Ze,$e=he("Hours",!0),ea={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:De,monthsShort:ke,week:{dow:0,doy:6},weekdays:Ce,weekdaysMin:xe,weekdaysShort:Re,meridiemParse:/[ap]\.?m?\.?/i},aa={},na={};function ta(e){return e?e.toLowerCase().replace("_","-"):e}function ca(a){var t=null;if(!aa[a]&&void 0!==e&&e&&e.exports)try{t=Ze._abbr,n(134)("./"+a),Ma(t)}catch(e){}return aa[a]}function Ma(e,a){var n;return e&&((n=o(a)?oa(e):sa(e,a))?Ze=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ze._abbr}function sa(e,a){if(null!==a){var n,t=ea;if(a.abbr=e,null!=aa[e])q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),t=aa[e]._config;else if(null!=a.parentLocale)if(null!=aa[a.parentLocale])t=aa[a.parentLocale]._config;else{if(null==(n=ca(a.parentLocale)))return na[a.parentLocale]||(na[a.parentLocale]=[]),na[a.parentLocale].push({name:e,config:a}),null;t=n._config}return aa[e]=new S(g(t,a)),na[e]&&na[e].forEach((function(e){sa(e.name,e.config)})),Ma(e),aa[e]}return delete aa[e],null}function oa(e){var a;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ze;if(!M(e)){if(a=ca(e))return a;e=[e]}return function(e){for(var a,n,t,c,M=0;M0;){if(t=ca(c.slice(0,a).join("-")))return t;if(n&&n.length>=a&&y(c,n,!0)>=a-1)break;a--}M++}return Ze}(e)}function ia(e){var a,n=e._a;return n&&-2===l(e).overflow&&(a=n[1]<0||n[1]>11?1:n[2]<1||n[2]>ye(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,l(e)._overflowDayOfYear&&(a<0||a>2)&&(a=2),l(e)._overflowWeeks&&-1===a&&(a=7),l(e)._overflowWeekday&&-1===a&&(a=8),l(e).overflow=a),e}function ra(e,a,n){return null!=e?e:null!=a?a:n}function da(e){var a,n,t,M,s,o=[];if(!e._d){for(t=function(e){var a=new Date(c.now());return e._useUTC?[a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()]:[a.getFullYear(),a.getMonth(),a.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var a,n,t,c,M,s,o,i;if(null!=(a=e._w).GG||null!=a.W||null!=a.E)M=1,s=4,n=ra(a.GG,e._a[0],Ee(Oa(),1,4).year),t=ra(a.W,1),((c=ra(a.E,1))<1||c>7)&&(i=!0);else{M=e._locale._week.dow,s=e._locale._week.doy;var r=Ee(Oa(),M,s);n=ra(a.gg,e._a[0],r.year),t=ra(a.w,r.week),null!=a.d?((c=a.d)<0||c>6)&&(i=!0):null!=a.e?(c=a.e+M,(a.e<0||a.e>6)&&(i=!0)):c=M}t<1||t>je(n,M,s)?l(e)._overflowWeeks=!0:null!=i?l(e)._overflowWeekday=!0:(o=He(n,t,c,M,s),e._a[0]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(s=ra(e._a[0],t[0]),(e._dayOfYear>be(s)||0===e._dayOfYear)&&(l(e)._overflowDayOfYear=!0),n=Be(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),a=0;a<3&&null==e._a[a];++a)e._a[a]=o[a]=t[a];for(;a<7;a++)e._a[a]=o[a]=null==e._a[a]?2===a?1:0:e._a[a];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Be:Xe).apply(null,o),M=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==M&&(l(e).weekdayMismatch=!0)}}var _a=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ua=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ma=/Z|[+-]\d\d(?::?\d\d)?/,la=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],pa=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],La=/^\/?Date\((\-?\d+)/i;function ba(e){var a,n,t,c,M,s,o=e._i,i=_a.exec(o)||ua.exec(o);if(i){for(l(e).iso=!0,a=0,n=la.length;a0&&l(e).unusedInput.push(s),o=o.slice(o.indexOf(n)+n.length),r+=n.length),x[M]?(n?l(e).empty=!1:l(e).unusedTokens.push(M),Le(M,n,e)):e._strict&&!n&&l(e).unusedTokens.push(M);l(e).charsLeftOver=i-r,o.length>0&&l(e).unusedInput.push(o),e._a[3]<=12&&!0===l(e).bigHour&&e._a[3]>0&&(l(e).bigHour=void 0),l(e).parsedDateParts=e._a.slice(0),l(e).meridiem=e._meridiem,e._a[3]=function(e,a,n){var t;return null==n?a:null!=e.meridiemHour?e.meridiemHour(a,n):null!=e.isPM?((t=e.isPM(n))&&a<12&&(a+=12),t||12!==a||(a=0),a):a}(e._locale,e._a[3],e._meridiem),da(e),ia(e)}else ha(e);else ba(e)}function Ta(e){var a=e._i,n=e._f;return e._locale=e._locale||oa(e._l),null===a||void 0===n&&""===a?L({nullInput:!0}):("string"==typeof a&&(e._i=a=e._locale.preparse(a)),h(a)?new z(ia(a)):(r(a)?e._d=a:M(n)?function(e){var a,n,t,c,M;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(c=0;cthis?this:e:L()}));function Wa(e,a){var n,t;if(1===a.length&&M(a[0])&&(a=a[0]),!a.length)return Oa();for(n=a[0],t=1;t=0?new Date(e+400,a,n)-126227808e5:new Date(e,a,n).valueOf()}function en(e,a,n){return e<100&&e>=0?Date.UTC(e+400,a,n)-126227808e5:Date.UTC(e,a,n)}function an(e,a){F(0,[e,e.length],0,a)}function nn(e,a,n,t,c){var M;return null==e?Ee(this,t,c).year:(a>(M=je(e,t,c))&&(a=M),tn.call(this,e,a,n,t,c))}function tn(e,a,n,t,c){var M=He(e,a,n,t,c),s=Be(M.year,0,M.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}F(0,["gg",2],0,(function(){return this.weekYear()%100})),F(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),X("weekYear","gg"),X("isoWeekYear","GG"),E("weekYear",1),E("isoWeekYear",1),de("G",Me),de("g",Me),de("GG",Z,G),de("gg",Z,G),de("GGGG",ne,V),de("gggg",ne,V),de("GGGGG",te,Q),de("ggggg",te,Q),pe(["gggg","ggggg","GGGG","GGGGG"],(function(e,a,n,t){a[t.substr(0,2)]=T(e)})),pe(["gg","GG"],(function(e,a,n,t){a[t]=c.parseTwoDigitYear(e)})),F("Q",0,"Qo","quarter"),X("quarter","Q"),E("quarter",7),de("Q",J),le("Q",(function(e,a){a[1]=3*(T(e)-1)})),F("D",["DD",2],"Do","date"),X("date","D"),E("date",9),de("D",Z),de("DD",Z,G),de("Do",(function(e,a){return e?a._dayOfMonthOrdinalParse||a._ordinalParse:a._dayOfMonthOrdinalParseLenient})),le(["D","DD"],2),le("Do",(function(e,a){a[2]=T(e.match(Z)[0])}));var cn=he("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),X("dayOfYear","DDD"),E("dayOfYear",4),de("DDD",ae),de("DDDD",K),le(["DDD","DDDD"],(function(e,a,n){n._dayOfYear=T(e)})),F("m",["mm",2],0,"minute"),X("minute","m"),E("minute",14),de("m",Z),de("mm",Z,G),le(["m","mm"],4);var Mn=he("Minutes",!1);F("s",["ss",2],0,"second"),X("second","s"),E("second",15),de("s",Z),de("ss",Z,G),le(["s","ss"],5);var sn,on=he("Seconds",!1);for(F("S",0,0,(function(){return~~(this.millisecond()/100)})),F(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),F(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),F(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),F(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),F(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),F(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),X("millisecond","ms"),E("millisecond",16),de("S",ae,J),de("SS",ae,G),de("SSS",ae,K),sn="SSSS";sn.length<=9;sn+="S")de(sn,ce);function rn(e,a){a[6]=T(1e3*("0."+e))}for(sn="S";sn.length<=9;sn+="S")le(sn,rn);var dn=he("Milliseconds",!1);F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var _n=z.prototype;function un(e){return e}_n.add=Ua,_n.calendar=function(e,a){var n=e||Oa(),t=va(n,this).startOf("day"),M=c.calendarFormat(this,t)||"sameElse",s=a&&(N(a[M])?a[M].call(this,n):a[M]);return this.format(s||this.localeData().calendar(M,this,Oa(n)))},_n.clone=function(){return new z(this)},_n.diff=function(e,a,n){var t,c,M;if(!this.isValid())return NaN;if(!(t=va(e,this)).isValid())return NaN;switch(c=6e4*(t.utcOffset()-this.utcOffset()),a=B(a)){case"year":M=Ga(this,t)/12;break;case"month":M=Ga(this,t);break;case"quarter":M=Ga(this,t)/3;break;case"second":M=(this-t)/1e3;break;case"minute":M=(this-t)/6e4;break;case"hour":M=(this-t)/36e5;break;case"day":M=(this-t-c)/864e5;break;case"week":M=(this-t-c)/6048e5;break;default:M=this-t}return n?M:Y(M)},_n.endOf=function(e){var a;if(void 0===(e=B(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?en:$a;switch(e){case"year":a=n(this.year()+1,0,1)-1;break;case"quarter":a=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":a=n(this.year(),this.month()+1,1)-1;break;case"week":a=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":a=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":a=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":a=this._d.valueOf(),a+=36e5-Za(a+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":a=this._d.valueOf(),a+=6e4-Za(a,6e4)-1;break;case"second":a=this._d.valueOf(),a+=1e3-Za(a,1e3)-1}return this._d.setTime(a),c.updateOffset(this,!0),this},_n.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var a=I(this,e);return this.localeData().postformat(a)},_n.from=function(e,a){return this.isValid()&&(h(e)&&e.isValid()||Oa(e).isValid())?Ca({to:this,from:e}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()},_n.fromNow=function(e){return this.from(Oa(),e)},_n.to=function(e,a){return this.isValid()&&(h(e)&&e.isValid()||Oa(e).isValid())?Ca({from:this,to:e}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()},_n.toNow=function(e){return this.to(Oa(),e)},_n.get=function(e){return N(this[e=B(e)])?this[e]():this},_n.invalidAt=function(){return l(this).overflow},_n.isAfter=function(e,a){var n=h(e)?e:Oa(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(a=B(a)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?I(n,a?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):N(Date.prototype.toISOString)?a?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",I(n,"Z")):I(n,a?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},_n.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",a="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z");var n="["+e+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",c=a+'[")]';return this.format(n+t+"-MM-DD[T]HH:mm:ss.SSS"+c)},_n.toJSON=function(){return this.isValid()?this.toISOString():null},_n.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},_n.unix=function(){return Math.floor(this.valueOf()/1e3)},_n.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},_n.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},_n.year=ze,_n.isLeapYear=function(){return Ae(this.year())},_n.weekYear=function(e){return nn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},_n.isoWeekYear=function(e){return nn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},_n.quarter=_n.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},_n.month=Ne,_n.daysInMonth=function(){return ye(this.year(),this.month())},_n.week=_n.weeks=function(e){var a=this.localeData().week(this);return null==e?a:this.add(7*(e-a),"d")},_n.isoWeek=_n.isoWeeks=function(e){var a=Ee(this,1,4).week;return null==e?a:this.add(7*(e-a),"d")},_n.weeksInYear=function(){var e=this.localeData()._week;return je(this.year(),e.dow,e.doy)},_n.isoWeeksInYear=function(){return je(this.year(),1,4)},_n.date=cn,_n.day=_n.days=function(e){if(!this.isValid())return null!=e?this:NaN;var a=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,a){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=a.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-a,"d")):a},_n.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var a=(this.day()+7-this.localeData()._week.dow)%7;return null==e?a:this.add(e-a,"d")},_n.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var a=function(e,a){return"string"==typeof e?a.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?a:a-7)}return this.day()||7},_n.dayOfYear=function(e){var a=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?a:this.add(e-a,"d")},_n.hour=_n.hours=$e,_n.minute=_n.minutes=Mn,_n.second=_n.seconds=on,_n.millisecond=_n.milliseconds=dn,_n.utcOffset=function(e,a,n){var t,M=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ba(oe,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&a&&(t=Ha(this)),this._offset=e,this._isUTC=!0,null!=t&&this.add(t,"m"),M!==e&&(!a||this._changeInProgress?Ia(this,Ca(e-M,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?M:Ha(this)},_n.utc=function(e){return this.utcOffset(0,e)},_n.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ha(this),"m")),this},_n.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ba(se,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},_n.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Oa(e).utcOffset():0,(this.utcOffset()-e)%60==0)},_n.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},_n.isLocal=function(){return!!this.isValid()&&!this._isUTC},_n.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},_n.isUtc=Ea,_n.isUTC=Ea,_n.zoneAbbr=function(){return this._isUTC?"UTC":""},_n.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},_n.dates=D("dates accessor is deprecated. Use date instead.",cn),_n.months=D("months accessor is deprecated. Use month instead",Ne),_n.years=D("years accessor is deprecated. Use year instead",ze),_n.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,a){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,a),this):-this.utcOffset()})),_n.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e={};if(A(e,this),(e=Ta(e))._a){var a=e._isUTC?m(e._a):Oa(e._a);this._isDSTShifted=this.isValid()&&y(e._a,a.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var mn=S.prototype;function ln(e,a,n,t){var c=oa(),M=m().set(t,a);return c[n](M,e)}function pn(e,a,n){if(i(e)&&(a=e,e=void 0),e=e||"",null!=a)return ln(e,a,n,"month");var t,c=[];for(t=0;t<12;t++)c[t]=ln(e,t,n,"month");return c}function Ln(e,a,n,t){"boolean"==typeof e?(i(a)&&(n=a,a=void 0),a=a||""):(n=a=e,e=!1,i(a)&&(n=a,a=void 0),a=a||"");var c,M=oa(),s=e?M._week.dow:0;if(null!=n)return ln(a,(n+s)%7,t,"day");var o=[];for(c=0;c<7;c++)o[c]=ln(a,(c+s)%7,t,"day");return o}mn.calendar=function(e,a,n){var t=this._calendar[e]||this._calendar.sameElse;return N(t)?t.call(a,n):t},mn.longDateFormat=function(e){var a=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return a||!n?a:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},mn.invalidDate=function(){return this._invalidDate},mn.ordinal=function(e){return this._ordinal.replace("%d",e)},mn.preparse=un,mn.postformat=un,mn.relativeTime=function(e,a,n,t){var c=this._relativeTime[n];return N(c)?c(e,a,n,t):c.replace(/%d/i,e)},mn.pastFuture=function(e,a){var n=this._relativeTime[e>0?"future":"past"];return N(n)?n(a):n.replace(/%s/i,a)},mn.set=function(e){var a,n;for(n in e)N(a=e[n])?this[n]=a:this["_"+n]=a;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},mn.months=function(e,a){return e?M(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Oe).test(a)?"format":"standalone"][e.month()]:M(this._months)?this._months:this._months.standalone},mn.monthsShort=function(e,a){return e?M(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Oe.test(a)?"format":"standalone"][e.month()]:M(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},mn.monthsParse=function(e,a,n){var t,c,M;if(this._monthsParseExact)return We.call(this,e,a,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),t=0;t<12;t++){if(c=m([2e3,t]),n&&!this._longMonthsParse[t]&&(this._longMonthsParse[t]=new RegExp("^"+this.months(c,"").replace(".","")+"$","i"),this._shortMonthsParse[t]=new RegExp("^"+this.monthsShort(c,"").replace(".","")+"$","i")),n||this._monthsParse[t]||(M="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[t]=new RegExp(M.replace(".",""),"i")),n&&"MMMM"===a&&this._longMonthsParse[t].test(e))return t;if(n&&"MMM"===a&&this._shortMonthsParse[t].test(e))return t;if(!n&&this._monthsParse[t].test(e))return t}},mn.monthsRegex=function(e){return this._monthsParseExact?(_(this,"_monthsRegex")||we.call(this),e?this._monthsStrictRegex:this._monthsRegex):(_(this,"_monthsRegex")||(this._monthsRegex=Se),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},mn.monthsShortRegex=function(e){return this._monthsParseExact?(_(this,"_monthsRegex")||we.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(_(this,"_monthsShortRegex")||(this._monthsShortRegex=ge),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},mn.week=function(e){return Ee(e,this._week.dow,this._week.doy).week},mn.firstDayOfYear=function(){return this._week.doy},mn.firstDayOfWeek=function(){return this._week.dow},mn.weekdays=function(e,a){var n=M(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(a)?"format":"standalone"];return!0===e?Pe(n,this._week.dow):e?n[e.day()]:n},mn.weekdaysMin=function(e){return!0===e?Pe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},mn.weekdaysShort=function(e){return!0===e?Pe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},mn.weekdaysParse=function(e,a,n){var t,c,M;if(this._weekdaysParseExact)return Fe.call(this,e,a,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),t=0;t<7;t++){if(c=m([2e3,1]).day(t),n&&!this._fullWeekdaysParse[t]&&(this._fullWeekdaysParse[t]=new RegExp("^"+this.weekdays(c,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[t]=new RegExp("^"+this.weekdaysShort(c,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[t]=new RegExp("^"+this.weekdaysMin(c,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[t]||(M="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[t]=new RegExp(M.replace(".",""),"i")),n&&"dddd"===a&&this._fullWeekdaysParse[t].test(e))return t;if(n&&"ddd"===a&&this._shortWeekdaysParse[t].test(e))return t;if(n&&"dd"===a&&this._minWeekdaysParse[t].test(e))return t;if(!n&&this._weekdaysParse[t].test(e))return t}},mn.weekdaysRegex=function(e){return this._weekdaysParseExact?(_(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(_(this,"_weekdaysRegex")||(this._weekdaysRegex=Ie),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},mn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(_(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(_(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ue),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},mn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(_(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(_(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},mn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},mn.meridiem=function(e,a,n){return e>11?n?"pm":"PM":n?"am":"AM"},Ma("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var a=e%10;return e+(1===T(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")}}),c.lang=D("moment.lang is deprecated. Use moment.locale instead.",Ma),c.langData=D("moment.langData is deprecated. Use moment.localeData instead.",oa);var bn=Math.abs;function An(e,a,n,t){var c=Ca(a,n);return e._milliseconds+=t*c._milliseconds,e._days+=t*c._days,e._months+=t*c._months,e._bubble()}function fn(e){return e<0?Math.floor(e):Math.ceil(e)}function zn(e){return 4800*e/146097}function hn(e){return 146097*e/4800}function Yn(e){return function(){return this.as(e)}}var Tn=Yn("ms"),yn=Yn("s"),On=Yn("m"),Dn=Yn("h"),kn=Yn("d"),Wn=Yn("w"),qn=Yn("M"),Nn=Yn("Q"),gn=Yn("y");function Sn(e){return function(){return this.isValid()?this._data[e]:NaN}}var wn=Sn("milliseconds"),Xn=Sn("seconds"),Bn=Sn("minutes"),vn=Sn("hours"),Hn=Sn("days"),En=Sn("months"),jn=Sn("years"),Pn=Math.round,Cn={ss:44,s:45,m:45,h:22,d:26,M:11};function Rn(e,a,n,t,c){return c.relativeTime(a||1,!!n,e,t)}var xn=Math.abs;function Fn(e){return(e>0)-(e<0)||+e}function In(){if(!this.isValid())return this.localeData().invalidDate();var e,a,n=xn(this._milliseconds)/1e3,t=xn(this._days),c=xn(this._months);e=Y(n/60),a=Y(e/60),n%=60,e%=60;var M=Y(c/12),s=c%=12,o=t,i=a,r=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",_=this.asSeconds();if(!_)return"P0D";var u=_<0?"-":"",m=Fn(this._months)!==Fn(_)?"-":"",l=Fn(this._days)!==Fn(_)?"-":"",p=Fn(this._milliseconds)!==Fn(_)?"-":"";return u+"P"+(M?m+M+"Y":"")+(s?m+s+"M":"")+(o?l+o+"D":"")+(i||r||d?"T":"")+(i?p+i+"H":"")+(r?p+r+"M":"")+(d?p+d+"S":"")}var Un=Na.prototype;return Un.isValid=function(){return this._isValid},Un.abs=function(){var e=this._data;return this._milliseconds=bn(this._milliseconds),this._days=bn(this._days),this._months=bn(this._months),e.milliseconds=bn(e.milliseconds),e.seconds=bn(e.seconds),e.minutes=bn(e.minutes),e.hours=bn(e.hours),e.months=bn(e.months),e.years=bn(e.years),this},Un.add=function(e,a){return An(this,e,a,1)},Un.subtract=function(e,a){return An(this,e,a,-1)},Un.as=function(e){if(!this.isValid())return NaN;var a,n,t=this._milliseconds;if("month"===(e=B(e))||"quarter"===e||"year"===e)switch(a=this._days+t/864e5,n=this._months+zn(a),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(a=this._days+Math.round(hn(this._months)),e){case"week":return a/7+t/6048e5;case"day":return a+t/864e5;case"hour":return 24*a+t/36e5;case"minute":return 1440*a+t/6e4;case"second":return 86400*a+t/1e3;case"millisecond":return Math.floor(864e5*a)+t;default:throw new Error("Unknown unit "+e)}},Un.asMilliseconds=Tn,Un.asSeconds=yn,Un.asMinutes=On,Un.asHours=Dn,Un.asDays=kn,Un.asWeeks=Wn,Un.asMonths=qn,Un.asQuarters=Nn,Un.asYears=gn,Un.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*T(this._months/12):NaN},Un._bubble=function(){var e,a,n,t,c,M=this._milliseconds,s=this._days,o=this._months,i=this._data;return M>=0&&s>=0&&o>=0||M<=0&&s<=0&&o<=0||(M+=864e5*fn(hn(o)+s),s=0,o=0),i.milliseconds=M%1e3,e=Y(M/1e3),i.seconds=e%60,a=Y(e/60),i.minutes=a%60,n=Y(a/60),i.hours=n%24,s+=Y(n/24),c=Y(zn(s)),o+=c,s-=fn(hn(c)),t=Y(o/12),o%=12,i.days=s,i.months=o,i.years=t,this},Un.clone=function(){return Ca(this)},Un.get=function(e){return e=B(e),this.isValid()?this[e+"s"]():NaN},Un.milliseconds=wn,Un.seconds=Xn,Un.minutes=Bn,Un.hours=vn,Un.days=Hn,Un.weeks=function(){return Y(this.days()/7)},Un.months=En,Un.years=jn,Un.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var a=this.localeData(),n=function(e,a,n){var t=Ca(e).abs(),c=Pn(t.as("s")),M=Pn(t.as("m")),s=Pn(t.as("h")),o=Pn(t.as("d")),i=Pn(t.as("M")),r=Pn(t.as("y")),d=c<=Cn.ss&&["s",c]||c0,d[4]=n,Rn.apply(null,d)}(this,!e,a);return e&&(n=a.pastFuture(+this,n)),a.postformat(n)},Un.toISOString=In,Un.toString=In,Un.toJSON=In,Un.locale=Ka,Un.localeData=Qa,Un.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",In),Un.lang=Va,F("X",0,0,"unix"),F("x",0,0,"valueOf"),de("x",Me),de("X",/[+-]?\d+(\.\d{1,3})?/),le("X",(function(e,a,n){n._d=new Date(1e3*parseFloat(e,10))})),le("x",(function(e,a,n){n._d=new Date(T(e))})),c.version="2.24.0",a=Oa,c.fn=_n,c.min=function(){var e=[].slice.call(arguments,0);return Wa("isBefore",e)},c.max=function(){var e=[].slice.call(arguments,0);return Wa("isAfter",e)},c.now=function(){return Date.now?Date.now():+new Date},c.utc=m,c.unix=function(e){return Oa(1e3*e)},c.months=function(e,a){return pn(e,a,"months")},c.isDate=r,c.locale=Ma,c.invalid=L,c.duration=Ca,c.isMoment=h,c.weekdays=function(e,a,n){return Ln(e,a,n,"weekdays")},c.parseZone=function(){return Oa.apply(null,arguments).parseZone()},c.localeData=oa,c.isDuration=ga,c.monthsShort=function(e,a){return pn(e,a,"monthsShort")},c.weekdaysMin=function(e,a,n){return Ln(e,a,n,"weekdaysMin")},c.defineLocale=sa,c.updateLocale=function(e,a){if(null!=a){var n,t,c=ea;null!=(t=ca(e))&&(c=t._config),a=g(c,a),(n=new S(a)).parentLocale=aa[e],aa[e]=n,Ma(e)}else null!=aa[e]&&(null!=aa[e].parentLocale?aa[e]=aa[e].parentLocale:null!=aa[e]&&delete aa[e]);return aa[e]},c.locales=function(){return k(aa)},c.weekdaysShort=function(e,a,n){return Ln(e,a,n,"weekdaysShort")},c.normalizeUnits=B,c.relativeTimeRounding=function(e){return void 0===e?Pn:"function"==typeof e&&(Pn=e,!0)},c.relativeTimeThreshold=function(e,a){return void 0!==Cn[e]&&(void 0===a?Cn[e]:(Cn[e]=a,"s"===e&&(Cn.ss=a-1),!0))},c.calendarFormat=function(e,a){var n=e.diff(a,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=_n,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},c}()}).call(this,n(133)(e))},function(e,a){e.exports=__webpack_require__(2543)},function(e,a,n){"use strict";n.r(a);var t=n(1);function c(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function M(e){for(var a=1;a=a.offsets.length?a:M(M({},a),{},{starts:a.starts.concat([{time:1e3*c,abbr:a.abbrs[s],offset:a.offsets[s]}])})}(e.substring(1,e.length),n)}}));var c={name:a,abbrs:[],offsets:[],untils:[]};if(0===n.starts.length)return c.abbrs.push(n.abbrs[0]),c.offsets.push(n.offsets[0]),c.untils.push(null),c;var s=n.starts[0],o=n.starts[n.starts.length-1];return n.starts.forEach((function(e,a){e===s?(c.abbrs.push(o.abbr),c.offsets.push(o.offset),c.untils.push(e.time)):(c.abbrs.push(n.starts[a-1].abbr),c.offsets.push(n.starts[a-1].offset),c.untils.push(e.time)),e===o&&(c.abbrs.push(e.abbr),c.offsets.push(e.offset),c.untils.push(null))})),c}},function(e,a){e.exports=__webpack_require__(75602)},function(e,a,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,a,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},c={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},M=function(e){return function(a,n,M,s){var o=t(a),i=c[e][t(a)];return 2===o&&(i=i[n?0:1]),i.replace(/%d/i,a)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,a,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:M("s"),ss:M("s"),m:M("m"),mm:M("m"),h:M("h"),hh:M("h"),d:M("d"),dd:M("d"),M:M("M"),MM:M("M"),y:M("y"),yy:M("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ar-dz",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},t={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},c=function(e){return function(a,c,M,s){var o=n(a),i=t[e][n(a)];return 2===o&&(i=i[c?0:1]),i.replace(/%d/i,a)}},M=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:M,monthsShort:M,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,a,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:c("s"),ss:c("s"),m:c("m"),mm:c("m"),h:c("h"),hh:c("h"),d:c("d"),dd:c("d"),M:c("M"),MM:c("M"),y:c("y"),yy:c("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,a,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,a,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(a[n]||a[e%100-n]||a[e>=100?100:null])},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){var t,c;return"m"===n?a?"хвіліна":"хвіліну":"h"===n?a?"гадзіна":"гадзіну":e+" "+(t=+e,c={ss:a?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:a?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:a?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),t%10==1&&t%100!=11?c[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?c[1]:c[2])}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:a,mm:a,h:a,hh:a,d:"дзень",dd:a,M:"месяц",MM:a,y:"год",yy:a},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,a,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var a=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===a?e+"-ви":2===a?e+"-ри":7===a||8===a?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,a){return 12===e&&(e=0),"রাত"===a&&e>=4||"দুপুর"===a&&e<5||"বিকাল"===a?e+12:e},meridiem:function(e,a,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,a){return 12===e&&(e=0),"མཚན་མོ"===a&&e>=4||"ཉིན་གུང"===a&&e<5||"དགོང་དག"===a?e+12:e},meridiem:function(e,a,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){return e+" "+function(e,a){return 2===a?function(e){var a={m:"v",b:"v",d:"z"};return void 0===a[e.charAt(0)]?e:a[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:a,h:"un eur",hh:"%d eur",d:"un devezh",dd:a,M:"ur miz",MM:a,y:"ur bloaz",yy:function(e){switch(function e(a){return a>9?e(a%10):a}(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){var t=e+" ";switch(n){case"ss":return t+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return a?"jedna minuta":"jedne minute";case"mm":return t+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return t+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return t+=1===e?"dan":"dana";case"MM":return t+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return t+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:a,m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,a){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==a&&"W"!==a||(n="a"),e+n},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),t=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],c=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function M(e){return e>1&&e<5&&1!=~~(e/10)}function s(e,a,n,t){var c=e+" ";switch(n){case"s":return a||t?"pár sekund":"pár sekundami";case"ss":return a||t?c+(M(e)?"sekundy":"sekund"):c+"sekundami";case"m":return a?"minuta":t?"minutu":"minutou";case"mm":return a||t?c+(M(e)?"minuty":"minut"):c+"minutami";case"h":return a?"hodina":t?"hodinu":"hodinou";case"hh":return a||t?c+(M(e)?"hodiny":"hodin"):c+"hodinami";case"d":return a||t?"den":"dnem";case"dd":return a||t?c+(M(e)?"dny":"dní"):c+"dny";case"M":return a||t?"měsíc":"měsícem";case"MM":return a||t?c+(M(e)?"měsíce":"měsíců"):c+"měsíci";case"y":return a||t?"rok":"rokem";case"yy":return a||t?c+(M(e)?"roky":"let"):c+"lety"}}e.defineLocale("cs",{months:a,monthsShort:n,monthsRegex:c,monthsShortRegex:c,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:s,ss:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var a="";return e>20?a=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(a=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+a},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return a?c[n][0]:c[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:a,mm:"%d Minuten",h:a,hh:"%d Stunden",d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return a?c[n][0]:c[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:a,mm:"%d Minuten",h:a,hh:"%d Stunden",d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return a?c[n][0]:c[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:a,mm:"%d Minuten",h:a,hh:"%d Stunden",d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:a,monthsShort:a,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,a,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,a){return e?"string"==typeof a&&/D/.test(a.substring(0,a.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,a,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,a){var n,t=this._calendarEl[e],c=a&&a.hours();return((n=t)instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(t=t.apply(a)),t.replace("{}",c%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-SG",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,a,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",ss:"%d sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),t=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],c=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,t){return e?/-MMM-/.test(t)?n[e.month()]:a[e.month()]:a},monthsRegex:c,monthsShortRegex:c,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),t=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],c=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,t){return e?/-MMM-/.test(t)?n[e.month()]:a[e.month()]:a},monthsRegex:c,monthsShortRegex:c,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),t=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],c=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,t){return e?/-MMM-/.test(t)?n[e.month()]:a[e.month()]:a},monthsRegex:c,monthsShortRegex:c,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return a?c[n][2]?c[n][2]:c[n][1]:t?c[n][0]:c[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:"%d päeva",M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,a,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"ثانیه d%",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",a[7],a[8],a[9]];function t(e,t,c,M){var s="";switch(c){case"s":return M?"muutaman sekunnin":"muutama sekunti";case"ss":return M?"sekunnin":"sekuntia";case"m":return M?"minuutin":"minuutti";case"mm":s=M?"minuutin":"minuuttia";break;case"h":return M?"tunnin":"tunti";case"hh":s=M?"tunnin":"tuntia";break;case"d":return M?"päivän":"päivä";case"dd":s=M?"päivän":"päivää";break;case"M":return M?"kuukauden":"kuukausi";case"MM":s=M?"kuukauden":"kuukautta";break;case"y":return M?"vuoden":"vuosi";case"yy":s=M?"vuoden":"vuotta"}return s=function(e,t){return e<10?t?n[e]:a[e]:e}(e,M)+" "+s}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,a){switch(a){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,a){switch(a){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,a){switch(a){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,t){return e?/-MMM-/.test(t)?n[e.month()]:a[e.month()]:a},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Méitheamh","Iúil","Lúnasa","Meán Fómhair","Deaireadh Fómhair","Samhain","Nollaig"],monthsShort:["Eaná","Feab","Márt","Aibr","Beal","Méit","Iúil","Lúna","Meán","Deai","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Satharn"],weekdaysShort:["Dom","Lua","Mái","Céa","Déa","hAo","Sat"],weekdaysMin:["Do","Lu","Má","Ce","Dé","hA","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné aig] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={s:["thodde secondanim","thodde second"],ss:[e+" secondanim",e+" second"],m:["eka mintan","ek minute"],mm:[e+" mintanim",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voranim",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disanim",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineanim",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsanim",e+" vorsam"]};return a?c[n][0]:c[n][1]}e.defineLocale("gom-latn",{months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Ieta to] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fatlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,a){switch(a){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:1,doy:4},meridiemParse:/rati|sokalli|donparam|sanje/,meridiemHour:function(e,a){return 12===e&&(e=0),"rati"===a?e<4?e:e+12:"sokalli"===a?e:"donparam"===a?e>12?e:e+12:"sanje"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"rati":e<12?"sokalli":e<16?"donparam":e<20?"sanje":"rati"}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,a){return 12===e&&(e=0),"રાત"===a?e<4?e:e+12:"સવાર"===a?e:"બપોર"===a?e>=10?e:e+12:"સાંજ"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,a,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात"===a?e<4?e:e+12:"सुबह"===a?e:"दोपहर"===a?e>=10?e:e+12:"शाम"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){var t=e+" ";switch(n){case"ss":return t+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return a?"jedna minuta":"jedne minute";case"mm":return t+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return t+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return t+=1===e?"dan":"dana";case"MM":return t+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return t+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:a,m:a,mm:a,h:a,hh:a,d:"dan",dd:a,M:"mjesec",MM:a,y:"godinu",yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,a,n,t){var c=e;switch(n){case"s":return t||a?"néhány másodperc":"néhány másodperce";case"ss":return c+(t||a)?" másodperc":" másodperce";case"m":return"egy"+(t||a?" perc":" perce");case"mm":return c+(t||a?" perc":" perce");case"h":return"egy"+(t||a?" óra":" órája");case"hh":return c+(t||a?" óra":" órája");case"d":return"egy"+(t||a?" nap":" napja");case"dd":return c+(t||a?" nap":" napja");case"M":return"egy"+(t||a?" hónap":" hónapja");case"MM":return c+(t||a?" hónap":" hónapja");case"y":return"egy"+(t||a?" év":" éve");case"yy":return c+(t||a?" év":" éve")}return""}function t(e){return(e?"":"[múlt] ")+"["+a[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,a,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return t.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return t.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,a){switch(a){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"siang"===a?e>=11?e:e+12:"sore"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e){return e%100==11||e%10!=1}function n(e,n,t,c){var M=e+" ";switch(t){case"s":return n||c?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return a(e)?M+(n||c?"sekúndur":"sekúndum"):M+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return a(e)?M+(n||c?"mínútur":"mínútum"):n?M+"mínúta":M+"mínútu";case"hh":return a(e)?M+(n||c?"klukkustundir":"klukkustundum"):M+"klukkustund";case"d":return n?"dagur":c?"dag":"degi";case"dd":return a(e)?n?M+"dagar":M+(c?"daga":"dögum"):n?M+"dagur":M+(c?"dag":"degi");case"M":return n?"mánuður":c?"mánuð":"mánuði";case"MM":return a(e)?n?M+"mánuðir":M+(c?"mánuði":"mánuðum"):n?M+"mánuður":M+(c?"mánuð":"mánuði");case"y":return n||c?"ár":"ári";case"yy":return a(e)?M+(n||c?"ár":"árum"):M+(n||c?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,a,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()=11?e:e+12:"sonten"===a||"ndalu"===a?e+12:void 0},meridiem:function(e,a,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return/(წამი|წუთი|საათი|წელი)/.test(e)?e.replace(/ი$/,"ში"):e+"ში"},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(a[e]||a[e%10]||a[e>=100?100:null])},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,a,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,a){return 12===e&&(e=0),"ರಾತ್ರಿ"===a?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===a?e:"ಮಧ್ಯಾಹ್ನ"===a?e>=10?e:e+12:"ಸಂಜೆ"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,a,n){return e<12?"오전":"오후"}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},t=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:t,monthsShort:t,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,a,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(a[e]||a[e%10]||a[e>=100?100:null])},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return a?c[n][0]:c[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var a=e%10;return n(0===a?e/10:a)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:a,mm:"%d Minutten",h:a,hh:"%d Stonnen",d:a,dd:"%d Deeg",M:a,MM:"%d Méint",y:a,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,a,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,a,n,t){return a?c(n)[0]:t?c(n)[1]:c(n)[2]}function t(e){return e%10==0||e>10&&e<20}function c(e){return a[e].split("_")}function M(e,a,M,s){var o=e+" ";return 1===e?o+n(0,a,M[0],s):a?o+(t(e)?c(M)[1]:c(M)[0]):s?o+c(M)[1]:o+(t(e)?c(M)[1]:c(M)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,a,n,t){return a?"kelios sekundės":t?"kelių sekundžių":"kelias sekundes"},ss:M,m:n,mm:M,h:n,hh:M,d:n,dd:M,M:n,MM:M,y:n,yy:M},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,a,n){return n?a%10==1&&a%100!=11?e[2]:e[3]:a%10==1&&a%100!=11?e[0]:e[1]}function t(e,t,c){return e+" "+n(a[c],e,t)}function c(e,t,c){return n(a[c],e,t)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,a){return a?"dažas sekundes":"dažām sekundēm"},ss:t,m:c,mm:t,h:c,hh:t,d:c,dd:t,M:c,MM:t,y:c,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,n,t){var c=a.words[t];return 1===t.length?n?c[0]:c[1]:e+" "+a.correctGrammaticalCase(e,c)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:a.translate,m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:"dan",dd:a.translate,M:"mjesec",MM:a.translate,y:"godinu",yy:a.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var a=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===a?e+"-ви":2===a?e+"-ри":7===a||8===a?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,a){return 12===e&&(e=0),"രാത്രി"===a&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===a||"വൈകുന്നേരം"===a?e+12:e},meridiem:function(e,a,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){switch(n){case"s":return a?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(a?" секунд":" секундын");case"m":case"mm":return e+(a?" минут":" минутын");case"h":case"hh":return e+(a?" цаг":" цагийн");case"d":case"dd":return e+(a?" өдөр":" өдрийн");case"M":case"MM":return e+(a?" сар":" сарын");case"y":case"yy":return e+(a?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,a,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function t(e,a,n,t){var c="";if(a)switch(n){case"s":c="काही सेकंद";break;case"ss":c="%d सेकंद";break;case"m":c="एक मिनिट";break;case"mm":c="%d मिनिटे";break;case"h":c="एक तास";break;case"hh":c="%d तास";break;case"d":c="एक दिवस";break;case"dd":c="%d दिवस";break;case"M":c="एक महिना";break;case"MM":c="%d महिने";break;case"y":c="एक वर्ष";break;case"yy":c="%d वर्षे"}else switch(n){case"s":c="काही सेकंदां";break;case"ss":c="%d सेकंदां";break;case"m":c="एका मिनिटा";break;case"mm":c="%d मिनिटां";break;case"h":c="एका तासा";break;case"hh":c="%d तासां";break;case"d":c="एका दिवसा";break;case"dd":c="%d दिवसां";break;case"M":c="एका महिन्या";break;case"MM":c="%d महिन्यां";break;case"y":c="एका वर्षा";break;case"yy":c="%d वर्षां"}return c.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात्री"===a?e<4?e:e+12:"सकाळी"===a?e:"दुपारी"===a?e>=10?e:e+12:"सायंकाळी"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e>=11?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e>=11?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,a){return 12===e&&(e=0),"राति"===a?e<4?e:e+12:"बिहान"===a?e:"दिउँसो"===a?e>=10?e:e+12:"साँझ"===a?e+12:void 0},meridiem:function(e,a,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),t=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],c=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,t){return e?/-MMM-/.test(t)?n[e.month()]:a[e.month()]:a},monthsRegex:c,monthsShortRegex:c,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),t=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],c=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,t){return e?/-MMM-/.test(t)?n[e.month()]:a[e.month()]:a},monthsRegex:c,monthsShortRegex:c,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:t,longMonthsParse:t,shortMonthsParse:t,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,a){return 12===e&&(e=0),"ਰਾਤ"===a?e<4?e:e+12:"ਸਵੇਰ"===a?e:"ਦੁਪਹਿਰ"===a?e>=10?e:e+12:"ਸ਼ਾਮ"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function t(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function c(e,a,n){var c=e+" ";switch(n){case"ss":return c+(t(e)?"sekundy":"sekund");case"m":return a?"minuta":"minutę";case"mm":return c+(t(e)?"minuty":"minut");case"h":return a?"godzina":"godzinę";case"hh":return c+(t(e)?"godziny":"godzin");case"MM":return c+(t(e)?"miesiące":"miesięcy");case"yy":return c+(t(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,t){return e?""===t?"("+n[e.month()]+"|"+a[e.month()]+")":/D MMMM/.test(t)?n[e.month()]:a[e.month()]:a},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:c,m:c,mm:c,h:c,hh:c,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:c,y:"rok",yy:c},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº"})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){var t=" ";return(e%100>=20||e>=100&&e%100==0)&&(t=" de "),e+t+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:a,m:"un minut",mm:a,h:"o oră",hh:a,d:"o zi",dd:a,M:"o lună",MM:a,y:"un an",yy:a},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){var t,c;return"m"===n?a?"минута":"минуту":e+" "+(t=+e,c={ss:a?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:a?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),t%10==1&&t%100!=11?c[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?c[1]:c[2])}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:a,m:a,mm:a,h:"час",hh:a,d:"день",dd:a,M:"месяц",MM:a,y:"год",yy:a},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,a,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:a,monthsShort:a,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,a,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,a,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function t(e){return e>1&&e<5}function c(e,a,n,c){var M=e+" ";switch(n){case"s":return a||c?"pár sekúnd":"pár sekundami";case"ss":return a||c?M+(t(e)?"sekundy":"sekúnd"):M+"sekundami";case"m":return a?"minúta":c?"minútu":"minútou";case"mm":return a||c?M+(t(e)?"minúty":"minút"):M+"minútami";case"h":return a?"hodina":c?"hodinu":"hodinou";case"hh":return a||c?M+(t(e)?"hodiny":"hodín"):M+"hodinami";case"d":return a||c?"deň":"dňom";case"dd":return a||c?M+(t(e)?"dni":"dní"):M+"dňami";case"M":return a||c?"mesiac":"mesiacom";case"MM":return a||c?M+(t(e)?"mesiace":"mesiacov"):M+"mesiacmi";case"y":return a||c?"rok":"rokom";case"yy":return a||c?M+(t(e)?"roky":"rokov"):M+"rokmi"}}e.defineLocale("sk",{months:a,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:c,ss:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c=e+" ";switch(n){case"s":return a||t?"nekaj sekund":"nekaj sekundami";case"ss":return c+=1===e?a?"sekundo":"sekundi":2===e?a||t?"sekundi":"sekundah":e<5?a||t?"sekunde":"sekundah":"sekund";case"m":return a?"ena minuta":"eno minuto";case"mm":return c+=1===e?a?"minuta":"minuto":2===e?a||t?"minuti":"minutama":e<5?a||t?"minute":"minutami":a||t?"minut":"minutami";case"h":return a?"ena ura":"eno uro";case"hh":return c+=1===e?a?"ura":"uro":2===e?a||t?"uri":"urama":e<5?a||t?"ure":"urami":a||t?"ur":"urami";case"d":return a||t?"en dan":"enim dnem";case"dd":return c+=1===e?a||t?"dan":"dnem":2===e?a||t?"dni":"dnevoma":a||t?"dni":"dnevi";case"M":return a||t?"en mesec":"enim mesecem";case"MM":return c+=1===e?a||t?"mesec":"mesecem":2===e?a||t?"meseca":"mesecema":e<5?a||t?"mesece":"meseci":a||t?"mesecev":"meseci";case"y":return a||t?"eno leto":"enim letom";case"yy":return c+=1===e?a||t?"leto":"letom":2===e?a||t?"leti":"letoma":e<5?a||t?"leta":"leti":a||t?"let":"leti"}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,a,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,n,t){var c=a.words[t];return 1===t.length?n?c[0]:c[1]:e+" "+a.correctGrammaticalCase(e,c)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:a.translate,m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:"dan",dd:a.translate,M:"mesec",MM:a.translate,y:"godinu",yy:a.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,n,t){var c=a.words[t];return 1===t.length?n?c[0]:c[1]:e+" "+a.correctGrammaticalCase(e,c)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:a.translate,m:a.translate,mm:a.translate,h:a.translate,hh:a.translate,d:"дан",dd:a.translate,M:"месец",MM:a.translate,y:"годину",yy:a.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,a,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,a){return 12===e&&(e=0),"ekuseni"===a?e:"emini"===a?e>=11?e:e+12:"entsambama"===a||"ebusuku"===a?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"e":1===a||2===a?"a":"e")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return a[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,a,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,a){return 12===e&&(e=0),"யாமம்"===a?e<2?e:e+12:"வைகறை"===a||"காலை"===a||"நண்பகல்"===a&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,a){return 12===e&&(e=0),"రాత్రి"===a?e<4?e:e+12:"ఉదయం"===a?e:"మధ్యాహ్నం"===a?e>=10?e:e+12:"సాయంత్రం"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",ss:"minutu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Пагоҳ соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,a){return 12===e&&(e=0),"шаб"===a?e<4?e:e+12:"субҳ"===a?e:"рӯз"===a?e>=11?e:e+12:"бегоҳ"===a?e+12:void 0},meridiem:function(e,a,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(a[e]||a[e%10]||a[e>=100?100:null])},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,a,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,t,c){var M=function(e){var n=Math.floor(e%1e3/100),t=Math.floor(e%100/10),c=e%10,M="";return n>0&&(M+=a[n]+"vatlh"),t>0&&(M+=(""!==M?" ":"")+a[t]+"maH"),c>0&&(M+=(""!==M?" ":"")+a[c]),""===M?"pagh":M}(e);switch(t){case"ss":return M+" lup";case"mm":return M+" tup";case"hh":return M+" rep";case"dd":return M+" jaj";case"MM":return M+" jar";case"yy":return M+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var a=e;return a=-1!==e.indexOf("jaj")?a.slice(0,-3)+"leS":-1!==e.indexOf("jar")?a.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?a.slice(0,-3)+"nem":a+" pIq"},past:function(e){var a=e;return a=-1!==e.indexOf("jaj")?a.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?a.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?a.slice(0,-3)+"ben":a+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";var a={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var t=e%10;return e+(a[t]||a[e%100-t]||a[e>=100?100:null])}},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n,t){var c={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return t||a?c[n][0]:c[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,a,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,a){return 12===e&&(e=0),"يېرىم كېچە"===a||"سەھەر"===a||"چۈشتىن بۇرۇن"===a?e:"چۈشتىن كېيىن"===a||"كەچ"===a?e+12:e>=11?e:e+12},meridiem:function(e,a,n){var t=100*e+a;return t<600?"يېرىم كېچە":t<900?"سەھەر":t<1130?"چۈشتىن بۇرۇن":t<1230?"چۈش":t<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";function a(e,a,n){var t,c;return"m"===n?a?"хвилина":"хвилину":"h"===n?a?"година":"годину":e+" "+(t=+e,c={ss:a?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:a?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:a?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),t%10==1&&t%100!=11?c[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?c[1]:c[2])}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,a){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(a)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(a)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:a,m:a,mm:a,h:"годину",hh:a,d:"день",dd:a,M:"місяць",MM:a,y:"рік",yy:a},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,a,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";var a=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:a,monthsShort:a,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,a,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,a,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,a){return 12===e&&(e=0),"凌晨"===a||"早上"===a||"上午"===a?e:"下午"===a||"晚上"===a?e+12:e>=11?e:e+12},meridiem:function(e,a,n){var t=100*e+a;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,a){return 12===e&&(e=0),"凌晨"===a||"早上"===a||"上午"===a?e:"中午"===a?e>=11?e:e+12:"下午"===a||"晚上"===a?e+12:void 0},meridiem:function(e,a,n){var t=100*e+a;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(0))},function(e,a,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,a){return 12===e&&(e=0),"凌晨"===a||"早上"===a||"上午"===a?e:"中午"===a?e>=11?e:e+12:"下午"===a||"晚上"===a?e+12:void 0},meridiem:function(e,a,n){var t=100*e+a;return t<600?"凌晨":t<900?"早上":t<1130?"上午":t<1230?"中午":t<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(0))},function(e,a,n){var t,c,M;//! moment-timezone.js +//! version : 0.5.28 +//! Copyright (c) JS Foundation and other contributors +//! license : MIT +//! github.com/moment/moment-timezone +!function(s,o){"use strict";e.exports?e.exports=o(n(0)):(c=[n(0)],void 0===(M="function"==typeof(t=o)?t.apply(a,c):t)||(e.exports=M))}(0,(function(e){"use strict";var a,n={},t={},c={},M={},s={};e&&"string"==typeof e.version||q("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");var o=e.version.split("."),i=+o[0],r=+o[1];function d(e){return e>96?e-87:e>64?e-29:e-48}function _(e){var a=0,n=e.split("."),t=n[0],c=n[1]||"",M=1,s=0,o=1;for(45===e.charCodeAt(0)&&(a=1,o=-1);a3){var a=M[y(e)];if(a)return a;q("Moment Timezone found "+e+" from the Intl api, but did not have that data loaded.")}}catch(e){}var n,t,c,s=function(){var e,a,n,t=(new Date).getFullYear()-2,c=new b(new Date(t,0,1)),M=[c];for(n=1;n<48;n++)(a=new b(new Date(t,n,1))).offset!==c.offset&&(e=f(c,a),M.push(e),M.push(new b(new Date(e.at+6e4)))),c=a;for(n=0;n<4;n++)M.push(new b(new Date(t+n,0,1))),M.push(new b(new Date(t+n,6,1)));return M}(),o=s.length,i=Y(s),r=[];for(t=0;t0?r[0].zone.name:void 0}function y(e){return(e||"").toLowerCase().replace(/\//g,"_")}function O(e){var a,t,c,s;for("string"==typeof e&&(e=[e]),a=0;a= 2.6.0. You are using Moment.js "+e.version+". See momentjs.com"),p.prototype={_set:function(e){this.name=e.name,this.abbrs=e.abbrs,this.untils=e.untils,this.offsets=e.offsets,this.population=e.population},_index:function(e){var a,n=+e,t=this.untils;for(a=0;at&&N.moveInvalidForward&&(a=t),M0&&(this._z=null),g.apply(this,arguments)}),e.tz.setDefault=function(a){return(i<2||2===i&&r<9)&&q("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js "+e.version+"."),e.defaultZone=a?D(a):null,e};var B=e.momentProperties;return"[object Array]"===Object.prototype.toString.call(B)?(B.push("_z"),B.push("_a")):B&&(B._z=null),e}))},function(e,a){e.exports=__webpack_require__(97478)},function(e,a){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,a,n){var t={"./af":4,"./af.js":4,"./ar":5,"./ar-dz":6,"./ar-dz.js":6,"./ar-kw":7,"./ar-kw.js":7,"./ar-ly":8,"./ar-ly.js":8,"./ar-ma":9,"./ar-ma.js":9,"./ar-sa":10,"./ar-sa.js":10,"./ar-tn":11,"./ar-tn.js":11,"./ar.js":5,"./az":12,"./az.js":12,"./be":13,"./be.js":13,"./bg":14,"./bg.js":14,"./bm":15,"./bm.js":15,"./bn":16,"./bn.js":16,"./bo":17,"./bo.js":17,"./br":18,"./br.js":18,"./bs":19,"./bs.js":19,"./ca":20,"./ca.js":20,"./cs":21,"./cs.js":21,"./cv":22,"./cv.js":22,"./cy":23,"./cy.js":23,"./da":24,"./da.js":24,"./de":25,"./de-at":26,"./de-at.js":26,"./de-ch":27,"./de-ch.js":27,"./de.js":25,"./dv":28,"./dv.js":28,"./el":29,"./el.js":29,"./en-SG":30,"./en-SG.js":30,"./en-au":31,"./en-au.js":31,"./en-ca":32,"./en-ca.js":32,"./en-gb":33,"./en-gb.js":33,"./en-ie":34,"./en-ie.js":34,"./en-il":35,"./en-il.js":35,"./en-nz":36,"./en-nz.js":36,"./eo":37,"./eo.js":37,"./es":38,"./es-do":39,"./es-do.js":39,"./es-us":40,"./es-us.js":40,"./es.js":38,"./et":41,"./et.js":41,"./eu":42,"./eu.js":42,"./fa":43,"./fa.js":43,"./fi":44,"./fi.js":44,"./fo":45,"./fo.js":45,"./fr":46,"./fr-ca":47,"./fr-ca.js":47,"./fr-ch":48,"./fr-ch.js":48,"./fr.js":46,"./fy":49,"./fy.js":49,"./ga":50,"./ga.js":50,"./gd":51,"./gd.js":51,"./gl":52,"./gl.js":52,"./gom-latn":53,"./gom-latn.js":53,"./gu":54,"./gu.js":54,"./he":55,"./he.js":55,"./hi":56,"./hi.js":56,"./hr":57,"./hr.js":57,"./hu":58,"./hu.js":58,"./hy-am":59,"./hy-am.js":59,"./id":60,"./id.js":60,"./is":61,"./is.js":61,"./it":62,"./it-ch":63,"./it-ch.js":63,"./it.js":62,"./ja":64,"./ja.js":64,"./jv":65,"./jv.js":65,"./ka":66,"./ka.js":66,"./kk":67,"./kk.js":67,"./km":68,"./km.js":68,"./kn":69,"./kn.js":69,"./ko":70,"./ko.js":70,"./ku":71,"./ku.js":71,"./ky":72,"./ky.js":72,"./lb":73,"./lb.js":73,"./lo":74,"./lo.js":74,"./lt":75,"./lt.js":75,"./lv":76,"./lv.js":76,"./me":77,"./me.js":77,"./mi":78,"./mi.js":78,"./mk":79,"./mk.js":79,"./ml":80,"./ml.js":80,"./mn":81,"./mn.js":81,"./mr":82,"./mr.js":82,"./ms":83,"./ms-my":84,"./ms-my.js":84,"./ms.js":83,"./mt":85,"./mt.js":85,"./my":86,"./my.js":86,"./nb":87,"./nb.js":87,"./ne":88,"./ne.js":88,"./nl":89,"./nl-be":90,"./nl-be.js":90,"./nl.js":89,"./nn":91,"./nn.js":91,"./pa-in":92,"./pa-in.js":92,"./pl":93,"./pl.js":93,"./pt":94,"./pt-br":95,"./pt-br.js":95,"./pt.js":94,"./ro":96,"./ro.js":96,"./ru":97,"./ru.js":97,"./sd":98,"./sd.js":98,"./se":99,"./se.js":99,"./si":100,"./si.js":100,"./sk":101,"./sk.js":101,"./sl":102,"./sl.js":102,"./sq":103,"./sq.js":103,"./sr":104,"./sr-cyrl":105,"./sr-cyrl.js":105,"./sr.js":104,"./ss":106,"./ss.js":106,"./sv":107,"./sv.js":107,"./sw":108,"./sw.js":108,"./ta":109,"./ta.js":109,"./te":110,"./te.js":110,"./tet":111,"./tet.js":111,"./tg":112,"./tg.js":112,"./th":113,"./th.js":113,"./tl-ph":114,"./tl-ph.js":114,"./tlh":115,"./tlh.js":115,"./tr":116,"./tr.js":116,"./tzl":117,"./tzl.js":117,"./tzm":118,"./tzm-latn":119,"./tzm-latn.js":119,"./tzm.js":118,"./ug-cn":120,"./ug-cn.js":120,"./uk":121,"./uk.js":121,"./ur":122,"./ur.js":122,"./uz":123,"./uz-latn":124,"./uz-latn.js":124,"./uz.js":123,"./vi":125,"./vi.js":125,"./x-pseudo":126,"./x-pseudo.js":126,"./yo":127,"./yo.js":127,"./zh-cn":128,"./zh-cn.js":128,"./zh-hk":129,"./zh-hk.js":129,"./zh-tw":130,"./zh-tw.js":130};function c(e){var a=M(e);return n(a)}function M(e){if(!n.o(t,e)){var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}return t[e]}c.keys=function(){return Object.keys(t)},c.resolve=M,e.exports=c,c.id=134},function(e,a,n){var t,c,M;//! moment-timezone-utils.js +//! version : 0.5.28 +//! Copyright (c) JS Foundation and other contributors +//! license : MIT +//! github.com/moment/moment-timezone +!function(s,o){"use strict";e.exports?e.exports=o(n(136)):(c=[n(0)],void 0===(M="function"==typeof(t=o)?t.apply(a,c):t)||(e.exports=M))}(0,(function(e){"use strict";if(!e.tz)throw new Error("moment-timezone-utils.js must be loaded after moment-timezone.js");var a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX";function n(e,n){for(var t="",c=Math.abs(e),M=Math.floor(c),s=function(e,n){for(var t,c=".",M="";n>0;)n-=1,e*=60,t=Math.floor(e+1e-6),c+=a[t],e-=t,t&&(M+=c,c="");return M}(c-M,Math.min(~~n,10));M>0;)t=a[M%60]+t,M=Math.floor(M/60);return e<0&&(t="-"+t),t&&s?t+s:(s||"-"!==t)&&(t||s)||"0"}function t(e){var a,t=[],c=0;for(a=0;ao.population||s.population===o.population&&t&&t[s.name]?i.unshift(s):i.push(s),d=!0);d||_.push([s])}for(c=0;c<_.length;c++)for(i=_[c],a.push(i[0]),M=1;Mn&&(c=a,a=n,n=c),c=0;cn&&(s=Math.min(s,c+1)));return[M,s]}(e.untils,a,n),M=t.apply(e.untils,c);return M[M.length-1]=null,{name:e.name,abbrs:t.apply(e.abbrs,c),untils:M,offsets:t.apply(e.offsets,c),population:e.population,countries:e.countries}}return e.tz.pack=s,e.tz.packBase60=n,e.tz.createLinks=d,e.tz.filterYears=_,e.tz.filterLinkPack=function(e,a,n,t){var c,M,i=e.zones,r=[];for(c=0;c-1){var s=a.format(t[n]);return c="".concat(c.substring(0,M),"[").concat(s,"]").concat(c.substring(M+n.length)),!0}return!1})),this.format(c)};a.default=c.a}]); + +/***/ }), + +/***/ 78817: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 30); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(20259); + +/***/ }), + +/***/ 30: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3867__) { + +"use strict"; +__nested_webpack_require_3867__.r(__nested_webpack_exports__); +/* harmony export (binding) */ __nested_webpack_require_3867__.d(__nested_webpack_exports__, "default", function() { return Cancel; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3867__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3867__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3867__(1); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3867__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_icons_Clear__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3867__(4); +/* harmony import */ var _splunk_react_icons_Clear__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3867__.n(_splunk_react_icons_Clear__WEBPACK_IMPORTED_MODULE_2__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + +function Cancel(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_icons_Clear__WEBPACK_IMPORTED_MODULE_2___default.a, _extends({ + screenReaderText: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__["_"])('Cancel') + }, props)); +} + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7602); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 7602: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 50); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(20259); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(6844); + +/***/ }), + +/***/ 50: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3985__) { + +"use strict"; +__nested_webpack_require_3985__.r(__nested_webpack_exports__); +/* harmony export (binding) */ __nested_webpack_require_3985__.d(__nested_webpack_exports__, "default", function() { return Clear; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3985__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3985__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3985__(1); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3985__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3985__(2); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3985__.n(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + +/* eslint-disable max-len */ + +function Clear(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default.a, _extends({ + screenReaderText: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__["_"])('Clear') + }, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("path", { + d: "M918.315 750.645L1500 1332.33 1332.33 1500 750.645 918.315 167.67 1500 0 1332.33l581.685-582.975L0 167.67 167.67 0l582.975 581.685L1332.33 0 1500 167.67" + })); +} + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 2892: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 80); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(20259); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(6844); + +/***/ }), + +/***/ 80: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3985__) { + +"use strict"; +__nested_webpack_require_3985__.r(__nested_webpack_exports__); +/* harmony export (binding) */ __nested_webpack_require_3985__.d(__nested_webpack_exports__, "default", function() { return Gear; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3985__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3985__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3985__(1); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3985__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3985__(2); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3985__.n(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + +/* eslint-disable max-len */ + +function Gear(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default.a, _extends({ + screenReaderText: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__["_"])('Gear') + }, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("path", { + d: "M1316.096 890.753l167.466-47.26c8.22 0 16.438-11.3 16.438-19.52V676.027c0-8.22-8.22-19.52-16.438-19.52l-167.466-47.26c-7.192 0-19.52-11.302-19.52-19.52L1250.34 476.71c-4.11-8.22-4.11-19.52 0-27.74l85.274-152.054c4.11-8.22 4.11-19.52-4.11-23.63l-104.794-104.795c-4.11-8.22-15.41-8.22-23.63-4.11l-152.055 85.275c-8.22 4.11-19.52 4.11-27.74 0l-113.013-46.233c-8.22 0-19.52-12.33-19.52-19.52l-47.26-167.467C843.493 8.218 832.19 0 823.973 0H676.026c-8.22 0-19.52 8.22-19.52 16.438l-47.26 167.466c0 7.192-11.302 19.52-19.52 19.52l-117.124 50.343c-7.192 4.11-19.52 4.11-27.74 0l-147.945-89.383c-8.22-4.11-19.52-4.11-23.63 4.11L168.493 273.287c-8.22 4.11-8.22 15.41-4.11 23.63l89.384 147.945c4.11 8.22 4.11 20.548 0 27.74l-50.342 121.233c-4.11 8.22-12.33 19.52-19.52 19.52l-167.467 43.15C8.218 659.59 0 667.81 0 676.027v147.947c0 8.22 8.22 16.438 16.438 19.52l167.466 43.15c7.192 0 15.41 11.302 19.52 19.52l50.343 121.234c4.11 7.192 4.11 19.52 0 27.74l-89.383 147.945c-4.11 8.22-4.11 19.52 4.11 23.63l104.794 104.795c4.11 8.22 15.41 8.22 23.63 4.11l147.945-89.384c8.22-4.11 20.548-4.11 27.74 0l121.233 50.342c8.22 4.11 19.52 12.33 19.52 19.52l43.15 167.467c3.083 8.22 11.302 16.438 19.52 16.438h147.947c8.22 0 19.52-8.22 19.52-16.438l43.15-167.466c0-7.192 11.302-15.41 19.52-19.52l117.125-46.234c8.22-4.11 19.52-4.11 27.74 0l152.054 85.274c8.22 4.11 19.52 4.11 23.63-4.11l104.795-104.794c8.22-4.11 8.22-15.41 4.11-23.63l-85.275-152.055c-4.11-8.22-4.11-19.52 0-27.74l46.233-113.013c0-8.22 12.33-19.52 19.52-19.52zM750 1050c-162.33 0-300-137.67-300-300s137.67-300 300-300 300 137.67 300 300-137.67 300-300 300z" + })); +} + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 49331: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 87); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(20259); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(6844); + +/***/ }), + +/***/ 87: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3985__) { + +"use strict"; +__nested_webpack_require_3985__.r(__nested_webpack_exports__); +/* harmony export (binding) */ __nested_webpack_require_3985__.d(__nested_webpack_exports__, "default", function() { return InfoCircle; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3985__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3985__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3985__(1); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3985__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3985__(2); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3985__.n(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + +/* eslint-disable max-len */ + +function InfoCircle(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default.a, _extends({ + screenReaderText: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__["_"])('Info Circle') + }, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("path", { + d: "M843.75 750v-93.75H562.5V750h93.75v281.25H562.5V1125h375v-93.75h-93.75V750zM750 1500C335.786 1500 0 1164.214 0 750S335.786 0 750 0s750 335.786 750 750-335.786 750-750 750zm0-937.5c51.777 0 93.75-41.973 93.75-93.75S801.777 375 750 375s-93.75 41.973-93.75 93.75S698.223 562.5 750 562.5z" + })); +} + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 24509: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 137); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 137: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3761__) { + +"use strict"; +__nested_webpack_require_3761__.r(__nested_webpack_exports__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3761__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3761__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3761__(3); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3761__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3761__(6); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3761__.n(lodash__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3761__(5); +/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3761__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +var InlineSVG = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.svg.withConfig({ + displayName: "SVG__InlineSVG", + componentId: "sc-13m0oii-0" +})(["display:inline-block;flex:0 0 auto;overflow:visible;vertical-align:middle;"]); +var BlockSVG = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.svg.withConfig({ + displayName: "SVG__BlockSVG", + componentId: "sc-13m0oii-1" +})(["display:block;flex:0 0 auto;margin:0 auto;overflow:visible;"]); +var viewBoxRegex = /-?\d.?\d* -?\d+.?\d* \d+.?\d* \d+.?\d*/; +var propTypes = { + children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, + height: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), + hideDefaultTooltip: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + inline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + screenReaderText: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['null'])]), + size: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), + width: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]), + viewBox: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, + preserveAspectRatio: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['none', 'xMinYMin', 'xMidYMin', 'xMaxYMin', 'xMinYMid', 'xMidYMid', 'xMaxYMid', 'xMinYMax', 'xMidYMax', 'xMaxYMax']) +}; + +function SVG(_ref) { + var children = _ref.children, + height = _ref.height, + _ref$hideDefaultToolt = _ref.hideDefaultTooltip, + hideDefaultTooltip = _ref$hideDefaultToolt === void 0 ? false : _ref$hideDefaultToolt, + _ref$inline = _ref.inline, + inline = _ref$inline === void 0 ? true : _ref$inline, + _ref$preserveAspectRa = _ref.preserveAspectRatio, + preserveAspectRatio = _ref$preserveAspectRa === void 0 ? 'xMidYMid' : _ref$preserveAspectRa, + screenReaderText = _ref.screenReaderText, + _ref$size = _ref.size, + size = _ref$size === void 0 ? 0.75 : _ref$size, + viewBox = _ref.viewBox, + width = _ref.width, + otherProps = _objectWithoutProperties(_ref, ["children", "height", "hideDefaultTooltip", "inline", "preserveAspectRatio", "screenReaderText", "size", "viewBox", "width"]); + + // @docs-props-type SVGPropsBase + if (false) {} + + var sizeValue = typeof size !== 'number' ? parseFloat(size) : size; + var sizeUnit = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(size) ? size.match(/[^\d]+/) : 'em'; + var vbHeight = parseFloat(viewBox.split(' ')[3]); + var vbWidth = parseFloat(viewBox.split(' ')[2]); + var maxDimension = Math.max(vbWidth, vbHeight); + var cHeight = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(height) ? vbHeight / maxDimension * sizeValue : height; + var cWidth = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(width) ? vbWidth / maxDimension * sizeValue : width; + var SVGElement = inline ? InlineSVG : BlockSVG; + var renderTitle = screenReaderText && !hideDefaultTooltip; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(SVGElement, _extends({ + focusable: "false", + height: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(cHeight) ? cHeight : "".concat(cHeight.toFixed(4)).concat(sizeUnit), + width: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(cWidth) ? cWidth : "".concat(cWidth.toFixed(4)).concat(sizeUnit), + viewBox: viewBox, + "aria-label": hideDefaultTooltip ? screenReaderText !== null && screenReaderText !== void 0 ? screenReaderText : undefined : undefined, + "aria-hidden": !screenReaderText, + preserveAspectRatio: preserveAspectRatio, + xmlns: "http://www.w3.org/2000/svg" + }, otherProps), renderTitle && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("title", null, screenReaderText), children); +} + +SVG.propTypes = propTypes; +/* harmony default export */ __nested_webpack_exports__["default"] = (SVG); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(2543); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 6844: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 138); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 13: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(24509); + +/***/ }), + +/***/ 138: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3872__) { + +"use strict"; +__nested_webpack_require_3872__.r(__nested_webpack_exports__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3872__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3872__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3872__(3); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3872__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3872__(5); +/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3872__.n(styled_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _splunk_react_icons_SVG__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_3872__(13); +/* harmony import */ var _splunk_react_icons_SVG__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_3872__.n(_splunk_react_icons_SVG__WEBPACK_IMPORTED_MODULE_3__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +var StyledSVG = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_splunk_react_icons_SVG__WEBPACK_IMPORTED_MODULE_3___default.a).withConfig({ + displayName: "SVGInternal__StyledSVG", + componentId: "ksy9g7-0" +})(["circle,ellipse,path,polygon,rect{fill:currentColor;}"]); +var propTypes = { + viewBox: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string +}; + +function SVGInternal(_ref) { + var _ref$viewBox = _ref.viewBox, + viewBox = _ref$viewBox === void 0 ? '0 0 1500 1500' : _ref$viewBox, + otherProps = _objectWithoutProperties(_ref, ["viewBox"]); + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(StyledSVG, _extends({ + viewBox: viewBox + }, otherProps)); +} + +SVGInternal.propTypes = propTypes; +/* harmony default export */ __nested_webpack_exports__["default"] = (SVGInternal); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 95031: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 172); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(20259); + +/***/ }), + +/***/ 172: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3869__) { + +"use strict"; +__nested_webpack_require_3869__.r(__nested_webpack_exports__); +/* harmony export (binding) */ __nested_webpack_require_3869__.d(__nested_webpack_exports__, "default", function() { return Warning; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3869__(0); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_3869__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_3869__(1); +/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_3869__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_3869__(2); +/* harmony import */ var _splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_3869__.n(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2__); +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + +/* eslint-disable max-len */ + +function Warning(props) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_icons_SVGInternal__WEBPACK_IMPORTED_MODULE_2___default.a, _extends({ + screenReaderText: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__["_"])('Warning'), + viewBox: "0 0 1500 1313" + }, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("path", { + d: "M.956 1196.326l668.58-1144.89C689.395 17.736 718.71 0 749.916 0c31.207 0 59.577 15.963 80.382 51.436l668.58 1144.89c7.565 12.416-23.642 116.174-77.544 116.174H85.474c-53.902 0-92.083-102.872-84.518-116.174zm643.333-684.743l32.146 257.167c4.908 39.264 34.086 74.685 69.815 91.187 36.612-16.018 64.87-50.826 69.914-91.187l32.146-257.167C855.18 456.623 815.582 411 759.7 411h-26.8c-55.908 0-95.555 45.033-88.61 100.583zm101.294 644.209c63.283 0 114.584-51.301 114.584-114.584 0-63.282-51.301-114.583-114.584-114.583-63.282 0-114.583 51.3-114.583 114.583s51.3 114.584 114.583 114.584z" + })); +} + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(6844); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 12348: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 12); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(78967); + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40961); + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(78598); + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(62491); + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70564); + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(69211); + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(23910); + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(20259); + +/***/ }), +/* 12 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4914__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4914__.r(__nested_webpack_exports__); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4914__(0); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4914__.n(external_react_); + +// EXTERNAL MODULE: external "react-dom" +var external_react_dom_ = __nested_webpack_require_4914__(3); + +// EXTERNAL MODULE: external "scriptjs" +var external_scriptjs_ = __nested_webpack_require_4914__(6); +var external_scriptjs_default = /*#__PURE__*/__nested_webpack_require_4914__.n(external_scriptjs_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Layer" +var Layer_ = __nested_webpack_require_4914__(7); + +// EXTERNAL MODULE: external "@splunk/splunk-utils/url" +var url_ = __nested_webpack_require_4914__(8); + +// EXTERNAL MODULE: external "@splunk/themes/SplunkThemeProvider" +var SplunkThemeProvider_ = __nested_webpack_require_4914__(9); +var SplunkThemeProvider_default = /*#__PURE__*/__nested_webpack_require_4914__.n(SplunkThemeProvider_); + +// EXTERNAL MODULE: external "@splunk/splunk-utils/themes" +var themes_ = __nested_webpack_require_4914__(5); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4914__(4); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4914__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4914__(10); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4914__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4914__(11); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4914__(2); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4914__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var external_splunk_themes_ = __nested_webpack_require_4914__(1); + +// CONCATENATED MODULE: ./src/LoadingStyles.js +function _templateObject6() { + var data = _taggedTemplateLiteral(["\n animation-name: ", ";\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n background-color: ", ";\n width: 10px;\n height: 10px;\n border-radius: 5px;\n display: inline-block;\n margin-right: ", ";\n\n &:nth-child(2) {\n animation-delay: 0.2s;\n }\n\n &:nth-child(3) {\n animation-delay: 0.4s;\n }\n"]); + + _templateObject6 = function _templateObject6() { + return data; + }; + + return data; +} + +function _templateObject5() { + var data = _taggedTemplateLiteral(["\n color: ", ";\n padding-top: 30vh;\n text-align: center;\n min-height: 400px;\n"]); + + _templateObject5 = function _templateObject5() { + return data; + }; + + return data; +} + +function _templateObject4() { + var data = _taggedTemplateLiteral(["\n background-color: ", ";\n min-height: 44px;\n"]); + + _templateObject4 = function _templateObject4() { + return data; + }; + + return data; +} + +function _templateObject3() { + var data = _taggedTemplateLiteral(["\n padding: 0;\n background-color: ", ";\n height: 34px;\n"]); + + _templateObject3 = function _templateObject3() { + return data; + }; + + return data; +} + +function _templateObject2() { + var data = _taggedTemplateLiteral(["\n background-color: ", ";\n position: fixed;\n opacity: 1;\n z-index: 10000;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n"]); + + _templateObject2 = function _templateObject2() { + return data; + }; + + return data; +} + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n 0% {\n opacity: 0.2;\n }\n\n 20% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.2;\n }\n"]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + + + +var blink = Object(external_styled_components_["keyframes"])(_templateObject()); +var Main = external_styled_components_default.a.div(_templateObject2(), external_splunk_themes_["variables"].backgroundColorPage); +var SplunkBar = external_styled_components_default.a.div(_templateObject3(), Object(external_splunk_themes_["pick"])({ + prisma: external_splunk_themes_["variables"].backgroundColorSection, + enterprise: external_splunk_themes_["variables"].gray20 +})); +var AppBar = external_styled_components_default.a.div(_templateObject4(), Object(external_splunk_themes_["pick"])({ + prisma: external_splunk_themes_["variables"].backgroundColorPopup, + enterprise: external_splunk_themes_["variables"].gray30 +})); +var AppBody = external_styled_components_default.a.div(_templateObject5(), external_splunk_themes_["variables"].contentColorInverted); +var Dot = external_styled_components_default.a.div(_templateObject6(), blink, external_splunk_themes_["variables"].neutral500, Object(external_splunk_themes_["pick"])({ + prisma: external_splunk_themes_["variables"].spacingMedium, + enterprise: external_splunk_themes_["variables"].spacingHalf +})); + +// CONCATENATED MODULE: ./src/Loading.jsx + + + + + +var propTypes = { + hideAppBar: external_prop_types_default.a.bool, + hideChrome: external_prop_types_default.a.bool, + hideSplunkBar: external_prop_types_default.a.bool +}; +var defaultProps = { + hideAppBar: false, + hideChrome: false, + hideSplunkBar: false +}; + +function Loading(_ref) { + var hideAppBar = _ref.hideAppBar, + hideChrome = _ref.hideChrome, + hideSplunkBar = _ref.hideSplunkBar; + return /*#__PURE__*/external_react_default.a.createElement(Main, null, !hideChrome && !hideSplunkBar && /*#__PURE__*/external_react_default.a.createElement(SplunkBar, null), !hideChrome && !hideAppBar && /*#__PURE__*/external_react_default.a.createElement(AppBar, null), /*#__PURE__*/external_react_default.a.createElement(AppBody, null, /*#__PURE__*/external_react_default.a.createElement(Dot, null), /*#__PURE__*/external_react_default.a.createElement(Dot, null), /*#__PURE__*/external_react_default.a.createElement(Dot, null), /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, Object(i18n_["_"])('Loading')))); +} + +Loading.propTypes = propTypes; +Loading.defaultProps = defaultProps; +/* harmony default export */ var src_Loading = (Loading); +// CONCATENATED MODULE: ./src/index.jsx +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + +/** + * Loads the layout from the server, using requirejs if available on the window and scriptjs if not. + * + * @param {Function} callback - A callback invoked with the layout module once resolved. + * @private + */ + +function getLayoutApi(callback) { + var url = Object(url_["createStaticURL"])('build/api/layout.js'); + + if (window.requirejs) { + window.requirejs([url], callback); + } else { + external_scriptjs_default()(url, function () { + // eslint-disable-next-line no-underscore-dangle + callback(window.__splunk_layout__); + }); + } +} +/** + * Renders a React element into the Layout API. + * @public + * @param {element} element - A React element. + * @param {object} [options] + * @param {string} [options.pageTitle] - Changes the page title. + * @param {Boolean} [options.hideAppBar = false] - Hides the app bar. + * @param {Boolean} [options.hideAppsList = false] - Hides the app list in + * the Splunk bar. + * @param {Boolean} [options.hideChrome = false] - Renders only the main content, hiding + * the Splunk bar, app bar, and footer. + * @param {Boolean} [options.hideFooter = false] - Hides the footer. + * @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar. + * @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars + * to the edge of the page. + * @param {string} [options.loadingThemeOverride] - Allows the theme provided by Splunk Enterprise to the loading screen + * to be overridden with `enterprise` or `enterpriseDark`. + * @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider. + */ + + +function layout(element) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var _ref$useGlobalLayerSt = _ref.useGlobalLayerStack, + useGlobalLayerStack = _ref$useGlobalLayerSt === void 0 ? true : _ref$useGlobalLayerSt, + loadingThemeOverride = _ref.loadingThemeOverride, + pageTitle = _ref.pageTitle, + layoutAPIOptions = _objectWithoutProperties(_ref, ["useGlobalLayerStack", "loadingThemeOverride", "pageTitle"]); + + var loadingContainer = document.createElement('div'); + var loadingTheme = Object(themes_["getThemeOptions"])(loadingThemeOverride || Object(themes_["defaultTheme"])()); + + if (pageTitle) { + document.title = pageTitle; + } + + document.body.appendChild(loadingContainer); + Object(external_react_dom_["render"])( /*#__PURE__*/external_react_default.a.createElement(SplunkThemeProvider_default.a, loadingTheme, /*#__PURE__*/external_react_default.a.createElement(src_Loading, layoutAPIOptions)), loadingContainer); + getLayoutApi(function (layoutApi) { + var containerEl; + + if (layoutApi) { + containerEl = layoutApi.create(layoutAPIOptions).getContainerElement(); + + if (layoutAPIOptions.layout === 'fixed') { + // the above create method adds flex: 1 0 0 + // IE 11 disregards 0px shorthand for flex-basis component. + // flex-basis 0% is better than 0px because css minification can remove px + if (!containerEl.style.flex || containerEl.style.flex === '1 0 0px') { + containerEl.style.flex = '1 0 0%'; + } // all elements in the hierarchy must have 'overflow: hidden' for children + // to support scrolling correctly. + + + if (!containerEl.style.overflow) { + containerEl.style.overflow = 'hidden'; + } // splunk hijacks the width of the body when printing, so we have to force width to the size + // of the viewport so that things print at the correct width + + + if (!containerEl.style.width) { + containerEl.style.width = '100vw'; + } + } + } else { + // eslint-disable-next-line no-console + console.error('Unable to load layout.'); + containerEl = document.createElement('div'); + document.body.appendChild(containerEl); + } + + setTimeout(function () { + Object(external_react_dom_["unmountComponentAtNode"])(loadingContainer); + loadingContainer.parentNode.removeChild(loadingContainer); + var wrappedElement = useGlobalLayerStack ? /*#__PURE__*/external_react_default.a.createElement(Layer_["LayerStackGlobalProvider"], null, element) : element; + Object(external_react_dom_["render"])(wrappedElement, containerEl); + }, 30); + }); +} + +/* harmony default export */ var src = __nested_webpack_exports__["default"] = (layout); + +/***/ }) +/******/ ]); + +/***/ }), + +/***/ 75553: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireDefault(__webpack_require__(96540)); + +var _i18n = __webpack_require__(20259); + +var _AbsoluteValueStyles = __webpack_require__(66079); + +const _excluded = ["error", "displayValue"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/AbsoluteValue.tsx"; + +const AbsoluteValue = props => { + const { + error, + displayValue + } = props, + rest = (0, _objectWithoutProperties2.default)(props, _excluded); + return /*#__PURE__*/_react.default.createElement(_AbsoluteValueStyles.Styled, (0, _extends2.default)({ + "data-test": "absolute-value" + }, rest, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 14, + columnNumber: 9 + } + }), error && (0, _i18n._)('Invalid Value'), !error && displayValue); +}; + +var _default = AbsoluteValue; +exports["default"] = _default; + +/***/ }), + +/***/ 66079: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Styled = void 0; + +var _styledComponents = _interopRequireDefault(__webpack_require__(92568)); + +var _themes = __webpack_require__(61572); + +const Styled = _styledComponents.default.div` + min-height: ${_themes.variables.lineHeight}; + min-width: 100px; + border-radius: ${_themes.variables.borderRadius}; + background-color: ${(0, _themes.pick)({ + enterprise: { + light: _themes.variables.gray96, + dark: _themes.variables.gray22 + }, + prisma: { + light: _themes.variables.neutral100, + dark: _themes.variables.neutral100 + } +})}; + font-size: ${_themes.variables.fontSizeSmall}; + margin-top: 5px; + padding: 0 ${_themes.variables.spacingXSmall}; + color: ${_themes.variables.textGray}; +`; +exports.Styled = Styled; + +/***/ }), + +/***/ 1593: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _lodash = __webpack_require__(2543); + +var _i18n = __webpack_require__(20259); + +var _keyboard = __webpack_require__(4214); + +var _moment = _interopRequireDefault(__webpack_require__(61605)); + +var _time = __webpack_require__(1115); + +var _Button = _interopRequireDefault(__webpack_require__(70181)); + +var _Link = _interopRequireDefault(__webpack_require__(59421)); + +var _Message = _interopRequireDefault(__webpack_require__(57914)); + +var _Text = _interopRequireDefault(__webpack_require__(25338)); + +var _AbsoluteValue = _interopRequireDefault(__webpack_require__(75553)); + +var _Panel = _interopRequireDefault(__webpack_require__(57837)); + +var _Styles = __webpack_require__(12169); + +const _excluded = ["earliest", "latest", "onRequestParseEarliest", "onRequestParseLatest", "onChange", "documentationURL", "parseEarliest", "parseLatest", "momentTimeZoneName", "inputTypes"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/Advanced.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const Advanced = _ref => { + let { + earliest: propsEarliest, + latest: propsLatest, + onRequestParseEarliest, + onRequestParseLatest, + onChange, + documentationURL, + parseEarliest, + parseLatest, + momentTimeZoneName, + inputTypes + } = _ref, + panelProps = (0, _objectWithoutProperties2.default)(_ref, _excluded); + const { + open, + panelId + } = panelProps; + const [earliest, setEarliest] = (0, _react.useState)(propsEarliest); + const [latest, setLatest] = (0, _react.useState)(propsLatest); + const [errorMessage, setErrorMessage] = (0, _react.useState)(null); + const prevEarliest = (0, _react.useRef)(); + const prevLatest = (0, _react.useRef)(); + const prevOpen = (0, _react.useRef)(); + + if (open && !prevOpen.current) { + onRequestParseEarliest(propsEarliest.trim() ? propsEarliest : '0', panelId); + onRequestParseLatest(propsLatest.trim() ? propsLatest : 'now', panelId); + } + + (0, _react.useEffect)(() => { + prevEarliest.current = propsEarliest; + prevLatest.current = propsLatest; + prevOpen.current = open; + }); + + if (prevEarliest.current && propsEarliest !== prevEarliest.current) { + if (open && !prevOpen.current) { + onRequestParseEarliest(propsEarliest, panelId); + } + } + + if (prevLatest.current && propsLatest !== prevLatest.current) { + if (open) { + onRequestParseLatest(propsLatest, panelId); + } + } + + if (open && !prevOpen.current) { + if (earliest !== propsEarliest && (0, _time.isValidTime)(earliest)) { + onRequestParseEarliest(earliest, panelId); + } else { + onRequestParseEarliest(propsEarliest, panelId); + } + + if (latest !== propsLatest && (0, _time.isValidTime)(latest)) { + onRequestParseLatest(latest, panelId); + } else { + onRequestParseLatest(propsLatest, panelId); + } + } + + const handleEarliestChange = (e, { + value + }) => { + setEarliest(previousEarliest => { + const val = value.trim(); + const isValid = (0, _time.isValidTime)(val); + + if (previousEarliest.trim() !== val && isValid) { + onRequestParseEarliest(val || '0', panelId); + } else if (!isValid) { + // if user input invalid value, we need to recover parser value + // so that switch to other panel will not cause issue. + onRequestParseEarliest(propsEarliest, panelId); + } + + return value; + }); + }; + + const handleLatestChange = (e, { + value + }) => { + setLatest(previousLatest => { + const val = value.trim(); + const isValid = (0, _time.isValidTime)(val); + + if (previousLatest.trim() !== val && isValid) { + onRequestParseLatest(val || 'now', panelId); + } else if (!isValid) { + onRequestParseLatest(propsLatest, panelId); + } + + return value; + }); + }; + + const handleApply = e => { + let error = ''; + const ASTEarliest = (0, _time.parseTimeString)(earliest); + const ASTLatest = (0, _time.parseTimeString)(latest); + const absoluteTypes = ['iso', 'epoch']; + + if (!ASTEarliest.isFullyParsed && earliest || _moment.default.tz(parseEarliest.iso, momentTimeZoneName).valueOf() > _moment.default.tz(momentTimeZoneName).valueOf()) { + error = (0, _i18n._)('The earliest time is invalid.'); + } else if (!ASTLatest.isFullyParsed && latest) { + error = (0, _i18n._)('The latest time is invalid.'); + } else if (earliest && earliest === latest) { + error = (0, _i18n._)('You cannot have equivalent times.'); + } else if (!(0, _lodash.includes)(inputTypes, 'relative') && ASTEarliest.type !== 'realTime' && !(0, _lodash.includes)(absoluteTypes, ASTLatest.type)) { + error = (0, _i18n._)('Relative searches are not supported.'); + } else if (!(0, _lodash.includes)(inputTypes, 'relative') && ASTLatest.type !== 'realTime' && ASTLatest.type !== 'epoch' && ASTLatest.type !== 'iso') { + error = (0, _i18n._)('Relative searches are not supported.'); + } else if (!(0, _lodash.includes)(inputTypes, 'realTime') && (ASTLatest.type === 'realTime' || ASTEarliest.type === 'realTime')) { + error = (0, _i18n._)('Real-time searches are not supported.'); + } else if ((ASTLatest.type === 'realTime' || ASTEarliest.type === 'realTime') && ASTLatest.type !== ASTEarliest.type) { + error = (0, _i18n._)('You must set a rt value for both earliest and latest time.'); + } else if (!(0, _lodash.includes)(inputTypes, 'dateTime') && ((0, _lodash.includes)(absoluteTypes, ASTLatest.type) || (0, _lodash.includes)(absoluteTypes, ASTEarliest.type))) { + error = (0, _i18n._)('Epoch and ISO times are not supported.'); + } else if (!(0, _lodash.includes)(inputTypes, 'allTime') && (0, _time.isEarliestEmpty)(earliest) && (0, _time.isLatestNow)(latest)) { + error = (0, _i18n._)('All-time searches are not supported.'); + } else if (parseEarliest.error) { + error = (0, _i18n._)('Earliest could not be validated.'); + } else if (parseLatest.error) { + error = (0, _i18n._)('Latest could not be validated.'); + } else if (_moment.default.tz(parseEarliest.iso, momentTimeZoneName).valueOf() >= _moment.default.tz(parseLatest.iso, momentTimeZoneName).valueOf()) { + error = (0, _i18n._)('Earliest must be before latest.'); + } + + setErrorMessage(error); + + if (!error && onChange) { + onChange(e, { + earliest, + latest + }); + } + }; + + const handleKeydown = e => { + if ((0, _keyboard.keycode)(e) === 'enter') { + handleApply(e); + } + }; + + const earliestParseValid = parseEarliest && Advanced.parseIsValid(earliest, parseEarliest.time, '0'); + const latestParseValid = parseLatest && Advanced.parseIsValid(latest, parseLatest.time, 'now'); + const inputValid = ((0, _time.isValidTime)(earliest) && parseEarliest ? parseEarliest.error === null : false) && ((0, _time.isValidTime)(latest) && parseLatest ? parseLatest.error === null : false); + return /*#__PURE__*/_react.default.createElement(_Panel.default, (0, _extends2.default)({ + title: (0, _i18n._)('Advanced') + }, panelProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 210, + columnNumber: 9 + } + }), errorMessage && /*#__PURE__*/_react.default.createElement(_Message.default, { + type: "error", + "data-test": "error-message", + style: { + margin: '0 20px' + }, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 212, + columnNumber: 17 + } + }, errorMessage), /*#__PURE__*/_react.default.createElement(_Styles.StyledCGWrapper, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 216, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Styles.FlexControlGroup, { + controlsLayout: "none", + label: (0, _i18n._)('Earliest:'), + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 217, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Text.default, { + value: earliest, + "data-test": "earliest", + onChange: handleEarliestChange, + onKeyDown: inputValid ? handleKeydown : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 218, + columnNumber: 21 + } + }), /*#__PURE__*/_react.default.createElement(_AbsoluteValue.default, { + "data-test": "earliest-absolute-value", + error: earliestParseValid ? parseEarliest.error : new Error('invalid'), + displayValue: earliestParseValid ? parseEarliest.displayValue : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 224, + columnNumber: 21 + } + })), /*#__PURE__*/_react.default.createElement(_Styles.FlexControlGroup, { + controlsLayout: "none", + label: (0, _i18n._)('Latest:'), + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 230, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Text.default, { + value: latest, + "data-test": "latest", + onChange: handleLatestChange, + onKeyDown: inputValid ? handleKeydown : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 231, + columnNumber: 21 + } + }), /*#__PURE__*/_react.default.createElement(_AbsoluteValue.default, { + "data-test": "latest-absolute-value", + error: latestParseValid ? parseLatest.error : new Error('invalid'), + displayValue: latestParseValid ? parseLatest.displayValue : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 237, + columnNumber: 21 + } + }))), /*#__PURE__*/_react.default.createElement(_Styles.StyledApplyContainer, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 244, + columnNumber: 13 + } + }, !!documentationURL && /*#__PURE__*/_react.default.createElement(_Link.default, { + to: documentationURL, + style: { + marginRight: 20 + }, + openInNewContext: true, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 246, + columnNumber: 21 + } + }, (0, _i18n._)('Documentation')), /*#__PURE__*/_react.default.createElement(_Button.default, { + disabled: !inputValid, + label: (0, _i18n._)('Apply'), + onClick: handleApply, + "data-test": "apply", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 250, + columnNumber: 17 + } + }))); +}; + +Advanced.defaultProps = { + open: false, + onChange: _lodash.noop, + onRequestParseEarliest: _lodash.noop, + onRequestParseLatest: _lodash.noop +}; + +Advanced.parseIsValid = (stateValue, parseValue, defaultValue) => { + const stateValueCleaned = stateValue.trim() || defaultValue; + return (0, _time.removeRealTime)(stateValueCleaned) === parseValue.trim(); +}; + +var _default = Advanced; +exports["default"] = _default; + +/***/ }), + +/***/ 32662: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _i18n = __webpack_require__(20259); + +var _keyboard = __webpack_require__(4214); + +var _moment = _interopRequireDefault(__webpack_require__(61605)); + +var _time = __webpack_require__(1115); + +var _Button = _interopRequireDefault(__webpack_require__(70181)); + +var _ControlGroup = _interopRequireDefault(__webpack_require__(37801)); + +var _Date = _interopRequireDefault(__webpack_require__(82857)); + +var _Message = _interopRequireDefault(__webpack_require__(57914)); + +var _Select = _interopRequireDefault(__webpack_require__(87149)); + +var _StaticContent = _interopRequireDefault(__webpack_require__(98798)); + +var _Styles = __webpack_require__(12169); + +var _Panel = _interopRequireDefault(__webpack_require__(57837)); + +const _excluded = ["earliest", "latest", "locale", "momentTimeZoneName", "onChange"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/DateRange.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const getTypeFromProps = (earliest, latest) => { + if (earliest && (!latest || latest === 'now')) { + return 'since'; + } + + if (latest && (!earliest || earliest === '0')) { + return 'before'; + } + + return 'between'; +}; + +const convertEarliestPropToState = (earliest, momentTimeZoneName) => { + let tz; + + if (momentTimeZoneName) { + tz = earliest ? _moment.default.tz(earliest, momentTimeZoneName) : _moment.default.unix(0); + } else { + tz = earliest ? (0, _moment.default)(earliest) : _moment.default.unix(0); + } + + return tz.format(_Date.default.momentFormat); +}; + +const convertLatestPropToState = (latest, momentTimeZoneName, type) => { + let tz; + + if (momentTimeZoneName) { + tz = latest ? _moment.default.tz(latest, momentTimeZoneName) : _moment.default.tz(undefined, momentTimeZoneName); + } else { + tz = latest ? (0, _moment.default)(latest) : (0, _moment.default)(undefined); + } + + if (type && type === 'between') { + if (latest && (0, _time.isWholeDay)(latest)) { + tz = tz.subtract({ + days: 1 + }); + } + } + + return tz.format(_Date.default.momentFormat); +}; + +const DateRange = _ref => { + let { + earliest: propsEarliest, + latest: propsLatest, + locale, + momentTimeZoneName, + onChange + } = _ref, + rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); + const typeFromProps = getTypeFromProps(propsEarliest, propsLatest); + const convertedEarliest = convertEarliestPropToState(propsEarliest, momentTimeZoneName); + const convertedLatest = convertLatestPropToState(propsLatest, momentTimeZoneName, typeFromProps); + const [earliest, setEarliest] = (0, _react.useState)(convertedEarliest); + const [latest, setLatest] = (0, _react.useState)(convertedLatest); + const [errorMessage, setErrorMessage] = (0, _react.useState)(); + const [type, setType] = (0, _react.useState)(typeFromProps); + const earliestRef = (0, _react.useRef)(); + const latestRef = (0, _react.useRef)(); + (0, _react.useEffect)(() => { + earliestRef.current = propsEarliest; + latestRef.current = propsLatest; + }, [propsEarliest, propsLatest]); + + if (earliestRef.current !== propsEarliest && earliest !== convertedEarliest) { + setEarliest(convertedEarliest); + } + + if (latestRef.current !== propsLatest && latest !== convertedLatest) { + setLatest(convertedLatest); + } + + if ((earliestRef.current !== propsEarliest || latestRef.current !== propsLatest) && type !== typeFromProps) { + setType(typeFromProps); + } + + const handleTypeChange = (e, { + value + }) => { + setType(value); + }; + + const handleChange = (e, { + value, + name + }) => { + if (name === 'earliest') { + setEarliest(value); + } else { + setLatest(value); + } + }; + + const apply = (e, updatedEarliest, updatedLatest) => { + const latestAdjusted = type === 'between' ? _moment.default.tz(updatedLatest, momentTimeZoneName).add({ + days: 1 + }).format(_Date.default.momentFormat) : latest; + let error = ''; + + if (type === 'between' && _moment.default.tz(updatedEarliest, momentTimeZoneName).valueOf() >= _moment.default.tz(latestAdjusted, momentTimeZoneName).valueOf()) { + error = (0, _i18n._)('Earliest must be before latest.'); + } + + setErrorMessage(error); + + if (!error && onChange) { + onChange(e, { + earliest: type === 'before' ? '0' : (0, _time.getISOWithTimeZone)(`${updatedEarliest}T00:00:00.000`, momentTimeZoneName), + latest: type === 'since' ? 'now' : (0, _time.getISOWithTimeZone)(`${latestAdjusted}T00:00:00.000`, momentTimeZoneName) + }); + } + }; + + const handleApply = e => { + apply(e, earliest, latest); + }; + + const handleKeyDown = e => { + if ((0, _keyboard.keycode)(e) === 'enter') { + const target = e.target; + const { + name, + value + } = target; + apply(e, name === 'earliest' ? convertEarliestPropToState(value) : earliest, name === 'latest' ? convertLatestPropToState(value) : latest); + } + }; + /* Due to IE11 bug (SUI-909) the Type Select needs to grow slightly, + * so it takes 1% of the extra space. */ + + + const typeStyles = { + flex: '0 1 auto', + marginRight: 10, + marginTop: 0 // remove prisma first-child cg top margin + + }; + const dateStyles = { + flex: 1 + }; + return /*#__PURE__*/_react.default.createElement(_Panel.default, (0, _extends2.default)({ + title: (0, _i18n._)('Date Range') + }, rest, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 181, + columnNumber: 9 + } + }), errorMessage && /*#__PURE__*/_react.default.createElement(_Message.default, { + type: "error", + "data-test": "error-message", + style: { + margin: '0 20px' + }, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 183, + columnNumber: 17 + } + }, errorMessage), /*#__PURE__*/_react.default.createElement(_Styles.StyledCGWrapper, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 187, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + style: typeStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 188, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Select.default, { + value: type, + "data-test": "range-type", + onChange: handleTypeChange, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 189, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Between'), + value: "between", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 190, + columnNumber: 25 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Before'), + value: "before", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 191, + columnNumber: 25 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Since'), + value: "since", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 192, + columnNumber: 25 + } + }))), /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + help: "00:00:00", + style: dateStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 195, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Date.default, { + name: type !== 'before' ? 'earliest' : 'latest', + value: type !== 'before' ? earliest : latest, + onChange: handleChange, + onKeyDown: handleKeyDown, + inline: false, + locale: locale, + style: dateStyles, + "data-test": type !== 'before' ? 'earliest-date' : 'latest-date', + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 202, + columnNumber: 21 + } + })), type !== 'before' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 214, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_StaticContent.default, { + style: { + marginLeft: type === 'between' ? 0 : 10, + // StaticContent lost left/right padding in Prisma - TBD if intentional or bug + paddingLeft: 7, + paddingRight: 7 + }, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 215, + columnNumber: 25 + } + }, type === 'between' ? (0, _i18n._)('and') : (0, _i18n._)('until now'))), type === 'between' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + help: "24:00:00", + style: dateStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 228, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Date.default, { + name: "latest", + value: latest, + onChange: handleChange, + inline: false, + locale: locale, + onKeyDown: handleKeyDown, + "data-test": "latest-date", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 235, + columnNumber: 25 + } + }))), /*#__PURE__*/_react.default.createElement(_Styles.StyledApplyContainer, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 247, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + label: (0, _i18n._)('Apply'), + "data-test": "apply", + onClick: handleApply, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 248, + columnNumber: 17 + } + }))); +}; + +DateRange.defaultProps = { + placeholder: 'Select...' +}; +var _default = DateRange; +exports["default"] = _default; + +/***/ }), + +/***/ 72521: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _i18n = __webpack_require__(20259); + +var _keyboard = __webpack_require__(4214); + +var _moment = _interopRequireDefault(__webpack_require__(61605)); + +var _Button = _interopRequireDefault(__webpack_require__(70181)); + +var _ControlGroup = _interopRequireDefault(__webpack_require__(37801)); + +var _Date = _interopRequireDefault(__webpack_require__(82857)); + +var _Message = _interopRequireDefault(__webpack_require__(57914)); + +var _Select = _interopRequireDefault(__webpack_require__(87149)); + +var _StaticContent = _interopRequireDefault(__webpack_require__(98798)); + +var _Text = _interopRequireDefault(__webpack_require__(25338)); + +var _time = __webpack_require__(1115); + +var _Styles = __webpack_require__(12169); + +var _Panel = _interopRequireDefault(__webpack_require__(57837)); + +const _excluded = ["earliest", "latest", "onChange", "momentTimeZoneName", "locale"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/DateTimeRange.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const DateTimeRange = _ref => { + let { + earliest, + latest, + onChange, + momentTimeZoneName, + locale + } = _ref, + rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); + + const convertEarliestPropToState = (earliestProp, momentTimeZoneNameProp) => { + const earliestMomentDateTime = momentTimeZoneNameProp ? _moment.default.tz(earliestProp, momentTimeZoneNameProp) : (0, _moment.default)(earliestProp); + const earliestDateTime = earliestProp ? earliestMomentDateTime : _moment.default.unix(0); + return { + date: earliestDateTime.format(_Date.default.momentFormat), + time: earliestDateTime.format(DateTimeRange.timeFormat) + }; + }; + + const convertLatestPropToState = (latestProp, momentTimeZoneNameProp) => { + const latestDateTime = momentTimeZoneNameProp ? _moment.default.tz(latestProp || undefined, momentTimeZoneNameProp) : (0, _moment.default)(latestProp || undefined); + return { + date: latestDateTime.format(_Date.default.momentFormat), + time: latestDateTime.format(DateTimeRange.timeFormat) + }; + }; + + const earliestDateTime = convertEarliestPropToState(earliest, momentTimeZoneName); + const latestDateTime = convertLatestPropToState(latest, momentTimeZoneName); + const typeFromProps = DateTimeRange.inferType(earliest, latest); + const [earliestDate, setEarliestDate] = (0, _react.useState)(earliestDateTime.date); + const [earliestTime, setEarliestTime] = (0, _react.useState)(earliestDateTime.time); + const [latestDate, setLatestDate] = (0, _react.useState)(latestDateTime.date); + const [latestTime, setLatestTime] = (0, _react.useState)(latestDateTime.time); + const [type, setType] = (0, _react.useState)(typeFromProps); + const [errorMessage, setErrorMessage] = (0, _react.useState)(''); + const earliestRef = (0, _react.useRef)(); + const latestRef = (0, _react.useRef)(); + (0, _react.useEffect)(() => { + earliestRef.current = earliest; + latestRef.current = latest; + }, [earliest, latest]); + + if (earliestRef.current !== earliest && earliestDateTime.date !== earliestDate) { + setEarliestDate(earliestDateTime.date); + } + + if (latestRef.current !== latest && latestDateTime.date !== latestDate) { + setLatestDate(latestDateTime.date); + } + + if (typeFromProps !== type && (earliestRef.current !== earliest || latestRef.current !== latest)) { + setType(typeFromProps); + } + + const handleTypeChange = (e, { + value + }) => { + setType(value); + }; + + const handleEarliestDateChange = (e, { + value + }) => { + setEarliestDate(value); + }; + + const handleEarliestTimeChange = (e, { + value + }) => { + setEarliestTime(value); + }; + + const handleLatestDateChange = (e, { + value + }) => { + setLatestDate(value); + }; + + const handleLatestTimeChange = (e, { + value + }) => { + setLatestTime(value); + }; + + const apply = (e, updatedEarliestTime, updatedEarliestDate, updatedLatestTime, updatedLatestDate) => { + let error = ''; + const updatedEarliest = type === 'before' ? '0' : (0, _time.getISOWithTimeZone)(`${updatedEarliestDate}T${updatedEarliestTime}`, momentTimeZoneName); + const updatedLatest = type === 'since' ? 'now' : (0, _time.getISOWithTimeZone)(`${updatedLatestDate}T${updatedLatestTime}`, momentTimeZoneName); + /* validateTime() checks the string is formatted correctly for splunkd. + * moment() validates that it is a valid time, such as not having 61 minutes. + */ + + if (type !== 'before' && !(DateTimeRange.validateTime(updatedEarliestTime) && _moment.default.tz(updatedEarliest, momentTimeZoneName).isValid())) { + error = (0, _i18n._)('Earliest time is invalid.'); + } else if (type !== 'since' && !(DateTimeRange.validateTime(updatedLatestTime) && _moment.default.tz(updatedLatest, momentTimeZoneName).isValid())) { + error = (0, _i18n._)('Latest time is invalid.'); + } else if (type === 'between' && _moment.default.tz(updatedEarliest, momentTimeZoneName).valueOf() >= _moment.default.tz(updatedLatest, momentTimeZoneName).valueOf()) { + error = (0, _i18n._)('Earliest must be before latest.'); + } + + setErrorMessage(error); + + if (!error && onChange) { + onChange(e, { + earliest: updatedEarliest, + latest: updatedLatest + }); + } + }; + + const handleApply = e => { + apply(e, earliestTime, earliestDate, latestTime, latestDate); + }; + + const handleTimeKeyDown = e => { + if ((0, _keyboard.keycode)(e) === 'enter') { + apply(e, earliestTime, earliestDate, latestTime, latestDate); + } + }; + + const handleDateKeyDown = e => { + if ((0, _keyboard.keycode)(e) === 'enter') { + const { + value, + name + } = e.target; + const updatedEarliestDate = name === 'earliestDate' ? convertEarliestPropToState(value).date : earliestDate; + const updatedLatestDate = name === 'latestDate' ? convertLatestPropToState(value).date : latestDate; + apply(e, earliestTime, updatedEarliestDate, latestTime, updatedLatestDate); + } + }; + /* Due to IE11 bug (SUI-909) the Type Select needs to grow slightly, + * so it takes 1% of the extra space. */ + + + const typeStyles = { + flex: '0 1 auto', + marginRight: 10, + marginTop: 0 // remove prisma first-child cg top margin + + }; + const dateStyles = { + flex: '0 1 150px', + marginRight: 10 + }; + const latestTimeStyles = { + flex: 1 + }; + const earliestTimeStyles = { + flex: 1 + }; + return /*#__PURE__*/_react.default.createElement(_Panel.default, (0, _extends2.default)({ + title: (0, _i18n._)('Date & Time Range') + }, rest, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 216, + columnNumber: 9 + } + }), errorMessage && /*#__PURE__*/_react.default.createElement(_Message.default, { + type: "error", + "data-test": "error-message", + style: { + margin: '0 20px' + }, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 218, + columnNumber: 17 + } + }, errorMessage), /*#__PURE__*/_react.default.createElement(_Styles.StyledCGWrapper, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 222, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + "data-role": "rangetype", + labelPosition: "top", + style: typeStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 223, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Select.default, { + value: type, + "data-test": "range-type", + onChange: handleTypeChange, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 230, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Between'), + value: "between", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 231, + columnNumber: 25 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Before'), + value: "before", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 232, + columnNumber: 25 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Since'), + value: "since", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 233, + columnNumber: 25 + } + }))), type !== 'before' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + style: dateStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 237, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Date.default, { + name: "earliestDate", + value: earliestDate, + onChange: handleEarliestDateChange, + onKeyDown: handleDateKeyDown, + inline: false, + locale: locale, + "data-test": "earliest-date", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 238, + columnNumber: 25 + } + })), type !== 'before' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + help: "HH:MM:SS.SSS", + style: earliestTimeStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 250, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Text.default, { + value: earliestTime, + onChange: handleEarliestTimeChange, + onKeyDown: handleTimeKeyDown, + "data-test": "earliest-time", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 257, + columnNumber: 25 + } + })), type !== 'before' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + inline: false, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 266, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_StaticContent.default, { + style: { + marginLeft: type === 'between' ? 0 : 10, + // StaticContent lost left/right padding in Prisma - TBD if intentional or bug + paddingLeft: 7, + paddingRight: 7 + }, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 267, + columnNumber: 25 + } + }, type === 'between' ? (0, _i18n._)('and') : (0, _i18n._)('until now'))), type !== 'since' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + style: dateStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 280, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Date.default, { + name: "latestDate", + value: latestDate, + onChange: handleLatestDateChange, + onKeyDown: handleDateKeyDown, + inline: false, + locale: locale, + "data-test": "latest-date", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 281, + columnNumber: 25 + } + })), type !== 'since' && /*#__PURE__*/_react.default.createElement(_ControlGroup.default, { + controlsLayout: "none", + label: "", + labelPosition: "top", + help: (0, _i18n._)('HH:MM:SS.SSS'), + style: latestTimeStyles, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 293, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Text.default, { + value: latestTime, + onChange: handleLatestTimeChange, + onKeyDown: handleTimeKeyDown, + "data-test": "latest-time", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 300, + columnNumber: 25 + } + }))), /*#__PURE__*/_react.default.createElement(_Styles.StyledApplyContainer, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 309, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + label: (0, _i18n._)('Apply'), + "data-test": "apply", + onClick: handleApply, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 310, + columnNumber: 17 + } + }))); +}; + +DateTimeRange.defaultProps = { + placeholder: 'Select...' +}; +DateTimeRange.timeFormat = 'HH:mm:ss.SSS'; + +DateTimeRange.validateTime = time => { + return time.match(/^\d\d:\d\d(:\d\d|:\d\d\.\d?\d?\d?)?$/); +}; + +DateTimeRange.inferType = (earliest, latest) => { + if (earliest && (!latest || latest === 'now')) { + return 'since'; + } + + if (latest && (!earliest || earliest === '0')) { + return 'before'; + } + + return 'between'; +}; + +var _default = DateTimeRange; +exports["default"] = _default; + +/***/ }), + +/***/ 27091: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.enrichParse = enrichParse; +exports["default"] = exports.convertToISO = exports.findPanelType = exports.possibleAdvancedInputTypes = exports.possibleFormInputTypes = exports.FormInputType = exports.AdvancedInputType = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(43693)); + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _lodash = __webpack_require__(2543); + +var _moment = _interopRequireDefault(__webpack_require__(61605)); + +var _time = __webpack_require__(1115); + +var _config = __webpack_require__(75602); + +var _Accordion = _interopRequireDefault(__webpack_require__(68503)); + +var _Advanced = _interopRequireDefault(__webpack_require__(1593)); + +var _DateRange = _interopRequireDefault(__webpack_require__(32662)); + +var _DateTimeRange = _interopRequireDefault(__webpack_require__(72521)); + +var _Presets = _interopRequireDefault(__webpack_require__(83343)); + +var _RealTime = _interopRequireDefault(__webpack_require__(29842)); + +var _Relative = _interopRequireDefault(__webpack_require__(39035)); + +var _stylesAndData = _interopRequireDefault(__webpack_require__(56452)); + +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/Dialog.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +const locale = _config.locale || 'en_US'; +let AdvancedInputType; +exports.AdvancedInputType = AdvancedInputType; + +(function (AdvancedInputType) { + AdvancedInputType["relative"] = "relative"; + AdvancedInputType["realTime"] = "realTime"; + AdvancedInputType["allTime"] = "allTime"; + AdvancedInputType["dateTime"] = "dateTime"; +})(AdvancedInputType || (exports.AdvancedInputType = AdvancedInputType = {})); + +let FormInputType; +exports.FormInputType = FormInputType; + +(function (FormInputType) { + FormInputType["relative"] = "relative"; + FormInputType["realTime"] = "realTime"; + FormInputType["date"] = "date"; + FormInputType["dateTime"] = "dateTime"; +})(FormInputType || (exports.FormInputType = FormInputType = {})); + +var PanelType; + +(function (PanelType) { + PanelType["relative"] = "relative"; + PanelType["realTime"] = "realTime"; + PanelType["date"] = "date"; + PanelType["dateTime"] = "dateTime"; + PanelType["presets"] = "presets"; + PanelType["advanced"] = "advanced"; +})(PanelType || (PanelType = {})); + +const possibleFormInputTypes = Object.keys(FormInputType); +exports.possibleFormInputTypes = possibleFormInputTypes; +const possibleAdvancedInputTypes = Object.keys(AdvancedInputType); +exports.possibleAdvancedInputTypes = possibleAdvancedInputTypes; + +const findPanelType = ({ + advancedInputTypes, + earliest, + formInputTypes, + latest, + presets +}) => { + // Presets + if ((0, _time.findPresetLabel)(presets, earliest, latest)) { + return PanelType.presets; + } // RealTime or Relative + + + const earliestParse = (0, _time.parseTimeString)(earliest); + const earliestMods = earliestParse.modifiers; + const latestParse = (0, _time.parseTimeString)(latest); + + if (earliestParse.isFullyParsed && latestParse.isFullyParsed && earliestMods.length === 1) { + // Relative + if ((0, _lodash.includes)(formInputTypes, FormInputType.relative) && earliestParse.type !== 'realTime' && latestParse.type !== 'realTime' && (!earliestMods[0].snap || earliestMods[0].unit === earliestMods[0].snap)) { + if ((0, _time.isLatestNow)(latest)) { + return PanelType.relative; + } + + const mod = latestParse.modifiers[0]; + + if (mod && !mod.amount && mod.snap === earliestMods[0].unit) { + return PanelType.relative; + } + } // RealTime + + + if ((0, _lodash.includes)(formInputTypes, FormInputType.realTime) && earliestParse.type === 'realTime' && !earliestMods[0].snap && (latest === 'rt' || latest === 'rtnow')) { + return PanelType.realTime; + } + } // DateRange or DateTimeRange + + + if ((0, _time.isISO)(earliest) && (latest === '' || latest === 'now')) { + if ((0, _lodash.includes)(formInputTypes, FormInputType.date) && (0, _time.isWholeDay)(earliest)) { + return PanelType.date; + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.dateTime)) { + return PanelType.dateTime; + } + } else if ((0, _time.isISO)(latest) && (earliest === '' || earliest === '0')) { + if ((0, _lodash.includes)(formInputTypes, FormInputType.date) && (0, _time.isWholeDay)(latest)) { + return PanelType.date; + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.dateTime)) { + return PanelType.dateTime; + } + } else if ((0, _time.isISO)(earliest) && (0, _time.isISO)(latest)) { + if ((0, _lodash.includes)(formInputTypes, FormInputType.date) && (0, _time.isWholeDay)(earliest) && (0, _time.isWholeDay)(latest)) { + return PanelType.date; + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.dateTime)) { + return PanelType.dateTime; + } + } else if ((0, _time.isEpoch)(earliest) && (0, _time.isEpoch)(latest)) { + return PanelType.dateTime; + } // Advanced + + + if (advancedInputTypes.length) { + return PanelType.advanced; + } // Fallback to first available + + + if (presets.length) { + return PanelType.presets; + } + + return PanelType[formInputTypes[0]]; +}; + +exports.findPanelType = findPanelType; + +const convertToISO = (time, parse, isEarliest = true) => { + if ((0, _time.isISO)(time)) { + return time; + } + + if (isEarliest && (0, _time.isEarliestEmpty)(time)) { + return ''; + } + + if (!isEarliest && (0, _time.isLatestNow)(time)) { + return ''; + } + + if (parse && parse.iso) { + return parse.iso; // remove timezone + } + + return ''; +}; + +exports.convertToISO = convertToISO; + +function enrichParse(parse) { + if (!parse) { + return; + } + /* ISO doesn't spec dates before the year 0000 or after 9999. Splunk's time parser is not + * compatible with moment or the native Date methods in these cases (SUI-1330). + * If the iso time is incompatible, the display value is removed and an error is added. + * */ + + + const iso = parse.iso && (0, _time.isISO)(parse.iso) ? (0, _time.removeISOTimezone)(parse.iso) : undefined; // eslint-disable-next-line consistent-return + + return { + error: parse.error || iso ? parse.error : new Error('The iso time could not be converted to a JavaScript Date.'), + iso, + displayValue: iso ? (0, _moment.default)(iso).locale(locale).format('LLL') : undefined, + time: parse.time + }; +} + +const TimeRangeDialog = props => { + const { + onRequestParseEarliest, + onRequestParseLatest, + earliest, + latest, + momentTimeZone, + advancedInputTypes, + documentationURL, + formInputTypes, + onChange, + presets, + style + } = props; + const [openPanelId, setOpenPanelId] = (0, _react.useState)(findPanelType(props)); + const prevMomentTimeZone = (0, _react.useRef)(); + const prevEarliest = (0, _react.useRef)(); + const prevLatest = (0, _react.useRef)(); + (0, _react.useEffect)(() => { + prevMomentTimeZone.current = momentTimeZone; + }, [momentTimeZone]); + (0, _react.useEffect)(() => { + prevEarliest.current = earliest; + }, [earliest]); + (0, _react.useEffect)(() => { + prevLatest.current = latest; + }, [latest]); + + if (prevMomentTimeZone.current !== momentTimeZone) { + _moment.default.tz.add(_moment.default.tz.pack(momentTimeZone)); + } + + (0, _react.useEffect)(() => { + /* Get the necessary data to populate the data and date-time panels. + * Real-time, relative and advanced panels will call parse on mount, so it's not necessary + * to cover those cases here. + */ + if ((0, _time.isEpoch)(earliest) || openPanelId === 'presets') { + onRequestParseEarliest(earliest); + } + + if ((0, _time.isEpoch)(latest) || openPanelId === 'presets') { + onRequestParseLatest(latest); + } + }, [onRequestParseEarliest, onRequestParseLatest, earliest, latest, openPanelId]); + + if (earliest !== prevEarliest.current && (0, _time.isEpoch)(earliest)) { + onRequestParseEarliest(earliest); + } + + if (latest !== prevLatest.current && (0, _time.isEpoch)(latest)) { + onRequestParseLatest(latest); + } + + const handleAccordionChange = (e, { + panelId + }) => { + setOpenPanelId(PanelType[panelId]); + }; + + const handleRequestParseEarliest = (time, panelId) => { + if (panelId === openPanelId) { + const timeCleaned = (0, _time.removeRealTime)(time || '0'); + onRequestParseEarliest(timeCleaned, panelId); + } + }; + + const handleRequestParseLatest = (time, panelId) => { + if (panelId === openPanelId) { + const timeCleaned = (0, _time.removeRealTime)(time || 'now'); + onRequestParseLatest(timeCleaned, panelId); + } + }; + + const momentTimeZoneName = momentTimeZone ? momentTimeZone.name : ''; + const panelProps = { + earliest, + latest, + onChange + }; + const parseEarliest = enrichParse(props.parseEarliest); + const parseLatest = enrichParse(props.parseLatest); + const parserProps = { + onRequestParseEarliest: handleRequestParseEarliest, + onRequestParseLatest: handleRequestParseLatest, + parseEarliest, + parseLatest + }; + const panelISOProps = { + earliest: convertToISO(earliest, parseEarliest, true), + latest: convertToISO(latest, parseLatest, false), + onChange, + locale + }; + const children = []; + + if (presets && presets.length) { + children.push( /*#__PURE__*/_react.default.createElement(_Presets.default, (0, _extends2.default)({ + panelId: "presets", + key: "presets", + presets: presets, + onRequestParseLatest: handleRequestParseLatest, + onRequestParseEarliest: handleRequestParseEarliest + }, panelProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 399, + columnNumber: 13 + } + }))); + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.relative)) { + children.push( /*#__PURE__*/_react.default.createElement(_Relative.default, (0, _extends2.default)({ + panelId: "relative", + key: "relative" + }, panelProps, parserProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 410, + columnNumber: 23 + } + }))); + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.realTime)) { + children.push( /*#__PURE__*/_react.default.createElement(_RealTime.default, (0, _extends2.default)({ + panelId: "realTime", + key: "realTime" + }, panelProps, parserProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 413, + columnNumber: 23 + } + }))); + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.date)) { + children.push( /*#__PURE__*/_react.default.createElement(_DateRange.default, (0, _extends2.default)({ + panelId: "date", + key: "date", + momentTimeZoneName: momentTimeZoneName + }, panelISOProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 417, + columnNumber: 13 + } + }))); + } + + if ((0, _lodash.includes)(formInputTypes, FormInputType.dateTime)) { + children.push( /*#__PURE__*/_react.default.createElement(_DateTimeRange.default, (0, _extends2.default)({ + panelId: "dateTime", + key: "dateTime", + momentTimeZoneName: momentTimeZoneName + }, panelISOProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 422, + columnNumber: 13 + } + }))); + } + + if (advancedInputTypes.length) { + children.push( /*#__PURE__*/_react.default.createElement(_Advanced.default, (0, _extends2.default)({ + panelId: "advanced", + key: "advanced", + inputTypes: advancedInputTypes, + documentationURL: documentationURL, + momentTimeZoneName: momentTimeZoneName + }, panelProps, parserProps, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 432, + columnNumber: 13 + } + }))); + } + + return /*#__PURE__*/_react.default.createElement(_Accordion.default, (0, _extends2.default)({ + openPanelId: openPanelId, + onChange: handleAccordionChange, + "data-test": "time-range-dialog", + "data-test-earliest": earliest, + "data-test-latest": latest + }, (0, _stylesAndData.default)(props), { + style: _objectSpread({ + minWidth: 820 + }, style), + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 445, + columnNumber: 9 + } + }), children); +}; + +TimeRangeDialog.defaultProps = { + advancedInputTypes: possibleAdvancedInputTypes, + formInputTypes: possibleFormInputTypes, + placeholder: 'Select...', + onChange: _lodash.noop, + onRequestParseEarliest: _lodash.noop, + onRequestParseLatest: _lodash.noop +}; +var _default = TimeRangeDialog; +exports["default"] = _default; + +/***/ }), + +/***/ 57837: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireDefault(__webpack_require__(96540)); + +var _Accordion = _interopRequireDefault(__webpack_require__(68503)); + +var _stylesAndData = _interopRequireDefault(__webpack_require__(56452)); + +const _excluded = ["children"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/Panel.tsx"; +const accordionPropSet = new Set([// public API +'description', 'elementRef', 'panelId', 'title', // internal API +'open', 'onRequestOpen', 'onRequestClose']); + +const Panel = _ref => { + let { + children + } = _ref, + rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); + return /*#__PURE__*/_react.default.createElement(_Accordion.default.Panel, (0, _extends2.default)({}, (0, _stylesAndData.default)(rest, accordionPropSet), { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 40, + columnNumber: 5 + } + }), children); +}; + +var _default = Panel; +exports["default"] = _default; + +/***/ }), + +/***/ 92476: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireDefault(__webpack_require__(96540)); + +var _Link = _interopRequireDefault(__webpack_require__(59421)); + +var _stylesAndData = _interopRequireDefault(__webpack_require__(56452)); + +const _excluded = ["children", "earliest", "latest", "label", "onClick"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/PresetLink.tsx"; + +function PresetLink(_ref) { + let { + children, + earliest, + latest, + label, + onClick + } = _ref, + rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); + + const handleClick = e => { + onClick(e, { + earliest, + latest + }); + }; + + return /*#__PURE__*/_react.default.createElement(_Link.default, (0, _extends2.default)({ + style: { + display: 'block' + }, + label: label, + onClick: handleClick + }, (0, _stylesAndData.default)(rest), { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 23, + columnNumber: 9 + } + }), children); +} + +var _default = PresetLink; +exports["default"] = _default; + +/***/ }), + +/***/ 83343: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _react = _interopRequireDefault(__webpack_require__(96540)); + +var _lodash = __webpack_require__(2543); + +var _i18n = __webpack_require__(20259); + +var _time = __webpack_require__(1115); + +var _PresetLink = _interopRequireDefault(__webpack_require__(92476)); + +var _PresetsStyles = __webpack_require__(75837); + +var _Panel = _interopRequireDefault(__webpack_require__(57837)); + +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/Presets.tsx"; + +const Presets = props => { + const handleClick = (e, { + earliest, + latest + }) => { + props.onRequestParseEarliest(earliest, props.panelId); + props.onRequestParseLatest(latest, props.panelId); + props.onChange(e, { + earliest, + latest + }); + }; + + function renderPresets() { + const realtime = []; + const past = []; + const latest = []; + const other = []; + props.presets.forEach(ps => { + const parseEarliest = (0, _time.parseTimeString)(ps.earliest); + const parseEarliestM = parseEarliest.modifiers[0]; + const parseLatest = (0, _time.parseTimeString)(ps.latest); + + const link = /*#__PURE__*/_react.default.createElement(_PresetLink.default, { + key: `${ps.earliest} ${ps.latest}`, + earliest: ps.earliest, + latest: ps.latest, + onClick: handleClick, + label: ps.label, + "data-test": ps.label, + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 46, + columnNumber: 17 + } + }, (0, _i18n._)(ps.label)); + + if (parseEarliest === false) { + other.push(link); + } else if (parseEarliest.type === 'realTime' || parseLatest.type === 'realTime') { + realtime.push(link); + } else if ((0, _time.isLatestNow)(ps.latest) && parseEarliestM && parseEarliestM.unit) { + latest.push(link); + } else if (parseEarliestM && (parseEarliestM.amount || parseEarliestM.snap)) { + past.push(link); + } else { + other.push(link); + } + }); + return /*#__PURE__*/_react.default.createElement(_PresetsStyles.Styled, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 72, + columnNumber: 13 + } + }, !!realtime.length && /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledColumn, { + "data-test": "real-time-column", + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 74, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledHeading, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 75, + columnNumber: 25 + } + }, (0, _i18n._)('Real-time')), realtime), !!past.length && /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledColumn, { + "data-test": "relative-column", + "data-test-column-id": "past", + "data-divider": !!realtime.length, + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 80, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledHeading, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 85, + columnNumber: 25 + } + }, (0, _i18n._)('Relative')), past), !!latest.length && /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledColumn, { + "data-test": "relative-column", + "data-test-column-id": "latest", + "data-divider": !!realtime.length && !past.length, + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 90, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledHeading, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 95, + columnNumber: 25 + } + }, !past.length && (0, _i18n._)('Relative')), latest), !!other.length && /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledColumn, { + "data-test": "other-column", + "data-divider": !!realtime.length || !!past.length || !!latest.length, + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 100, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_PresetsStyles.StyledHeading, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 104, + columnNumber: 25 + } + }, (0, _i18n._)('Other')), other)); + } + + return /*#__PURE__*/_react.default.createElement(_Panel.default, (0, _extends2.default)({ + title: (0, _i18n._)('Presets') + }, props, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 113, + columnNumber: 9 + } + }), renderPresets()); +}; + +Presets.defaultProps = { + placeholder: 'Select...', + onChange: _lodash.noop, + onRequestParseEarliest: _lodash.noop, + onRequestParseLatest: _lodash.noop +}; +var _default = Presets; +exports["default"] = _default; + +/***/ }), + +/***/ 75837: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StyledHeading = exports.StyledColumn = exports.Styled = void 0; + +var _styledComponents = _interopRequireDefault(__webpack_require__(92568)); + +var _themes = __webpack_require__(61572); + +const Styled = _styledComponents.default.div` + display: flex; + padding: ${_themes.variables.spacingLarge}; +`; +exports.Styled = Styled; +const StyledColumn = _styledComponents.default.div` + flex: 1 0 auto; + padding-right: ${_themes.variables.spacingSmall}; +`; +exports.StyledColumn = StyledColumn; +const StyledHeading = _styledComponents.default.h5` + ${_themes.mixins.reset('block')}; + color: ${_themes.variables.textGray}; + min-height: ${_themes.variables.lineHeight}; + min-width: 20px; +`; +exports.StyledHeading = StyledHeading; + +/***/ }), + +/***/ 29842: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _time = __webpack_require__(1115); + +var _lodash = __webpack_require__(2543); + +var _i18n = __webpack_require__(20259); + +var _keyboard = __webpack_require__(4214); + +var _Button = _interopRequireDefault(__webpack_require__(70181)); + +var _Message = _interopRequireDefault(__webpack_require__(57914)); + +var _Number = _interopRequireDefault(__webpack_require__(36156)); + +var _Select = _interopRequireDefault(__webpack_require__(87149)); + +var _Text = _interopRequireDefault(__webpack_require__(25338)); + +var _AbsoluteValue = _interopRequireDefault(__webpack_require__(75553)); + +var _Styles = __webpack_require__(12169); + +var _Panel = _interopRequireDefault(__webpack_require__(57837)); + +const _excluded = ["earliest", "open", "onChange", "onRequestParseEarliest", "parseEarliest", "panelId"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/RealTime.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const RealTime = _ref => { + let { + earliest: earliestProp, + open, + onChange, + onRequestParseEarliest, + parseEarliest, + panelId + } = _ref, + rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); + const fromNumberFromProps = (0, _time.getFromNumber)(earliestProp); + const fromUnitFromProps = (0, _time.getFromUnit)(earliestProp); + const [fromNumber, setFromNumber] = (0, _react.useState)(fromNumberFromProps); + const [fromUnit, setFromUnit] = (0, _react.useState)(fromUnitFromProps); + const [hasError, setHasError] = (0, _react.useState)(); + const prevOpenRef = (0, _react.useRef)(); + const prevEarliestRef = (0, _react.useRef)(); + (0, _react.useEffect)(() => { + prevEarliestRef.current = earliestProp; + }, [earliestProp]); + (0, _react.useEffect)(() => { + prevOpenRef.current = open; + }, [open]); + + if (open && prevEarliestRef.current && (earliestProp !== prevEarliestRef.current || !prevOpenRef.current)) { + if (hasError) { + setHasError(false); + } + + const needsEarliestUpdate = !prevOpenRef.current || fromNumberFromProps !== fromNumber || fromUnitFromProps !== fromUnit; + + if (needsEarliestUpdate) { + onRequestParseEarliest((0, _time.getRealTimeEarliest)(fromNumber, fromUnit), panelId); + } + } + + const handleFromNumberChange = (e, { + value + }) => { + setFromNumber(value); + onRequestParseEarliest((0, _time.getRealTimeEarliest)(value, fromUnit), panelId); + }; + + const handleFromUnitChange = (e, { + value + }) => { + setFromUnit(value); + onRequestParseEarliest((0, _time.getRealTimeEarliest)(fromNumber, value), panelId); + }; + + const handleApply = e => { + // eslint-disable-next-line no-restricted-globals + if (!isFinite(fromNumber)) { + setHasError(true); + return; + } + + const earliest = (0, _time.getRealTimeEarliest)(fromNumber, fromUnit); + const latest = 'rt'; + onChange(e, { + earliest, + latest + }); + }; + + const handleKeyDown = e => { + if ((0, _keyboard.keycode)(e) === 'enter') { + handleApply(e); + } + }; + + const earliest = (0, _time.removeRealTime)((0, _time.getRealTimeEarliest)(fromNumber, fromUnit)); + const earliestParseValid = parseEarliest && earliest === parseEarliest.time; + return /*#__PURE__*/_react.default.createElement(_Panel.default, (0, _extends2.default)({ + title: (0, _i18n._)('Real-time'), + panelId: panelId, + open: open + }, rest, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 114, + columnNumber: 9 + } + }), hasError && /*#__PURE__*/_react.default.createElement(_Styles.StyledError, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 116, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Message.default, { + type: "error", + "data-test": "error-message", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 117, + columnNumber: 21 + } + }, (0, _i18n._)('A number is required for earliest.'))), /*#__PURE__*/_react.default.createElement(_Styles.StyledCGWrapper, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 122, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Styles.FlexControlGroup, { + controlsLayout: "none", + label: (0, _i18n._)('Earliest:'), + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 123, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Styles.StyledFromControl, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 124, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Number.default, { + onChange: handleFromNumberChange, + onKeyDown: handleKeyDown, + min: 1, + roundTo: 0, + value: fromNumber, + style: { + flex: 1 + }, + append: true, + "data-test": "earliest-number", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 125, + columnNumber: 25 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default, { + value: fromUnit, + onChange: handleFromUnitChange, + style: { + flex: '0 1 auto' + }, + prepend: true, + "data-test": "earliest-unit", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 135, + columnNumber: 25 + } + }, /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Seconds Ago'), + value: "s", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 142, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Minutes Ago'), + value: "m", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 143, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Hours Ago'), + value: "h", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 144, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Days Ago'), + value: "d", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 145, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Weeks Ago'), + value: "w", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 146, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Months Ago'), + value: "mon", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 147, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Quarters Ago'), + value: "q", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 148, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Years Ago'), + value: "y", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 149, + columnNumber: 29 + } + }))), /*#__PURE__*/_react.default.createElement(_AbsoluteValue.default, { + error: earliestParseValid ? parseEarliest.error : undefined, + displayValue: earliestParseValid ? parseEarliest.displayValue : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 152, + columnNumber: 21 + } + })), /*#__PURE__*/_react.default.createElement(_Styles.FlexControlGroup, { + controlsLayout: "none", + label: (0, _i18n._)('Latest:'), + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 157, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Text.default, { + value: "now", + "data-test": "now", + disabled: true, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 158, + columnNumber: 21 + } + }))), /*#__PURE__*/_react.default.createElement(_Styles.StyledApplyContainer, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 161, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + label: (0, _i18n._)('Apply'), + "data-test": "apply", + disabled: !earliestParseValid || !!(parseEarliest && parseEarliest.error), + onClick: handleApply, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 162, + columnNumber: 17 + } + }))); +}; + +RealTime.defaultProps = { + open: false, + onChange: _lodash.noop, + onRequestParseEarliest: _lodash.noop, + onRequestParseLatest: _lodash.noop +}; +var _default = RealTime; +exports["default"] = _default; + +/***/ }), + +/***/ 39035: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(91847)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _lodash = __webpack_require__(2543); + +var _Button = _interopRequireDefault(__webpack_require__(70181)); + +var _Message = _interopRequireDefault(__webpack_require__(57914)); + +var _Number = _interopRequireDefault(__webpack_require__(36156)); + +var _Select = _interopRequireDefault(__webpack_require__(87149)); + +var _RadioList = _interopRequireDefault(__webpack_require__(93158)); + +var _time = __webpack_require__(1115); + +var _format = __webpack_require__(30376); + +var _i18n = __webpack_require__(20259); + +var _keyboard = __webpack_require__(4214); + +var _AbsoluteValue = _interopRequireDefault(__webpack_require__(75553)); + +var _Styles = __webpack_require__(12169); + +var _Panel = _interopRequireDefault(__webpack_require__(57837)); + +const _excluded = ["earliest", "latest", "open", "onChange", "onRequestParseEarliest", "onRequestParseLatest", "parseEarliest", "parseLatest", "panelId"]; +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dialog/Relative.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +const Relative = _ref => { + let { + earliest: earliestProps, + latest: latestProps, + open, + onChange, + onRequestParseEarliest, + onRequestParseLatest, + parseEarliest, + parseLatest, + panelId + } = _ref, + rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); + const fromNumberFromProps = (0, _time.getFromNumber)(earliestProps); + const fromSnapFromProps = (0, _time.getFromSnap)(earliestProps); + const fromUnitFromProps = (0, _time.getFromUnit)(earliestProps); + const toSnapFromProps = (0, _time.getToSnap)(latestProps); + const [fromNumber, setFromNumber] = (0, _react.useState)(fromNumberFromProps); + const [fromUnit, setFromUnit] = (0, _react.useState)(fromUnitFromProps); + const [fromSnap, setFromSnap] = (0, _react.useState)(fromSnapFromProps); + const [toSnap, setToSnap] = (0, _react.useState)(toSnapFromProps); + const [hasError, setHasError] = (0, _react.useState)(false); + const prevOpenRef = (0, _react.useRef)(); + const prevEarliestRef = (0, _react.useRef)(); + const prevLatestRef = (0, _react.useRef)(); + (0, _react.useEffect)(() => { + prevOpenRef.current = open; + }, [open]); + (0, _react.useEffect)(() => { + prevEarliestRef.current = earliestProps; + prevLatestRef.current = latestProps; + }, [earliestProps, latestProps]); + + if (open && !prevOpenRef.current) { + onRequestParseEarliest((0, _time.getRelativeEarliest)(fromNumber, fromSnap, fromUnit), panelId); + onRequestParseLatest((0, _time.getRelativeLatest)(fromUnit, toSnap), panelId); + } + + if (open && (prevEarliestRef.current || prevLatestRef.current) && (prevEarliestRef.current !== earliestProps || prevLatestRef.current !== latestProps)) { + if (hasError) { + setHasError(false); + } + + const needsEarliestUpdate = !prevOpenRef.current || fromNumber !== fromNumberFromProps || fromSnap !== fromSnapFromProps || fromUnit !== fromUnitFromProps; + + if (needsEarliestUpdate) { + onRequestParseEarliest((0, _time.getRelativeEarliest)(fromNumber, fromSnap, fromUnit), panelId); + } + + const needsLatestUpdate = toSnapFromProps !== toSnap || !prevOpenRef.current; + + if (needsLatestUpdate) { + onRequestParseLatest((0, _time.getRelativeLatest)(fromUnit, toSnap), panelId); + } + } + + const handleFromNumberChange = (e, { + value + }) => { + setFromNumber(value); + onRequestParseEarliest((0, _time.getRelativeEarliest)(value, fromSnap, fromUnit), panelId); + }; + + const handleFromUnitChange = (e, { + value + }) => { + setFromUnit(value); + onRequestParseEarliest((0, _time.getRelativeEarliest)(fromNumber, fromSnap, value), panelId); + onRequestParseLatest((0, _time.getRelativeLatest)(value, toSnap), panelId); + }; + + const handleFromSnapChange = (e, { + value + }) => { + setFromSnap(value); + onRequestParseEarliest((0, _time.getRelativeEarliest)(fromNumber, value, fromUnit), panelId); + }; + + const handleToSnapChange = (e, { + value + }) => { + setToSnap(value); + onRequestParseLatest((0, _time.getRelativeLatest)(fromUnit, value), panelId); + }; + + const handleApply = e => { + if (!(0, _lodash.isFinite)(fromNumber)) { + setHasError(true); + return; + } + + const earliest = (0, _time.getRelativeEarliest)(fromNumber, fromSnap, fromUnit); + const latest = (0, _time.getRelativeLatest)(fromUnit, toSnap); + onChange(e, { + earliest, + latest + }); + }; + + const handleKeyDown = e => { + if ((0, _keyboard.keycode)(e) === 'enter') { + handleApply(e); + } + }; + + const earliest = (0, _time.getRelativeEarliest)(fromNumber, fromSnap, fromUnit); + const latest = (0, _time.getRelativeLatest)(fromUnit, toSnap); + const earliestParseValid = parseEarliest && earliest === parseEarliest.time; + const latestParseValid = parseLatest && latest === parseLatest.time; + const timeUnit = (0, _time.getUnitLabel)(fromUnit); + return /*#__PURE__*/_react.default.createElement(_Panel.default, (0, _extends2.default)({ + title: (0, _i18n._)('Relative'), + panelId: panelId, + open: open + }, rest, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 152, + columnNumber: 9 + } + }), hasError && /*#__PURE__*/_react.default.createElement(_Styles.StyledError, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 154, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Message.default, { + type: "error", + "data-test": "error-message", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 155, + columnNumber: 21 + } + }, (0, _i18n._)('A number is required for earliest.'))), /*#__PURE__*/_react.default.createElement(_Styles.StyledCGWrapper, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 161, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Styles.FlexControlGroup, { + controlsLayout: "none", + label: (0, _i18n._)('Earliest:'), + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 162, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_Styles.StyledFromControl, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 163, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_Number.default, { + style: { + flex: 1 + }, + onChange: handleFromNumberChange, + onKeyDown: handleKeyDown, + min: 0, + roundTo: 0, + value: fromNumber, + append: true, + "data-test": "earliest-number", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 164, + columnNumber: 25 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default, { + value: fromUnit, + onChange: handleFromUnitChange, + prepend: true, + style: { + flex: '0 1 auto' + }, + "data-test": "earliest-unit", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 174, + columnNumber: 25 + } + }, /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Seconds Ago'), + value: "s", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 181, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Minutes Ago'), + value: "m", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 182, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Hours Ago'), + value: "h", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 183, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Days Ago'), + value: "d", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 184, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Weeks Ago'), + value: "w", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 185, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Months Ago'), + value: "mon", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 186, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Quarters Ago'), + value: "q", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 187, + columnNumber: 29 + } + }), /*#__PURE__*/_react.default.createElement(_Select.default.Option, { + label: (0, _i18n._)('Years Ago'), + value: "y", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 188, + columnNumber: 29 + } + }))), /*#__PURE__*/_react.default.createElement(_RadioList.default, { + "data-test-temp": "radio-list-earliest", + value: fromSnap, + onChange: handleFromSnapChange, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 192, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_RadioList.default.Option, { + "data-test": "no-snap-to", + value: false, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 197, + columnNumber: 25 + } + }, (0, _i18n._)('No snap-to')), /*#__PURE__*/_react.default.createElement(_RadioList.default.Option, { + "data-test": "earliest-begin", + value: true, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 200, + columnNumber: 25 + } + }, (0, _format.sprintf)((0, _i18n._)('Beginning of %(timeUnit)s'), { + timeUnit + }))), /*#__PURE__*/_react.default.createElement(_AbsoluteValue.default, { + "data-test": "earliest-absolute-value", + error: earliestParseValid ? parseEarliest.error : undefined, + displayValue: earliestParseValid ? parseEarliest.displayValue : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 204, + columnNumber: 21 + } + })), /*#__PURE__*/_react.default.createElement(_Styles.FlexControlGroup, { + controlsLayout: "none", + label: (0, _i18n._)('Latest:'), + labelPosition: "top", + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 210, + columnNumber: 17 + } + }, /*#__PURE__*/_react.default.createElement(_RadioList.default, { + "data-test-temp": "radio-list-latest", + value: toSnap, + onChange: handleToSnapChange, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 211, + columnNumber: 21 + } + }, /*#__PURE__*/_react.default.createElement(_RadioList.default.Option, { + "data-test": "now", + value: false, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 216, + columnNumber: 25 + } + }, (0, _i18n._)('Now')), /*#__PURE__*/_react.default.createElement(_RadioList.default.Option, { + "data-test": "latest-begin", + value: true, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 219, + columnNumber: 25 + } + }, (0, _format.sprintf)((0, _i18n._)('Beginning of current %(timeUnit)s'), { + timeUnit + }))), /*#__PURE__*/_react.default.createElement(_AbsoluteValue.default, { + "data-test": "latest-absolute-value", + error: latestParseValid ? parseLatest.error : undefined, + displayValue: latestParseValid ? parseLatest.displayValue : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 223, + columnNumber: 21 + } + }))), /*#__PURE__*/_react.default.createElement(_Styles.StyledApplyContainer, { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 230, + columnNumber: 13 + } + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + label: (0, _i18n._)('Apply'), + disabled: !earliestParseValid || !latestParseValid || !!(parseEarliest && parseEarliest.error) || !!(parseEarliest && parseLatest.error), + "data-test": "apply", + onClick: handleApply, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 231, + columnNumber: 17 + } + }))); +}; + +Relative.defaultProps = { + onChange: _lodash.noop, + open: false +}; +var _default = Relative; +exports["default"] = _default; + +/***/ }), + +/***/ 12169: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StyledFromControl = exports.StyledApplyContainer = exports.FlexControlGroup = exports.StyledCGWrapper = exports.StyledError = void 0; + +var _styledComponents = _interopRequireDefault(__webpack_require__(92568)); + +var _ControlGroup = _interopRequireDefault(__webpack_require__(37801)); + +var _themes = __webpack_require__(61572); + +const StyledError = _styledComponents.default.div` + padding: 0 ${_themes.variables.spacingLarge}; +`; +exports.StyledError = StyledError; +const StyledCGWrapper = _styledComponents.default.div` + display: flex; + padding: ${_themes.variables.spacingSmall} ${_themes.variables.spacingLarge} 0; + + ${ +/* sc-sel */ +StyledError} + & { + padding-top: 0; + } +`; +exports.StyledCGWrapper = StyledCGWrapper; +const FlexControlGroup = (0, _styledComponents.default)(_ControlGroup.default)` + & { + flex: 1; + } + + &:first-child { + margin-top: 0; + padding-right: ${_themes.variables.spacingLarge}; + } +`; +exports.FlexControlGroup = FlexControlGroup; +const StyledApplyContainer = _styledComponents.default.div` + text-align: right; + padding: 0 ${_themes.variables.spacingLarge} ${_themes.variables.spacingLarge}; + + & > button { + min-width: 100px; + } +`; +exports.StyledApplyContainer = StyledApplyContainer; +const StyledFromControl = _styledComponents.default.div` + display: flex; + margin-bottom: ${_themes.variables.spacingSmall}; +`; +exports.StyledFromControl = StyledFromControl; + +/***/ }), + +/***/ 34087: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = {}; +Object.defineProperty(exports, "default", ({ + enumerable: true, + get: function () { + return _Dialog.default; + } +})); + +var _Dialog = _interopRequireWildcard(__webpack_require__(27091)); + +Object.keys(_Dialog).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _Dialog[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _Dialog[key]; + } + }); +}); + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +/***/ }), + +/***/ 56452: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _lodash = __webpack_require__(2543); + +const styleOrData = extra => (value, key) => { + switch (key) { + case 'style': + case 'className': + return true; + + default: + if (extra && extra.has(key)) { + return true; + } + + return key.startsWith('data-') || key.startsWith('aria-'); + } +}; + +const stylesAndData = (props, extra) => (0, _lodash.pickBy)(props, styleOrData(extra)); + +var _default = stylesAndData; +exports["default"] = _default; + +/***/ }), + +/***/ 50789: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _extends2 = _interopRequireDefault(__webpack_require__(94634)); + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _lodash = __webpack_require__(2543); + +var _time = __webpack_require__(1115); + +var _Button = _interopRequireDefault(__webpack_require__(70181)); + +var _Dropdown = _interopRequireDefault(__webpack_require__(73592)); + +var _Dialog = _interopRequireWildcard(__webpack_require__(34087)); + +var _stylesAndData = _interopRequireDefault(__webpack_require__(56452)); + +var _jsxFileName = "/builds/swp/ui-platform/projects/lib/search-components/react-time-range/src/Dropdown/Dropdown.tsx"; + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +var Appearance; + +(function (Appearance) { + Appearance["default"] = "default"; + Appearance["primary"] = "primary"; + Appearance["pill"] = "pill"; + Appearance["toggle"] = "toggle"; + Appearance["flat"] = "flat"; +})(Appearance || (Appearance = {})); + +var CloseReasons; + +(function (CloseReasons) { + CloseReasons["clickAway"] = "clickAway"; + CloseReasons["escapeKey"] = "escapeKey"; + CloseReasons["offScreen"] = "offScreen"; + CloseReasons["toggleClick"] = "toggleClick"; +})(CloseReasons || (CloseReasons = {})); + +const TimeRange = props => { + const { + onChange, + appearance, + append, + describedBy, + disabled, + earliest, + inline, + labelMaxChars, + latest, + prepend, + presets + } = props; + const dropdownRef = (0, _react.useRef)(null); + const [open, setOpen] = (0, _react.useState)(false); + + const focus = () => { + const { + current + } = dropdownRef; + + if (current) { + current.focus(); + } + }; + + const handleChange = (e, data) => { + setOpen(false); + onChange(e, data); + focus(); + }; + + const handleRequestClose = ({ + reason + }) => { + if (reason !== 'contentClick') { + setOpen(false); + } + }; + + const handleRequestOpen = () => { + setOpen(true); + }; + + const ariaLabel = props['aria-label']; + const label = (0, _time.createRangeLabel)(earliest, latest, { + presets, + maxChars: labelMaxChars + }); + const closeReasons = Object.keys(CloseReasons); + + const toggle = /*#__PURE__*/_react.default.createElement(_Button.default, (0, _extends2.default)({ + appearance: appearance, + disabled: disabled, + label: label, + append: append, + prepend: prepend, + inline: inline, + isMenu: true, + "aria-describedby": describedBy, + "data-test": "time-range-dropdown", + "data-test-earliest": earliest, + "data-test-latest": latest, + ref: dropdownRef + }, (0, _stylesAndData.default)(props), { + "aria-label": ariaLabel ? `${ariaLabel}, ${label}` : undefined, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 101, + columnNumber: 9 + } + })); + + return /*#__PURE__*/_react.default.createElement(_Dropdown.default, { + inline: inline, + open: open, + retainFocus: true, + toggle: toggle, + closeReasons: closeReasons, + onRequestClose: handleRequestClose, + onRequestOpen: handleRequestOpen, + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 120, + columnNumber: 9 + } + }, open && /*#__PURE__*/_react.default.createElement(_Dialog.default, (0, _extends2.default)({ + onChange: handleChange, + style: { + width: 640 + } + }, (0, _lodash.omit)(props, 'appearance', 'disabled', 'prepend', 'append', 'describedBy', 'onChange', 'labelMaxChars', 'data-test', 'style', 'className'), { + __self: void 0, + __source: { + fileName: _jsxFileName, + lineNumber: 130, + columnNumber: 17 + } + }))); +}; + +TimeRange.defaultProps = { + appearance: Appearance.toggle, + advancedInputTypes: _Dialog.possibleAdvancedInputTypes, + disabled: false, + inline: true, + formInputTypes: _Dialog.possibleFormInputTypes, + labelMaxChars: 30, + onChange: _lodash.noop +}; +var _default = TimeRange; +exports["default"] = _default; + +/***/ }), + +/***/ 10450: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = {}; +Object.defineProperty(exports, "default", ({ + enumerable: true, + get: function () { + return _Dropdown.default; + } +})); + +var _Dropdown = _interopRequireWildcard(__webpack_require__(50789)); + +Object.keys(_Dropdown).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _Dropdown[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _Dropdown[key]; + } + }); +}); + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +/***/ }), + +/***/ 92233: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = SplunkThemeProvider; + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _styledComponents = __webpack_require__(92568); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +/** SplunkThemeProvider defaults to `prisma` `dark` `comfortable`, unless the properties have already been set. + * + * For example, here the nested `SplunkThemeProvider` defaults to `enterprise` `light`: + * ```jsx + * return ( + * + * Main part of the page in enterprise-light-comfortable. + * + * Part of the page in enterprise-light-compact. + * + * + * ) + */ +function SplunkThemeProvider(_ref) { + var family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density, + additionalThemeProperties = _ref.additionalThemeProperties, + customizeTheme = _ref.customizeTheme, + otherProps = _objectWithoutProperties(_ref, ["family", "colorScheme", "density", "additionalThemeProperties", "customizeTheme"]); + + var _ref2 = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + _ref2$splunkThemeV = _ref2.splunkThemeV1, + splunkThemeV1 = _ref2$splunkThemeV === void 0 ? {} : _ref2$splunkThemeV; + + var composedTheme = _objectSpread(_objectSpread({}, additionalThemeProperties), {}, { + splunkThemeV1: { + family: family || splunkThemeV1.family || 'prisma', + colorScheme: colorScheme || splunkThemeV1.colorScheme || 'dark', + density: density || splunkThemeV1.density || 'comfortable', + customizer: customizeTheme || splunkThemeV1.customizer + } + }); + + return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, _extends({ + theme: composedTheme + }, otherProps)); +} + +/***/ }), + +/***/ 93466: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * + * @valueSet + */ +var measures = { + spacingQuarter: '5px', + spacingHalf: '10px', + spacing: '20px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '32px', + borderRadius: '3px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 94067: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * * Larger containers, such as `Card` or `Modal`, use `spacing`. + * * `spacingHalf` and `spacingQuarter` are primarily for horizontal spacing between smaller elements. + * * Just because a desired value equals 20, 10, or 5 pixels, does not mean it's appropriate to + * use spacing variables. + * + * @valueSet + */ +var measures = { + spacingQuarter: '5px', + spacingHalf: '10px', + spacing: '20px', + fontSizeSmall: '12px', + fontSize: '12px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '28px', + borderRadius: '3px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 74976: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(4174)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var dragHandleDark = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAXEgAAFxIBZ5/SUgAAAW5pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICAgICAgICAgPGRjOnN1YmplY3Q+CiAgICAgICAgICAgIDxyZGY6QmFnLz4KICAgICAgICAgPC9kYzpzdWJqZWN0PgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4K72CKvQAAADdJREFUOBFj/PDp00cGJCDAx8ePxGUgJM+ErJgc9sAbQI6rh5seRkLxTEh+4KORYhcMtzglxz8AtKEQD3hiWXMAAAAASUVORK5CYII="; // see babel-plugin-base64-png + +var dark = { + backgroundColor: _light["default"].gray20, + backgroundColorHover: _light["default"].gray30, + borderColor: _light["default"].gray22, + borderDarkColor: _light["default"].black, + borderLightColor: _light["default"].gray60, + textColor: _light["default"].white, + textGray: _light["default"].gray92, + textDisabledColor: _light["default"].gray45, + linkColor: _light["default"].accentColorL10, + linkColorHover: _light["default"].accentColorL20, + border: "1px solid ".concat(_light["default"].gray22), + borderDark: "1px solid ".concat(_light["default"].black), + borderLight: "1px solid ".concat(_light["default"].gray60), + focusShadowInset: "inset 0 0 1px 1px ".concat(_light["default"].gray25, ", inset 0 0 0 3px ").concat(_light["default"].focusColor), + draggableBackground: "url('data:image/png;base64,".concat(dragHandleDark, "') 0 0 / 8px 8px repeat") +}; + +var theme = _objectSpread(_objectSpread({}, _light["default"]), dark); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 47490: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(4174)); + +var _dark = _interopRequireDefault(__webpack_require__(74976)); + +var _compact = _interopRequireDefault(__webpack_require__(94067)); + +var _comfortable = _interopRequireDefault(__webpack_require__(93466)); + +var _prismaAliases = _interopRequireDefault(__webpack_require__(50166)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function createEnterpriseTheme(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var cs = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var d = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + var pa = (0, _prismaAliases["default"])({ + colorScheme: colorScheme, + density: density + }); + return _objectSpread(_objectSpread(_objectSpread({}, cs), d), pa); +} + +var _default = createEnterpriseTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 4174: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var dragHandle = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAG0lEQVR4AWMAgioUjAoIyg9xAxBgFIymg1EAAD/iHoHfZJ8OAAAAAElFTkSuQmCC"; // see babel-plugin-base64-pngimport { + +/** + * # Brand Colors + * + * @colorSet + */ + +var brandColors = { + brandColorL50: '#f5fbf5', + brandColorL40: '#dff2df', + brandColorL30: '#bee6be', + brandColorL20: '#9ed99e', + brandColorL10: '#7ecd7e', + brandColor: '#5cc05c', + brandColorD10: '#49b849', + brandColorD20: '#40a540', + brandColorD30: '#389038', + brandColorD40: '#307b30', + brandColorD50: '#286728' +}; +/** + * # Grayscale Colors + * + * @colorSet + */ + +var grays = { + white: '#ffffff', + gray98: '#f7f8fa', + gray96: '#f2f4f5', + gray92: '#e1e6eb', + gray80: '#c3cbd4', + gray60: '#818d99', + gray45: '#5c6773', + gray30: '#3c444d', + gray25: '#31373e', + gray22: '#2b3033', + gray20: '#171d21', + black: '#000000' +}; +/** + * # Accent Colors + * + * @colorSet + */ + +var accentColors = { + accentColorL50: '#ecf8ff', + accentColorL40: '#bfe9ff', + accentColorL30: '#7ed2ff', + accentColorL20: '#3ebcff', + accentColorL10: '#00a4fd', + accentColor: '#007abd', + accentColorD10: '#006eaa', + accentColorD20: '#006297', + accentColorD30: '#005684', + accentColorD40: '#004a71', + accentColorD50: '#003d5e' +}; +/** + * # Error Colors + * + * @colorSet + */ + +var errorColors = { + errorColorL50: '#fcedec', + errorColorL40: '#f8dcd9', + errorColorL30: '#f1b9b3', + errorColorL20: '#ea958d', + errorColorL10: '#e37267', + errorColor: '#dc4e41', + errorColorD10: '#c84535', + errorColorD20: '#b23d30', + errorColorD30: '#9c3529', + errorColorD40: '#852d24', + errorColorD50: '#6f261d' +}; +/** + * # Alert Colors + * + * @colorSet + * */ + +var alertColors = { + alertColorL50: '#fef3ec', + alertColorL40: '#fde6d9', + alertColorL30: '#facdb3', + alertColorL20: '#f7b48c', + alertColorL10: '#f49b66', + alertColor: '#f1813f', + alertColorD10: '#da742e', + alertColorD20: '#c2672a', + alertColorD30: '#aa5a25', + alertColorD40: '#914d1f', + alertColorD50: '#79401a' +}; +/** + * # Warning Colors + * + * @colorSet + */ + +var warningColors = { + warningColorL50: '#fff9eb', + warningColorL40: '#fef2d7', + warningColorL30: '#fde5ae', + warningColorL20: '#fbd886', + warningColorL10: '#facb5d', + warningColor: '#f8be34', + warningColorD10: '#e0ac16', + warningColorD20: '#c79915', + warningColorD30: '#ae8613', + warningColorD40: '#957312', + warningColorD50: '#7d600f' +}; +/** + * # Success Colors + * + * @colorSet + */ + +var successColors = { + successColorL50: '#eef6ee', + successColorL40: '#ddecdd', + successColorL30: '#bbd9ba', + successColorL20: '#98c697', + successColorL10: '#76b374', + successColor: '#53a051', + successColorD10: '#479144', + successColorD20: '#40813d', + successColorD30: '#387135', + successColorD40: '#2f612e', + successColorD50: '#275126' +}; +/** + * # Info Colors + * + * @colorSet + */ + +var infoColors = { + infoColorL50: '#e5f0f5', + infoColorL40: '#cce2eb', + infoColorL30: '#99c5d7', + infoColorL20: '#66a7c4', + infoColorL10: '#338ab0', + infoColor: '#006d9c', + infoColorD10: '#00577c', + infoColorD20: '#004c6c', + infoColorD30: '#00415d', + infoColorD40: '#00364d', + infoColorD50: '#002b3e' +}; +/** + * # Diverging Colors + * + * @colorSet alphabetical + */ + +var divergingColors = { + diverging1ColorA: '#006d9c', + diverging1ColorB: '#ec9960', + diverging2ColorA: '#af575a', + diverging2ColorB: '#62b3b2', + diverging3ColorA: '#4fa484', + diverging3ColorB: '#f8be34', + diverging4ColorA: '#5a4575', + diverging4ColorB: '#708794', + diverging5ColorA: '#294e70', + diverging5ColorB: '#b6c75a' +}; +/** + * # Categorical Colors + * + * @colorSet alphabetical + */ + +var categoricalColors = { + cat1Color: '#297ba5', + cat1ColorL: '#78b9d6', + cat2Color: '#4fa484', + cat2ColorL: '#74d5c2', + cat3Color: '#b6c75a', + cat3ColorL: '#dce6a5', + cat4Color: '#3c6188', + cat4ColorL: '#a0b2ca', + cat5Color: '#ec9960', + cat5ColorL: '#fac9a7', + cat6Color: '#a65c7d', + cat6ColorL: '#d3a7ba', + cat7Color: '#708794', + cat7ColorL: '#b2c0c8', + cat8Color: '#38b8bf', + cat8ColorL: '#92dde2', + cat9Color: '#ffde63', + cat9ColorL: '#ffeeae', + cat10Color: '#c19975', + cat10ColorL: '#d7bfab', + cat11Color: '#5a4575', + cat11ColorL: '#b7acca', + cat12Color: '#7ea77b', + cat12ColorL: '#b2cab0', + cat13Color: '#576d83', + cat13ColorL: '#a5b2bf', + cat14Color: '#d7c6b7', + cat14ColorL: '#e9ddd4', + cat15Color: '#339bb2', + cat15ColorL: '#66c3d0', + cat16Color: '#236d9b', + cat16ColorL: '#66a7c2', + cat17Color: '#e5dc80', + cat17ColorL: '#f1eab7', + cat18Color: '#96907f', + cat18ColorL: '#c1bcb3', + cat19Color: '#87bc65', + cat19ColorL: '#b6d7a3', + cat20Color: '#cf7e60', + cat20ColorL: '#e1b2a1', + cat21Color: '#7b5547', + cat21ColorL: '#dec4ba', + cat22Color: '#77d6d8', + cat22ColorL: '#abe6e8', + cat23Color: '#4a7f2c', + cat23ColorL: '#91b282', + cat24Color: '#f589ad', + cat24ColorL: '#f8b7ce', + cat25Color: '#6a2c5d', + cat25ColorL: '#cba3c2', + cat26Color: '#aaabae', + cat26ColorL: '#cccdce', + cat27Color: '#9a7438', + cat27ColorL: '#c3ab89', + cat28Color: '#a4d563', + cat28ColorL: '#c7e6a3', + cat29Color: '#7672a4', + cat29ColorL: '#ada9c8', + cat30Color: '#184b81', + cat30ColorL: '#a4bbe0' +}; +/** + * # Usage-based Colors + * + * @colorSet verbose + */ + +var usageColors = { + textColor: grays.gray30, + textGray: '#6b7785', + textDisabledColor: grays.gray80, + linkColor: accentColors.accentColorD10, + linkColorHover: accentColors.accentColor, + borderLightColor: grays.gray92, + borderColor: grays.gray80, + focusColor: accentColors.accentColorD10, + backgroundColorHover: grays.gray96, + backgroundColor: grays.white, + transparent: 'transparent' +}; +/** + * # Syntax Colors + * The following colors should only be used for syntax coloring of code. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#2662fc', + syntaxBlueLight: '#006d9c', + syntaxBrown: '#a67f59', + syntaxGray: '#8293a7', + syntaxGreen: '#5ca300', + syntaxGreenLight: '#5ba383', + syntaxOrange: '#f58220', + syntaxPink: '#cf00cf', + syntaxPurple: '#7738ff', + syntaxPurpleLight: '#b19cd9', + syntaxRed: '#d90700', + syntaxRedLight: '#af575a', + syntaxTeal: '#00a8ab' +}; +/** + * # Shadows + * + * @shadowSet + */ + +var shadows = { + focusShadow: "0 0 1px 3px ".concat(usageColors.focusColor), + focusShadowInset: "inset 0 0 1px 1px ".concat(grays.white, ", inset 0 0 0 3px ").concat(usageColors.focusColor), + overlayShadow: '0 4px 8px rgba(0, 0, 0, 0.2)' +}; +/** + * # Backgrounds + * + * @colorSet verbose + */ + +var backgrounds = { + draggableBackground: "url('data:image/png;base64,".concat(dragHandle, "') 0 0 / 8px 8px repeat") +}; +/** + * # Border + * + * @valueSet + */ + +var borders = { + borderRadius: '3px', + border: "1px solid ".concat(usageColors.borderColor) +}; +var sansFontFamily = "'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif"; +/** + * # Fonts + * + * @valueSet + */ + +var fonts = { + sansFontFamily: sansFontFamily, + serifFontFamily: "Georgia, 'Times New Roman', Times, serif", + monoFontFamily: "'Splunk Platform Mono', Inconsolata, Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace", + fontFamily: sansFontFamily, + fontWeightBold: '700', + fontWeightSemiBold: '500' +}; +/** + * # Layers + * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1. + * + * @valueSet + */ + +var zindexes = { + zindexFixedNavbar: 1030, + zindexModalBackdrop: 1040, + zindexModal: 1050, + zindexPopover: 1060, + zindexToastMessages: 2000 +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors), fonts), usageColors), backgrounds), shadows), borders), zindexes); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 50166: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _light = _interopRequireDefault(__webpack_require__(4174)); + +var _dark = _interopRequireDefault(__webpack_require__(74976)); + +var _compact = _interopRequireDefault(__webpack_require__(94067)); + +var _comfortable = _interopRequireDefault(__webpack_require__(93466)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function createPrismaAliases(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var cs = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var d = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + /** + * # Prisma Aliases + * The following aliases for prisma variables are provided for convenience. Just because an alias is provided, + * does not mean it is ideal for enterprise themes in all scenarios. + * + * They cover all values except most `interactiveColor*` variables. + * + * @valueSet + */ + + var prismaAliases = { + accentColorPositive: cs.successColor, + accentColorWarning: cs.warningColor, + accentColorAlert: cs.alertColor, + accentColorNegative: cs.errorColor, + statusColorInfo: cs.infoColorL10, + statusColorNormal: cs.successColorL10, + statusColorLow: cs.warningColorL10, + statusColorMedium: cs.alertColorL10, + statusColorHigh: cs.errorColorL10, + statusColorCritical: cs.errorColorD20, + embossShadow: cs.overlayShadow, + dragShadow: cs.overlayShadow, + modalShadow: cs.overlayShadow, + backgroundColorPopup: cs.backgroundColor, + backgroundColorSection: cs.backgroundColor, + backgroundColorSidebar: cs.backgroundColor, + backgroundColorPage: cs.backgroundColor, + backgroundColorNavigation: cs.backgroundColor, + backgroundColorFloating: cs.backgroundColor, + backgroundColorModal: cs.backgroundColor, + backgroundColorScrim: (0, _tinycolor["default"])(cs.gray30).setAlpha(0.8).toRgbString(), + contentColorActive: cs.textColor, + contentColorDefault: cs.textColor, + contentColorMuted: cs.textGray, + contentColorDisabled: cs.textDisabledColor, + contentColorInverted: colorScheme === 'dark' ? cs.gray30 : cs.gray30, + neutral100: colorScheme === 'dark' ? cs.gray25 : cs.gray98, + neutral200: colorScheme === 'dark' ? cs.gray30 : cs.gray96, + neutral300: colorScheme === 'dark' ? cs.gray45 : cs.gray92, + neutral400: colorScheme === 'dark' ? cs.gray60 : _tinycolor["default"].mix(cs.gray92, cs.gray80).toRgbString(), + neutral500: cs.gray80, + interactiveColorPrimary: cs.brandColor, + interactiveColorBorder: cs.borderColor, + spacingXSmall: d.spacingQuarter, + spacingSmall: d.spacingHalf, + spacingMedium: "calc(".concat(d.spacing, " * 0.75)"), + spacingLarge: d.spacing, + spacingXLarge: "calc(".concat(d.spacing, " * 1.5)"), + spacingXXLarge: "calc(".concat(d.spacing, " * 2)"), + spacingXXXLarge: "calc(".concat(d.spacing, " * 2.5)") + }; + return prismaAliases; +} + +var _default = createPrismaAliases; +exports["default"] = _default; + +/***/ }), + +/***/ 64922: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _utils = __webpack_require__(16077); + +/** + * The theme settings in `props.theme` are not considered an API to allow support for fallbacks + * and forward compatibility in future versions of `SplunkThemeProvider`. Use this utility to + * access `family`, `colorScheme`, and `density` from a component's props. This is useful + * in limited migration scenarios. Use `withSplunkTheme` or `useSplunkTheme` instead. + * + * ```js + * import getSettingsFromThemedProps from '@splunk/themes/getSettingsFromThemedProps'; + * ... + * const { family, colorScheme } = getSettingsFromThemedProps(props); + * + * ``` + * @param {object} props - The themed props passed to a styled-component. + * @returns {object} An object consisting of `{ family, colorScheme, density }`. + * @public + */ +function getSettingsFromThemedProps(props) { + var _props$theme; + + // props.theme is sometimes null + var _ref = ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.splunkThemeV1) || {}, + family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + + return (0, _utils.addThemeDefaults)({ + family: family, + colorScheme: colorScheme, + density: density + }); +} + +var _default = getSettingsFromThemedProps; +exports["default"] = _default; + +/***/ }), + +/***/ 23371: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearGetThemeCache = exports["default"] = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _enterprise = _interopRequireDefault(__webpack_require__(47490)); + +var _prisma = _interopRequireDefault(__webpack_require__(40069)); + +var _utils = __webpack_require__(16077); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * **NOTE:** Use cases for this function are limited. Instead, use `useSplunkTheme` in React components and `variables` in styled-components' CSS. + * This function is for use outside of React and styled-components. + * @file + */ + +/** + * The `getTheme` function returns all theme variables for a given theme. This function is memoized. + * + * ```js + * import getTheme from '@splunk/themes/getTheme'; + * + * const baseTheme = getTheme({family: 'prisma', colorScheme: 'light', density: 'compact' }); + * + * console.log(baseTheme.family, baseTheme.focusColor); + * ``` + * @param {object} [options] - The attributes of the theme as defined below. + * @param {'prisma' | 'enterprise'} [options.family = 'prisma'] + * @param {'dark' | 'light'} [options.colorScheme = 'dark'] + * @param {'comfortable' | 'compact'} [options.density = 'comfortable'] + * @returns {object} A flat object of all variables and their values. + * @public + */ +function getTheme() { + var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var _addThemeDefaults = (0, _utils.addThemeDefaults)(settings), + family = _addThemeDefaults.family, + colorScheme = _addThemeDefaults.colorScheme, + density = _addThemeDefaults.density; + + return Object.freeze(_objectSpread({ + colorScheme: colorScheme, + density: density, + family: family + }, family === 'enterprise' ? (0, _enterprise["default"])({ + colorScheme: colorScheme, + density: density + }) : (0, _prisma["default"])({ + colorScheme: colorScheme, + density: density + }))); +} + +var getThemeMemoized = (0, _memoize["default"])(getTheme, function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + + return "".concat(family).concat(colorScheme).concat(density); +}); + +var clearGetThemeCache = function clearGetThemeCache() { + var _getThemeMemoized$cac, _getThemeMemoized$cac2; + + return (_getThemeMemoized$cac = (_getThemeMemoized$cac2 = getThemeMemoized.cache).clear) === null || _getThemeMemoized$cac === void 0 ? void 0 : _getThemeMemoized$cac.call(_getThemeMemoized$cac2); +}; + +exports.clearGetThemeCache = clearGetThemeCache; +var _default = getThemeMemoized; +exports["default"] = _default; + +/***/ }), + +/***/ 61572: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + getSettingsFromThemedProps: true, + getTheme: true, + mixins: true, + pick: true, + pickVariant: true, + SplunkThemeProvider: true, + useSplunkTheme: true, + withSplunkTheme: true, + variables: true +}; +Object.defineProperty(exports, "getSettingsFromThemedProps", ({ + enumerable: true, + get: function get() { + return _getSettingsFromThemedProps["default"]; + } +})); +Object.defineProperty(exports, "getTheme", ({ + enumerable: true, + get: function get() { + return _getTheme["default"]; + } +})); +Object.defineProperty(exports, "mixins", ({ + enumerable: true, + get: function get() { + return _mixins["default"]; + } +})); +Object.defineProperty(exports, "pick", ({ + enumerable: true, + get: function get() { + return _pick["default"]; + } +})); +Object.defineProperty(exports, "pickVariant", ({ + enumerable: true, + get: function get() { + return _pickVariant["default"]; + } +})); +Object.defineProperty(exports, "SplunkThemeProvider", ({ + enumerable: true, + get: function get() { + return _SplunkThemeProvider["default"]; + } +})); +Object.defineProperty(exports, "useSplunkTheme", ({ + enumerable: true, + get: function get() { + return _useSplunkTheme["default"]; + } +})); +Object.defineProperty(exports, "withSplunkTheme", ({ + enumerable: true, + get: function get() { + return _withSplunkTheme["default"]; + } +})); +Object.defineProperty(exports, "variables", ({ + enumerable: true, + get: function get() { + return _variables["default"]; + } +})); + +var _getSettingsFromThemedProps = _interopRequireDefault(__webpack_require__(64922)); + +var _getTheme = _interopRequireDefault(__webpack_require__(23371)); + +var _mixins = _interopRequireDefault(__webpack_require__(20460)); + +var _pick = _interopRequireDefault(__webpack_require__(95883)); + +var _pickVariant = _interopRequireDefault(__webpack_require__(29350)); + +var _SplunkThemeProvider = _interopRequireDefault(__webpack_require__(92233)); + +var _useSplunkTheme = _interopRequireDefault(__webpack_require__(68259)); + +var _withSplunkTheme = _interopRequireDefault(__webpack_require__(87080)); + +var _variables = _interopRequireDefault(__webpack_require__(97689)); + +var _types = __webpack_require__(13089); + +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _types[key]; + } + }); +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/***/ }), + +/***/ 20460: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearfix = clearfix; +exports.ellipsis = ellipsis; +exports.printWidth100Percent = printWidth100Percent; +exports.printHide = printHide; +exports.printNoBackground = printNoBackground; +exports.printWrapAll = printWrapAll; +exports.screenReaderContent = screenReaderContent; +exports.overlayColors = overlayColors; +exports.colorWithAlpha = colorWithAlpha; +exports["default"] = exports.reset = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _styledComponents = __webpack_require__(92568); + +var _colorBlend = __webpack_require__(94581); + +var _variables = _interopRequireDefault(__webpack_require__(97689)); + +var _pick = _interopRequireDefault(__webpack_require__(95883)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n /* Generic resets */\n animation: none 0s ease 0s 1 normal none running;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n box-shadow: none;\n caption-side: top;\n clear: none;\n clip: auto;\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n empty-cells: show;\n float: none;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n list-style: disc outside none;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n pointer-events: auto;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-origin: 50% 50% 0;\n transform-style: flat;\n transition: none 0s ease 0s;\n user-select: auto;\n vertical-align: baseline;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n /* Splunk-specific resets */\n border-width: 1px;\n box-sizing: border-box;\n color: ", ";\n cursor: inherit;\n display: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +/** + * @file + * A collection of style-related helper functions. All of them return a single object containing + * DOM CSS properties, for example: `{ display: …, fontFamily: … }`. + */ + +/** + * The `reset` mixin resets css properties to their browser defaults, plus many to + * theme-specific values. This ensures an element is not inheriting inappropriate styles. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { reset } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${reset('block')}; + * ` + * ``` + * @name reset + * @kind function + * @param {string} [display=inline] Set the `display` property (block, inline-block, …) + * @public + */ +var reset = function reset() { + var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline'; + return function () { + return (0, _styledComponents.css)(_templateObject(), (0, _pick["default"])({ + enterprise: _variables["default"].textColor, + prisma: _variables["default"].contentColorDefault + }), display, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor); + }; +}; +/** + * `clearfix` is used on a container to ensure its height is at least as tall as any floating + * children. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { clearfix } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${clearfix()}; + * ` + * ``` + * @public + */ + + +exports.reset = reset; + +function clearfix() { + return { + '&::after': { + display: 'table', + content: '""', + clear: 'both' + } + }; +} +/** + * Use `ellipsis` for overflowing text. Requires `display` to be set to `inline-block` or `block`. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { ellipsis } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${clearfix()}; + * width: 300px; + * ` + * ``` + * @public + */ + + +function ellipsis() { + return { + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap' + }; +} +/** + * Force an element to be exactly 100% wide so that it doesn't overflow the page. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printWidth100Percent } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printWidth100Percent()}; + * } + * } + * } + * ` + * ``` + * @public + */ + + +function printWidth100Percent() { + return { + maxWidth: '100% !important', + width: '100% !important', + overflow: 'hidden !important' + }; +} +/** + * Hide an element (such as a button). + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printHide } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printHide()}; + * } + * } + * } + * ``` + * @public + */ + + +function printHide() { + return { + display: 'none !important' + }; +} +/** + * Remove background gradients and images. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printNoBackground } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printNoBackground()}; + * } + * } + * } + * ``` + * @public + */ + + +function printNoBackground() { + return { + background: 'none !important' + }; +} +/** + * Ensure that all text wraps so that it doesn't overflow the page. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printWrapAll } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printWrapAll()}; + * } + * } + * } + * ``` + * @public + */ + + +function printWrapAll() { + // TS: have to assert as CSSObject because csstype doesn't allow !important + return { + wordBreak: 'break-all !important', + wordWrap: 'break-word !important', + overflowWrap: 'break-word !important', + whiteSpace: 'normal !important' + }; +} +/** + * Visually hide content. Typically used to target content for assistive technologies. + * + * ##### Example + * ``` js + * import screenReaderContent from '@splunk/themes/mixins'; + * + * .myElement { + * ${props => props.theme.mixins.screenReaderContent()}; + * } + * ``` + * @public + */ + + +function screenReaderContent() { + return { + position: 'absolute', + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + height: '1px', + width: '1px', + margin: '-1px', + padding: 0, + border: 0 + }; +} + +/** + * Calculates how one color would appear over another using a normal blend mode. + * Colors can either be strings or functions, such as variable functions. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { overlayColors } from '@splunk/themes/mixins'; + * import { interactiveColorPrimary, interactiveColorOverlaySelected } from '@splunk/themes/variables'; + * + * const myButton = styled.button` + * background: ${overlayColors(interactiveColorPrimary, interactiveColorOverlaySelected)}; + * ` + * ``` + * @name overlayColors + * @kind function + * @param {string|function} background + * @param {string|function} foreground The color to overlay over the background. + * @public + */ +function overlayColors(c1, c2) { + return function (props) { + var c1Value = typeof c1 === 'function' ? c1(props) : c1; + var c2Value = typeof c2 === 'function' ? c2(props) : c2; + var c3 = (0, _colorBlend.normal)((0, _tinycolor["default"])(c1Value).toRgb(), (0, _tinycolor["default"])(c2Value).toRgb()); + return (0, _tinycolor["default"])(c3).toRgbString(); + }; +} +/** + * Sets the alpha value on a given color. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { colorWithAlpha } from '@splunk/themes/mixins'; + * import { interactiveColorPrimary } from '@splunk/themes/variables'; + * + * const myButton = styled.button` + * background: ${colorWithAlpha(interactiveColorPrimary, 0.5)}; + * ` + * ``` + * @name colorWithAlpha + * @kind function + * @param {string|function} color + * @param {number} alpha The alpha value accepts range between 0-1. + * @public + */ + + +function colorWithAlpha(color, alpha) { + return function (props) { + var colorValue = typeof color === 'function' ? color(props) : color; + + if (false) {} + + return (0, _tinycolor["default"])(colorValue).setAlpha(alpha).toRgbString(); + }; +} + +var _default = { + reset: reset, + clearfix: clearfix, + ellipsis: ellipsis, + printWidth100Percent: printWidth100Percent, + printHide: printHide, + printNoBackground: printNoBackground, + printWrapAll: printWrapAll, + screenReaderContent: screenReaderContent, + colorWithAlpha: colorWithAlpha, + overlayColors: overlayColors +}; +exports["default"] = _default; + +/***/ }), + +/***/ 95883: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isInterpolationResult = isInterpolationResult; +exports["default"] = exports.getThemeVariant = void 0; + +var _utils = __webpack_require__(16077); + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var valueToKey = { + enterprise: 'family', + prisma: 'family', + light: 'colorScheme', + dark: 'colorScheme', + compact: 'density', + comfortable: 'density' +}; + +function isInterpolationResult(tree) { + // for this to work as expected for objects/CSSProperties, it may be necessary to change + // it to only consider objects that have valid pick tree keys (but no other keys) + // as trees + return _typeof(tree) !== 'object' || Array.isArray(tree) || tree === null; +} +/** + * This function is exported for use in pickVariant exclusively. + */ + + +var getThemeVariant = function getThemeVariant(tree, theme) { + // If it's not an object with one of the six keys, it must be an end value. + var treeKey = Object.keys(tree).shift(); + + if (!treeKey) { + throw new Error('A pick tree cannot be empty.'); + } + + var themeKey = valueToKey[treeKey]; + + if (!themeKey) { + throw new Error("Invalid pick tree key: ".concat(treeKey)); + } // Recursively crawl the tree. + + + var themeCurrentValue = theme[themeKey]; + var treeValue = tree[themeCurrentValue]; // If it's not an object or it's a null value, it must be the end value. + + if (isInterpolationResult(treeValue)) { + return treeValue; // this may be undefined, when the css does not support the theme + } + + return getThemeVariant(treeValue, theme); +}; +/** + * Pick is used to create theme-specific css. + * + * This example selects an appropriate variable for the current theme. + * ``` + * import { pick, variables } from '@splunk/themes'; + * + * const Wrapper = styled.div` + * padding: ${pick({ + * enterprise: { + * light: variables.grey35, + * dark: variables.grey92, + * }, + * prisma: variables.contentColorDefault, + * })} + * `; + * ``` + * This example selects an appropriate block of css for the current theme. + * ``` + * const Label = styled.div` + * ${pick({ + * enterprise: css` + * font-weight: ${variables.fontWeightSemiBold}; + * `, + * prisma: css` + * color: ${variables.contentColorDefault), + * `, + * })} + * `; + * ``` + * @param {object} themeOptions - An object consisting of a tree of theme options (`enterprise|prisma`, `light|dark`, or `compact|comfortable`). + * @returns {function} The returned function is called by `styled-components`, which provides the theme context. + * @public + */ + + +exports.getThemeVariant = getThemeVariant; + +var pick = function pick(tree) { + return function (_ref) { + var theme = _ref.theme; + var themeCleaned = (0, _utils.addThemeDefaults)(theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1); + return getThemeVariant(tree, themeCleaned); + }; +}; + +var _default = pick; +exports["default"] = _default; + +/***/ }), + +/***/ 29350: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _pick = __webpack_require__(95883); + +var _utils = __webpack_require__(16077); + +/** + * Pick Variant is used to create theme-specific css. + * + * This example selects an appropriate variable for the current theme. + * ``` + * import { pickVariant } from '@splunk/themes'; + * + * ... + * + * const Wrapper = styled.div` + * ${pickVariant('appearance', { + * filled: 'background: red', + * open: 'border: 1px solid red', + * })} + * `; + * ``` + * This example selects an appropriate block of css for the current theme. + * ``` + * const Wrapper = styled.div` + * ${pickVariant('appearance', { + * filled: { + * enterprise: 'background: green', + * prisma: 'background: blue', + * }, + * open: { + * enterprise: 'border: 1px solid green', + * prisma: 'border: 1px solid blue', + * }, + * })} + * `; + * ``` + * @param {string} propName - The prop name used to resolve the variants. The prop value must be a `string` or `boolean`. + * @param {object} themeOptions - An object consisting of a tree of theme options, with the prop variants the top of the tree and optional + * theme variants below (`enterprise|prisma`, `light|dark`, or `compact|comfortable`). + * @returns {function} The returned function is called by `styled-components`, which provides the props and theme context. + * @public + */ +var pickVariant = function pickVariant(propName, tree) { + return function (props) { + var _props$theme; + + // TS: must assume prop value can be used as string key + var variantKey = props[propName]; + var subTree = tree[variantKey]; + + if ((0, _pick.isInterpolationResult)(subTree)) { + return subTree; + } + + var theme = (0, _utils.addThemeDefaults)((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.splunkThemeV1); + return (0, _pick.getThemeVariant)(subTree, theme); + }; +}; + +var _default = pickVariant; +exports["default"] = _default; + +/***/ }), + +/***/ 19392: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _light = _interopRequireDefault(__webpack_require__(36501)); + +var _dark = _interopRequireDefault(__webpack_require__(60765)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function createPrismaBase(_ref) { + var colorScheme = _ref.colorScheme; + var colorSchemeVars = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + /** + * # Misc Colors + * + * @colorSet verbose + */ + + var usageColors = { + focusColor: (0, _tinycolor["default"])(colorSchemeVars.interactiveColorPrimary).setAlpha(0.7).toRgbString(), + transparent: 'transparent', + linkColor: colorSchemeVars.interactiveColorPrimary + }; + /** + * # Interactive State Shadows + * + * @shadowSet + * + */ + + var shadows = { + hoverShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(colorSchemeVars.interactiveColorOverlayHover), + focusShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(usageColors.focusColor), + focusShadowInset: "inset 0 0 0 3px ".concat(usageColors.focusColor) + }; + /** + * # Backgrounds + * + * @colorSet verbose + */ + + var backgrounds = { + draggableBackground: "radial-gradient(circle at 1px 1px, ".concat(colorSchemeVars.contentColorMuted, ", ").concat(colorSchemeVars.contentColorMuted, " 1px, transparent 1px) 0 0 / 4px 6px") + }; + var sansFontFamily = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif"; + /** + * # Fonts + * + * @valueSet + */ + + var fonts = { + sansFontFamily: sansFontFamily, + serifFontFamily: "Georgia, 'Times New Roman', Times, serif", + monoFontFamily: "'Splunk Platform Mono', 'Roboto Mono', Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace", + fontFamily: sansFontFamily, + fontWeightBold: '700', + fontWeightSemiBold: '500' + }; + /** + * # Layers + * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1. + * + * @valueSet + */ + + var zindexes = { + zindexFixedNavbar: 1030, + zindexModalBackdrop: 1040, + zindexModal: 1050, + zindexPopover: 1060, + zindexToastMessages: 2000 + }; + return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fonts), usageColors), shadows), backgrounds), zindexes); +} + +var _default = createPrismaBase; +exports["default"] = _default; + +/***/ }), + +/***/ 71785: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * + * @valueSet + */ +var measures = { + spacingXSmall: '4px', + spacingSmall: '8px', + spacingMedium: '12px', + spacingLarge: '16px', + spacingXLarge: '24px', + spacingXXLarge: '32px', + spacingXXXLarge: '40px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '40px', + borderRadius: '4px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 91000: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * * Larger containers, such as `Card` or `Modal`, use `spacing`. + * * `spacingHalf` and `spacingQuarter` are primarily for horizontal spacing between smaller elements. + * * Just because a desired value equals 20, 10, or 5 pixels, does not mean it's appropriate to + * use spacing variables. + * + * @valueSet + */ +var measures = { + spacingXSmall: '4px', + spacingSmall: '8px', + spacingMedium: '12px', + spacingLarge: '16px', + spacingXLarge: '24px', + spacingXXLarge: '32px', + spacingXXXLarge: '40px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '32px', + borderRadius: '4px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 60765: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * # Background Colors + * Background colors should be used only for backgrounds of higher level sections & containers of a UI. + * + * @colorSet verbose + */ +var backgroundColors = { + backgroundColorPopup: '#27292e', + backgroundColorSection: '#1a1c20', + backgroundColorSidebar: '#0b0c0e', + backgroundColorPage: '#111215', + backgroundColorNavigation: '#08090a', + backgroundColorFloating: '#ffffff', + backgroundColorModal: '#1e2024', + backgroundColorScrim: 'rgba(0, 0, 0, 0.8)' +}; +/** + * # Content Colors + * Content colors should be used for text, icons and dividers. They use transparent colors, to ensure optimal contrast on every background. + * + * @colorSet verbose + */ + +var contentColors = { + contentColorActive: 'rgba(255, 255, 255, 0.98)', + contentColorDefault: 'rgba(255, 255, 255, 0.7)', + contentColorMuted: 'rgba(255, 255, 255, 0.5)', + contentColorDisabled: 'rgba(255, 255, 255, 0.3)', + contentColorInverted: '#000' +}; +/** + * # Interactive Colors + * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content. + * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary. + * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two. + * + * @colorSet verbose + */ + +var interactiveColors = { + interactiveColorPrimary: '#3993FF', + interactiveColorBorder: 'rgba(255, 255, 255, 0.5)', + interactiveColorBorderHover: 'rgba(255, 255, 255, 0.7)', + interactiveColorBorderDisabled: 'rgba(255, 255, 255, 0.30)', + interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)', + interactiveColorOverlayHover: 'rgba(255, 255, 255, 0.05)', + interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.2)', + interactiveColorOverlayDrag: 'rgba(57, 147, 255, 0.16)', + interactiveColorBackground: '#272a2f', + interactiveColorBackgroundDisabled: 'rgba(255, 255, 255, 0.15)' +}; +/** + * # Neutral Colors + * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough. + * + * @colorSet verbose + */ + +var neutralColors = { + black: '#000000', + neutral100: '#33343b', + neutral200: '#43454b', + neutral300: '#505158', + neutral400: '#818285', + neutral500: '#acacad', + white: '#ffffff' +}; +/** + * # Accent Colors + * Accent colors aid and categorize the visual communication of the system response. + * + * @colorSet verbose + */ + +var accentColors = { + accentColorPositive: '#27f561', + accentColorWarning: '#ffd442', + accentColorAlert: '#ff9750', + accentColorNegative: '#ff5c5c' +}; +/** + * # Status Colors + * Status colors are reserved for communicating urgency and severity associated with data objects. + * + * @colorSet verbose + */ + +var statusColors = { + statusColorInfo: '#61cafa', + statusColorNormal: '#85eb48', + statusColorLow: '#fae75f', + statusColorMedium: '#f5b53f', + statusColorHigh: '#ec4B43', + statusColorCritical: '#a81916' +}; +/** + * # Elevation Shadows + * + * @shadowSet + * + */ + +var elevationShadows = { + embossShadow: '0px 1px 5px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(0, 0, 0, 0.35)', + overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)', + dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)', + modalShadow: '0px 50px 200px #000000, 0px 29px 66px rgba(0, 0, 0, 0.41), 0px 14px 47px rgba(0, 0, 0, 0.17), 0px 5px 10px rgba(0, 0, 0, 0.15)' +}; +/** + * # Syntax Colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#6cd0f0', + syntaxBrown: '#fccf87', + syntaxGray: '#7d7d7d', + syntaxGreen: '#cef06c', + syntaxOrange: '#f7933f', + syntaxPink: '#f494e5', + syntaxPurple: '#a870ef', + syntaxRed: '#e85b79', + syntaxTeal: '#45d4ba' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, accentColors), statusColors), elevationShadows), backgroundColors), contentColors), neutralColors), interactiveColors), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 40069: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(36501)); + +var _dark = _interopRequireDefault(__webpack_require__(60765)); + +var _compact = _interopRequireDefault(__webpack_require__(91000)); + +var _comfortable = _interopRequireDefault(__webpack_require__(71785)); + +var _base = _interopRequireDefault(__webpack_require__(19392)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function createPrismaTheme(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var colorSchemeVars = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var densityVars = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + var prismaBase = (0, _base["default"])({ + colorScheme: colorScheme + }); + return _objectSpread(_objectSpread(_objectSpread({}, prismaBase), colorSchemeVars), densityVars); +} + +var _default = createPrismaTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 36501: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * # Background Colors + * Background colors should be used only for backgrounds of higher level sections & containers of a UI. + * + * @colorSet verbose + */ +var backgroundColors = { + backgroundColorPopup: '#ffffff', + backgroundColorSection: '#ffffff', + backgroundColorSidebar: '#f8f8f8', + backgroundColorPage: '#f9f9f9', + backgroundColorNavigation: '#f7f7f7', + backgroundColorFloating: '#000000', + backgroundColorModal: '#ffffff', + backgroundColorScrim: 'rgba(255, 255, 255, 0.75)' +}; +/** + * # Content Colors + * Content colors should be used for text, icons and dividers. They use transparent colors, to ensure optimal contrast on every background. + * + * @colorSet verbose + */ + +var contentColors = { + contentColorActive: '#2c2c2c', + contentColorDefault: 'rgba(0, 0, 0, 0.65)', + contentColorMuted: 'rgba(0, 0, 0, 0.54)', + contentColorDisabled: 'rgba(0, 0, 0, 0.3)', + contentColorInverted: '#ffffff' +}; +/** + * # Interactive Colors + * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content. + * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary. + * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two. + * + * @colorSet verbose + */ + +var interactiveColors = { + interactiveColorPrimary: '#0264d7', + interactiveColorBorder: 'rgba(0, 0, 0, 0.4)', + interactiveColorBorderHover: 'rgba(0, 0, 0, 0.6)', + interactiveColorBorderDisabled: 'rgba(0, 0, 0, 0.3)', + interactiveColorOverlaySelected: 'rgba(0, 0, 0, 0.04)', + interactiveColorOverlayHover: 'rgba(0, 0, 0, 0.03)', + interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.07)', + interactiveColorOverlayDrag: 'rgba(2, 100, 215, 0.16)', + interactiveColorBackground: '#eeeeee', + interactiveColorBackgroundDisabled: 'rgba(0, 0, 0, 0.1)' +}; +/** + * # Neutral Colors + * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough. + * + * @colorSet verbose + */ + +var neutralColors = { + white: '#ffffff', + neutral100: '#f0f0f0', + neutral200: '#e6e6e6', + neutral300: '#dddddd', + neutral400: '#cacaca', + neutral500: '#b8b8b8', + black: '#000000' +}; +/** + * # Accent Colors + * Accent colors aid and categorize the visual communication of the system response. + * + * @colorSet verbose + */ + +var accentColors = { + accentColorPositive: '#118832', + accentColorWarning: '#cca700', + accentColorAlert: '#cf750c', + accentColorNegative: '#d41f1f' +}; +/** + * # Status Colors + * Status colors are reserved for communicating urgency and severity associated with data objects. + * + * @colorSet verbose + */ + +var statusColors = { + statusColorInfo: '#61cafa', + statusColorNormal: '#85eb48', + statusColorLow: '#fae75f', + statusColorMedium: '#f5b53f', + statusColorHigh: '#ec4B43', + statusColorCritical: '#9c0300' +}; +/** + * # Elevation Shadows + * + * @shadowSet + * + */ + +var elevationShadows = { + embossShadow: ' 0px 1px 5px rgba(0, 0, 0, 0.07), 0px 0px 1px rgba(0, 0, 0, 0.07)', + overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)', + dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)', + modalShadow: '0px 50px 200px rgba(0, 0, 0, 0.3), 0px 29px 66px rgba(0, 0, 0, 0.08), 0px 29px 47px rgba(0, 0, 0, 0.08), 0px 5px 10px rgba(0, 0, 0, 0.03)' +}; +/** + * # Syntax Colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#107d9f', + syntaxBrown: '#a26604', + syntaxGray: '#737373', + syntaxGreen: '#607d0d', + syntaxOrange: '#b75808', + syntaxPink: '#d015b2', + syntaxPurple: '#7f52f5', + syntaxRed: '#df1f48', + syntaxTeal: '#1e816f' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, accentColors), statusColors), elevationShadows), backgroundColors), contentColors), neutralColors), interactiveColors), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 13089: +/***/ (() => { + +"use strict"; + + +/***/ }), + +/***/ 68259: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _react = __webpack_require__(96540); + +var _styledComponents = __webpack_require__(92568); + +var _utils = __webpack_require__(16077); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +/** + * React hook that allows theme variables to be easily used within a React functional component. + * This includes the basic configuration of `family`, `colorScheme` and `density`, + * as well as all the specific variables available in that theme. + * + * If no data `SplunkThemeProvider` was configured, the Prisma Dark Comfortable theme is returned. + * + * ``` + * import useSplunkTheme from '@splunk/themes/useSplunkTheme'; + * ... + * export function() { + * const { density, focusColor } = useSplunkTheme(); + * + * const style = { + * color: focusColor, + * padding: density === 'comfortable' ? '10px' : '5px', + * } + * + * ... + * + * return ( + *
+ * Hello + *
+ * ) + * } + * ``` + * @public + */ +var useSplunkTheme = function useSplunkTheme() { + var _ref = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + _ref$splunkThemeV = _ref.splunkThemeV1, + splunkThemeV1 = _ref$splunkThemeV === void 0 ? {} : _ref$splunkThemeV, + rest = _objectWithoutProperties(_ref, ["splunkThemeV1"]); + + var family = splunkThemeV1.family, + colorScheme = splunkThemeV1.colorScheme, + density = splunkThemeV1.density, + customizer = splunkThemeV1.customizer; + return _objectSpread(_objectSpread({}, rest), (0, _utils.getCustomizedTheme)({ + family: family, + colorScheme: colorScheme, + density: density + }, customizer)); +}; + +var _default = useSplunkTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 16077: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getCustomizedTheme = exports.addThemeDefaults = void 0; + +var _lodash = __webpack_require__(2543); + +var _getTheme = _interopRequireDefault(__webpack_require__(23371)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * Accepts a theme object and returns supported values and defaults. + * @private + */ +var addThemeDefaults = function addThemeDefaults() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$family = _ref.family, + family = _ref$family === void 0 ? 'prisma' : _ref$family, + _ref$colorScheme = _ref.colorScheme, + colorScheme = _ref$colorScheme === void 0 ? 'dark' : _ref$colorScheme, + _ref$density = _ref.density, + density = _ref$density === void 0 ? 'comfortable' : _ref$density; + + return { + family: family, + colorScheme: colorScheme, + density: density + }; +}; + +exports.addThemeDefaults = addThemeDefaults; + +function getCustomizedThemeUnmemo(settings, customizer) { + var variables = (0, _getTheme["default"])(settings); + + if (!customizer) { + return variables; + } + + return customizer(variables); +} +/** + * Accepts a theme object and customizer, and returns supported values and defaults. + * @private + */ + + +var getCustomizedTheme = (0, _lodash.memoize)(getCustomizedThemeUnmemo, function () { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + family = _ref2.family, + colorScheme = _ref2.colorScheme, + density = _ref2.density; + + var customizer = arguments.length > 1 ? arguments[1] : undefined; + return "".concat(family, "-").concat(colorScheme, "-").concat(density, "-").concat(!!customizer); +}); +exports.getCustomizedTheme = getCustomizedTheme; + +/***/ }), + +/***/ 97689: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearVariablesCache = exports["default"] = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _getTheme = _interopRequireDefault(__webpack_require__(23371)); + +var _utils = __webpack_require__(16077); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * @file + * ## Theme Variables + * All variables are available in one util for use in styled-component templates. + * Each variable is a function which styled-components will call with the available theme information. + * If there is no SplunkThemeProvider, variables will default to Prisma Dark Comfortable. + * + * Variables will return `undefined` if the variable does not exist in the current theme. + * ``` + * import variables from '@splunk/themes/variables'; + * import styled from 'styled-components'; + * ... + * const PrismaWrapper = styled.div` + * color: ${variables.contentColorDefault}; + * `; + * ``` + * + * Variables may also be imported individually. + * ``` + * import { contentColorDefault } from '@splunk/themes/variables'; + * import styled from 'styled-components'; + * ... + * const PrismaWrapper = styled.div` + * color: ${contentColorDefault}; + * `; + * ``` + * + * This function must be used in conjunction with `pick` if different variables are needed in different themes. + * ``` + * import { pick, variables } from '@splunk/themes'; + * import styled from 'styled-components'; + * + * const Wrapper = styled.div` + * color: ${pick({ + * enterprise: variables.textColor, + * prisma: variables.contentColorDefault + * }); + * `; + * ``` + * ## Custom Variables + * Custom variables cannot be added to this package. However, `pick()` can be used to create sets of + * theme variables. These can be then be imported separately and used as above. + * ``` + * import pick from '@splunk/themes/pick'; + * + * export const myVariables = { + * orange: pick({ + * light: '#C80', + * dark: '#F90', + * }), + * space: pick({ + * enterprise: '20px', + * prisma: { + * comfortable: '16px', + * compact: '12px', + * }, + * }), + * }; + * ``` + */ +var getThemeVariable = function getThemeVariable(name, settings, customizer) { + var theme = (0, _utils.getCustomizedTheme)(settings, customizer); + var returnValue = theme[name]; + + if (false) {} + + return returnValue; +}; + +var getThemeVariableMemoized = (0, _memoize["default"])(getThemeVariable, function (name, _ref, customizer) { + var family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + return "".concat(name, "-").concat(family, "-").concat(colorScheme, "-").concat(density, "-").concat(!!customizer); +}); + +var clearVariablesCache = function clearVariablesCache() { + var _getThemeVariableMemo, _getThemeVariableMemo2; + + return (_getThemeVariableMemo = (_getThemeVariableMemo2 = getThemeVariableMemoized.cache).clear) === null || _getThemeVariableMemo === void 0 ? void 0 : _getThemeVariableMemo.call(_getThemeVariableMemo2); +}; +/** + * The `get` helper will insert a theme variable into a `styled-components` css template. + * Note, this will return `undefined` if the variable does not exist in the current theme. + * This function must be used in conjunction with `pick` if different variables are needed in different themes. + * ``` + * import get from '@splunk/themes/get'; + * ... + * const Wrapper = styled.div` + * color: ${get('contentColorDefaultDefault')}; // prisma theme only + * `; + * ``` + * @param {string} name - The name of the variable to get from the current theme configuration. + * @returns {function} The returned function is called by `styled-components`, which provides the theme context. + * @private + */ + + +exports.clearVariablesCache = clearVariablesCache; + +var get = function get(name) { + return function (_ref2) { + var _ref2$theme = _ref2.theme; + _ref2$theme = _ref2$theme === void 0 ? {} : _ref2$theme; + var splunkThemeV1 = _ref2$theme.splunkThemeV1; + + var _ref3 = splunkThemeV1 || {}, + family = _ref3.family, + colorScheme = _ref3.colorScheme, + density = _ref3.density, + customizer = _ref3.customizer; + + return getThemeVariableMemoized(name, { + family: family, + colorScheme: colorScheme, + density: density + }, customizer); + }; +}; + +var variableNames = Object.keys(_objectSpread(_objectSpread({}, (0, _getTheme["default"])({ + family: 'prisma' +})), (0, _getTheme["default"])({ + family: 'enterprise' +}))); // each variable is converted to a get() function. +// TS: The AllVariables type allows safe access to all variables shared across themes, +// and unsafe access to variables exclusive to Enterprise or Prisma + +var variables = variableNames.reduce(function (acc, currentValue) { + // using defineProperty instead of acc[currentValue] to work around readonly issue + Object.defineProperty(acc, currentValue, { + value: get(currentValue) + }); + return acc; +}, {}); +var _default = variables; +exports["default"] = _default; + +/***/ }), + +/***/ 87080: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _styledComponents = __webpack_require__(92568); + +var _utils = __webpack_require__(16077); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +// implementation for both + +/** + * `withSplunkTheme` allows theme variables to be used within a React class component. + * This includes the basic configuration of `family`, `colorScheme` and `density`, + * as well as all the specific variables available in that theme. + * + * If no data `SplunkThemeProvider` was configured, the Prisma Dark Comfortable theme is returned. + * + * ``` + * import React, { Component } from 'react'; + * import PropTypes from 'prop-types'; + * import withSplunkTheme from '@splunk/themes/withSplunkTheme'; + * + * + * class MyComponent extends Component { + * static propTypes = { + * splunkTheme: PropTypes.object, + * }; + * + * render() { + * const { density, focusColor } = this.props.splunkTheme; + * + * const style = { + * color: focusColor, + * padding: density === 'comfortable' ? '10px' : '5px', + * } + * + * return ( + *
+ * Hello + *
+ * ) + * } + * } + * + * const MyComponentWithTheme = withSplunkTheme(MyComponent); + * MyComponentWithTheme.propTypes = MyComponent.propTypes; + * + * export default MyComponentWithTheme; + * + * ``` + * @name withSplunkTheme + * @function + * @public + */ +function withSplunkTheme( // eslint-disable-line @typescript-eslint/explicit-module-boundary-types +Component) { + var ComponentWithSplunkTheme = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { + var _ref = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + splunkThemeV1 = _ref.splunkThemeV1, + rest = _objectWithoutProperties(_ref, ["splunkThemeV1"]); + + var _ref2 = splunkThemeV1 || {}, + family = _ref2.family, + colorScheme = _ref2.colorScheme, + density = _ref2.density, + customizer = _ref2.customizer; + + var themeSettings = (0, _utils.addThemeDefaults)({ + family: family, + colorScheme: colorScheme, + density: density + }); + + var splunkTheme = _objectSpread(_objectSpread({}, rest), (0, _utils.getCustomizedTheme)(themeSettings, customizer)); + + return /*#__PURE__*/_react["default"].createElement(Component, _extends({}, props, { + ref: ref, + splunkTheme: splunkTheme + })); + }); + + var displayName = Component.displayName || Component.name || 'Component'; + ComponentWithSplunkTheme.displayName = "withSplunkTheme(".concat(displayName, ")"); + return ComponentWithSplunkTheme; +} // see https://github.com/Microsoft/TypeScript/issues/28938 for the two "as T" assertions above + + +var _default = withSplunkTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 68503: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 189); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 121: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36771); + +/***/ }), + +/***/ 189: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4087__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4087__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4087__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Accordion_Accordion; }); +__nested_webpack_require_4087__.d(__nested_webpack_exports__, "Panel", function() { return /* reexport */ Accordion_Panel; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4087__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4087__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4087__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4087__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_4087__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_4087__.n(has_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_4087__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_4087__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4087__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4087__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/react-ui/CollapsiblePanel" +var CollapsiblePanel_ = __nested_webpack_require_4087__(121); +var CollapsiblePanel_default = /*#__PURE__*/__nested_webpack_require_4087__.n(CollapsiblePanel_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4087__(0); + +// CONCATENATED MODULE: ./src/Accordion/AccordionContext.tsx + +var AccordionContext = /*#__PURE__*/Object(external_react_["createContext"])({}); +AccordionContext.displayName = 'Accordion'; +/* harmony default export */ var Accordion_AccordionContext = (AccordionContext); +// CONCATENATED MODULE: ./src/Accordion/Panel.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + +var propTypes = { + description: external_prop_types_default.a.string, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + inset: external_prop_types_default.a.bool, + panelId: external_prop_types_default.a.any.isRequired, + title: external_prop_types_default.a.node.isRequired +}; + +var getPaddingValue = function getPaddingValue(family, density) { + var values = { + enterprise: { + compact: '8px', + comfortable: '10px' + }, + prisma: { + compact: '12px 20px', + comfortable: '20px' + } + }; + return values[family][density]; +}; + +/** + * `Accordion.Panel` operates as a container component for content in an `Accordion`. + */ +function Panel(_ref) { + var panelId = _ref.panelId, + inset = _ref.inset, + otherProps = _objectWithoutProperties(_ref, ["panelId", "inset"]); + + // @docs-props-type AccordionPanelPropsBase + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family, + density = _useSplunkTheme.density; + + var _useContext = Object(external_react_["useContext"])(AccordionContext), + onRequestCloseContext = _useContext.onRequestClose, + onRequestOpenContext = _useContext.onRequestOpen, + openPanelIdContext = _useContext.openPanelId, + insetContext = _useContext.inset; + + var open = openPanelIdContext === panelId; + var finalInset = inset !== undefined ? inset : insetContext; + return /*#__PURE__*/external_react_default.a.createElement(CollapsiblePanel_default.a, _extends({ + panelId: panelId, + "data-test": "panel", + innerBodyStyles: finalInset ? { + padding: getPaddingValue(family, density) + } : undefined, + "data-test-panel-id": panelId, + style: { + flexShrink: 1 + } + }, otherProps, { + onRequestClose: onRequestCloseContext, + onRequestOpen: onRequestOpenContext, + open: open + })); +} + +Panel.propTypes = propTypes; +/* harmony default export */ var Accordion_Panel = (Panel); +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4087__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4087__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4087__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4087__.n(Box_); + +// CONCATENATED MODULE: ./src/Accordion/AccordionStyles.ts + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "AccordionStyles__StyledBox", + componentId: "m39hyh-0" +})(["", ";flex-direction:column;margin-bottom:0;", ""], themes_["mixins"].reset('flex'), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].backgroundColor) +})); + +// CONCATENATED MODULE: ./src/Accordion/Accordion.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function Accordion_extends() { Accordion_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Accordion_extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + +/** @public */ + +var Accordion_propTypes = { + children: external_prop_types_default.a.node, + defaultOpenPanelId: external_prop_types_default.a.any, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + onChange: external_prop_types_default.a.func, + openPanelId: external_prop_types_default.a.any +}; +var defaultProps = { + inset: false // SUI-2559 This will become true in 5.0 + +}; + +var Accordion_Accordion = /*#__PURE__*/function (_Component) { + _inherits(Accordion, _Component); + + var _super = _createSuper(Accordion); + + // @docs-props-type AccordionPropsBase + function Accordion(props) { + var _this; + + _classCallCheck(this, Accordion); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "handleRequestOpen", function (data) { + var _this$props$onChange, _this$props; + + if (!_this.isControlled()) { + _this.setState({ + openPanelId: data.panelId + }); + } + + (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, data.event, data); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (data) { + var _this$props$onChange2, _this$props2; + + if (!_this.isControlled()) { + _this.setState({ + openPanelId: undefined + }); + } + + (_this$props$onChange2 = (_this$props2 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props2, data.event, _objectSpread(_objectSpread({}, data), {}, { + panelId: undefined + })); + }); + + _this.controlledExternally = has_default()(props, 'openPanelId'); + + if (!_this.isControlled()) { + _this.state = { + openPanelId: props.defaultOpenPanelId + }; + } + + if (false) {} + + return _this; + } + + _createClass(Accordion, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (false) {} + + if (false) {} + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + children = _this$props3.children, + elementRef = _this$props3.elementRef, + inset = _this$props3.inset; + var openPanelId = this.isControlled() ? this.props.openPanelId : this.state.openPanelId; + var childrenCleaned = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]); // remove false, null, 0, etc + + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, Accordion_extends({ + "data-test": "accordion", + "data-test-open-panel-id": openPanelId, + elementRef: elementRef + }, omit_default()(this.props, keys_default()(Accordion.propTypes))), /*#__PURE__*/external_react_default.a.createElement(Accordion_AccordionContext.Provider, { + value: { + onRequestOpen: this.handleRequestOpen, + onRequestClose: this.handleRequestClose, + openPanelId: openPanelId, + inset: inset + } + }, childrenCleaned)); + } + }]); + + return Accordion; +}(external_react_["Component"]); + +_defineProperty(Accordion_Accordion, "propTypes", Accordion_propTypes); + +_defineProperty(Accordion_Accordion, "defaultProps", defaultProps); + +_defineProperty(Accordion_Accordion, "Panel", Accordion_Panel); + +/* harmony default export */ var src_Accordion_Accordion = (Accordion_Accordion); + +// CONCATENATED MODULE: ./src/Accordion/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 66991: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 236); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 236: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3669__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3669__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3669__.d(__nested_webpack_exports__, "Spring", function() { return /* reexport */ Spring; }); +__nested_webpack_require_3669__.d(__nested_webpack_exports__, "Transition", function() { return /* reexport */ Transition; }); + +// EXTERNAL MODULE: external "react-spring" +var external_react_spring_ = __nested_webpack_require_3669__(24); + +// EXTERNAL MODULE: external "@splunk/react-ui/AnimationToggle" +var AnimationToggle_ = __nested_webpack_require_3669__(48); + +// CONCATENATED MODULE: ./src/Animation/Animation.tsx +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + +/** + * Wrappers to use in place of `Spring` and `Transition` from `react-spring`. + * Uses `useAnimationToggle` to offer animation control. + */ + +function Spring(_ref) { + var children = _ref.children, + immediate = _ref.immediate, + otherProps = _objectWithoutProperties(_ref, ["children", "immediate"]); + + var animationToggle = Object(AnimationToggle_["useAnimationToggle"])(); + return children(Object(external_react_spring_["useSpring"])(_objectSpread({ + immediate: immediate || animationToggle !== 'on' + }, otherProps))); +} + +function Transition(_ref2) { + var items = _ref2.items, + children = _ref2.children, + immediate = _ref2.immediate, + otherProps = _objectWithoutProperties(_ref2, ["items", "children", "immediate"]); + + var animationToggle = Object(AnimationToggle_["useAnimationToggle"])(); + return Object(external_react_spring_["useTransition"])(items, _objectSpread({ + immediate: immediate || animationToggle !== 'on' + }, otherProps))(children); +} + + +// CONCATENATED MODULE: ./src/Animation/index.ts + + +/***/ }), + +/***/ 24: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36529); + +/***/ }), + +/***/ 48: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(4995); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 4995: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 190); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 190: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3766__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3766__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3766__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ AnimationToggle_AnimationToggle; }); +__nested_webpack_require_3766__.d(__nested_webpack_exports__, "AnimationToggleContext", function() { return /* reexport */ AnimationToggleContext; }); +__nested_webpack_require_3766__.d(__nested_webpack_exports__, "AnimationToggleProvider", function() { return /* reexport */ AnimationToggleProvider_AnimationToggleProvider; }); +__nested_webpack_require_3766__.d(__nested_webpack_exports__, "useAnimationToggle", function() { return /* reexport */ useAnimationToggle_useAnimationToggle; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3766__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3766__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3766__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3766__.n(external_prop_types_); + +// CONCATENATED MODULE: ./src/AnimationToggle/AnimationToggleContext.tsx + +/** + * A React context used to control whether animations are enabled or disabled. + * Prefer `useAnimationToggle` or `AnimationToggle` over consuming this context + * directly, since they take the user's reduced motion preference into account. + * This context should only be used if direct access to the animation setting + * is required. The context type is `Boolean` and defaults to `true`. + * + * @public + */ + +var AnimationToggleContext = /*#__PURE__*/external_react_default.a.createContext(true); + +// CONCATENATED MODULE: ./src/AnimationToggle/useAnimationToggle.tsx +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + +/** + * A React hook that combines the animation setting (see `AnimationToggleProvider`) + * and the user's reduced motion preference into one value. + * + * @returns {string} `'off'` if animations are disabled. If animations are enabled + * and the user prefers reduced motion, `'reduced'` is returned, `'on'` otherwise. + * @public + */ + +var useAnimationToggle_useAnimationToggle = function useAnimationToggle() { + var animationEnabled = Object(external_react_["useContext"])(AnimationToggleContext); + var query = 'screen and (prefers-reduced-motion: reduce)'; + var matchMedia = typeof window !== 'undefined' && !!window.matchMedia; + + var _useState = Object(external_react_["useState"])(matchMedia && window.matchMedia(query).matches), + _useState2 = _slicedToArray(_useState, 2), + reduced = _useState2[0], + setReduced = _useState2[1]; + + Object(external_react_["useEffect"])(function () { + if (matchMedia) { + var mediaQuery = window.matchMedia(query); + + var reducedMotionChanged = function reducedMotionChanged() { + setReduced(mediaQuery.matches); + }; + + mediaQuery.addListener(reducedMotionChanged); + return function () { + mediaQuery.removeListener(reducedMotionChanged); + }; + } + + return undefined; + }, [matchMedia, query]); + + if (animationEnabled) { + return reduced ? 'reduced' : 'on'; + } + + return 'off'; +}; + + +// CONCATENATED MODULE: ./src/AnimationToggle/AnimationToggle.tsx + + + + +var callMeMaybe = function callMeMaybe(maybeFunction) { + return typeof maybeFunction === 'function' ? maybeFunction() : maybeFunction; +}; + +var propTypes = { + on: external_prop_types_default.a.oneOfType([external_prop_types_default.a.node, external_prop_types_default.a.func]).isRequired, + off: external_prop_types_default.a.oneOfType([external_prop_types_default.a.node, external_prop_types_default.a.func]).isRequired, + reduced: external_prop_types_default.a.oneOfType([external_prop_types_default.a.node, external_prop_types_default.a.func]) +}; +/** + * Used to allow animation to be externally controlled through a provider or user preference. + */ + +function AnimationToggle(_ref) { + var on = _ref.on, + off = _ref.off, + reduced = _ref.reduced; + var animationToggle = useAnimationToggle_useAnimationToggle(); + + if (animationToggle === 'on') { + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, callMeMaybe(on)); + } + + if (animationToggle === 'reduced' && reduced) { + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, callMeMaybe(reduced)); + } + + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, callMeMaybe(off)); // react-docgen ignores components that don't use JSX/React.createElement. + // the following line forces detection: + + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null); // eslint-disable-line no-unreachable +} + +AnimationToggle.propTypes = propTypes; +/* harmony default export */ var AnimationToggle_AnimationToggle = (AnimationToggle); +// CONCATENATED MODULE: ./src/AnimationToggle/AnimationToggleProvider.tsx + + + +var AnimationToggleProvider_propTypes = { + children: external_prop_types_default.a.node, + enabled: external_prop_types_default.a.bool +}; +/** + * Used to provide a setting to enable or disable animation. + */ + +var AnimationToggleProvider_AnimationToggleProvider = function AnimationToggleProvider(_ref) { + var children = _ref.children, + _ref$enabled = _ref.enabled, + enabled = _ref$enabled === void 0 ? false : _ref$enabled; + return /*#__PURE__*/external_react_default.a.createElement(AnimationToggleContext.Provider, { + value: enabled + }, children); +}; + +AnimationToggleProvider_AnimationToggleProvider.propTypes = AnimationToggleProvider_propTypes; + +// CONCATENATED MODULE: ./src/AnimationToggle/index.ts + + + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 7596: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 211); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 211: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Box_Box; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/Box/BoxStyles.ts + + +var Styled = external_styled_components_default.a.div.withConfig({ + displayName: "BoxStyles__Styled", + componentId: "sc-1h4b5f6-0" +})(["", ";align-items:stretch;align-content:stretch;flex-flow:row nowrap;flex-grow:0;flex-shrink:0;justify-content:flex-start;width:auto;max-width:100%;@media all and (-ms-high-contrast:none){max-width:calc(100% - 0.01px);}&[data-inline]{display:inline-block;vertical-align:middle;}&[data-flex]{display:flex;}&[data-flex][data-inline]{display:inline-flex;}"], themes_["mixins"].reset('block')); + +// CONCATENATED MODULE: ./src/Box/Box.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + flex: external_prop_types_default.a.bool, + inline: external_prop_types_default.a.bool +}; + +/** + * Box is a utility component to normalize and abstract common layout styles. + */ +function Box(_ref) { + var children = _ref.children, + elementRef = _ref.elementRef, + _ref$flex = _ref.flex, + flex = _ref$flex === void 0 ? false : _ref$flex, + _ref$inline = _ref.inline, + inline = _ref$inline === void 0 ? false : _ref$inline, + otherProps = _objectWithoutProperties(_ref, ["children", "elementRef", "flex", "inline"]); + + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + ref: elementRef + }, otherProps, { + "data-inline": inline || undefined, + "data-flex": flex || undefined + }), children); +} + +Box.propTypes = propTypes; +/* harmony default export */ var Box_Box = (Box); +// CONCATENATED MODULE: ./src/Box/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 70181: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 191); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 122: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(77225); + +/***/ }), + +/***/ 191: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4000__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4000__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4000__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Button_Button; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4000__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4000__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4000__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4000__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/isString" +var isString_ = __nested_webpack_require_4000__(23); +var isString_default = /*#__PURE__*/__nested_webpack_require_4000__.n(isString_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown" +var Dropdown_ = __nested_webpack_require_4000__(22); + +// EXTERNAL MODULE: external "@splunk/ui-utils/style" +var style_ = __nested_webpack_require_4000__(37); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4000__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4000__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ButtonSimple" +var ButtonSimple_ = __nested_webpack_require_4000__(62); +var ButtonSimple_default = /*#__PURE__*/__nested_webpack_require_4000__.n(ButtonSimple_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4000__(0); + +// CONCATENATED MODULE: ./src/Button/ButtonStyles.ts + + + +var StyledIcon = external_styled_components_default.a.span.withConfig({ + displayName: "ButtonStyles__StyledIcon", + componentId: "eqxqs2-0" +})(["display:flex;align-items:center;flex-shrink:0;font-size:", ";", ";"], Object(themes_["pick"])({ + enterprise: 'inherit', + prisma: { + comfortable: '21px', + compact: '16px' + } +}), Object(themes_["pickVariant"])('$isIconOnly', { + "false": { + enterprise: Object(external_styled_components_["css"])(["padding-right:3px;"]), + prisma: Object(external_styled_components_["css"])(["padding-right:8px;"]) + } +})); +var StyledButtonSimple = external_styled_components_default()(ButtonSimple_default.a).withConfig({ + displayName: "ButtonStyles__StyledButtonSimple", + componentId: "eqxqs2-1" +})(["text-align:center;vertical-align:middle;text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{display:inline-block;vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}"], themes_["variables"].lineHeight, themes_["variables"].inputHeight, Object(themes_["pick"])({ + enterprise: { + comfortable: '5px 14px', + compact: '2px 14px' + }, + prisma: { + comfortable: function comfortable(_ref) { + var $hasPrismaIcon = _ref.$hasPrismaIcon; + return $hasPrismaIcon ? '7px 18px' : '9px 18px'; + }, + compact: function compact(_ref2) { + var $isMenu = _ref2.$isMenu; + return $isMenu ? '5px 8px 5px 16px' : '5px 16px'; + } + } +}), function (_ref3) { + var $inline = _ref3.$inline, + append = _ref3.append, + prepend = _ref3.prepend; + return !$inline && !append && !prepend && Object(external_styled_components_["css"])(["width:100%;"]); +}, function (_ref4) { + var $isIconOnly = _ref4.$isIconOnly; + return $isIconOnly && Object(external_styled_components_["css"])(["box-sizing:border-box;padding:", ";width:", ";min-width:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '0 5px', + compact: '0 2px' + }, + prisma: { + comfortable: Object(external_styled_components_["css"])(["0px calc(", " / 2 - 1px)"], themes_["variables"].inputHeight), + compact: Object(external_styled_components_["css"])(["0px calc(", " / 2 - 1px)"], themes_["variables"].inputHeight) + } + }), themes_["variables"].inputHeight, themes_["variables"].inputHeight); +}, function (_ref5) { + var $isIconOnly = _ref5.$isIconOnly; + return $isIconOnly ? null : Object(external_styled_components_["css"])(["width:auto;"]); +}, function (_ref6) { + var prepend = _ref6.prepend; + return !prepend && Object(external_styled_components_["css"])(["margin-left:", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: themes_["variables"].spacingSmall + })); +}); +var StyledContentWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "ButtonStyles__StyledContentWrapper", + componentId: "eqxqs2-2" +})(["display:flex;flex-direction:row;justify-content:center;align-items:center;max-width:100%;padding:", ";"], Object(themes_["pick"])({ + enterprise: function enterprise(_ref7) { + var $error = _ref7.$error; + + if ($error) { + return '1px'; + } + + return Object(themes_["pickVariant"])('$appearance', { + "default": '0', + secondary: '0', + destructive: '1px', + primary: '1px', + pill: '0', + toggle: '0', + // === default + flat: '0' // === default + + }); + }, + prisma: Object(themes_["pickVariant"])('$appearance', { + "default": 0, + secondary: '1px 0', + primary: '1px 0', + destructive: '1px 0', + pill: '1px 0', + // === secondary + toggle: '0', + flat: '1px 0' + }) +})); +var StyledLabel = external_styled_components_default.a.span.withConfig({ + displayName: "ButtonStyles__StyledLabel", + componentId: "eqxqs2-3" +})(["text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", ""], Object(themes_["pick"])({ + enterprise: '3px', + prisma: '10px' +}), function (_ref8) { + var $isMenu = _ref8.$isMenu; + return $isMenu && Object(external_styled_components_["css"])(["flex:1 1 auto;text-align:left;"]); +}); +var StyledCaretWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "ButtonStyles__StyledCaretWrapper", + componentId: "eqxqs2-4" +})(["display:inline-flex;", ""], Object(themes_["pickVariant"])('$disabled', { + "false": { + prisma: Object(themes_["pickVariant"])('$primary', { + "true": Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorInverted), + "false": Object(external_styled_components_["css"])(["color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}"], themes_["variables"].contentColorDefault, + /* sc-sel */ + StyledButtonSimple, + /* sc-sel */ + StyledButtonSimple, themes_["variables"].contentColorDefault) + }) + } +})); + +// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown" +var CaretSmallDown_ = __nested_webpack_require_4000__(53); +var CaretSmallDown_default = /*#__PURE__*/__nested_webpack_require_4000__.n(CaretSmallDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret" +var Caret_ = __nested_webpack_require_4000__(54); +var Caret_default = /*#__PURE__*/__nested_webpack_require_4000__.n(Caret_); + +// CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx + + + + + +var CaretSmallDown_CaretSmallDown = function CaretSmallDown() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise, + isCompact = _useSplunkTheme.isCompact; + + var prismaSize = isCompact ? '20px' : '24px'; + return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, { + screenReaderText: null, + hideDefaultTooltip: true, + size: 0.5 + }) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, { + height: prismaSize, + width: prismaSize + }); +}; + +/* harmony default export */ var icons_CaretSmallDown = (CaretSmallDown_CaretSmallDown); +// EXTERNAL MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset" +var ArrowSquareTopRightInset_ = __nested_webpack_require_4000__(122); +var ArrowSquareTopRightInset_default = /*#__PURE__*/__nested_webpack_require_4000__.n(ArrowSquareTopRightInset_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/External" +var External_ = __nested_webpack_require_4000__(63); +var External_default = /*#__PURE__*/__nested_webpack_require_4000__.n(External_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4000__(4); + +// CONCATENATED MODULE: ./src/Button/icons/External.tsx + + + + + + +var External_label = Object(i18n_["_"])('Open externally'); + +function External() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise, + isCompact = _useSplunkTheme.isCompact; + + var prismaSize = isCompact ? '20px' : '24px'; + return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(External_default.a, { + screenReaderText: External_label, + size: 0.8, + style: { + verticalAlign: 'baseline' + } + }) : /*#__PURE__*/external_react_default.a.createElement(ArrowSquareTopRightInset_default.a, { + "aria-label": External_label, + height: prismaSize, + width: prismaSize + }, /*#__PURE__*/external_react_default.a.createElement("title", null, External_label)); +} + +/* harmony default export */ var icons_External = (External); +// CONCATENATED MODULE: ./src/Button/Button.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + +var propTypes = { + action: external_prop_types_default.a.string, + appearance: external_prop_types_default.a.oneOf(['default', 'secondary', 'primary', 'destructive', 'pill', 'toggle', 'flat']), + append: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + + /** @private An additional className to add to the button. */ + classNamePrivate: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + icon: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + isMenu: external_prop_types_default.a.bool, + label: external_prop_types_default.a.node, + onClick: external_prop_types_default.a.func, + openInNewContext: external_prop_types_default.a.bool, + prepend: external_prop_types_default.a.bool, + selected: external_prop_types_default.a.bool, + to: external_prop_types_default.a.string, + value: external_prop_types_default.a.any +}; +var defaultProps = { + appearance: 'default', + append: false, + disabled: false, + error: false, + inline: true, + isMenu: false, + openInNewContext: false, + prepend: false, + selected: false +}; + +var Button_Button = /*#__PURE__*/function (_Component) { + _inherits(Button, _Component); + + var _super = _createSuper(Button); + + // @docs-props-type ButtonPropsBase + function Button(props) { + var _this; + + _classCallCheck(this, Button); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "component", null); + + _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props = _this.props, + label = _this$props.label, + icon = _this$props.icon, + value = _this$props.value, + action = _this$props.action, + onClick = _this$props.onClick; + onClick === null || onClick === void 0 ? void 0 : onClick(e, { + label: label, + icon: icon, + value: value, + action: action + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) { + _this.component = c; + }); + + if (false) {} + + return _this; + } + + _createClass(Button, [{ + key: "focus", + + /** + * Places focus on the button. + */ + value: function focus() { + var _this$component; + + (_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + action = _this$props2.action, + appearance = _this$props2.appearance, + append = _this$props2.append, + className = _this$props2.className, + classNamePrivate = _this$props2.classNamePrivate, + disabled = _this$props2.disabled, + error = _this$props2.error, + icon = _this$props2.icon, + inline = _this$props2.inline, + isMenu = _this$props2.isMenu, + onClick = _this$props2.onClick, + openInNewContext = _this$props2.openInNewContext, + prepend = _this$props2.prepend, + to = _this$props2.to, + value = _this$props2.value; + var _this$props3 = this.props, + children = _this$props3.children, + label = _this$props3.label; + + if (!label && isString_default()(children)) { + label = children; + children = null; + } + + var isIconOnly = !!(icon && !label && !isMenu && !children); + var hasPrismaIcon = to && openInNewContext || isMenu || !!icon; + return /*#__PURE__*/external_react_default.a.createElement(StyledButtonSimple, _extends({ + "aria-haspopup": isMenu || undefined, + "aria-invalid": error || undefined, + "data-test": "button" + }, this.props, { + className: Object(style_["toClassName"])(className, classNamePrivate), + "data-action": action, + "data-inline": inline || null, + disabled: disabled, + append: append, + prepend: prepend, + $inline: inline, + $hasPrismaIcon: hasPrismaIcon, + $isIconOnly: isIconOnly, + $isMenu: isMenu // @ts-expect-error - this is problematic for two reasons: + // * value is only a valid attribute on button (not on a) + // * this component's value prop is of type any, which can result + // in "[object Object]" attribute values + , + value: value, + onClick: onClick ? this.handleClick : undefined, + ref: this.handleMount, + openInNewContext: openInNewContext, + appearance: appearance + }), /*#__PURE__*/external_react_default.a.createElement(StyledContentWrapper, { + $appearance: appearance, + $error: error + }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, { + $isIconOnly: isIconOnly + }, icon), label && /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + "data-test": "label", + $isMenu: isMenu + }, label), children, isMenu && /*#__PURE__*/external_react_default.a.createElement(StyledCaretWrapper, { + $disabled: disabled, + $primary: appearance === 'primary' + }, /*#__PURE__*/external_react_default.a.createElement(icons_CaretSmallDown, null)), openInNewContext && /*#__PURE__*/external_react_default.a.createElement(icons_External, null))); + } + }]); + + return Button; +}(external_react_["Component"]); + +_defineProperty(Button_Button, "propTypes", propTypes); + +_defineProperty(Button_Button, "defaultProps", defaultProps); + +_defineProperty(Button_Button, Dropdown_["legacyRefMode"], true); + +/* harmony default export */ var src_Button_Button = (Button_Button); +// CONCATENATED MODULE: ./src/Button/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 22: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73592); + +/***/ }), + +/***/ 23: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(85015); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 37: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(83778); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 53: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32305); + +/***/ }), + +/***/ 54: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40828); + +/***/ }), + +/***/ 62: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(2759); + +/***/ }), + +/***/ 63: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63172); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 2759: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 192); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 192: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4105__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4105__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4105__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_ButtonSimple_ButtonSimple; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4105__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4105__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4105__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4105__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4105__(4); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4105__(0); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4105__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4105__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4105__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4105__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4105__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4105__.n(Clickable_); + +// CONCATENATED MODULE: ./src/ButtonSimple/prismaStyles.ts + + +var common = Object(external_styled_components_["css"])(["", " cursor:pointer;position:relative;border-radius:", ";&:focus,&:hover{z-index:3;}"], themes_["mixins"].reset('block'), themes_["variables"].borderRadius); +/* Setting border-radius to 0.1px creates a rounded shadow, */ + +var appendPrepend = Object(external_styled_components_["css"])(["", " ", ""], function (_ref) { + var $append = _ref.$append; + return $append && Object(external_styled_components_["css"])(["border-top-right-radius:0.1px;border-bottom-right-radius:0.1px;border-right:none;"]); +}, function (_ref2) { + var $prepend = _ref2.$prepend; + return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0.1px;border-bottom-left-radius:0.1px;"]); +}); +var prismaTransparent = Object(external_styled_components_["css"])(["", " ", " ", " &:not([disabled]){color:", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;&:hover{background-color:", ";border-color:", ";", "}", " ", " &:active{background-color:", ";transition:none;}&:focus{background-color:", ";", " &:active{background-color:", ";}}}&[disabled]{border-color:", ";color:", ";cursor:not-allowed;", "}"], common, Object(themes_["pickVariant"])('$variant', { + prismaSecondary: Object(external_styled_components_["css"])(["font-weight:", ";"], themes_["variables"].fontWeightSemiBold), + prismaDefault: Object(external_styled_components_["css"])(["border:1px solid ", ";font-weight:", ";"], themes_["variables"].interactiveColorBorder, themes_["variables"].fontWeightSemiBold), + prismaToggle: Object(external_styled_components_["css"])(["border:1px solid ", ";font-weight:normal;"], themes_["variables"].interactiveColorBorder) +}), appendPrepend, themes_["variables"].contentColorActive, themes_["variables"].interactiveColorOverlayHover, themes_["variables"].interactiveColorBorderHover, Object(themes_["pickVariant"])('$variant', { + prismaSecondary: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].hoverShadow), + prismaDefault: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].hoverShadow) +}), function (_ref3) { + var $selected = _ref3.$selected; + return $selected && Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";&:hover{background-color:", ";}"], themes_["variables"].interactiveColorOverlaySelected, themes_["variables"].interactiveColorBorderDisabled, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorOverlaySelected, themes_["variables"].interactiveColorOverlayHover)); +}, function (_ref4) { + var $error = _ref4.$error; + return $error && Object(external_styled_components_["css"])(["border-color:", ";&:hover{border-color:", ";}"], themes_["variables"].accentColorNegative, themes_["variables"].accentColorNegative); +}, themes_["variables"].interactiveColorOverlayActive, themes_["variables"].interactiveColorOverlayHover, Object(themes_["pickVariant"])('$variant', { + prismaSecondary: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadow), + prismaDefault: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadow), + prismaToggle: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorPrimary) +}), themes_["variables"].interactiveColorOverlayActive, themes_["variables"].interactiveColorBorderDisabled, themes_["variables"].contentColorDisabled, function (_ref5) { + var $selected = _ref5.$selected; + return $selected && Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackgroundDisabled, themes_["variables"].interactiveColorOverlaySelected)); +}); +var disabledFillStyles = Object(external_styled_components_["css"])(["&[disabled]{border-color:", ";color:", ";background-color:", ";cursor:not-allowed;", "}"], themes_["variables"].interactiveColorBorderDisabled, themes_["variables"].contentColorDisabled, themes_["variables"].interactiveColorBackgroundDisabled, function ($selected) { + return $selected && Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackgroundDisabled, themes_["variables"].interactiveColorOverlaySelected)); +}); +var prismaFilled = Object(external_styled_components_["css"])(["", " font-weight:", ";border-radius:", ";", " &:not([disabled]){color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;background-color:", ";&:hover,&:focus{background-color:", ";}&:hover{box-shadow:", ";}&:focus{box-shadow:", ";}&:active{background-color:", ";transition:none;}}", ""], common, themes_["variables"].fontWeightSemiBold, themes_["variables"].borderRadius, appendPrepend, themes_["variables"].contentColorInverted, Object(themes_["pickVariant"])('$selected', { + "false": Object(themes_["pickVariant"])('$variant', { + prismaPrimary: themes_["variables"].interactiveColorPrimary, + prismaDestructive: themes_["variables"].accentColorNegative + }), + "true": Object(themes_["pickVariant"])('$variant', { + prismaPrimary: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorPrimary, themes_["variables"].interactiveColorOverlaySelected), + prismaDestructive: themes_["mixins"].overlayColors(themes_["variables"].accentColorNegative, themes_["variables"].interactiveColorOverlaySelected) + }) +}), Object(themes_["pickVariant"])('$variant', { + prismaPrimary: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorPrimary, themes_["variables"].interactiveColorOverlayHover), + prismaDestructive: themes_["mixins"].overlayColors(themes_["variables"].accentColorNegative, themes_["variables"].interactiveColorOverlayHover) +}), themes_["variables"].hoverShadow, themes_["variables"].focusShadow, Object(themes_["pickVariant"])('$variant', { + prismaPrimary: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorPrimary, themes_["variables"].interactiveColorOverlayActive), + prismaDestructive: themes_["mixins"].overlayColors(themes_["variables"].accentColorNegative, themes_["variables"].interactiveColorOverlayActive) +}), disabledFillStyles); +var prismaFlat = Object(external_styled_components_["css"])(["", " font-weight:", ";border-radius:", ";", " &:not([disabled]){color:", ";background-color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " &:hover{background-color:", ";box-shadow:", ";}&:active{background-color:", ";transition:none;}&:focus{box-shadow:", ";background-color:", ";}}", ""], common, themes_["variables"].fontWeightSemiBold, themes_["variables"].borderRadius, appendPrepend, themes_["variables"].contentColorActive, themes_["variables"].interactiveColorBackground, function ($selected) { + return $selected && Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlaySelected)); +}, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlayHover), themes_["variables"].hoverShadow, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlayActive), themes_["variables"].focusShadow, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlayHover), disabledFillStyles); + +// CONCATENATED MODULE: ./src/ButtonSimple/enterpriseStyles.ts + + +var primaryBackgroundColor = '#1A8929'; // SUI-2439 to meet WCAG AA compliance + +var primarySelectedBackgroundColor = '#235823'; // SUI-2439 to meet WCAG AA compliance + +var enterpriseStyles_common = Object(external_styled_components_["css"])(["", " border-radius:", ";cursor:pointer;position:relative;&:focus{z-index:3;}"], themes_["mixins"].reset('block'), themes_["variables"].borderRadius); +var enterpriseStyles_appendPrepend = Object(external_styled_components_["css"])(["", " ", ""], function (_ref) { + var $append = _ref.$append; + return $append && Object(external_styled_components_["css"])(["border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;"]); +}, function (_ref2) { + var $prepend = _ref2.$prepend; + return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0;border-bottom-left-radius:0;"]); +}); +var lightShadow = 'inset 0 -1px 0 rgba(0, 0, 0, 0.1)'; +var lightSelectedShadow = 'inset 0 1px 0 rgba(0, 0, 0, 0.1)'; +var enterpriseDefault = Object(external_styled_components_["css"])(["", ";border:", ";", ";font-weight:", ";&:not([disabled]){background-color:", ";color:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", ";", " &:hover{background-color:", ";box-shadow:", ";}&:active{transition:none;background-color:", ";border-color:", ";", ";}&:focus{box-shadow:", ",", ";", " ", "}}&[disabled]{cursor:not-allowed;color:", ";background-color:", ";border-color:", ";", "}"], enterpriseStyles_common, Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray60), + dark: themes_["variables"].border +}), enterpriseStyles_appendPrepend, Object(themes_["pickVariant"])('$variant', { + enterpriseDefault: 'normal', + enterpriseSecondary: themes_["variables"].fontWeightSemiBold +}), Object(themes_["pick"])({ + light: themes_["variables"].gray98, + dark: themes_["variables"].gray45 +}), Object(themes_["pick"])({ + light: themes_["variables"].gray45, + dark: themes_["variables"].white +}), Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["box-shadow:", ";"], lightShadow), + dark: Object(external_styled_components_["css"])(["box-shadow:inset 0 -1px 0 ", ";"], themes_["variables"].gray30) +}), function (_ref3) { + var $selected = _ref3.$selected; + return $selected && Object(external_styled_components_["css"])(["box-shadow:", ";background-color:", ";border-color:", ";"], Object(themes_["pick"])({ + light: lightSelectedShadow, + dark: Object(external_styled_components_["css"])(["inset 0 1px 0 ", ""], themes_["variables"].black) + }), Object(themes_["pick"])({ + light: themes_["variables"].gray92, + dark: themes_["variables"].gray22 + }), Object(themes_["pick"])({ + light: themes_["variables"].gray60, + dark: themes_["variables"].gray20 + })); +}, Object(themes_["pick"])({ + light: '#ebeeef', + dark: themes_["variables"].gray30 +}), Object(themes_["pick"])({ + light: lightShadow, + dark: Object(external_styled_components_["css"])(["inset 0 -1px 0 ", ""], themes_["variables"].gray25) +}), Object(themes_["pick"])({ + light: themes_["variables"].gray92, + dark: themes_["variables"].gray22 +}), Object(themes_["pick"])({ + light: themes_["variables"].gray60, + dark: themes_["variables"].gray20 +}), Object(themes_["pick"])({ + dark: Object(external_styled_components_["css"])(["box-shadow:inset 0 -1px 0 ", ";"], themes_["variables"].gray22) +}), Object(themes_["pick"])({ + light: lightShadow, + dark: Object(external_styled_components_["css"])(["inset 0 -1px 0 ", ""], themes_["variables"].gray30) +}), themes_["variables"].focusShadow, function (_ref4) { + var $append = _ref4.$append; + return $append && Object(external_styled_components_["css"])(["box-shadow:", ",", ",inset -1px 0 0 ", ";"], Object(themes_["pick"])({ + light: lightShadow, + dark: Object(external_styled_components_["css"])(["inset 0 -1px 0 ", ""], themes_["variables"].gray30) + }), themes_["variables"].focusShadow, themes_["variables"].borderColor); +}, function (_ref5) { + var $append = _ref5.$append, + $selected = _ref5.$selected; + return $append && $selected && Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["box-shadow:", ",", ",", ",inset -1px 0 0 ", ";"], lightShadow, lightSelectedShadow, themes_["variables"].focusShadow, themes_["variables"].borderColor), + dark: Object(external_styled_components_["css"])(["box-shadow:inset 0 1px 0 ", ",", ",inset -1px 0 0 ", ";"], themes_["variables"].black, themes_["variables"].focusShadow, themes_["variables"].borderColor) + }); +}, themes_["variables"].textDisabledColor, Object(themes_["pick"])({ + light: themes_["variables"].gray96, + dark: themes_["variables"].gray30 +}), Object(themes_["pick"])({ + light: themes_["variables"].borderLightColor, + dark: themes_["variables"].gray30 +}), function (_ref6) { + var $selected = _ref6.$selected; + return $selected && Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["box-shadow:", ";background-color:", ";border-color:", ";"], lightSelectedShadow, themes_["variables"].gray92, themes_["variables"].gray80), + dark: Object(external_styled_components_["css"])(["box-shadow:inset 0 1px 0 ", ";background-color:", ";border-color:", ";"], themes_["variables"].black, themes_["variables"].gray22, themes_["variables"].gray20) + }); +}); +var primaryShadow = 'inset 0 -2px 0 rgba(0, 0, 0, 0.1)'; +var primarySelectedShadow = 'inset 0 2px 0 rgba(0, 0, 0, 0.1)'; +var enterprisePrimary = Object(external_styled_components_["css"])(["", ";font-weight:", ";", " &:not([disabled]){background-color:", ";color:", ";box-shadow:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " ", " &:hover{background-color:", ";}&:active{background-color:", ";transition:none;}&:focus{box-shadow:", ",", ";&:active{background-color:", ";transition:none;}}}&[disabled]{color:", ";background-color:", ";cursor:not-allowed;", "}"], enterpriseStyles_common, themes_["variables"].fontWeightSemiBold, enterpriseStyles_appendPrepend, primaryBackgroundColor, themes_["variables"].white, primaryShadow, function (_ref7) { + var $selected = _ref7.$selected; + return $selected && Object(external_styled_components_["css"])(["box-shadow:", ";background-color:", ";"], primarySelectedShadow, primarySelectedBackgroundColor); +}, function (_ref8) { + var $prepend = _ref8.$prepend; + return $prepend && Object(external_styled_components_["css"])(["border-left:1px solid ", ";"], primaryBackgroundColor); +}, themes_["variables"].brandColorD50, themes_["variables"].brandColorD30, primaryShadow, themes_["variables"].focusShadow, themes_["variables"].brandColorD30, themes_["variables"].brandColorL30, themes_["variables"].brandColorL10, function (_ref9) { + var $selected = _ref9.$selected; + return $selected && Object(external_styled_components_["css"])(["box-shadow:", ";background-color:", ";"], primarySelectedShadow, themes_["variables"].brandColorD20); +}); +var enterpriseError = Object(external_styled_components_["css"])(["", ";font-weight:", ";", " &:not([disabled]){background-color:", ";color:", ";box-shadow:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " ", " &:hover{background-color:", ";}&:active{background-color:", ";transition:none;}&:focus{box-shadow:", ",", ";&:active{background-color:", ";transition:none;}}}&[disabled]{color:", ";background-color:", ";cursor:not-allowed;", "}"], enterpriseStyles_common, themes_["variables"].fontWeightSemiBold, enterpriseStyles_appendPrepend, themes_["variables"].errorColorD10, themes_["variables"].white, primaryShadow, function (_ref10) { + var $selected = _ref10.$selected; + return $selected && Object(external_styled_components_["css"])(["box-shadow:", ";background-color:", ";"], primarySelectedShadow, themes_["variables"].errorColorD30); +}, function (_ref11) { + var $prepend = _ref11.$prepend; + return $prepend && Object(external_styled_components_["css"])(["border-left:1px solid ", ";"], themes_["variables"].errorColorD30); +}, themes_["variables"].errorColorD30, themes_["variables"].errorColorD40, primaryShadow, themes_["variables"].focusShadow, themes_["variables"].errorColorD40, themes_["variables"].errorColorL10, themes_["variables"].errorColorD10, function (_ref12) { + var $selected = _ref12.$selected; + return $selected && Object(external_styled_components_["css"])(["box-shadow:", ";background-color:", ";"], primarySelectedShadow, themes_["variables"].errorColorD40); +}); +var enterprisePill = Object(external_styled_components_["css"])(["", ";color:", ";border:1px solid transparent;&:not([disabled]){transition:background-color 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " &:hover{color:", ";background-color:", ";border-color:", ";}", " &:focus{color:", ";box-shadow:", ";}&:active,&[aria-expanded='true']{background-color:", ";transition:none;}}&[disabled]{color:", ";cursor:not-allowed;", "}"], enterpriseStyles_common, Object(themes_["pick"])({ + light: themes_["variables"].gray45, + dark: themes_["variables"].white +}), function (_ref13) { + var $selected = _ref13.$selected; + return $selected && Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].accentColor); +}, Object(themes_["pick"])({ + light: themes_["variables"].linkColor, + dark: themes_["variables"].white +}), themes_["variables"].backgroundColorHover, Object(themes_["pick"])({ + light: themes_["variables"].gray60, + dark: themes_["variables"].borderColor +}), function (_ref14) { + var $error = _ref14.$error; + return $error && Object(external_styled_components_["css"])(["&,&:hover{color:", ";}"], themes_["variables"].errorColor); +}, Object(themes_["pick"])({ + light: themes_["variables"].linkColor, + dark: themes_["variables"].white +}), themes_["variables"].focusShadow, Object(themes_["pick"])({ + light: themes_["variables"].gray92, + dark: themes_["variables"].gray22 +}), themes_["variables"].textDisabledColor, function (_ref15) { + var $selected = _ref15.$selected; + return $selected && Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].borderLightColor); +}); + +// CONCATENATED MODULE: ./src/ButtonSimple/ButtonSimpleStyles.ts + + + + + +var StyledClickable = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "ButtonSimpleStyles__StyledClickable", + componentId: "vlarwe-0" +})(["", ""], Object(themes_["pickVariant"])('$variant', { + enterpriseDefault: enterpriseDefault, + enterpriseSecondary: enterpriseDefault, + enterprisePrimary: enterprisePrimary, + enterpriseError: enterpriseError, + enterpriseDestructive: enterpriseError, + enterprisePill: enterprisePill, + prismaDefault: prismaTransparent, + prismaDestructive: prismaFilled, + prismaPrimary: prismaFilled, + prismaSecondary: prismaTransparent, + prismaToggle: prismaTransparent, + prismaFlat: prismaFlat +})); + +// CONCATENATED MODULE: ./src/ButtonSimple/ButtonSimple.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + +var propTypes = { + action: external_prop_types_default.a.string, + appearance: external_prop_types_default.a.oneOf(['default', 'secondary', 'primary', 'destructive', 'pill', 'toggle', 'flat']), + append: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + inline: external_prop_types_default.a.bool, + openInNewContext: external_prop_types_default.a.bool, + prepend: external_prop_types_default.a.bool, + selected: external_prop_types_default.a.bool, + splunkTheme: external_prop_types_default.a.object, + to: external_prop_types_default.a.string +}; +var defaultProps = { + appearance: 'default', + append: false, + disabled: false, + error: false, + inline: true, + openInNewContext: false, + prepend: false, + selected: false +}; + +var mapVariant = function mapVariant(appearance, family) { + var enterprise = { + "default": 'enterpriseDefault', + destructive: 'enterpriseError', + primary: 'enterprisePrimary', + secondary: 'enterpriseSecondary', + pill: 'enterprisePill', + toggle: 'enterpriseDefault', + flat: 'enterpriseDefault' + }; + var prisma = { + "default": 'prismaDefault', + destructive: 'prismaDestructive', + primary: 'prismaPrimary', + secondary: 'prismaSecondary', + pill: 'prismaSecondary', + toggle: 'prismaToggle', + flat: 'prismaFlat' + }; + + if (family === 'enterprise') { + return enterprise[appearance]; + } + + return prisma[appearance]; +}; + +var ButtonSimple_ButtonSimple = /*#__PURE__*/function (_Component) { + _inherits(ButtonSimple, _Component); + + var _super = _createSuper(ButtonSimple); + + function ButtonSimple() { + var _this; + + _classCallCheck(this, ButtonSimple); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "component", null); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) { + _this.component = c; + }); + + return _this; + } + + _createClass(ButtonSimple, [{ + key: "focus", + + /** + * Places focus on the button. + */ + value: function focus() { + var _this$component; + + (_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + appearance = _this$props.appearance, + append = _this$props.append, + children = _this$props.children, + error = _this$props.error, + prepend = _this$props.prepend, + selected = _this$props.selected, + splunkTheme = _this$props.splunkTheme, + otherProps = _objectWithoutProperties(_this$props, ["appearance", "append", "children", "error", "prepend", "selected", "splunkTheme"]); + + var variant = appearance; + + if (splunkTheme.isEnterprise) { + variant = error ? 'destructive' : appearance; + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({ + "aria-invalid": error, + "data-test": "button-simple", + ref: this.handleMount, + $variant: mapVariant(variant, splunkTheme.family), + $append: append, + $prepend: prepend, + $selected: selected, + $error: error + }, otherProps), children, selected && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, Object(i18n_["_"])('Selected'))); + } + }]); + + return ButtonSimple; +}(external_react_["Component"]); + +_defineProperty(ButtonSimple_ButtonSimple, "defaultProps", defaultProps); + +_defineProperty(ButtonSimple_ButtonSimple, "propTypes", propTypes); + +var ButtonSimpleWithTheme = Object(themes_["withSplunkTheme"])(ButtonSimple_ButtonSimple); +ButtonSimpleWithTheme.propTypes = ButtonSimple_ButtonSimple.propTypes; +/* harmony default export */ var src_ButtonSimple_ButtonSimple = (ButtonSimpleWithTheme); +// CONCATENATED MODULE: ./src/ButtonSimple/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 68427: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 174); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3866__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3866__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 17: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), + +/***/ 174: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4960__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4960__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4960__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Calendar_Calendar; }); +__nested_webpack_require_4960__.d(__nested_webpack_exports__, "calendarActiveSelector", function() { return /* reexport */ calendarActiveSelector; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4960__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4960__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4960__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4960__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_4960__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_4960__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4960__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4960__.n(omit_); + +// EXTERNAL MODULE: external "moment" +var external_moment_ = __nested_webpack_require_4960__(20); +var external_moment_default = /*#__PURE__*/__nested_webpack_require_4960__.n(external_moment_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4960__(8); + +// EXTERNAL MODULE: external "lodash/times" +var times_ = __nested_webpack_require_4960__(78); +var times_default = /*#__PURE__*/__nested_webpack_require_4960__.n(times_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4960__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_4960__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4960__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4960__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4960__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4960__.n(external_styled_components_); + +// CONCATENATED MODULE: ./src/Calendar/DayStyles.ts + + +/* Element used to prevent vertical shift on firefox when the font-weight is increased with $selected */ + +var StyledValue = external_styled_components_default.a.div.withConfig({ + displayName: "DayStyles__StyledValue", + componentId: "sc-1nryhyt-0" +})(["left:0;line-height:", ";position:absolute;top:0;width:100%;"], Object(themes_["pick"])({ + enterprise: '2em', + prisma: '36px ' +})); +var StyledInner = external_styled_components_default.a.div.withConfig({ + displayName: "DayStyles__StyledInner", + componentId: "sc-1nryhyt-1" +})(["border:", ";border-radius:", ";color:", ";height:", ";position:relative;text-align:center;width:", ";"], Object(themes_["pick"])({ + enterprise: '1px solid transparent', + prisma: 'none' +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].borderRadius, + prisma: '50%' +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray45, + dark: themes_["variables"].gray98 + }, + prisma: themes_["variables"].contentColorActive +}), Object(themes_["pick"])({ + enterprise: '2em', + prisma: '36px ' +}), Object(themes_["pick"])({ + enterprise: 'calc(2em - 2px)', + prisma: '36px' +})); +var StyledCell = external_styled_components_default.a.td.withConfig({ + displayName: "DayStyles__StyledCell", + componentId: "sc-1nryhyt-2" +})(["", ";cursor:pointer;", ";", ";"], themes_["mixins"].reset('table-cell'), Object(themes_["pickVariant"])('$today', { + "true": { + enterprise: Object(external_styled_components_["css"])(["& > ", "{background-color:", ";}&:focus{& > ", "{box-shadow:", ";}}"], + /* sc-sel */ + StyledInner, Object(themes_["pick"])({ + light: themes_["variables"].gray92, + dark: themes_["variables"].gray45 + }), + /* sc-sel */ + StyledInner, themes_["variables"].focusShadow), + prisma: Object(external_styled_components_["css"])(["& > ", "{box-shadow:inset 0 0 0 1px ", ";}&:focus{& > ", "{box-shadow:inset 0 0 0 1px ", ",", ";}}"], + /* sc-sel */ + StyledInner, themes_["variables"].interactiveColorBorder, + /* sc-sel */ + StyledInner, themes_["variables"].interactiveColorBorder, themes_["variables"].focusShadow) + }, + "false": Object(external_styled_components_["css"])(["&:focus{& > ", "{box-shadow:", ";}}"], + /* sc-sel */ + StyledInner, themes_["variables"].focusShadow) +}), Object(themes_["pickVariant"])('$selected', { + "true": Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["& > ", "{border-color:", ";}"], + /* sc-sel */ + StyledInner, themes_["variables"].linkColor), + prisma: Object(external_styled_components_["css"])(["& > ", "{background-color:", ";font-weight:", ";}"], + /* sc-sel */ + StyledInner, themes_["variables"].interactiveColorOverlaySelected, themes_["variables"].fontWeightBold) + }), + "false": Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["&:hover{& > ", "{background-color:", ";color:", ";}}"], + /* sc-sel */ + StyledInner, themes_["variables"].backgroundColorHover, themes_["variables"].linkColor), + prisma: Object(external_styled_components_["css"])(["&:hover{& > ", "{background-color:", ";}}"], + /* sc-sel */ + StyledInner, themes_["variables"].interactiveColorOverlayHover) + }) +})); + +// CONCATENATED MODULE: ./src/Calendar/Day.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +var propTypes = { + active: external_prop_types_default.a.bool, + locale: external_prop_types_default.a.string, + onClick: external_prop_types_default.a.func, + onKeydown: external_prop_types_default.a.func, + selected: external_prop_types_default.a.bool, + today: external_prop_types_default.a.bool, + value: external_prop_types_default.a.string +}; + +function Day(_ref) { + var _ref$active = _ref.active, + active = _ref$active === void 0 ? false : _ref$active, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? 'en_US' : _ref$locale, + onClick = _ref.onClick, + onKeyDown = _ref.onKeyDown, + _ref$selected = _ref.selected, + selected = _ref$selected === void 0 ? false : _ref$selected, + _ref$today = _ref.today, + today = _ref$today === void 0 ? false : _ref$today, + value = _ref.value, + otherProps = _objectWithoutProperties(_ref, ["active", "locale", "onClick", "onKeyDown", "selected", "today", "value"]); + + var handleClick = Object(external_react_["useCallback"])(function (e) { + e.preventDefault(); + onClick === null || onClick === void 0 ? void 0 : onClick(e, { + value: value + }); + }, [onClick, value]); + var handleKeyDown = Object(external_react_["useCallback"])(function (e) { + e.preventDefault(); + onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, { + value: value + }); + }, [onKeyDown, value]); + var day = value && external_moment_default()(value, 'YYYY-MM-DD', locale).format('D'); + return /*#__PURE__*/external_react_default.a.createElement(StyledCell, _extends({ + tabIndex: active ? 0 : -1, + "aria-selected": selected, + "data-test-day": day, + "data-test": "day-of-month", + "data-active-day": active, + "data-is-today": today, + onClick: handleClick, + onKeyDown: handleKeyDown, + $today: today, + $selected: selected + }, otherProps), /*#__PURE__*/external_react_default.a.createElement(StyledInner, null, /*#__PURE__*/external_react_default.a.createElement(StyledValue, null, day))); +} + +Day.propTypes = propTypes; +/* harmony default export */ var Calendar_Day = (Day); +// CONCATENATED MODULE: ./src/Calendar/DateTableStyles.ts + + +var Styled = external_styled_components_default.a.table.withConfig({ + displayName: "DateTableStyles__Styled", + componentId: "sc-1lbrjq0-0" +})(["", ";table-layout:fixed;border-spacing:", ";width:", ";margin:", ";"], themes_["mixins"].reset('table'), Object(themes_["pick"])({ + enterprise: '3px', + prisma: themes_["variables"].spacingSmall +}), Object(themes_["pick"])({ + enterprise: '100%', + prisma: 'calc(100% + 16px)' +}), Object(themes_["pick"])({ + enterprise: '0', + prisma: '-8px' +})); +var StyledTableHeader = external_styled_components_default.a.th.withConfig({ + displayName: "DateTableStyles__StyledTableHeader", + componentId: "sc-1lbrjq0-1" +})(["", ";text-align:center;padding-bottom:", ";color:", ";font-size:", ";"], themes_["mixins"].reset('table-cell'), Object(themes_["pick"])({ + enterprise: '2px', + prisma: themes_["variables"].spacingXSmall +}), themes_["variables"].contentColorMuted, Object(themes_["pick"])({ + enterprise: themes_["variables"].fontSizeSmall, + prisma: themes_["variables"].fontSize +})); + +// CONCATENATED MODULE: ./src/Calendar/DateTable.tsx +function DateTable_extends() { DateTable_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return DateTable_extends.apply(this, arguments); } + +function DateTable_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = DateTable_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function DateTable_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + + +var DateTable_propTypes = { + displayValue: external_prop_types_default.a.string.isRequired, + highlightToday: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + locale: external_prop_types_default.a.string, + onChange: external_prop_types_default.a.func, + onInternalChange: external_prop_types_default.a.func, + selectedValue: external_prop_types_default.a.string.isRequired, + todayValue: external_prop_types_default.a.string +}; + +function renderPaddingCells(count) { + return times_default()(count, function (i) { + return /*#__PURE__*/external_react_default.a.createElement("td", { + key: "".concat(i) + }); + }); +} + +function renderDays(_ref) { + var displayValue = _ref.displayValue, + endDate = _ref.endDate, + highlightToday = _ref.highlightToday, + locale = _ref.locale, + onChange = _ref.onChange, + onKeyDown = _ref.onKeyDown, + selectedDate = _ref.selectedDate, + selectedValue = _ref.selectedValue, + startDate = _ref.startDate, + todayValue = _ref.todayValue; + var cursor = external_moment_default()(startDate).locale(locale).startOf('month'); + var days = []; + + while (cursor.isSameOrBefore(endDate)) { + var cursorString = cursor.format('YYYY-MM-DD'); + var isToday = cursorString === todayValue; + var isSelected = cursorString === selectedValue; + var isActive = cursorString === displayValue; + days.push( /*#__PURE__*/external_react_default.a.createElement(Calendar_Day, { + key: cursorString, + locale: locale, + onClick: onChange, + onKeyDown: onKeyDown, + active: selectedDate ? isActive : isToday, + today: highlightToday && isToday, + value: cursorString, + selected: isSelected + })); + cursor.add(1, 'day'); + } + + return days; +} + +function renderRows(cells) { + return cells.reduce(function (accum, el, i) { + var row = Math.floor(i / 7); + accum[row].push(el); + return accum; + }, times_default()(7, function () { + return []; + })).map(function (row, i) { + return ( + /*#__PURE__*/ + // eslint-disable-next-line react/no-array-index-key + external_react_default.a.createElement("tr", { + key: "$week-".concat(i) + }, row) + ); + }); +} + +function renderHeader(locale, dayFormat) { + return /*#__PURE__*/external_react_default.a.createElement("thead", null, /*#__PURE__*/external_react_default.a.createElement("tr", null, times_default()(7, function (i) { + var text = external_moment_default()().locale(locale).weekday(i).format(dayFormat); + var label = external_moment_default()().locale(locale).weekday(i).format('dddd'); + return /*#__PURE__*/external_react_default.a.createElement(StyledTableHeader, { + key: text + }, /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, label), /*#__PURE__*/external_react_default.a.createElement("span", { + "aria-hidden": true + }, text)); + }))); +} + +function DateTable(_ref2) { + var displayValue = _ref2.displayValue, + _ref2$highlightToday = _ref2.highlightToday, + highlightToday = _ref2$highlightToday === void 0 ? false : _ref2$highlightToday, + labelledBy = _ref2.labelledBy, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? 'en_US' : _ref2$locale, + onChange = _ref2.onChange, + onInternalChange = _ref2.onInternalChange, + selectedValue = _ref2.selectedValue, + todayValue = _ref2.todayValue, + otherProps = DateTable_objectWithoutProperties(_ref2, ["displayValue", "highlightToday", "labelledBy", "locale", "onChange", "onInternalChange", "selectedValue", "todayValue"]); + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family; + + var dayFormat = family === 'prisma' ? 'dd' : 'ddd'; + var displayDate = external_moment_default()(displayValue, 'YYYY-MM-DD', locale); + var selectedDate = external_moment_default()(selectedValue, 'YYYY-MM-DD', locale); + var startDate = external_moment_default()(displayDate).startOf('month'); + var endDate = external_moment_default()(displayDate).endOf('month').startOf('day'); + + var handleOnChange = function handleOnChange(event, data) { + event.preventDefault(); + onChange === null || onChange === void 0 ? void 0 : onChange(event, data); + }; + + var handlePreviousDay = function handlePreviousDay(event, _ref3) { + var value = _ref3.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'd').format('YYYY-MM-DD') + }); + }; + + var handleNextDay = function handleNextDay(event, _ref4) { + var value = _ref4.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'd').format('YYYY-MM-DD') + }); + }; + + var handlePreviousWeek = function handlePreviousWeek(event, _ref5) { + var value = _ref5.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'w').format('YYYY-MM-DD') + }); + }; + + var handleNextWeek = function handleNextWeek(event, _ref6) { + var value = _ref6.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'w').format('YYYY-MM-DD') + }); + }; + + var handlePreviousMonth = function handlePreviousMonth(event, _ref7) { + var value = _ref7.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'M').format('YYYY-MM-DD') + }); + }; + + var handleNextMonth = function handleNextMonth(event, _ref8) { + var value = _ref8.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'M').format('YYYY-MM-DD') + }); + }; + + var handlePreviousYear = function handlePreviousYear(event, _ref9) { + var value = _ref9.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(-1, 'y').format('YYYY-MM-DD') + }); + }; + + var handleNextYear = function handleNextYear(event, _ref10) { + var value = _ref10.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').add(1, 'y').format('YYYY-MM-DD') + }); + }; + + var handleStartOfWeek = function handleStartOfWeek(event, _ref11) { + var value = _ref11.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + }); + }; + + var handleEndOfWeek = function handleEndOfWeek(event, _ref12) { + var value = _ref12.value; + event.preventDefault(); + onInternalChange === null || onInternalChange === void 0 ? void 0 : onInternalChange(event, { + value: external_moment_default()(value, 'YYYY-MM-DD').endOf('week').format('YYYY-MM-DD') + }); + }; + + var handleKeyDown = function handleKeyDown(event, data) { + var eventKeyCode = Object(keyboard_["keycode"])(event.nativeEvent); + + switch (eventKeyCode) { + case 'enter': + case 'space': + handleOnChange(event, data); + break; + + case 'up': + handlePreviousWeek(event, data); + break; + + case 'down': + handleNextWeek(event, data); + break; + + case 'left': + handlePreviousDay(event, data); + break; + + case 'right': + handleNextDay(event, data); + break; + + case 'page up': + if (event.shiftKey) { + handlePreviousYear(event, data); + } else { + handlePreviousMonth(event, data); + } + + break; + + case 'page down': + if (event.shiftKey) { + handleNextYear(event, data); + } else { + handleNextMonth(event, data); + } + + break; + + case 'home': + handleStartOfWeek(event, data); + break; + + case 'end': + handleEndOfWeek(event, data); + break; + + default: // do nothing + + } + }; + + var cells = renderPaddingCells(startDate.format('e')).concat(renderDays({ + displayValue: displayValue, + endDate: endDate, + highlightToday: highlightToday, + locale: locale, + onChange: onChange, + onKeyDown: handleKeyDown, + selectedDate: selectedDate, + selectedValue: selectedValue, + startDate: startDate, + todayValue: todayValue + })).concat(renderPaddingCells(6 - endDate.format('e'))); + return /*#__PURE__*/external_react_default.a.createElement(Styled, DateTable_extends({ + role: "grid", + "aria-labelledby": labelledBy + }, otherProps), renderHeader(locale, dayFormat), /*#__PURE__*/external_react_default.a.createElement("tbody", null, renderRows(cells))); +} + +DateTable.propTypes = DateTable_propTypes; +/* harmony default export */ var Calendar_DateTable = (DateTable); +// EXTERNAL MODULE: external "@splunk/react-icons/ChevronLeft" +var ChevronLeft_ = __nested_webpack_require_4960__(83); +var ChevronLeft_default = /*#__PURE__*/__nested_webpack_require_4960__.n(ChevronLeft_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ChevronRight" +var ChevronRight_ = __nested_webpack_require_4960__(43); +var ChevronRight_default = /*#__PURE__*/__nested_webpack_require_4960__.n(ChevronRight_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronLeft" +var enterprise_ChevronLeft_ = __nested_webpack_require_4960__(64); +var enterprise_ChevronLeft_default = /*#__PURE__*/__nested_webpack_require_4960__.n(enterprise_ChevronLeft_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronRight" +var enterprise_ChevronRight_ = __nested_webpack_require_4960__(35); +var enterprise_ChevronRight_default = /*#__PURE__*/__nested_webpack_require_4960__.n(enterprise_ChevronRight_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_4960__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_4960__.n(Button_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4960__(4); + +// CONCATENATED MODULE: ./src/Calendar/MonthHeaderStyles.ts + + +var StyledBox = external_styled_components_default.a.div.withConfig({ + displayName: "MonthHeaderStyles__StyledBox", + componentId: "sc-18bmbh7-0" +})(["display:flex;position:relative;line-height:", ";padding:0 2px;margin-bottom:10px;"], themes_["variables"].inputHeight); +var StyledHeading = external_styled_components_default.a.span.withConfig({ + displayName: "MonthHeaderStyles__StyledHeading", + componentId: "sc-18bmbh7-1" +})(["display:block;text-align:center;text-transform:", ";flex:1 0 1px;", ";"], Object(themes_["pick"])({ + enterprise: 'capitalize', + prisma: 'uppercase' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["font-size:20px;font-weight:bold;color:", ";"], themes_["variables"].contentColorActive) +})); + +// CONCATENATED MODULE: ./src/Calendar/MonthHeader.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function MonthHeader_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = MonthHeader_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function MonthHeader_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + +var MonthHeader_propTypes = { + headingId: external_prop_types_default.a.string, + locale: external_prop_types_default.a.string, + onChange: external_prop_types_default.a.func, + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + value: external_prop_types_default.a.string.isRequired +}; +var defaultProps = { + locale: 'en_US' +}; + +var MonthHeader_MonthHeader = /*#__PURE__*/function (_Component) { + _inherits(MonthHeader, _Component); + + var _super = _createSuper(MonthHeader); + + function MonthHeader() { + var _this; + + _classCallCheck(this, MonthHeader); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "handlePrevMonthClick", function (e) { + _this.handleChange(e, -1); + }); + + _defineProperty(_assertThisInitialized(_this), "handleNextMonthClick", function (e) { + _this.handleChange(e, 1); + }); + + return _this; + } + + _createClass(MonthHeader, [{ + key: "handleChange", + value: function handleChange(e, diff) { + var _this$props$onChange, _this$props; + + e.stopPropagation(); + var newValue = external_moment_default()(this.props.value, 'YYYY-MM-DD').add(diff, 'M').format('YYYY-MM-DD'); + (_this$props$onChange = (_this$props = this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, { + value: newValue + }); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + headingId = _this$props2.headingId, + locale = _this$props2.locale, + value = _this$props2.value, + splunkTheme = _this$props2.splunkTheme, + otherProps = MonthHeader_objectWithoutProperties(_this$props2, ["headingId", "locale", "value", "splunkTheme"]); + + var isEnterprise = splunkTheme.isEnterprise, + isPrisma = splunkTheme.isPrisma; + var date = external_moment_default()(value, 'YYYY-MM-DD', locale); + var monthYear = date.format(MonthHeader.getMonthYearFormat(locale, isPrisma)); + var buttonStyles = { + flex: '0 0 auto' + }; + + var previousScreenReaderText = Object(i18n_["_"])('Previous month'); + + var nextScreenReaderText = Object(i18n_["_"])('Next month'); + + return /*#__PURE__*/external_react_default.a.createElement(themes_["SplunkThemeProvider"], { + density: isPrisma ? 'comfortable' : splunkTheme.density + }, /*#__PURE__*/external_react_default.a.createElement(StyledBox, omit_default()(otherProps, 'onChange'), /*#__PURE__*/external_react_default.a.createElement(Button_default.a, { + appearance: "pill", + icon: isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(enterprise_ChevronLeft_default.a, { + hideDefaultTooltip: true, + screenReaderText: previousScreenReaderText, + size: 1 + }) : /*#__PURE__*/external_react_default.a.createElement(ChevronLeft_default.a, { + "aria-label": previousScreenReaderText, + height: "24", + width: "24" + }), + "data-test": "previous-month", + onClick: this.handlePrevMonthClick, + style: buttonStyles + }), /*#__PURE__*/external_react_default.a.createElement(StyledHeading, { + id: headingId, + "data-test": "header-label" + }, monthYear), /*#__PURE__*/external_react_default.a.createElement(Button_default.a, { + appearance: "pill", + icon: isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(enterprise_ChevronRight_default.a, { + hideDefaultTooltip: true, + screenReaderText: nextScreenReaderText, + size: 1 + }) : /*#__PURE__*/external_react_default.a.createElement(ChevronRight_default.a, { + "aria-label": nextScreenReaderText, + height: "24", + width: "24" + }), + "data-test": "next-month", + onClick: this.handleNextMonthClick, + style: buttonStyles + }))); + } + }], [{ + key: "getMonthYearFormat", + value: function getMonthYearFormat(locale) { + var shortForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var localeNormalized = locale.toLowerCase().replace('_', '-'); + return shortForm ? MonthHeader.monthYearFormatsShortForm[localeNormalized] || // full locale match + MonthHeader.monthYearFormatsShortForm[localeNormalized.substr(0, 2)] || // language match + MonthHeader.monthYearFormatsShortForm["default"] : MonthHeader.monthYearFormats[localeNormalized] || // full locale match + MonthHeader.monthYearFormats[localeNormalized.substr(0, 2)] || // language match + MonthHeader.monthYearFormats["default"]; // default + } + }]); + + return MonthHeader; +}(external_react_["Component"]); + +_defineProperty(MonthHeader_MonthHeader, "propTypes", MonthHeader_propTypes); + +_defineProperty(MonthHeader_MonthHeader, "defaultProps", defaultProps); + +_defineProperty(MonthHeader_MonthHeader, "monthYearFormats", { + "default": 'MMMM YYYY', + ja: 'YYYY年MMM', + ko: 'YYYY년 MMMM', + 'zh-cn': 'YYYY年MMM', + 'zh-tw': 'YYYY年MMM' +}); + +_defineProperty(MonthHeader_MonthHeader, "monthYearFormatsShortForm", { + "default": 'MMM YYYY', + ja: 'YYYY年 MMM', + ko: 'YYYY년 MMMM', + 'zh-cn': 'YYYY年 MMM', + 'zh-tw': 'YYYY年 MMM' +}); + +var MonthHeaderWithTheme = Object(themes_["withSplunkTheme"])(MonthHeader_MonthHeader); +MonthHeaderWithTheme.propTypes = MonthHeader_MonthHeader.propTypes; +/* harmony default export */ var Calendar_MonthHeader = (MonthHeaderWithTheme); +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4960__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4960__.n(Box_); + +// CONCATENATED MODULE: ./src/Calendar/CalendarStyles.ts + + + +var CalendarStyles_StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "CalendarStyles__StyledBox", + componentId: "sc-18925wt-0" +})(["width:", ";padding:", ";"], Object(themes_["pick"])({ + enterprise: '220px', + prisma: '332px' +}), Object(themes_["pick"])({ + enterprise: '8px', + prisma: themes_["variables"].spacingLarge +})); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_4960__(11); + +// CONCATENATED MODULE: ./src/Calendar/Calendar.tsx +function Calendar_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Calendar_typeof = function _typeof(obj) { return typeof obj; }; } else { Calendar_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Calendar_typeof(obj); } + +function Calendar_extends() { Calendar_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Calendar_extends.apply(this, arguments); } + +function Calendar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Calendar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Calendar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Calendar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Calendar_defineProperties(Constructor, staticProps); return Constructor; } + +function Calendar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Calendar_setPrototypeOf(subClass, superClass); } + +function Calendar_setPrototypeOf(o, p) { Calendar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Calendar_setPrototypeOf(o, p); } + +function Calendar_createSuper(Derived) { var hasNativeReflectConstruct = Calendar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Calendar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Calendar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Calendar_possibleConstructorReturn(this, result); }; } + +function Calendar_possibleConstructorReturn(self, call) { if (call && (Calendar_typeof(call) === "object" || typeof call === "function")) { return call; } return Calendar_assertThisInitialized(self); } + +function Calendar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Calendar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Calendar_getPrototypeOf(o) { Calendar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Calendar_getPrototypeOf(o); } + +function Calendar_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + +var calendarActiveSelector = '[data-active-day="true"]'; +var Calendar_propTypes = { + describedBy: external_prop_types_default.a.string, + highlightToday: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + locale: external_prop_types_default.a.string, + onChange: external_prop_types_default.a.func, + + /** @private. */ + required: external_prop_types_default.a.bool, + value: external_prop_types_default.a.string, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]) +}; +var Calendar_defaultProps = { + locale: 'en_US', + value: external_moment_default()().format('YYYY-MM-DD') +}; + +var Calendar_Calendar = /*#__PURE__*/function (_Component) { + Calendar_inherits(Calendar, _Component); + + var _super = Calendar_createSuper(Calendar); + + function Calendar(props) { + var _this; + + Calendar_classCallCheck(this, Calendar); + + _this = _super.call(this, props); + + Calendar_defineProperty(Calendar_assertThisInitialized(_this), "monthHeaderId", void 0); + + Calendar_defineProperty(Calendar_assertThisInitialized(_this), "todayTimerId", void 0); + + Calendar_defineProperty(Calendar_assertThisInitialized(_this), "calendarRef", void 0); + + Calendar_defineProperty(Calendar_assertThisInitialized(_this), "handleMonthChange", function (e, _ref) { + var value = _ref.value; + + _this.setState({ + internalValue: value, + source: 'month' + }); + }); + + Calendar_defineProperty(Calendar_assertThisInitialized(_this), "handleDayChange", function (e, _ref2) { + var value = _ref2.value; + + _this.setState({ + internalValue: value, + source: 'day' + }); + }); + + Calendar_defineProperty(Calendar_assertThisInitialized(_this), "handleCalendarMount", function (el) { + Object(updateReactRef["a" /* updateReactRef */])(_this.calendarRef, el); + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + _this.state = { + internalValue: props.value, + todayValue: _this.getToday(), + source: null + }; + _this.monthHeaderId = Object(id_["createDOMID"])('header'); + _this.calendarRef = /*#__PURE__*/external_react_default.a.createRef(); + + if (false) {} + + return _this; + } + + Calendar_createClass(Calendar, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.todayTimerId = setInterval(function () { + var todayValue = _this2.getToday(); + + if (todayValue !== _this2.state.todayValue) { + _this2.setState({ + todayValue: todayValue + }); + } + }, 1000); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.todayTimerId !== undefined) { + clearInterval(this.todayTimerId); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (false) {} + + if (this.state.internalValue !== prevState.internalValue && this.state.source === 'day') { + this.focusActiveDay(); + } + } + /** + * Place focus on the active day. + */ + + }, { + key: "focusActiveDay", + value: function focusActiveDay() { + var _this$calendarRef, _this$calendarRef$cur; + + var current = (_this$calendarRef = this.calendarRef) === null || _this$calendarRef === void 0 ? void 0 : (_this$calendarRef$cur = _this$calendarRef.current) === null || _this$calendarRef$cur === void 0 ? void 0 : _this$calendarRef$cur.querySelector(calendarActiveSelector); + current === null || current === void 0 ? void 0 : current.focus(); + } + }, { + key: "getToday", + value: function getToday() { + var today = external_moment_default()().locale(this.props.locale).format('YYYY-MM-DD'); + return today; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + describedBy = _this$props.describedBy, + highlightToday = _this$props.highlightToday, + labelledBy = _this$props.labelledBy, + locale = _this$props.locale, + onChange = _this$props.onChange, + required = _this$props.required, + value = _this$props.value; + var _this$state = this.state, + internalValue = _this$state.internalValue, + todayValue = _this$state.todayValue; + return /*#__PURE__*/external_react_default.a.createElement(CalendarStyles_StyledBox, Calendar_extends({ + inline: true, + "aria-labelledby": labelledBy, + "aria-describedby": describedBy, + "aria-required": required, + "data-test": "calendar" + }, omit_default()(this.props, keys_default()(Calendar.propTypes)), { + elementRef: this.handleCalendarMount + }), /*#__PURE__*/external_react_default.a.createElement(Calendar_MonthHeader, { + headingId: this.monthHeaderId, + locale: locale, + onChange: this.handleMonthChange, + value: internalValue + }), /*#__PURE__*/external_react_default.a.createElement(Calendar_DateTable, { + displayValue: internalValue, + highlightToday: highlightToday, + labelledBy: this.monthHeaderId, + locale: locale, + onChange: onChange, + onInternalChange: this.handleDayChange, + selectedValue: value, + todayValue: todayValue + })); + } + }], [{ + key: "validateValue", + value: function validateValue(value) { + if (!external_moment_default()(value, 'YYYY-MM-DD').isValid()) { + return new Error("Invalid value prop ".concat(value, " passed to Calendar. value must be a string date formatted 'YYYY-MM-DD'.")); + } + + return null; + } + }]); + + return Calendar; +}(external_react_["Component"]); + +Calendar_defineProperty(Calendar_Calendar, "propTypes", Calendar_propTypes); + +Calendar_defineProperty(Calendar_Calendar, "defaultProps", Calendar_defaultProps); + +/* harmony default export */ var src_Calendar_Calendar = (Calendar_Calendar); + +// CONCATENATED MODULE: ./src/Calendar/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 20: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95093); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 35: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(69564); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 43: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(65836); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 64: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(16861); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 78: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(6638); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 83: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(88685); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 33319: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 214); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 214: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4073__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4073__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4073__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Chip_Chip; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4073__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4073__.n(external_react_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4073__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4073__.n(omit_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4073__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4073__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Cross" +var Cross_ = __nested_webpack_require_4073__(25); +var Cross_default = /*#__PURE__*/__nested_webpack_require_4073__.n(Cross_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close" +var Close_ = __nested_webpack_require_4073__(26); +var Close_default = /*#__PURE__*/__nested_webpack_require_4073__.n(Close_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4073__(4); + +// EXTERNAL MODULE: external "@splunk/ui-utils/color" +var color_ = __nested_webpack_require_4073__(47); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4073__(0); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4073__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4073__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4073__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4073__.n(Clickable_); + +// CONCATENATED MODULE: ./src/Chip/ChipStyles.ts + + + +var StyledBasic = external_styled_components_default.a.div.withConfig({ + displayName: "ChipStyles__StyledBasic", + componentId: "sc-1sd3tsh-0" +})(["", ";background-color:", ";border:1px solid transparent;flex:0 1 auto;max-width:calc(100% - 3px);border-radius:2px;", ";", " ", " ", ""], themes_["mixins"].reset('inline-flex'), Object(themes_["pickVariant"])('$appearance', { + "default": { + enterprise: { + dark: themes_["variables"].gray45, + light: themes_["variables"].gray92 + }, + prisma: themes_["variables"].neutral100 + }, + info: { + enterprise: themes_["variables"].infoColorL10 + }, + success: { + enterprise: themes_["variables"].successColorL10 + }, + warning: { + enterprise: themes_["variables"].warningColorL10 + }, + error: { + enterprise: themes_["variables"].errorColorL10, + prisma: themes_["variables"].accentColorNegative + }, + outline: { + prisma: 'transparent' + }, + custom: function custom(_ref) { + var $backgroundColor = _ref.$backgroundColor; + return $backgroundColor; + } +}), function (_ref2) { + var $appearance = _ref2.$appearance; + return $appearance === 'outline' && Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorder); +}, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["color:", ",line-height:", ";margin:0 2px 2px 0;"], themes_["variables"].textGray, themes_["variables"].lineHeight), + prisma: Object(external_styled_components_["css"])(["color:", ";line-height:16px;margin:1px;"], function (_ref3) { + var $appearance = _ref3.$appearance; + return $appearance === 'error' ? themes_["variables"].contentColorInverted : themes_["variables"].contentColorDefault; + }) +}), Object(themes_["pick"])({ + enterprise: { + comfortable: Object(external_styled_components_["css"])(["height:calc(", " - 6px);padding:4px 7px;"], themes_["variables"].inputHeight), + compact: Object(external_styled_components_["css"])(["height:calc(", " - 6px);padding:2px 4px;"], themes_["variables"].inputHeight) + }, + prisma: { + comfortable: Object(external_styled_components_["css"])(["height:calc(", " - 8px);padding:7px 7px;font-size:", ";"], themes_["variables"].inputHeight, themes_["variables"].fontSizeSmall), + compact: Object(external_styled_components_["css"])(["height:calc(", " - 8px);padding:3px 7px;font-size:", ";"], themes_["variables"].inputHeight, themes_["variables"].fontSizeSmall) + } +}), function (_ref4) { + var $disabled = _ref4.$disabled; + return $disabled && Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pickVariant"])('$appearance', { + "default": { + enterprise: { + dark: 'rgba(0, 0, 0, 0.15)', + light: 'rgba(0, 0, 0, 0.05)' + }, + prisma: themes_["variables"].interactiveColorBackgroundDisabled + }, + info: { + enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].infoColorL10, 0.3) + }, + success: { + enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].successColorL10, 0.3) + }, + warning: { + enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].warningColorL10, 0.3) + }, + error: { + enterprise: themes_["mixins"].colorWithAlpha(themes_["variables"].errorColorL10, 0.3), + prisma: themes_["variables"].interactiveColorBackgroundDisabled + }, + outline: { + prisma: themes_["variables"].interactiveColorBackgroundDisabled + }, + custom: { + enterprise: { + dark: 'rgba(0, 0, 0, 0.15)', + light: 'rgba(0, 0, 0, 0.05)' + }, + prisma: themes_["variables"].interactiveColorBackgroundDisabled + } + })); +}); +var Styled = external_styled_components_default()(StyledBasic).withConfig({ + displayName: "ChipStyles__Styled", + componentId: "sc-1sd3tsh-1" +})(["align-items:center;"]); +var StyledInner = external_styled_components_default.a.div.withConfig({ + displayName: "ChipStyles__StyledInner", + componentId: "sc-1sd3tsh-2" +})(["", ";"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["display:flex;max-width:100%;"]), + prisma: Object(external_styled_components_["css"])(["display:grid;max-width:100%;height:16px;column-gap:", ";", ";"], Object(themes_["pick"])({ + prisma: { + compact: themes_["variables"].spacingXSmall, + comfortable: themes_["variables"].spacingSmall + } + }), function (_ref5) { + var $icon = _ref5.$icon, + $removable = _ref5.$removable; + var gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:1fr;"]); + + if ($icon && $removable) { + gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:0fr 1fr 0fr;"]); + } else if ($icon) { + gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:0fr 1fr;"]); + } else if ($removable) { + gridColumns = Object(external_styled_components_["css"])(["grid-template-columns:1fr 0fr;"]); + } + + return gridColumns; + }) +})); +var StyledIcon = external_styled_components_default.a.div.withConfig({ + displayName: "ChipStyles__StyledIcon", + componentId: "sc-1sd3tsh-3" +})(["", ";margin-right:", ";color:", ";"], Object(themes_["pick"])({ + prisma: { + compact: Object(external_styled_components_["css"])(["font-size:14px;display:inline-flex;svg{height:16px;vertical-align:baseline;}"]), + comfortable: Object(external_styled_components_["css"])(["font-size:18px;display:inline-flex;align-self:center;svg{height:16px;vertical-align:baseline;}"]) + }, + enterprise: Object(external_styled_components_["css"])(["flex:0 0 auto;"]) +}), Object(themes_["pick"])({ + enterprise: '3px' +}), Object(themes_["pickVariant"])('$disabled', { + "true": themes_["variables"].contentColorDisabled, + "false": { + enterprise: function enterprise(_ref6) { + var $foregroundColor = _ref6.$foregroundColor; + return $foregroundColor || themes_["variables"].contentColorDefault; + }, + prisma: function prisma(_ref7) { + var $foregroundColor = _ref7.$foregroundColor, + $appearance = _ref7.$appearance; + return $foregroundColor || ($appearance === 'error' ? themes_["variables"].contentColorInverted : themes_["variables"].contentColorDefault); + } + } +})); +var StyledLabel = external_styled_components_default.a.div.withConfig({ + displayName: "ChipStyles__StyledLabel", + componentId: "sc-1sd3tsh-4" +})(["", " ", ";color:", ";"], themes_["mixins"].ellipsis(), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["flex:0 1 auto;"]) +}), Object(themes_["pickVariant"])('$disabled', { + "true": themes_["variables"].contentColorDisabled, + "false": { + enterprise: function enterprise(_ref8) { + var $foregroundColor = _ref8.$foregroundColor; + return $foregroundColor || themes_["variables"].contentColorDefault; + }, + prisma: function prisma(_ref9) { + var $foregroundColor = _ref9.$foregroundColor, + $appearance = _ref9.$appearance; + return $foregroundColor || ($appearance === 'error' ? themes_["variables"].contentColorInverted : themes_["variables"].contentColorActive); + } + } +})); +var StyledRemove = external_styled_components_default.a.span.withConfig({ + displayName: "ChipStyles__StyledRemove", + componentId: "sc-1sd3tsh-5" +})(["", ";"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["flex:0 0 auto;padding-left:", ";font-size:", ";color:", ";"], themes_["variables"].spacingQuarter, Object(themes_["pick"])({ + compact: '9px', + comfortable: '10.5px' + }), function (_ref10) { + var $disabled = _ref10.$disabled, + $foregroundColor = _ref10.$foregroundColor; + return $disabled ? themes_["variables"].contentColorDisabled : $foregroundColor || themes_["variables"].textGray; + }), + prisma: Object(external_styled_components_["css"])(["font-size:", ";display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:12px;font-size:9px;color:", ";"], Object(themes_["pick"])({ + compact: '9px', + comfortable: '10.5px' + }), function (_ref11) { + var $disabled = _ref11.$disabled, + $foregroundColor = _ref11.$foregroundColor; + return $disabled ? themes_["variables"].contentColorDisabled : $foregroundColor || 'inherit'; + }) +})); +var StyledClickable = external_styled_components_default()(StyledBasic.withComponent(Clickable_default.a)).withConfig({ + displayName: "ChipStyles__StyledClickable", + componentId: "sc-1sd3tsh-6" +})(["flex:0 1 auto;line-height:16px;cursor:pointer;&:focus{", ";}&:not([disabled]):hover{", ";}", ";"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].linkColor), + prisma: Object(external_styled_components_["css"])(["color:", ";", "{background-color:", ";box-shadow:0 0 0 3px ", ";}"], themes_["variables"].contentColorActive, + /* sc-sel */ + StyledRemove, themes_["variables"].interactiveColorOverlayHover, themes_["variables"].focusColor) +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["background-color:", ";", "{color:", ";}"], Object(themes_["pickVariant"])('$appearance', { + "default": { + dark: themes_["variables"].gray30, + light: themes_["variables"].gray96 + }, + info: themes_["variables"].infoColorL20, + success: themes_["variables"].successColorL20, + warning: themes_["variables"].warningColorL20, + error: themes_["variables"].errorColorL20, + custom: { + dark: themes_["variables"].gray30, + light: themes_["variables"].gray96 + } + }), + /* sc-sel */ + StyledRemove, function (_ref12) { + var $foregroundColor = _ref12.$foregroundColor; + return $foregroundColor || themes_["variables"].linkColor; + }), + prisma: Object(external_styled_components_["css"])(["color:", ";", "{background-color:", ";", ";}"], themes_["variables"].contentColorActive, + /* sc-sel */ + StyledRemove, themes_["variables"].interactiveColorOverlayHover, function (_ref13) { + var $appearance = _ref13.$appearance; + return $appearance === 'error' && Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorInverted); + }) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:not([disabled]):active ", "{background-color:", ";}"], + /* sc-sel */ + StyledRemove, themes_["variables"].interactiveColorOverlayActive) +})); + +// CONCATENATED MODULE: ./src/Chip/Chip.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + + +var propTypes = { + appearance: external_prop_types_default.a.oneOf(['info', 'success', 'warning', 'error', 'outline']), + backgroundColor: external_prop_types_default.a.string, + children: external_prop_types_default.a.node.isRequired, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + foregroundColor: external_prop_types_default.a.string, + icon: external_prop_types_default.a.node, + onRequestRemove: external_prop_types_default.a.func, + + /** Includes this value in `onRequestRemove` callbacks. */ + value: external_prop_types_default.a.any +}; +var defaultProps = { + disabled: false +}; + +function isInteractive(props) { + return !!props.onRequestRemove; +} + +function getSharedProps(props) { + var appearance = props.appearance, + backgroundColor = props.backgroundColor, + disabled = props.disabled, + foregroundColor = props.foregroundColor, + icon = props.icon, + otherProps = _objectWithoutProperties(props, ["appearance", "backgroundColor", "disabled", "foregroundColor", "icon"]); // Validate that the color being rendered into the CSS is restricted to only values that are of CSS type . + + + var $foregroundColor = foregroundColor && Object(color_["isCSSColor"])(foregroundColor) ? foregroundColor : undefined; + var $backgroundColor = backgroundColor && Object(color_["isCSSColor"])(backgroundColor) ? backgroundColor : undefined; + var sharedProps = { + 'data-test': 'chip', + $appearance: appearance || ($backgroundColor ? 'custom' : 'default'), + $backgroundColor: $backgroundColor, + $foregroundColor: $foregroundColor, + disabled: disabled, + icon: icon + }; + return [sharedProps, otherProps]; +} + +function ChipInteractive(props) { + var _getSharedProps = getSharedProps(props), + _getSharedProps2 = _slicedToArray(_getSharedProps, 2), + sharedProps = _getSharedProps2[0], + ownProps = _getSharedProps2[1]; + + var $appearance = sharedProps.$appearance, + $foregroundColor = sharedProps.$foregroundColor, + disabled = sharedProps.disabled, + icon = sharedProps.icon, + otherSharedProps = _objectWithoutProperties(sharedProps, ["$appearance", "$foregroundColor", "disabled", "icon"]); + + var children = ownProps.children, + elementRef = ownProps.elementRef, + onRequestRemove = ownProps.onRequestRemove, + value = ownProps.value, + otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef", "onRequestRemove", "value"]); + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var handleRemoveClick = Object(external_react_["useCallback"])(function (e) { + onRequestRemove(e, { + value: value + }); + }, [onRequestRemove, value]); + return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({ + $appearance: $appearance, + $disabled: disabled, + $foregroundColor: $foregroundColor, + "data-test-value": value, + disabled: disabled, + elementRef: elementRef, + onClick: handleRemoveClick + }, otherSharedProps, omit_default()(otherProps, Object.keys(propTypes))), /*#__PURE__*/external_react_default.a.createElement(StyledInner, { + $icon: !!icon, + $removable: true + }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, { + $appearance: $appearance, + $disabled: disabled, + $foregroundColor: $foregroundColor + }, icon), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + "data-test": "label", + $appearance: $appearance, + $disabled: disabled, + $foregroundColor: $foregroundColor + }, children), /*#__PURE__*/external_react_default.a.createElement(StyledRemove, { + $disabled: disabled, + $foregroundColor: $foregroundColor + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + "data-test": "cross", + hideDefaultTooltip: true, + screenReaderText: Object(i18n_["_"])('Remove'), + size: 0.85 + }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + "aria-label": Object(i18n_["_"])('Remove'), + "data-test": "cross", + height: "20px", + width: "20px" + })))); +} + +function ChipNonInteractive(props) { + var _getSharedProps3 = getSharedProps(props), + _getSharedProps4 = _slicedToArray(_getSharedProps3, 2), + sharedProps = _getSharedProps4[0], + ownProps = _getSharedProps4[1]; + + var $appearance = sharedProps.$appearance, + $foregroundColor = sharedProps.$foregroundColor, + disabled = sharedProps.disabled, + icon = sharedProps.icon, + otherSharedProps = _objectWithoutProperties(sharedProps, ["$appearance", "$foregroundColor", "disabled", "icon"]); + + var children = ownProps.children, + elementRef = ownProps.elementRef, + otherProps = _objectWithoutProperties(ownProps, ["children", "elementRef"]); + + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + $appearance: $appearance, + $disabled: disabled, + ref: elementRef + }, otherSharedProps, omit_default()(otherProps, Object.keys(propTypes))), /*#__PURE__*/external_react_default.a.createElement(StyledInner, { + $icon: !!icon, + $removable: false + }, icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, { + $appearance: $appearance, + $disabled: disabled, + $foregroundColor: $foregroundColor + }, icon), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + "data-test": "label", + $appearance: $appearance, + $disabled: disabled, + $foregroundColor: $foregroundColor + }, children))); +} + +function Chip(props) { + // @docs-props-type ChipPropsBase + return isInteractive(props) ? /*#__PURE__*/external_react_default.a.createElement(ChipInteractive, props) : /*#__PURE__*/external_react_default.a.createElement(ChipNonInteractive, props); +} + +Chip.propTypes = propTypes; +Chip.defaultProps = defaultProps; +/* harmony default export */ var Chip_Chip = (Chip); +// CONCATENATED MODULE: ./src/Chip/index.ts + + + +/***/ }), + +/***/ 25: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54719); + +/***/ }), + +/***/ 26: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68787); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 47: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(74224); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 39137: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 195); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3964__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3964__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 195: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4823__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4823__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4823__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Clickable_Clickable; }); +__nested_webpack_require_4823__.d(__nested_webpack_exports__, "isInternalLink", function() { return /* reexport */ isInternalLink; }); +__nested_webpack_require_4823__.d(__nested_webpack_exports__, "NavigationContext", function() { return /* reexport */ NavigationContext; }); +__nested_webpack_require_4823__.d(__nested_webpack_exports__, "NavigationProvider", function() { return /* reexport */ NavigationProvider; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4823__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4823__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4823__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4823__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_4823__(10); + +// EXTERNAL MODULE: external "lodash/isString" +var isString_ = __nested_webpack_require_4823__(23); +var isString_default = /*#__PURE__*/__nested_webpack_require_4823__.n(isString_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4823__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4823__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown" +var Dropdown_ = __nested_webpack_require_4823__(22); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4823__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4823__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4823__(0); + +// CONCATENATED MODULE: ./src/Clickable/ClickableStyles.ts + + +var StyledA = external_styled_components_default.a.a.withConfig({ + displayName: "ClickableStyles__StyledA", + componentId: "sc-7al1vw-0" +})(["", " cursor:pointer;&[disabled]{cursor:not-allowed;color:", ";}&::-moz-focus-inner{border:0;padding:0;}"], themes_["mixins"].reset('inline'), themes_["variables"].contentColorDisabled); + +// CONCATENATED MODULE: ./src/Clickable/NavigationProvider.tsx + + +/** @public */ + +var propTypes = { + children: external_prop_types_default.a.node, + onClick: external_prop_types_default.a.func, + prefix: external_prop_types_default.a.string +}; +var NavigationContext = /*#__PURE__*/external_react_default.a.createContext({}); +/** + * Used to provide an override for the `onClick` for links for single page applications so that + * internal links can navigate without a page reload. + */ + +function NavigationProvider(_ref) { + var children = _ref.children, + onClick = _ref.onClick, + prefix = _ref.prefix; + // @docs-props-type NavigationProviderProps + return /*#__PURE__*/external_react_default.a.createElement(NavigationContext.Provider, { + value: { + onClick: onClick, + prefix: prefix + } + }, children); +} + +NavigationProvider.propTypes = propTypes; + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_4823__(11); + +// CONCATENATED MODULE: ./src/Clickable/Clickable.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + +var WITH_SCHEME = /^[a-z0-9]+:/; +var SCHEME_RELATIVE = /^\/\//; +var IS_RELATIVE = /^\//; +var isInternalLink = function isInternalLink(to) { + return to != null && !WITH_SCHEME.test(to) && !SCHEME_RELATIVE.test(to); +}; +var Clickable_propTypes = { + /** @private */ + allowDisabledLink: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + onClick: external_prop_types_default.a.func, + openInNewContext: external_prop_types_default.a.bool, + navigationLabel: external_prop_types_default.a.string, + to: external_prop_types_default.a.string +}; +var defaultProps = { + disabled: false, + openInNewContext: false +}; + +function isLink(props) { + return !!props.to && !props.disabled; +} + +function getPrefixedURL(to, prefix) { + if (prefix != null && isInternalLink(to) && IS_RELATIVE.test(to)) { + return "".concat(prefix).concat(to); + } + + return to; +} +/** + * `Clickable` renders as a `button` element, or as an `a` element if the `to` prop is set + * and the `disabled` prop is `false`. This is called link mode. + */ + + +var Clickable_Clickable = /*#__PURE__*/function (_Component) { + _inherits(Clickable, _Component); + + var _super = _createSuper(Clickable); + + // @docs-props-type ClickablePropsBase + // should use ClickablePropsBase but fails on refs - observe + function Clickable(props) { + var _this; + + _classCallCheck(this, Clickable); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "el", null); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + _this.el = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "createHandleOnClick", function (providedOnClick) { + return function (e) { + if (isLink(_this.props)) { + // when user command-click on mac or ctrl-click on other platforms, and + // Tag is an , let the click pass through, let the to achieve user's + // intent of 'open in new context' + // on mac, ctrl-click will be caught and open option menu even before hitting + // the DOM, so we're safe to check both metaKey and ctrlKey here + // without platform sniffing + if ((e.metaKey || e.ctrlKey) && _this.props.to) { + return; + } + } + + if (_this.props.onClick) { + _this.props.onClick(e); + } else if (isLink(_this.props) && providedOnClick) { + var prefix = _this.context.prefix; + var label = _this.props.navigationLabel; + + if (!label && isString_default()(_this.props.children)) { + label = _this.props.children; + } + + providedOnClick(e, { + to: getPrefixedURL(_this.props.to, prefix), + originalTo: _this.props.to, + openInNewContext: _this.props.openInNewContext, + label: label + }); + } + }; + }); + + if (false) {} + + return _this; + } + + _createClass(Clickable, [{ + key: "focus", + + /** + * Place focus on the element. + */ + value: function focus() { + var _this$el; + + (_this$el = this.el) === null || _this$el === void 0 ? void 0 : _this$el.focus(); + } + }, { + key: "render", + value: function render() { + var _this$context = this.context, + onClick = _this$context.onClick, + prefix = _this$context.prefix; + var handleOnClick = this.createHandleOnClick(onClick); // Only set the href attribute when enabled, and therefore using an tag + + if (isLink(this.props)) { + var _this$props = this.props, + _children = _this$props.children, + openInNewContext = _this$props.openInNewContext, + to = _this$props.to, + _otherProps = _objectWithoutProperties(_this$props, ["children", "openInNewContext", "to"]); + + var target = openInNewContext ? '_blank' : undefined; + var rel = openInNewContext && isInternalLink(to) ? 'noopener noreferrer' : undefined; + return /*#__PURE__*/external_react_default.a.createElement(StyledA, _extends({ + "data-test": "clickable", + ref: this.handleMount, + href: getPrefixedURL(this.props.to, prefix), + target: target, + rel: rel, + onClick: handleOnClick + }, omit_default()(_otherProps, 'disabled', 'elementRef', 'onClick')), _children); + } + + if (this.props.allowDisabledLink) { + var _ref = this.props, + _children2 = _ref.children, + _otherProps2 = _objectWithoutProperties(_ref, ["children"]); + + if (this.props.disabled && this.props.to != null) { + return /*#__PURE__*/external_react_default.a.createElement(StyledA, _extends({ + "data-test": "clickable", + ref: this.handleMount + }, omit_default()(_otherProps2, 'href', 'elementRef', 'onClick')), _children2); + } + } // button variant + + + var _ref2 = this.props, + children = _ref2.children, + type = _ref2.type, + otherProps = _objectWithoutProperties(_ref2, ["children", "type"]); + + return /*#__PURE__*/external_react_default.a.createElement(StyledA, _extends({ + as: "button", + "data-test": "clickable", + ref: this.handleMount, + type: type || 'button', + onClick: handleOnClick + }, omit_default()(otherProps, 'elementRef', 'onClick', 'openInNewContext', 'to')), children); + } + }]); + + return Clickable; +}(external_react_["Component"]); + +_defineProperty(Clickable_Clickable, "contextType", NavigationContext); + +_defineProperty(Clickable_Clickable, "propTypes", Clickable_propTypes); + +_defineProperty(Clickable_Clickable, "defaultProps", defaultProps); + +_defineProperty(Clickable_Clickable, Dropdown_["legacyRefMode"], true); + +/* harmony default export */ var src_Clickable_Clickable = (Clickable_Clickable); +// CONCATENATED MODULE: ./src/Clickable/index.ts + + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 22: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73592); + +/***/ }), + +/***/ 23: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(85015); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 241: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 215); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 215: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ CloseButton_CloseButton; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Cross" +var Cross_ = __nested_webpack_require_3959__(25); +var Cross_default = /*#__PURE__*/__nested_webpack_require_3959__.n(Cross_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close" +var Close_ = __nested_webpack_require_3959__(26); +var Close_default = /*#__PURE__*/__nested_webpack_require_3959__.n(Close_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_3959__(4); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ButtonSimple" +var ButtonSimple_ = __nested_webpack_require_3959__(62); +var ButtonSimple_default = /*#__PURE__*/__nested_webpack_require_3959__.n(ButtonSimple_); + +// CONCATENATED MODULE: ./src/CloseButton/CloseButtonStyles.ts + + + +var StyledButtonSimple = external_styled_components_default()(ButtonSimple_default.a).withConfig({ + displayName: "CloseButtonStyles__StyledButtonSimple", + componentId: "b3h40f-0" +})(["float:right;width:", ";height:", ";text-align:center;"], themes_["variables"].inputHeight, themes_["variables"].inputHeight); + +// CONCATENATED MODULE: ./src/CloseButton/CloseButton.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + +var propTypes = { + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + screenReaderText: external_prop_types_default.a.string +}; + +function CloseButton(_ref) { + var _ref$disabled = _ref.disabled, + disabled = _ref$disabled === void 0 ? false : _ref$disabled, + _ref$screenReaderText = _ref.screenReaderText, + screenReaderText = _ref$screenReaderText === void 0 ? Object(i18n_["_"])('Close') : _ref$screenReaderText, + otherProps = _objectWithoutProperties(_ref, ["disabled", "screenReaderText"]); + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise, + isCompact = _useSplunkTheme.isCompact; + + var prismaSize = isCompact ? '20px' : '24px'; + return /*#__PURE__*/external_react_default.a.createElement(StyledButtonSimple, _extends({ + appearance: "pill", + disabled: disabled, + "aria-label": screenReaderText + }, otherProps), isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + "data-test": "cross", + inline: false, + screenReaderText: null, + size: "13px" + }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + "data-test": "cross", + height: prismaSize, + width: prismaSize + })); +} + +CloseButton.propTypes = propTypes; +/* harmony default export */ var CloseButton_CloseButton = (CloseButton); +// CONCATENATED MODULE: ./src/CloseButton/index.ts + + +/***/ }), + +/***/ 25: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54719); + +/***/ }), + +/***/ 26: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68787); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 62: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(2759); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 36771: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 196); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 196: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4079__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4079__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4079__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_CollapsiblePanel_CollapsiblePanel; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4079__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4079__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4079__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4079__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_4079__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_4079__.n(has_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_4079__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_4079__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4079__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4079__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4079__(8); + +// EXTERNAL MODULE: external "@splunk/react-ui/TransitionOpen" +var TransitionOpen_ = __nested_webpack_require_4079__(72); +var TransitionOpen_default = /*#__PURE__*/__nested_webpack_require_4079__.n(TransitionOpen_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4079__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4079__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4079__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4079__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4079__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4079__.n(Clickable_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4079__(0); + +// CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanelStyles.ts + + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "CollapsiblePanelStyles__StyledBox", + componentId: "sc-1phikbp-0" +})(["display:flex;flex-direction:column;min-height:", ";", ";& + &{margin-top:", ";}"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc(", " + 12px)"], themes_["variables"].lineHeight), + prisma: { + comfortable: '56px', + compact: '48px' + } +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].backgroundColorSection) +}), Object(themes_["pick"])({ + enterprise: '2px', + prisma: '1px' +})); +var StyledIcon = external_styled_components_default.a.span.withConfig({ + displayName: "CollapsiblePanelStyles__StyledIcon", + componentId: "sc-1phikbp-1" +})(["position:absolute;left:", ";transition:transform ", ";", ";"], Object(themes_["pick"])({ + enterprise: '12px', + prisma: '20px' +}), Object(themes_["pick"])({ + enterprise: '300ms', + prisma: '200ms' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";display:flex;top:", ";[disabled] > &{color:inherit;}"], themes_["variables"].contentColorDefault, Object(themes_["pick"])({ + comfortable: '20px', + compact: '16px' + })) +})); +var StyledTitleWithActions = external_styled_components_default.a.div.withConfig({ + displayName: "CollapsiblePanelStyles__StyledTitleWithActions", + componentId: "sc-1phikbp-2" +})(["flex-shrink:0;border-bottom:0;position:relative;padding:", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;color:", ";", " ", ""], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["", " ", " ", " 30px"], themes_["variables"].spacingXSmall, themes_["variables"].spacingSmall, themes_["variables"].spacingXSmall), + prisma: { + comfortable: '8px 10px 8px 52px', + compact: '8px 10px 8px 52px' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].interactiveColorBackground), + enterprise: { + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].gray45), + light: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].gray96) + } +}), function (_ref) { + var $disabled = _ref.$disabled; + return $disabled && Object(external_styled_components_["css"])(["cursor:default;color:", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].contentColorDefault, + prisma: themes_["variables"].contentColorDisabled + })); +}); +var StyledClickableIcon = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "CollapsiblePanelStyles__StyledClickableIcon", + componentId: "sc-1phikbp-3" +})(["position:absolute;left:", ";padding:", ";top:8px;& > svg{transition:transform ", ";}", ";", " &:focus:not([disabled]),&:active:not([disabled]){color:", ";box-shadow:", ";}&:hover:not([disabled]){color:", ";background-color:", ";}"], Object(themes_["pick"])({ + enterprise: '4px', + prisma: '8px' +}), Object(themes_["pick"])({ + enterprise: { + comfortable: '2px 8px', + compact: '0px 8px' + }, + prisma: { + comfortable: '14px', + compact: '8px' + } +}), Object(themes_["pick"])({ + enterprise: '300ms', + prisma: '200ms' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";display:flex;[disabled] > &{color:inherit;}"], themes_["variables"].contentColorDefault) +}), Object(themes_["pickVariant"])('$open', { + "true": Object(external_styled_components_["css"])(["& > svg{transform:rotate(90deg);}"]) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), themes_["variables"].focusShadowInset, Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray92, + dark: themes_["variables"].gray30 + }, + prisma: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlayHover) +})); +var StyledTitleClickable = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "CollapsiblePanelStyles__StyledTitleClickable", + componentId: "sc-1phikbp-4" +})(["width:100%;flex-shrink:0;border-bottom:0;cursor:pointer;position:relative;display:block;transition:background-color 0.2s,border 0.2s,box-shadow 0.2s;padding:", ";color:", ";", " ", " &[disabled]{cursor:default;color:", ";}&:focus:not([disabled]),&:active:not([disabled]){color:", ";box-shadow:", ";}&:hover:not([disabled]){color:", ";background-color:", ";}"], Object(themes_["pick"])({ + enterprise: '6px 30px', + prisma: { + comfortable: '18px 20px 18px 52px', + compact: '14px 20px 14px 52px' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].interactiveColorBackground) +}), Object(themes_["pickVariant"])('$open', { + "true": Object(external_styled_components_["css"])(["", "{transform:rotate(90deg);}"], + /* sc-sel */ + StyledIcon), + "false": { + enterprise: { + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].gray45), + light: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].gray96) + } + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].contentColorDefault, + prisma: themes_["variables"].contentColorDisabled +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), themes_["variables"].focusShadowInset, Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray92, + dark: themes_["variables"].gray30 + }, + prisma: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlayHover) +})); +var StyledHeadingContent = external_styled_components_default.a.span.withConfig({ + displayName: "CollapsiblePanelStyles__StyledHeadingContent", + componentId: "sc-1phikbp-5" +})(["display:flex;justify-content:space-between;", " ", ""], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["font-weight:", ";"], themes_["variables"].fontWeightSemiBold) +}), function (_ref2) { + var $titleWithActions = _ref2.$titleWithActions; + return $titleWithActions && Object(external_styled_components_["css"])(["min-height:", ";"], Object(themes_["pick"])({ + prisma: { + comfortable: '40px', + compact: '32px' + } + })); +}); +var StyledDescription = external_styled_components_default.a.span.withConfig({ + displayName: "CollapsiblePanelStyles__StyledDescription", + componentId: "sc-1phikbp-6" +})(["font-size:", ";margin-left:", ";"], themes_["variables"].fontSizeSmall, Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: themes_["variables"].spacingLarge +})); + +// EXTERNAL MODULE: external "@splunk/react-icons/ChevronRight" +var ChevronRight_ = __nested_webpack_require_4079__(43); +var ChevronRight_default = /*#__PURE__*/__nested_webpack_require_4079__.n(ChevronRight_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronRight" +var enterprise_ChevronRight_ = __nested_webpack_require_4079__(35); +var enterprise_ChevronRight_default = /*#__PURE__*/__nested_webpack_require_4079__.n(enterprise_ChevronRight_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4079__(4); + +// CONCATENATED MODULE: ./src/CollapsiblePanel/icons/ExpandPanel.tsx + + + + + + +var propTypes = { + open: external_prop_types_default.a.bool +}; + +var ExpandPanel_ChevronRight = function ChevronRight(_ref) { + var open = _ref.open; + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var screenReaderText = open ? Object(i18n_["_"])('Panel is open') : Object(i18n_["_"])('Panel is closed'); + return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(enterprise_ChevronRight_default.a, { + hideDefaultTooltip: true, + screenReaderText: screenReaderText + }) : /*#__PURE__*/external_react_default.a.createElement(ChevronRight_default.a, { + "aria-label": screenReaderText + }); +}; + +ExpandPanel_ChevronRight.propTypes = propTypes; +/* harmony default export */ var ExpandPanel = (ExpandPanel_ChevronRight); +// CONCATENATED MODULE: ./src/CollapsiblePanel/CollapsiblePanel.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + +/** @public */ + +var CollapsiblePanel_propTypes = { + innerBodyStyles: external_prop_types_default.a.object, + children: external_prop_types_default.a.node, + defaultOpen: external_prop_types_default.a.bool, + description: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + headingLevel: external_prop_types_default.a.number, + onRequestClose: external_prop_types_default.a.func, + onRequestOpen: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + overflow: external_prop_types_default.a.string, + panelId: external_prop_types_default.a.any, + renderChildrenWhenCollapsed: external_prop_types_default.a.bool, + title: external_prop_types_default.a.node.isRequired, + titleWithActions: external_prop_types_default.a.bool +}; +var defaultProps = { + disabled: false, + overflow: 'auto', + renderChildrenWhenCollapsed: false, + titleWithActions: false +}; + +var CollapsiblePanel_CollapsiblePanel = /*#__PURE__*/function (_Component) { + _inherits(CollapsiblePanel, _Component); + + var _super = _createSuper(CollapsiblePanel); + + // @docs-props-type CollapsiblePanelPropsBase + function CollapsiblePanel(props) { + var _this; + + _classCallCheck(this, CollapsiblePanel); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "containerId", void 0); + + _defineProperty(_assertThisInitialized(_this), "toggleId", void 0); + + _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (event) { + var _this$props = _this.props, + panelId = _this$props.panelId, + onRequestClose = _this$props.onRequestClose; + onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose({ + event: event, + panelId: panelId, + reason: 'toggleClick' + }); + + _this.setState(_objectSpread({ + animating: true + }, !_this.isControlled() ? { + open: false + } : {})); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestOpen", function (event) { + var _this$props2 = _this.props, + panelId = _this$props2.panelId, + onRequestOpen = _this$props2.onRequestOpen; + onRequestOpen === null || onRequestOpen === void 0 ? void 0 : onRequestOpen({ + event: event, + panelId: panelId, + reason: 'toggleClick' + }); + + _this.setState(_objectSpread({ + animating: true + }, !_this.isControlled() ? { + open: true + } : {})); + }); + + _defineProperty(_assertThisInitialized(_this), "handleAnimationEnd", function () { + _this.setState({ + animating: false + }); + }); + + _this.controlledExternally = has_default()(props, 'open'); + _this.state = _objectSpread({ + animating: false + }, !_this.isControlled() ? { + open: props.defaultOpen || false + } : undefined); + + if (false) {} + + _this.containerId = "container-".concat(Object(id_["createGUID"])()); + _this.toggleId = "toggle-".concat(Object(id_["createGUID"])()); + return _this; + } + + _createClass(CollapsiblePanel, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (this.props.open !== prevProps.open) { + this.setState({ + animating: true + }); // eslint-disable-line react/no-did-update-set-state + } + + if (false) {} + + if (false) {} + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + innerBodyStyles = _this$props3.innerBodyStyles, + children = _this$props3.children, + description = _this$props3.description, + disabled = _this$props3.disabled, + elementRef = _this$props3.elementRef, + headingLevel = _this$props3.headingLevel, + overflow = _this$props3.overflow, + renderChildrenWhenCollapsed = _this$props3.renderChildrenWhenCollapsed, + title = _this$props3.title, + titleWithActions = _this$props3.titleWithActions; + var animating = this.state.animating; + var open = this.isControlled() ? this.props.open : this.state.open; + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + "data-test": "collapsible-panel", + elementRef: elementRef + }, omit_default()(this.props, keys_default()(CollapsiblePanel.propTypes))), titleWithActions ? /*#__PURE__*/external_react_default.a.createElement(StyledTitleWithActions, { + $disabled: disabled + }, /*#__PURE__*/external_react_default.a.createElement(StyledClickableIcon, { + disabled: disabled, + onClick: open ? this.handleRequestClose : this.handleRequestOpen, + id: this.toggleId, + "aria-controls": this.containerId, + "aria-expanded": open, + $open: !!open, + "data-test": "toggle" + }, /*#__PURE__*/external_react_default.a.createElement(ExpandPanel, { + open: open + })), /*#__PURE__*/external_react_default.a.createElement(StyledHeadingContent, { + $titleWithActions: titleWithActions, + "data-test": "title" + }, title)) : + /*#__PURE__*/ + + /* Clickable component is not allowed to have role="heading" so it is wrapped with a span */ + external_react_default.a.createElement("span", { + "data-test": "heading", + role: headingLevel ? 'heading' : undefined, + "aria-level": headingLevel + }, /*#__PURE__*/external_react_default.a.createElement(StyledTitleClickable, { + disabled: disabled, + onClick: open ? this.handleRequestClose : this.handleRequestOpen, + id: this.toggleId, + "aria-controls": this.containerId, + "aria-expanded": open, + $open: !!open, + "data-test": "toggle" + }, /*#__PURE__*/external_react_default.a.createElement(StyledIcon, null, /*#__PURE__*/external_react_default.a.createElement(ExpandPanel, { + open: open + })), /*#__PURE__*/external_react_default.a.createElement(StyledHeadingContent, null, /*#__PURE__*/external_react_default.a.createElement("span", { + "data-test": "title" + }, title), description && /*#__PURE__*/external_react_default.a.createElement(StyledDescription, { + "data-test": "description" + }, description)))), /*#__PURE__*/external_react_default.a.createElement(TransitionOpen_default.a, { + outerId: this.containerId, + "aria-labelledby": this.toggleId, + "data-test": "body", + outerStyle: { + overflow: animating ? 'hidden' : overflow + }, + innerStyle: _objectSpread({ + tableLayout: 'fixed' + }, innerBodyStyles), + open: open, + onAnimationEnd: this.handleAnimationEnd, + renderChildrenWhenCollapsed: renderChildrenWhenCollapsed + }, children)); + } + }]); + + return CollapsiblePanel; +}(external_react_["Component"]); + +_defineProperty(CollapsiblePanel_CollapsiblePanel, "propTypes", CollapsiblePanel_propTypes); + +_defineProperty(CollapsiblePanel_CollapsiblePanel, "defaultProps", defaultProps); + +/* harmony default export */ var src_CollapsiblePanel_CollapsiblePanel = (CollapsiblePanel_CollapsiblePanel); +// CONCATENATED MODULE: ./src/CollapsiblePanel/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 35: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(69564); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 43: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(65836); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 72: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(27198); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 37801: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 197); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 19: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92297); + +/***/ }), + +/***/ 197: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4094__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4094__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4094__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_ControlGroup_ControlGroup; }); +__nested_webpack_require_4094__.d(__nested_webpack_exports__, "ControlGroupContext", function() { return /* reexport */ ControlGroup_ControlGroupContext; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4094__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4094__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4094__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4094__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/find" +var find_ = __nested_webpack_require_4094__(52); +var find_default = /*#__PURE__*/__nested_webpack_require_4094__.n(find_); + +// EXTERNAL MODULE: external "lodash/isFinite" +var isFinite_ = __nested_webpack_require_4094__(19); +var isFinite_default = /*#__PURE__*/__nested_webpack_require_4094__.n(isFinite_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4094__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4094__(8); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4094__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4094__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4094__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4094__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4094__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4094__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Tooltip" +var Tooltip_ = __nested_webpack_require_4094__(42); +var Tooltip_default = /*#__PURE__*/__nested_webpack_require_4094__.n(Tooltip_); + +// CONCATENATED MODULE: ./src/ControlGroup/ControlGroupStyles.ts + + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "ControlGroupStyles__StyledBox", + componentId: "wjnyif-0" +})(["", " ", " max-width:600px;margin-bottom:", ";", " color:", ";", ""], themes_["mixins"].reset('block'), themes_["mixins"].clearfix(), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc(", " * 0.75)"], themes_["variables"].spacing), + prisma: { + comfortable: '16px', + compact: '12px' + } +}), Object(themes_["pick"])({ + prisma: { + comfortable: Object(external_styled_components_["css"])(["&:first-child{margin-top:", ";}&:last-child{margin-bottom:", ";}"], themes_["variables"].spacingMedium, themes_["variables"].spacingMedium), + compact: Object(external_styled_components_["css"])(["&:first-child{margin-top:", ";}&:last-child{margin-bottom:", ";}"], themes_["variables"].spacingSmall, themes_["variables"].spacingSmall) + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorMuted +}), function (_ref) { + var $error = _ref.$error; + return $error && Object(external_styled_components_["css"])(["color:", ";"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].errorColorD10, + dark: themes_["variables"].errorColorL20 + }, + prisma: themes_["variables"].accentColorNegative + })); +}); +var StyledControlsStackBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "ControlGroupStyles__StyledControlsStackBox", + componentId: "wjnyif-1" +})(["flex-direction:column;"]); +var StyledLabelWrapper = external_styled_components_default.a.div.withConfig({ + displayName: "ControlGroupStyles__StyledLabelWrapper", + componentId: "wjnyif-2" +})(["display:inline-flex;align-items:center;", " ", ""], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["justify-content:flex-end;"]) +}), function (_ref2) { + var $labelPosition = _ref2.$labelPosition; + return $labelPosition === 'top' ? Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["height:24px;padding-bottom:", ";"], themes_["variables"].spacingXSmall) + })) : Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["min-height:", ";"], themes_["variables"].inputHeight) + })); +}); +var StyledLabelWrapperLeft = external_styled_components_default()(StyledLabelWrapper).withConfig({ + displayName: "ControlGroupStyles__StyledLabelWrapperLeft", + componentId: "wjnyif-3" +})(["float:left;"]); +var StyledLabel = external_styled_components_default.a.label.withConfig({ + displayName: "ControlGroupStyles__StyledLabel", + componentId: "wjnyif-4" +})(["padding:", ";word-wrap:break-word;color:inherit;text-align:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '6px 0', + compact: '4px 0' + } +}), Object(themes_["pick"])({ + enterprise: 'right', + prisma: 'left' +})); +var StyledTooltip = external_styled_components_default()(Tooltip_default.a).withConfig({ + displayName: "ControlGroupStyles__StyledTooltip", + componentId: "wjnyif-5" +})(["", ""], function (_ref3) { + var $labelPosition = _ref3.$labelPosition; + return $labelPosition === 'top' && Object(external_styled_components_["css"])(["button{", "}"], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["svg{width:20px;height:20px;}padding:4px;"]) + })); +}); +var StyledHelp = external_styled_components_default.a.div.withConfig({ + displayName: "ControlGroupStyles__StyledHelp", + componentId: "wjnyif-6" +})(["", ";font-size:", ";color:", ";margin-top:", ";", ""], themes_["mixins"].reset('block'), themes_["variables"].fontSizeSmall, themes_["variables"].contentColorMuted, Object(themes_["pick"])({ + enterprise: '2px', + prisma: '4px' +}), function (_ref4) { + var $error = _ref4.$error; + return $error && Object(external_styled_components_["css"])(["color:inherit;"]); +}); +var StyledErrorText = external_styled_components_default.a.div.withConfig({ + displayName: "ControlGroupStyles__StyledErrorText", + componentId: "wjnyif-7" +})(["", ";font-size:", ";[aria-invalid] > &{color:inherit;}", ""], themes_["mixins"].reset('block'), themes_["variables"].fontSizeSmall, function (_ref5) { + var $help = _ref5.$help; + return !$help && Object(external_styled_components_["css"])(["margin-top:", ";"], Object(themes_["pick"])({ + enterprise: '2px', + prisma: '4px' + })); +}); +var StyledAsterisk = external_styled_components_default.a.span.withConfig({ + displayName: "ControlGroupStyles__StyledAsterisk", + componentId: "wjnyif-8" +})(["color:inherit;margin-right:2px;"]); + +// CONCATENATED MODULE: ./src/ControlGroup/ControlGroupContext.tsx + + +/** + * A React context used to inform subcomponets of ControlGroup of parent component values. + * The context interface is `ControlGroupContextValue`. + * Defaults to `'{}'`. + * @public + */ +var ControlGroupContext = /*#__PURE__*/external_react_default.a.createContext({}); +/* harmony default export */ var ControlGroup_ControlGroupContext = (ControlGroupContext); +// CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + // props ControlGroup may access and/or override on children + +var propTypes = { + children: external_prop_types_default.a.node, + controlsLayout: external_prop_types_default.a.oneOf(['fill', 'fillJoin', 'none', 'stack']), + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.oneOfType([external_prop_types_default.a.bool, external_prop_types_default.a.string]), + help: external_prop_types_default.a.node, + hideLabel: external_prop_types_default.a.bool, + label: external_prop_types_default.a.string.isRequired, + labelFor: external_prop_types_default.a.string, + labelPosition: external_prop_types_default.a.oneOf(['left', 'top']), + labelWidth: external_prop_types_default.a.oneOfType([external_prop_types_default.a.number, external_prop_types_default.a.string]), + required: external_prop_types_default.a.bool, + size: external_prop_types_default.a.oneOf(['small', 'medium']), + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + tooltip: external_prop_types_default.a.node, + tooltipDefaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'theme']) +}; +var defaultProps = { + controlsLayout: 'fill', + error: false, + hideLabel: false, + labelPosition: 'left', + labelWidth: 120, + required: false, + size: 'medium' +}; +// Style cloned onto child elements when fill behavior set. +var FLEX_GROW_STYLE = { + flexGrow: 1 +}; // Margin bootom values cloned onto child elements when the stacking behavior is needed. + +var CHILD_MARGIN_BOTTOM_DEFAULT = '0'; +var CHILD_MARGIN_BOTTOM_PRISMA = '16px'; +var CHILD_MARGIN_BOTTOM_PRISMA_COMPACT = '12px'; +/** + * `ControlGroup` places a label and optional help text around one or more controls. The `ControlGroup` + * will automatically add aria attributes to associate the controls with the labels and help text to + * address accessibility requirements. + * + * `ControlGroup` provides layouts to assist in aligning and laying out controls, but the defaults are + * not helpful in all cases, nor will the layout options address all cases. Consider setting + * `controlsLayout` to none and manually positioning the controls as required. + * + * `ControlGroup` uses the HTML `label` tag. The rules for determining which child component is linked + * to the label's `for` attribute are: + * 1. If one or more `children` are `Text` components, the first one is used. + * 2. If there aren't any `Text` components, the first child is used. + * + * If the linked child supports an `inputId` prop and it's set, its value is used for the label's `for` + * attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't + * supported `id` is used. The `labelFor` prop may be used to override the `for` attribute. + */ + +var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) { + _inherits(ControlGroup, _Component); + + var _super = _createSuper(ControlGroup); + + // @docs-props-type ControlGroupPropsBase + function ControlGroup(props) { + var _this; + + _classCallCheck(this, ControlGroup); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "errorId", void 0); + + _defineProperty(_assertThisInitialized(_this), "helpId", void 0); + + _defineProperty(_assertThisInitialized(_this), "labelId", void 0); + + _defineProperty(_assertThisInitialized(_this), "contextValue", void 0); + + _defineProperty(_assertThisInitialized(_this), "childIds", void 0); + + _defineProperty(_assertThisInitialized(_this), "stackLayoutChildStyle", void 0); + + _defineProperty(_assertThisInitialized(_this), "getChildID", function (key, index) { + var childKey = "".concat(key, "-").concat(index); + var value = _this.childIds[childKey]; + + if (!value || !value.length) { + value = Object(id_["createDOMID"])(key); + _this.childIds[childKey] = value; + } + + return value; + }); + + _defineProperty(_assertThisInitialized(_this), "getStackLayoutChildStyle", function (isPrisma, isCompact) { + if (isPrisma) { + if (isCompact) { + _this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_PRISMA_COMPACT; + } + + _this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_PRISMA; + } else { + _this.stackLayoutChildStyle.marginBottom = CHILD_MARGIN_BOTTOM_DEFAULT; + } + + return _this.stackLayoutChildStyle; + }); + + _defineProperty(_assertThisInitialized(_this), "hasInputId", function (item) { + return item.type && item.type.propTypes && Object.prototype.hasOwnProperty.call(item.type.propTypes, 'inputId'); + }); + + _defineProperty(_assertThisInitialized(_this), "getLinkedId", function (components) { + if (components.length === 0) { + return undefined; + } + + var _components = _slicedToArray(components, 1), + firstChild = _components[0]; + + var firstText = find_default()(components, function (comp) { + return comp.type && comp.type.componentType === 'Text'; + }); + + var inputId = _this.hasInputId(firstChild); // see class doc block for details + + + if (components.length === 1 && firstChild && firstChild.props) { + return inputId ? firstChild.props.inputId : firstChild.props.id; + } + + if (firstText && firstText.props) { + return firstText.props.inputId; + } + + if (firstChild.props) { + return inputId ? firstChild.props.inputId : firstChild.props.id; + } + + return undefined; + }); + + _this.errorId = Object(id_["createDOMID"])('error'); + _this.helpId = Object(id_["createDOMID"])('help'); + _this.labelId = Object(id_["createDOMID"])('label'); + _this.contextValue = _this.createContextValue(); + _this.childIds = {}; + _this.stackLayoutChildStyle = {}; + + if (false) {} + + return _this; + } + + _createClass(ControlGroup, [{ + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps) { + if (external_react_default.a.Children.count(nextProps.children) !== external_react_default.a.Children.count(this.props.children)) { + this.childIds = {}; + } + + return true; + } + }, { + key: "createContextValue", + value: function createContextValue() { + return { + labelAttrs: { + text: this.props.label, + id: this.labelId + } + }; + } + }, { + key: "getContextValue", + value: function getContextValue() { + var _this$contextValue$la, _this$contextValue$la2; + + if (this.props.label !== ((_this$contextValue$la = this.contextValue.labelAttrs) === null || _this$contextValue$la === void 0 ? void 0 : _this$contextValue$la.text) || this.labelId !== ((_this$contextValue$la2 = this.contextValue.labelAttrs) === null || _this$contextValue$la2 === void 0 ? void 0 : _this$contextValue$la2.id)) { + this.contextValue = this.createContextValue(); + } + + return this.contextValue; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + children = _this$props.children, + controlsLayout = _this$props.controlsLayout, + error = _this$props.error, + help = _this$props.help, + hideLabel = _this$props.hideLabel, + label = _this$props.label, + labelFor = _this$props.labelFor, + labelPosition = _this$props.labelPosition, + labelWidth = _this$props.labelWidth, + required = _this$props.required, + size = _this$props.size, + splunkTheme = _this$props.splunkTheme, + tooltip = _this$props.tooltip, + tooltipDefaultPlacement = _this$props.tooltipDefaultPlacement, + otherProps = _objectWithoutProperties(_this$props, ["children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "size", "splunkTheme", "tooltip", "tooltipDefaultPlacement"]); + + var isPrisma = splunkTheme.isPrisma, + isCompact = splunkTheme.isCompact; + var validChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]); + var count = validChildren.length; + var writableOtherProps = otherProps; // Clean the Children + + var cloneWithProps = function cloneWithProps(item, i) { + var cloneProps = { + key: item.key || i + }; + + if (controlsLayout === 'fillJoin') { + if (i > 0) { + cloneProps.prepend = true; + } + + if (i < count - 1) { + cloneProps.append = true; + } + + if (cloneProps.prepend || cloneProps.append) { + cloneProps.inline = false; + } + } + + if (controlsLayout === 'fill' && count > 1) { + cloneProps.inline = true; + } + + if (controlsLayout === 'stack') { + cloneProps.inline = false; + + if (i < count - 1) { + // The spread operator is used as css styles are not nested, so there is no need for a deep copy. + var stackStyle = _this2.getStackLayoutChildStyle(isPrisma, isCompact); + + cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), stackStyle) : stackStyle; + } + } + + cloneProps.labelledBy = _this2.labelId; + + if (_this2.props.help && typeof _this2.props.error === 'boolean') { + cloneProps.describedBy = _this2.helpId; + } else if (_this2.props.help && typeof _this2.props.error === 'string') { + cloneProps.describedBy = "".concat(_this2.helpId, " ").concat(_this2.errorId); + } else if (!_this2.props.help && typeof _this2.props.error === 'string') { + cloneProps.describedBy = _this2.errorId; + } + + if (_this2.props.required) { + cloneProps.required = true; + } // TODO: SUI-3402 refactor so that parent component doesn't have to know what it's child components are + + + if (item.type.componentType === 'Multiselect') { + var multiselect = item; + + if (multiselect.props.compact === false) { + cloneProps.labelText = label; + } + } else { + cloneProps.labelText = label; + } + + if (count === 1 && (controlsLayout === 'fillJoin' || controlsLayout === 'fill')) { + // Some controls like Select do not grow by default, so flexGrow is applied + // The spread operator is used as css styles are not nested, so there is no need for a deep copy. + cloneProps.style = item.props.style ? _objectSpread(_objectSpread({}, item.props.style), FLEX_GROW_STYLE) : FLEX_GROW_STYLE; + } + + if (!labelFor && item) { + if (_this2.hasInputId(item)) { + cloneProps.inputId = item.props.inputId || _this2.getChildID('input-id', i); + } else { + cloneProps.id = item.props.id || _this2.getChildID('id', i); + } + } + + return /*#__PURE__*/Object(external_react_["cloneElement"])(item, cloneProps); + }; + + var childrenFormatted = validChildren.map(cloneWithProps); + var defaultLinkedId = this.getLinkedId(childrenFormatted); + + if (error) { + writableOtherProps['aria-invalid'] = true; + } + + var labelWidthStyle = labelPosition === 'left' ? { + width: labelWidth + } : undefined; + var labelWidthString = isFinite_default()(labelWidth) ? "".concat(labelWidth, "px") : labelWidth; + var labelMargin = isPrisma ? '16px' : '20px'; + var contentMarginStyle = labelPosition === 'left' ? { + marginLeft: "calc(".concat(labelWidthString, " + ").concat(labelMargin, ")") + } : undefined; + var StyledControlsComponent = controlsLayout === 'stack' ? StyledControlsStackBox : Box_default.a; + var StyledLabelWrapperComponent = labelPosition === 'left' ? StyledLabelWrapperLeft : StyledLabelWrapper; + var styledLabel = /*#__PURE__*/external_react_default.a.createElement(StyledLabelWrapperComponent, { + style: labelWidthStyle, + $labelPosition: labelPosition + }, /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + "data-size": size, + "data-test": "label", + id: this.labelId, + htmlFor: labelFor || defaultLinkedId, + $tooltip: !!tooltip + }, required && /*#__PURE__*/external_react_default.a.createElement(StyledAsterisk, { + "aria-hidden": "true" + }, "*"), label, !isPrisma && !hideLabel && tooltip && /*#__PURE__*/external_react_default.a.createElement("span", null, "\xA0"), !hideLabel && tooltip && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, tooltip)), !hideLabel && tooltip && /*#__PURE__*/external_react_default.a.createElement(StyledTooltip, { + $labelPosition: labelPosition, + closeWhen: "notOnClick", + content: tooltip, + defaultPlacement: tooltipDefaultPlacement, + "aria-hidden": "true" + })); + var isError = typeof error === 'string' || error === true; + var isErrorBoolean = typeof error === 'boolean'; + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + "data-test": "control-group", + $error: isError + }, writableOtherProps), /*#__PURE__*/external_react_default.a.createElement(ControlGroup_ControlGroupContext.Provider, { + value: this.getContextValue() + }, hideLabel ? /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, styledLabel) : styledLabel, /*#__PURE__*/external_react_default.a.createElement(StyledControlsComponent, { + "data-test": "controls", + flex: controlsLayout !== 'none', + style: contentMarginStyle + }, childrenFormatted), help && /*#__PURE__*/external_react_default.a.createElement(StyledHelp, { + "data-test": "help", + id: this.helpId, + style: contentMarginStyle, + $error: isError && isErrorBoolean + }, help), isError && !isErrorBoolean && /*#__PURE__*/external_react_default.a.createElement(StyledErrorText, { + "data-test": "error", + id: this.errorId, + style: contentMarginStyle, + $help: !!help + }, error))); + } + }]); + + return ControlGroup; +}(external_react_["Component"]); + +_defineProperty(ControlGroup_ControlGroup, "propTypes", propTypes); + +_defineProperty(ControlGroup_ControlGroup, "defaultProps", defaultProps); + +var ControlGroupWithTheme = Object(themes_["withSplunkTheme"])(ControlGroup_ControlGroup); +ControlGroupWithTheme.propTypes = ControlGroup_ControlGroup.propTypes; +/* harmony default export */ var src_ControlGroup_ControlGroup = (ControlGroupWithTheme); + +// CONCATENATED MODULE: ./src/ControlGroup/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 42: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28546); + +/***/ }), + +/***/ 52: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7309); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 82857: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 198); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3964__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3964__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 128: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68427); + +/***/ }), + +/***/ 198: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4937__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4937__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4937__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Date_Date; }); +__nested_webpack_require_4937__.d(__nested_webpack_exports__, "DateWithoutTheme", function() { return /* reexport */ _Date; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4937__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4937__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4937__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4937__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_4937__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_4937__.n(has_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4937__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4937__.n(omit_); + +// EXTERNAL MODULE: external "moment" +var external_moment_ = __nested_webpack_require_4937__(20); +var external_moment_default = /*#__PURE__*/__nested_webpack_require_4937__.n(external_moment_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4937__(8); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_4937__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/Calendar" +var Calendar_ = __nested_webpack_require_4937__(128); +var Calendar_default = /*#__PURE__*/__nested_webpack_require_4937__.n(Calendar_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Popover" +var Popover_ = __nested_webpack_require_4937__(21); +var Popover_default = /*#__PURE__*/__nested_webpack_require_4937__.n(Popover_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4937__(0); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4937__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4937__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Text" +var Text_ = __nested_webpack_require_4937__(30); +var Text_default = /*#__PURE__*/__nested_webpack_require_4937__.n(Text_); + +// CONCATENATED MODULE: ./src/Date/DateStyles.ts + + + +var StyledText = external_styled_components_default()(Text_default.a).withConfig({ + displayName: "DateStyles__StyledText", + componentId: "kacgdc-0" +})(["cursor:", ";&[data-inline]{flex-basis:", ";width:", ";}"], Object(themes_["pickVariant"])('$disabled', { + "false": 'text', + "true": 'not-allowed' +}), Object(themes_["pick"])({ + enterprise: '105px', + prisma: '150px' +}), Object(themes_["pick"])({ + enterprise: { + comfortable: '105px', + compact: '80px' + }, + prisma: '150px' +})); +var IconContainer = external_styled_components_default.a.div.withConfig({ + displayName: "DateStyles__IconContainer", + componentId: "kacgdc-1" +})(["align-items:center;color:", ";display:flex;padding:", ";pointer-events:none;"], Object(themes_["pickVariant"])('$disabled', { + "false": themes_["variables"].contentColorMuted, + "true": themes_["variables"].contentColorDisabled +}), Object(themes_["pick"])({ + comfortable: '0 8px', + compact: '0 6px' +})); + +// CONCATENATED MODULE: ./src/Date/Icon.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + +function CalendarIcon(props) { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + density = _useSplunkTheme.density; + + var size = density === 'compact' ? '20px' : '24px'; + return /*#__PURE__*/external_react_default.a.createElement("svg", _extends({ + viewBox: "0 0 24 24", + width: size, + height: size + }, props), /*#__PURE__*/external_react_default.a.createElement("path", { + fill: "currentColor", + fillRule: "evenodd", + d: "M16.6001 2C17.1524 2 17.6001 2.44772 17.6001 3V4H19C20.1046 4 21 4.89543 21 6V8.5V9.5V19.5C21 19.7761 20.7761 20 20.5 20H3.5C3.22386 20 3 19.7761 3 19.5V9.5V8.5V6C3 4.89543 3.89543 4 5 4H6.6001V3C6.6001 2.44772 7.04781 2 7.6001 2C8.15238 2 8.6001 2.44772 8.6001 3V4H15.6001V3C15.6001 2.44772 16.0478 2 16.6001 2ZM6.6001 6C6.6001 6.55228 7.04781 7 7.6001 7C8.15238 7 8.6001 6.55228 8.6001 6H15.6001C15.6001 6.55228 16.0478 7 16.6001 7C17.1524 7 17.6001 6.55228 17.6001 6H19V8H5L5 6H6.6001ZM19 10H5V18H19V10Z" + })); +} +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_4937__(11); + +// CONCATENATED MODULE: ./src/Date/Date.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function Date_extends() { Date_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Date_extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + +var propTypes = { + defaultValue: external_prop_types_default.a.string, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + highlightToday: external_prop_types_default.a.bool, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputOnly: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + locale: external_prop_types_default.a.string, + name: external_prop_types_default.a.string, + onBlur: external_prop_types_default.a.func, + onChange: external_prop_types_default.a.func, + onClick: external_prop_types_default.a.func, + onFocus: external_prop_types_default.a.func, + onKeyDown: external_prop_types_default.a.func, + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + value: external_prop_types_default.a.string +}; +var defaultProps = { + disabled: false, + error: false, + highlightToday: false, + inline: true, + inputOnly: false, + locale: 'en_US' +}; + +var _Date = /*#__PURE__*/function (_Component) { + _inherits(Date, _Component); + + var _super = _createSuper(Date); + + // @docs-props-type DatePropsBase + + /** + * This static value can be used to convert a moment date to a compatible string + * to set the `value` prop. + * ``` + * moment().format(Date.momentFormat); + * ``` + * @public + * @name momentFormat + * @memberOf Date + * @type string + */ + function Date(props) { + var _this; + + _classCallCheck(this, Date); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "focusCalledInternally", false); + + _defineProperty(_assertThisInitialized(_this), "popoverId", void 0); + + _defineProperty(_assertThisInitialized(_this), "calendar", null); + + _defineProperty(_assertThisInitialized(_this), "openWithFocus", false); + + _defineProperty(_assertThisInitialized(_this), "applyTextChange", function (e) { + var date = external_moment_default()(_this.state.tempTextInputDate, 'l', _this.props.locale); + + if (date.isValid()) { + _this.handleDateChange(e, { + value: date.format(_Date.momentFormat) + }, 'textInput'); + } else { + _this.setState({ + calendarOpen: false, + tempTextInputDate: undefined + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleDateChange", function (e, _ref, origin) { + var value = _ref.value; + + if (origin !== 'textInput') { + _this.focusCalledInternally = true; + + _this.focus(); + } + + if (_this.getValue() !== value) { + var _this$props$onChange, _this$props; + + _this.setState({ + calendarOpen: false, + tempTextInputDate: undefined, + value: _this.isControlled() ? undefined : value + }); + + var name = _this.props.name; + (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, { + value: value, + name: name + }); + } else { + _this.setState({ + calendarOpen: false + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) { + var _this$props$onFocus, _this$props2; + + if (_this.focusCalledInternally) { + _this.focusCalledInternally = false; + } else if (!_this.props.inputOnly) { + _this.setState({ + calendarOpen: true + }); + } + + (_this$props$onFocus = (_this$props2 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props2, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) { + var _this$state$anchor, _this$props$onClick, _this$props3; + + if (document.activeElement !== _this.state.input && ((_this$state$anchor = _this.state.anchor) === null || _this$state$anchor === void 0 ? void 0 : _this$state$anchor.contains(e.target))) { + _this.focus(); + } + + if (!_this.props.inputOnly && !_this.state.calendarOpen) { + _this.setState({ + calendarOpen: true + }); + } + + (_this$props$onClick = (_this$props3 = _this.props).onClick) === null || _this$props$onClick === void 0 ? void 0 : _this$props$onClick.call(_this$props3, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e, _ref2) { + var value = _ref2.value; + + _this.setState({ + tempTextInputDate: value, + calendarOpen: !_this.props.inputOnly + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props$onKeyDown, _this$props4; + + var eventKeyCode = Object(keyboard_["keycode"])(e.nativeEvent); + + if (eventKeyCode === 'enter' || eventKeyCode === 'tab') { + _this.applyTextChange(e); + } else if (!_this.props.inputOnly && eventKeyCode === 'down') { + e.preventDefault(); + + if (!_this.state.calendarOpen) { + _this.openWithFocus = true; + + _this.setState({ + calendarOpen: true + }); + } else if (_this.calendar) { + _this.calendar.focusActiveDay(); + } + } else if (eventKeyCode === 'esc') { + _this.setState({ + calendarOpen: false, + tempTextInputDate: undefined + }); + + _this.focus(); + } + + (_this$props$onKeyDown = (_this$props4 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props4, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + _this.setState({ + anchor: el + }); + + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) { + _this.setState({ + input: el + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleCalendarMount", function (el) { + _this.calendar = el; + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (_ref3) { + var event = _ref3.event, + reason = _ref3.reason; + + if ((reason === 'clickAway' || reason === 'escapeKey') && event !== undefined && event.target !== _this.state.anchor) { + _this.applyTextChange(event); + + if (reason === 'escapeKey') { + _this.focusCalledInternally = true; + + _this.focus(); + } + } + }); + + _this.controlledExternally = has_default()(props, 'value'); + var dateString = _this.isControlled() ? props.value : props.defaultValue || external_moment_default()().locale(props.locale).format(_Date.momentFormat); + _this.state = { + anchor: null, + calendarOpen: false, + input: null, + value: _this.isControlled() ? undefined : dateString + }; + _this.popoverId = Object(id_["createDOMID"])('calendar'); + + if (false) {} + + if (false) {} + + return _this; + } + + _createClass(Date, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (false) {} + + if (false) {} + + if (false) {} + /** + * If `openWithFocus` and `calendarOpen` are set the user is attempting to navigate to the dropdown, but it's closed. + * On the first update following the state change set focus to the active day within the calendar. + */ + + + if (this.openWithFocus && this.state.calendarOpen && prevState.calendarOpen !== this.state.calendarOpen) { + var _this$calendar; + + this.openWithFocus = false; + (_this$calendar = this.calendar) === null || _this$calendar === void 0 ? void 0 : _this$calendar.focusActiveDay(); + } + } + }, { + key: "getValue", + value: function getValue() { + return this.isControlled() ? this.props.value : this.state.value; + } + }, { + key: "getTextInputValue", + value: function getTextInputValue() { + return this.state.tempTextInputDate === undefined ? external_moment_default()(this.getValue(), _Date.momentFormat, this.props.locale).format('l') : this.state.tempTextInputDate; + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + /** + * Place focus on the input. + */ + + }, { + key: "focus", + value: function focus() { + var _this$state$input; + + (_this$state$input = this.state.input) === null || _this$state$input === void 0 ? void 0 : _this$state$input.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props5 = this.props, + disabled = _this$props5.disabled, + highlightToday = _this$props5.highlightToday, + inputOnly = _this$props5.inputOnly, + locale = _this$props5.locale, + splunkTheme = _this$props5.splunkTheme; + var isPrisma = splunkTheme.isPrisma; + var currentValue = this.getValue(); + var startAdornment = isPrisma && !inputOnly && /*#__PURE__*/external_react_default.a.createElement(IconContainer, { + "aria-hidden": true, + $disabled: disabled + }, /*#__PURE__*/external_react_default.a.createElement(CalendarIcon, null)); + var children; + var ariaProps = {}; + + if (!inputOnly) { + ariaProps.role = 'combobox'; + ariaProps['aria-controls'] = this.state.calendarOpen ? this.popoverId : undefined; + ariaProps['aria-expanded'] = disabled ? false : this.state.calendarOpen; + ariaProps['aria-haspopup'] = true; + children = /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, { + anchor: this.state.anchor, + id: this.popoverId, + open: disabled ? false : this.state.calendarOpen, + onRequestClose: this.handleRequestClose + }, /*#__PURE__*/external_react_default.a.createElement(Calendar_default.a, { + ref: this.handleCalendarMount, + highlightToday: highlightToday, + locale: locale, + onChange: this.handleDateChange, + value: currentValue + })); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledText, Date_extends({ + autoCapitalize: "off", + autoComplete: "off", + autoCorrect: "off", + spellCheck: false, + "data-test": "date", + "data-test-value": currentValue, + "data-test-popover-id": this.popoverId, + elementRef: this.handleMount, + inputRef: this.handleInputMount, + onChange: this.handleInputChange, + onClick: this.handleClick, + onFocus: this.handleFocus, + onKeyDown: this.handleKeyDown, + value: this.getTextInputValue(), + startAdornment: startAdornment, + $disabled: disabled + }, ariaProps, omit_default()(this.props, 'className', 'defaultValue', 'elementRef', 'inputOnly', 'multiline', 'locale', 'onChange', 'onClick', 'onFocus', 'onKeyDown', 'onSelect', 'spellCheck', 'value')), children); + } + }]); + + return Date; +}(external_react_["Component"]); + +_defineProperty(_Date, "propTypes", propTypes); + +_defineProperty(_Date, "defaultProps", defaultProps); + +_defineProperty(_Date, "momentFormat", 'YYYY-MM-DD'); + +_defineProperty(_Date, "validateValue", function (value) { + if (!external_moment_default()(value, _Date.momentFormat).isValid()) { + // eslint-disable-next-line no-console + console.error("Invalid date string value \"".concat(value, "\" provided to Moment.")); + } +}); + +var DateWithThemeBase = Object(themes_["withSplunkTheme"])(_Date); +var DateWithTheme = DateWithThemeBase; +DateWithTheme.propTypes = _Date.propTypes; +DateWithTheme.momentFormat = _Date.momentFormat; +/* harmony default export */ var Date_Date = (DateWithTheme); + +// CONCATENATED MODULE: ./src/Date/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 20: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95093); + +/***/ }), + +/***/ 21: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79728); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 30: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25338); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 76536: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 179); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 179: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3867__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3867__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3867__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ DefinitionList_DefinitionList; }); +__nested_webpack_require_3867__.d(__nested_webpack_exports__, "Description", function() { return /* reexport */ DefinitionList_Description; }); +__nested_webpack_require_3867__.d(__nested_webpack_exports__, "Term", function() { return /* reexport */ DefinitionList_Term; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3867__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3867__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3867__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3867__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3867__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3867__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3867__(0); + +// CONCATENATED MODULE: ./src/DefinitionList/DescriptionStyles.ts + + +var Styled = external_styled_components_default.a.dd.withConfig({ + displayName: "DescriptionStyles__Styled", + componentId: "sc-1jglixb-0" +})(["", ";", ";min-height:", ";padding-left:5px;"], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + prisma: themes_["mixins"].typography('body', { + color: 'active' + }), + enterprise: themes_["mixins"].typography('body') +}), themes_["variables"].lineHeight); + +// CONCATENATED MODULE: ./src/DefinitionList/Description.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]) +}; + +/** + * Container component for a `DefinitionList` description. + */ +function Description(_ref) { + var children = _ref.children, + elementRef = _ref.elementRef, + otherProps = _objectWithoutProperties(_ref, ["children", "elementRef"]); + + // @docs-props-type DescriptionPropsBase + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + "data-test": "description", + ref: elementRef + }, otherProps), children); +} + +Description.propTypes = propTypes; +/* harmony default export */ var DefinitionList_Description = (Description); +// CONCATENATED MODULE: ./src/DefinitionList/DefinitionListStyles.ts + + +var DefinitionListStyles_Styled = external_styled_components_default.a.dl.withConfig({ + displayName: "DefinitionListStyles__Styled", + componentId: "sc-1pqfrgm-0" +})(["", ";", ";"], themes_["mixins"].reset('block'), themes_["mixins"].typography('body')); + +// CONCATENATED MODULE: ./src/DefinitionList/TermStyles.ts + + +var TermStyles_Styled = external_styled_components_default.a.dt.withConfig({ + displayName: "TermStyles__Styled", + componentId: "sc-1ao97j9-0" +})(["", ";", " float:left;width:120px;overflow:hidden;overflow-x:hidden;white-space:nowrap;word-wrap:normal;", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + prisma: themes_["mixins"].typography('body', { + color: 'muted' + }), + enterprise: themes_["mixins"].typography('body') +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["&::after{content:'", "';}"], " ".concat('.'.repeat(100))) +})); + +// CONCATENATED MODULE: ./src/DefinitionList/Term.tsx +function Term_extends() { Term_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Term_extends.apply(this, arguments); } + +function Term_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Term_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Term_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var Term_propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]) +}; + +/** + * Container component for a `DefinitionList` term. + */ +function Term(_ref) { + var children = _ref.children, + elementRef = _ref.elementRef, + otherProps = Term_objectWithoutProperties(_ref, ["children", "elementRef"]); + + // @docs-props-type TermPropsBase + return /*#__PURE__*/external_react_default.a.createElement(TermStyles_Styled, Term_extends({ + "data-test": "term", + ref: elementRef + }, otherProps), children); +} + +Term.propTypes = Term_propTypes; +/* harmony default export */ var DefinitionList_Term = (Term); +// CONCATENATED MODULE: ./src/DefinitionList/DefinitionList.tsx +function DefinitionList_extends() { DefinitionList_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return DefinitionList_extends.apply(this, arguments); } + +function DefinitionList_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = DefinitionList_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function DefinitionList_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + +var DefinitionList_propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + termWidth: external_prop_types_default.a.oneOfType([external_prop_types_default.a.number, external_prop_types_default.a.string]) +}; + +function processChildren(_ref) { + var children = _ref.children, + termWidth = _ref.termWidth; + var filteredChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]); + return filteredChildren.map(function (child) { + if (child.type === DefinitionList_Term) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(child, { + style: { + width: termWidth + } + }); + } + + if (child.type === DefinitionList_Description) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(child, { + style: { + marginLeft: termWidth + } + }); + } + + return child; + }); +} + +function DefinitionList(_ref2) { + var children = _ref2.children, + elementRef = _ref2.elementRef, + _ref2$termWidth = _ref2.termWidth, + termWidth = _ref2$termWidth === void 0 ? 120 : _ref2$termWidth, + otherProps = DefinitionList_objectWithoutProperties(_ref2, ["children", "elementRef", "termWidth"]); + + // @docs-props-type DefinitionListPropsBase + return /*#__PURE__*/external_react_default.a.createElement(DefinitionListStyles_Styled, DefinitionList_extends({ + "data-test": "definition-list", + ref: elementRef + }, otherProps), processChildren({ + children: children, + termWidth: termWidth + })); +} + +DefinitionList.propTypes = DefinitionList_propTypes; +DefinitionList.Description = DefinitionList_Description; +DefinitionList.Term = DefinitionList_Term; +/* harmony default export */ var DefinitionList_DefinitionList = (DefinitionList); + +// CONCATENATED MODULE: ./src/DefinitionList/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 37964: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 218); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 218: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Divider_Divider; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/Divider/DividerStyles.ts + + +var StyledRule = external_styled_components_default.a.hr.withConfig({ + displayName: "DividerStyles__StyledRule", + componentId: "gl6kyz-0" +})(["", ";", ";border-color:", ";"], themes_["mixins"].reset('block'), Object(themes_["pickVariant"])('$orientation', { + horizontal: Object(external_styled_components_["css"])(["border-top-style:solid;border-width:1px;"]), + vertical: Object(external_styled_components_["css"])(["display:inline;border-left-style:solid;border-width:1px;"]) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].borderColor, + prisma: themes_["variables"].neutral200 +})); + +// CONCATENATED MODULE: ./src/Divider/Divider.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + orientation: external_prop_types_default.a.oneOf(['horizontal', 'vertical']) +}; + +function Divider(_ref) { + var elementRef = _ref.elementRef, + _ref$orientation = _ref.orientation, + orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation, + otherProps = _objectWithoutProperties(_ref, ["elementRef", "orientation"]); + + // @docs-props-type DividerPropsBase + return /*#__PURE__*/external_react_default.a.createElement(StyledRule, _extends({ + "data-test": "divider", + ref: elementRef, + "aria-orientation": orientation, + $orientation: orientation + }, otherProps)); +} + +Divider.propTypes = propTypes; +/* harmony default export */ var Divider_Divider = (Divider); +// CONCATENATED MODULE: ./src/Divider/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 73592: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 237); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3863__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3863__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 15: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79859); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 21: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79728); + +/***/ }), + +/***/ 237: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5029__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_5029__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_5029__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Dropdown_Dropdown; }); +__nested_webpack_require_5029__.d(__nested_webpack_exports__, "legacyRefMode", function() { return /* reexport */ legacyRefMode; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_5029__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_5029__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_5029__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_5029__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_5029__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_5029__.n(has_); + +// EXTERNAL MODULE: external "lodash/includes" +var includes_ = __nested_webpack_require_5029__(15); +var includes_default = /*#__PURE__*/__nested_webpack_require_5029__.n(includes_); + +// EXTERNAL MODULE: external "lodash/isEmpty" +var isEmpty_ = __nested_webpack_require_5029__(87); + +// EXTERNAL MODULE: external "lodash/isFunction" +var isFunction_ = __nested_webpack_require_5029__(69); +var isFunction_default = /*#__PURE__*/__nested_webpack_require_5029__.n(isFunction_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_5029__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_5029__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_5029__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_5029__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_5029__(8); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_5029__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/Popover" +var Popover_ = __nested_webpack_require_5029__(21); +var Popover_default = /*#__PURE__*/__nested_webpack_require_5029__.n(Popover_); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_5029__(11); + +// CONCATENATED MODULE: ./src/Dropdown/Dropdown.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + +/** @public */ + +var possibleCloseReasons = ['clickAway', 'contentClick', 'escapeKey', 'offScreen', 'tabKey', 'toggleClick']; +var propTypes = { + align: external_prop_types_default.a.oneOf(['center', 'edge', 'theme', 'end']), + canCoverAnchor: external_prop_types_default.a.bool, + children: external_prop_types_default.a.oneOfType([external_prop_types_default.a.node, external_prop_types_default.a.func]), + closeReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)), + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'vertical', 'horizontal']), + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + focusToggleReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)), + inputId: external_prop_types_default.a.string, + onRequestClose: external_prop_types_default.a.func, + onRequestOpen: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + openWithArrowKeys: external_prop_types_default.a.bool, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip', 'any']), + retainFocus: external_prop_types_default.a.bool, + takeFocus: external_prop_types_default.a.bool, + toggle: external_prop_types_default.a.element.isRequired +}; +var defaultProps = { + align: 'theme', + canCoverAnchor: true, + closeReasons: possibleCloseReasons, + defaultPlacement: 'below', + focusToggleReasons: ['contentClick', 'escapeKey', 'tabKey', 'toggleClick'], + repositionMode: 'flip', + retainFocus: false, + openWithArrowKeys: false, + takeFocus: true +}; +var legacyRefMode = Symbol('Dropdown legacy ref mode marker'); + +var Dropdown_Dropdown = /*#__PURE__*/function (_Component) { + _inherits(Dropdown, _Component); + + var _super = _createSuper(Dropdown); + + // @docs-props-type DropdownPropsBase + + /** + * Enumeration of the possible reasons for closing the Select. + * 'clickAway', 'escapeKey', and 'offScreen' are inherited from Popover, but repeated here for + * docs extraction. + */ + function Dropdown(props) { + var _this; + + _classCallCheck(this, Dropdown); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "popoverId", void 0); + + _defineProperty(_assertThisInitialized(_this), "toggleRef", null); + + _defineProperty(_assertThisInitialized(_this), "toggleId", void 0); + + _defineProperty(_assertThisInitialized(_this), "handleToggleMount", function (el) { + _this.toggleRef = el; + + _this.setState({ + anchor: el + }); + + if (_this.props.toggle.type[legacyRefMode]) { + // TS: assume that legacy ref mode toggles support elementRef + Object(updateReactRef["a" /* updateReactRef */])(_this.props.toggle.props.elementRef, el); + } else { + // TS: ref does not exist on React.ReactElement - technically, this is undocumented API + Object(updateReactRef["a" /* updateReactRef */])(_this.props.toggle.ref, el); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleToggleClick", function (event) { + var _this$props$toggle$pr, _this$props$toggle$pr2; + + (_this$props$toggle$pr = (_this$props$toggle$pr2 = _this.props.toggle.props).onClick) === null || _this$props$toggle$pr === void 0 ? void 0 : _this$props$toggle$pr.call(_this$props$toggle$pr2, event); + + if (_this.isOpen()) { + _this.handleRequestClose({ + reason: 'toggleClick', + event: event + }); + } else { + var _this$props$onRequest, _this$props; + + (_this$props$onRequest = (_this$props = _this.props).onRequestOpen) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, event, { + reason: 'toggleClick' + }); + + if (!_this.isControlled()) { + _this.setState({ + open: true + }); + } + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleToggleKeyDownOpen", function (e) { + var _this$props$toggle$pr3, _this$props$toggle$pr4; + + (_this$props$toggle$pr3 = (_this$props$toggle$pr4 = _this.props.toggle.props).onKeyDown) === null || _this$props$toggle$pr3 === void 0 ? void 0 : _this$props$toggle$pr3.call(_this$props$toggle$pr4, e); + + if (!_this.props.openWithArrowKeys) { + return; + } + + var eventKeyCode = Object(keyboard_["keycode"])(e.nativeEvent); + + if (eventKeyCode === 'up' || eventKeyCode === 'down') { + var _this$props$onRequest2, _this$props2; + + e.preventDefault(); + (_this$props$onRequest2 = (_this$props2 = _this.props).onRequestOpen) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props2, e, { + reason: 'toggleKeydown' + }); + + if (!_this.isControlled()) { + _this.setState({ + open: true + }); + } + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (info) { + var event = info.event, + reason = info.reason; + var _this$props3 = _this.props, + closeReasons = _this$props3.closeReasons, + focusToggleReasons = _this$props3.focusToggleReasons, + onRequestClose = _this$props3.onRequestClose; + + if (event && reason === 'clickAway') { + var el = event.target; + var toggleId = _this.props.inputId || _this.props.toggle.props.id || _this.toggleId; + + while (el) { + // Ignore clicks on toggle. + if (el.id === toggleId) { + return; + } + + el = el.parentNode; + } + } + + if (_this.isOpen() && includes_default()(closeReasons, reason)) { + if (includes_default()(focusToggleReasons, reason)) { + _this.focus(); + } + + if (!_this.isControlled()) { + _this.setState({ + open: false + }); + } + + onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose(info); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleContentClick", function (event) { + _this.handleRequestClose({ + reason: 'contentClick', + event: event + }); + }); + + _this.state = { + anchor: null, + open: false + }; + _this.controlledExternally = has_default()(props, 'open'); + _this.popoverId = Object(id_["createDOMID"])('popover'); + _this.toggleId = Object(id_["createDOMID"])('toggle'); + return _this; + } + + _createClass(Dropdown, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + if (false) {} + + var otherProps = _objectSpread({}, omit_default()(this.props, keys_default()(Dropdown.propTypes), 'value', 'id')); + + if (false) {} + } + }, { + key: "isOpen", + value: function isOpen() { + return this.isControlled() ? this.props.open : this.state.open; + } + /** + * Places focus on the toggle. + */ + + }, { + key: "focus", + value: function focus() { + var _this$toggleRef; + + (_this$toggleRef = this.toggleRef) === null || _this$toggleRef === void 0 ? void 0 : _this$toggleRef.focus(); + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "renderToggle", + value: function renderToggle() { + var _cloneElement; + + return /*#__PURE__*/Object(external_react_["cloneElement"])(this.props.toggle, (_cloneElement = { + onClick: this.handleToggleClick, + onKeyDown: this.handleToggleKeyDownOpen + }, _defineProperty(_cloneElement, this.props.toggle.type[legacyRefMode] ? 'elementRef' : 'ref', this.handleToggleMount), _defineProperty(_cloneElement, 'aria-controls', this.isOpen() ? this.popoverId : undefined), _defineProperty(_cloneElement, 'aria-haspopup', this.props.toggle.props['aria-haspopup'] || true), _defineProperty(_cloneElement, 'aria-expanded', this.isOpen()), _defineProperty(_cloneElement, 'data-test', this.props.toggle.props['data-test'] || 'dropdown'), _defineProperty(_cloneElement, 'data-test-popover-id', this.popoverId), _defineProperty(_cloneElement, "id", this.props.inputId || this.props.toggle.props.id || this.toggleId), _cloneElement)); + } + }, { + key: "render", + value: function render() { + var _this$props4 = this.props, + align = _this$props4.align, + canCoverAnchor = _this$props4.canCoverAnchor, + children = _this$props4.children, + closeReasons = _this$props4.closeReasons, + defaultPlacement = _this$props4.defaultPlacement, + elementRef = _this$props4.elementRef, + repositionMode = _this$props4.repositionMode, + retainFocus = _this$props4.retainFocus, + takeFocus = _this$props4.takeFocus; + var anchor = this.state.anchor; + var handleRequestClose = this.handleRequestClose, + handleContentClick = this.handleContentClick; + var toggle = this.renderToggle(); + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, toggle, /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, { + align: align, + open: !!anchor && this.isOpen(), + autoCloseWhenOffScreen: includes_default()(closeReasons, 'offScreen'), + anchor: anchor, + canCoverAnchor: canCoverAnchor, + elementRef: elementRef, + retainFocus: retainFocus, + defaultPlacement: defaultPlacement, + onRequestClose: handleRequestClose, + repositionMode: repositionMode, + id: this.popoverId, + "aria-labelledby": this.props.inputId || this.props.toggle.props.id || this.toggleId, + takeFocus: takeFocus + }, isFunction_default()(children) ? // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions + function () { + return /*#__PURE__*/external_react_default.a.createElement("div", { + onClick: handleContentClick + }, children.apply(void 0, arguments)); + } : + /*#__PURE__*/ + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions + external_react_default.a.createElement("div", { + onClick: handleContentClick + }, children))); + } + }]); + + return Dropdown; +}(external_react_["Component"]); + +_defineProperty(Dropdown_Dropdown, "possibleCloseReasons", possibleCloseReasons); + +_defineProperty(Dropdown_Dropdown, "propTypes", propTypes); + +_defineProperty(Dropdown_Dropdown, "defaultProps", defaultProps); + +/* harmony default export */ var src_Dropdown_Dropdown = (Dropdown_Dropdown); + +// CONCATENATED MODULE: ./src/Dropdown/index.ts + + + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 69: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1882); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 87: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(62193); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 68973: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 238); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 129: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(59687); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 238: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3971__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3971__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3971__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ EventListener_EventListener; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3971__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3971__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3971__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3971__.n(external_prop_types_); + +// EXTERNAL MODULE: external "use-typed-event-listener" +var external_use_typed_event_listener_ = __nested_webpack_require_3971__(129); +var external_use_typed_event_listener_default = /*#__PURE__*/__nested_webpack_require_3971__.n(external_use_typed_event_listener_); + +// CONCATENATED MODULE: ./src/EventListener/EventListener.tsx + + + +/** + * This is a private component. + * Please see the Readme file for more information. + */ + +var propTypes = { + children: external_prop_types_default.a.node, + target: external_prop_types_default.a.oneOfType([external_prop_types_default.a.object, external_prop_types_default.a.string]), + eventType: external_prop_types_default.a.any, + listener: external_prop_types_default.a.func, + options: external_prop_types_default.a.oneOfType([external_prop_types_default.a.object, external_prop_types_default.a.bool]) +}; + +function EventListener(props) { + var children = props.children, + target = props.target, + eventType = props.eventType, + listener = props.listener, + options = props.options; + external_use_typed_event_listener_default()(target, eventType, listener, options); + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, children || null); +} + +EventListener.propTypes = propTypes; +/* harmony default export */ var EventListener_EventListener = (EventListener); +// CONCATENATED MODULE: ./src/EventListener/index.ts + + + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 39643: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 219); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 134: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63616); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 219: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4075__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4075__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4075__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Heading_Heading; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4075__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4075__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4075__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4075__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4075__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4075__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Typography" +var Typography_ = __nested_webpack_require_4075__(134); +var Typography_default = /*#__PURE__*/__nested_webpack_require_4075__.n(Typography_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4075__(0); + +// CONCATENATED MODULE: ./src/Heading/HeadingStyles.ts + + + +var StyledTypography = external_styled_components_default()(Typography_default.a).withConfig({ + displayName: "HeadingStyles__StyledTypography", + componentId: "sc-15s3yx3-0" +})(["", " margin:1.414em 0 0.4em;text-rendering:optimizelegibility;", " ", ""], Object(themes_["pickVariant"])('variant', { + title4: { + enterprise: { + compact: function compact(_ref) { + var $isSection = _ref.$isSection; + return $isSection ? themes_["mixins"].typography('title4', { + weight: 'semiBold' + }) : themes_["mixins"].typography('title4'); + }, + comfortable: function comfortable(_ref2) { + var $isSection = _ref2.$isSection; + return $isSection ? themes_["mixins"].typography('title4', { + size: 14, + weight: 'semiBold' + }) : themes_["mixins"].typography('title4', { + size: 14 + }); + } + }, + prisma: function prisma(_ref3) { + var $isSection = _ref3.$isSection; + return $isSection ? themes_["mixins"].typography('title4', { + color: 'default', + size: 14 + }) : themes_["mixins"].typography('title4'); + } + } +}), Object(themes_["pickVariant"])('$isSection', { + "true": { + enterprise: { + dark: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].gray80), + light: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].gray45) + } + } +}), function (_ref4) { + var $isSection = _ref4.$isSection; + return $isSection && Object(external_styled_components_["css"])(["margin:0.707em 0 0.2em;"]); +}); + +// CONCATENATED MODULE: ./src/Heading/Heading.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + level: external_prop_types_default.a.oneOf([1, 2, 3, 4, 's', 'ss', 5, 6]), + variant: external_prop_types_default.a.oneOf(['title1', 'title2', 'title3', 'title4', 'title5', 'title6', 'title7']) +}; +// h1-h6 use the same intrinsic element type +var levelToElement = { + '1': 'h1', + '2': 'h2', + '3': 'h3', + '4': 'h4', + s: 'h4', + ss: 'h5', + '5': 'h5', + '6': 'h6' +}; +var elementToVariant = { + h1: 'title1', + h2: 'title2', + h3: 'title3', + h4: 'title4', + h5: 'title5', + h6: 'title6' +}; + +function Heading(_ref) { + var _ref$level = _ref.level, + level = _ref$level === void 0 ? 2 : _ref$level, + children = _ref.children, + variant = _ref.variant, + otherProps = _objectWithoutProperties(_ref, ["level", "children", "variant"]); + + // @docs-props-type HeadingPropsBase + var isSection = function isSection(l) { + return l.toString().charAt(0) === 's'; + }; + + var element = levelToElement[level]; + var finalVariant = variant || elementToVariant[element]; + + if (false) {} + + return /*#__PURE__*/external_react_default.a.createElement(StyledTypography, _extends({ + forwardedAs: element, + $isSection: isSection(level), + "data-test": "heading", + variant: finalVariant + }, otherProps), children); +} + +Heading.propTypes = propTypes; +/* harmony default export */ var Heading_Heading = (Heading); + +// CONCATENATED MODULE: ./src/Heading/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 70564: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 220); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 119: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(50121); + +/***/ }), + +/***/ 15: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79859); + +/***/ }), + +/***/ 16: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68973); + +/***/ }), + +/***/ 166: +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 220: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4812__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4812__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4812__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Layer_Layer; }); +__nested_webpack_require_4812__.d(__nested_webpack_exports__, "LayerStackContext", function() { return /* reexport */ LayerStack["b" /* LayerStackContext */]; }); +__nested_webpack_require_4812__.d(__nested_webpack_exports__, "LayerContext", function() { return /* reexport */ LayerStack["a" /* LayerContext */]; }); +__nested_webpack_require_4812__.d(__nested_webpack_exports__, "LayerStackGlobalProvider", function() { return /* reexport */ LayerStack["c" /* LayerStackGlobalProvider */]; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4812__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4812__.n(external_react_); + +// EXTERNAL MODULE: external "react-dom" +var external_react_dom_ = __nested_webpack_require_4812__(90); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4812__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4812__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/includes" +var includes_ = __nested_webpack_require_4812__(15); +var includes_default = /*#__PURE__*/__nested_webpack_require_4812__.n(includes_); + +// EXTERNAL MODULE: external "lodash/last" +var last_ = __nested_webpack_require_4812__(91); +var last_default = /*#__PURE__*/__nested_webpack_require_4812__.n(last_); + +// EXTERNAL MODULE: external "lodash/pull" +var pull_ = __nested_webpack_require_4812__(119); +var pull_default = /*#__PURE__*/__nested_webpack_require_4812__.n(pull_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_4812__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/EventListener" +var EventListener_ = __nested_webpack_require_4812__(16); +var EventListener_default = /*#__PURE__*/__nested_webpack_require_4812__.n(EventListener_); + +// EXTERNAL MODULE: ./src/Layer/LayerStack.tsx +var LayerStack = __nested_webpack_require_4812__(92); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4812__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4812__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4812__(0); + +// CONCATENATED MODULE: ./src/Layer/LayerStyles.ts + + +var StyledLayer = external_styled_components_default.a.div.withConfig({ + displayName: "LayerStyles__StyledLayer", + componentId: "ii6psl-0" +})(["", ""], function (_ref) { + var $separateStackingContexts = _ref.$separateStackingContexts; + return $separateStackingContexts && Object(external_styled_components_["css"])(["isolation:isolate;z-index:", ";"], themes_["variables"].zindexLayer); +}); + +// EXTERNAL MODULE: ./src/utils/ssrDocument.ts +var ssrDocument = __nested_webpack_require_4812__(27); + +// CONCATENATED MODULE: ./src/Layer/Layer.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + +/** @public */ + +var possibleCloseReasons = ['clickAway', 'escapeKey']; +var propTypes = { + children: external_prop_types_default.a.node, + closeReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)), + onRequestClose: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool +}; +var defaultProps = { + closeReasons: possibleCloseReasons, + open: false +}; + +var Layer_Layer = /*#__PURE__*/function (_Component) { + _inherits(Layer, _Component); + + var _super = _createSuper(Layer); + + // @docs-props-type LayerPropsBase + // eslint-disable-next-line react/sort-comp + // LayerStackContext (an array) keeps track of the current instances of Layer. This is + // used by Layer#handleKeyDown to determine if the escapeKey event should be handled by + // the current instance. Only the topmost Layer instance should honor the escapeKey. + // TODO: enable once this is sorted out within the babel/ts ecosystem + // declare context: React.ContextType; + function Layer(props) { + var _this; + + _classCallCheck(this, Layer); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "layerClickEvent", null); + + _defineProperty(_assertThisInitialized(_this), "handleClickOnLayer", function (_ref) { + var nativeEvent = _ref.nativeEvent; + _this.layerClickEvent = nativeEvent; + }); + + _defineProperty(_assertThisInitialized(_this), "handleClickOnWindow", function (event) { + var _this$props$onRequest, _this$props; + + // clicks inside the layer should not be considered clickAways + if (!_this.props.open || !includes_default()(_this.props.closeReasons, 'clickAway') || _this.layerClickEvent === event) { + return; + } + + (_this$props$onRequest = (_this$props = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, { + event: event, + reason: 'clickAway' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleKeyDownOnWindow", function (event) { + if (_this.props.open && Object(keyboard_["keycode"])(event) === 'esc' && last_default()(_this.getLayerStack()) === _assertThisInitialized(_this) && includes_default()(_this.props.closeReasons, 'escapeKey')) { + var _this$props$onRequest2, _this$props2; + + (_this$props$onRequest2 = (_this$props2 = _this.props).onRequestClose) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props2, { + event: event, + reason: 'escapeKey' + }); + } + }); + + var document = Object(ssrDocument["a" /* getDocument */])(); + + if (!Layer.layerContainer) { + Layer.layerContainer = document.createElement('div'); + Layer.layerContainer.setAttribute('data-test', 'layer-container'); + document.body.appendChild(Layer.layerContainer); + } + + return _this; + } + + _createClass(Layer, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (this.props.open) { + this.getLayerStack().push(this); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (!prevProps.open && this.props.open) { + this.getLayerStack().push(this); + } else if (prevProps.open && !this.props.open) { + pull_default()(this.getLayerStack(), this); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + pull_default()(this.getLayerStack(), this); + } + }, { + key: "getLayerStack", + value: function getLayerStack() { + return this.context; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props3 = this.props, + children = _this$props3.children, + open = _this$props3.open; + + if (open) { + var layerPortal = /*#__PURE__*/Object(external_react_dom_["createPortal"])( /*#__PURE__*/external_react_default.a.createElement(LayerStack["a" /* LayerContext */].Consumer, null, function (_ref2) { + var _ref2$separateStackin = _ref2.separateStackingContexts, + separateStackingContexts = _ref2$separateStackin === void 0 ? false : _ref2$separateStackin; + return /*#__PURE__*/external_react_default.a.createElement(StyledLayer // eslint-disable-line jsx-a11y/no-static-element-interactions + , { + $separateStackingContexts: separateStackingContexts, + "data-test": "layer", + onMouseDown: _this2.handleClickOnLayer, + onTouchStart: _this2.handleClickOnLayer + }, children); + }), Layer.layerContainer // eslint-disable-line @typescript-eslint/no-non-null-assertion + ); + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "keydown", + listener: this.handleKeyDownOnWindow, + key: "eventListenerKeydown" + }), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "mousedown", + listener: this.handleClickOnWindow, + key: "eventListenerMouseDown" + }), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "touchstart", + listener: this.handleClickOnWindow, + key: "eventListenerTouchStart", + options: { + passive: true + } + }), layerPortal); + } + + return null; + } + }]); + + return Layer; +}(external_react_["Component"]); + +_defineProperty(Layer_Layer, "layerContainer", null); + +_defineProperty(Layer_Layer, "possibleCloseReasons", possibleCloseReasons); + +_defineProperty(Layer_Layer, "propTypes", propTypes); + +_defineProperty(Layer_Layer, "defaultProps", defaultProps); + +_defineProperty(Layer_Layer, "contextType", LayerStack["b" /* LayerStackContext */]); + +/* harmony default export */ var src_Layer_Layer = (Layer_Layer); +// CONCATENATED MODULE: ./src/Layer/index.ts + + + +/***/ }), + +/***/ 27: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_17070__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_17070__.d(__nested_webpack_exports__, "a", function() { return getDocument; }); +/* harmony export (binding) */ __nested_webpack_require_17070__.d(__nested_webpack_exports__, "b", function() { return ssrDocument; }); +/* eslint-disable @typescript-eslint/no-empty-function */ +var ssrDocument = { + body: { + appendChild: function appendChild() { + return []; + } + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + activeElement: { + blur: function blur() {}, + nodeName: '' + }, + querySelector: function querySelector() { + return null; + }, + querySelectorAll: function querySelectorAll() { + return []; + }, + getElementById: function getElementById() { + return null; + }, + createEvent: function createEvent() { + return { + initEvent: function initEvent() {} + }; + }, + createElement: function createElement() { + return { + children: [], + childNodes: [], + style: {}, + setAttribute: function setAttribute() {}, + getElementsByTagName: function getElementsByTagName() { + return []; + } + }; + }, + createElementNS: function createElementNS() { + return {}; + }, + importNode: function importNode() { + return null; + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } +}; + +function getDocument() { + var doc = typeof document !== 'undefined' ? document : ssrDocument; + return doc; +} + + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 90: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40961); + +/***/ }), + +/***/ 91: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68090); + +/***/ }), + +/***/ 92: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_19123__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __nested_webpack_require_19123__.d(__nested_webpack_exports__, "b", function() { return LayerStackContext; }); +/* harmony export (binding) */ __nested_webpack_require_19123__.d(__nested_webpack_exports__, "a", function() { return LayerContext; }); +/* harmony export (binding) */ __nested_webpack_require_19123__.d(__nested_webpack_exports__, "c", function() { return LayerStackGlobalProvider; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_19123__(2); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_19123__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_19123__(1); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_19123__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); + + + +/** + * `LayerStackContext` is used to manage the array that `Layer` (and components that + * depend on it, such as `Modal`) uses to determine the order of open layers. + * @public + */ +var LayerStackContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext([]); +var LayerContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({}); +var propTypes = { + children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, + name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, + scope: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, + separateStackingContexts: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool +}; +/* global global */ + +/** + * A `LayerStackContext` provider that stores a shared layer stack using a global variable. + * Applications should only use this provider if there's a known need to support multiple + * instances of this library on the same page. + */ + +function LayerStackGlobalProvider(_ref) { + var children = _ref.children, + _ref$name = _ref.name, + name = _ref$name === void 0 ? '__splunkui_layer_instances__' : _ref$name, + _ref$scope = _ref.scope, + scope = _ref$scope === void 0 ? typeof window !== 'undefined' ? window : global : _ref$scope, + _ref$separateStacking = _ref.separateStackingContexts, + separateStackingContexts = _ref$separateStacking === void 0 ? false : _ref$separateStacking; + + if (!scope[name]) { + scope[name] = []; // eslint-disable-line no-param-reassign + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(LayerStackContext.Provider, { + value: scope[name] + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(LayerContext.Provider, { + value: { + separateStackingContexts: separateStackingContexts + } + }, children)); +} + +LayerStackGlobalProvider.propTypes = propTypes; + +/* WEBPACK VAR INJECTION */}.call(this, __nested_webpack_require_19123__(166))) + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 59421: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 200); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 200: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4073__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4073__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4073__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Link_Link; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4073__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4073__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4073__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4073__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown" +var Dropdown_ = __nested_webpack_require_4073__(22); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4073__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4073__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ArrowSquareTopRight" +var ArrowSquareTopRight_ = __nested_webpack_require_4073__(93); +var ArrowSquareTopRight_default = /*#__PURE__*/__nested_webpack_require_4073__.n(ArrowSquareTopRight_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/External" +var External_ = __nested_webpack_require_4073__(63); +var External_default = /*#__PURE__*/__nested_webpack_require_4073__.n(External_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4073__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4073__(4); + +// CONCATENATED MODULE: ./src/Link/icons/External.tsx + + + + + + + +var label = Object(i18n_["_"])('Open externally'); + +var iconStyles = Object(external_styled_components_["css"])(["width:0.8em;height:0.8em;vertical-align:baseline;"]); +var StyledEnterprise = external_styled_components_default()(External_default.a).withConfig({ + displayName: "External__StyledEnterprise", + componentId: "sc-13bdx45-0" +})(["", " margin:0 0 0 3px;"], iconStyles); +var StyledPrisma = external_styled_components_default()(ArrowSquareTopRight_default.a).withConfig({ + displayName: "External__StyledPrisma", + componentId: "sc-13bdx45-1" +})(["", " margin:0 0 0 4px;"], iconStyles); + +function External() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(StyledEnterprise, { + screenReaderText: label + }) : /*#__PURE__*/external_react_default.a.createElement(StyledPrisma, { + "aria-label": label + }, /*#__PURE__*/external_react_default.a.createElement("title", null, label)); +} + +/* harmony default export */ var icons_External = (External); +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4073__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4073__.n(Clickable_); + +// CONCATENATED MODULE: ./src/Link/LinkStyles.ts + + + +var StyledClickable = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "LinkStyles__StyledClickable", + componentId: "sc-1hhltcf-0" +})(["", ";color:", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;border-radius:", ";&:not([disabled]){cursor:pointer;", ";&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled]{color:", ";}&::-moz-focus-inner{border:0;padding:0;}"], themes_["mixins"].reset('inline'), Object(themes_["pick"])({ + enterprise: themes_["variables"].linkColor, + prisma: themes_["variables"].interactiveColorPrimary +}), Object(themes_["pick"])({ + enterprise: 0, + prisma: '1px' +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["&:hover{text-decoration:underline;}"]), + prisma: Object(external_styled_components_["css"])(["&:hover:not(:focus),&:active{text-decoration:underline;text-underline-position:under;}"]) +}), themes_["variables"].focusShadow, themes_["variables"].contentColorDisabled); + +// CONCATENATED MODULE: ./src/Link/Link.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + +var defaultProps = { + disabled: false, + openInNewContext: false +}; +var propTypes = { + children: external_prop_types_default.a.node, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + openInNewContext: external_prop_types_default.a.bool, + to: external_prop_types_default.a.string +}; +/** + * `Link` is a simple method for configuring `Button` for inline links. For more complex behaviors, + * see the `Button` documentation. + */ + +var Link_Link = /*#__PURE__*/function (_Component) { + _inherits(Link, _Component); + + var _super = _createSuper(Link); + + function Link() { + var _this; + + _classCallCheck(this, Link); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "component", null); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (comp) { + _this.component = comp; + }); + + return _this; + } + + _createClass(Link, [{ + key: "focus", + + /** + * Place focus on the link. + */ + value: function focus() { + var _this$component; + + (_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + openInNewContext = _this$props.openInNewContext, + otherProps = _objectWithoutProperties(_this$props, ["children", "openInNewContext"]); + + return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({ + "data-test": "link", + ref: this.handleMount, + openInNewContext: openInNewContext + }, otherProps), children, openInNewContext && /*#__PURE__*/external_react_default.a.createElement(icons_External, null)); + } + }]); + + return Link; +}(external_react_["Component"]); + +_defineProperty(Link_Link, "propTypes", propTypes); + +_defineProperty(Link_Link, "defaultProps", defaultProps); + +_defineProperty(Link_Link, Dropdown_["legacyRefMode"], true); + +/* harmony default export */ var src_Link_Link = (Link_Link); +// CONCATENATED MODULE: ./src/Link/index.ts + + +/***/ }), + +/***/ 22: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73592); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 63: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63172); + +/***/ }), + +/***/ 93: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(43102); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 76646: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 171); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3866__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3866__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 142: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(37075); + +/***/ }), + +/***/ 171: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4963__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4963__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4963__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Menu_Menu; }); +__nested_webpack_require_4963__.d(__nested_webpack_exports__, "Item", function() { return /* reexport */ Menu_Item; }); +__nested_webpack_require_4963__.d(__nested_webpack_exports__, "Heading", function() { return /* reexport */ Menu_Heading; }); +__nested_webpack_require_4963__.d(__nested_webpack_exports__, "Divider", function() { return /* reexport */ Menu_Divider; }); +__nested_webpack_require_4963__.d(__nested_webpack_exports__, "MenuContext", function() { return /* reexport */ MenuContext; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4963__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4963__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4963__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4963__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4963__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4963__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Popover" +var Popover_ = __nested_webpack_require_4963__(21); + +// EXTERNAL MODULE: external "@splunk/ui-utils/focus" +var focus_ = __nested_webpack_require_4963__(29); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_4963__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/useForceUpdate" +var useForceUpdate_ = __nested_webpack_require_4963__(45); +var useForceUpdate_default = /*#__PURE__*/__nested_webpack_require_4963__.n(useForceUpdate_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4963__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4963__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4963__(0); + +// CONCATENATED MODULE: ./src/Menu/DividerStyles.ts + + +var Styled = external_styled_components_default.a.div.withConfig({ + displayName: "DividerStyles__Styled", + componentId: "l3zfh3-0" +})(["border-top:1px solid ", ";", ""], Object(themes_["pick"])({ + enterprise: themes_["variables"].borderColor, + prisma: themes_["variables"].neutral200 +}), Object(themes_["pick"])({ + prisma: { + comfortable: Object(external_styled_components_["css"])(["margin:8px 0;"]), + compact: Object(external_styled_components_["css"])(["margin:6px 0;"]) + } +})); + +// CONCATENATED MODULE: ./src/Menu/MenuContext.tsx + +var MenuContext = /*#__PURE__*/Object(external_react_["createContext"])({ + role: 'menu' +}); + +// CONCATENATED MODULE: ./src/Menu/Divider.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + +var propTypes = {}; + +/** + * A non-interactive menu item used to visually separate groups of items in the menu. + */ +function Divider(_ref) { + var otherProps = _extends({}, _ref); + + // @docs-props-type DividerPropsBase + var _useContext = Object(external_react_["useContext"])(MenuContext), + role = _useContext.role; + + return /*#__PURE__*/external_react_default.a.createElement(Styled // dividers are not supported in role="listbox" + // this causes Firefox to incorrectly read the total number + // of items in the list if it contains a heading or divider + // so we set them to aria-hidden to prevent that + , _extends({ + "aria-hidden": role === 'listbox', + "data-test": "divider", + role: "separator" + }, otherProps)); +} + +Divider.propTypes = propTypes; +/* Remove the item if it is the first item after filtering */ + +Divider.filterFirst = true; +/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ + +Divider.filterConsecutive = true; +/* Remove the item if it is the last item after filtering. */ + +Divider.filterLast = true; +/* Tag the item as Divider */ + +Divider.as = 'Divider'; +/* harmony default export */ var Menu_Divider = (Divider); +// EXTERNAL MODULE: external "@splunk/react-ui/Heading" +var Heading_ = __nested_webpack_require_4963__(77); +var Heading_default = /*#__PURE__*/__nested_webpack_require_4963__.n(Heading_); + +// EXTERNAL MODULE: external "@splunk/themes/useSplunkTheme" +var useSplunkTheme_ = __nested_webpack_require_4963__(68); +var useSplunkTheme_default = /*#__PURE__*/__nested_webpack_require_4963__.n(useSplunkTheme_); + +// CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts + + +var HeadingStyles_Styled = external_styled_components_default.a.div.withConfig({ + displayName: "HeadingStyles__Styled", + componentId: "mcd2ws-0" +})(["", " border-top:1px solid transparent;padding:", ";&:not(:first-child){", ";}"], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["", " ", " 6px"], themes_["variables"].spacingQuarter, themes_["variables"].spacingHalf), + prisma: { + comfortable: '13px 16px 10px 16px', + compact: '9px 16px 6px 16px' + } +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border), + prisma: { + comfortable: Object(external_styled_components_["css"])(["border-top:1px solid ", ";margin-top:6px;padding-top:19px;"], themes_["variables"].neutral200), + compact: Object(external_styled_components_["css"])(["border-top:1px solid ", ";margin-top:6px;padding-top:15px;"], themes_["variables"].neutral200) + } +})); +var PrismaSectionTitle = external_styled_components_default.a.h5.withConfig({ + displayName: "HeadingStyles__PrismaSectionTitle", + componentId: "mcd2ws-1" +})(["", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;"], themes_["mixins"].reset('block'), themes_["variables"].fontSizeSmall, themes_["variables"].lineHeight, themes_["variables"].fontWeightBold); + +// CONCATENATED MODULE: ./src/Menu/Heading.tsx +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function Heading_extends() { Heading_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Heading_extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + +var Heading_propTypes = { + children: external_prop_types_default.a.node, + title: external_prop_types_default.a.bool, + outerStyle: external_prop_types_default.a.object +}; + +/** + * A non-interactive `Menu` item used to separate and label groups of `Menu` items. + */ +function Heading(_ref) { + var children = _ref.children, + title = _ref.title, + outerStyle = _ref.outerStyle, + otherProps = _objectWithoutProperties(_ref, ["children", "title", "outerStyle"]); + + var _useContext = Object(external_react_["useContext"])(MenuContext), + role = _useContext.role; + + var _useSplunkTheme = useSplunkTheme_default()(), + family = _useSplunkTheme.family; + + var inner = family === 'prisma' ? /*#__PURE__*/external_react_default.a.createElement(PrismaSectionTitle, Heading_extends({ + as: title ? 'h4' : 'h5', + style: outerStyle, + "data-test": "heading" + }, otherProps), children) : /*#__PURE__*/external_react_default.a.createElement(Heading_default.a, Heading_extends({ + style: _objectSpread(_objectSpread({}, outerStyle), {}, { + margin: 0 + }), + level: title ? 4 : 'ss', + "data-test": "heading" + }, otherProps), children); // headings are not supported in role="listbox" + // this causes Firefox to incorrectly read the total number + // of items in the list if it contains a heading or divider + // so we set them to aria-hidden to prevent that + + return /*#__PURE__*/external_react_default.a.createElement(HeadingStyles_Styled, { + "aria-hidden": role === 'listbox' + }, inner); +} + +Heading.propTypes = Heading_propTypes; +/* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ + +Heading.filterConsecutive = true; +/* Remove the item if it is the last item after filtering. */ + +Heading.filterLast = true; +/* Tag the item as a Heading */ + +Heading.as = 'Heading'; +/* harmony default export */ var Menu_Heading = (Heading); +// EXTERNAL MODULE: external "lodash/isString" +var isString_ = __nested_webpack_require_4963__(23); +var isString_default = /*#__PURE__*/__nested_webpack_require_4963__.n(isString_); + +// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallRight" +var CaretSmallRight_ = __nested_webpack_require_4963__(142); +var CaretSmallRight_default = /*#__PURE__*/__nested_webpack_require_4963__.n(CaretSmallRight_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Checkmark" +var Checkmark_ = __nested_webpack_require_4963__(75); +var Checkmark_default = /*#__PURE__*/__nested_webpack_require_4963__.n(Checkmark_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Check" +var Check_ = __nested_webpack_require_4963__(94); +var Check_default = /*#__PURE__*/__nested_webpack_require_4963__.n(Check_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronRight" +var ChevronRight_ = __nested_webpack_require_4963__(35); +var ChevronRight_default = /*#__PURE__*/__nested_webpack_require_4963__.n(ChevronRight_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4963__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4963__.n(Clickable_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Switch" +var Switch_ = __nested_webpack_require_4963__(58); +var Switch_default = /*#__PURE__*/__nested_webpack_require_4963__.n(Switch_); + +// CONCATENATED MODULE: ./src/Menu/ItemStyles.ts + + + + +var itemDescription = Object(external_styled_components_["css"])(["color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;"], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDefault, + enterprise: themes_["variables"].textGray +}), themes_["variables"].fontSizeSmall, Object(themes_["pick"])({ + prisma: '16px' +})); +var StyledItemDescriptionBottom = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledItemDescriptionBottom", + componentId: "sc-4kc053-0" +})(["", ";display:block;"], itemDescription); +var StyledItemDescriptionRight = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledItemDescriptionRight", + componentId: "sc-4kc053-1" +})(["", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;"], itemDescription, themes_["variables"].spacing); +var StyledItemSelectedIcon = external_styled_components_default.a.div.withConfig({ + displayName: "ItemStyles__StyledItemSelectedIcon", + componentId: "sc-4kc053-2" +})(["position:absolute;", " color:", ";"], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["right:16px;"]), + enterprise: Object(external_styled_components_["css"])(["top:5px;right:3px;left:8px;"]) +}), Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorActive, + enterprise: themes_["variables"].accentColorL10 +})); +var StyledItemIcon = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledItemIcon", + componentId: "sc-4kc053-3" +})(["flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", ""], Object(themes_["pick"])({ + prisma: '8px', + enterprise: '3px' +}), Object(themes_["pick"])({ + prisma: 'initial', + enterprise: 'middle' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}"], themes_["variables"].contentColorMuted), + enterprise: Object(external_styled_components_["css"])(["transform:translateY(-1px);"]) +})); +var StyledClickable = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "ItemStyles__StyledClickable", + componentId: "sc-4kc053-4" +})(["display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", ""], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorActive, + enterprise: { + dark: themes_["variables"].gray96, + light: themes_["variables"].gray22 + } +}), Object(themes_["pick"])({ + prisma: { + comfortable: '10px 16px', + compact: '6px 16px' + }, + enterprise: '6px 10px' +}), function (_ref) { + var $isSelectable = _ref.$isSelectable, + $selectableAppearance = _ref.$selectableAppearance; + return $isSelectable && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["padding-right:44px;", ""], function () { + return $selectableAppearance === 'checkbox' && 'padding-left: 42px;'; + }), + enterprise: Object(external_styled_components_["css"])(["padding-right:10px;padding-left:", ";"], function () { + return $selectableAppearance === 'checkbox' ? '32px' : '28px'; + }) + }); +}, function (_ref2) { + var $active = _ref2.$active, + $preventFocus = _ref2.$preventFocus; + return $active && !$preventFocus && Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadowInset); +}, function (_ref3) { + var $active = _ref3.$active; + return $active && Object(external_styled_components_["css"])(["background:", ";font-weight:", ";"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray92, + dark: themes_["variables"].gray22 + }, + prisma: themes_["variables"].neutral100 + }), themes_["variables"].fontWeightBold); +}, Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayHover, + enterprise: themes_["variables"].backgroundColorHover +}), function (_ref4) { + var $selected = _ref4.$selected; + return $selected && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background:", ";"], themes_["mixins"].overlayColors(themes_["variables"].interactiveColorOverlaySelected, themes_["variables"].interactiveColorOverlayHover)) + }); +}, themes_["variables"].focusShadowInset, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].interactiveColorOverlayHover) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:active{background:", ";}"], themes_["variables"].interactiveColorOverlayActive) +}), function (_ref5) { + var $selected = _ref5.$selected; + return $selected && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background:", ";&:active{background:", ";}"], themes_["variables"].interactiveColorOverlaySelected, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorOverlaySelected, themes_["variables"].interactiveColorOverlayActive)) + }); +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray45, + dark: themes_["variables"].contentColorDisabled + }, + prisma: themes_["variables"].contentColorDisabled +}), +/* sc-sel */ +StyledItemDescriptionBottom, +/* sc-sel */ +StyledItemDescriptionRight, +/* sc-sel */ +StyledItemSelectedIcon, Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDisabled, + enterprise: themes_["variables"].gray80 +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["& > * > ", "{color:", ";}"], + /* sc-sel */ + StyledItemIcon, themes_["variables"].contentColorDisabled) +}), function (_ref6) { + var $selected = _ref6.$selected; + return $selected && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["", "{color:", ";}"], + /* sc-sel */ + StyledItemIcon, themes_["variables"].contentColorActive) + }); +}); +var StyledSwitch = external_styled_components_default()(Switch_default.a).withConfig({ + displayName: "ItemStyles__StyledSwitch", + componentId: "sc-4kc053-5" +})(["position:absolute;left:", ";top:", ";"], Object(themes_["pick"])({ + prisma: '16px', + enterprise: '8px' +}), Object(themes_["pick"])({ + prisma: '0px', + enterprise: { + comfortable: '-1px', + compact: '2px' + } +})); +var StyledInnerWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledInnerWrapper", + componentId: "sc-4kc053-6" +})(["display:flex;align-items:flex-start;"]); +var StyledTitleAndDescriptionWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledTitleAndDescriptionWrapper", + componentId: "sc-4kc053-7" +})(["max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", ""], function (_ref7) { + var $truncate = _ref7.$truncate; + return $truncate && Object(external_styled_components_["css"])(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]); +}); +var StyledLabel = external_styled_components_default.a.div.withConfig({ + displayName: "ItemStyles__StyledLabel", + componentId: "sc-4kc053-8" +})(["overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", ""], function (_ref8) { + var $truncate = _ref8.$truncate; + return $truncate && Object(external_styled_components_["css"])(["display:block;clear:both;"]); +}); +var StyledMatch = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledMatch", + componentId: "sc-4kc053-9" +})(["border-bottom:1px solid ", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorActive, + enterprise: { + dark: themes_["variables"].gray96, + light: themes_["variables"].gray45 + } +})); +var StyledSubmenu = external_styled_components_default.a.span.withConfig({ + displayName: "ItemStyles__StyledSubmenu", + componentId: "sc-4kc053-10" +})(["float:right;padding-left:", ";color:", ";"], themes_["variables"].spacingSmall, Object(themes_["pick"])({ + prisma: 'inherit', + enterprise: themes_["variables"].textGray +})); + +// EXTERNAL MODULE: external "@splunk/react-icons/ArrowSquareTopRight" +var ArrowSquareTopRight_ = __nested_webpack_require_4963__(93); +var ArrowSquareTopRight_default = /*#__PURE__*/__nested_webpack_require_4963__.n(ArrowSquareTopRight_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/External" +var External_ = __nested_webpack_require_4963__(63); +var External_default = /*#__PURE__*/__nested_webpack_require_4963__.n(External_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4963__(4); + +// CONCATENATED MODULE: ./src/Menu/icons/External.tsx + + + + + + + +var label = Object(i18n_["_"])('Open externally'); + +var iconStyles = Object(external_styled_components_["css"])(["width:0.8em;height:0.8em;vertical-align:baseline;"]); +var StyledEnterprise = external_styled_components_default()(External_default.a).withConfig({ + displayName: "External__StyledEnterprise", + componentId: "sc-1turs2s-0" +})(["", " margin:0 0 0 3px;"], iconStyles); +var StyledPrisma = external_styled_components_default()(ArrowSquareTopRight_default.a).withConfig({ + displayName: "External__StyledPrisma", + componentId: "sc-1turs2s-1" +})(["", " margin:0 0 0 4px;"], iconStyles); + +function External() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise, + isCompact = _useSplunkTheme.isCompact; + + var prismaSize = isCompact ? '20px' : '24px'; + return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(StyledEnterprise, { + screenReaderText: label + }) : /*#__PURE__*/external_react_default.a.createElement(StyledPrisma, { + "aria-label": label, + height: prismaSize, + width: prismaSize + }, /*#__PURE__*/external_react_default.a.createElement("title", null, label)); +} + +/* harmony default export */ var icons_External = (External); +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_4963__(11); + +// EXTERNAL MODULE: ./src/utils/scrollIntoViewIfNeeded.ts +var utils_scrollIntoViewIfNeeded = __nested_webpack_require_4963__(88); + +// CONCATENATED MODULE: ./src/Menu/Item.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function Item_extends() { Item_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Item_extends.apply(this, arguments); } + +function Item_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Item_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Item_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function Item_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + +var Item_propTypes = { + active: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + description: external_prop_types_default.a.string, + descriptionPosition: external_prop_types_default.a.oneOf(['right', 'bottom']), + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + hasSubmenu: external_prop_types_default.a.bool, + icon: external_prop_types_default.a.node, + + /** @private. The internal key of the tab */ + itemKey: external_prop_types_default.a.number, + matchRanges: external_prop_types_default.a.arrayOf(external_prop_types_default.a.shape({ + start: external_prop_types_default.a.number.isRequired, + end: external_prop_types_default.a.number.isRequired + })), + onClick: external_prop_types_default.a.func, + + /** @private */ + onFocus: external_prop_types_default.a.func, + openInNewContext: external_prop_types_default.a.bool, + + /** @private */ + preventFocus: external_prop_types_default.a.bool, + role: external_prop_types_default.a.oneOf(['menuitem', 'menuitemradio', 'menuitemcheckbox', 'listboxitem', 'option']), + selectable: external_prop_types_default.a.bool, + selectableAppearance: external_prop_types_default.a.oneOf(['checkmark', 'checkbox']), + selected: external_prop_types_default.a.bool, + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + to: external_prop_types_default.a.string, + truncate: external_prop_types_default.a.bool +}; +var defaultProps = { + active: false, + descriptionPosition: 'bottom', + disabled: false, + hasSubmenu: false, + openInNewContext: false, + preventFocus: false, + selectable: false, + selectableAppearance: 'checkmark', + selected: false, + truncate: false +}; + +var Item_Item = /*#__PURE__*/function (_Component) { + _inherits(Item, _Component); + + var _super = _createSuper(Item); + + _createClass(Item, null, [{ + key: "validateProps", + // @docs-props-type ItemPropsBase + value: function validateProps(props) { + if (false) {} + } + }]); + + function Item(props) { + var _this; + + _classCallCheck(this, Item); + + _this = _super.call(this, props); + + Item_defineProperty(_assertThisInitialized(_this), "el", null); + + Item_defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) { + var _this$props = _this.props, + onFocus = _this$props.onFocus, + itemKey = _this$props.itemKey; + onFocus === null || onFocus === void 0 ? void 0 : onFocus(e, { + itemKey: itemKey + }); + }); + + Item_defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + _this.el = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + Item.validateProps(props); + return _this; + } + + _createClass(Item, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + Item.validateProps(this.props); + } + }, { + key: "focus", + value: function focus() { + var _this$el; + + (_this$el = this.el) === null || _this$el === void 0 ? void 0 : _this$el.focus(); + } + }, { + key: "scrollIntoViewIfNeeded", + value: function scrollIntoViewIfNeeded() { + Object(utils_scrollIntoViewIfNeeded["a" /* scrollIntoViewIfNeeded */])(this.el); + } + }, { + key: "renderLabel", + value: function renderLabel() { + var _this$props2 = this.props, + children = _this$props2.children, + matchRanges = _this$props2.matchRanges; + + if (!matchRanges || !isString_default()(children)) { + return children; + } + + var segments = []; // before first match. May be empty string. + + segments.push(children.substring(0, matchRanges[0].start)); + matchRanges.forEach(function (match, index) { + segments.push( + /*#__PURE__*/ + // eslint-disable-next-line react/no-array-index-key + external_react_default.a.createElement(StyledMatch, { + key: index, + "data-test": "match" + }, children.substring(match.start, match.end))); + + if (index < matchRanges.length - 1) { + segments.push(children.substring(match.end, matchRanges[index + 1].start)); + } else { + segments.push(children.substring(match.end, children.length)); + } + }); + return segments; + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + active = _this$props3.active, + children = _this$props3.children, + hasSubmenu = _this$props3.hasSubmenu, + selectable = _this$props3.selectable, + selectableAppearance = _this$props3.selectableAppearance, + selected = _this$props3.selected, + icon = _this$props3.icon, + description = _this$props3.description, + disabled = _this$props3.disabled, + onClick = _this$props3.onClick, + preventFocus = _this$props3.preventFocus, + role = _this$props3.role, + splunkTheme = _this$props3.splunkTheme, + to = _this$props3.to, + truncate = _this$props3.truncate, + descriptionPosition = _this$props3.descriptionPosition, + openInNewContext = _this$props3.openInNewContext, + otherProps = Item_objectWithoutProperties(_this$props3, ["active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext"]); + + var isEnterprise = splunkTheme.isEnterprise, + isPrisma = splunkTheme.isPrisma; + var isSelectable = selectable || selected; + var defaultRole = { + nonselectable: 'menuitem', + checkmark: 'menuitemradio', + checkbox: 'menuitemcheckbox' + }[isSelectable ? selectableAppearance : 'nonselectable']; // aria-checked updates only with checkmark appearance for now SUI-2578 + + var ariaProps = { + 'aria-haspopup': hasSubmenu ? true : undefined, + 'aria-checked': selectableAppearance === 'checkmark' && selected ? true : undefined + }; + var selectablePosition = isPrisma ? 'right' : 'left'; + var descriptionRight = description && descriptionPosition === 'right' && selectablePosition !== 'right'; + var descriptionBottom = description && !descriptionRight; + var selectableCheckmark = selected && selectableAppearance === 'checkmark' && /*#__PURE__*/external_react_default.a.createElement(StyledItemSelectedIcon, null, isPrisma ? /*#__PURE__*/external_react_default.a.createElement(Checkmark_default.a, { + inline: true, + height: "16", + width: "16" + }) : /*#__PURE__*/external_react_default.a.createElement(Check_default.a, { + hideDefaultTooltip: true, + inline: true, + screenReaderText: null, + size: 0.85 + })); + return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, Item_extends({ + $isSelectable: isSelectable, + $selectableAppearance: selectableAppearance, + $selected: selected, + $active: active, + $preventFocus: preventFocus, + "data-test-selected": isSelectable ? selected : null, + "data-test": "item", + "data-has-icon": !!icon, + disabled: disabled, + onClick: onClick, + onFocus: this.handleFocus, + onMouseDown: function onMouseDown(e) { + if (preventFocus) { + e.preventDefault(); + } + }, + role: role || defaultRole, + to: to, + title: truncate && isString_default()(children) ? children : undefined, + openInNewContext: openInNewContext + }, ariaProps, omit_default()(otherProps, 'onFocus'), { + elementRef: this.handleMount + }), selectablePosition === 'left' && selectableCheckmark, selectable && selectableAppearance === 'checkbox' && /*#__PURE__*/external_react_default.a.createElement(StyledSwitch, { + interactive: false, + selected: selected, + selectedLabel: "Selected", + value: "menu-item" + }), hasSubmenu && /*#__PURE__*/external_react_default.a.createElement(StyledSubmenu, null, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(ChevronRight_default.a, { + hideDefaultTooltip: true, + screenReaderText: null + }) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallRight_default.a, { + height: "24", + width: "24" + })), descriptionRight && /*#__PURE__*/external_react_default.a.createElement(StyledItemDescriptionRight, { + "data-test": "description" + }, description), /*#__PURE__*/external_react_default.a.createElement(StyledInnerWrapper, null, icon && /*#__PURE__*/external_react_default.a.createElement(StyledItemIcon, null, icon), /*#__PURE__*/external_react_default.a.createElement(StyledTitleAndDescriptionWrapper, { + $truncate: truncate + }, /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + $truncate: truncate, + "data-test": "label" + }, this.renderLabel(), openInNewContext && /*#__PURE__*/external_react_default.a.createElement(icons_External, null)), descriptionBottom && /*#__PURE__*/external_react_default.a.createElement(StyledItemDescriptionBottom, { + "data-test": "description" + }, description)), selectablePosition === 'right' && selectableCheckmark)); + } + }]); + + return Item; +}(external_react_["Component"]); + +Item_defineProperty(Item_Item, "propTypes", Item_propTypes); + +Item_defineProperty(Item_Item, "defaultProps", defaultProps); + +Item_defineProperty(Item_Item, "as", void 0); + +var ItemWithThemeBase = Object(themes_["withSplunkTheme"])(Item_Item); +var ItemWithTheme = ItemWithThemeBase; +ItemWithTheme.propTypes = Item_Item.propTypes; +ItemWithTheme.as = 'Item'; +/* harmony default export */ var Menu_Item = (ItemWithTheme); +// EXTERNAL MODULE: external "@splunk/react-ui/Scroll" +var Scroll_ = __nested_webpack_require_4963__(86); +var Scroll_default = /*#__PURE__*/__nested_webpack_require_4963__.n(Scroll_); + +// CONCATENATED MODULE: ./src/Menu/MenuStyles.ts + + + +var adjacentSiblingStyles = Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].gray60, + prisma: themes_["variables"].neutral200 +})); +var MenuStyles_Styled = external_styled_components_default.a.div.withConfig({ + displayName: "MenuStyles__Styled", + componentId: "sc-1olffp9-0" +})(["", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}"], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorPopup +}), themes_["variables"].borderRadius, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["padding:8px 0;"]) +}), themes_["variables"].focusShadowInset, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].interactiveColorOverlayHover) +}), adjacentSiblingStyles); +var StyledScroll = external_styled_components_default()(MenuStyles_Styled.withComponent(Scroll_default.a)).withConfig({ + displayName: "MenuStyles__StyledScroll", + componentId: "sc-1olffp9-1" +})(["", " + &,& + ", "{", "}"], +/* sc-sel */ +MenuStyles_Styled, +/* sc-sel */ +MenuStyles_Styled, adjacentSiblingStyles); + +// EXTERNAL MODULE: ./src/utils/navigateList.ts +var navigateList = __nested_webpack_require_4963__(57); + +// CONCATENATED MODULE: ./src/Menu/Menu.tsx +function Menu_extends() { Menu_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Menu_extends.apply(this, arguments); } + +function Menu_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Menu_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Menu_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + + + + + + + +var Menu_propTypes = { + children: external_prop_types_default.a.node, + + /** @private */ + controlledExternally: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + retainFocus: external_prop_types_default.a.bool, + stopScrollPropagation: external_prop_types_default.a.bool +}; +var Menu_defaultProps = { + stopScrollPropagation: false +}; + +function Menu(_ref) { + var children = _ref.children, + controlledExternally = _ref.controlledExternally, + elementRef = _ref.elementRef, + retainFocusProp = _ref.retainFocus, + stopScrollPropagation = _ref.stopScrollPropagation, + otherProps = Menu_objectWithoutProperties(_ref, ["children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation"]); + + // @docs-props-type MenuPropsBase + var _useContext = Object(external_react_["useContext"])(MenuContext), + _useContext$role = _useContext.role, + role = _useContext$role === void 0 ? 'menu' : _useContext$role; + + var _useContext2 = Object(external_react_["useContext"])(Popover_["PopoverContext"]), + retainFocusFromContext = _useContext2.retainFocus; + + var forceUpdate = useForceUpdate_default()(); + var retainFocus = true; + + if (retainFocusProp != null) { + retainFocus = retainFocusProp; + } else if (retainFocusFromContext != null) { + retainFocus = retainFocusFromContext; + } + + var focusedItemKeyRef = external_react_default.a.useRef(0); + var itemRefs = []; + var itemKeyCounter = 0; + var firstEnabledItemKey; + var focusedItemKeyIsDisabled = false; + var hasSelectedItems = false; + var hasSelectedEnabledItems = false; + + var handleKeyDown = function handleKeyDown(e) { + // SUI-2734: keeping this active even if controlledExternally is set + // because Firefox + Voiceover (and possibly other a11y tools) + // can still set focus on the Menu items and this avoids the + // whole page scrolling when that happens + var key = Object(keyboard_["keycode"])(e.nativeEvent); + var focusedItemKey = focusedItemKeyRef.current; + var itemToFocusRef; // the "retainFocus" checks here mimic the prior tab key functionality + + if (key === 'down' || retainFocus && Object(focus_["isTabKey"])(e)) { + itemToFocusRef = Object(navigateList["a" /* getNextListItem */])(itemRefs, focusedItemKey, focusedItemKey + 1); + } else if (key === 'up' || retainFocus && Object(focus_["isTabKey"])(e) && e.shiftKey) { + itemToFocusRef = Object(navigateList["b" /* getPrevListItem */])(itemRefs, focusedItemKey, focusedItemKey - 1); + } else if (key === 'home') { + itemToFocusRef = Object(navigateList["a" /* getNextListItem */])(itemRefs, focusedItemKey, 0); + } else if (key === 'end') { + itemToFocusRef = Object(navigateList["b" /* getPrevListItem */])(itemRefs, focusedItemKey, itemRefs.length - 1); + } + + if (itemToFocusRef != null) { + var _itemToFocusRef$curre, _itemToFocusRef$curre2; + + (_itemToFocusRef$curre = itemToFocusRef.current) === null || _itemToFocusRef$curre === void 0 ? void 0 : (_itemToFocusRef$curre2 = _itemToFocusRef$curre.focus) === null || _itemToFocusRef$curre2 === void 0 ? void 0 : _itemToFocusRef$curre2.call(_itemToFocusRef$curre); + e.preventDefault(); + } + }; + + var itemOnFocus = Object(external_react_["useCallback"])(function (e, data) { + var itemKey = data.itemKey; + + if (itemKey != null) { + focusedItemKeyRef.current = itemKey; + } + }, []); + var childrenCleaned = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).reduce(function (acc, item, index, original) { + /* Filter out initial Dividers + * Requires reduce() over filter() because a Heading may have been + * before the Divider. + */ + if (item.type.as === 'Divider' && acc.length === 0) { + return acc; + } // Filter out consecutive Dividers and Headings + // If Divider is next to Heading then it will remove both Heading and Divider unless Heading has title prop set to it + + + if ((item.type.as === 'Heading' || item.type.as === 'Divider') && !item.props.title && item.type.filterConsecutive && original.length > index + 1) { + var consec = original[index + 1]; + + if (consec.type.as === 'Heading' || consec.type.as === 'Divider') { + return acc; + } + } // Filter out last Dividers and Headings + + + if ((item.type.as === 'Divider' || item.type.as === 'Heading') && index === original.length - 1) { + return acc; + } // the filterConsecutive check filters out Headings and Dividers whether styled or not + // the typeof check prevents props from being applied to HTML elements + // such as the zero-height scroll bottom div in + + + if (!(item.type.as === 'Divider' || item.type.as === 'Heading') && typeof item.type !== 'string') { + var _ref2 = /*#__PURE__*/external_react_default.a.createRef(); + + itemRefs.push(_ref2); + + if (firstEnabledItemKey == null && (!('disabled' in item.props) || !item.props.disabled)) { + firstEnabledItemKey = itemKeyCounter; + } + + if (focusedItemKeyRef.current === itemKeyCounter && 'disabled' in item.props && item.props.disabled) { + focusedItemKeyIsDisabled = true; + } + + if ('selected' in item.props && item.props.selected) { + hasSelectedItems = true; + + if ('disabled' in item.props && !item.props.disabled) { + hasSelectedEnabledItems = true; + } + } + + var tabIndex = !controlledExternally && focusedItemKeyRef.current === itemKeyCounter ? undefined : -1; + acc.push( /*#__PURE__*/external_react_default.a.cloneElement(item, { + itemKey: itemKeyCounter, + onFocus: itemOnFocus, + preventFocus: controlledExternally, + ref: function ref(c) { + Object(updateReactRef["a" /* updateReactRef */])(item.ref, c); + Object(updateReactRef["a" /* updateReactRef */])(_ref2, c); + }, + tabIndex: tabIndex + })); + itemKeyCounter += 1; + return acc; + } + + acc.push(item); + return acc; + }, []); + + if (firstEnabledItemKey !== focusedItemKeyRef.current && (!hasSelectedItems || hasSelectedEnabledItems) && focusedItemKeyIsDisabled && firstEnabledItemKey != null) { + focusedItemKeyRef.current = firstEnabledItemKey; + forceUpdate(); + } + + var sharedProps = { + 'data-test': 'menu', + onKeyDown: handleKeyDown, + role: role, + tabIndex: firstEnabledItemKey == null && !controlledExternally ? 0 : undefined + }; + return stopScrollPropagation ? /*#__PURE__*/external_react_default.a.createElement(StyledScroll, Menu_extends({}, sharedProps, { + elementRef: elementRef, + stopScrollPropagation: true + }, omit_default()(otherProps, 'tagName')), childrenCleaned) : /*#__PURE__*/external_react_default.a.createElement(MenuStyles_Styled, Menu_extends({}, sharedProps, { + ref: elementRef + }, otherProps), childrenCleaned); +} + +Menu.propTypes = Menu_propTypes; +Menu.defaultProps = Menu_defaultProps; +Menu.Item = Menu_Item; +Menu.Divider = Menu_Divider; +Menu.Heading = Menu_Heading; +/* harmony default export */ var Menu_Menu = (Menu); + +// CONCATENATED MODULE: ./src/Menu/index.ts + + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 21: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79728); + +/***/ }), + +/***/ 23: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(85015); + +/***/ }), + +/***/ 29: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1027); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 35: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(69564); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 45: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79214); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 57: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_52294__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_52294__.d(__nested_webpack_exports__, "a", function() { return getNextListItem; }); +/* harmony export (binding) */ __nested_webpack_require_52294__.d(__nested_webpack_exports__, "b", function() { return getPrevListItem; }); +// A utility for keyboard navigation of lists +function getNextListItem(refs, currentIndex, nextIndex) { + for (var i = 0; i < refs.length; i += 1) { + var _refs$pointer$current; + + var pointer = (i + nextIndex) % refs.length; + + if (((_refs$pointer$current = refs[pointer].current) === null || _refs$pointer$current === void 0 ? void 0 : _refs$pointer$current.props.disabled) !== true) { + return refs[pointer]; + } + } + + return refs[currentIndex]; +} + +function getPrevListItem(refs, currentIndex, prevIndex) { + for (var i = refs.length; i > 0; i -= 1) { + var _refs$pointer$current2; + + var pointer = (i + prevIndex) % refs.length; + + if (((_refs$pointer$current2 = refs[pointer].current) === null || _refs$pointer$current2 === void 0 ? void 0 : _refs$pointer$current2.props.disabled) !== true) { + return refs[pointer]; + } + } + + return refs[currentIndex]; +} + + + +/***/ }), + +/***/ 58: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73997); + +/***/ }), + +/***/ 63: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63172); + +/***/ }), + +/***/ 68: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(52778); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 75: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25154); + +/***/ }), + +/***/ 77: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39643); + +/***/ }), + +/***/ 86: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(76088); + +/***/ }), + +/***/ 88: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_54335__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_54335__.d(__nested_webpack_exports__, "a", function() { return scrollIntoViewIfNeeded; }); +// A utility that attempts to move an element into view by scrolling it's derived parent. +var scrollIntoViewIfNeeded = function scrollIntoViewIfNeeded(el) { + if (!el) { + return; + } + + var parentEl = el.offsetParent; + + if (!parentEl) { + return; + } // Below the bottom of the container. + + + if (parentEl.scrollTop + parentEl.clientHeight < el.offsetTop + el.clientHeight) { + parentEl.scrollTop = el.offsetTop + el.clientHeight - parentEl.clientHeight; // Above the top of the container. + } else if (parentEl.scrollTop > el.offsetTop) { + parentEl.scrollTop = el.offsetTop; + } +}; + + + +/***/ }), + +/***/ 93: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(43102); + +/***/ }), + +/***/ 94: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(89439); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 57914: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 181); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 100: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96051); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 143: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(58817); + +/***/ }), + +/***/ 181: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4224__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4224__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4224__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Message_Message; }); +__nested_webpack_require_4224__.d(__nested_webpack_exports__, "Link", function() { return /* reexport */ Message_Link; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4224__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4224__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4224__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4224__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-icons/CheckCircle" +var CheckCircle_ = __nested_webpack_require_4224__(70); +var CheckCircle_default = /*#__PURE__*/__nested_webpack_require_4224__.n(CheckCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Cross" +var Cross_ = __nested_webpack_require_4224__(25); +var Cross_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Cross_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close" +var Close_ = __nested_webpack_require_4224__(26); +var Close_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Close_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ExclamationCircle" +var ExclamationCircle_ = __nested_webpack_require_4224__(71); +var ExclamationCircle_default = /*#__PURE__*/__nested_webpack_require_4224__.n(ExclamationCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/InformationCircle" +var InformationCircle_ = __nested_webpack_require_4224__(95); +var InformationCircle_default = /*#__PURE__*/__nested_webpack_require_4224__.n(InformationCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ExclamationTriangle" +var ExclamationTriangle_ = __nested_webpack_require_4224__(96); +var ExclamationTriangle_default = /*#__PURE__*/__nested_webpack_require_4224__.n(ExclamationTriangle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Error" +var Error_ = __nested_webpack_require_4224__(97); +var Error_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Error_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/InfoCircle" +var InfoCircle_ = __nested_webpack_require_4224__(98); +var InfoCircle_default = /*#__PURE__*/__nested_webpack_require_4224__.n(InfoCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Success" +var Success_ = __nested_webpack_require_4224__(99); +var Success_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Success_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Warning" +var Warning_ = __nested_webpack_require_4224__(100); +var Warning_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Warning_); + +// EXTERNAL MODULE: external "@splunk/react-ui/MessageBar" +var MessageBar_ = __nested_webpack_require_4224__(143); +var MessageBar_default = /*#__PURE__*/__nested_webpack_require_4224__.n(MessageBar_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4224__(0); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4224__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4224__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Link" +var Link_ = __nested_webpack_require_4224__(39); +var Link_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Link_); + +// CONCATENATED MODULE: ./src/Message/LinkStyles.ts + + +var StyledLink = external_styled_components_default()(Link_default.a).withConfig({ + displayName: "LinkStyles__StyledLink", + componentId: "w06zjv-0" +})([""]); + +// CONCATENATED MODULE: ./src/Message/Link.tsx +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + openInNewContext: external_prop_types_default.a.bool, + to: external_prop_types_default.a.string +}; + +/** + * @deprecated `Message.Link` is deprecated and will be removed in a future major version. Use `Link` instead. + * + * A `Link` styled to work with `Message`'s `banner` appearance. + */ +function Link(_ref) { + var children = _ref.children, + otherProps = _objectWithoutProperties(_ref, ["children"]); + + // @docs-props-type LinkPropsBase + if (false) {} + + return /*#__PURE__*/external_react_default.a.createElement(StyledLink, otherProps, children); +} + +Link.propTypes = propTypes; +/* harmony default export */ var Message_Link = (Link); +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4224__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4224__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4224__.n(Clickable_); + +// CONCATENATED MODULE: ./src/Message/TitleStyles.ts + + +var StyledTitle = external_styled_components_default.a.p.withConfig({ + displayName: "TitleStyles__StyledTitle", + componentId: "sc-6gbjha-0" +})(["", " ", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["font-size:14px;line-height:20px;"]) +})); + +// CONCATENATED MODULE: ./src/Message/MessageStyles.ts + + + + + +var StyledContent = external_styled_components_default.a.div.withConfig({ + displayName: "MessageStyles__StyledContent", + componentId: "eg66af-0" +})(["", ";", ""], themes_["mixins"].reset('inline'), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive) +})); +var StyledRemove = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "MessageStyles__StyledRemove", + componentId: "eg66af-1" +})(["", ";border:1px solid transparent;border-radius:", ";color:", ";", ";cursor:pointer;position:absolute;", " padding:8px;&:hover,&:focus{background:", ";border:", ";color:", ";}&:active{", ";}", ""], themes_["mixins"].reset('flex'), Object(themes_["pick"])({ + prisma: '50%', + enterprise: themes_["variables"].borderRadius +}), Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorMuted, + enterprise: { + dark: themes_["variables"].gray96, + light: themes_["variables"].gray45 + } +}), function (_ref) { + var $appearance = _ref.$appearance; + return $appearance === 'banner' && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorInverted) + }); +}, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["top:1px;right:2px;"]), + enterprise: Object(external_styled_components_["css"])(["top:6px;right:8px;"]) +}), Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayHover, + enterprise: { + dark: themes_["variables"].gray30, + light: themes_["variables"].gray92 + } +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["1px solid inherit"]), + enterprise: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray80) +}), Object(themes_["pick"])({ + enterprise: { + dark: themes_["variables"].gray96, + light: themes_["variables"].linkColor + }, + prisma: themes_["variables"].contentColorActive +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].interactiveColorOverlayActive), + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadow) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:focus{box-shadow:0 0 0 3px ", ";}"], themes_["variables"].focusColor) +})); +var StyledIconWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "MessageStyles__StyledIconWrapper", + componentId: "eg66af-2" +})(["position:absolute;top:", ";left:0;width:", ";height:calc(100% - 8px);text-align:center;color:", ";", " border-top-left-radius:inherit;border-bottom-left-radius:inherit;", " ", ";"], Object(themes_["pick"])({ + prisma: '0px', + enterprise: '7px' +}), Object(themes_["pick"])({ + prisma: '24px', + enterprise: '25px' +}), themes_["variables"].white, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["padding-top:8px;"]) +}), Object(themes_["pickVariant"])('$type', { + info: Object(external_styled_components_["css"])(["color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorMuted, + enterprise: themes_["variables"].infoColor + })), + success: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].accentColorPositive), + warning: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].accentColorWarning), + error: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].accentColorNegative) +}), function (_ref2) { + var $fillStyle = _ref2.$fillStyle; + return $fillStyle && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pickVariant"])('$type', { + info: themes_["variables"].contentColorActive, + success: themes_["variables"].accentColorPositive, + warning: themes_["variables"].accentColorWarning, + error: themes_["variables"].accentColorNegative + })) + }); +}); +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "MessageStyles__StyledBox", + componentId: "eg66af-3" +})(["", ";position:relative;border-radius:", ";margin-bottom:", ";padding:", ";word-wrap:break-word;", " ", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + prisma: themes_["variables"].borderRadius, + enterprise: '5px' +}), themes_["variables"].spacingSmall, Object(themes_["pickVariant"])('$hasRemoveIcon', { + "true": { + prisma: '10px 40px 10px 28px', + enterprise: '10px 40px 10px 40px' + }, + "false": { + prisma: '10px 8px 10px 28px', + enterprise: '10px 10px 10px 40px' + } +}), function (_ref3) { + var $fillStyle = _ref3.$fillStyle; + return $fillStyle && Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["& > ", "{left:", ";}", ""], + /* sc-sel */ + StyledIconWrapper, themes_["variables"].spacingXSmall, Object(themes_["pickVariant"])('$type', { + info: Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["background-color:", ";border:1px solid ", ";"], themes_["variables"].infoColorL50, themes_["variables"].infoColor), + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].colorWithAlpha(themes_["variables"].infoColor, 0.5)) + })), + success: Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["background-color:", ";border:1px solid ", ";"], themes_["variables"].successColorL50, themes_["variables"].successColor), + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].colorWithAlpha(themes_["variables"].successColor, 0.5)) + })), + warning: Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["background-color:", ";border:1px solid ", ";"], themes_["variables"].warningColorL50, themes_["variables"].warningColor), + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].colorWithAlpha(themes_["variables"].warningColor, 0.5)) + })), + error: Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["background-color:", ";border:1px solid ", ";"], themes_["variables"].errorColorL50, themes_["variables"].errorColor), + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].colorWithAlpha(themes_["variables"].errorColor, 0.5)) + })) + })), + prisma: Object(external_styled_components_["css"])(["border:1px solid transparent;background-color:", ";box-shadow:", ";& > ", "{color:", ";}"], themes_["variables"].backgroundColorPopup, themes_["variables"].embossShadow, + /* sc-sel */ + StyledIconWrapper, themes_["variables"].backgroundColorPopup) + }); +}, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["& ", "{color:", ";}"], + /* sc-sel */ + StyledTitle, Object(themes_["pickVariant"])('$type', { + info: themes_["variables"].contentColorActive, + warning: themes_["variables"].accentColorWarning, + error: themes_["variables"].accentColorNegative, + success: themes_["variables"].accentColorPositive + })) +})); + +// CONCATENATED MODULE: ./src/Message/Title.tsx +function Title_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Title_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Title_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var Title_propTypes = { + children: external_prop_types_default.a.node +}; +/** + * A title component for use in `Message`. + */ + +function Title(_ref) { + var children = _ref.children, + otherProps = Title_objectWithoutProperties(_ref, ["children"]); + + // @docs-props-type TitleProps + return /*#__PURE__*/external_react_default.a.createElement(StyledTitle, otherProps, children); +} + +Title.propTypes = Title_propTypes; +/* harmony default export */ var Message_Title = (Title); +// CONCATENATED MODULE: ./src/Message/Message.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function Message_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Message_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Message_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + + + + + + + + + + +var Message_propTypes = { + appearance: external_prop_types_default.a.oneOf(['default', 'fill', 'banner']), + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + onRequestRemove: external_prop_types_default.a.func, + type: external_prop_types_default.a.oneOf(['info', 'success', 'warning', 'error']) +}; +var enterpriseTypeToIconMap = Object.freeze({ + info: InfoCircle_default.a, + warning: Warning_default.a, + error: Error_default.a, + success: Success_default.a +}); +var prismaTypeToIconMap = Object.freeze({ + info: InformationCircle_default.a, + warning: ExclamationTriangle_default.a, + error: ExclamationCircle_default.a, + success: CheckCircle_default.a +}); + +function Message(_ref) { + var _ref$appearance = _ref.appearance, + appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance, + children = _ref.children, + _ref$type = _ref.type, + type = _ref$type === void 0 ? 'warning' : _ref$type, + onRequestRemove = _ref.onRequestRemove, + otherProps = Message_objectWithoutProperties(_ref, ["appearance", "children", "type", "onRequestRemove"]); + + // @docs-props-type MessagePropsBase + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + if (false) {} // double check this can only be button + + + var handleRemoveClick = Object(external_react_["useCallback"])(function (e) { + onRequestRemove === null || onRequestRemove === void 0 ? void 0 : onRequestRemove(e); + }, [onRequestRemove]); + + if (appearance === 'banner') { + return /*#__PURE__*/external_react_default.a.createElement(MessageBar_default.a, _extends({ + type: type, + "data-test": "banner", + onRequestClose: handleRemoveClick + }, otherProps), children); + } + + var typeToIconMap = isEnterprise ? enterpriseTypeToIconMap : prismaTypeToIconMap; + var Icon = typeToIconMap[type]; + var fillStyle = appearance === 'fill'; + var hasIcon = appearance === 'default' || appearance === 'fill'; + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + $appearance: appearance, + $fillStyle: fillStyle, + $hasRemoveIcon: !!onRequestRemove, + $type: type, + "data-test-type": type, + "data-test": "message" + }, otherProps), hasIcon && /*#__PURE__*/external_react_default.a.createElement(StyledIconWrapper, { + $fillStyle: fillStyle, + $type: type + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Icon, { + height: "24px", + width: "24px", + hideDefaultTooltip: true, + screenReaderText: null + }) : /*#__PURE__*/external_react_default.a.createElement(Icon, { + variant: "filled", + style: { + verticalAlign: 'bottom' + } + })), /*#__PURE__*/external_react_default.a.createElement(StyledContent, { + "data-test": "content", + $fillStyle: fillStyle + }, children), onRequestRemove && /*#__PURE__*/external_react_default.a.createElement(StyledRemove, { + "data-test": "remove", + onClick: handleRemoveClick, + $appearance: appearance + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + height: "12px", + hideDefaultTooltip: true, + screenReaderText: null, + width: "12px" + }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + height: "20px", + width: "20px" + }))); +} + +Message.propTypes = Message_propTypes; +Message.Title = Message_Title; +Message.Link = Message_Link; +/* harmony default export */ var Message_Message = (Message); + +// CONCATENATED MODULE: ./src/Message/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 25: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54719); + +/***/ }), + +/***/ 26: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68787); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 39: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(59421); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 70: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(16363); + +/***/ }), + +/***/ 71: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(31798); + +/***/ }), + +/***/ 95: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90089); + +/***/ }), + +/***/ 96: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(24554); + +/***/ }), + +/***/ 97: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(44673); + +/***/ }), + +/***/ 98: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(17743); + +/***/ }), + +/***/ 99: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(41240); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 58817: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 221); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 100: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96051); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 221: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4324__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4324__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4324__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ MessageBar_MessageBar; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4324__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4324__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4324__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4324__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Cross" +var Cross_ = __nested_webpack_require_4324__(25); +var Cross_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Cross_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close" +var Close_ = __nested_webpack_require_4324__(26); +var Close_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Close_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4324__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4324__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4324__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4324__(4); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4324__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4324__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-icons/CheckCircle" +var CheckCircle_ = __nested_webpack_require_4324__(70); +var CheckCircle_default = /*#__PURE__*/__nested_webpack_require_4324__.n(CheckCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ExclamationCircle" +var ExclamationCircle_ = __nested_webpack_require_4324__(71); +var ExclamationCircle_default = /*#__PURE__*/__nested_webpack_require_4324__.n(ExclamationCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/InformationCircle" +var InformationCircle_ = __nested_webpack_require_4324__(95); +var InformationCircle_default = /*#__PURE__*/__nested_webpack_require_4324__.n(InformationCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ExclamationTriangle" +var ExclamationTriangle_ = __nested_webpack_require_4324__(96); +var ExclamationTriangle_default = /*#__PURE__*/__nested_webpack_require_4324__.n(ExclamationTriangle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Error" +var Error_ = __nested_webpack_require_4324__(97); +var Error_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Error_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/InfoCircle" +var InfoCircle_ = __nested_webpack_require_4324__(98); +var InfoCircle_default = /*#__PURE__*/__nested_webpack_require_4324__.n(InfoCircle_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Success" +var Success_ = __nested_webpack_require_4324__(99); +var Success_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Success_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Warning" +var Warning_ = __nested_webpack_require_4324__(100); +var Warning_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Warning_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4324__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4324__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4324__.n(Clickable_); + +// CONCATENATED MODULE: ./src/MessageBar/MessageBarStyles.ts + + + + + + + + + + + + +var MessageBarContent = external_styled_components_default.a.div.withConfig({ + displayName: "MessageBarStyles__MessageBarContent", + componentId: "sc-1uyhzza-0" +})(["", ";color:inherit;padding:0 8px;text-align:center;margin-right:auto;& a{display:inline-block;color:inherit;text-decoration:underline;text-underline-position:under;padding:0 3px 2px 3px;&:not([disabled]):focus{border-radius:", ";outline:0;box-shadow:", ";}}"], themes_["mixins"].reset('inline'), themes_["variables"].borderRadius, Object(themes_["pick"])({ + enterprise: { + dark: Object(external_styled_components_["css"])(["0 0 0 2px ", ""], themes_["variables"].gray80), + light: Object(external_styled_components_["css"])(["0 0 0 2px ", ""], themes_["variables"].gray25) + }, + prisma: { + light: Object(themes_["pickVariant"])('$type', { + info: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].black), + warning: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].black), + error: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].white), + success: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].white) + }), + dark: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].black) + } +})); +var MessageBarCloseWrapper = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "MessageBarStyles__MessageBarCloseWrapper", + componentId: "sc-1uyhzza-1" +})(["", ";border:1px solid transparent;border-radius:", ";color:inherit;cursor:pointer;padding:", ";", " &:hover,&:focus{background:", ";border:", ";color:", ";}&:active{", ";}", ""], themes_["mixins"].reset('flex'), themes_["variables"].borderRadius, Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingXSmall, + prisma: '3px' +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["margin-top:1px;"]) +}), Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayHover, + enterprise: { + dark: themes_["variables"].gray30, + light: themes_["variables"].gray92 + } +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["1px solid inherit"]), + enterprise: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray80) +}), Object(themes_["pick"])({ + enterprise: { + dark: themes_["variables"].gray96, + light: themes_["variables"].linkColor + } +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background:", ";"], themes_["variables"].interactiveColorOverlayActive), + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadow) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:focus{border-radius:", ";box-shadow:", ";}"], themes_["variables"].borderRadius, Object(themes_["pick"])({ + light: Object(themes_["pickVariant"])('$type', { + info: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].black), + warning: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].black), + error: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].white), + success: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].white) + }), + dark: Object(external_styled_components_["css"])(["0 0 0 3px ", ""], themes_["variables"].black) + })) +})); +var iconCommonStyles = Object(external_styled_components_["css"])(["margin-left:auto;"]); +var StyledCheckCircleIcon = external_styled_components_default()(CheckCircle_default.a).withConfig({ + displayName: "MessageBarStyles__StyledCheckCircleIcon", + componentId: "sc-1uyhzza-2" +})(["", ""], iconCommonStyles); +var StyledExclamationCircleIcon = external_styled_components_default()(ExclamationCircle_default.a).withConfig({ + displayName: "MessageBarStyles__StyledExclamationCircleIcon", + componentId: "sc-1uyhzza-3" +})(["", ""], iconCommonStyles); +var StyledInformationCircleIcon = external_styled_components_default()(InformationCircle_default.a).withConfig({ + displayName: "MessageBarStyles__StyledInformationCircleIcon", + componentId: "sc-1uyhzza-4" +})(["", ""], iconCommonStyles); +var StyledExclamationTriangleIcon = external_styled_components_default()(ExclamationTriangle_default.a).withConfig({ + displayName: "MessageBarStyles__StyledExclamationTriangleIcon", + componentId: "sc-1uyhzza-5" +})(["", ""], iconCommonStyles); +var StyledEnterpriseErrorIcon = external_styled_components_default()(Error_default.a).withConfig({ + displayName: "MessageBarStyles__StyledEnterpriseErrorIcon", + componentId: "sc-1uyhzza-6" +})(["", " color:", ";"], iconCommonStyles, themes_["variables"].errorColor); +var StyledEnterpriseInfoCircleIcon = external_styled_components_default()(InfoCircle_default.a).withConfig({ + displayName: "MessageBarStyles__StyledEnterpriseInfoCircleIcon", + componentId: "sc-1uyhzza-7" +})(["", " color:", ";"], iconCommonStyles, themes_["variables"].infoColor); +var StyledEnterpriseSuccessIcon = external_styled_components_default()(Success_default.a).withConfig({ + displayName: "MessageBarStyles__StyledEnterpriseSuccessIcon", + componentId: "sc-1uyhzza-8" +})(["", " color:", ";"], iconCommonStyles, themes_["variables"].successColor); +var StyledEnterpriseWarningIcon = external_styled_components_default()(Warning_default.a).withConfig({ + displayName: "MessageBarStyles__StyledEnterpriseWarningIcon", + componentId: "sc-1uyhzza-9" +})(["", " color:", ";"], iconCommonStyles, themes_["variables"].warningColor); +var MessageBarWrapper = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "MessageBarStyles__MessageBarWrapper", + componentId: "sc-1uyhzza-10" +})(["", ";display:flex;align-items:center;justify-content:center;min-height:40px;margin-bottom:", ";", ";word-wrap:break-word;color:", ";", ";"], themes_["mixins"].reset('block'), themes_["variables"].spacingSmall, function (_ref) { + var $hasCloseButton = _ref.$hasCloseButton; + return $hasCloseButton ? Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["padding:0 8px 0 32px;"]), + enterprise: Object(external_styled_components_["css"])(["padding:0 8px 0 38px;"]) + })) : Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["padding:0 33px 0 32px;"]), + enterprise: Object(external_styled_components_["css"])(["padding:0 26px 0 32px;"]) + })); +}, Object(themes_["pick"])({ + prisma: Object(themes_["pickVariant"])('$type', { + info: { + light: themes_["variables"].contentColorActive, + dark: themes_["variables"].contentColorInverted + }, + success: themes_["variables"].contentColorInverted, + warning: themes_["variables"].black, + error: themes_["variables"].contentColorInverted + }), + enterprise: { + dark: themes_["variables"].gray96, + light: themes_["variables"].gray25 + } +}), Object(themes_["pickVariant"])('$type', { + info: Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pick"])({ + prisma: { + dark: themes_["variables"].white, + light: themes_["variables"].neutral200 + }, + enterprise: { + dark: themes_["mixins"].colorWithAlpha(themes_["variables"].infoColor, 0.5), + light: themes_["variables"].infoColorL50 + } + })), + success: Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].accentColorPositive, + enterprise: { + dark: themes_["mixins"].colorWithAlpha(themes_["variables"].successColor, 0.5), + light: themes_["variables"].successColorL50 + } + })), + warning: Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].accentColorWarning, + enterprise: { + dark: themes_["mixins"].colorWithAlpha(themes_["variables"].warningColor, 0.5), + light: themes_["variables"].warningColorL50 + } + })), + error: Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].accentColorNegative, + enterprise: { + dark: themes_["mixins"].colorWithAlpha(themes_["variables"].errorColor, 0.5), + light: themes_["variables"].errorColorL50 + } + })) +})); + +// CONCATENATED MODULE: ./src/MessageBar/MessageBar.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + +var propTypes = { + children: external_prop_types_default.a.node.isRequired, + onRequestClose: external_prop_types_default.a.func, + type: external_prop_types_default.a.oneOf(['info', 'success', 'warning', 'error']).isRequired +}; +var TypeToAnnouncementMap = Object.freeze({ + info: Object(i18n_["_"])('Info'), + warning: Object(i18n_["_"])('Warning'), + error: Object(i18n_["_"])('Alert'), + success: Object(i18n_["_"])('Success') +}); +var enterpriseTypeToIconMap = Object.freeze({ + info: StyledEnterpriseInfoCircleIcon, + warning: StyledEnterpriseWarningIcon, + error: StyledEnterpriseErrorIcon, + success: StyledEnterpriseSuccessIcon +}); +var prismaTypeToIconMap = Object.freeze({ + info: StyledInformationCircleIcon, + warning: StyledExclamationTriangleIcon, + error: StyledExclamationCircleIcon, + success: StyledCheckCircleIcon +}); +var standardIconSize = '24px'; + +function MessageBar(_ref) { + var children = _ref.children, + type = _ref.type, + onRequestClose = _ref.onRequestClose, + otherProps = _objectWithoutProperties(_ref, ["children", "type", "onRequestClose"]); + + // @docs-props-type MessageBarPropsBase + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var width = isEnterprise && type === 'error' ? '22px' : standardIconSize; + var height = isEnterprise && type === 'warning' ? '21px' : standardIconSize; + var icon; + + if (isEnterprise) { + var IconType = enterpriseTypeToIconMap[type]; + icon = /*#__PURE__*/external_react_default.a.createElement(IconType, { + height: height, + width: width, + hideDefaultTooltip: true, + screenReaderText: null, + "aria-hidden": true, + "data-test": "icon" + }); + } else { + var _IconType = prismaTypeToIconMap[type]; + icon = /*#__PURE__*/external_react_default.a.createElement(_IconType, { + height: standardIconSize, + width: standardIconSize, + variant: "filled", + "aria-hidden": true, + "data-test": "icon" + }); + } + + return /*#__PURE__*/external_react_default.a.createElement(MessageBarWrapper, _extends({ + $type: type, + "data-test": "message-bar", + "data-test-type": type + }, otherProps, { + role: "region", + $hasCloseButton: Boolean(onRequestClose) + }), icon, /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, TypeToAnnouncementMap[type]), /*#__PURE__*/external_react_default.a.createElement(MessageBarContent, { + $type: type, + "data-test": "content" + }, children), onRequestClose && /*#__PURE__*/external_react_default.a.createElement(MessageBarCloseWrapper, { + $type: type, + onClick: onRequestClose + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + height: "12px", + hideDefaultTooltip: true, + screenReaderText: null, + width: "12px" + }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + height: "19px", + style: { + margin: -0.5 + }, + width: "19px" + }), /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, Object(i18n_["_"])('Close')))); +} + +MessageBar.propTypes = propTypes; +/* harmony default export */ var MessageBar_MessageBar = (MessageBar); +// CONCATENATED MODULE: ./src/MessageBar/index.ts + + + +/***/ }), + +/***/ 25: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54719); + +/***/ }), + +/***/ 26: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68787); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 70: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(16363); + +/***/ }), + +/***/ 71: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(31798); + +/***/ }), + +/***/ 95: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90089); + +/***/ }), + +/***/ 96: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(24554); + +/***/ }), + +/***/ 97: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(44673); + +/***/ }), + +/***/ 98: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(17743); + +/***/ }), + +/***/ 99: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(41240); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 64200: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 173); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 101: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(71883); + +/***/ }), + +/***/ 110: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(37964); + +/***/ }), + +/***/ 173: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4096__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4096__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4096__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Modal_Modal; }); +__nested_webpack_require_4096__.d(__nested_webpack_exports__, "Body", function() { return /* reexport */ Modal_Body; }); +__nested_webpack_require_4096__.d(__nested_webpack_exports__, "Header", function() { return /* reexport */ Modal_Header; }); +__nested_webpack_require_4096__.d(__nested_webpack_exports__, "Footer", function() { return /* reexport */ Modal_Footer; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4096__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4096__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4096__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4096__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/defer" +var defer_ = __nested_webpack_require_4096__(55); +var defer_default = /*#__PURE__*/__nested_webpack_require_4096__.n(defer_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_4096__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_4096__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4096__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4096__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ModalLayer" +var ModalLayer_ = __nested_webpack_require_4096__(101); +var ModalLayer_default = /*#__PURE__*/__nested_webpack_require_4096__.n(ModalLayer_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/focus" +var focus_ = __nested_webpack_require_4096__(29); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4096__(8); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext" +var ScrollContainerContext_ = __nested_webpack_require_4096__(50); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4096__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4096__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4096__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4096__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4096__(0); + +// CONCATENATED MODULE: ./src/Modal/BodyStyles.ts + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "BodyStyles__StyledBox", + componentId: "lv54z7-0" +})(["background-color:", ";", " flex:0 1 auto;overflow:auto;@media all and (-ms-high-contrast:none){*::-ms-backdrop,&{max-height:calc(100vh - 180px);}}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorDialog +}), Object(themes_["pick"])({ + enterprise: { + comfortable: Object(external_styled_components_["css"])(["padding:28px;"]), + compact: Object(external_styled_components_["css"])(["padding:24px;"]) + }, + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:12px 24px;&:first-child{padding-top:36px;}&:last-child{padding-bottom:36px;}"]), + compact: Object(external_styled_components_["css"])(["padding:8px 24px;&:first-child{padding-top:26px;}&:last-child{padding-bottom:26px;}"]) + } +})); + +// CONCATENATED MODULE: ./src/Modal/Body.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +var propTypes = { + children: external_prop_types_default.a.node +}; + +/** + * A styled container for `Modal` body content. + */ +function Body(_ref) { + var children = _ref.children, + otherProps = _objectWithoutProperties(_ref, ["children"]); + + // @docs-props-type BodyPropsBase + var _useState = Object(external_react_["useState"])(), + _useState2 = _slicedToArray(_useState, 2), + scrollContainer = _useState2[0], + setScrollContainer = _useState2[1]; + + var scrollContainerRef = Object(external_react_["useCallback"])(function (el) { + setScrollContainer(el); + }, []); + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + "data-test": "body" + }, otherProps, { + elementRef: scrollContainerRef + }), /*#__PURE__*/external_react_default.a.createElement(ScrollContainerContext_["ScrollContainerProvider"], { + value: scrollContainer + }, children)); +} + +Body.propTypes = propTypes; +/* harmony default export */ var Modal_Body = (Body); +// EXTERNAL MODULE: external "@splunk/react-ui/Divider" +var Divider_ = __nested_webpack_require_4096__(110); +var Divider_default = /*#__PURE__*/__nested_webpack_require_4096__.n(Divider_); + +// CONCATENATED MODULE: ./src/Modal/FooterStyles.ts + + + +var FooterStyles_StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "FooterStyles__StyledBox", + componentId: "yszcmv-0" +})(["flex:0 0 auto;text-align:right;padding:", ";background-color:", ";& > button{min-width:80px;}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacing, + prisma: { + comfortable: '24px', + compact: '18px 24px' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorDialog +})); + +// CONCATENATED MODULE: ./src/Modal/ModalContext.tsx + +var ModalContext = /*#__PURE__*/Object(external_react_["createContext"])({}); +/* harmony default export */ var Modal_ModalContext = (ModalContext); +// CONCATENATED MODULE: ./src/Modal/Footer.tsx +function Footer_extends() { Footer_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Footer_extends.apply(this, arguments); } + +function Footer_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Footer_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Footer_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + +var Footer_propTypes = { + children: external_prop_types_default.a.node +}; + +/** + * A styled container for `Modal` footer content. + */ +function Footer(_ref) { + var children = _ref.children, + otherProps = Footer_objectWithoutProperties(_ref, ["children"]); + + // @docs-props-type FooterPropsBase + var _useContext = Object(external_react_["useContext"])(Modal_ModalContext), + dividerContext = _useContext.divider; + + var hasDivider = dividerContext === 'both' || dividerContext === 'footer'; + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, hasDivider && /*#__PURE__*/external_react_default.a.createElement(Divider_default.a, { + "aria-hidden": true + }), /*#__PURE__*/external_react_default.a.createElement(FooterStyles_StyledBox, Footer_extends({ + "data-test": "footer" + }, otherProps), children)); +} + +Footer.propTypes = Footer_propTypes; +/* harmony default export */ var Modal_Footer = (Footer); +// EXTERNAL MODULE: external "@splunk/react-ui/CloseButton" +var CloseButton_ = __nested_webpack_require_4096__(89); +var CloseButton_default = /*#__PURE__*/__nested_webpack_require_4096__.n(CloseButton_); + +// CONCATENATED MODULE: ./src/Modal/HeaderStyles.ts + + + +var HeaderStyles_StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "HeaderStyles__StyledBox", + componentId: "sc-1y722ut-0" +})(["", ";flex:0 0 auto;position:relative;min-height:", ";background-color:", ";padding:", ";align-items:center;padding-right:", ";"], themes_["mixins"].reset('flex'), Object(themes_["pick"])({ + enterprise: '30px', + prisma: { + comfortable: '60px', + compact: '52px' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorDialog +}), Object(themes_["pick"])({ + enterprise: '25px 28px', + prisma: { + comfortable: '18px 24px', + compact: '14px 24px' + } +}), function (_ref) { + var $close = _ref.$close; + return $close && Object(themes_["pick"])({ + enterprise: '54px', + prisma: { + comfortable: '64px', + compact: '56px' + } + }); +}); +var StyledTitleWrapper = external_styled_components_default.a.div.withConfig({ + displayName: "HeaderStyles__StyledTitleWrapper", + componentId: "sc-1y722ut-1" +})(["", ";flex-direction:column;"], themes_["mixins"].reset('flex')); +var StyledIcon = external_styled_components_default.a.div.withConfig({ + displayName: "HeaderStyles__StyledIcon", + componentId: "sc-1y722ut-2" +})(["", ";align-items:center;justify-content:center;margin-right:", ";", " width:", ";height:", ";flex-shrink:0;"], themes_["mixins"].reset('inline-flex'), themes_["variables"].spacingLarge, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].transparent) +}), Object(themes_["pick"])({ + comfortable: '40px', + compact: '32px' +}), Object(themes_["pick"])({ + comfortable: '40px', + compact: '32px' +})); +var StyledTitle = external_styled_components_default.a.div.withConfig({ + displayName: "HeaderStyles__StyledTitle", + componentId: "sc-1y722ut-3" +})(["", ";font-size:20px;margin:0;overflow-wrap:break-word;font-weight:", ";", ""], themes_["mixins"].reset('block'), themes_["variables"].fontWeightSemiBold, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["line-height:22px;"]), + prisma: Object(external_styled_components_["css"])(["color:", ";line-height:24px;"], themes_["variables"].contentColorActive) +})); +var StyledSubtitle = external_styled_components_default.a.div.withConfig({ + displayName: "HeaderStyles__StyledSubtitle", + componentId: "sc-1y722ut-4" +})(["", ";font-size:14px;overflow-wrap:break-word;line-height:", ";"], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + enterprise: themes_["variables"].lineHeight, + prisma: '20px' +})); +var StyledButtonsWrapper = external_styled_components_default.a.div.withConfig({ + displayName: "HeaderStyles__StyledButtonsWrapper", + componentId: "sc-1y722ut-5" +})(["", ";position:absolute;top:", ";right:", ";bottom:50%;", " max-height:35px;transform-origin:bottom right;transform:rotate(-90deg) translateX(100%);"], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + enterprise: 0, + prisma: { + comfortable: '-2px', + compact: '-6px' + } +}), Object(themes_["pick"])({ + enterprise: 0, + prisma: { + comfortable: '-2px', + compact: '-6px' + } +}), Object(themes_["pick"])({ + prisma: { + comfortable: Object(external_styled_components_["css"])(["min-height:35px;"]), + compact: Object(external_styled_components_["css"])(["min-height:30px;"]) + } +})); +var StyledClose = external_styled_components_default.a.div.withConfig({ + displayName: "HeaderStyles__StyledClose", + componentId: "sc-1y722ut-6" +})(["", ";position:absolute;right:0;top:0;transform:rotate(90deg) translate(-50%,-50%);"], themes_["mixins"].reset('block')); + +// CONCATENATED MODULE: ./src/Modal/Header.tsx +function Header_extends() { Header_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Header_extends.apply(this, arguments); } + +function Header_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Header_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Header_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + +var Header_propTypes = { + children: external_prop_types_default.a.node, + icon: external_prop_types_default.a.node, + onRequestClose: external_prop_types_default.a.func, + subtitle: external_prop_types_default.a.node, + title: external_prop_types_default.a.string +}; + +/** + * A styled container for `Modal` header content. + */ +function Header(_ref) { + var children = _ref.children, + icon = _ref.icon, + onRequestClose = _ref.onRequestClose, + subtitle = _ref.subtitle, + title = _ref.title, + otherProps = Header_objectWithoutProperties(_ref, ["children", "icon", "onRequestClose", "subtitle", "title"]); + + // @docs-props-type StepPropsBase + var _useContext = Object(external_react_["useContext"])(Modal_ModalContext), + titleIdContext = _useContext.titleId, + dividerContext = _useContext.divider; + + var hasDivider = dividerContext === 'both' || dividerContext === 'header'; + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(HeaderStyles_StyledBox, Header_extends({ + $close: !!onRequestClose, + "data-test": "header" + }, otherProps), icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, null, icon), title ? /*#__PURE__*/external_react_default.a.createElement(StyledTitleWrapper, null, title && /*#__PURE__*/external_react_default.a.createElement(StyledTitle, { + id: titleIdContext, + "data-test": "title" + }, title), subtitle && /*#__PURE__*/external_react_default.a.createElement(StyledSubtitle, { + "data-test": "subtitle" + }, subtitle)) : children, onRequestClose && /*#__PURE__*/external_react_default.a.createElement(StyledButtonsWrapper, null, onRequestClose && /*#__PURE__*/external_react_default.a.createElement(StyledClose, null, /*#__PURE__*/external_react_default.a.createElement(CloseButton_default.a, { + onClick: onRequestClose, + "data-test": "close" + })))), hasDivider && /*#__PURE__*/external_react_default.a.createElement(Divider_default.a, { + "aria-hidden": true + })); +} + +Header.propTypes = Header_propTypes; +/* harmony default export */ var Modal_Header = (Header); +// EXTERNAL MODULE: external "react-spring" +var external_react_spring_ = __nested_webpack_require_4096__(24); + +// CONCATENATED MODULE: ./src/Modal/ModalStyles.ts + + + +var Styled = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({ + displayName: "ModalStyles__Styled", + componentId: "sc-5fn8ds-0" +})(["", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";", ""], themes_["mixins"].reset('flex'), themes_["variables"].zindexModal, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:0 1px 5px ", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);"], themes_["variables"].black, themes_["variables"].spacing, themes_["variables"].spacing), + prisma: Object(external_styled_components_["css"])(["box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;"], themes_["variables"].modalShadow, themes_["variables"].spacingXLarge, themes_["variables"].spacingXLarge, themes_["variables"].borderRadius) +})); + +// CONCATENATED MODULE: ./src/Modal/Modal.tsx +function Modal_extends() { Modal_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Modal_extends.apply(this, arguments); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Modal_unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function Modal_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Modal_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Modal_arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Modal_arrayLikeToArray(arr); } + +function Modal_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + +/** @public */ + +var Modal_propTypes = { + children: external_prop_types_default.a.node, + initialFocus: external_prop_types_default.a.oneOfType([external_prop_types_default.a.object, external_prop_types_default.a.oneOf(['first', 'container'])]), + onRequestClose: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + divider: external_prop_types_default.a.oneOf(['header', 'footer', 'both', 'none']) +}; +var defaultProps = { + initialFocus: 'first', + open: false, + divider: 'both' +}; + +var Modal_Modal = /*#__PURE__*/function (_Component) { + _inherits(Modal, _Component); + + var _super = _createSuper(Modal); + + // @docs-props-type ModalPropsBase + // this timeout ensures that the Modal is finished rendering before setting the focus + function Modal(props) { + var _this; + + _classCallCheck(this, Modal); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "el", null); + + _defineProperty(_assertThisInitialized(_this), "initialFocusTimeoutId", undefined); + + _defineProperty(_assertThisInitialized(_this), "initialFocus", null); + + _defineProperty(_assertThisInitialized(_this), "headerTitleId", void 0); + + _defineProperty(_assertThisInitialized(_this), "getDefaultMotionStyle", function () { + return { + top: 0 + }; + }); + + _defineProperty(_assertThisInitialized(_this), "getMotionStyle", function () { + if (_this.props.open) { + return { + top: 40 + }; + } + + return { + top: 0 + }; + }); + + _defineProperty(_assertThisInitialized(_this), "handleInitialFocus", function () { + var _this$props = _this.props, + initialFocus = _this$props.initialFocus, + open = _this$props.open; + + if (open) { + _this.initialFocusTimeoutId = defer_default()(function () { + var focusTarget; // not using the takeFocus() util here because it + // doesn't work for all values of "initialFocus" + // and it has a nested defer() call, which we want to avoid + + if (_this.initialFocus !== initialFocus) { + if (initialFocus === 'first') { + if (_this.el) { + /* eslint-disable prefer-destructuring */ + + /* prefer-desturucting leads to harder-to-read syntax in this case */ + focusTarget = Object(focus_["getSortedTabbableElements"])(_this.el)[0]; + /* eslint-enable prefer-destructuring */ + } + } else if (initialFocus === 'container') { + focusTarget = _this.el; + } else if (_typeof(initialFocus) === 'object') { + focusTarget = initialFocus; + } // Typescript isn't happy with optional chaining here + + + if (focusTarget != null && 'focus' in focusTarget) { + focusTarget.focus(); + } + + _this.initialFocus = initialFocus; + } + }); + } else { + _this.initialFocus = null; + clearTimeout(_this.initialFocusTimeoutId); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleModalMount", function (element) { + _this.el = element; + }); + + _defineProperty(_assertThisInitialized(_this), "handleModalKeyDown", function (e) { + if (_this.el !== null) { + Object(focus_["handleTab"])(_this.el, e.nativeEvent); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (e) { + var _this$props$onRequest, _this$props2; + + _this.initialFocus = null; + (_this$props$onRequest = (_this$props2 = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props2, e); + }); + + _defineProperty(_assertThisInitialized(_this), "renderModal", function (interpolatedStyle) { + var _this$props3 = _this.props, + style = _this$props3.style, + children = _this$props3.children, + divider = _this$props3.divider; + var top = interpolatedStyle.top, + opacity = interpolatedStyle.opacity; + var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]); + return /*#__PURE__*/external_react_default.a.createElement(Styled // eslint-disable-line jsx-a11y/no-noninteractive-element-interactions + , Modal_extends({ + ref: _this.handleModalMount, + "data-test": "modal", + style: _objectSpread(_objectSpread({}, style), {}, { + top: top, + opacity: opacity + }), + tabIndex: -1, + onKeyDown: _this.handleModalKeyDown, + role: "dialog", + "aria-labelledby": _this.headerTitleId + }, omit_default()(_this.props, [].concat(_toConsumableArray(keys_default()(Modal.propTypes)), ['style']))), /*#__PURE__*/external_react_default.a.createElement(Modal_ModalContext.Provider, { + value: { + titleId: _this.headerTitleId, + divider: divider + } + }, clonedChildren)); + }); + + _this.headerTitleId = Object(id_["createDOMID"])('titleId'); + return _this; + } + + _createClass(Modal, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.handleInitialFocus(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var initialFocus = this.props.initialFocus; + + if (prevProps.initialFocus !== initialFocus) { + // cancel the defer() set up in handleInitialFocus() + // so that focus won't jump around if "initialFocus" changes + clearTimeout(this.initialFocusTimeoutId); + } + + this.handleInitialFocus(); + } + }, { + key: "render", + value: function render() { + return /*#__PURE__*/external_react_default.a.createElement(ModalLayer_default.a, { + open: this.props.open, + getDefaultMotionStyle: this.getDefaultMotionStyle, + renderModal: this.renderModal, + getMotionStyle: this.getMotionStyle, + onRequestClose: this.handleRequestClose + }); + } + }]); + + return Modal; +}(external_react_["Component"]); + +_defineProperty(Modal_Modal, "propTypes", Modal_propTypes); + +_defineProperty(Modal_Modal, "defaultProps", defaultProps); + +_defineProperty(Modal_Modal, "Header", Modal_Header); + +_defineProperty(Modal_Modal, "Body", Modal_Body); + +_defineProperty(Modal_Modal, "Footer", Modal_Footer); + +/* harmony default export */ var src_Modal_Modal = (Modal_Modal); + +// CONCATENATED MODULE: ./src/Modal/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 24: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36529); + +/***/ }), + +/***/ 29: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1027); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 50: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25474); + +/***/ }), + +/***/ 55: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64112); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 89: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(241); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 71883: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 222); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 222: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_ModalLayer_ModalLayer; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Animation" +var Animation_ = __nested_webpack_require_3959__(40); + +// EXTERNAL MODULE: external "@splunk/react-ui/Layer" +var Layer_ = __nested_webpack_require_3959__(82); +var Layer_default = /*#__PURE__*/__nested_webpack_require_3959__.n(Layer_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "react-spring" +var external_react_spring_ = __nested_webpack_require_3959__(24); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/ModalLayer/ModalLayerStyles.ts + + + +var overlay = Object(external_styled_components_["css"])(["", ";position:fixed;top:0;right:0;bottom:0;left:0;"], themes_["mixins"].reset('block')); +var StyledClickAwayOverlay = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({ + displayName: "ModalLayerStyles__StyledClickAwayOverlay", + componentId: "sc-1sa3n1j-0" +})(["", ";background-color:", ";z-index:", ";"], overlay, themes_["variables"].backgroundColorScrim, themes_["variables"].zindexModalBackdrop); + +// CONCATENATED MODULE: ./src/ModalLayer/ModalLayer.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + +var propTypes = { + childrenInAnimation: external_prop_types_default.a.bool, + getDefaultMotionStyle: external_prop_types_default.a.func, + getMotionStyle: external_prop_types_default.a.func, + onRequestClose: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + renderModal: external_prop_types_default.a.func.isRequired, + useLayerForClickAway: external_prop_types_default.a.bool +}; +var defaultProps = { + childrenInAnimation: false, + open: false, + useLayerForClickAway: true +}; + +var ModalLayer_ModalLayer = /*#__PURE__*/function (_Component) { + _inherits(ModalLayer, _Component); + + var _super = _createSuper(ModalLayer); + + function ModalLayer(props) { + var _this; + + _classCallCheck(this, ModalLayer); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "allowAnimationUpdates", true); + + _defineProperty(_assertThisInitialized(_this), "handleClickAway", function (event) { + var _this$props$onRequest, _this$props; + + (_this$props$onRequest = (_this$props = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, { + reason: 'clickAway', + event: event + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleAnimationEnd", function () { + if (_this.allowAnimationUpdates) { + _this.setState({ + animating: false + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "renderLayer", function () { + var _this$props2 = _this.props, + getDefaultMotionStyle = _this$props2.getDefaultMotionStyle, + getMotionStyle = _this$props2.getMotionStyle, + renderModal = _this$props2.renderModal, + useLayerForClickAway = _this$props2.useLayerForClickAway; + var open = _this.props.open || _this.state.animating; + return /*#__PURE__*/external_react_default.a.createElement(Animation_["Spring"], { + from: _objectSpread(_objectSpread({}, getDefaultMotionStyle === null || getDefaultMotionStyle === void 0 ? void 0 : getDefaultMotionStyle()), {}, { + overlayOpacity: 0, + opacity: 0 + }), + to: _objectSpread(_objectSpread({}, getMotionStyle === null || getMotionStyle === void 0 ? void 0 : getMotionStyle()), {}, { + overlayOpacity: _this.props.open ? 1 : 0, + opacity: _this.props.open ? 1 : 0 + }), + onRest: _this.handleAnimationEnd + }, function (interpolatedStyle) { + return /*#__PURE__*/external_react_default.a.createElement("div", null, + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + renderModal(interpolatedStyle), open && useLayerForClickAway && /*#__PURE__*/external_react_default.a.createElement(StyledClickAwayOverlay, { + "data-test": "modal-overlay", + onMouseDown: _this.handleClickAway, + key: "clickAway", + style: { + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + opacity: interpolatedStyle.overlayOpacity + } + })); + }); + }); + + _this.state = { + animating: false, + prevOpen: props.open // eslint-disable-line react/no-unused-state + + }; + return _this; + } + + _createClass(ModalLayer, [{ + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.allowAnimationUpdates = false; + } + }, { + key: "render", + + /* eslint-enable jsx-a11y/no-static-element-interactions */ + value: function render() { + var open = this.props.open || this.state.animating || this.props.childrenInAnimation; + return /*#__PURE__*/external_react_default.a.createElement(Layer_default.a, { + open: open, + closeReasons: ['escapeKey'], + onRequestClose: this.props.onRequestClose + }, open && this.renderLayer()); + } + }]); + + return ModalLayer; +}(external_react_["Component"]); + +_defineProperty(ModalLayer_ModalLayer, "propTypes", propTypes); + +_defineProperty(ModalLayer_ModalLayer, "defaultProps", defaultProps); + +_defineProperty(ModalLayer_ModalLayer, "getDerivedStateFromProps", function (props, state) { + if (props.open !== state.prevOpen) { + return { + animating: true, + prevOpen: props.open + }; + } + + return null; +}); + +/* harmony default export */ var src_ModalLayer_ModalLayer = (ModalLayer_ModalLayer); +// CONCATENATED MODULE: ./src/ModalLayer/index.ts + + + +/***/ }), + +/***/ 24: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36529); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 40: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(66991); + +/***/ }), + +/***/ 82: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70564); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 80128: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 184); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 102: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(27386); + +/***/ }), + +/***/ 103: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63375); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4172__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_4172__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 13: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(76646); + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 144: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(58156); + +/***/ }), + +/***/ 145: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(33319); + +/***/ }), + +/***/ 15: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79859); + +/***/ }), + +/***/ 17: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), + +/***/ 18: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5686__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_5686__.d(__nested_webpack_exports__, "a", function() { return getWindow; }); +/* unused harmony export ssrWindow */ +/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_5686__(27); +/* eslint-disable @typescript-eslint/no-empty-function */ + +var ssrWindow = { + document: _ssrDocument__WEBPACK_IMPORTED_MODULE_0__[/* ssrDocument */ "b"], + navigator: { + userAgent: '' + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + }, + history: { + replaceState: function replaceState() {}, + pushState: function pushState() {}, + go: function go() {}, + back: function back() {} + }, + CustomEvent: function CustomEvent() { + return this; + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + getComputedStyle: function getComputedStyle() { + return { + getPropertyValue: function getPropertyValue() { + return ''; + } + }; + }, + Image: function Image() {}, + Date: function Date() {}, + screen: {}, + setTimeout: function setTimeout() {}, + clearTimeout: function clearTimeout() {}, + matchMedia: function matchMedia() { + return {}; + }, + requestAnimationFrame: function requestAnimationFrame(callback) { + if (typeof setTimeout === 'undefined') { + callback(); + return null; + } + + return setTimeout(callback, 0); + }, + cancelAnimationFrame: function cancelAnimationFrame(id) { + if (typeof setTimeout === 'undefined') { + return; + } + + clearTimeout(id); + } +}; + +function getWindow() { + var win = typeof window !== 'undefined' ? window : ssrWindow; + return win; +} + + + +/***/ }), + +/***/ 184: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_7537__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_7537__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_7537__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Multiselect_Multiselect; }); +__nested_webpack_require_7537__.d(__nested_webpack_exports__, "Divider", function() { return /* reexport */ Menu_["Divider"]; }); +__nested_webpack_require_7537__.d(__nested_webpack_exports__, "Heading", function() { return /* reexport */ Menu_["Heading"]; }); +__nested_webpack_require_7537__.d(__nested_webpack_exports__, "Option", function() { return /* reexport */ Multiselect_Option; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_7537__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_7537__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_7537__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_7537__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_7537__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_7537__.n(has_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_7537__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_7537__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_7537__(4); + +// EXTERNAL MODULE: external "@splunk/react-ui/Menu" +var Menu_ = __nested_webpack_require_7537__(13); + +// EXTERNAL MODULE: ./src/Select/OptionBase.tsx +var OptionBase = __nested_webpack_require_7537__(36); + +// CONCATENATED MODULE: ./src/Multiselect/Option.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + +var propTypes = { + /** @private */ + active: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + + /** + * @private this is passed down from Multiselect. + */ + compact: external_prop_types_default.a.bool, + description: external_prop_types_default.a.string, + descriptionPosition: external_prop_types_default.a.oneOf(['right', 'bottom']), + disabled: external_prop_types_default.a.bool, + hidden: external_prop_types_default.a.bool, + icon: external_prop_types_default.a.node, + label: external_prop_types_default.a.string.isRequired, + matchRanges: external_prop_types_default.a.arrayOf(external_prop_types_default.a.shape({ + start: external_prop_types_default.a.number.isRequired, + end: external_prop_types_default.a.number.isRequired + })), + + /** @private */ + onClick: external_prop_types_default.a.func, + + /** @private */ + selected: external_prop_types_default.a.bool, + selectedAppearance: external_prop_types_default.a.oneOf(['info', 'success', 'warning', 'error']), + selectedBackgroundColor: external_prop_types_default.a.string, + selectedForegroundColor: external_prop_types_default.a.string, + truncate: external_prop_types_default.a.bool, + value: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number, external_prop_types_default.a.bool]).isRequired +}; +var defaultProps = { + compact: false, + descriptionPosition: 'bottom', + disabled: false, + selected: false, + truncate: false +}; + +/** + * An option within a `Multiselect`. This inherits from + * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent) + * so any elements passed to it must also be pure. + */ +var Option_Option = /*#__PURE__*/function (_PureComponent) { + _inherits(Option, _PureComponent); + + var _super = _createSuper(Option); + + function Option() { + var _this; + + _classCallCheck(this, Option); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "c", null); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) { + _this.c = c; + }); + + return _this; + } + + _createClass(Option, [{ + key: "scrollIntoViewIfNeeded", + value: function scrollIntoViewIfNeeded() { + var _this$c; + + (_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded(); + } + /** + * Place focus on the button. + */ + + }, { + key: "focus", + value: function focus() { + var _this$c2; + + (_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + compact = _this$props.compact, + otherProps = _objectWithoutProperties(_this$props, ["compact"]); + + return /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], _extends({}, otherProps, { + multiple: compact, + ref: this.handleMount + }), this.props.children || this.props.label); + } + }]); + + return Option; +}(external_react_["PureComponent"]); + +_defineProperty(Option_Option, "propTypes", propTypes); + +_defineProperty(Option_Option, "defaultProps", defaultProps); + +/* harmony default export */ var Multiselect_Option = (Option_Option); +// EXTERNAL MODULE: ./src/Select/SelectBase.tsx + 3 modules +var SelectBase = __nested_webpack_require_7537__(60); + +// CONCATENATED MODULE: ./src/Multiselect/Compact.tsx +function Compact_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Compact_typeof = function _typeof(obj) { return typeof obj; }; } else { Compact_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Compact_typeof(obj); } + +function Compact_extends() { Compact_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Compact_extends.apply(this, arguments); } + +function Compact_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Compact_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Compact_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function Compact_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Compact_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Compact_createClass(Constructor, protoProps, staticProps) { if (protoProps) Compact_defineProperties(Constructor.prototype, protoProps); if (staticProps) Compact_defineProperties(Constructor, staticProps); return Constructor; } + +function Compact_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Compact_setPrototypeOf(subClass, superClass); } + +function Compact_setPrototypeOf(o, p) { Compact_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Compact_setPrototypeOf(o, p); } + +function Compact_createSuper(Derived) { var hasNativeReflectConstruct = Compact_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Compact_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Compact_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Compact_possibleConstructorReturn(this, result); }; } + +function Compact_possibleConstructorReturn(self, call) { if (call && (Compact_typeof(call) === "object" || typeof call === "function")) { return call; } return Compact_assertThisInitialized(self); } + +function Compact_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Compact_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Compact_getPrototypeOf(o) { Compact_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Compact_getPrototypeOf(o); } + +function Compact_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + +var Compact_propTypes = { + allowNewValues: external_prop_types_default.a.bool, + animateLoading: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + controlledFilter: external_prop_types_default.a.bool, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']), + defaultValues: external_prop_types_default.a.array, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + filter: external_prop_types_default.a.oneOf([false, true, 'controlled']), + footerMessage: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + isLoadingOptions: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + loadingMessage: external_prop_types_default.a.node, + menuStyle: external_prop_types_default.a.object, + name: external_prop_types_default.a.string, + noOptionsMessage: external_prop_types_default.a.node, + onChange: external_prop_types_default.a.func, + onClose: external_prop_types_default.a.func, + onFilterChange: external_prop_types_default.a.func, + onOpen: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip']), + showSelectedValuesFirst: external_prop_types_default.a.oneOf(['nextOpen', 'immediately', 'never']), + tabConfirmsNewValue: external_prop_types_default.a.bool, + values: external_prop_types_default.a.array +}; +var Compact_defaultProps = { + allowNewValues: false, + animateLoading: false, + defaultPlacement: 'vertical', + disabled: false, + inline: false, + isLoadingOptions: false, + menuStyle: {}, + noOptionsMessage: Object(i18n_["_"])('No matches'), + placeholder: Object(i18n_["_"])('Select...'), + showSelectedValuesFirst: 'nextOpen', + tabConfirmsNewValue: false +}; // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component + +var Compact_Compact = /*#__PURE__*/function (_Component) { + Compact_inherits(Compact, _Component); + + var _super = Compact_createSuper(Compact); + + function Compact() { + Compact_classCallCheck(this, Compact); + + return _super.apply(this, arguments); + } + + Compact_createClass(Compact, [{ + key: "render", + // @docs-props-type CompactPropsBase + value: function render() { + var _this$props = this.props, + defaultValues = _this$props.defaultValues, + children = _this$props.children, + controlledFilter = _this$props.controlledFilter, + filter = _this$props.filter, + values = _this$props.values, + otherProps = Compact_objectWithoutProperties(_this$props, ["defaultValues", "children", "controlledFilter", "filter", "values"]); + + var finalFilter = true; + + if (filter != null) { + finalFilter = filter; + + if (false) {} + } else { + finalFilter = controlledFilter ? 'controlled' : true; + } + + var convertedProps = { + children: external_react_["Children"].toArray(children).map(function (item) { + if (Object(SelectBase["d" /* isOption */])(item)) { + return /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], Compact_extends({}, item.props, { + multiple: true + })); + } + + return item; + }), + filter: finalFilter + }; + + if (defaultValues != null) { + convertedProps.defaultValues = defaultValues; + } + + if (values != null) { + convertedProps.values = values; + } + + return /*#__PURE__*/external_react_default.a.createElement(SelectBase["c" /* default */], Compact_extends({}, otherProps, convertedProps, { + multiple: true + })); + } + }]); + + return Compact; +}(external_react_["Component"]); + +Compact_defineProperty(Compact_Compact, "propTypes", Compact_propTypes); + +Compact_defineProperty(Compact_Compact, "defaultProps", Compact_defaultProps); + +Compact_defineProperty(Compact_Compact, "Option", Multiselect_Option); + +Compact_defineProperty(Compact_Compact, "Divider", Menu_["Divider"]); + +Compact_defineProperty(Compact_Compact, "Heading", Menu_["Heading"]); + +/* harmony default export */ var Multiselect_Compact = (Compact_Compact); +// EXTERNAL MODULE: external "lodash/defer" +var defer_ = __nested_webpack_require_7537__(55); +var defer_default = /*#__PURE__*/__nested_webpack_require_7537__.n(defer_); + +// EXTERNAL MODULE: external "lodash/extend" +var extend_ = __nested_webpack_require_7537__(49); +var extend_default = /*#__PURE__*/__nested_webpack_require_7537__.n(extend_); + +// EXTERNAL MODULE: external "lodash/get" +var get_ = __nested_webpack_require_7537__(144); +var get_default = /*#__PURE__*/__nested_webpack_require_7537__.n(get_); + +// EXTERNAL MODULE: external "lodash/isString" +var isString_ = __nested_webpack_require_7537__(23); +var isString_default = /*#__PURE__*/__nested_webpack_require_7537__.n(isString_); + +// EXTERNAL MODULE: external "lodash/isUndefined" +var isUndefined_ = __nested_webpack_require_7537__(38); +var isUndefined_default = /*#__PURE__*/__nested_webpack_require_7537__.n(isUndefined_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_7537__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_7537__.n(keys_); + +// EXTERNAL MODULE: external "lodash/last" +var last_ = __nested_webpack_require_7537__(91); +var last_default = /*#__PURE__*/__nested_webpack_require_7537__.n(last_); + +// EXTERNAL MODULE: external "lodash/pick" +var pick_ = __nested_webpack_require_7537__(41); +var pick_default = /*#__PURE__*/__nested_webpack_require_7537__.n(pick_); + +// EXTERNAL MODULE: external "lodash/pickBy" +var pickBy_ = __nested_webpack_require_7537__(61); +var pickBy_default = /*#__PURE__*/__nested_webpack_require_7537__.n(pickBy_); + +// EXTERNAL MODULE: external "lodash/without" +var without_ = __nested_webpack_require_7537__(59); +var without_default = /*#__PURE__*/__nested_webpack_require_7537__.n(without_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/filter" +var filter_ = __nested_webpack_require_7537__(33); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_7537__(8); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_7537__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/Chip" +var Chip_ = __nested_webpack_require_7537__(145); +var Chip_default = /*#__PURE__*/__nested_webpack_require_7537__.n(Chip_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu" +var ResultsMenu_ = __nested_webpack_require_7537__(44); +var ResultsMenu_default = /*#__PURE__*/__nested_webpack_require_7537__.n(ResultsMenu_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Popover" +var Popover_ = __nested_webpack_require_7537__(21); +var Popover_default = /*#__PURE__*/__nested_webpack_require_7537__.n(Popover_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_7537__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_7537__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_7537__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_7537__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_7537__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_7537__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_7537__(0); + +// CONCATENATED MODULE: ./src/Multiselect/NormalStyles.ts + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "NormalStyles__StyledBox", + componentId: "sc-1uwwpco-0" +})(["border-radius:", ";align-items:", ";flex-wrap:wrap;min-height:", ";max-height:300px;overflow-y:auto;border:1px solid ", ";padding:", ";", " ", " ", " ", " ", " &[data-inline]{width:400px;}[data-inline='true'] + &{margin-left:", "}"], themes_["variables"].borderRadius, Object(themes_["pick"])({ + enterprise: 'flex-start', + prisma: 'center' +}), themes_["variables"].inputHeight, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].borderColor + }, + prisma: themes_["variables"].interactiveColorBorder +}), Object(themes_["pick"])({ + enterprise: '2px 0 0 2px', + prisma: '2px' +}), Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].white), + dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].gray22) + } +}), function (_ref) { + var $hasfocus = _ref.$hasfocus; + return $hasfocus && Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].focusShadow), + prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].focusColor) + }); +}, function (_ref2) { + var $error = _ref2.$error; + return $error && Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].accentColorNegative, themes_["variables"].accentColorNegative); +}, function (_ref3) { + var $disabled = _ref3.$disabled, + $hasfocus = _ref3.$hasfocus; + return $disabled ? Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";cursor:not-allowed;"], themes_["variables"].gray96, themes_["variables"].gray92), + dark: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";cursor:not-allowed;"], themes_["variables"].gray22, themes_["variables"].gray30) + }, + prisma: Object(external_styled_components_["css"])(["border-color:", ";cursor:not-allowed;"], themes_["variables"].interactiveColorBorderDisabled) + }) : !$hasfocus && Object(external_styled_components_["css"])(["&:hover{border-color:", ";}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].borderColor, + prisma: themes_["variables"].interactiveColorBorderHover + })); +}, function (_ref4) { + var $popoverOpen = _ref4.$popoverOpen; + return $popoverOpen && Object(external_styled_components_["css"])(["position:relative;z-index:calc(", " - 2);"], themes_["variables"].zindexFixedNavbar); +}, Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: themes_["variables"].spacingSmall +})); +var StyledInputWrapper = external_styled_components_default.a.div.withConfig({ + displayName: "NormalStyles__StyledInputWrapper", + componentId: "sc-1uwwpco-1" +})(["flex:1 0 auto;max-width:100%;"]); +var StyledInput = external_styled_components_default.a.input.withConfig({ + displayName: "NormalStyles__StyledInput", + componentId: "sc-1uwwpco-2" +})(["", ";min-width:100%;max-width:100%;line-height:12px;", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + enterprise: { + comfortable: Object(external_styled_components_["css"])(["padding:", ";"], themes_["variables"].spacingQuarter), + compact: Object(external_styled_components_["css"])(["padding:3px;"]) + }, + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:7px 10px;"]), + compact: Object(external_styled_components_["css"])(["padding:3px;"]) + } +})); +var StyledOverlay = external_styled_components_default.a.div.withConfig({ + displayName: "NormalStyles__StyledOverlay", + componentId: "sc-1uwwpco-3" +})(["", ""], function (_ref5) { + var $popoveropen = _ref5.$popoveropen; + return $popoveropen && Object(external_styled_components_["css"])(["position:fixed;top:0;left:0;width:100%;height:100%;z-index:calc(", " - 2);"], themes_["variables"].zindexFixedNavbar); +}); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_7537__(11); + +// CONCATENATED MODULE: ./src/Multiselect/Normal.tsx +function Normal_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Normal_typeof = function _typeof(obj) { return typeof obj; }; } else { Normal_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Normal_typeof(obj); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Normal_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function Normal_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Normal_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Normal_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function Normal_extends() { Normal_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Normal_extends.apply(this, arguments); } + +function Normal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Normal_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Normal_createClass(Constructor, protoProps, staticProps) { if (protoProps) Normal_defineProperties(Constructor.prototype, protoProps); if (staticProps) Normal_defineProperties(Constructor, staticProps); return Constructor; } + +function Normal_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Normal_setPrototypeOf(subClass, superClass); } + +function Normal_setPrototypeOf(o, p) { Normal_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Normal_setPrototypeOf(o, p); } + +function Normal_createSuper(Derived) { var hasNativeReflectConstruct = Normal_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Normal_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Normal_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Normal_possibleConstructorReturn(this, result); }; } + +function Normal_possibleConstructorReturn(self, call) { if (call && (Normal_typeof(call) === "object" || typeof call === "function")) { return call; } return Normal_assertThisInitialized(self); } + +function Normal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Normal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Normal_getPrototypeOf(o) { Normal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Normal_getPrototypeOf(o); } + +function Normal_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + + + + + + + + + + + + + + +var Normal_propTypes = { + allowNewValues: external_prop_types_default.a.bool, + animateLoading: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + controlledFilter: external_prop_types_default.a.bool, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']), + defaultValues: external_prop_types_default.a.array, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + footerMessage: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + isLoadingOptions: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + loadingMessage: external_prop_types_default.a.node, + menuStyle: external_prop_types_default.a.object, + name: external_prop_types_default.a.string, + noOptionsMessage: external_prop_types_default.a.node, + onChange: external_prop_types_default.a.func, + onClose: external_prop_types_default.a.func, + onFilterChange: external_prop_types_default.a.func, + onOpen: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + + /** @private. */ + required: external_prop_types_default.a.bool, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip']), + tabConfirmsNewValue: external_prop_types_default.a.bool, + useClickawayOverlay: external_prop_types_default.a.bool, + values: external_prop_types_default.a.array +}; +var Normal_defaultProps = { + allowNewValues: false, + animateLoading: false, + defaultPlacement: 'vertical', + disabled: false, + inline: false, + isLoadingOptions: false, + menuStyle: {}, + noOptionsMessage: Object(i18n_["_"])('No matches'), + placeholder: Object(i18n_["_"])('Select...'), + tabConfirmsNewValue: false, + useClickawayOverlay: false +}; // TS: not typed controlled/uncontrolled, handled by Multiselect wrapper component + +var Normal_Normal = /*#__PURE__*/function (_Component) { + Normal_inherits(Normal, _Component); + + var _super = Normal_createSuper(Normal); + + // @docs-props-type NormalPropsBase + function Normal(props) { + var _this; + + Normal_classCallCheck(this, Normal); + + _this = _super.call(this, props); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "activeItemId", void 0); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "activeValue", void 0); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "availableOptionCount", void 0); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "children", void 0); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "controlledExternally", void 0); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "input", null); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "popoverId", void 0); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "previousActiveIndex", null); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleClick", function () { + var _this$input; + + (_this$input = _this.input) === null || _this$input === void 0 ? void 0 : _this$input.focus(); + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleRequestRemove", function (e, _ref) { + var value = _ref.value; + defer_default()(function () { + return _this.removeValue(e, value); + }); // allow the event to bubble before removing. + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleInputFocus", function (e) { + if (_this.state.filterKeyword !== '') { + var _this$props$onFilterC, _this$props; + + (_this$props$onFilterC = (_this$props = _this.props).onFilterChange) === null || _this$props$onFilterC === void 0 ? void 0 : _this$props$onFilterC.call(_this$props, e, { + keyword: '' + }); + } + + _this.setState({ + filterKeyword: '', + hasFocus: true, + open: true + }, function () { + var _this$props$onOpen, _this$props2; + + (_this$props$onOpen = (_this$props2 = _this.props).onOpen) === null || _this$props$onOpen === void 0 ? void 0 : _this$props$onOpen.call(_this$props2); + }); + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleInputKeyDown", function (e) { + var _this$input3, _this$getCurrentValue2; + + var _this$props3 = _this.props, + children = _this$props3.children, + onScrollBottom = _this$props3.onScrollBottom, + tabConfirmsNewValue = _this$props3.tabConfirmsNewValue; + var eventKeyCode = Object(keyboard_["keycode"])(e.nativeEvent); + + if (eventKeyCode === 'tab' && _this.state.open) { + if (tabConfirmsNewValue && !isUndefined_default()(_this.activeValue) && _this.availableOptionCount <= 1) { + var _this$input2; + + e.preventDefault(); + + _this.addValue(e, _this.activeValue); + + (_this$input2 = _this.input) === null || _this$input2 === void 0 ? void 0 : _this$input2.focus(); + } else { + _this.setState({ + open: false + }); + } + } + + if (e.shiftKey || e.metaKey || e.ctrlKey) { + return; + } + + if (eventKeyCode === 'end' && _this.state.open) { + e.preventDefault(); + + _this.setState({ + activeIndex: _this.availableOptionCount - 1 + }); + } + + if (eventKeyCode === 'home' && _this.state.open) { + e.preventDefault(); + + _this.setState({ + activeIndex: 0 + }); + } + + if (eventKeyCode === 'down') { + e.preventDefault(); + + if (_this.state.open) { + _this.setState(function (state) { + return { + activeIndex: Math.min(state.activeIndex + 1, _this.availableOptionCount - 1) + }; + }); + } else { + _this.setState({ + activeIndex: 0, + open: true + }); + } + + if (children && onScrollBottom) { + var _this$getCurrentValue; + + var beforeLastChild = external_react_["Children"].toArray(children).length - (2 + ((_this$getCurrentValue = _this.getCurrentValues()) !== null && _this$getCurrentValue !== void 0 ? _this$getCurrentValue : []).length); + + if (_this.state.activeIndex === beforeLastChild) { + _this.handleScrollBottom(e); + } + } + } + + if (eventKeyCode === 'up') { + e.preventDefault(); + + if (_this.state.open) { + _this.setState(function (state) { + return { + activeIndex: Math.max(state.activeIndex - 1, 0) + }; + }); + } else { + _this.setState({ + activeIndex: 0, + open: true + }); + } + } + + if (eventKeyCode === 'enter' && !isUndefined_default()(_this.activeValue) && _this.state.open) { + _this.addValue(e, _this.activeValue); + } + + if (eventKeyCode === 'backspace' && ((_this$input3 = _this.input) === null || _this$input3 === void 0 ? void 0 : _this$input3.value) === '' && ((_this$getCurrentValue2 = _this.getCurrentValues()) === null || _this$getCurrentValue2 === void 0 ? void 0 : _this$getCurrentValue2.length)) { + _this.removeValue(e, last_default()(_this.getCurrentValues())); + } + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleInputChange", function (e) { + var _this$props$onFilterC2, _this$props4; + + _this.setState({ + filterKeyword: e.target.value, + open: true, + activeIndex: 0 + }); + + (_this$props$onFilterC2 = (_this$props4 = _this.props).onFilterChange) === null || _this$props$onFilterC2 === void 0 ? void 0 : _this$props$onFilterC2.call(_this$props4, e, { + keyword: e.target.value + }); + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleMenuOptionClick", function (e, _ref2) { + var _this$input4; + + var value = _ref2.value; + + _this.addValue(e, value); + + (_this$input4 = _this.input) === null || _this$input4 === void 0 ? void 0 : _this$input4.focus(); + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleInputBlur", function (e) { + var popoverEl = document.getElementById(_this.popoverId); + var blurTo = e.relatedTarget || document.activeElement; // IE11 doesn't support relatedTarget but sets activeElement + + var isBlurToOwnOption = popoverEl && blurTo && popoverEl.contains(blurTo); // TS: target as Node is an unsafe assumption + + _this.setState(function (state) { + return { + filterKeyword: isBlurToOwnOption ? state.filterKeyword : '', + hasFocus: false + }; + }); + + if (!isBlurToOwnOption) { + var _this$props$onFilterC3, _this$props5; + + (_this$props$onFilterC3 = (_this$props5 = _this.props).onFilterChange) === null || _this$props$onFilterC3 === void 0 ? void 0 : _this$props$onFilterC3.call(_this$props5, e, { + keyword: '' + }); + } + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleRequestClose", function (_ref3) { + var _this$state$el; + + var reason = _ref3.reason, + event = _ref3.event; + + if (reason === 'escapeKey' || reason === 'offScreen' || reason === 'clickAway' && event !== undefined && !((_this$state$el = _this.state.el) === null || _this$state$el === void 0 ? void 0 : _this$state$el.contains(event.target)) // TS: target as Node is an unsafe assumption + ) { + _this.setState({ + open: false + }, function () { + var _this$props$onClose, _this$props6; + + _this.previousActiveIndex = null; + (_this$props$onClose = (_this$props6 = _this.props).onClose) === null || _this$props$onClose === void 0 ? void 0 : _this$props$onClose.call(_this$props6); + }); + } + + if (reason === 'escapeKey') { + var _this$input5; + + (_this$input5 = _this.input) === null || _this$input5 === void 0 ? void 0 : _this$input5.focus(); + } + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleScrollBottom", function (e) { + if (_this.state.open && !_this.props.isLoadingOptions) { + var _this$props$onScrollB, _this$props7; + + (_this$props$onScrollB = (_this$props7 = _this.props).onScrollBottom) === null || _this$props$onScrollB === void 0 ? void 0 : _this$props$onScrollB.call(_this$props7, e); + + _this.setState({ + loadingMoreMessage: "".concat(_this.availableOptionCount, " options, loading more options") + }); + } + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleMount", function (el) { + _this.setState({ + el: el + }); + + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleInputMount", function (el) { + _this.input = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.inputRef, el); + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "handleActiveOptionMount", function (c) { + if (_this.previousActiveIndex !== _this.state.activeIndex) { + c === null || c === void 0 ? void 0 : c.scrollIntoViewIfNeeded(); + } + }); + + Normal_defineProperty(Normal_assertThisInitialized(_this), "renderMenu", function (_ref4) { + var anchorWidth = _ref4.anchorWidth, + maxHeight = _ref4.maxHeight, + placement = _ref4.placement; + return /*#__PURE__*/external_react_default.a.createElement(ResultsMenu_default.a, Normal_extends({ + controlledExternally: true, + placement: placement !== null && placement !== void 0 ? placement : undefined, + maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : undefined, + isLoading: _this.props.isLoadingOptions, + onScrollBottom: _this.props.onScrollBottom ? _this.handleScrollBottom : undefined + }, pick_default()(_this.props, 'noOptionsMessage', 'footerMessage', 'animateLoading', 'loadingMessage', 'onScroll'), { + style: extend_default()({ + width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200) + }, _this.props.menuStyle) + }), _this.children); + }); + + _this.state = { + activeIndex: 0, + el: null, + filterKeyword: '', + hasFocus: false, + open: false, + values: props.defaultValues || [], + loadingMoreMessage: '' + }; + _this.availableOptionCount = 0; + _this.children = []; + _this.controlledExternally = has_default()(props, 'values'); + _this.activeItemId = Object(id_["createDOMID"])('active-item'); + _this.popoverId = Object(id_["createDOMID"])('popover'); + + if (false) {} + + if (false) {} + + return _this; + } + + Normal_createClass(Normal, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (false) {} + + if (false) {} + + this.previousActiveIndex = prevState.activeIndex; + + if (this.isControlled() && prevProps.values !== this.props.values) { + // eslint-disable-next-line react/no-did-update-set-state + this.setState({ + filterKeyword: '', + activeIndex: 0 + }); + } + } + }, { + key: "getCurrentValues", + value: function getCurrentValues() { + return this.isControlled() ? this.props.values : this.state.values; + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + /** + * Place focus on the text input. + */ + + }, { + key: "focus", + value: function focus() { + if (this.input) { + this.input.focus(); + } + } + }, { + key: "addValue", + value: function addValue(e, value) { + var _this$getCurrentValue3, _this$props$onChange, _this$props8; + + var values = ((_this$getCurrentValue3 = this.getCurrentValues()) !== null && _this$getCurrentValue3 !== void 0 ? _this$getCurrentValue3 : []).concat([value]); + var name = this.props.name; + + if (!this.isControlled()) { + this.setState({ + values: values, + activeIndex: 0, + open: true, + filterKeyword: '' + }); + } + + (_this$props$onChange = (_this$props8 = this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props8, e, { + values: values, + name: name + }); + } + }, { + key: "removeValue", + value: function removeValue(e, value) { + var _this$props$onChange2, _this$props9; + + var values = without_default()(this.getCurrentValues(), value); + var name = this.props.name; + + if (!this.isControlled()) { + this.setState({ + values: values + }); + } + + (_this$props$onChange2 = (_this$props9 = this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props9, e, { + values: values, + name: name + }); + } + }, { + key: "renderButtons", + value: function renderButtons(selectedItems) { + var _this2 = this; + + // selectedItems may contain items or unmatched values at this point + return selectedItems.map(function (selectedItem) { + var item = selectedItem; // TS: faking props here + + return /*#__PURE__*/external_react_default.a.createElement(Chip_default.a, { + "aria-selected": true, + disabled: _this2.props.disabled, + icon: item.props ? item.props.icon : undefined, + key: (item.props ? item.props.value : item).toString(), + "data-test": "selected-option", + onRequestRemove: _this2.handleRequestRemove, + role: "option", + value: item.props ? item.props.value : item, + appearance: item.props ? item.props.selectedAppearance : undefined, + backgroundColor: item.props ? item.props.selectedBackgroundColor : undefined, + foregroundColor: item.props ? item.props.selectedForegroundColor : undefined + }, /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, item.props ? item.props.children || item.props.label : item)); + }); + } + }, { + key: "render", + value: function render() { + var _this$getCurrentValue4, + _this3 = this; + + var _this$props10 = this.props, + allowNewValues = _this$props10.allowNewValues, + children = _this$props10.children, + controlledFilter = _this$props10.controlledFilter, + defaultPlacement = _this$props10.defaultPlacement, + describedBy = _this$props10.describedBy, + disabled = _this$props10.disabled, + error = _this$props10.error, + inline = _this$props10.inline, + inputId = _this$props10.inputId, + labelledBy = _this$props10.labelledBy, + placeholder = _this$props10.placeholder, + required = _this$props10.required, + repositionMode = _this$props10.repositionMode, + useClickawayOverlay = _this$props10.useClickawayOverlay, + otherProps = Normal_objectWithoutProperties(_this$props10, ["allowNewValues", "children", "controlledFilter", "defaultPlacement", "describedBy", "disabled", "error", "inline", "inputId", "labelledBy", "placeholder", "required", "repositionMode", "useClickawayOverlay"]); + + var ariaProps = _objectSpread(_objectSpread({}, pickBy_default()(otherProps, function (val, key) { + return key === 'role' || key.indexOf('aria-') === 0; + })), {}, { + 'aria-describedby': describedBy, + 'aria-labelledby': labelledBy, + 'aria-invalid': error || undefined + }); + + var subsetAriaProps = _objectSpread({}, pickBy_default()(otherProps, function (val, key) { + return key === 'aria-label' || key === 'aria-describedby'; + })); + + var currentValues = (_this$getCurrentValue4 = this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : []; + var selectedItems = currentValues.slice(0); + var foundExactMatch = currentValues.indexOf(this.state.filterKeyword) >= 0; // Map Options to selected values + + if (currentValues && currentValues.length) { + external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).filter(function (item) { + return item.type === Multiselect_Option; + }).forEach(function (item) { + if (item.type === Multiselect_Option) { + var selectedIndex = currentValues.indexOf(item.props.value); + + if (selectedIndex !== -1) { + selectedItems[selectedIndex] = item; + } + } + }); + } // Filter the items + + + var keywords = Object(filter_["stringToKeywords"])(this.state.filterKeyword); + var childrenFiltered = controlledFilter ? external_react_["Children"].toArray(children) : // ensure consistent keys + external_react_["Children"].toArray(children).filter(function (option) { + if (get_default()(option, ['props', 'label'], false)) { + return Object(filter_["testPhrase"])(option.props.label, keywords); + } + + return true; // Keep all headers and non-interactive options + }); + this.availableOptionCount = 0; + this.activeValue = undefined; + this.children = external_react_["Children"].map(childrenFiltered, function (childrenItem, i) { + if (!childrenItem.props || !has_default()(childrenItem.props, 'value')) { + // ignore Headings and Dividers + return childrenItem; + } + + var item = childrenItem; // find out if the search string exactly matches a value + + if (item.props.value === _this3.state.filterKeyword) { + foundExactMatch = true; + } // remove items that are already selected + + + var selectedIndex = currentValues.indexOf(item.props.value); + + if (selectedIndex >= 0) { + return null; + } // highlight matched text + + + var _item$props = item.props, + itemChildren = _item$props.children, + label = _item$props.label, + matchRanges = _item$props.matchRanges; + var itemSupportsMatchRanges = itemChildren === undefined || isString_default()(itemChildren); + var matchRangesCalc = itemSupportsMatchRanges && !controlledFilter && !matchRanges && keywords && Object(filter_["keywordLocations"])(label, keywords); // clone item + + var clonedItem = /*#__PURE__*/Object(external_react_["cloneElement"])(item, { + key: i, + onClick: _this3.handleMenuOptionClick, + matchRanges: itemSupportsMatchRanges && (matchRanges || matchRangesCalc) || undefined + }); + return clonedItem; + }).filter(function (item) { + return item !== null; + }); // Add the option to add the new value + + if (allowNewValues && !foundExactMatch && this.state.filterKeyword) { + this.children.unshift( /*#__PURE__*/external_react_default.a.createElement(Multiselect_Option, { + label: "".concat(this.state.filterKeyword), + description: Object(i18n_["_"])('(New value)'), + descriptionPosition: "right", + value: this.state.filterKeyword, + key: "newValue", + onClick: this.handleMenuOptionClick + })); + } + + if (this.state.open) { + // highlight the selected Item + this.children = external_react_["Children"].map(this.children, function (childrenItem) { + if (!childrenItem.props || !has_default()(childrenItem.props, 'value')) { + // ignore Headings and Dividers + return childrenItem; + } + + var item = childrenItem; + var active = _this3.availableOptionCount === _this3.state.activeIndex; + _this3.availableOptionCount += 1; + + if (!active) { + return item; + } + + if (!item.props.disabled) { + _this3.activeValue = item.props.value; + } + + var clonedItem = /*#__PURE__*/Object(external_react_["cloneElement"])(item, { + active: active, + id: _this3.activeItemId, + ref: _this3.handleActiveOptionMount + }); + return clonedItem; + }); + } + + var inputWidth = "".concat(this.state.filterKeyword.length * 0.8, "em"); + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(StyledBox, Normal_extends({ + key: "control", + "data-test-values": JSON.stringify(currentValues), + inline: inline, + $hasfocus: this.state.hasFocus + }, omit_default.a.apply(void 0, [otherProps, 'animateLoading', 'controlledFilter', 'defaultValues', 'footerMessage', 'inputRef', 'isLoadingOptions', 'labelledBy', 'menuStyle', 'noOptionsMessage', 'onChange', 'onFilterChange', 'onScroll', 'onScrollBottom', 'onClose', 'onOpen', 'values', 'useClickawayOverlay'].concat(_toConsumableArray(keys_default()(ariaProps)))), { + onClick: disabled ? undefined : this.handleClick, + $disabled: disabled, + $error: error, + "data-test-popover-id": this.popoverId, + $popoverOpen: this.state.open, + flex: true, + elementRef: this.handleMount, + role: "listbox", + "aria-disabled": disabled || undefined, + "aria-labelledby": labelledBy, + "aria-invalid": error, + "aria-multiselectable": "true" + }, subsetAriaProps), this.renderButtons(selectedItems), !disabled && /*#__PURE__*/external_react_default.a.createElement(StyledInputWrapper, { + role: "combobox", + "aria-owns": this.state.open ? this.popoverId : undefined, + "aria-haspopup": true, + "aria-expanded": this.state.open, + "aria-controls": this.state.open ? this.popoverId : undefined + }, /*#__PURE__*/external_react_default.a.createElement(StyledInput, Normal_extends({ + "data-test": "textbox", + id: inputId, + ref: this.handleInputMount, + onBlur: this.handleInputBlur, + onFocus: this.handleInputFocus, + onChange: this.handleInputChange, + onKeyDown: this.handleInputKeyDown, + value: this.state.filterKeyword, + autoCapitalize: "off", + autoComplete: "off", + autoCorrect: "off", + spellCheck: false, + "aria-autocomplete": "list", + style: { + flexBasis: inputWidth, + width: inputWidth + }, + placeholder: currentValues.length ? '' : placeholder, + required: required, + "aria-activedescendant": this.state.open && this.availableOptionCount > 0 ? this.activeItemId : undefined + }, ariaProps))), !disabled && /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, { + open: this.state.open && !!this.state.el, + autoCloseWhenOffScreen: true, + anchor: this.state.el, + onRequestClose: this.handleRequestClose, + canCoverAnchor: false, + defaultPlacement: defaultPlacement, + repositionMode: repositionMode, + id: this.popoverId + }, this.renderMenu)), /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, { + role: "status", + "aria-live": "polite" + }, this.state.loadingMoreMessage), useClickawayOverlay && this.state.open ? /*#__PURE__*/external_react_default.a.createElement(StyledOverlay, { + key: "overlay", + $popoveropen: this.state.open, + "data-test": "overlay" + }) : null); + } + }]); + + return Normal; +}(external_react_["Component"]); + +Normal_defineProperty(Normal_Normal, "propTypes", Normal_propTypes); + +Normal_defineProperty(Normal_Normal, "defaultProps", Normal_defaultProps); + +Normal_defineProperty(Normal_Normal, "Option", Multiselect_Option); + +Normal_defineProperty(Normal_Normal, "Divider", Menu_["Divider"]); + +Normal_defineProperty(Normal_Normal, "Heading", Menu_["Heading"]); + +/* harmony default export */ var Multiselect_Normal = (Normal_Normal); +// CONCATENATED MODULE: ./src/Multiselect/Multiselect.tsx +function Multiselect_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Multiselect_typeof = function _typeof(obj) { return typeof obj; }; } else { Multiselect_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Multiselect_typeof(obj); } + +function Multiselect_extends() { Multiselect_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Multiselect_extends.apply(this, arguments); } + +function Multiselect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Multiselect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Multiselect_createClass(Constructor, protoProps, staticProps) { if (protoProps) Multiselect_defineProperties(Constructor.prototype, protoProps); if (staticProps) Multiselect_defineProperties(Constructor, staticProps); return Constructor; } + +function Multiselect_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Multiselect_setPrototypeOf(subClass, superClass); } + +function Multiselect_setPrototypeOf(o, p) { Multiselect_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Multiselect_setPrototypeOf(o, p); } + +function Multiselect_createSuper(Derived) { var hasNativeReflectConstruct = Multiselect_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Multiselect_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Multiselect_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Multiselect_possibleConstructorReturn(this, result); }; } + +function Multiselect_possibleConstructorReturn(self, call) { if (call && (Multiselect_typeof(call) === "object" || typeof call === "function")) { return call; } return Multiselect_assertThisInitialized(self); } + +function Multiselect_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Multiselect_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Multiselect_getPrototypeOf(o) { Multiselect_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Multiselect_getPrototypeOf(o); } + +function Multiselect_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + +var Multiselect_propTypes = { + allowNewValues: external_prop_types_default.a.bool, + animateLoading: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + compact: external_prop_types_default.a.bool, + controlledFilter: external_prop_types_default.a.bool, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']), + defaultValues: external_prop_types_default.a.array, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + filter: external_prop_types_default.a.oneOf([false, true, 'controlled']), + footerMessage: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + isLoadingOptions: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + loadingMessage: external_prop_types_default.a.node, + menuStyle: external_prop_types_default.a.object, + name: external_prop_types_default.a.string, + noOptionsMessage: external_prop_types_default.a.node, + onChange: external_prop_types_default.a.func, + onClose: external_prop_types_default.a.func, + onFilterChange: external_prop_types_default.a.func, + onOpen: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip']), + showSelectedValuesFirst: external_prop_types_default.a.oneOf(['nextOpen', 'immediately', 'never']), + tabConfirmsNewValue: external_prop_types_default.a.bool, + useClickawayOverlay: external_prop_types_default.a.bool, + values: external_prop_types_default.a.array +}; +var Multiselect_defaultProps = { + allowNewValues: false, + animateLoading: false, + compact: false, + defaultPlacement: 'vertical', + disabled: false, + inline: false, + isLoadingOptions: false, + menuStyle: {}, + noOptionsMessage: Object(i18n_["_"])('No matches'), + placeholder: Object(i18n_["_"])('Select...'), + repositionMode: 'flip', + tabConfirmsNewValue: false, + useClickawayOverlay: false +}; + +function isCompact(props) { + return props && props.compact === true; +} + +var Multiselect_Multiselect = /*#__PURE__*/function (_Component) { + Multiselect_inherits(Multiselect, _Component); + + var _super = Multiselect_createSuper(Multiselect); + + function Multiselect() { + Multiselect_classCallCheck(this, Multiselect); + + return _super.apply(this, arguments); + } + + Multiselect_createClass(Multiselect, [{ + key: "render", + // @docs-props-type MultiselectPropsBase + // TODO: SUI-3402, this can be removed when ControlGroup no longer needs to inspect componentType + value: function render() { + if (isCompact(this.props)) { + return /*#__PURE__*/external_react_default.a.createElement(Multiselect_Compact, Multiselect_extends({ + "data-test": "multiselect" + }, omit_default()(this.props, 'compact'))); + } + + if (false) {} + + return /*#__PURE__*/external_react_default.a.createElement(Multiselect_Normal, Multiselect_extends({ + "data-test": "multiselect" + }, omit_default()(this.props, 'compact'))); + } + }]); + + return Multiselect; +}(external_react_["Component"]); + +Multiselect_defineProperty(Multiselect_Multiselect, "propTypes", Multiselect_propTypes); + +Multiselect_defineProperty(Multiselect_Multiselect, "defaultProps", Multiselect_defaultProps); + +Multiselect_defineProperty(Multiselect_Multiselect, "componentType", 'Multiselect'); + +Multiselect_defineProperty(Multiselect_Multiselect, "Option", Multiselect_Option); + +Multiselect_defineProperty(Multiselect_Multiselect, "Heading", Menu_["Heading"]); + +Multiselect_defineProperty(Multiselect_Multiselect, "Divider", Menu_["Divider"]); + +/* harmony default export */ var src_Multiselect_Multiselect = (Multiselect_Multiselect); + +// CONCATENATED MODULE: ./src/Multiselect/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 21: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79728); + +/***/ }), + +/***/ 22: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73592); + +/***/ }), + +/***/ 23: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(85015); + +/***/ }), + +/***/ 27: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_75193__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_75193__.d(__nested_webpack_exports__, "a", function() { return getDocument; }); +/* harmony export (binding) */ __nested_webpack_require_75193__.d(__nested_webpack_exports__, "b", function() { return ssrDocument; }); +/* eslint-disable @typescript-eslint/no-empty-function */ +var ssrDocument = { + body: { + appendChild: function appendChild() { + return []; + } + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + activeElement: { + blur: function blur() {}, + nodeName: '' + }, + querySelector: function querySelector() { + return null; + }, + querySelectorAll: function querySelectorAll() { + return []; + }, + getElementById: function getElementById() { + return null; + }, + createEvent: function createEvent() { + return { + initEvent: function initEvent() {} + }; + }, + createElement: function createElement() { + return { + children: [], + childNodes: [], + style: {}, + setAttribute: function setAttribute() {}, + getElementsByTagName: function getElementsByTagName() { + return []; + } + }; + }, + createElementNS: function createElementNS() { + return {}; + }, + importNode: function importNode() { + return null; + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } +}; + +function getDocument() { + var doc = typeof document !== 'undefined' ? document : ssrDocument; + return doc; +} + + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 30: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25338); + +/***/ }), + +/***/ 33: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(23601); + +/***/ }), + +/***/ 36: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_77158__) { + +"use strict"; +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_77158__(2); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_77158__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_77158__(1); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_77158__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_77158__(13); +/* harmony import */ var _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_77158__.n(_splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + +var propTypes = { + /** @private */ + active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, + description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, + descriptionPosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['right', 'bottom']), + disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + hidden: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, + label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, + + /** + * @private Passed down from + */ + multiple: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + matchRanges: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ + start: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, + end: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired + })), + + /** @private */ + onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, + + /** @private */ + selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + truncate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool]).isRequired +}; +var defaultProps = { + descriptionPosition: 'bottom', + disabled: false, + multiple: false, + selected: false, + truncate: false +}; + +/** + * An option within a `Multiselect`. This inherits from + * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent) + * so any elements passed to it must also be pure. + */ +var Option = /*#__PURE__*/function (_PureComponent) { + _inherits(Option, _PureComponent); + + var _super = _createSuper(Option); + + function Option() { + var _this; + + _classCallCheck(this, Option); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "c", null); + + _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props = _this.props, + onClick = _this$props.onClick, + value = _this$props.value, + disabled = _this$props.disabled; + + if (!disabled) { + onClick === null || onClick === void 0 ? void 0 : onClick(e, { + value: value + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) { + _this.c = c; + }); + + return _this; + } + + _createClass(Option, [{ + key: "scrollIntoViewIfNeeded", + value: function scrollIntoViewIfNeeded() { + var _this$c; + + (_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded(); + } + /** + * Place focus on the button. + */ + + }, { + key: "focus", + value: function focus() { + var _this$c2; + + (_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + value = _this$props2.value, + children = _this$props2.children, + label = _this$props2.label, + multiple = _this$props2.multiple, + otherProps = _objectWithoutProperties(_this$props2, ["value", "children", "label", "multiple"]); + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"], _extends({ + "aria-selected": this.props.selected, + "data-test-value": value, + "data-test": "option", + ref: this.handleMount + }, otherProps, { + selectable: true, + selectableAppearance: multiple ? 'checkbox' : undefined, + onClick: this.handleClick, + role: "option", + value: value.toString() + }), children || label); + } + }]); + + return Option; +}(react__WEBPACK_IMPORTED_MODULE_0__["PureComponent"]); + +_defineProperty(Option, "propTypes", propTypes); + +_defineProperty(Option, "defaultProps", defaultProps); + +_defineProperty(Option, "type", _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"]); + +/* harmony default export */ __nested_webpack_exports__["a"] = (Option); + +/***/ }), + +/***/ 38: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(62216); + +/***/ }), + +/***/ 39: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(59421); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 41: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(44383); + +/***/ }), + +/***/ 44: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(80436); + +/***/ }), + +/***/ 46: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(80935); + +/***/ }), + +/***/ 49: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(43346); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 51: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(75795); + +/***/ }), + +/***/ 52: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7309); + +/***/ }), + +/***/ 53: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32305); + +/***/ }), + +/***/ 54: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40828); + +/***/ }), + +/***/ 55: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64112); + +/***/ }), + +/***/ 56: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_88265__) { + +"use strict"; +/* unused harmony export charFromMatchOption */ +/* harmony export (binding) */ __nested_webpack_require_88265__.d(__nested_webpack_exports__, "a", function() { return fuzzyMatch; }); +// A utility for matching keyboard characters to list values +var charFromMatchOption = function charFromMatchOption(option, charIndex) { + return option ? option.label.charAt(charIndex).toLowerCase() : ''; +}; + +var fuzzyMatch = function fuzzyMatch(options, matchChar) { + if (!options.length) { + return options; + } + + var defaultMatch = null; + var hasMatch = false; + var matches = options.filter(function (option) { + var characterValue = charFromMatchOption(option, matchChar.index); + + if (characterValue === matchChar.value) { + hasMatch = true; + return true; + } // If we haven't found a match yet, keep track of the next closest match. + // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value. + + + if (!hasMatch) { + var defaultValue = charFromMatchOption(defaultMatch, matchChar.index); + + if (!defaultValue) { + defaultMatch = option; + } else if (characterValue > matchChar.value) { + if (defaultValue < matchChar.value) { + defaultMatch = option; + } else if (defaultValue > characterValue) { + defaultMatch = option; + } + } else if (characterValue > defaultValue) { + defaultMatch = option; + } + } + + return false; + }); + return matches.length === 0 && defaultMatch ? [defaultMatch] : matches; +}; + + + +/***/ }), + +/***/ 59: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(91648); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 60: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_90109__) { + +"use strict"; + +// EXPORTS +__nested_webpack_require_90109__.d(__nested_webpack_exports__, "a", function() { return /* reexport */ Menu_["Divider"]; }); +__nested_webpack_require_90109__.d(__nested_webpack_exports__, "b", function() { return /* reexport */ Menu_["Heading"]; }); +__nested_webpack_require_90109__.d(__nested_webpack_exports__, "d", function() { return /* binding */ isOption; }); + +// UNUSED EXPORTS: Option + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_90109__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_90109__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_90109__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_90109__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/castArray" +var castArray_ = __nested_webpack_require_90109__(65); +var castArray_default = /*#__PURE__*/__nested_webpack_require_90109__.n(castArray_); + +// EXTERNAL MODULE: external "lodash/find" +var find_ = __nested_webpack_require_90109__(52); +var find_default = /*#__PURE__*/__nested_webpack_require_90109__.n(find_); + +// EXTERNAL MODULE: external "lodash/forEachRight" +var forEachRight_ = __nested_webpack_require_90109__(102); +var forEachRight_default = /*#__PURE__*/__nested_webpack_require_90109__.n(forEachRight_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_90109__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_90109__.n(has_); + +// EXTERNAL MODULE: external "lodash/includes" +var includes_ = __nested_webpack_require_90109__(15); +var includes_default = /*#__PURE__*/__nested_webpack_require_90109__.n(includes_); + +// EXTERNAL MODULE: external "lodash/isUndefined" +var isUndefined_ = __nested_webpack_require_90109__(38); +var isUndefined_default = /*#__PURE__*/__nested_webpack_require_90109__.n(isUndefined_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_90109__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_90109__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_90109__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_90109__.n(omit_); + +// EXTERNAL MODULE: external "lodash/pick" +var pick_ = __nested_webpack_require_90109__(41); +var pick_default = /*#__PURE__*/__nested_webpack_require_90109__.n(pick_); + +// EXTERNAL MODULE: external "lodash/uniq" +var uniq_ = __nested_webpack_require_90109__(103); +var uniq_default = /*#__PURE__*/__nested_webpack_require_90109__.n(uniq_); + +// EXTERNAL MODULE: external "lodash/without" +var without_ = __nested_webpack_require_90109__(59); +var without_default = /*#__PURE__*/__nested_webpack_require_90109__.n(without_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_90109__(8); + +// EXTERNAL MODULE: external "@splunk/react-ui/Menu" +var Menu_ = __nested_webpack_require_90109__(13); + +// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown" +var Dropdown_ = __nested_webpack_require_90109__(22); +var Dropdown_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Dropdown_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_90109__(7); + +// EXTERNAL MODULE: external "@splunk/ui-utils/filter" +var filter_ = __nested_webpack_require_90109__(33); + +// EXTERNAL MODULE: external "@splunk/react-ui/Link" +var Link_ = __nested_webpack_require_90109__(39); +var Link_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Link_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu" +var ResultsMenu_ = __nested_webpack_require_90109__(44); +var ResultsMenu_default = /*#__PURE__*/__nested_webpack_require_90109__.n(ResultsMenu_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Text" +var Text_ = __nested_webpack_require_90109__(30); +var Text_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Text_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_90109__(4); + +// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown" +var CaretSmallDown_ = __nested_webpack_require_90109__(53); +var CaretSmallDown_default = /*#__PURE__*/__nested_webpack_require_90109__.n(CaretSmallDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret" +var Caret_ = __nested_webpack_require_90109__(54); +var Caret_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Caret_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_90109__(0); + +// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx + + + + + +var CaretSmallDown_CaretSmallDownIcon = function CaretSmallDownIcon() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var familyCaretSmallDownIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, { + screenReaderText: null, + hideDefaultTooltip: true, + size: 0.5 + }) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, null); + return familyCaretSmallDownIcon; +}; + +/* harmony default export */ var CaretSmallDown = (CaretSmallDown_CaretSmallDownIcon); +// EXTERNAL MODULE: ./src/Select/OptionBase.tsx +var OptionBase = __nested_webpack_require_90109__(36); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search" +var Search_ = __nested_webpack_require_90109__(51); +var Search_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Search_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier" +var Magnifier_ = __nested_webpack_require_90109__(46); +var Magnifier_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Magnifier_); + +// CONCATENATED MODULE: ./src/Select/icons/Search.tsx + + + + + + +var Search_Search = function Search() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise, + isCompact = _useSplunkTheme.isCompact; + + var screenReaderText = Object(i18n_["_"])('Search'); + + var prismaSize = isCompact ? '20px' : '24px'; + var familyIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, { + role: "presentation", + size: "16px", + screenReaderText: screenReaderText, + hideDefaultTooltip: true + }) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, { + role: "presentation", + "aria-label": screenReaderText, + width: prismaSize, + height: prismaSize + }); + return familyIcon; +}; + +/* harmony default export */ var icons_Search = (Search_Search); +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_90109__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_90109__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_90109__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_90109__.n(Button_); + +// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts + + + + +var StyledButton = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "SelectBaseStyles__StyledButton", + componentId: "sc-16cj7sk-0" +})(["&[data-inline]{width:", ";}", ""], function (_ref) { + var $multiple = _ref.$multiple; + return $multiple ? '400px' : 'auto'; +}, function (_ref2) { + var $multiple = _ref2.$multiple; + return !$multiple && 'flex-grow: 0;'; +}); +var StyledLinkIcon = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledLinkIcon", + componentId: "sc-16cj7sk-1" +})(["padding-right:2px;"]); +var StyledLinkCaret = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledLinkCaret", + componentId: "sc-16cj7sk-2" +})(["padding-left:2px;"]); +var StyledFilter = external_styled_components_default.a.div.withConfig({ + displayName: "SelectBaseStyles__StyledFilter", + componentId: "sc-16cj7sk-3" +})(["padding:", ";min-width:160px;"], Object(themes_["pick"])({ + enterprise: '8px', + prisma: '10px 16px' +})); +var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledSearchIconWrapper", + componentId: "sc-16cj7sk-4" +})(["color:", ";pointer-events:none;padding:", ";"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +}), Object(themes_["pick"])({ + comfortable: '0 8px', + compact: '0 6px' +})); +var StyledCount = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledCount", + componentId: "sc-16cj7sk-5" +})(["padding-right:", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingQuarter, + prisma: themes_["variables"].spacingXSmall +})); +var StyledControlsLink = external_styled_components_default()(Link_default.a).withConfig({ + displayName: "SelectBaseStyles__StyledControlsLink", + componentId: "sc-16cj7sk-6" +})(["", ";"], function (_ref3) { + var $disabled = _ref3.$disabled; + return $disabled && Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled); +}); +var StyledToggleAllControls = external_styled_components_default.a.div.withConfig({ + displayName: "SelectBaseStyles__StyledToggleAllControls", + componentId: "sc-16cj7sk-7" +})(["padding:", ";", ""], Object(themes_["pick"])({ + enterprise: "5px 8px", + prisma: '10px 16px' +}), Object(themes_["pickVariant"])('$placement', { + above: { + enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border), + prisma: Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], themes_["variables"].neutral200) + }, + below: { + enterprise: Object(external_styled_components_["css"])(["border-bottom:", ";"], themes_["variables"].border), + prisma: Object(external_styled_components_["css"])(["border-bottom:1px solid ", ";"], themes_["variables"].neutral200) + } +})); + +// EXTERNAL MODULE: ./src/utils/fuzzyMatch.ts +var fuzzyMatch = __nested_webpack_require_90109__(56); + +// EXTERNAL MODULE: ./src/utils/ssrWindow.ts +var ssrWindow = __nested_webpack_require_90109__(18); + +// CONCATENATED MODULE: ./src/Select/SelectBase.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var propTypes = { + allowKeyMatching: external_prop_types_default.a.bool, + allowNewValues: external_prop_types_default.a.bool, + animateLoading: external_prop_types_default.a.bool, + appearance: external_prop_types_default.a.oneOf(['default', 'link', 'primary', 'pill', 'toggle', 'flat']), + append: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']), + defaultValues: external_prop_types_default.a.array, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + filter: external_prop_types_default.a.oneOf([false, true, 'controlled']), + footerMessage: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + isLoadingOptions: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + labelText: external_prop_types_default.a.string, + loadingMessage: external_prop_types_default.a.node, + menuStyle: external_prop_types_default.a.object, + multiple: external_prop_types_default.a.bool, + name: external_prop_types_default.a.string, + noOptionsMessage: external_prop_types_default.a.node, + onChange: external_prop_types_default.a.func, + onClose: external_prop_types_default.a.func, + onFilterChange: external_prop_types_default.a.func, + onOpen: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + + /** @private. */ + required: external_prop_types_default.a.bool, + placeholder: external_prop_types_default.a.string, + prefixLabel: external_prop_types_default.a.string, + prepend: external_prop_types_default.a.bool, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip']), + showSelectedValuesFirst: external_prop_types_default.a.oneOf(['nextOpen', 'immediately', 'never']), + suffixLabel: external_prop_types_default.a.string, + tabConfirmsNewValue: external_prop_types_default.a.bool, + values: external_prop_types_default.a.array +}; +var defaultProps = { + allowKeyMatching: true, + allowNewValues: false, + animateLoading: false, + appearance: 'toggle', + append: false, + defaultPlacement: 'vertical', + disabled: false, + filter: false, + inline: false, + isLoadingOptions: false, + menuStyle: {}, + multiple: false, + noOptionsMessage: Object(i18n_["_"])('No matches'), + placeholder: Object(i18n_["_"])('Select...'), + prepend: false, + repositionMode: 'flip', + tabConfirmsNewValue: false +}; + +function isOption(child) { + return child && has_default()(child.props, 'value'); +} + +function itemKeyFromValueLabel(value, label) { + return "".concat(_typeof(value), "-").concat(value, "-").concat(label); +} + +var SelectBase_SelectBase = /*#__PURE__*/function (_Component) { + _inherits(SelectBase, _Component); + + var _super = _createSuper(SelectBase); + + _createClass(SelectBase, null, [{ + key: "validateAppearance", + // @docs-props-type CompactPropsBase + value: function validateAppearance(props) { + if (false) {} + } + }]); + + function SelectBase(props) { + var _this; + + _classCallCheck(this, SelectBase); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "activeItemId", void 0); + + _defineProperty(_assertThisInitialized(_this), "activeValue", void 0); + + _defineProperty(_assertThisInitialized(_this), "availableOptionCount", void 0); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "displayedValues", void 0); + + _defineProperty(_assertThisInitialized(_this), "dropdown", null); + + _defineProperty(_assertThisInitialized(_this), "firstSelectedEnabledOption", null); + + _defineProperty(_assertThisInitialized(_this), "firstSelectedOptionIndex", void 0); + + _defineProperty(_assertThisInitialized(_this), "menuId", void 0); + + _defineProperty(_assertThisInitialized(_this), "previousActiveIndex", null); + + _defineProperty(_assertThisInitialized(_this), "selectedOptionCount", void 0); + + _defineProperty(_assertThisInitialized(_this), "optionRefsByKey", void 0); + + _defineProperty(_assertThisInitialized(_this), "matchCharacter", void 0); + + _defineProperty(_assertThisInitialized(_this), "matchTimeout", void 0); + + _defineProperty(_assertThisInitialized(_this), "currentMatchOptions", void 0); + + _defineProperty(_assertThisInitialized(_this), "availableMatchOptions", void 0); + + _defineProperty(_assertThisInitialized(_this), "resetMatches", function () { + _this.matchCharacter = null; + _this.currentMatchOptions = []; + + if (_this.matchTimeout) { + clearTimeout(_this.matchTimeout); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleSelectAll", function (e) { + var _this$getCurrentValue, _this$props$onChange, _this$props2; + + var _this$props = _this.props, + name = _this$props.name, + children = _this$props.children, + multiple = _this$props.multiple; // this doesn't make sense if we can't select multiple values + + if (!multiple) { + return; + } + + var currentValues = (_this$getCurrentValue = _this.getCurrentValues()) !== null && _this$getCurrentValue !== void 0 ? _this$getCurrentValue : []; + var values = uniq_default()(currentValues.concat(_this.displayedValues)); + values = external_react_default.a.Children.toArray(children).filter(function (child) { + return isOption(child) && includes_default()(values, child.props.value) && (!child.props.disabled || includes_default()(currentValues, child.props.value)); + }).map(function (child) { + return child.props.value; + }); + + if (!_this.isControlled()) { + _this.setState({ + values: values + }); + } + + (_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, e, { + values: values, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleClearAll", function (e) { + var _this$getCurrentValue2, _this$props$onChange2, _this$props4; + + var _this$props3 = _this.props, + name = _this$props3.name, + children = _this$props3.children, + multiple = _this$props3.multiple; // this doesn't make sense if we can't select multiple values + + if (!multiple) { + return; + } + + var currentValues = (_this$getCurrentValue2 = _this.getCurrentValues()) !== null && _this$getCurrentValue2 !== void 0 ? _this$getCurrentValue2 : []; + var hiddenCurrentValues = without_default.a.apply(void 0, [currentValues].concat(_toConsumableArray(_this.displayedValues))); // this will unselect all selected values unless those values are disabled or hidden by the filter + + var values = external_react_default.a.Children.toArray(children).filter(function (child) { + return isOption(child) && (includes_default()(currentValues, child.props.value) && child.props.disabled || includes_default()(hiddenCurrentValues, child.props.value)); + }).map(function (child) { + return child.props.value; + }); + + if (!_this.isControlled()) { + _this.setState({ + values: values + }); + } + + (_this$props$onChange2 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props4, e, { + values: values, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextKeyDown", function (e) { + var _this$props5 = _this.props, + children = _this$props5.children, + onScrollBottom = _this$props5.onScrollBottom, + tabConfirmsNewValue = _this$props5.tabConfirmsNewValue; + var eventKeyCode = Object(keyboard_["keycode"])(e.nativeEvent); + + if (eventKeyCode === 'tab') { + if (tabConfirmsNewValue && !isUndefined_default()(_this.activeValue) && _this.availableOptionCount <= 1) { + e.preventDefault(); + + _this.toggleValue(e, _this.activeValue); + } + } + + if (e.shiftKey || e.metaKey || e.ctrlKey) { + return; + } + + if (eventKeyCode === 'down') { + e.preventDefault(); + + _this.setState(function (state) { + return { + activeIndex: Math.min(state.activeIndex + 1, _this.availableOptionCount - 1) + }; + }); + + if (children && onScrollBottom) { + var _this$getCurrentValue3; + + var beforeLastChild = external_react_["Children"].toArray(children).length - (2 + ((_this$getCurrentValue3 = _this.getCurrentValues()) !== null && _this$getCurrentValue3 !== void 0 ? _this$getCurrentValue3 : []).length); + + if (_this.state.activeIndex === beforeLastChild) { + _this.handleScrollBottom(e); + } + } + } + + if (eventKeyCode === 'up') { + e.preventDefault(); + + _this.setState(function (state) { + return { + activeIndex: Math.max(state.activeIndex - 1, 0) + }; + }); + } + + if (eventKeyCode === 'enter' && !isUndefined_default()(_this.activeValue) && _this.state.open) { + e.preventDefault(); + + _this.toggleValue(e, _this.activeValue); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMenuOptionClick", function (e, _ref) { + var value = _ref.value; + e.preventDefault(); + + if (!_this.state.open) { + return; + } + + _this.toggleValue(e, value); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMenuOptionKeyDown", function (e, optionIndex) { + var currentKey = e.nativeEvent.key; // Checking for a single character to avoid complications from double-byte languages and emojis. + + if (currentKey.length === 1) { + var matches = []; + var character = { + index: 0, + value: currentKey + }; + + if (!_this.matchCharacter) { + if (currentKey === ' ') { + _this.resetMatches(); + + return; + } + + matches = Object(fuzzyMatch["a" /* fuzzyMatch */])(_this.availableMatchOptions, character); + } else if (_this.currentMatchOptions.length > 1) { + character.index = _this.matchCharacter.index + 1; + matches = Object(fuzzyMatch["a" /* fuzzyMatch */])(_this.currentMatchOptions, character); + } + + if (matches.length) { + var matchIndex = 0; // If the active option is a first character match, cycle to the next matching option. + + if (character.index === 0 && matches.length > 1) { + var activeMatchIndex = matches.indexOf(_this.availableMatchOptions[optionIndex]); + + if (activeMatchIndex >= 0) { + matchIndex = activeMatchIndex === matches.length - 1 ? 0 : activeMatchIndex + 1; + } + } + + var match = matches[matchIndex]; + + var optionToFocusRef = _this.optionRefsByKey[itemKeyFromValueLabel(match.value, match.label)]; + + if (optionToFocusRef != null) { + var _optionToFocusRef$foc; + + (_optionToFocusRef$foc = optionToFocusRef.focus) === null || _optionToFocusRef$foc === void 0 ? void 0 : _optionToFocusRef$foc.call(optionToFocusRef); + } + } + + _this.currentMatchOptions = matches; + _this.matchCharacter = character; + + if (_this.matchTimeout) { + clearTimeout(_this.matchTimeout); + } + + _this.matchTimeout = setTimeout(_this.resetMatches, 500); + e.preventDefault(); + e.stopPropagation(); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextChange", function (e, _ref2) { + var _this$props$onFilterC, _this$props6; + + var value = _ref2.value; + + _this.setState({ + filterKeyword: value, + open: true, + activeIndex: 0 + }); + + (_this$props$onFilterC = (_this$props6 = _this.props).onFilterChange) === null || _this$props$onFilterC === void 0 ? void 0 : _this$props$onFilterC.call(_this$props6, e, { + keyword: value + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextFocus", function () { + _this.setState({ + textHasFocus: true + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextBlur", function () { + _this.setState({ + textHasFocus: false + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestOpen", function (e) { + var newState = { + open: true, + topValues: _this.getTopValues() + }; // SUI-3234: preserve existing behavior difference between behaviour is to show the placeholder if all parts of the the label + // are empty strings so we replicate this behaviour here + + + if (label.length === 0 || !multiple && label.every(function (labelNode) { + return labelNode === ''; + })) { + label = [placeholder]; + } + + var ariaLabel = label; // If there's more than one item selected, read out the selected total + // rather than reading out each selected item + + if (label.length > 1) { + ariaLabel = _this.wrapLabel({ + prefixLabel: prefixLabel, + label: ["".concat(currentValues.length, " items selected")], + suffixLabel: suffixLabel + }); + } + + var commonProps = _objectSpread({ + 'aria-describedby': describedBy, + 'aria-label': "".concat(labelText ? "".concat(labelText, ", ") : '').concat(ariaLabel), + 'aria-labelledby': labelText ? undefined : labelledBy, + 'aria-multiselectable': multiple || undefined, + 'aria-required': required, + 'data-select-appearance': appearance, + 'data-test': multiple ? 'multiselect' : 'select', + disabled: disabled, + elementRef: elementRef, + error: error + }, omit_default()(_this.props, keys_default()(SelectBase.propTypes))); + + if (multiple) { + commonProps['data-test-values'] = JSON.stringify(currentValues); + } else { + var _currentValues = _slicedToArray(currentValues, 1), + dataTestValue = _currentValues[0]; + + commonProps['data-test-value'] = dataTestValue; + } + + if (toggle) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(toggle, commonProps); + } + + if (appearance === 'link') { + return /*#__PURE__*/external_react_default.a.createElement(Link_default.a, _extends({}, commonProps, { + "data-select-appearance": "link" + }), !!icon && /*#__PURE__*/external_react_default.a.createElement(StyledLinkIcon, null, icon), label || placeholder, /*#__PURE__*/external_react_default.a.createElement(StyledLinkCaret, null, /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown, null))); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledButton, _extends({}, commonProps, { + $multiple: multiple, + appearance: appearance, + label: label, + error: error, + icon: icon, + inline: inline, + isMenu: true, + "aria-haspopup": "listbox", + "aria-owns": _this.menuId // @ts-expect-error - accept inconsistency with Button + , + onClick: _this.props.onClick + }, pick_default()(_this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.a.createElement(StyledCount, { + "data-role": "count" + }, "(", currentValues.length, ")")); + }); + + _defineProperty(_assertThisInitialized(_this), "createChildren", function () { + var _this$state = _this.state, + filterKeyword = _this$state.filterKeyword, + textHasFocus = _this$state.textHasFocus, + topValuesState = _this$state.topValues; + var _this$props12 = _this.props, + allowKeyMatching = _this$props12.allowKeyMatching, + allowNewValues = _this$props12.allowNewValues, + filter = _this$props12.filter, + multiple = _this$props12.multiple, + showSelectedValuesFirst = _this$props12.showSelectedValuesFirst, + isLoadingOptions = _this$props12.isLoadingOptions, + onScrollBottom = _this$props12.onScrollBottom; + + var currentValues = _this.getCurrentValues(); + + _this.availableOptionCount = 0; + _this.firstSelectedOptionIndex = undefined; + _this.selectedOptionCount = 0; + _this.activeValue = undefined; + _this.availableMatchOptions = []; + var foundExactMatch; + var childrenTopCount = 0; + var hasDivider = false; // used to avoid overwriting the selected item ref in multiple mode + + var foundSelectedAndEnabled; + var topValues = showSelectedValuesFirst === 'immediately' ? _this.getTopValues() : topValuesState; + var children = external_react_["Children"].toArray(_this.props.children).reduce(function (acc, item, i) { + // ignore Headings and Dividers + if (!isOption(item)) { + acc.push(item); + return acc; + } // Find out if the search string exactly matches a value + + + if (item.props.value === _this.state.filterKeyword) { + foundExactMatch = true; + } + + var selected = currentValues && currentValues.indexOf(item.props.value) >= 0; + var isFirstSelectedAndEnabled = !!selected && !item.props.disabled && !foundSelectedAndEnabled; + var useMatchOptions = allowKeyMatching && !multiple && !filter && !isLoadingOptions && !onScrollBottom; + var itemKey = itemKeyFromValueLabel(item.props.value, item.props.label); + var filterIndex = -1; + + if (useMatchOptions && !item.props.disabled && !item.props.hidden) { + _this.availableMatchOptions.push({ + label: item.props.label, + value: item.props.value + }); + + filterIndex = _this.availableMatchOptions.length - 1; + } // Format the Menu.Item + + + var clonedItem = /*#__PURE__*/Object(external_react_["cloneElement"])(item, { + key: item.key || i, + onClick: _this.handleMenuOptionClick, + onKeyDown: useMatchOptions ? function (e) { + return _this.handleMenuOptionKeyDown(e, filterIndex); + } : undefined, + selected: selected, + multiple: multiple, + role: 'option', + ref: function ref(element) { + return _this.handleOptionMount(element, itemKey, isFirstSelectedAndEnabled); + } + }); + + if (isFirstSelectedAndEnabled) { + foundSelectedAndEnabled = true; + } + + if (topValues && topValues.indexOf(item.props.value) >= 0) { + if (childrenTopCount === 0) { + acc.splice(childrenTopCount, 0, /*#__PURE__*/external_react_default.a.createElement(Menu_["Divider"], { + key: "topDivider" + })); + hasDivider = true; + } + + acc.splice(childrenTopCount, 0, clonedItem); + childrenTopCount += 1; + } else { + acc.push(clonedItem); + } + + return acc; + }, []); // In multiple mode, add missing items + + if (multiple) { + forEachRight_default()(currentValues, function (value) { + var matchedItem = find_default()(children, function (item) { + return isOption(item) && item.props && item.props.value === value; + }); + + if (!matchedItem) { + if (value === _this.state.filterKeyword) { + foundExactMatch = true; + } + + var isTopValue = topValues && topValues.indexOf(value) >= 0; + var topLength = topValues.length; + + if (childrenTopCount === 0) { + children.splice(0, 0, /*#__PURE__*/external_react_default.a.createElement(Menu_["Divider"], { + key: "topDivider" + })); + childrenTopCount += 1; + hasDivider = true; + } + + children.splice(isTopValue ? 0 : topLength + 1, 0, /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], { + label: String(value), + value: value, + key: "missing-value-".concat(value), + onClick: _this.handleMenuOptionClick, + multiple: multiple, + selected: true + })); + + if (isTopValue) { + childrenTopCount += 1; + } + } + }); + } + + var controlledFilter = filter === 'controlled'; // Filter the items + + var keywords = Object(filter_["stringToKeywords"])(filterKeyword); + children = controlledFilter ? children : children.filter(function (option) { + if (isOption(option)) { + return Object(filter_["testPhrase"])(option.props.label, keywords); + } + + return true; // Keep all headers and non-interactive options + }) // highlight the matched text + .map(function (option) { + if (!isOption(option)) { + return option; + } // highlight matched text + + + var matchRanges = keywords && Object(filter_["keywordLocations"])(option.props.label, keywords); + return /*#__PURE__*/Object(external_react_["cloneElement"])(option, { + matchRanges: matchRanges || undefined + }); + }); // Add the option to add the new value + + if (allowNewValues && !foundExactMatch && filterKeyword) { + var insertIndex = hasDivider ? childrenTopCount + 1 : childrenTopCount; + children.splice(insertIndex, 0, /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], { + label: "".concat(filterKeyword, " (new value)"), + value: filterKeyword, + key: "newValue", + multiple: multiple, + onClick: _this.handleMenuOptionClick + })); + } // Highlight the selected Items and remove hidden + + + children = children.reduce(function (acc, item) { + // ignore Dividers & Headings + if (!isOption(item)) { + acc.push(item); + return acc; + } // Ignore any hidden items + + + if (item.props && item.props.hidden) { + return acc; + } + + if (item.props.selected && !item.props.disabled && _this.firstSelectedOptionIndex == null) { + _this.firstSelectedOptionIndex = _this.availableOptionCount; + } + + var active = _this.availableOptionCount === _this.state.activeIndex; + _this.availableOptionCount += 1; + _this.selectedOptionCount += item.props.selected ? 1 : 0; + + if (!active || !textHasFocus) { + acc.push(item); + return acc; + } + + if (!item.props.disabled) { + _this.activeValue = item.props.value; + } + + var clonedItem = /*#__PURE__*/Object(external_react_["cloneElement"])(item, { + active: active, + id: _this.activeItemId, + ref: _this.handleActiveOptionMount + }); + acc.push(clonedItem); + return acc; + }, []); + _this.displayedValues = children.reduce(function (acc, item) { + if (isOption(item)) { + acc.push(item.props.value); + } + + return acc; + }, []); + return children; + }); + + _defineProperty(_assertThisInitialized(_this), "wrapLabel", function (_ref3) { + var prefixLabel = _ref3.prefixLabel, + label = _ref3.label, + suffixLabel = _ref3.suffixLabel; + var wrappedLabel = label; + + if (prefixLabel) { + wrappedLabel = ["".concat(prefixLabel, ": ")].concat(wrappedLabel); + } + + if (suffixLabel) { + wrappedLabel = castArray_default()(wrappedLabel).concat(" ".concat(suffixLabel)); + } + + return wrappedLabel; + }); + + _this.state = { + activeIndex: 0, + filterKeyword: '', + open: false, + textHasFocus: false, + topValues: [], + values: props.defaultValues || [] + }; + _this.controlledExternally = has_default()(props, 'values'); + _this.displayedValues = []; + _this.availableOptionCount = 0; + _this.firstSelectedOptionIndex = undefined; + _this.selectedOptionCount = 0; + _this.matchCharacter = null; + _this.matchTimeout = null; + _this.currentMatchOptions = []; + _this.availableMatchOptions = []; + _this.optionRefsByKey = {}; + + if (false) {} + + if (false) {} + + SelectBase.validateAppearance(props); + _this.menuId = Object(id_["createDOMID"])('menu'); + _this.activeItemId = Object(id_["createDOMID"])('active-item'); + return _this; + } + + _createClass(SelectBase, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (false) {} + + if (false) {} + + SelectBase.validateAppearance(this.props); + this.previousActiveIndex = prevState.activeIndex; + } + }, { + key: "getCurrentValues", + value: function getCurrentValues() { + var values = this.isControlled() ? this.props.values : this.state.values; + return this.props.multiple || values == null ? values : values.slice(0, 1); + } + }, { + key: "getTopValues", + value: function getTopValues() { + var _this$getCurrentValue5; + + // in non-multiple mode, don't move values to the top of the list + return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue5 = this.getCurrentValues()) !== null && _this$getCurrentValue5 !== void 0 ? _this$getCurrentValue5 : [] : []; + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "hasFilter", + value: function hasFilter() { + return !!this.props.filter; + } + }, { + key: "toggleValue", + value: function toggleValue(e, value) { + var _this$getCurrentValue6, _this$props$onChange3, _this$props14; + + var values = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : []; + var currentIndex = values.indexOf(value); + var _this$props13 = this.props, + name = _this$props13.name, + multiple = _this$props13.multiple; + var newValues; + + if (multiple) { + if (currentIndex >= 0) { + newValues = [].concat(_toConsumableArray(values.slice(0, currentIndex)), _toConsumableArray(values.slice(currentIndex + 1))); + } else { + newValues = values.concat([value]); + } + } else { + // non-multiple mode must always have a value + newValues = [value]; + } + + var uncontrolled = !this.isControlled(); + + if (uncontrolled) { + this.setState({ + values: newValues + }); + } + + if (multiple) { + // in uncontrolled multiple mode, keep the menu open + if (uncontrolled) { + this.setState({ + open: true + }); + } + } else { + // non-multiple mode only supports a single selection + // so close the menu once a selection is made + this.handleRequestClose({ + reason: 'contentClick' + }); + this.focus(); + } + + (_this$props$onChange3 = (_this$props14 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props14, e, { + values: newValues, + name: name + }); + } + /** + * Place focus on the toggle. + */ + + }, { + key: "focus", + value: function focus() { + var _this$dropdown; + + (_this$dropdown = this.dropdown) === null || _this$dropdown === void 0 ? void 0 : _this$dropdown.focus(); + } + }, { + key: "renderControls", + value: function renderControls(_ref4) { + var hasChildren = _ref4.hasChildren, + placement = _ref4.placement; + var filterKeyword = this.state.filterKeyword; + var _this$props15 = this.props, + inputId = _this$props15.inputId, + inputRef = _this$props15.inputRef, + multiple = _this$props15.multiple; // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731 + + var selectControls = /*#__PURE__*/external_react_default.a.createElement(StyledToggleAllControls, { + $placement: placement, + key: "selectAll" + }, /*#__PURE__*/external_react_default.a.createElement(StyledControlsLink, { + $disabled: !(this.availableOptionCount - this.selectedOptionCount), + onClick: this.handleSelectAll, + "data-test": "select-all", + style: { + marginRight: 20 + } + }, filterKeyword ? Object(i18n_["_"])('Select All Matches') : Object(i18n_["_"])('Select All')), /*#__PURE__*/external_react_default.a.createElement(StyledControlsLink, { + $disabled: !this.selectedOptionCount, + onClick: this.handleClearAll, + "data-test": "clear-all" + }, filterKeyword ? Object(i18n_["_"])('Clear All Matches') : Object(i18n_["_"])('Clear All'))); + return this.hasFilter() && /*#__PURE__*/external_react_default.a.createElement("div", { + key: "controls" + }, /*#__PURE__*/external_react_default.a.createElement(StyledFilter, { + key: "filter", + "data-test": "filter" + }, /*#__PURE__*/external_react_default.a.createElement(Text_default.a, { + value: filterKeyword, + autoCapitalize: "off", + autoComplete: "off", + autoCorrect: "off", + spellCheck: false, + onChange: this.handleTextChange, + onKeyDown: this.handleTextKeyDown, + onFocus: this.handleTextFocus, + onBlur: this.handleTextBlur, + placeholder: Object(i18n_["_"])('filter'), + role: "combobox", + "aria-expanded": "true", + "aria-label": Object(i18n_["_"])('Filter'), + "aria-activedescendant": this.activeItemId, + inputRef: inputRef, + inputId: inputId, + canClear: true, + startAdornment: /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, null, /*#__PURE__*/external_react_default.a.createElement(icons_Search, null)) + })), multiple && hasChildren && selectControls); + } + }, { + key: "render", + value: function render() { + var _this$getCurrentValue7, + _this2 = this; + + var _this$props16 = this.props, + children = _this$props16.children, + defaultPlacement = _this$props16.defaultPlacement, + inputId = _this$props16.inputId, + multiple = _this$props16.multiple, + repositionMode = _this$props16.repositionMode; + var filterEnabled = this.hasFilter(); + var currentValues = (_this$getCurrentValue7 = this.getCurrentValues()) !== null && _this$getCurrentValue7 !== void 0 ? _this$getCurrentValue7 : []; + var childrenArray = external_react_["Children"].toArray(children); + var isAnyValueSelected = currentValues.some(function (value) { + var matchedItem = find_default()(childrenArray, function (item) { + return isOption(item) && item.props.value === value; + }); + return matchedItem && !matchedItem.props.disabled; + }); + var finalChildren = this.createChildren(); + var toggle = this.createToggle(); + + var createMenu = function createMenu(_ref5) { + var anchorWidth = _ref5.anchorWidth, + maxHeight = _ref5.maxHeight, + placement = _ref5.placement; + // preserve separate widths for single vs. multi mode + var internalMenuStyle = _this2.props.multiple ? { + width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200) + } : { + minWidth: anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : undefined, + maxWidth: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 300) + }; + var tabIndex = currentValues.length > 0 && !isAnyValueSelected && !_this2.hasFilter() ? 0 : undefined; + return /*#__PURE__*/external_react_default.a.createElement(ResultsMenu_default.a, _extends({ + "aria-multiselectable": multiple || undefined, + childrenStart: _this2.renderControls({ + placement: placement, + hasChildren: !!finalChildren.length + }), + controlledExternally: _this2.hasFilter(), + placement: placement !== null && placement !== void 0 ? placement : undefined, + maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : undefined, + onScrollBottom: _this2.props.onScrollBottom ? _this2.handleScrollBottom : undefined, + "data-test": "results-menu", + isLoading: _this2.props.isLoadingOptions, + id: _this2.menuId + }, pick_default()(_this2.props, 'noOptionsMessage', 'footerMessage', 'animateLoading', 'loadingMessage', 'onScroll'), { + style: _objectSpread(_objectSpread({}, internalMenuStyle), _this2.props.menuStyle), + tabIndex: tabIndex + }), finalChildren); + }; + + return /*#__PURE__*/external_react_default.a.createElement(Dropdown_default.a, { + closeReasons: ['clickAway', 'escapeKey', 'offScreen', 'tabKey', 'toggleClick'], + inputId: inputId, + toggle: toggle, + onRequestOpen: this.handleRequestOpen, + onRequestClose: this.handleRequestClose, + open: this.state.open, + openWithArrowKeys: true, + repositionMode: repositionMode, + defaultPlacement: filterEnabled ? defaultPlacement : undefined, + canCoverAnchor: Object(ssrWindow["a" /* getWindow */])().innerHeight < 500, + ref: function ref(c) { + _this2.dropdown = c; + }, + retainFocus: false, + takeFocus: currentValues.length === 0 || currentValues.length > 0 && !isAnyValueSelected || !!filterEnabled + }, createMenu); + } + }]); + + return SelectBase; +}(external_react_["Component"]); + +_defineProperty(SelectBase_SelectBase, "propTypes", propTypes); + +_defineProperty(SelectBase_SelectBase, "defaultProps", defaultProps); + +_defineProperty(SelectBase_SelectBase, "Option", OptionBase["a" /* default */]); + +_defineProperty(SelectBase_SelectBase, "Divider", Menu_["Divider"]); + +_defineProperty(SelectBase_SelectBase, "Heading", Menu_["Heading"]); + +_defineProperty(SelectBase_SelectBase, "invalidLinkAppearanceProps", ['append', 'error', 'prepend']); + +/* harmony default export */ var Select_SelectBase = __nested_webpack_exports__["c"] = (SelectBase_SelectBase); + + +/***/ }), + +/***/ 61: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(71086); + +/***/ }), + +/***/ 65: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(99084); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }), + +/***/ 91: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68090); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 36156: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 202); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 17: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), + +/***/ 19: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92297); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 202: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4385__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4385__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4385__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Number_Number; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4385__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4385__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4385__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4385__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_4385__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_4385__.n(has_); + +// EXTERNAL MODULE: external "lodash/isFinite" +var isFinite_ = __nested_webpack_require_4385__(19); +var isFinite_default = /*#__PURE__*/__nested_webpack_require_4385__.n(isFinite_); + +// EXTERNAL MODULE: external "lodash/isString" +var isString_ = __nested_webpack_require_4385__(23); +var isString_default = /*#__PURE__*/__nested_webpack_require_4385__.n(isString_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_4385__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_4385__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4385__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_4385__(7); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4385__(4); + +// EXTERNAL MODULE: external "@splunk/react-icons/SVGEnterprise" +var SVGEnterprise_ = __nested_webpack_require_4385__(32); +var SVGEnterprise_default = /*#__PURE__*/__nested_webpack_require_4385__.n(SVGEnterprise_); + +// CONCATENATED MODULE: ./src/Number/IncrementIcon.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + +/* eslint-disable max-len */ + +function SortedUp(props) { + return /*#__PURE__*/external_react_default.a.createElement(SVGEnterprise_default.a, _extends({ + viewBox: "0 0 933 600" + }, props), /*#__PURE__*/external_react_default.a.createElement("path", { + fill: "currentColor", + d: "M0 466.438L466.438 0l466.44 467.466-134.59 133.56-331.85-331.848-331.85 331.85L0 466.438z" + })); +} +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4385__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4385__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_4385__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_4385__.n(Button_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4385__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4385__.n(Clickable_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Text" +var Text_ = __nested_webpack_require_4385__(30); +var Text_default = /*#__PURE__*/__nested_webpack_require_4385__.n(Text_); + +// CONCATENATED MODULE: ./src/Number/NumberStyles.ts + + + + + +var StyledText = external_styled_components_default()(Text_default.a).withConfig({ + displayName: "NumberStyles__StyledText", + componentId: "sc-2ekj9s-0" +})(["&[data-inline]{", "}"], Object(themes_["pick"])({ + enterprise: { + comfortable: Object(external_styled_components_["css"])(["width:100px;"]), + compact: Object(external_styled_components_["css"])(["width:80px;"]) + }, + prisma: Object(external_styled_components_["css"])(["width:100px;"]) +})); +var StyledControls = external_styled_components_default.a.div.withConfig({ + displayName: "NumberStyles__StyledControls", + componentId: "sc-2ekj9s-1" +})(["width:", ";height:100%;", " ", ""], Object(themes_["pick"])({ + enterprise: { + comfortable: '20px', + compact: '16px' + }, + prisma: { + comfortable: '24px', + compact: '24px' + } +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["transform:translateY(-1px);"]), + prisma: Object(external_styled_components_["css"])(["transform:translateX(1px);"]) +}), function (_ref) { + var $isAppend = _ref.$isAppend; + return $isAppend ? Object(external_styled_components_["css"])(["margin-right:8px;", ""], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["transform:translateX(-1px);"]) + })) : Object(external_styled_components_["css"])(["margin-left:8px;"]); +}); +var incrementor = Object(external_styled_components_["css"])(["position:relative;padding:3px;font-size:inherit;min-width:0;min-height:0;height:", ";width:100%;"], Object(themes_["pick"])({ + enterprise: 'calc(50% + 1.5px)', + prisma: '50%' +})); +var StyledPlusButton = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "NumberStyles__StyledPlusButton", + componentId: "sc-2ekj9s-2" +})(["", ";top:0;border-bottom-left-radius:0;border-bottom-right-radius:0;", " &:not([disabled]){&,&:hover{", ";}}"], incrementor, function (_ref2) { + var append = _ref2.append; + return append && Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["border-right:1px solid ", ";"], themes_["variables"].gray60), + dark: Object(external_styled_components_["css"])(["border-right:", ";"], themes_["variables"].border) + } + }); +}, Object(themes_["pick"])({ + enterprise: { + dark: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray20) + } +})); +var StyledMinusButton = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "NumberStyles__StyledMinusButton", + componentId: "sc-2ekj9s-3" +})(["", ";bottom:1px;border-top-left-radius:0;border-top-right-radius:0;", " &:not([disabled]){&,&:hover{", ";}}"], incrementor, function (_ref3) { + var append = _ref3.append; + return append && Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["border-right:1px solid ", ";"], themes_["variables"].gray60), + dark: Object(external_styled_components_["css"])(["border-right:", ";"], themes_["variables"].border) + } + }); +}, Object(themes_["pick"])({ + enterprise: { + dark: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray20) + } +})); +var prismaButton = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "NumberStyles__prismaButton", + componentId: "sc-2ekj9s-4" +})(["", ";display:flex;align-items:center;justify-content:center;", " &:hover:not([disabled]){", "}&:active:not([disabled]){", "}"], incrementor, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDefault) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";color:", ";"], themes_["variables"].interactiveColorOverlayHover, themes_["variables"].contentColorActive) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";color:", ";"], themes_["variables"].interactiveColorOverlayActive, themes_["variables"].contentColorActive) +})); +var StyledPrismaPlusButton = external_styled_components_default()(prismaButton).withConfig({ + displayName: "NumberStyles__StyledPrismaPlusButton", + componentId: "sc-2ekj9s-5" +})(["border-top-right-radius:4px;"]); +var StyledPrismaMinusButton = external_styled_components_default()(prismaButton).withConfig({ + displayName: "NumberStyles__StyledPrismaMinusButton", + componentId: "sc-2ekj9s-6" +})(["border-bottom-right-radius:4px;padding-bottom:5px;"]); + +// CONCATENATED MODULE: ./src/Number/Number.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function Number_extends() { Number_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Number_extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + +var propTypes = { + append: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + defaultValue: external_prop_types_default.a.number, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + hideStepButtons: external_prop_types_default.a.bool, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + labelledBy: external_prop_types_default.a.string, + locale: external_prop_types_default.a.string, + max: external_prop_types_default.a.number, + min: external_prop_types_default.a.number, + name: external_prop_types_default.a.string, + onBlur: external_prop_types_default.a.func, + onChange: external_prop_types_default.a.func, + onFocus: external_prop_types_default.a.func, + onKeyDown: external_prop_types_default.a.func, + onKeyUp: external_prop_types_default.a.func, + onSelect: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + prepend: external_prop_types_default.a.bool, + roundTo: external_prop_types_default.a.number, + step: external_prop_types_default.a.number, + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + useSyntheticPlaceholder: external_prop_types_default.a.bool, + value: external_prop_types_default.a.number +}; +var defaultProps = { + append: false, + disabled: false, + error: false, + hideStepButtons: false, + inline: false, + locale: 'en-US', + placeholder: '', + prepend: false, + roundTo: 5, + step: 1 +}; + +var Number_Number = /*#__PURE__*/function (_Component) { + _inherits(Number, _Component); + + var _super = _createSuper(Number); + + _createClass(Number, null, [{ + key: "getDecimalSeparator", + // @docs-props-type NumberPropsBase + value: function getDecimalSeparator(locale) { + // A more robust and expandable solution would be to use formatToParts() once IE requirements are dropped. + var formattedNumber = new Intl.NumberFormat(locale.replace('_', '-')).format(1.2); + return formattedNumber.indexOf(',') > -1 ? ',' : '.'; + } + }, { + key: "validatePrependAppend", + value: function validatePrependAppend(append, prepend) { + if (false) {} + } + }, { + key: "stringToNumber", + value: function stringToNumber(str, props) { + var val = str; + + if (!isString_default()(val) || val === '') { + return undefined; + } + + if (Number.getDecimalSeparator(props.locale) === '.') { + // remove leading non-numeric characters. + val = val.replace(/^[^\d.-]/, ''); + } else { + // remove leading non-numeric characters and replace comma with period + val = val.replace(/^[^\d,-]/, '').replace(',', '.'); + } + + var valNumeric = Number.limitValue(parseFloat(val), props); + + if (isFinite_default()(valNumeric)) { + return valNumeric; + } + + return undefined; + } + }, { + key: "numberToString", + value: function numberToString(number, props) { + if (number === undefined || !isFinite_default()(number)) { + return ''; + } + + if (Number.getDecimalSeparator(props.locale) === '.') { + return number.toString(); + } // comma separated case + + + return number.toString().replace('.', ','); + } + }, { + key: "limitValue", + value: function limitValue(val, _ref) { + var min = _ref.min, + max = _ref.max, + roundTo = _ref.roundTo; + var newVal = val; + + if (!isFinite_default()(val)) { + return newVal; + } + + if (min !== undefined && isFinite_default()(min)) { + newVal = Math.max(min, newVal); + } + + if (max !== undefined && isFinite_default()(max)) { + newVal = Math.min(max, newVal); + } // eslint-disable-next-line no-restricted-properties + + + var pow = Math.pow(10, roundTo); + return Math.round(newVal * pow) / pow; + } + }]); + + function Number(props) { + var _this; + + _classCallCheck(this, Number); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "text", null); + + _defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (e) { + var _this$props$onBlur, _this$props; + + _this.updateString(); + + (_this$props$onBlur = (_this$props = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e, _ref2) { + var value = _ref2.value; + + _this.setValueFromString(e, value); + }); + + _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props$onKeyDown, _this$props2; + + if (!e.metaKey && !e.ctrlKey && !e.altKey && Object(keyboard_["addsCharacter"])(e.nativeEvent) !== false) { + // only allow numbers, negative and decimals + if (!Object(keyboard_["isNumeric"])(e.nativeEvent, { + locale: _this.props.locale + })) { + e.preventDefault(); + } // if minus is not allowed or there is already one, prevent input + + + if (Object(keyboard_["isMinus"])(e.nativeEvent) && (_this.preventNegativeNumbers() || _this.state.stringValue.indexOf('-') >= 0)) { + e.preventDefault(); + } // if decimal is not allowed or there is already one, prevent input + + + if (Object(keyboard_["isDecimal"])(e.nativeEvent, { + locale: _this.props.locale + }) && (_this.props.roundTo <= 0 || _this.state.stringValue.indexOf(_this.props.locale) >= 0)) { + e.preventDefault(); + } + } // Arrow up and down will increment + + + if (Object(keyboard_["keycode"])(e.nativeEvent) === 'up') { + _this.increment(e, _this.props.step); + + e.preventDefault(); + } else if (Object(keyboard_["keycode"])(e.nativeEvent) === 'down') { + _this.increment(e, -_this.props.step); + + e.preventDefault(); + } + + (_this$props$onKeyDown = (_this$props2 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props2, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleKeyUp", function (e) { + var _this$props$onKeyUp, _this$props3; + + if (Object(keyboard_["keycode"])(e.nativeEvent) === 'enter') { + _this.updateString(); + } + + (_this$props$onKeyUp = (_this$props3 = _this.props).onKeyUp) === null || _this$props$onKeyUp === void 0 ? void 0 : _this$props$onKeyUp.call(_this$props3, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleIncrement", function (e) { + _this.increment(e, _this.props.step); + }); + + _defineProperty(_assertThisInitialized(_this), "handleDecrement", function (e) { + _this.increment(e, -_this.props.step); + }); + + _this.controlledExternally = has_default()(props, 'value'); + + var _value = _this.isControlled() ? props.value : props.defaultValue; + + _this.state = { + // value stores internal state, only in uncontrolled mode + value: _this.isControlled() ? undefined : _value, + // prevValueProp is used to keep track of changes to the value prop, only in controlled mode + prevValueProp: _this.isControlled() ? _value : undefined, + // eslint-disable-line react/no-unused-state + // stringValue stores the current contents of the input text box - it might be out of range, invalid, ... + stringValue: Number.numberToString(_value, props) + }; + + if (false) {} + + if (has_default()(props, 'useSyntheticPlaceholder')) { + // eslint-disable-next-line no-console + console.warn("The 'Number' prop 'useSyntheticPlaceholder' has been marked for deprecation."); + } + + if (false) {} + + Number.validatePrependAppend(_this.props.append, _this.props.prepend); + return _this; + } + + _createClass(Number, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (false) {} + + if (false) {} + + Number.validatePrependAppend(this.props.append, this.props.prepend); + } + }, { + key: "getValue", + value: function getValue() { + return this.isControlled() ? this.props.value : this.state.value; + } + }, { + key: "setValueFromString", + value: function setValueFromString(e, str) { + var _this2 = this; + + var value = Number.stringToNumber(str, this.props); + var name = this.props.name; + this.setState({ + value: this.isControlled() ? undefined : value, + stringValue: str + }, function () { + if (_this2.getValue() !== value || !_this2.isControlled()) { + var _this2$props$onChange, _this2$props; + + (_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0 ? void 0 : _this2$props$onChange.call(_this2$props, e, { + value: value, + name: name + }); + } + }); + } + }, { + key: "setValue", + value: function setValue(e, value) { + var _this3 = this; + + var name = this.props.name; + this.setState({ + value: this.isControlled() ? undefined : value, + stringValue: Number.numberToString(value, this.props) + }, function () { + if (_this3.getValue() !== value || !_this3.isControlled()) { + var _this3$props$onChange, _this3$props; + + (_this3$props$onChange = (_this3$props = _this3.props).onChange) === null || _this3$props$onChange === void 0 ? void 0 : _this3$props$onChange.call(_this3$props, e, { + value: value, + name: name + }); + } + }); + } + }, { + key: "focus", + + /** + * Place focus on the input. + */ + value: function focus(options) { + if (this.text) { + this.text.focus(options); + } + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "updateString", + value: function updateString() { + var value = this.getValue(); + this.setState({ + stringValue: Number.numberToString(value, this.props) + }); + } + }, { + key: "increment", + value: function increment(e, amount) { + var valNumeric = Number.stringToNumber(this.state.stringValue, this.props); + var targetValNumeric; // increment appropriate number + + if (valNumeric !== undefined && isFinite_default()(valNumeric)) { + // increment the entered value + targetValNumeric = valNumeric + amount; + } else if (this.props.defaultValue !== undefined && isFinite_default()(this.props.defaultValue)) { + // increment the defaultValue + targetValNumeric = this.props.defaultValue + amount; + } else if (amount > 0) { + // increment up to max or step value + targetValNumeric = this.props.max || this.props.step; + } else { + // increment down to min or 0 + targetValNumeric = this.props.min || 0; // set to min or 0 + } + + this.setValue(e, Number.limitValue(targetValNumeric, this.props)); + } + }, { + key: "preventNegativeNumbers", + value: function preventNegativeNumbers() { + return this.props.min !== undefined && isFinite_default()(this.props.min) && this.props.min >= 0; + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props4 = this.props, + append = _this$props4.append, + describedBy = _this$props4.describedBy, + disabled = _this$props4.disabled, + error = _this$props4.error, + hideStepButtons = _this$props4.hideStepButtons, + inline = _this$props4.inline, + _this$props4$value = _this$props4.value, + value = _this$props4$value === void 0 ? this.state.value : _this$props4$value, + max = _this$props4.max, + min = _this$props4.min, + prepend = _this$props4.prepend, + splunkTheme = _this$props4.splunkTheme; + var textProps = omit_default()(this.props, ['defaultValue', 'hideStepButtons', 'max', 'min', 'roundTo', 'spellCheck', 'step']); + var isPrisma = splunkTheme.isPrisma; + var buttonProps = isPrisma ? {} : { + append: append, + prepend: !append, + error: error, + inline: false + }; + var disableIncrement = value !== undefined && isFinite_default()(value) && max !== undefined && isFinite_default()(max) && value >= max; + var disableDecrement = value !== undefined && isFinite_default()(value) && min !== undefined && isFinite_default()(min) && value <= min; + var plusIcon = /*#__PURE__*/external_react_default.a.createElement(SortedUp, { + width: "6px", + height: "4px", + screenReaderText: Object(i18n_["_"])('Increment') + }); + + var plusProps = _objectSpread({ + 'data-test': 'increment', + disabled: disabled || disableIncrement, + onClick: this.handleIncrement, + tabIndex: -1 + }, buttonProps); + + var styledPlus = isPrisma ? /*#__PURE__*/external_react_default.a.createElement(StyledPrismaPlusButton, plusProps, plusIcon) : /*#__PURE__*/external_react_default.a.createElement(StyledPlusButton, plusProps, plusIcon); + var minusIcon = /*#__PURE__*/external_react_default.a.createElement(SortedUp, { + width: "6px", + height: "4px", + screenReaderText: Object(i18n_["_"])('Decrement'), + style: { + transform: 'rotateX(180deg)' + } + }); + + var minusProps = _objectSpread({ + 'data-test': 'decrement', + disabled: disabled || disableDecrement, + onClick: this.handleDecrement, + tabIndex: -1 + }, buttonProps); + + var styledMinus = isPrisma ? /*#__PURE__*/external_react_default.a.createElement(StyledPrismaMinusButton, minusProps, minusIcon) : /*#__PURE__*/external_react_default.a.createElement(StyledMinusButton, minusProps, minusIcon); + var isAppend = append && !prepend; + var startAdornment = (!disabled || isPrisma) && isAppend && !hideStepButtons && /*#__PURE__*/external_react_default.a.createElement(StyledControls, { + $isAppend: isAppend + }, styledPlus, styledMinus); + var endAdornment = (!disabled || isPrisma) && !isAppend && !hideStepButtons && /*#__PURE__*/external_react_default.a.createElement(StyledControls, { + $isAppend: isAppend + }, styledPlus, styledMinus); + return /*#__PURE__*/external_react_default.a.createElement(StyledText, Number_extends({ + autoCapitalize: "off", + autoComplete: "off", + autoCorrect: "off", + spellCheck: false, + "data-test": "number", + ref: function ref(c) { + _this4.text = c; + } + }, textProps, { + inline: inline, + onChange: this.handleInputChange, + onBlur: this.handleInputBlur, + onKeyDown: this.handleKeyDown, + onKeyUp: this.handleKeyUp, + value: this.state.stringValue, + "aria-describedby": describedBy, + error: error, + "data-test-value": value, + startAdornment: startAdornment, + endAdornment: endAdornment + })); + } + }]); + + return Number; +}(external_react_["Component"]); + +_defineProperty(Number_Number, "propTypes", propTypes); + +_defineProperty(Number_Number, "defaultProps", defaultProps); + +_defineProperty(Number_Number, "getDerivedStateFromProps", function (props, state) { + if (has_default()(props, 'value') && props.value !== state.prevValueProp) { + var valNumeric = Number_Number.stringToNumber(state.stringValue, props); + return props.value !== valNumeric ? { + prevValueProp: props.value, + stringValue: Number_Number.numberToString(props.value, props) + } : { + prevValueProp: props.value + }; + } + + return null; +}); + +var NumberWithTheme = Object(themes_["withSplunkTheme"])(Number_Number); +NumberWithTheme.propTypes = Number_Number.propTypes; +/* harmony default export */ var src_Number_Number = (NumberWithTheme); +// CONCATENATED MODULE: ./src/Number/index.ts + + + +/***/ }), + +/***/ 23: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(85015); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 30: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25338); + +/***/ }), + +/***/ 32: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(19838); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 94762: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 182); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 146: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5979); + +/***/ }), + +/***/ 182: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3995__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3995__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3995__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Paginator_Paginator; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3995__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3995__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3995__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3995__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_3995__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_3995__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3995__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/format" +var format_ = __nested_webpack_require_3995__(28); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_3995__(4); + +// EXTERNAL MODULE: external "@splunk/react-icons/DotsThreeHorizontal" +var DotsThreeHorizontal_ = __nested_webpack_require_3995__(146); +var DotsThreeHorizontal_default = /*#__PURE__*/__nested_webpack_require_3995__.n(DotsThreeHorizontal_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3995__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3995__.n(external_styled_components_); + +// CONCATENATED MODULE: ./src/Paginator/PageSeparatorStyles.ts + + +var StyledEllipsisWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "PageSeparatorStyles__StyledEllipsisWrapper", + componentId: "j50fqf-0" +})(["display:flex;align-items:center;margin:", ";color:", ";"], Object(themes_["pick"])({ + enterprise: '0px 11px', + prisma: '0px 20px' +}), themes_["variables"].contentColorActive); + +// CONCATENATED MODULE: ./src/Paginator/PageSeparator.tsx + + + + + +function PageSeparator() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family; + + var content = family === 'enterprise' ? /*#__PURE__*/external_react_default.a.createElement("span", { + role: "separator" + }, "\u2026") : /*#__PURE__*/external_react_default.a.createElement(DotsThreeHorizontal_default.a, null); + return /*#__PURE__*/external_react_default.a.createElement(StyledEllipsisWrapper, { + role: "separator" + }, content); +} + +/* harmony default export */ var Paginator_PageSeparator = (PageSeparator); +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_3995__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_3995__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_3995__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_3995__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ButtonSimple" +var ButtonSimple_ = __nested_webpack_require_3995__(62); +var ButtonSimple_default = /*#__PURE__*/__nested_webpack_require_3995__.n(ButtonSimple_); + +// CONCATENATED MODULE: ./src/Paginator/ButtonStyles.ts + + + +var StyledButtonSimple = external_styled_components_default()(ButtonSimple_default.a).withConfig({ + displayName: "ButtonStyles__StyledButtonSimple", + componentId: "sc-1neztq7-0" +})(["min-width:", ";min-height:", ";text-align:center;flex-shrink:0;", ""], themes_["variables"].inputHeight, themes_["variables"].inputHeight, Object(themes_["pick"])({ + enterprise: { + comfortable: Object(external_styled_components_["css"])(["padding:", ";"], themes_["variables"].spacingQuarter), + compact: Object(external_styled_components_["css"])(["padding:3px;"]) + }, + prisma: Object(external_styled_components_["css"])(["padding:", ";", " & + &{margin-left:8px;}"], Object(themes_["pick"])({ + comfortable: '5px 8px', + compact: '4px' + }), function (_ref) { + var selected = _ref.selected; + return selected && Object(external_styled_components_["css"])(["font-weight:", ";"], themes_["variables"].fontWeightBold); + }) +})); +var StyledPrevNext = external_styled_components_default.a.div.withConfig({ + displayName: "ButtonStyles__StyledPrevNext", + componentId: "sc-1neztq7-1" +})(["padding:", ";white-space:nowrap;"], Object(themes_["pick"])({ + enterprise: '0 3px', + prisma: '0 8px' +})); + +// CONCATENATED MODULE: ./src/Paginator/Button.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + +var propTypes = { + children: external_prop_types_default.a.node, + label: external_prop_types_default.a.node, + onClick: external_prop_types_default.a.func, + page: external_prop_types_default.a.number, + + /** @private */ + selected: external_prop_types_default.a.bool +}; +var defaultProps = { + selected: false +}; + +var Button_PaginatorButton = /*#__PURE__*/function (_Component) { + _inherits(PaginatorButton, _Component); + + var _super = _createSuper(PaginatorButton); + + function PaginatorButton() { + var _this; + + _classCallCheck(this, PaginatorButton); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props = _this.props, + onClick = _this$props.onClick, + page = _this$props.page; + onClick === null || onClick === void 0 ? void 0 : onClick(e, { + // @ts-expect-error - guaranteed by onClick on StyleButtonSimple below + page: page + }); + }); + + return _this; + } + + _createClass(PaginatorButton, [{ + key: "render", + value: function render() { + var _this$props2 = this.props, + children = _this$props2.children, + label = _this$props2.label, + page = _this$props2.page, + selected = _this$props2.selected; + return /*#__PURE__*/external_react_default.a.createElement(StyledButtonSimple, _extends({ + "data-test": "page", + "data-test-page": page, + appearance: "pill", + onClick: page !== undefined ? this.handleClick : undefined, + inline: false, + selected: selected + }, omit_default()(this.props, keys_default()(PaginatorButton.propTypes))), label, children && /*#__PURE__*/external_react_default.a.createElement(StyledPrevNext, null, children)); + } + }]); + + return PaginatorButton; +}(external_react_["Component"]); + +_defineProperty(Button_PaginatorButton, "propTypes", propTypes); + +_defineProperty(Button_PaginatorButton, "defaultProps", defaultProps); + +/* harmony default export */ var Button = (Button_PaginatorButton); +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronLeft" +var ChevronLeft_ = __nested_webpack_require_3995__(64); +var ChevronLeft_default = /*#__PURE__*/__nested_webpack_require_3995__.n(ChevronLeft_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ChevronLeft" +var react_icons_ChevronLeft_ = __nested_webpack_require_3995__(83); +var react_icons_ChevronLeft_default = /*#__PURE__*/__nested_webpack_require_3995__.n(react_icons_ChevronLeft_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronRight" +var ChevronRight_ = __nested_webpack_require_3995__(35); +var ChevronRight_default = /*#__PURE__*/__nested_webpack_require_3995__.n(ChevronRight_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ChevronRight" +var react_icons_ChevronRight_ = __nested_webpack_require_3995__(43); +var react_icons_ChevronRight_default = /*#__PURE__*/__nested_webpack_require_3995__.n(react_icons_ChevronRight_); + +// CONCATENATED MODULE: ./src/Paginator/PaginatorStyles.ts + + + + + + +var StyledEnterpriseChevronLeftIcon = external_styled_components_default()(ChevronLeft_default.a).withConfig({ + displayName: "PaginatorStyles__StyledEnterpriseChevronLeftIcon", + componentId: "pmabsp-0" +})(["margin:-1px 3px 0 0;"]); +var StyledEnterpriseChevronRightIcon = external_styled_components_default()(ChevronRight_default.a).withConfig({ + displayName: "PaginatorStyles__StyledEnterpriseChevronRightIcon", + componentId: "pmabsp-1" +})(["margin:-1px 0 0 3px;"]); +var compact = Object(external_styled_components_["css"])(["height:20px;width:20px;"]); +var comfortable = Object(external_styled_components_["css"])(["height:24px;width:24px;"]); +var StyledChevronLeftIcon = external_styled_components_default()(react_icons_ChevronLeft_default.a).withConfig({ + displayName: "PaginatorStyles__StyledChevronLeftIcon", + componentId: "pmabsp-2" +})(["margin:-2px 6px 0 0;color:", ";", ""], function (_ref) { + var $disabled = _ref.$disabled; + return $disabled ? themes_["variables"].contentColorDisabled : themes_["variables"].contentColorMuted; +}, Object(themes_["pick"])({ + compact: compact, + comfortable: comfortable +})); +var StyledChevronRightIcon = external_styled_components_default()(react_icons_ChevronRight_default.a).withConfig({ + displayName: "PaginatorStyles__StyledChevronRightIcon", + componentId: "pmabsp-3" +})(["margin:-2px 0 0 6px;color:", ";", ""], function (_ref2) { + var $disabled = _ref2.$disabled; + return $disabled ? themes_["variables"].contentColorDisabled : themes_["variables"].contentColorMuted; +}, Object(themes_["pick"])({ + compact: compact, + comfortable: comfortable +})); + +// CONCATENATED MODULE: ./src/Paginator/Paginator.tsx +function Paginator_extends() { Paginator_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Paginator_extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + + +var Paginator_propTypes = { + alwaysShowLastPageLink: external_prop_types_default.a.bool, + current: external_prop_types_default.a.number, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + numPageLinks: external_prop_types_default.a.number, + onChange: external_prop_types_default.a.func, + totalPages: external_prop_types_default.a.number +}; + +function Paginator(_ref) { + var onChange = _ref.onChange, + _ref$current = _ref.current, + current = _ref$current === void 0 ? 1 : _ref$current, + _ref$alwaysShowLastPa = _ref.alwaysShowLastPageLink, + alwaysShowLastPageLink = _ref$alwaysShowLastPa === void 0 ? false : _ref$alwaysShowLastPa, + _ref$numPageLinks = _ref.numPageLinks, + numPageLinks = _ref$numPageLinks === void 0 ? 5 : _ref$numPageLinks, + totalPages = _ref.totalPages, + otherProps = _objectWithoutProperties(_ref, ["onChange", "current", "alwaysShowLastPageLink", "numPageLinks", "totalPages"]); + + // @docs-props-type PaginatorPropsBase + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; // Can't show more links than total number of pages. + + + var numLinks = Math.min(numPageLinks, totalPages); + var loMid = Math.ceil(numLinks / 2); + var hiMid = Math.ceil(totalPages - numLinks / 2); + var pages = []; + + if (totalPages <= 1) { + return null; + } + + if ((current > totalPages || current < 1) && "production" !== "production") {} + + var firstPage; + var lastPage; + + if (current <= loMid + 1) { + // + 1 to avoid ellipsis between 1 and 2 + firstPage = 1; + lastPage = firstPage + Math.min(totalPages, numLinks) - 1; + } else if (current > loMid && current < hiMid) { + lastPage = Math.ceil(current + (numLinks - 2) / 2); + firstPage = lastPage - numLinks + 2; + } else { + // include page #1 to avoid ellipsis between 1 and 2 + firstPage = totalPages - numLinks === 1 ? 1 : totalPages - numLinks + 1; + lastPage = totalPages; + } // bump up the last page to avoid ellipsis + + + lastPage = alwaysShowLastPageLink && lastPage + 1 === totalPages ? totalPages : lastPage; + pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, { + "data-test": "prev", + disabled: current === 1, + onClick: onChange, + page: current - 1, + key: "prev", + "aria-label": Object(i18n_["_"])('Go to previous page') + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(StyledEnterpriseChevronLeftIcon, { + hideDefaultTooltip: true, + screenReaderText: null + }) : /*#__PURE__*/external_react_default.a.createElement(StyledChevronLeftIcon, { + $disabled: current === 1 + }), Object(i18n_["_"])('Prev'))); + + if (current > loMid && totalPages > numLinks && firstPage !== 1) { + pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, { + label: "1", + key: "first", + onClick: onChange, + page: 1, + "aria-label": Object(i18n_["_"])('Go to first page') + })); + pages.push( /*#__PURE__*/external_react_default.a.createElement(Paginator_PageSeparator, { + "data-test": "page", + key: "prevEllipsis" + })); + } + + for (var i = firstPage; i <= lastPage; i += 1) { + var isCurrent = i === current; + pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, { + label: String(i), + selected: isCurrent, + onClick: onChange, + page: i, + key: i, + "aria-label": isCurrent ? Object(i18n_["_"])('Current page') : Object(format_["sprintf"])(Object(i18n_["_"])('Go to page %(pageNumber)d'), { + pageNumber: i + }) + })); + } + + if (current <= hiMid && totalPages > numLinks && lastPage !== totalPages) { + pages.push( /*#__PURE__*/external_react_default.a.createElement(Paginator_PageSeparator, { + "data-test": "page", + key: "nextEllipsis" + })); + + if (alwaysShowLastPageLink) { + pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, { + "data-test": "last", + label: String(totalPages), + key: "last", + onClick: onChange, + page: totalPages, + "aria-label": Object(i18n_["_"])('Go to last page') + })); + } + } + + pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, { + "data-test": "next", + disabled: current === totalPages, + onClick: onChange, + page: current + 1, + key: "next", + "aria-label": Object(i18n_["_"])('Go to next page') + }, Object(i18n_["_"])('Next'), isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(StyledEnterpriseChevronRightIcon, { + hideDefaultTooltip: true, + screenReaderText: null + }) : /*#__PURE__*/external_react_default.a.createElement(StyledChevronRightIcon, { + $disabled: current === totalPages + }))); + return /*#__PURE__*/external_react_default.a.createElement(Box_default.a, Paginator_extends({ + "data-test": "paginator", + "data-test-current": current, + flex: true, + inline: true, + role: "navigation", + "aria-label": Object(i18n_["_"])('Pagination navigation') + }, otherProps), pages); +} + +Paginator.propTypes = Paginator_propTypes; +/* harmony default export */ var Paginator_Paginator = (Paginator); +// CONCATENATED MODULE: ./src/Paginator/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 28: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(33492); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 35: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(69564); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 43: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(65836); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 62: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(2759); + +/***/ }), + +/***/ 64: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(16861); + +/***/ }), + +/***/ 83: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(88685); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 56143: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 224); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 224: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Paragraph_Paragraph; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/Paragraph/ParagraphStyles.ts + + +var Styled = external_styled_components_default.a.p.withConfig({ + displayName: "ParagraphStyles__Styled", + componentId: "sic5zk-0" +})(["", ";", ";", ""], themes_["mixins"].reset('block'), themes_["mixins"].typography('body'), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["margin-bottom:calc(", " / 2);"], themes_["variables"].lineHeight), + prisma: Object(external_styled_components_["css"])(["margin-bottom:14px;"]) +})); + +// CONCATENATED MODULE: ./src/Paragraph/Paragraph.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]) +}; + +function Paragraph(_ref) { + var children = _ref.children, + elementRef = _ref.elementRef, + otherProps = _objectWithoutProperties(_ref, ["children", "elementRef"]); + + // @docs-props-type ParagraphPropsBase + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + "data-test": "paragraph", + ref: elementRef + }, otherProps), children); +} + +Paragraph.propTypes = propTypes; +/* harmony default export */ var Paragraph_Paragraph = (Paragraph); +// CONCATENATED MODULE: ./src/Paragraph/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 79728: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 185); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3964__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3964__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 147: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(78659); + +/***/ }), + +/***/ 148: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(19747); + +/***/ }), + +/***/ 149: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5287); + +/***/ }), + +/***/ 15: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79859); + +/***/ }), + +/***/ 16: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68973); + +/***/ }), + +/***/ 18: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5353__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_5353__.d(__nested_webpack_exports__, "a", function() { return getWindow; }); +/* unused harmony export ssrWindow */ +/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_5353__(27); +/* eslint-disable @typescript-eslint/no-empty-function */ + +var ssrWindow = { + document: _ssrDocument__WEBPACK_IMPORTED_MODULE_0__[/* ssrDocument */ "b"], + navigator: { + userAgent: '' + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + }, + history: { + replaceState: function replaceState() {}, + pushState: function pushState() {}, + go: function go() {}, + back: function back() {} + }, + CustomEvent: function CustomEvent() { + return this; + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + getComputedStyle: function getComputedStyle() { + return { + getPropertyValue: function getPropertyValue() { + return ''; + } + }; + }, + Image: function Image() {}, + Date: function Date() {}, + screen: {}, + setTimeout: function setTimeout() {}, + clearTimeout: function clearTimeout() {}, + matchMedia: function matchMedia() { + return {}; + }, + requestAnimationFrame: function requestAnimationFrame(callback) { + if (typeof setTimeout === 'undefined') { + callback(); + return null; + } + + return setTimeout(callback, 0); + }, + cancelAnimationFrame: function cancelAnimationFrame(id) { + if (typeof setTimeout === 'undefined') { + return; + } + + clearTimeout(id); + } +}; + +function getWindow() { + var win = typeof window !== 'undefined' ? window : ssrWindow; + return win; +} + + + +/***/ }), + +/***/ 185: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_7204__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_7204__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_7204__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Popover_Popover; }); +__nested_webpack_require_7204__.d(__nested_webpack_exports__, "PopoverContext", function() { return /* reexport */ PopoverContext; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_7204__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_7204__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_7204__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_7204__.n(external_prop_types_); + +// EXTERNAL MODULE: external "react-dom" +var external_react_dom_ = __nested_webpack_require_7204__(90); + +// EXTERNAL MODULE: external "lodash/clamp" +var clamp_ = __nested_webpack_require_7204__(147); +var clamp_default = /*#__PURE__*/__nested_webpack_require_7204__.n(clamp_); + +// EXTERNAL MODULE: external "lodash/defer" +var defer_ = __nested_webpack_require_7204__(55); +var defer_default = /*#__PURE__*/__nested_webpack_require_7204__.n(defer_); + +// EXTERNAL MODULE: external "lodash/every" +var every_ = __nested_webpack_require_7204__(148); +var every_default = /*#__PURE__*/__nested_webpack_require_7204__.n(every_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_7204__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_7204__.n(has_); + +// EXTERNAL MODULE: external "lodash/includes" +var includes_ = __nested_webpack_require_7204__(15); +var includes_default = /*#__PURE__*/__nested_webpack_require_7204__.n(includes_); + +// EXTERNAL MODULE: external "lodash/intersection" +var intersection_ = __nested_webpack_require_7204__(149); +var intersection_default = /*#__PURE__*/__nested_webpack_require_7204__.n(intersection_); + +// EXTERNAL MODULE: external "lodash/isFinite" +var isFinite_ = __nested_webpack_require_7204__(19); +var isFinite_default = /*#__PURE__*/__nested_webpack_require_7204__.n(isFinite_); + +// EXTERNAL MODULE: external "lodash/isFunction" +var isFunction_ = __nested_webpack_require_7204__(69); +var isFunction_default = /*#__PURE__*/__nested_webpack_require_7204__.n(isFunction_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_7204__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_7204__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_7204__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_7204__.n(omit_); + +// EXTERNAL MODULE: external "lodash/throttle" +var throttle_ = __nested_webpack_require_7204__(31); +var throttle_default = /*#__PURE__*/__nested_webpack_require_7204__.n(throttle_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_7204__(0); + +// EXTERNAL MODULE: external "@splunk/react-ui/Animation" +var Animation_ = __nested_webpack_require_7204__(40); + +// EXTERNAL MODULE: external "@splunk/react-ui/EventListener" +var EventListener_ = __nested_webpack_require_7204__(16); +var EventListener_default = /*#__PURE__*/__nested_webpack_require_7204__.n(EventListener_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Layer" +var Layer_ = __nested_webpack_require_7204__(82); +var Layer_default = /*#__PURE__*/__nested_webpack_require_7204__.n(Layer_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext" +var ScrollContainerContext_ = __nested_webpack_require_7204__(50); +var ScrollContainerContext_default = /*#__PURE__*/__nested_webpack_require_7204__.n(ScrollContainerContext_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/focus" +var focus_ = __nested_webpack_require_7204__(29); + +// CONCATENATED MODULE: ./src/Popover/getPlacement.ts +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function getInitialStyle(_ref) { + var align = _ref.align, + anchorPos = _ref.anchorPos, + outerContainerEl = _ref.outerContainerEl, + padding = _ref.padding, + placement = _ref.placement; + + switch (placement) { + case 'above': + return { + top: anchorPos.top - outerContainerEl.offsetHeight, + left: align === 'edge' ? anchorPos.left - padding : anchorPos.middle - outerContainerEl.offsetWidth / 2 + }; + + case 'below': + // Align 'end' is only supported by below + // TODO: SUI-5101 Enable users to align Popover and Dropdown + if (align === 'end') { + return { + top: anchorPos.bottom, + left: anchorPos.right - outerContainerEl.offsetWidth + padding + }; + } + + return { + top: anchorPos.bottom, + left: align === 'edge' ? anchorPos.left - padding : anchorPos.middle - outerContainerEl.offsetWidth / 2 + }; + + case 'left': + return { + top: align === 'edge' ? anchorPos.top - padding : anchorPos.center - outerContainerEl.offsetHeight / 2, + left: anchorPos.left - outerContainerEl.offsetWidth + }; + + case 'right': + return { + top: align === 'edge' ? anchorPos.top - padding : anchorPos.center - outerContainerEl.offsetHeight / 2, + left: anchorPos.right + }; + + default: + throw new Error("".concat(placement, " is not a valid placement value. Valid options are: 'above', 'below', 'left', or 'right'")); + } +} + +function getPlacement(args) { + var align = args.align, + anchorPos = args.anchorPos, + scrollContainerPos = args.scrollContainerPos, + canCoverAnchor = args.canCoverAnchor, + defaultPlacement = args.defaultPlacement, + outerContainerEl = args.outerContainerEl, + padding = args.padding, + repositionMode = args.repositionMode, + windowHeight = args.windowHeight, + windowWidth = args.windowWidth; + var repositionFlip = repositionMode === 'flip'; + var repositionAny = repositionMode === 'any'; + var canReposition = repositionFlip || repositionAny; + var placement = args.placement || defaultPlacement; // Translate vertical/horizontal to above/below/left/right + + if (defaultPlacement === 'vertical') { + placement = anchorPos.top > windowHeight - anchorPos.bottom ? 'above' : 'below'; + } else if (defaultPlacement === 'horizontal') { + placement = anchorPos.left > windowWidth - anchorPos.right ? 'left' : 'right'; + } + + var resolvedPlacement = placement; // Initialize the result variables. These will be mutated as needed and returned. + + var _getInitialStyle = getInitialStyle({ + align: align, + anchorPos: anchorPos, + outerContainerEl: outerContainerEl, + padding: padding, + placement: resolvedPlacement + }), + top = _getInitialStyle.top, + left = _getInitialStyle.left; + + var bottom = 'auto'; + var maxWidth = windowWidth; + var maxHeight = windowHeight; + var placementStatus = resolvedPlacement; // Boolean convenience variables to simplify positioning logic. + + var canPlaceAbove = anchorPos.top - outerContainerEl.offsetHeight > 0; + var canPlaceBelow = anchorPos.bottom + outerContainerEl.offsetHeight < windowHeight; + var canPlaceLeft = anchorPos.left - outerContainerEl.offsetWidth > 0; + var canPlaceRight = anchorPos.right + outerContainerEl.offsetWidth < windowWidth; + var significantlyMoreSpaceAbove = anchorPos.top * 0.7 > windowHeight - anchorPos.bottom; + var offScreenRight = (align === 'edge' ? anchorPos.left + outerContainerEl.offsetWidth - padding : anchorPos.middle + outerContainerEl.offsetWidth / 2) > windowWidth; + var offScreenLeft = (align === 'edge' ? anchorPos.left - padding : anchorPos.middle - outerContainerEl.offsetWidth / 2) < 0; + var offScreenTop = (align === 'edge' ? anchorPos.top - padding : anchorPos.top - outerContainerEl.offsetHeight / 2) < 0; + var offScreenBottom = (align === 'edge' ? anchorPos.top + outerContainerEl.offsetHeight - padding : anchorPos.bottom + outerContainerEl.offsetHeight / 2) > windowHeight; // Handle each of the four placement options individually. + + if (placementStatus === 'above') { + if (!canPlaceAbove && canReposition) { + if (canPlaceBelow) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'below' + })); + } + + if (repositionAny && canPlaceRight) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'right' + })); + } + + if (repositionAny && canPlaceLeft) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'left' + })); + } + + if (canCoverAnchor) { + placementStatus = 'misaligned'; + top = 0; + } + } + + if (placementStatus !== 'misaligned') { + bottom = windowHeight - top - outerContainerEl.offsetHeight; + + if (scrollContainerPos) { + bottom = Math.min(bottom, windowHeight - scrollContainerPos.top); + } + + top = 'auto'; + } + + if (offScreenRight) { + left = Math.max(windowWidth - outerContainerEl.offsetWidth, 0); + } else if (offScreenLeft) { + left = 0; + } + + if (!canCoverAnchor) { + maxHeight = anchorPos.top; + } + } + + if (placementStatus === 'below') { + if (!canPlaceBelow && canReposition) { + if (canPlaceAbove && significantlyMoreSpaceAbove) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'above' + })); + } + + if (repositionAny && canPlaceRight) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'right' + })); + } + + if (repositionAny && canPlaceLeft) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'left' + })); + } + + if (canCoverAnchor) { + placementStatus = 'misaligned'; + top = 0; + } + } + + if (scrollContainerPos) { + top = Math.min(top, scrollContainerPos.bottom); + } + + if (offScreenRight) { + left = Math.max(windowWidth - outerContainerEl.offsetWidth, 0); + } else if (offScreenLeft) { + left = 0; + } + + if (!canCoverAnchor) { + maxHeight = windowHeight - anchorPos.bottom; + } + } + + if (placementStatus === 'left') { + if (!canPlaceLeft && canReposition) { + if (canPlaceRight) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'right' + })); + } + + if (repositionAny && canPlaceBelow) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'below' + })); + } + + if (repositionAny && canPlaceAbove) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'above' + })); + } + + if (canCoverAnchor) { + placementStatus = 'misaligned'; + top = 0; + } + } + + if (offScreenTop) { + top = 0; + } else if (offScreenBottom) { + top = Math.max(windowHeight - outerContainerEl.offsetHeight, 0); + } + + if (!canCoverAnchor) { + maxWidth = anchorPos.left; + } + } + + if (placementStatus === 'right') { + if (!canPlaceRight && canReposition) { + if (canPlaceLeft) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'left' + })); + } + + if (repositionAny && canPlaceBelow) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'below' + })); + } + + if (repositionAny && canPlaceAbove) { + return getPlacement(_objectSpread(_objectSpread({}, args), {}, { + placement: 'above' + })); + } + + if (canCoverAnchor) { + placementStatus = 'misaligned'; + top = 0; + } + } + + if (offScreenTop) { + top = 0; + } else if (offScreenBottom) { + top = Math.max(windowHeight - outerContainerEl.offsetHeight, 0); + } + + if (!canCoverAnchor) { + maxWidth = windowWidth - anchorPos.left; + } + } + + return { + placement: placementStatus, + maxHeight: maxHeight, + maxWidth: maxWidth, + outerContainerStyle: { + top: top, + left: left, + bottom: bottom + } + }; +} +// CONCATENATED MODULE: ./src/Popover/PopoverContext.tsx + +var PopoverContext = /*#__PURE__*/Object(external_react_["createContext"])({}); + +// EXTERNAL MODULE: external "react-spring" +var external_react_spring_ = __nested_webpack_require_7204__(24); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_7204__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_7204__.n(external_styled_components_); + +// CONCATENATED MODULE: ./src/Popover/PopoverStyles.ts + + + +var PopoverStyles_arrowHeight = Object(themes_["pick"])({ + enterprise: '8px', + prisma: 0 +}); +var Styled = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({ + displayName: "PopoverStyles__Styled", + componentId: "sc-1nahsvw-0" +})(["position:fixed;z-index:", ";left:-300%;top:-300%;"], themes_["variables"].zindexPopover); +var StyledBox = external_styled_components_default.a.div.withConfig({ + displayName: "PopoverStyles__StyledBox", + componentId: "sc-1nahsvw-1" +})(["", ";", ";", ";"], themes_["mixins"].reset('block'), function (_ref) { + var $open = _ref.$open; + return !$open && Object(external_styled_components_["css"])(["pointer-events:none;"]); +}, function (_ref2) { + var $appearance = _ref2.$appearance; + return $appearance !== 'none' && Object(external_styled_components_["css"])(["padding:8px;"]); +}); +var StyledContent = external_styled_components_default.a.div.withConfig({ + displayName: "PopoverStyles__StyledContent", + componentId: "sc-1nahsvw-2" +})(["", ""], Object(themes_["pickVariant"])('$appearance', { + normal: Object(external_styled_components_["css"])(["background-color:", ";color:", ";border:", ";box-shadow:", ";border-radius:", ";"], themes_["variables"].backgroundColorPopup, themes_["variables"].contentColorDefault, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].border, + dark: themes_["variables"].border + }, + prisma: 'none' + }), Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["0 2px 2px ", ""], themes_["mixins"].colorWithAlpha(themes_["variables"].gray20, 0.1)), + dark: '0 1px 2px #000' + }, + prisma: themes_["variables"].overlayShadow + }), themes_["variables"].borderRadius), + // Enterprise Only + inverted: Object(external_styled_components_["css"])(["background-color:", ";color:", ";"], Object(themes_["pick"])({ + light: themes_["variables"].gray20, + dark: themes_["variables"].white + }), Object(themes_["pick"])({ + light: themes_["variables"].white, + dark: themes_["variables"].gray30 + })) +})); // Enterprise Only + +var StyledArrow = external_styled_components_default.a.div.withConfig({ + displayName: "PopoverStyles__StyledArrow", + componentId: "sc-1nahsvw-3" +})(["width:0;height:0;border-left:", " solid transparent;border-right:", " solid transparent;position:absolute;border-bottom-width:", ";border-bottom-style:solid;", ""], PopoverStyles_arrowHeight, PopoverStyles_arrowHeight, PopoverStyles_arrowHeight, Object(themes_["pickVariant"])('$appearance', { + normal: Object(external_styled_components_["css"])(["border-bottom-color:", ";&::before{content:'';display:block;width:0;height:0;border-left:", " solid transparent;border-right:", " solid transparent;border-bottom:", " solid ", ";position:absolute;top:1px;left:0;margin-left:-", ";}"], Object(themes_["pick"])({ + light: themes_["variables"].borderColor, + dark: themes_["variables"].black + }), PopoverStyles_arrowHeight, PopoverStyles_arrowHeight, PopoverStyles_arrowHeight, themes_["variables"].backgroundColor, PopoverStyles_arrowHeight), + inverted: Object(external_styled_components_["css"])(["border-bottom-color:", ";"], Object(themes_["pick"])({ + light: themes_["variables"].gray20, + dark: themes_["variables"].white + })) +})); +var StyledLowerRightCorner = external_styled_components_default.a.div.withConfig({ + displayName: "PopoverStyles__StyledLowerRightCorner", + componentId: "sc-1nahsvw-4" +})(["position:fixed;right:0;bottom:0;"]); +var StyledHitArea = external_styled_components_default.a.svg.withConfig({ + displayName: "PopoverStyles__StyledHitArea", + componentId: "sc-1nahsvw-5" +})(["position:fixed;pointer-events:none;path{pointer-events:auto;stroke-width:0;stroke:transparent;fill:transparent;}"]); + +// CONCATENATED MODULE: ./src/Popover/PopoverHitArea.tsx +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + +var propTypes = { + anchorRect: external_prop_types_default.a.object, + popoverEl: external_prop_types_default.a.object, + popoverPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'misaligned']) +}; + +var getHitAreaSettings = function getHitAreaSettings(_ref) { + var anchorRect = _ref.anchorRect, + popoverEl = _ref.popoverEl, + popoverPlacement = _ref.popoverPlacement; + + if (anchorRect != null && popoverEl != null && popoverPlacement != null) { + var menuRect = popoverEl.getBoundingClientRect(); + + if (popoverPlacement === 'above' || popoverPlacement === 'below') { + var anchorLeftEdge = anchorRect.left - menuRect.left; + var verticalStart = anchorRect.height; + var verticalEnd = 0; + + if (popoverPlacement === 'above') { + verticalStart = 0; + verticalEnd = anchorRect.height; + } + + var menuStart = "0 ".concat(verticalStart); + var menuEnd = "".concat(menuRect.width, " ").concat(verticalStart); + var anchorStartNear = "".concat(anchorLeftEdge, " ").concat(verticalStart); + var anchorStartFar = "".concat(anchorLeftEdge, " ").concat(verticalEnd); + var anchorEndNear = "".concat(anchorLeftEdge + anchorRect.width, " ").concat(verticalStart); + var anchorEndFar = "".concat(anchorLeftEdge + anchorRect.width, " ").concat(verticalEnd); + var hitAreaPath = "\n M ".concat(menuStart, "\n S ").concat(anchorStartNear, " , ").concat(anchorStartFar, "\n L ").concat(anchorStartNear, "\n L ").concat(anchorEndNear, "\n L ").concat(anchorEndFar, "\n S ").concat(anchorEndNear, " , ").concat(menuEnd, "\n "); + return { + hitAreaPath: hitAreaPath, + hitAreaStyle: { + left: menuRect.left, + top: anchorRect.top, + width: menuRect.width, + height: anchorRect.height + } + }; + } + + if (popoverPlacement === 'left' || popoverPlacement === 'right') { + var anchorTopEdge = anchorRect.top - menuRect.top; + var horizontalStart = 0; + var horizontalEnd = anchorRect.width; + + if (popoverPlacement === 'right') { + horizontalStart = anchorRect.width; + horizontalEnd = 0; + } + + var _menuStart = "".concat(horizontalStart, " 0"); + + var _menuEnd = "".concat(horizontalStart, " ").concat(menuRect.height); + + var _anchorStartNear = "".concat(horizontalStart, " ").concat(anchorTopEdge); + + var _anchorStartFar = "".concat(horizontalEnd, " ").concat(anchorTopEdge); + + var _anchorEndNear = "".concat(horizontalStart, " ").concat(anchorTopEdge + anchorRect.height); + + var _anchorEndFar = "".concat(horizontalEnd, " ").concat(anchorTopEdge + anchorRect.height); + + var _hitAreaPath = "\n M ".concat(_menuStart, "\n S ").concat(_anchorStartNear, " , ").concat(_anchorStartFar, "\n L ").concat(_anchorStartNear, "\n L ").concat(_anchorEndNear, "\n L ").concat(_anchorEndFar, "\n S ").concat(_anchorEndNear, " , ").concat(_menuEnd, "\n "); + + return { + hitAreaPath: _hitAreaPath, + hitAreaStyle: { + left: anchorRect.left, + top: menuRect.top, + width: anchorRect.width, + height: menuRect.height + } + }; + } + } + + return { + hitAreaPath: null, + hitAreaStyle: {} + }; +}; + +var PopoverHitArea = /*#__PURE__*/external_react_default.a.forwardRef(function (_ref2, ref) { + var anchorRect = _ref2.anchorRect, + popoverEl = _ref2.popoverEl, + popoverPlacement = _ref2.popoverPlacement; + + var _useState = Object(external_react_["useState"])(null), + _useState2 = _slicedToArray(_useState, 2), + hitAreaPathState = _useState2[0], + setHitAreaPathState = _useState2[1]; + + var _useState3 = Object(external_react_["useState"])({}), + _useState4 = _slicedToArray(_useState3, 2), + hitAreaStyleState = _useState4[0], + setHitAreaStyleState = _useState4[1]; + + Object(external_react_["useEffect"])(function () { + var _getHitAreaSettings = getHitAreaSettings({ + anchorRect: anchorRect, + popoverEl: popoverEl, + popoverPlacement: popoverPlacement + }), + hitAreaPath = _getHitAreaSettings.hitAreaPath, + hitAreaStyle = _getHitAreaSettings.hitAreaStyle; + + setHitAreaPathState(hitAreaPath); + setHitAreaStyleState(hitAreaStyle); + }, [anchorRect, popoverEl, popoverPlacement]); + + if (hitAreaPathState != null) { + return /*#__PURE__*/external_react_default.a.createElement(StyledHitArea, { + "data-test": "popover-hit-area", + style: hitAreaStyleState + }, /*#__PURE__*/external_react_default.a.createElement("path", { + d: hitAreaPathState, + ref: ref + })); + } + + return null; +}); +PopoverHitArea.propTypes = propTypes; +/* harmony default export */ var Popover_PopoverHitArea = (PopoverHitArea); +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_7204__(11); + +// EXTERNAL MODULE: ./src/utils/ssrWindow.ts +var ssrWindow = __nested_webpack_require_7204__(18); + +// CONCATENATED MODULE: ./src/Popover/Popover.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Popover_unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Popover_arrayLikeToArray(arr); } + +function Popover_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function Popover_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Popover_ownKeys(Object(source), true).forEach(function (key) { Popover_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Popover_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function Popover_slicedToArray(arr, i) { return Popover_arrayWithHoles(arr) || Popover_iterableToArrayLimit(arr, i) || Popover_unsupportedIterableToArray(arr, i) || Popover_nonIterableRest(); } + +function Popover_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function Popover_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Popover_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Popover_arrayLikeToArray(o, minLen); } + +function Popover_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function Popover_iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function Popover_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function Popover_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + + + + + + + + + + + + + + +/** @public */ + +var possibleCloseReasons = ['clickAway', 'escapeKey', 'offScreen', 'tabKey']; +var Popover_propTypes = { + align: external_prop_types_default.a.oneOf(['center', 'edge', 'theme', 'end']), + anchor: external_prop_types_default.a.object, + animation: external_prop_types_default.a.bool, + animationConfig: external_prop_types_default.a.object, + appearance: external_prop_types_default.a.oneOf(['normal', 'inverted', 'none']), + autoCloseWhenOffScreen: external_prop_types_default.a.bool, + canCoverAnchor: external_prop_types_default.a.bool, + children: external_prop_types_default.a.oneOfType([external_prop_types_default.a.node, external_prop_types_default.a.func]), + closeReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)), + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'vertical', 'horizontal']), + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + id: external_prop_types_default.a.string, + hitAreaRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + onRequestClose: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + outerRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + pointTo: external_prop_types_default.a.shape({ + x: external_prop_types_default.a.number, + y: external_prop_types_default.a.number + }), + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip', 'any']), + retainFocus: external_prop_types_default.a.bool, + takeFocus: external_prop_types_default.a.bool, + splunkTheme: external_prop_types_default.a.object +}; +var defaultProps = { + align: 'theme', + animation: true, + animationConfig: {}, + appearance: 'normal', + autoCloseWhenOffScreen: true, + canCoverAnchor: false, + closeReasons: possibleCloseReasons, + defaultPlacement: 'below', + open: false, + repositionMode: 'flip', + retainFocus: true, + takeFocus: false +}; + +// eslint-disable-next-line @typescript-eslint/ban-types +function everyApproxEqual(a, b) { + var threshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; + return !!a && !!b && every_default()(a, function (val, key) { + if (isFinite_default()(val)) { + return Math.abs(b[key] - val) <= threshold; + } + + return b[key] === val; + }); +} + +function isHTMLElement(container) { + return container !== window && container !== window.document; +} +/** + * `Popover` is used to create layovers such as dropdowns, contextual menus, or tooltips. Use + * this only when the other components don't provide sufficient functionality or control. A controlled + * `Dropdown` covers use cases where you might consider using `Popover` directly. + */ + + +var Popover_Popover = /*#__PURE__*/function (_Component) { + _inherits(Popover, _Component); + + var _super = _createSuper(Popover); + + _createClass(Popover, null, [{ + key: "getArrowStyle", + // @docs-props-type PopoverPropsBase + value: function getArrowStyle(_ref) { + var anchorPos = _ref.anchorPos, + arrowHeight = _ref.arrowHeight, + placement = _ref.placement, + outerContainerStyle = _ref.outerContainerStyle, + outerContainerEl = _ref.outerContainerEl; + + if (placement === 'misaligned') { + return [{ + display: 'none' + }]; + } + + var style = { + display: 'block' + }; + var maxVertDiff = outerContainerEl.offsetHeight / 2 - 22; + var minVertDiff = -(outerContainerEl.offsetHeight / 2 - 15); + var initVertDiff = anchorPos.center - (outerContainerStyle.top + outerContainerEl.offsetHeight / 2) - arrowHeight / 2; + var vertDiff = clamp_default()(initVertDiff, minVertDiff, maxVertDiff); + var horizontalDiff = anchorPos.middle - (outerContainerStyle.left + outerContainerEl.offsetWidth / 2) - arrowHeight; + var transformMetadata = { + left: { + translateX: arrowHeight / 2, + translateY: vertDiff, + rotate: 90 + }, + right: { + translateX: -arrowHeight / 2, + translateY: vertDiff, + rotate: -90 + }, + above: { + translateX: horizontalDiff, + translateY: 0, + rotate: 180 + }, + below: { + translateX: horizontalDiff, + translateY: 0, + rotate: 0 + } + }; + var transformMeta = transformMetadata[placement]; + style.transform = "translate(".concat(transformMeta.translateX, "px, ").concat(transformMeta.translateY, "px) rotate(").concat(transformMeta.rotate, "deg)"); // set new positions + + var origin1 = { + left: 'right', + right: 'left', + above: 'bottom', + below: 'top' + }; + style[origin1[placement]] = '1px'; + var origin2 = { + left: 'top', + right: 'top', + above: 'left', + below: 'left' + }; + style[origin2[placement]] = '50%'; + return [style, transformMeta]; + } + }]); + + function Popover(props) { + var _this; + + _classCallCheck(this, Popover); + + _this = _super.call(this, props); + + Popover_defineProperty(_assertThisInitialized(_this), "outerContainerEl", null); + + Popover_defineProperty(_assertThisInitialized(_this), "innerContainerEl", null); + + Popover_defineProperty(_assertThisInitialized(_this), "arrow", null); + + Popover_defineProperty(_assertThisInitialized(_this), "windowSizeMeasurementEl", null); + + Popover_defineProperty(_assertThisInitialized(_this), "handleScroll", void 0); + + Popover_defineProperty(_assertThisInitialized(_this), "handleWindowScroll", void 0); + + Popover_defineProperty(_assertThisInitialized(_this), "allowAnimationUpdates", true); + + Popover_defineProperty(_assertThisInitialized(_this), "getElPosition", function (anchorEl) { + var rect = anchorEl.getBoundingClientRect(); + var a = { + width: anchorEl.offsetWidth, + height: anchorEl.offsetHeight + }; + var pointTo = _this.props.pointTo; + var pointToHorizontal = pointTo && has_default()(pointTo, 'x'); + var pointToVertical = pointTo && has_default()(pointTo, 'y'); + a.left = pointToHorizontal ? rect.left + ((pointTo === null || pointTo === void 0 ? void 0 : pointTo.x) || 0) : rect.left; + a.top = pointToVertical ? rect.top + ((pointTo === null || pointTo === void 0 ? void 0 : pointTo.y) || 0) : rect.top; + a.right = pointToHorizontal ? a.left + a.width : rect.left + a.width || rect.right; + a.bottom = pointToVertical ? a.top + a.height : rect.top + a.height || rect.bottom; + a.middle = pointToHorizontal ? a.left : rect.left + (a.right - rect.left) / 2; + a.center = pointToVertical ? a.top : rect.top + (a.bottom - rect.top) / 2; + return a; + }); + + Popover_defineProperty(_assertThisInitialized(_this), "setPlacement", function (scrolling) { + var window = Object(ssrWindow["a" /* getWindow */])(); + + _this.setState(function (state) { + var _state$arrowStyleTran; + + var _this$props = _this.props, + align = _this$props.align, + anchor = _this$props.anchor, + autoCloseWhenOffScreen = _this$props.autoCloseWhenOffScreen, + canCoverAnchor = _this$props.canCoverAnchor, + defaultPlacement = _this$props.defaultPlacement, + open = _this$props.open, + repositionMode = _this$props.repositionMode, + splunkTheme = _this$props.splunkTheme; + var scrollContainer = _this.context || window; + var isPrisma = splunkTheme.isPrisma; // If these conditions are not met, we cannot set the popover. + + if (!open || !_this.outerContainerEl || !anchor || !state.anchorEl || !_this.windowSizeMeasurementEl) { + if (false) {} + + return null; + } + + var anchorPos = _this.getElPosition(state.anchorEl); + + var scrollContainerPos = isHTMLElement(scrollContainer) ? _this.getElPosition(scrollContainer) : undefined; + + if (scrolling && autoCloseWhenOffScreen) { + if (_this.autoCloseWhenOffScreen(anchorPos, scrollContainerPos)) { + return null; + } + } + + var arrowHeight = isPrisma ? 0 : 8; + var padding = 8; + var defaultAlignment = isPrisma ? 'edge' : 'center'; + + var _getPlacement = getPlacement({ + align: align === 'theme' ? defaultAlignment : align, + anchorPos: anchorPos, + scrollContainerPos: scrollContainerPos, + canCoverAnchor: canCoverAnchor, + defaultPlacement: defaultPlacement, + repositionMode: repositionMode, + outerContainerEl: _this.outerContainerEl, + padding: padding, + windowWidth: _this.windowSizeMeasurementEl.offsetLeft, + windowHeight: _this.windowSizeMeasurementEl.offsetTop + }), + placement = _getPlacement.placement, + outerContainerStyle = _getPlacement.outerContainerStyle, + maxHeight = _getPlacement.maxHeight, + maxWidth = _getPlacement.maxWidth; + + var _ref2 = _this.arrow ? Popover.getArrowStyle({ + anchorPos: anchorPos, + arrowHeight: arrowHeight, + outerContainerStyle: outerContainerStyle, + placement: placement, + outerContainerEl: _this.outerContainerEl + }) : [], + _ref3 = Popover_slicedToArray(_ref2, 2), + arrowStyle = _ref3[0], + arrowStyleTransformMeta = _ref3[1]; + + var hasArrow = _this.props.appearance !== 'none' && !isPrisma; + var baseCheck = everyApproxEqual(anchorPos, state.anchorPos) && everyApproxEqual(outerContainerStyle, state.outerContainerStyle) && placement === state.placement && maxHeight === state.maxHeight && maxWidth === state.maxWidth; + var arrowCheck = everyApproxEqual(omit_default()(arrowStyle, 'transform'), omit_default()(state.arrowStyle, 'transform')) && everyApproxEqual(arrowStyleTransformMeta !== null && arrowStyleTransformMeta !== void 0 ? arrowStyleTransformMeta : {}, (_state$arrowStyleTran = state.arrowStyleTransformMeta) !== null && _state$arrowStyleTran !== void 0 ? _state$arrowStyleTran : {}); // If none of the position data has changed, do not set state. + + if (baseCheck && (!hasArrow || hasArrow && arrowCheck)) { + return null; + } + + return { + anchorPos: anchorPos, + arrowStyle: arrowStyle, + arrowStyleTransformMeta: arrowStyleTransformMeta, + outerContainerStyle: outerContainerStyle, + placement: placement, + maxHeight: maxHeight, + maxWidth: maxWidth + }; + }); + }); + + Popover_defineProperty(_assertThisInitialized(_this), "handleNewAnchor", function (anchor) { + var anchorEl; + + if (anchor && !(anchor instanceof HTMLElement)) { + if (false) {} + + anchorEl = Object(external_react_dom_["findDOMNode"])(anchor); // eslint-disable-line react/no-find-dom-node + } else { + anchorEl = anchor !== null && anchor !== void 0 ? anchor : undefined; + } + + var anchorPos = anchorEl ? _this.getElPosition(anchorEl) : undefined; + + _this.setState({ + anchorEl: anchorEl, + anchorPos: anchorPos + }); // eslint-disable-line react/no-unused-state + + }); + + Popover_defineProperty(_assertThisInitialized(_this), "handleInnerContainerMount", function (el) { + _this.innerContainerEl = el; + + if (el && _this.props.takeFocus) { + defer_default()(focus_["takeFocus"], el); + } + + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + Popover_defineProperty(_assertThisInitialized(_this), "handleOuterContainerMount", function (el) { + _this.outerContainerEl = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.outerRef, el); + }); + + Popover_defineProperty(_assertThisInitialized(_this), "handleTab", function (e) { + if (_this.innerContainerEl) { + if (_this.props.retainFocus) { + Object(focus_["handleTab"])(_this.innerContainerEl, e); + } else if (Object(focus_["isTabKey"])(e)) { + var tabbableElements = Object(focus_["getSortedTabbableElements"])(_this.innerContainerEl); + + if (tabbableElements.length > 0) { + var finalTabbale = e.shiftKey ? tabbableElements[0] : tabbableElements[tabbableElements.length - 1]; + + if (finalTabbale === e.target) { + _this.handleRequestClose({ + event: e, + reason: 'tabKey' + }); + } + } + } + } + }); + + Popover_defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (data) { + if (_this.props.open) { + _this.requestClose(data); + } + }); + + Popover_defineProperty(_assertThisInitialized(_this), "handleAnimationEnd", function () { + if (_this.allowAnimationUpdates) { + _this.setState({ + animating: false + }); + } + }); + + Popover_defineProperty(_assertThisInitialized(_this), "renderLayer", function () { + var _this$props2 = _this.props, + animation = _this$props2.animation, + animationConfig = _this$props2.animationConfig, + appearance = _this$props2.appearance, + children = _this$props2.children, + id = _this$props2.id, + open = _this$props2.open, + retainFocus = _this$props2.retainFocus, + splunkTheme = _this$props2.splunkTheme; + var _this$state = _this.state, + anchorPos = _this$state.anchorPos, + arrowStyle = _this$state.arrowStyle, + outerContainerStyle = _this$state.outerContainerStyle, + placement = _this$state.placement; + var isPrisma = splunkTheme.isPrisma; + var displayAppearance = isPrisma && appearance === 'inverted' ? 'normal' : appearance; + var _this$state2 = _this.state, + maxHeight = _this$state2.maxHeight, + maxWidth = _this$state2.maxWidth; // eslint-disable-line prefer-const + // Accommodate the arrow in the maxHeight and maxWidth. + + if (appearance !== 'none') { + if (isFinite_default()(maxHeight)) { + maxHeight -= 20; + } + + if (isFinite_default()(maxWidth)) { + maxWidth -= 20; + } + } + + var childData = { + anchorHeight: anchorPos ? anchorPos.height : null, + anchorWidth: anchorPos ? anchorPos.width : null, + placement: placement || null, + maxHeight: maxHeight || null, + maxWidth: maxWidth || null + }; + var motionStyle = animation ? { + opacity: open ? 1 : 0 + } : { + opacity: 1 + }; + /* eslint-disable jsx-a11y/no-static-element-interactions */ + + return /*#__PURE__*/external_react_default.a.createElement(Animation_["Spring"], { + from: { + opacity: animation ? 0 : 1 + }, + to: motionStyle, + config: Popover_objectSpread({ + tension: 300, + friction: 40 + }, animationConfig), + onRest: _this.handleAnimationEnd + }, function (interpolatedStyles) { + return /*#__PURE__*/external_react_default.a.createElement(Styled, { + "data-test": "outer-popover", + style: Popover_objectSpread(Popover_objectSpread({}, outerContainerStyle), interpolatedStyles), + ref: _this.handleOuterContainerMount + }, (open || _this.state.animating) && /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + $appearance: displayAppearance, + $open: open, + "data-test": "popover", + ref: _this.handleInnerContainerMount, + tabIndex: -1, + id: id, + onKeyDown: _this.handleTab // TODO: remove anchor once prop type generation is fixed + + }, omit_default()(_this.props, ['anchor'].concat(_toConsumableArray(keys_default()(Popover.propTypes))))), /*#__PURE__*/external_react_default.a.createElement(PopoverContext.Provider, { + value: { + retainFocus: retainFocus + } + }, /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, appearance === 'none' && children, appearance !== 'none' && !isPrisma && /*#__PURE__*/external_react_default.a.createElement(StyledArrow, { + $appearance: displayAppearance, + ref: function ref(arrow) { + _this.arrow = arrow; + }, + style: arrowStyle + }), appearance !== 'none' && /*#__PURE__*/external_react_default.a.createElement(StyledContent, { + $appearance: displayAppearance + }, isFunction_default()(children) ? children(childData) : children)))), /*#__PURE__*/external_react_default.a.createElement(StyledLowerRightCorner, { + ref: function ref(el) { + _this.windowSizeMeasurementEl = el; + } + })); + }); + /* eslint-enable jsx-a11y/no-static-element-interactions */ + }); + + _this.handleScroll = throttle_default()(_this.setPlacement.bind(_assertThisInitialized(_this), true), 0); + _this.handleWindowScroll = throttle_default()(_this.setPlacement.bind(_assertThisInitialized(_this), true), 0); + _this.setPlacement = throttle_default()(_this.setPlacement, 0, { + leading: false + }); + _this.state = { + animating: false, + prevOpen: props.open // eslint-disable-line react/no-unused-state + + }; + return _this; + } + + _createClass(Popover, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.handleNewAnchor(this.props.anchor); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (prevProps.anchor !== this.props.anchor) { + this.handleNewAnchor(this.props.anchor); + } + + if (!this.innerContainerEl) { + return; + } + + if (this.props.open || this.state.animating) { + this.setPlacement(); // make sure that the popover both was not open before and is actually open now + // this prevents bugs like #4 in SUI-2054 where popover contents re-rendering due to animation + // causes the popover contents to receive focus even though the popover closing + + if (!prevProps.open && this.props.open && this.props.takeFocus) { + Object(focus_["takeFocus"])(this.innerContainerEl); + } + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.setPlacement.cancel(); // guaranteed by constructor + + this.handleScroll.cancel(); + this.allowAnimationUpdates = false; + } + }, { + key: "autoCloseWhenOffScreen", + value: function autoCloseWhenOffScreen(anchorPosition, scrollContainerPosition) { + var window = Object(ssrWindow["a" /* getWindow */])(); + + if (anchorPosition.top < 0 || anchorPosition.top > window.innerHeight || anchorPosition.left < 0 || anchorPosition.left > window.innerWidth) { + this.requestClose({ + reason: 'offScreen' + }); + return true; + } + + if (scrollContainerPosition) { + if (anchorPosition.height + anchorPosition.top < scrollContainerPosition.top || anchorPosition.top > scrollContainerPosition.bottom || anchorPosition.width + anchorPosition.left < scrollContainerPosition.left || anchorPosition.left > scrollContainerPosition.right) { + this.requestClose({ + reason: 'offScreen' + }); + return true; + } + } + + return false; + } + }, { + key: "requestClose", + value: function requestClose(data) { + if (includes_default()(this.props.closeReasons, data.reason)) { + var _this$props$onRequest, _this$props3; + + (_this$props$onRequest = (_this$props3 = this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props3, data); + } + } + }, { + key: "render", + value: function render() { + var window = Object(ssrWindow["a" /* getWindow */])(); + var open = this.props.open || this.state.animating; + var scrollContainer = this.context || window; + var hasCustomizedScrollContainer = scrollContainer !== window; + var _this$state3 = this.state, + anchorPos = _this$state3.anchorPos, + placement = _this$state3.placement; + return [hasCustomizedScrollContainer && /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: scrollContainer, + eventType: "scroll", + listener: this.handleScroll, + options: { + passive: false, + capture: true + }, + key: "eventListener" + }), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "resize", + listener: this.setPlacement, + key: "eventListenerOnWindowResize" + }), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "scroll", + listener: this.handleWindowScroll, + options: { + passive: false, + capture: true + }, + key: "eventListenerOnWindowScroll" + }), /*#__PURE__*/external_react_default.a.createElement(Layer_default.a, { + closeReasons: intersection_default()(this.props.closeReasons.filter(function (reason) { + return reason !== 'offScreen'; + }), Layer_default.a.possibleCloseReasons), + open: open, + onRequestClose: this.handleRequestClose, + key: "Layer" + }, open && this.innerContainerEl && this.props.hitAreaRef && /*#__PURE__*/external_react_default.a.createElement(Popover_PopoverHitArea, { + anchorRect: anchorPos, + popoverEl: this.innerContainerEl, + popoverPlacement: placement, + ref: this.props.hitAreaRef + }), open && this.renderLayer())]; + } + }]); + + return Popover; +}(external_react_["Component"]); + +Popover_defineProperty(Popover_Popover, "contextType", ScrollContainerContext_default.a); + +Popover_defineProperty(Popover_Popover, "defaultProps", defaultProps); + +Popover_defineProperty(Popover_Popover, "propTypes", Popover_propTypes); + +Popover_defineProperty(Popover_Popover, "getDerivedStateFromProps", function (props, state) { + if (props.open !== state.prevOpen) { + return { + animating: props.animation, + prevOpen: props.open + }; + } + + return null; +}); + +var PopoverWithTheme = Object(themes_["withSplunkTheme"])(Popover_Popover); +PopoverWithTheme.propTypes = Popover_Popover.propTypes; +/* harmony default export */ var src_Popover_Popover = (PopoverWithTheme); +// CONCATENATED MODULE: ./src/Popover/index.ts + + + + +/***/ }), + +/***/ 19: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92297); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 24: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36529); + +/***/ }), + +/***/ 27: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_60812__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_60812__.d(__nested_webpack_exports__, "a", function() { return getDocument; }); +/* harmony export (binding) */ __nested_webpack_require_60812__.d(__nested_webpack_exports__, "b", function() { return ssrDocument; }); +/* eslint-disable @typescript-eslint/no-empty-function */ +var ssrDocument = { + body: { + appendChild: function appendChild() { + return []; + } + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + activeElement: { + blur: function blur() {}, + nodeName: '' + }, + querySelector: function querySelector() { + return null; + }, + querySelectorAll: function querySelectorAll() { + return []; + }, + getElementById: function getElementById() { + return null; + }, + createEvent: function createEvent() { + return { + initEvent: function initEvent() {} + }; + }, + createElement: function createElement() { + return { + children: [], + childNodes: [], + style: {}, + setAttribute: function setAttribute() {}, + getElementsByTagName: function getElementsByTagName() { + return []; + } + }; + }, + createElementNS: function createElementNS() { + return {}; + }, + importNode: function importNode() { + return null; + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } +}; + +function getDocument() { + var doc = typeof document !== 'undefined' ? document : ssrDocument; + return doc; +} + + + +/***/ }), + +/***/ 29: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1027); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 31: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7350); + +/***/ }), + +/***/ 40: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(66991); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 50: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25474); + +/***/ }), + +/***/ 55: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64112); + +/***/ }), + +/***/ 69: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1882); + +/***/ }), + +/***/ 82: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70564); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }), + +/***/ 90: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40961); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 93158: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 187); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 187: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3867__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3867__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3867__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ RadioList_RadioList; }); +__nested_webpack_require_3867__.d(__nested_webpack_exports__, "Option", function() { return /* reexport */ RadioList_Option; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3867__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3867__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3867__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3867__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_3867__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_3867__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_3867__(8); + +// CONCATENATED MODULE: ./src/RadioList/RadioListContext.ts + +var RadioListContext = /*#__PURE__*/Object(external_react_["createContext"])({}); +RadioListContext.displayName = 'RadioList'; +/* harmony default export */ var RadioList_RadioListContext = (RadioListContext); +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3867__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3867__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3867__(0); + +// CONCATENATED MODULE: ./src/RadioList/OptionStyles.ts + + +var StyledWrapper = external_styled_components_default.a.div.withConfig({ + displayName: "OptionStyles__StyledWrapper", + componentId: "imaqjt-0" +})(["position:relative;padding:", ";"], Object(themes_["pick"])({ + prisma: { + comfortable: '10px 0', + compact: '6px 0' + }, + enterprise: '7px 0 7px 0' +})); +var StyledLabel = external_styled_components_default.a.label.withConfig({ + displayName: "OptionStyles__StyledLabel", + componentId: "imaqjt-1" +})(["", ";", ";position:relative;flex:1 1 auto;padding-left:", ";margin-left:", ";cursor:pointer;&::before,&::after{display:block;content:'';position:absolute;border-radius:50%;}&::before{box-sizing:border-box;top:0;border:", ";", "}&::after{opacity:0;width:8px;height:8px;", " background-color:", ";}", " ", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive) +}), Object(themes_["pick"])({ + prisma: '10px', + enterprise: themes_["variables"].spacingQuarter +}), Object(themes_["pick"])({ + prisma: '20px', + enterprise: '18px' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["2px solid ", ""], themes_["variables"].contentColorMuted), + enterprise: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray80) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["width:20px;height:20px;left:-20px;"]), + enterprise: Object(external_styled_components_["css"])(["width:18px;height:18px;left:-18px;"]) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["top:6px;left:-14px;"]), + enterprise: Object(external_styled_components_["css"])(["top:5px;left:-13px;"]) +}), Object(themes_["pick"])({ + prisma: themes_["variables"].white, + enterprise: { + dark: themes_["variables"].gray80, + light: themes_["variables"].gray45 + } +}), Object(themes_["pick"])({ + compact: { + enterprise: Object(external_styled_components_["css"])(["font-size:", ";"], themes_["variables"].fontSizeSmall) + } +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:hover{&::before{box-shadow:", ";border-color:", ";background-color:", ";}"], themes_["variables"].hoverShadow, themes_["variables"].contentColorDefault, themes_["mixins"].overlayColors(themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayHover)) +})); +var StyledRadioInput = external_styled_components_default.a.input.withConfig({ + displayName: "OptionStyles__StyledRadioInput", + componentId: "imaqjt-2" +})(["opacity:0;position:absolute;top:10px;left:0;&:focus{& + ", "::before{box-shadow:", ";}}&:checked + ", "::after{opacity:1;}&:checked + ", "::before{", "}&:disabled,&:disabled + ", "{color:", ";cursor:not-allowed;}&:disabled + ", "::before{", ";}&:disabled:not(:checked) + ", "::before{", ";}&:disabled + ", "::after{background-color:", ";}", " ", ""], +/* sc-sel */ +StyledLabel, themes_["variables"].focusShadow, +/* sc-sel */ +StyledLabel, +/* sc-sel */ +StyledLabel, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["border-color:transparent;background-color:", ";"], themes_["variables"].interactiveColorPrimary), + enterprise: { + dark: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray80), + light: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray45) + } +}), +/* sc-sel */ +StyledLabel, Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDisabled, + enterprise: { + dark: themes_["variables"].gray45, + light: themes_["variables"].gray80 + } +}), +/* sc-sel */ +StyledLabel, Object(themes_["pick"])({ + enterprise: { + dark: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray45), + light: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].gray80) + } +}), +/* sc-sel */ +StyledLabel, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].contentColorDisabled) +}), +/* sc-sel */ +StyledLabel, Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDisabled, + enterprise: { + dark: themes_["variables"].gray45, + light: themes_["variables"].gray80 + } +}), function (_ref) { + var $error = _ref.$error; + return $error && Object(external_styled_components_["css"])(["&:not(:disabled) + ", "{color:", ";&::before{border-color:", ";}}&:checked:not(:disabled) + ", "{&::before{border-color:", ";}", "}", ""], + /* sc-sel */ + StyledLabel, Object(themes_["pick"])({ + prisma: themes_["variables"].accentColorNegative, + enterprise: themes_["variables"].errorColor + }), Object(themes_["pick"])({ + prisma: themes_["variables"].accentColorNegative, + enterprise: { + dark: themes_["variables"].errorColor, + light: themes_["variables"].errorColorL30 + } + }), + /* sc-sel */ + StyledLabel, Object(themes_["pick"])({ + prisma: themes_["variables"].accentColorNegative, + enterprise: themes_["variables"].errorColor + }), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["&::after{background-color:", ";}"], themes_["variables"].errorColor) + }), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:not(:disabled):checked + ", "{&::before{background-color:", ";}}"], + /* sc-sel */ + StyledLabel, themes_["variables"].accentColorNegative) + })); +}, Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["&:active + ", "::before{background-color:", ";}&:active + ", "::after{background-color:", ";}&:checked:active + ", "::before{border-color:transparent;background-color:", ";}&:disabled + ", ":hover::before{box-shadow:none;}&:checked:disabled + ", "{&::before{background-color:", ";}&::after{background-color:rgba(255,255,255,0.3);}}"], + /* sc-sel */ + StyledLabel, themes_["mixins"].overlayColors(themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayActive), + /* sc-sel */ + StyledLabel, themes_["mixins"].overlayColors(themes_["variables"].white, themes_["variables"].interactiveColorOverlayActive), + /* sc-sel */ + StyledLabel, themes_["mixins"].overlayColors(themes_["variables"].interactiveColorPrimary, themes_["variables"].interactiveColorOverlayActive), + /* sc-sel */ + StyledLabel, + /* sc-sel */ + StyledLabel, themes_["variables"].interactiveColorBackgroundDisabled) +})); +// CONCATENATED MODULE: ./src/RadioList/Option.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + +var propTypes = { + children: external_prop_types_default.a.node, + disabled: external_prop_types_default.a.bool, + error: external_prop_types_default.a.bool, + id: external_prop_types_default.a.string, + onChange: external_prop_types_default.a.func, + value: external_prop_types_default.a.any.isRequired +}; + +function Option(_ref) { + var children = _ref.children, + _ref$disabled = _ref.disabled, + disabledProp = _ref$disabled === void 0 ? false : _ref$disabled, + _ref$error = _ref.error, + errorProp = _ref$error === void 0 ? false : _ref$error, + idProp = _ref.id, + onChange = _ref.onChange, + value = _ref.value, + otherProps = _objectWithoutProperties(_ref, ["children", "disabled", "error", "id", "onChange", "value"]); + + // @docs-props-type OptionPropsBase + var _useRef = Object(external_react_["useRef"])(idProp || Object(id_["createDOMID"])('radio-option')), + id = _useRef.current; + + var radioList = Object(external_react_["useContext"])(RadioList_RadioListContext); + + var handleOnChange = function handleOnChange(e) { + var _radioList$onChange; + + e.stopPropagation(); + onChange === null || onChange === void 0 ? void 0 : onChange(e, { + value: value, + name: radioList.name + }); + (_radioList$onChange = radioList.onChange) === null || _radioList$onChange === void 0 ? void 0 : _radioList$onChange.call(radioList, e, { + value: value, + name: radioList.name + }); + }; + + var checked = false; + + if ((radioList === null || radioList === void 0 ? void 0 : radioList.value) !== undefined) { + checked = radioList.value === value; + } + + var disabled = disabledProp; + + if (radioList === null || radioList === void 0 ? void 0 : radioList.disabled) { + disabled = radioList.disabled; + } + + var $error = errorProp; + + if (radioList === null || radioList === void 0 ? void 0 : radioList.error) { + $error = radioList.error; + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledWrapper, _extends({ + "data-test": "option", + "data-test-value": value + }, otherProps, { + "data-checked": checked + }), /*#__PURE__*/external_react_default.a.createElement(StyledRadioInput, { + id: id, + type: "radio", + name: radioList.name, + $error: $error, + disabled: disabled, + value: value.toString(), + checked: checked, + onChange: handleOnChange, + "data-test": "input" + }), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + htmlFor: id, + "data-test": "label" + }, children)); +} + +Option.propTypes = propTypes; +/* harmony default export */ var RadioList_Option = (Option); +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_3867__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_3867__.n(Box_); + +// CONCATENATED MODULE: ./src/RadioList/RadioListStyles.ts + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "RadioListStyles__StyledBox", + componentId: "sc-1qg10hx-0" +})(["align-items:flex-start;flex-wrap:wrap;flex-direction:", ";", ""], function (props) { + return props.direction; +}, function (props) { + return props.direction === 'row' && Object(external_styled_components_["css"])(["", "{margin-right:40px;margin-inline-end:40px;}"], StyledWrapper); +}); + +// CONCATENATED MODULE: ./src/RadioList/RadioList.tsx +function RadioList_extends() { RadioList_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return RadioList_extends.apply(this, arguments); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function RadioList_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = RadioList_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function RadioList_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + +var RadioList_propTypes = { + direction: external_prop_types_default.a.oneOf(['row', 'column']), + children: external_prop_types_default.a.node, + defaultValue: external_prop_types_default.a.any, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + name: external_prop_types_default.a.string, + onChange: external_prop_types_default.a.func, + + /** @private. */ + required: external_prop_types_default.a.bool, + value: external_prop_types_default.a.any, + labelledBy: external_prop_types_default.a.string, + describedBy: external_prop_types_default.a.string +}; + +function RadioList(_ref) { + var children = _ref.children, + defaultValueProp = _ref.defaultValue, + describedBy = _ref.describedBy, + _ref$direction = _ref.direction, + direction = _ref$direction === void 0 ? 'column' : _ref$direction, + _ref$disabled = _ref.disabled, + disabled = _ref$disabled === void 0 ? false : _ref$disabled, + _ref$error = _ref.error, + error = _ref$error === void 0 ? false : _ref$error, + labelledBy = _ref.labelledBy, + nameProp = _ref.name, + onChange = _ref.onChange, + required = _ref.required, + valueProp = _ref.value, + otherProps = RadioList_objectWithoutProperties(_ref, ["children", "defaultValue", "describedBy", "direction", "disabled", "error", "labelledBy", "name", "onChange", "required", "value"]); + + // @docs-props-type RadioListPropsBase + // TODO: Implement shared isControlled hook (SUI-5283). + // See material-ui for similar pattern to handle controlled/un-controlled in functional components w/ hooks + // https://github.com/mui-org/material-ui/blob/60d99a39836fb82f4da1477a717f642c216fb0b9/packages/material-ui/src/utils/useControlled.js + var _useRef = Object(external_react_["useRef"])(valueProp !== undefined), + isControlledExternally = _useRef.current; + + var _useState = Object(external_react_["useState"])(defaultValueProp), + _useState2 = _slicedToArray(_useState, 2), + valueState = _useState2[0], + setValueState = _useState2[1]; + + var value = isControlledExternally ? valueProp : valueState; + + var _useRef2 = Object(external_react_["useRef"])(nameProp || Object(id_["createDOMID"])('radio-name')), + name = _useRef2.current; + + var handleChange = function handleChange(e, data) { + if (!isControlledExternally) { + setValueState(data.value); + } + + onChange === null || onChange === void 0 ? void 0 : onChange(e, data); + }; // Check correct props are passed + + + if (false) {} + + if (false) {} // Check if changing from controlled to un-controlled + + + Object(external_react_["useEffect"])(function () { + if (false) {} + }, [valueProp, isControlledExternally]); + + var _useRef3 = Object(external_react_["useRef"])(defaultValueProp), + defaultValue = _useRef3.current; + + Object(external_react_["useEffect"])(function () { + if (false) {} + }, [defaultValue, defaultValueProp, isControlledExternally]); + var labelledByAttr = otherProps['aria-labelledby']; + var describedByAttr = otherProps['aria-describedby']; + return /*#__PURE__*/external_react_default.a.createElement(RadioList_RadioListContext.Provider, { + value: { + value: value, + name: name, + onChange: handleChange, + error: error, + disabled: disabled + } + }, /*#__PURE__*/external_react_default.a.createElement(StyledBox, RadioList_extends({ + flex: true, + direction: direction, + role: "radiogroup", + "data-test": "radio-list", + "data-test-value": value + }, omit_default()(otherProps, ['aria-labelledby', 'aria-describedby']), { + "aria-labelledby": labelledByAttr ? "".concat(labelledByAttr, " ").concat(labelledBy) : labelledBy, + "aria-describedby": describedByAttr ? "".concat(describedByAttr, " ").concat(describedBy) : describedBy, + "aria-required": required + }), children)); +} + +RadioList.propTypes = RadioList_propTypes; +RadioList.Option = RadioList_Option; +/* harmony default export */ var RadioList_RadioList = (RadioList); + // only for styled components using RadioList +// CONCATENATED MODULE: ./src/RadioList/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 80436: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 227); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3866__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3866__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 13: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(76646); + +/***/ }), + +/***/ 150: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(93755); + +/***/ }), + +/***/ 151: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(24379); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 227: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5158__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_5158__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_5158__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_ResultsMenu_ResultsMenu; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_5158__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_5158__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_5158__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_5158__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_5158__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_5158__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_5158__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_5158__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_5158__(4); + +// EXTERNAL MODULE: external "@splunk/ui-utils/userAgent" +var userAgent_ = __nested_webpack_require_5158__(150); + +// EXTERNAL MODULE: external "@splunk/react-ui/Menu" +var Menu_ = __nested_webpack_require_5158__(13); +var Menu_default = /*#__PURE__*/__nested_webpack_require_5158__.n(Menu_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_5158__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_5158__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/WaitSpinner" +var WaitSpinner_ = __nested_webpack_require_5158__(151); +var WaitSpinner_default = /*#__PURE__*/__nested_webpack_require_5158__.n(WaitSpinner_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_5158__(0); + +// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenuStyles.ts + + + +var Styled = external_styled_components_default.a.div.withConfig({ + displayName: "ResultsMenuStyles__Styled", + componentId: "avbhl8-0" +})(["", ";flex-direction:column;max-height:calc(100vh - 20px);", ""], themes_["mixins"].reset('flex'), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["border-radius:", ";background-color:", ";"], themes_["variables"].borderRadius, themes_["variables"].backgroundColorPopup) +})); +var StyledFooter = external_styled_components_default.a.div.withConfig({ + displayName: "ResultsMenuStyles__StyledFooter", + componentId: "avbhl8-1" +})(["padding:", ";color:", ";", ""], Object(themes_["pick"])({ + prisma: { + comfortable: '10px 16px', + compact: '6px 16px' + }, + enterprise: '6px 10px' +}), Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorMuted, + enterprise: themes_["variables"].textGray +}), function (_ref) { + var $placement = _ref.$placement; + return $placement === 'above' ? Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["border-bottom:1px solid ", ";"], themes_["variables"].neutral200), + enterprise: Object(external_styled_components_["css"])(["border-bottom:", ";"], themes_["variables"].border) + }) : Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], themes_["variables"].neutral200), + enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border) + }); +}); +var StyledLoading = external_styled_components_default.a.li.withConfig({ + displayName: "ResultsMenuStyles__StyledLoading", + componentId: "avbhl8-2" +})(["", ";padding:", ";"], themes_["mixins"].reset('flex'), Object(themes_["pick"])({ + prisma: { + comfortable: '10px 16px', + compact: '6px 16px' + }, + enterprise: '6px 10px' +})); +var StyledWait = external_styled_components_default()(WaitSpinner_default.a).withConfig({ + displayName: "ResultsMenuStyles__StyledWait", + componentId: "avbhl8-3" +})(["margin-right:", ";flex:0 0 auto;"], themes_["variables"].spacingQuarter); +var StyledLoadingMessage = external_styled_components_default.a.div.withConfig({ + displayName: "ResultsMenuStyles__StyledLoadingMessage", + componentId: "avbhl8-4" +})(["flex:1 0 0;color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorMuted, + enterprise: themes_["variables"].textGray +})); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_5158__(11); + +// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenu.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + +var propTypes = { + animateLoading: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + + /** @private */ + controlledExternally: external_prop_types_default.a.bool, + childrenStart: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + footerMessage: external_prop_types_default.a.node, + isLoading: external_prop_types_default.a.bool, + loadingMessage: external_prop_types_default.a.node, + maxHeight: external_prop_types_default.a.number, + noOptionsMessage: external_prop_types_default.a.node, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + placement: external_prop_types_default.a.string +}; +var defaultProps = { + animateLoading: false, + isLoading: false, + loadingMessage: Object(i18n_["_"])('Loading...'), + noOptionsMessage: Object(i18n_["_"])('No matches') +}; + +// @docs-props-type ResultsMenuPropsBase +var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) { + _inherits(ResultsMenu, _Component); + + var _super = _createSuper(ResultsMenu); + + function ResultsMenu(props) { + var _this; + + _classCallCheck(this, ResultsMenu); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "scrollBottomOffset", void 0); + + _defineProperty(_assertThisInitialized(_this), "itemMinHeight", void 0); + + _defineProperty(_assertThisInitialized(_this), "handleMenuMount", function (menuEl) { + _this.setState({ + menuEl: menuEl + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + _this.setState({ + containerEl: el + }); + + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () { + _this.setState({ + windowTop: document.documentElement.scrollTop + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () { + _this.setState({ + windowTop: document.documentElement.scrollTop + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleScroll", function (e) { + var _this$props$onScroll, _this$props; + + if (_this.props.onScrollBottom != null) { + if (e.target && _this.state.menuEl) { + var bottomScrollMenu = _this.state.menuEl.scrollHeight - _this.state.menuEl.offsetHeight - _this.scrollBottomOffset; // Adding 1 due to border of menu item. + + if (_this.state.menuEl.scrollTop + 1 >= bottomScrollMenu) { + _this.handleScrollBottom(e); + } + } + } + + (_this$props$onScroll = (_this$props = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleWheelMenu", function (e) { + // Safety net to ensure window doesn't scroll if menu is scrolled pass the numberOfItemsLoaded at high velocity. + e.stopPropagation(); + document.documentElement.scrollTop = _this.state.windowTop; + }); + + _defineProperty(_assertThisInitialized(_this), "handleScrollBottomOnFullMenu", function () { + var currentChildrenCount = external_react_["Children"].count(_this.props.children); + var _this$state = _this.state, + childrenCount = _this$state.childrenCount, + menuMaxHeight = _this$state.menuMaxHeight; // If menu is full length, load more items. + + if (_this.checkFullHeight()) { + _this.handleScrollBottom(null); + } // avoid triggering this logic if this.state.childrenCount is null + // because that's not a real change in the number of children + // and thus we want to avoid resetting the value of scrollBottomTriggered + + + if (menuMaxHeight && currentChildrenCount != null && currentChildrenCount !== childrenCount) { + _this.setState({ + numberOfItemsLoaded: currentChildrenCount - (childrenCount !== null && childrenCount !== void 0 ? childrenCount : 0), + scrollBottomTriggered: false + }); + } + + if (currentChildrenCount !== childrenCount) { + _this.setState({ + childrenCount: currentChildrenCount + }); + } + }); + + _this.state = { + containerEl: null, + menuEl: null, + menuMaxHeight: undefined, + numberOfItemsLoaded: 0, + scrollBottomTriggered: false, + windowTop: 0 + }; // The remaining amount of pixels when scrolled from bottom of menu to trigger onScrollBottom(). + + _this.scrollBottomOffset = 400; + _this.itemMinHeight = 28; + return _this; + } + + _createClass(ResultsMenu, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + var _this$state2 = this.state, + containerEl = _this$state2.containerEl, + menuEl = _this$state2.menuEl, + menuMaxHeight = _this$state2.menuMaxHeight; + + if (!userAgent_["isIE11"] || !containerEl || !menuEl) { + return; + } + + if (this.props.maxHeight) { + var otherElementsHeight = containerEl.scrollHeight - menuEl.clientHeight; + var newMenuMaxHeight = this.props.maxHeight - otherElementsHeight; + + if (menuMaxHeight === undefined || Math.abs(menuMaxHeight - newMenuMaxHeight) > 1) { + // eslint-disable-next-line react/no-did-update-set-state + this.setState({ + menuMaxHeight: newMenuMaxHeight + }); + } + } // If onScrollBottom is defined, determine if it should be triggered. + + + if (this.props && this.props.onScrollBottom && this.props.children) { + this.handleScrollBottomOnFullMenu(); + } + } + }, { + key: "handleScrollBottom", + value: function handleScrollBottom(e) { + // Prevent multiple calls to onScrollBottom. + if (!this.state.scrollBottomTriggered) { + var _this$props$onScrollB, _this$props2; + + this.setState({ + scrollBottomTriggered: true + }); + (_this$props$onScrollB = (_this$props2 = this.props).onScrollBottom) === null || _this$props$onScrollB === void 0 ? void 0 : _this$props$onScrollB.call(_this$props2, e); + } + } + }, { + key: "checkFullHeight", + value: function checkFullHeight() { + var menuEl = this.state.menuEl; + return menuEl && menuEl.scrollHeight === menuEl.offsetHeight; + } + }, { + key: "renderFooterMessage", + value: function renderFooterMessage() { + return this.props.footerMessage && !!external_react_["Children"].toArray(this.props.children).length && /*#__PURE__*/external_react_default.a.createElement(StyledFooter, { + $placement: this.props.placement, + "data-test": "footer-message", + key: "footer" + }, this.props.footerMessage); + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + animateLoading = _this$props3.animateLoading, + children = _this$props3.children, + controlledExternally = _this$props3.controlledExternally, + childrenStart = _this$props3.childrenStart, + isLoading = _this$props3.isLoading, + loadingMessage = _this$props3.loadingMessage, + noOptionsMessage = _this$props3.noOptionsMessage, + onScrollBottom = _this$props3.onScrollBottom, + placement = _this$props3.placement, + style = _this$props3.style, + tabIndex = _this$props3.tabIndex; + var otherProps = omit_default()(this.props, keys_default()(ResultsMenu.propTypes)); + // Assumption: that you cannot be filtered if you are a result + var hasResults = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).some(function (_ref) { + var type = _ref.type; + return !(type === Menu_["Divider"] && type.filterFirst || (type === Menu_["Divider"] || type === Menu_["Heading"]) && (type.filterLast || type.filterConsecutive)); + }); + var fullHeight = this.checkFullHeight(); + /* eslint-disable jsx-a11y/aria-role */ + + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + key: "wrapper", + style: style, + ref: this.handleMount, + onWheel: onScrollBottom ? this.handleWheelMenu : undefined, + onMouseEnter: onScrollBottom ? this.handleMouseEnter : undefined, + onMouseLeave: onScrollBottom ? this.handleMouseLeave : undefined + }, omit_default()(otherProps, 'tabIndex')), placement !== 'above' && childrenStart, placement === 'above' && this.renderFooterMessage(), /*#__PURE__*/external_react_default.a.createElement(Menu_["MenuContext"].Provider, { + value: { + role: 'listbox' + } + }, /*#__PURE__*/external_react_default.a.createElement(Menu_default.a, { + key: "menu", + style: { + overflow: 'auto', + maxHeight: this.state.menuMaxHeight || 'calc(100vh - 20px)', + flexDirection: 'column' + }, + controlledExternally: controlledExternally, + elementRef: this.handleMenuMount, + onScroll: this.handleScroll, + stopScrollPropagation: true, + tabIndex: tabIndex + }, !hasResults && noOptionsMessage && !isLoading && /*#__PURE__*/external_react_default.a.createElement(Menu_default.a.Item, { + "data-test": "no-results-message", + disabled: true + }, noOptionsMessage), children, onScrollBottom && !fullHeight && + /*#__PURE__*/ + // Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems. + external_react_default.a.createElement("div", { + "data-test": "results-menu-bottom-spacer", + style: { + height: this.state.scrollBottomTriggered ? this.state.numberOfItemsLoaded * this.itemMinHeight || 0 : 0 + } + }), isLoading && /*#__PURE__*/external_react_default.a.createElement(StyledLoading, null, animateLoading && /*#__PURE__*/external_react_default.a.createElement(StyledWait, null), /*#__PURE__*/external_react_default.a.createElement(StyledLoadingMessage, null, loadingMessage)))), placement !== 'above' && this.renderFooterMessage(), placement === 'above' && childrenStart); + } + }]); + + return ResultsMenu; +}(external_react_["Component"]); + +_defineProperty(ResultsMenu_ResultsMenu, "propTypes", propTypes); + +_defineProperty(ResultsMenu_ResultsMenu, "defaultProps", defaultProps); + +/* harmony default export */ var src_ResultsMenu_ResultsMenu = (ResultsMenu_ResultsMenu); +// CONCATENATED MODULE: ./src/ResultsMenu/index.ts + + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 54345: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 228); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 228: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ ScreenReaderContent_ScreenReaderContent; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts + + +var Styled = external_styled_components_default.a.span.withConfig({ + displayName: "ScreenReaderContentStyles__Styled", + componentId: "sc-1lnohwp-0" +})(["", ";"], themes_["mixins"].screenReaderContent()); + +// CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContent.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node.isRequired, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]) +}; + +/** + * The screen reader text is used to wrap content that + * is only accessible through screen readers. + */ +function ScreenReaderContent(_ref) { + var children = _ref.children, + elementRef = _ref.elementRef, + otherProps = _objectWithoutProperties(_ref, ["children", "elementRef"]); + + // @docs-props-type ScreenReaderContentPropsBase + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + "data-test": "screen-reader-content", + ref: elementRef + }, otherProps), children); +} + +ScreenReaderContent.propTypes = propTypes; +/* harmony default export */ var ScreenReaderContent_ScreenReaderContent = (ScreenReaderContent); +// CONCATENATED MODULE: ./src/ScreenReaderContent/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 76088: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 203); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3866__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3866__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 16: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68973); + +/***/ }), + +/***/ 19: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92297); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 203: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5038__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_5038__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_5038__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Scroll_Scroll; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_5038__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_5038__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_5038__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_5038__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/isFinite" +var isFinite_ = __nested_webpack_require_5038__(19); +var isFinite_default = /*#__PURE__*/__nested_webpack_require_5038__.n(isFinite_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Animation" +var Animation_ = __nested_webpack_require_5038__(40); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_5038__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_5038__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_5038__(0); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_5038__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_5038__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_5038__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_5038__.n(omit_); + +// EXTERNAL MODULE: external "react-spring" +var external_react_spring_ = __nested_webpack_require_5038__(24); + +// EXTERNAL MODULE: external "@splunk/react-ui/EventListener" +var EventListener_ = __nested_webpack_require_5038__(16); +var EventListener_default = /*#__PURE__*/__nested_webpack_require_5038__.n(EventListener_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext" +var ScrollContainerContext_ = __nested_webpack_require_5038__(50); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_5038__(11); + +// CONCATENATED MODULE: ./src/Scroll/Inner.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + +var propTypes = { + children: external_prop_types_default.a.node, + defaultLeft: external_prop_types_default.a.number, + defaultTop: external_prop_types_default.a.number, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + left: external_prop_types_default.a.object, + onScroll: external_prop_types_default.a.func, + stopScrollPropagation: external_prop_types_default.a.oneOf([true, false, 'window']), + tagName: external_prop_types_default.a.string, + top: external_prop_types_default.a.object +}; +var defaultProps = { + defaultLeft: 0, + defaultTop: 0, + tagName: 'div' +}; + +var Inner_Inner = /*#__PURE__*/function (_Component) { + _inherits(Inner, _Component); + + var _super = _createSuper(Inner); + + function Inner(props) { + var _this; + + _classCallCheck(this, Inner); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "defaultWindowOverflowX", 'visible'); + + _defineProperty(_assertThisInitialized(_this), "defaultWindowOverflowY", 'visible'); + + _defineProperty(_assertThisInitialized(_this), "handleWheel", function (e) { + var el = _this.state.containerEl; + + if (!el) { + return; + } // if the element is scrollable in both directions, it's not safe to stop propagation. + + + if (el.clientWidth !== el.scrollWidth && el.clientHeight !== el.scrollHeight) { + return; + } + + if (el.clientWidth !== el.scrollWidth) { + if (e.deltaX < 0 && el.scrollLeft < Math.abs(e.deltaX)) { + el.scrollLeft = 0; + e.stopPropagation(); + e.preventDefault(); + return; + } + + var maxLeft = el.scrollWidth - el.clientWidth; + + if (e.deltaX && e.deltaX + el.scrollLeft > maxLeft) { + el.scrollLeft = maxLeft; + e.stopPropagation(); + e.preventDefault(); + } + } + + if (el.clientHeight !== el.scrollHeight) { + if (e.deltaY < 0 && el.scrollTop < Math.abs(e.deltaY)) { + el.scrollTop = 0; + e.stopPropagation(); + e.preventDefault(); + return; + } + + var maxTop = el.scrollHeight - el.clientHeight; + + if (e.deltaY && e.deltaY + el.scrollTop > maxTop) { + el.scrollTop = maxTop; + e.stopPropagation(); + e.preventDefault(); + } + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + _this.setState({ + containerEl: el + }); + + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () { + _this.defaultWindowOverflowX = document.body.style.overflowX; + _this.defaultWindowOverflowY = document.body.style.overflowY; + document.body.style.overflowX = 'hidden'; + document.body.style.overflowY = 'hidden'; + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () { + document.body.style.overflowX = _this.defaultWindowOverflowX; + document.body.style.overflowY = _this.defaultWindowOverflowY; + }); + + _this.state = { + containerEl: null + }; + return _this; + } + + _createClass(Inner, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (this.state.containerEl) { + if (!prevState.containerEl) { + this.state.containerEl.scrollTop = this.props.defaultTop; + this.state.containerEl.scrollLeft = this.props.defaultLeft; + } + + if (isFinite_default()(this.props.top)) { + var _this$props$top; + + this.state.containerEl.scrollTop = ((_this$props$top = this.props.top) === null || _this$props$top === void 0 ? void 0 : _this$props$top.get()) || 0; + } + + if (isFinite_default()(this.props.left)) { + var _this$props$left; + + this.state.containerEl.scrollLeft = ((_this$props$left = this.props.left) === null || _this$props$left === void 0 ? void 0 : _this$props$left.get()) || 0; + } + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + onScroll = _this$props.onScroll, + stopScrollPropagation = _this$props.stopScrollPropagation, + top = _this$props.top, + left = _this$props.left; + var containerEl = this.state.containerEl; + var AnimatedTag = external_react_spring_["animated"][this.props.tagName]; + return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(AnimatedTag, _extends({}, omit_default()(this.props, keys_default()(Inner.propTypes)), { + ref: this.handleMount, + onMouseEnter: stopScrollPropagation === 'window' ? this.handleMouseEnter : undefined, + onMouseLeave: stopScrollPropagation === 'window' ? this.handleMouseLeave : undefined, + onScroll: onScroll, + scrollTop: top, + scrollLeft: left + }), /*#__PURE__*/external_react_default.a.createElement(ScrollContainerContext_["ScrollContainerProvider"], { + value: containerEl + }, children)), stopScrollPropagation === true && containerEl && /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: containerEl, + eventType: "wheel", + listener: this.handleWheel, + options: { + passive: false + } + })); + } + }]); + + return Inner; +}(external_react_["Component"]); + +_defineProperty(Inner_Inner, "propTypes", propTypes); + +_defineProperty(Inner_Inner, "defaultProps", defaultProps); + +/* harmony default export */ var Scroll_Inner = (Inner_Inner); +// CONCATENATED MODULE: ./src/Scroll/ScrollStyles.ts + + + +var StyledInner = external_styled_components_default()(Scroll_Inner).withConfig({ + displayName: "ScrollStyles__StyledInner", + componentId: "sc-1xspttf-0" +})(["", ";overflow:auto;overflow-y:auto;overflow-x:hidden;"], themes_["mixins"].reset('block')); + +// CONCATENATED MODULE: ./src/Scroll/Scroll.tsx +function Scroll_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Scroll_typeof = function _typeof(obj) { return typeof obj; }; } else { Scroll_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Scroll_typeof(obj); } + +function Scroll_extends() { Scroll_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Scroll_extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function Scroll_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Scroll_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Scroll_createClass(Constructor, protoProps, staticProps) { if (protoProps) Scroll_defineProperties(Constructor.prototype, protoProps); if (staticProps) Scroll_defineProperties(Constructor, staticProps); return Constructor; } + +function Scroll_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Scroll_setPrototypeOf(subClass, superClass); } + +function Scroll_setPrototypeOf(o, p) { Scroll_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Scroll_setPrototypeOf(o, p); } + +function Scroll_createSuper(Derived) { var hasNativeReflectConstruct = Scroll_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Scroll_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Scroll_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Scroll_possibleConstructorReturn(this, result); }; } + +function Scroll_possibleConstructorReturn(self, call) { if (call && (Scroll_typeof(call) === "object" || typeof call === "function")) { return call; } return Scroll_assertThisInitialized(self); } + +function Scroll_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Scroll_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Scroll_getPrototypeOf(o) { Scroll_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Scroll_getPrototypeOf(o); } + +function Scroll_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + +var Scroll_propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + left: external_prop_types_default.a.number, + onScroll: external_prop_types_default.a.func, + onScrollComplete: external_prop_types_default.a.func, + stopScrollPropagation: external_prop_types_default.a.oneOf([true, false, 'window']), + tagName: external_prop_types_default.a.string, + top: external_prop_types_default.a.number +}; +var Scroll_defaultProps = { + stopScrollPropagation: false, + tagName: 'div' +}; + +var Scroll_Scroll = /*#__PURE__*/function (_Component) { + Scroll_inherits(Scroll, _Component); + + var _super = Scroll_createSuper(Scroll); + + // @docs-props-type ScrollPropsBase + function Scroll(props) { + var _this; + + Scroll_classCallCheck(this, Scroll); + + _this = _super.call(this, props); + + Scroll_defineProperty(Scroll_assertThisInitialized(_this), "handleRest", function () { + var _this$props$onScrollC, _this$props; + + (_this$props$onScrollC = (_this$props = _this.props).onScrollComplete) === null || _this$props$onScrollC === void 0 ? void 0 : _this$props$onScrollC.call(_this$props); + }); + + Scroll_defineProperty(Scroll_assertThisInitialized(_this), "handleScroll", function (e) { + var _this$props$onScroll, _this$props2; + + _this.setState({ + currentLeft: e.currentTarget.scrollLeft, + currentTop: e.currentTarget.scrollTop + }); + + (_this$props$onScroll = (_this$props2 = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props2, e); + }); + + Scroll_defineProperty(Scroll_assertThisInitialized(_this), "renderInner", function (targetScroll) { + var _this$props3 = _this.props, + children = _this$props3.children, + elementRef = _this$props3.elementRef, + left = _this$props3.left, + top = _this$props3.top, + onScrollComplete = _this$props3.onScrollComplete, + otherProps = _objectWithoutProperties(_this$props3, ["children", "elementRef", "left", "top", "onScrollComplete"]); + + return /*#__PURE__*/external_react_default.a.createElement(StyledInner, Scroll_extends({ + "data-test": "scroll" + }, otherProps, { + key: "inner", + top: isFinite_default()(top) ? targetScroll.top : undefined, + left: isFinite_default()(left) ? targetScroll.left : undefined, + elementRef: elementRef, + onScroll: _this.handleScroll + }), children); + }); + + _this.state = { + currentLeft: 0, + currentTop: 0 + }; + return _this; + } + + Scroll_createClass(Scroll, [{ + key: "render", + value: function render() { + var _this$props4 = this.props, + left = _this$props4.left, + top = _this$props4.top; + var _this$state = this.state, + currentLeft = _this$state.currentLeft, + currentTop = _this$state.currentTop; + var targetScroll = {}; // When isFinite, the prop is defined and therefore animating. + + if (isFinite_default()(left)) { + targetScroll.left = left; + } else { + targetScroll.left = currentLeft; + } + + if (isFinite_default()(top)) { + targetScroll.top = top; + } else { + targetScroll.top = currentTop; + } + + return /*#__PURE__*/external_react_default.a.createElement(Animation_["Spring"], { + from: { + left: 0, + top: 0 + }, + to: targetScroll, + onRest: this.handleRest, + config: { + precision: 10 + } + }, this.renderInner); + } + }]); + + return Scroll; +}(external_react_["Component"]); + +Scroll_defineProperty(Scroll_Scroll, "propTypes", Scroll_propTypes); + +Scroll_defineProperty(Scroll_Scroll, "defaultProps", Scroll_defaultProps); + +/* harmony default export */ var src_Scroll_Scroll = (Scroll_Scroll); +// CONCATENATED MODULE: ./src/Scroll/index.ts + + +/***/ }), + +/***/ 24: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36529); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 40: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(66991); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 50: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25474); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 25474: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 239); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 18: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3668__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_3668__.d(__nested_webpack_exports__, "a", function() { return getWindow; }); +/* unused harmony export ssrWindow */ +/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_3668__(27); +/* eslint-disable @typescript-eslint/no-empty-function */ + +var ssrWindow = { + document: _ssrDocument__WEBPACK_IMPORTED_MODULE_0__[/* ssrDocument */ "b"], + navigator: { + userAgent: '' + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + }, + history: { + replaceState: function replaceState() {}, + pushState: function pushState() {}, + go: function go() {}, + back: function back() {} + }, + CustomEvent: function CustomEvent() { + return this; + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + getComputedStyle: function getComputedStyle() { + return { + getPropertyValue: function getPropertyValue() { + return ''; + } + }; + }, + Image: function Image() {}, + Date: function Date() {}, + screen: {}, + setTimeout: function setTimeout() {}, + clearTimeout: function clearTimeout() {}, + matchMedia: function matchMedia() { + return {}; + }, + requestAnimationFrame: function requestAnimationFrame(callback) { + if (typeof setTimeout === 'undefined') { + callback(); + return null; + } + + return setTimeout(callback, 0); + }, + cancelAnimationFrame: function cancelAnimationFrame(id) { + if (typeof setTimeout === 'undefined') { + return; + } + + clearTimeout(id); + } +}; + +function getWindow() { + var win = typeof window !== 'undefined' ? window : ssrWindow; + return win; +} + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 239: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5611__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_5611__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_5611__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ ScrollContainerContext_ScrollContainerContext; }); +__nested_webpack_require_5611__.d(__nested_webpack_exports__, "ScrollContainerContext", function() { return /* reexport */ ScrollContainerContext; }); +__nested_webpack_require_5611__.d(__nested_webpack_exports__, "ScrollContainerProvider", function() { return /* reexport */ ScrollContainerProvider; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_5611__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_5611__.n(external_react_); + +// EXTERNAL MODULE: ./src/utils/ssrWindow.ts +var ssrWindow = __nested_webpack_require_5611__(18); + +// CONCATENATED MODULE: ./src/ScrollContainerContext/ScrollContainerContext.tsx + + +/** + * A React context used to manage a custom scroll container for child elements + * that need to react to scrolling. The context type is `Window | Document | HTMLElement | null | undefined`. + * Defaults to `window`. Consumers of this context must gracefully handle values + * of `null` and `undefined`. + * @public + */ + +var ScrollContainerContext = /*#__PURE__*/external_react_default.a.createContext(Object(ssrWindow["a" /* getWindow */])()); +/** + * `ScrollContainerProvider` is an alias of `ScrollContainerContext.Provider`. + * @public + */ + +var ScrollContainerProvider = ScrollContainerContext.Provider; +/* harmony default export */ var ScrollContainerContext_ScrollContainerContext = (ScrollContainerContext); + +// CONCATENATED MODULE: ./src/ScrollContainerContext/index.ts + + + +/***/ }), + +/***/ 27: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_7311__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_7311__.d(__nested_webpack_exports__, "a", function() { return getDocument; }); +/* harmony export (binding) */ __nested_webpack_require_7311__.d(__nested_webpack_exports__, "b", function() { return ssrDocument; }); +/* eslint-disable @typescript-eslint/no-empty-function */ +var ssrDocument = { + body: { + appendChild: function appendChild() { + return []; + } + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + activeElement: { + blur: function blur() {}, + nodeName: '' + }, + querySelector: function querySelector() { + return null; + }, + querySelectorAll: function querySelectorAll() { + return []; + }, + getElementById: function getElementById() { + return null; + }, + createEvent: function createEvent() { + return { + initEvent: function initEvent() {} + }; + }, + createElement: function createElement() { + return { + children: [], + childNodes: [], + style: {}, + setAttribute: function setAttribute() {}, + getElementsByTagName: function getElementsByTagName() { + return []; + } + }; + }, + createElementNS: function createElementNS() { + return {}; + }, + importNode: function importNode() { + return null; + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } +}; + +function getDocument() { + var doc = typeof document !== 'undefined' ? document : ssrDocument; + return doc; +} + + + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 87149: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 230); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 102: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(27386); + +/***/ }), + +/***/ 103: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63375); + +/***/ }), + +/***/ 13: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(76646); + +/***/ }), + +/***/ 15: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79859); + +/***/ }), + +/***/ 17: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), + +/***/ 18: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4495__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_4495__.d(__nested_webpack_exports__, "a", function() { return getWindow; }); +/* unused harmony export ssrWindow */ +/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_4495__(27); +/* eslint-disable @typescript-eslint/no-empty-function */ + +var ssrWindow = { + document: _ssrDocument__WEBPACK_IMPORTED_MODULE_0__[/* ssrDocument */ "b"], + navigator: { + userAgent: '' + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + }, + history: { + replaceState: function replaceState() {}, + pushState: function pushState() {}, + go: function go() {}, + back: function back() {} + }, + CustomEvent: function CustomEvent() { + return this; + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + getComputedStyle: function getComputedStyle() { + return { + getPropertyValue: function getPropertyValue() { + return ''; + } + }; + }, + Image: function Image() {}, + Date: function Date() {}, + screen: {}, + setTimeout: function setTimeout() {}, + clearTimeout: function clearTimeout() {}, + matchMedia: function matchMedia() { + return {}; + }, + requestAnimationFrame: function requestAnimationFrame(callback) { + if (typeof setTimeout === 'undefined') { + callback(); + return null; + } + + return setTimeout(callback, 0); + }, + cancelAnimationFrame: function cancelAnimationFrame(id) { + if (typeof setTimeout === 'undefined') { + return; + } + + clearTimeout(id); + } +}; + +function getWindow() { + var win = typeof window !== 'undefined' ? window : ssrWindow; + return win; +} + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 22: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73592); + +/***/ }), + +/***/ 230: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_6551__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_6551__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_6551__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Select_Select; }); +__nested_webpack_require_6551__.d(__nested_webpack_exports__, "Divider", function() { return /* reexport */ SelectBase["a" /* Divider */]; }); +__nested_webpack_require_6551__.d(__nested_webpack_exports__, "Heading", function() { return /* reexport */ SelectBase["b" /* Heading */]; }); +__nested_webpack_require_6551__.d(__nested_webpack_exports__, "Option", function() { return /* reexport */ Select_Option; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_6551__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_6551__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_6551__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_6551__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_6551__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_6551__.n(has_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_6551__(4); + +// EXTERNAL MODULE: ./src/Select/SelectBase.tsx + 3 modules +var SelectBase = __nested_webpack_require_6551__(60); + +// EXTERNAL MODULE: ./src/Select/OptionBase.tsx +var OptionBase = __nested_webpack_require_6551__(36); + +// CONCATENATED MODULE: ./src/Select/Option.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + +var propTypes = { + /** @private */ + active: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + description: external_prop_types_default.a.string, + descriptionPosition: external_prop_types_default.a.oneOf(['right', 'bottom']), + disabled: external_prop_types_default.a.bool, + hidden: external_prop_types_default.a.bool, + icon: external_prop_types_default.a.node, + label: external_prop_types_default.a.string.isRequired, + matchRanges: external_prop_types_default.a.arrayOf(external_prop_types_default.a.shape({ + start: external_prop_types_default.a.number.isRequired, + end: external_prop_types_default.a.number.isRequired + })), + + /** @private */ + onClick: external_prop_types_default.a.func, + + /** @private */ + selected: external_prop_types_default.a.bool, + truncate: external_prop_types_default.a.bool, + value: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number, external_prop_types_default.a.bool]).isRequired +}; +var defaultProps = { + active: false, + descriptionPosition: 'bottom', + disabled: false, + hidden: false, + selected: false, + truncate: false +}; + +/** + * An option within a `Select`. This inherits from + * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent) + * so any elements passed to it must also be pure. + */ +var Option_Option = /*#__PURE__*/function (_PureComponent) { + _inherits(Option, _PureComponent); + + var _super = _createSuper(Option); + + function Option() { + var _this; + + _classCallCheck(this, Option); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "c", null); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) { + _this.c = c; + }); + + return _this; + } + + _createClass(Option, [{ + key: "scrollIntoViewIfNeeded", + value: function scrollIntoViewIfNeeded() { + var _this$c; + + (_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded(); + } + /** + * Place focus on the button. + */ + + }, { + key: "focus", + value: function focus() { + var _this$c2; + + (_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus(); + } + }, { + key: "render", + value: function render() { + return /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], _extends({}, this.props, { + multiple: false, + ref: this.handleMount + }), this.props.children || this.props.label); + } + }]); + + return Option; +}(external_react_["PureComponent"]); + +_defineProperty(Option_Option, "propTypes", propTypes); + +_defineProperty(Option_Option, "defaultProps", defaultProps); + +/* harmony default export */ var Select_Option = (Option_Option); +// CONCATENATED MODULE: ./src/Select/Select.tsx +function Select_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Select_typeof = function _typeof(obj) { return typeof obj; }; } else { Select_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Select_typeof(obj); } + +function Select_extends() { Select_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Select_extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Select_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; } + +function Select_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Select_setPrototypeOf(subClass, superClass); } + +function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); } + +function Select_createSuper(Derived) { var hasNativeReflectConstruct = Select_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Select_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Select_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Select_possibleConstructorReturn(this, result); }; } + +function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); } + +function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Select_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); } + +function Select_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* eslint-disable max-classes-per-file */ + + + + + + +/** @public */ + +var Select_propTypes = { + allowKeyMatching: external_prop_types_default.a.bool, + animateLoading: external_prop_types_default.a.bool, + appearance: external_prop_types_default.a.oneOf(['default', 'link', 'primary', 'pill', 'toggle', 'flat']), + append: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']), + defaultValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number, external_prop_types_default.a.bool]), + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + filter: external_prop_types_default.a.oneOf([false, true, 'controlled']), + footerMessage: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + isLoadingOptions: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + labelText: external_prop_types_default.a.string, + loadingMessage: external_prop_types_default.a.node, + menuStyle: external_prop_types_default.a.object, + name: external_prop_types_default.a.string, + noOptionsMessage: external_prop_types_default.a.node, + onChange: external_prop_types_default.a.func, + onClose: external_prop_types_default.a.func, + onFilterChange: external_prop_types_default.a.func, + onOpen: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + prefixLabel: external_prop_types_default.a.string, + prepend: external_prop_types_default.a.bool, + suffixLabel: external_prop_types_default.a.string, + value: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number, external_prop_types_default.a.bool]) +}; +var Select_defaultProps = { + allowKeyMatching: true, + animateLoading: false, + appearance: 'toggle', + append: false, + children: [], + defaultPlacement: 'vertical', + disabled: false, + error: false, + filter: false, + inline: true, + isLoadingOptions: false, + menuStyle: {}, + noOptionsMessage: Object(i18n_["_"])('No matches'), + placeholder: Object(i18n_["_"])('Select...'), + prepend: false +}; + +var Select_Select = /*#__PURE__*/function (_Component) { + Select_inherits(Select, _Component); + + var _super = Select_createSuper(Select); + + // @docs-props-type SelectPropsBase + function Select(props) { + var _this; + + Select_classCallCheck(this, Select); + + _this = _super.call(this, props); + var state = {}; // wrap defaultValue in an array once to avoid failing 's defaultValues comparison check + // using "has" to make sure that pre-4.3 behavior is preserved if a user explicitly passes "null" or "undefined" + + if (has_default()(props, 'defaultValue')) { + if (props.defaultValue != null) { + state.defaultValues = [props.defaultValue]; + } else { + state.defaultValues = []; + } + } + + _this.state = state; + return _this; + } + + Select_createClass(Select, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (false) {} + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + defaultValue = _this$props.defaultValue, + _onChange = _this$props.onChange, + value = _this$props.value, + otherProps = _objectWithoutProperties(_this$props, ["defaultValue", "onChange", "value"]); + + var convertedProps = { + onChange: function onChange(e, _ref) { + var name = _ref.name, + values = _ref.values; + _onChange === null || _onChange === void 0 ? void 0 : _onChange(e, { + name: name, + value: values[0] + }); + } + }; // using "has" as opposed to a null check to match SelectBase + + if (has_default()(this.props, 'value')) { + if (value != null) { + convertedProps.values = [value]; + } else { + convertedProps.values = []; + } + } else if (this.state.defaultValues != null) { + // using defaultValues from state in order to avoid wrapping defaultValue here + convertedProps.defaultValues = this.state.defaultValues; + } + + return /*#__PURE__*/external_react_default.a.createElement(SelectBase["c" /* default */], Select_extends({}, otherProps, convertedProps, { + multiple: false + })); + } + }]); + + return Select; +}(external_react_["Component"]); + +Select_defineProperty(Select_Select, "propTypes", Select_propTypes); + +Select_defineProperty(Select_Select, "defaultProps", Select_defaultProps); + +Select_defineProperty(Select_Select, "Option", Select_Option); + +Select_defineProperty(Select_Select, "Heading", SelectBase["b" /* Heading */]); + +Select_defineProperty(Select_Select, "Divider", SelectBase["a" /* Divider */]); + +/* harmony default export */ var src_Select_Select = (Select_Select); + +// CONCATENATED MODULE: ./src/Select/index.ts + + + +/***/ }), + +/***/ 27: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_24467__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_24467__.d(__nested_webpack_exports__, "a", function() { return getDocument; }); +/* harmony export (binding) */ __nested_webpack_require_24467__.d(__nested_webpack_exports__, "b", function() { return ssrDocument; }); +/* eslint-disable @typescript-eslint/no-empty-function */ +var ssrDocument = { + body: { + appendChild: function appendChild() { + return []; + } + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + activeElement: { + blur: function blur() {}, + nodeName: '' + }, + querySelector: function querySelector() { + return null; + }, + querySelectorAll: function querySelectorAll() { + return []; + }, + getElementById: function getElementById() { + return null; + }, + createEvent: function createEvent() { + return { + initEvent: function initEvent() {} + }; + }, + createElement: function createElement() { + return { + children: [], + childNodes: [], + style: {}, + setAttribute: function setAttribute() {}, + getElementsByTagName: function getElementsByTagName() { + return []; + } + }; + }, + createElementNS: function createElementNS() { + return {}; + }, + importNode: function importNode() { + return null; + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } +}; + +function getDocument() { + var doc = typeof document !== 'undefined' ? document : ssrDocument; + return doc; +} + + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 30: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25338); + +/***/ }), + +/***/ 33: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(23601); + +/***/ }), + +/***/ 36: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_26432__) { + +"use strict"; +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_26432__(2); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_26432__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_26432__(1); +/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_26432__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_26432__(13); +/* harmony import */ var _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_26432__.n(_splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + +var propTypes = { + /** @private */ + active: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, + description: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, + descriptionPosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(['right', 'bottom']), + disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + hidden: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, + label: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired, + + /** + * @private Passed down from + */ + multiple: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + matchRanges: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.shape({ + start: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired, + end: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired + })), + + /** @private */ + onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func, + + /** @private */ + selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + truncate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool, + value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool]).isRequired +}; +var defaultProps = { + descriptionPosition: 'bottom', + disabled: false, + multiple: false, + selected: false, + truncate: false +}; + +/** + * An option within a `Multiselect`. This inherits from + * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent) + * so any elements passed to it must also be pure. + */ +var Option = /*#__PURE__*/function (_PureComponent) { + _inherits(Option, _PureComponent); + + var _super = _createSuper(Option); + + function Option() { + var _this; + + _classCallCheck(this, Option); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _defineProperty(_assertThisInitialized(_this), "c", null); + + _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props = _this.props, + onClick = _this$props.onClick, + value = _this$props.value, + disabled = _this$props.disabled; + + if (!disabled) { + onClick === null || onClick === void 0 ? void 0 : onClick(e, { + value: value + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (c) { + _this.c = c; + }); + + return _this; + } + + _createClass(Option, [{ + key: "scrollIntoViewIfNeeded", + value: function scrollIntoViewIfNeeded() { + var _this$c; + + (_this$c = this.c) === null || _this$c === void 0 ? void 0 : _this$c.scrollIntoViewIfNeeded(); + } + /** + * Place focus on the button. + */ + + }, { + key: "focus", + value: function focus() { + var _this$c2; + + (_this$c2 = this.c) === null || _this$c2 === void 0 ? void 0 : _this$c2.focus(); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + value = _this$props2.value, + children = _this$props2.children, + label = _this$props2.label, + multiple = _this$props2.multiple, + otherProps = _objectWithoutProperties(_this$props2, ["value", "children", "label", "multiple"]); + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"], _extends({ + "aria-selected": this.props.selected, + "data-test-value": value, + "data-test": "option", + ref: this.handleMount + }, otherProps, { + selectable: true, + selectableAppearance: multiple ? 'checkbox' : undefined, + onClick: this.handleClick, + role: "option", + value: value.toString() + }), children || label); + } + }]); + + return Option; +}(react__WEBPACK_IMPORTED_MODULE_0__["PureComponent"]); + +_defineProperty(Option, "propTypes", propTypes); + +_defineProperty(Option, "defaultProps", defaultProps); + +_defineProperty(Option, "type", _splunk_react_ui_Menu__WEBPACK_IMPORTED_MODULE_2__["Item"]); + +/* harmony default export */ __nested_webpack_exports__["a"] = (Option); + +/***/ }), + +/***/ 38: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(62216); + +/***/ }), + +/***/ 39: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(59421); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 41: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(44383); + +/***/ }), + +/***/ 44: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(80436); + +/***/ }), + +/***/ 46: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(80935); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 51: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(75795); + +/***/ }), + +/***/ 52: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7309); + +/***/ }), + +/***/ 53: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32305); + +/***/ }), + +/***/ 54: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40828); + +/***/ }), + +/***/ 56: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_37338__) { + +"use strict"; +/* unused harmony export charFromMatchOption */ +/* harmony export (binding) */ __nested_webpack_require_37338__.d(__nested_webpack_exports__, "a", function() { return fuzzyMatch; }); +// A utility for matching keyboard characters to list values +var charFromMatchOption = function charFromMatchOption(option, charIndex) { + return option ? option.label.charAt(charIndex).toLowerCase() : ''; +}; + +var fuzzyMatch = function fuzzyMatch(options, matchChar) { + if (!options.length) { + return options; + } + + var defaultMatch = null; + var hasMatch = false; + var matches = options.filter(function (option) { + var characterValue = charFromMatchOption(option, matchChar.index); + + if (characterValue === matchChar.value) { + hasMatch = true; + return true; + } // If we haven't found a match yet, keep track of the next closest match. + // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value. + + + if (!hasMatch) { + var defaultValue = charFromMatchOption(defaultMatch, matchChar.index); + + if (!defaultValue) { + defaultMatch = option; + } else if (characterValue > matchChar.value) { + if (defaultValue < matchChar.value) { + defaultMatch = option; + } else if (defaultValue > characterValue) { + defaultMatch = option; + } + } else if (characterValue > defaultValue) { + defaultMatch = option; + } + } + + return false; + }); + return matches.length === 0 && defaultMatch ? [defaultMatch] : matches; +}; + + + +/***/ }), + +/***/ 59: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(91648); + +/***/ }), + +/***/ 60: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_39075__) { + +"use strict"; + +// EXPORTS +__nested_webpack_require_39075__.d(__nested_webpack_exports__, "a", function() { return /* reexport */ Menu_["Divider"]; }); +__nested_webpack_require_39075__.d(__nested_webpack_exports__, "b", function() { return /* reexport */ Menu_["Heading"]; }); +__nested_webpack_require_39075__.d(__nested_webpack_exports__, "d", function() { return /* binding */ isOption; }); + +// UNUSED EXPORTS: Option + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_39075__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_39075__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_39075__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_39075__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/castArray" +var castArray_ = __nested_webpack_require_39075__(65); +var castArray_default = /*#__PURE__*/__nested_webpack_require_39075__.n(castArray_); + +// EXTERNAL MODULE: external "lodash/find" +var find_ = __nested_webpack_require_39075__(52); +var find_default = /*#__PURE__*/__nested_webpack_require_39075__.n(find_); + +// EXTERNAL MODULE: external "lodash/forEachRight" +var forEachRight_ = __nested_webpack_require_39075__(102); +var forEachRight_default = /*#__PURE__*/__nested_webpack_require_39075__.n(forEachRight_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_39075__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_39075__.n(has_); + +// EXTERNAL MODULE: external "lodash/includes" +var includes_ = __nested_webpack_require_39075__(15); +var includes_default = /*#__PURE__*/__nested_webpack_require_39075__.n(includes_); + +// EXTERNAL MODULE: external "lodash/isUndefined" +var isUndefined_ = __nested_webpack_require_39075__(38); +var isUndefined_default = /*#__PURE__*/__nested_webpack_require_39075__.n(isUndefined_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_39075__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_39075__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_39075__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_39075__.n(omit_); + +// EXTERNAL MODULE: external "lodash/pick" +var pick_ = __nested_webpack_require_39075__(41); +var pick_default = /*#__PURE__*/__nested_webpack_require_39075__.n(pick_); + +// EXTERNAL MODULE: external "lodash/uniq" +var uniq_ = __nested_webpack_require_39075__(103); +var uniq_default = /*#__PURE__*/__nested_webpack_require_39075__.n(uniq_); + +// EXTERNAL MODULE: external "lodash/without" +var without_ = __nested_webpack_require_39075__(59); +var without_default = /*#__PURE__*/__nested_webpack_require_39075__.n(without_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_39075__(8); + +// EXTERNAL MODULE: external "@splunk/react-ui/Menu" +var Menu_ = __nested_webpack_require_39075__(13); + +// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown" +var Dropdown_ = __nested_webpack_require_39075__(22); +var Dropdown_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Dropdown_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_39075__(7); + +// EXTERNAL MODULE: external "@splunk/ui-utils/filter" +var filter_ = __nested_webpack_require_39075__(33); + +// EXTERNAL MODULE: external "@splunk/react-ui/Link" +var Link_ = __nested_webpack_require_39075__(39); +var Link_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Link_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu" +var ResultsMenu_ = __nested_webpack_require_39075__(44); +var ResultsMenu_default = /*#__PURE__*/__nested_webpack_require_39075__.n(ResultsMenu_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Text" +var Text_ = __nested_webpack_require_39075__(30); +var Text_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Text_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_39075__(4); + +// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown" +var CaretSmallDown_ = __nested_webpack_require_39075__(53); +var CaretSmallDown_default = /*#__PURE__*/__nested_webpack_require_39075__.n(CaretSmallDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret" +var Caret_ = __nested_webpack_require_39075__(54); +var Caret_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Caret_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_39075__(0); + +// CONCATENATED MODULE: ./src/Select/icons/CaretSmallDown.tsx + + + + + +var CaretSmallDown_CaretSmallDownIcon = function CaretSmallDownIcon() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var familyCaretSmallDownIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, { + screenReaderText: null, + hideDefaultTooltip: true, + size: 0.5 + }) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, null); + return familyCaretSmallDownIcon; +}; + +/* harmony default export */ var CaretSmallDown = (CaretSmallDown_CaretSmallDownIcon); +// EXTERNAL MODULE: ./src/Select/OptionBase.tsx +var OptionBase = __nested_webpack_require_39075__(36); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search" +var Search_ = __nested_webpack_require_39075__(51); +var Search_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Search_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier" +var Magnifier_ = __nested_webpack_require_39075__(46); +var Magnifier_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Magnifier_); + +// CONCATENATED MODULE: ./src/Select/icons/Search.tsx + + + + + + +var Search_Search = function Search() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise, + isCompact = _useSplunkTheme.isCompact; + + var screenReaderText = Object(i18n_["_"])('Search'); + + var prismaSize = isCompact ? '20px' : '24px'; + var familyIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, { + role: "presentation", + size: "16px", + screenReaderText: screenReaderText, + hideDefaultTooltip: true + }) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, { + role: "presentation", + "aria-label": screenReaderText, + width: prismaSize, + height: prismaSize + }); + return familyIcon; +}; + +/* harmony default export */ var icons_Search = (Search_Search); +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_39075__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_39075__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_39075__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_39075__.n(Button_); + +// CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts + + + + +var StyledButton = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "SelectBaseStyles__StyledButton", + componentId: "sc-16cj7sk-0" +})(["&[data-inline]{width:", ";}", ""], function (_ref) { + var $multiple = _ref.$multiple; + return $multiple ? '400px' : 'auto'; +}, function (_ref2) { + var $multiple = _ref2.$multiple; + return !$multiple && 'flex-grow: 0;'; +}); +var StyledLinkIcon = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledLinkIcon", + componentId: "sc-16cj7sk-1" +})(["padding-right:2px;"]); +var StyledLinkCaret = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledLinkCaret", + componentId: "sc-16cj7sk-2" +})(["padding-left:2px;"]); +var StyledFilter = external_styled_components_default.a.div.withConfig({ + displayName: "SelectBaseStyles__StyledFilter", + componentId: "sc-16cj7sk-3" +})(["padding:", ";min-width:160px;"], Object(themes_["pick"])({ + enterprise: '8px', + prisma: '10px 16px' +})); +var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledSearchIconWrapper", + componentId: "sc-16cj7sk-4" +})(["color:", ";pointer-events:none;padding:", ";"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +}), Object(themes_["pick"])({ + comfortable: '0 8px', + compact: '0 6px' +})); +var StyledCount = external_styled_components_default.a.span.withConfig({ + displayName: "SelectBaseStyles__StyledCount", + componentId: "sc-16cj7sk-5" +})(["padding-right:", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingQuarter, + prisma: themes_["variables"].spacingXSmall +})); +var StyledControlsLink = external_styled_components_default()(Link_default.a).withConfig({ + displayName: "SelectBaseStyles__StyledControlsLink", + componentId: "sc-16cj7sk-6" +})(["", ";"], function (_ref3) { + var $disabled = _ref3.$disabled; + return $disabled && Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled); +}); +var StyledToggleAllControls = external_styled_components_default.a.div.withConfig({ + displayName: "SelectBaseStyles__StyledToggleAllControls", + componentId: "sc-16cj7sk-7" +})(["padding:", ";", ""], Object(themes_["pick"])({ + enterprise: "5px 8px", + prisma: '10px 16px' +}), Object(themes_["pickVariant"])('$placement', { + above: { + enterprise: Object(external_styled_components_["css"])(["border-top:", ";"], themes_["variables"].border), + prisma: Object(external_styled_components_["css"])(["border-top:1px solid ", ";"], themes_["variables"].neutral200) + }, + below: { + enterprise: Object(external_styled_components_["css"])(["border-bottom:", ";"], themes_["variables"].border), + prisma: Object(external_styled_components_["css"])(["border-bottom:1px solid ", ";"], themes_["variables"].neutral200) + } +})); + +// EXTERNAL MODULE: ./src/utils/fuzzyMatch.ts +var fuzzyMatch = __nested_webpack_require_39075__(56); + +// EXTERNAL MODULE: ./src/utils/ssrWindow.ts +var ssrWindow = __nested_webpack_require_39075__(18); + +// CONCATENATED MODULE: ./src/Select/SelectBase.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var propTypes = { + allowKeyMatching: external_prop_types_default.a.bool, + allowNewValues: external_prop_types_default.a.bool, + animateLoading: external_prop_types_default.a.bool, + appearance: external_prop_types_default.a.oneOf(['default', 'link', 'primary', 'pill', 'toggle', 'flat']), + append: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'vertical']), + defaultValues: external_prop_types_default.a.array, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + filter: external_prop_types_default.a.oneOf([false, true, 'controlled']), + footerMessage: external_prop_types_default.a.node, + inline: external_prop_types_default.a.bool, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + isLoadingOptions: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + labelText: external_prop_types_default.a.string, + loadingMessage: external_prop_types_default.a.node, + menuStyle: external_prop_types_default.a.object, + multiple: external_prop_types_default.a.bool, + name: external_prop_types_default.a.string, + noOptionsMessage: external_prop_types_default.a.node, + onChange: external_prop_types_default.a.func, + onClose: external_prop_types_default.a.func, + onFilterChange: external_prop_types_default.a.func, + onOpen: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + onScrollBottom: external_prop_types_default.a.func, + + /** @private. */ + required: external_prop_types_default.a.bool, + placeholder: external_prop_types_default.a.string, + prefixLabel: external_prop_types_default.a.string, + prepend: external_prop_types_default.a.bool, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip']), + showSelectedValuesFirst: external_prop_types_default.a.oneOf(['nextOpen', 'immediately', 'never']), + suffixLabel: external_prop_types_default.a.string, + tabConfirmsNewValue: external_prop_types_default.a.bool, + values: external_prop_types_default.a.array +}; +var defaultProps = { + allowKeyMatching: true, + allowNewValues: false, + animateLoading: false, + appearance: 'toggle', + append: false, + defaultPlacement: 'vertical', + disabled: false, + filter: false, + inline: false, + isLoadingOptions: false, + menuStyle: {}, + multiple: false, + noOptionsMessage: Object(i18n_["_"])('No matches'), + placeholder: Object(i18n_["_"])('Select...'), + prepend: false, + repositionMode: 'flip', + tabConfirmsNewValue: false +}; + +function isOption(child) { + return child && has_default()(child.props, 'value'); +} + +function itemKeyFromValueLabel(value, label) { + return "".concat(_typeof(value), "-").concat(value, "-").concat(label); +} + +var SelectBase_SelectBase = /*#__PURE__*/function (_Component) { + _inherits(SelectBase, _Component); + + var _super = _createSuper(SelectBase); + + _createClass(SelectBase, null, [{ + key: "validateAppearance", + // @docs-props-type CompactPropsBase + value: function validateAppearance(props) { + if (false) {} + } + }]); + + function SelectBase(props) { + var _this; + + _classCallCheck(this, SelectBase); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "activeItemId", void 0); + + _defineProperty(_assertThisInitialized(_this), "activeValue", void 0); + + _defineProperty(_assertThisInitialized(_this), "availableOptionCount", void 0); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "displayedValues", void 0); + + _defineProperty(_assertThisInitialized(_this), "dropdown", null); + + _defineProperty(_assertThisInitialized(_this), "firstSelectedEnabledOption", null); + + _defineProperty(_assertThisInitialized(_this), "firstSelectedOptionIndex", void 0); + + _defineProperty(_assertThisInitialized(_this), "menuId", void 0); + + _defineProperty(_assertThisInitialized(_this), "previousActiveIndex", null); + + _defineProperty(_assertThisInitialized(_this), "selectedOptionCount", void 0); + + _defineProperty(_assertThisInitialized(_this), "optionRefsByKey", void 0); + + _defineProperty(_assertThisInitialized(_this), "matchCharacter", void 0); + + _defineProperty(_assertThisInitialized(_this), "matchTimeout", void 0); + + _defineProperty(_assertThisInitialized(_this), "currentMatchOptions", void 0); + + _defineProperty(_assertThisInitialized(_this), "availableMatchOptions", void 0); + + _defineProperty(_assertThisInitialized(_this), "resetMatches", function () { + _this.matchCharacter = null; + _this.currentMatchOptions = []; + + if (_this.matchTimeout) { + clearTimeout(_this.matchTimeout); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleSelectAll", function (e) { + var _this$getCurrentValue, _this$props$onChange, _this$props2; + + var _this$props = _this.props, + name = _this$props.name, + children = _this$props.children, + multiple = _this$props.multiple; // this doesn't make sense if we can't select multiple values + + if (!multiple) { + return; + } + + var currentValues = (_this$getCurrentValue = _this.getCurrentValues()) !== null && _this$getCurrentValue !== void 0 ? _this$getCurrentValue : []; + var values = uniq_default()(currentValues.concat(_this.displayedValues)); + values = external_react_default.a.Children.toArray(children).filter(function (child) { + return isOption(child) && includes_default()(values, child.props.value) && (!child.props.disabled || includes_default()(currentValues, child.props.value)); + }).map(function (child) { + return child.props.value; + }); + + if (!_this.isControlled()) { + _this.setState({ + values: values + }); + } + + (_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, e, { + values: values, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleClearAll", function (e) { + var _this$getCurrentValue2, _this$props$onChange2, _this$props4; + + var _this$props3 = _this.props, + name = _this$props3.name, + children = _this$props3.children, + multiple = _this$props3.multiple; // this doesn't make sense if we can't select multiple values + + if (!multiple) { + return; + } + + var currentValues = (_this$getCurrentValue2 = _this.getCurrentValues()) !== null && _this$getCurrentValue2 !== void 0 ? _this$getCurrentValue2 : []; + var hiddenCurrentValues = without_default.a.apply(void 0, [currentValues].concat(_toConsumableArray(_this.displayedValues))); // this will unselect all selected values unless those values are disabled or hidden by the filter + + var values = external_react_default.a.Children.toArray(children).filter(function (child) { + return isOption(child) && (includes_default()(currentValues, child.props.value) && child.props.disabled || includes_default()(hiddenCurrentValues, child.props.value)); + }).map(function (child) { + return child.props.value; + }); + + if (!_this.isControlled()) { + _this.setState({ + values: values + }); + } + + (_this$props$onChange2 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props4, e, { + values: values, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextKeyDown", function (e) { + var _this$props5 = _this.props, + children = _this$props5.children, + onScrollBottom = _this$props5.onScrollBottom, + tabConfirmsNewValue = _this$props5.tabConfirmsNewValue; + var eventKeyCode = Object(keyboard_["keycode"])(e.nativeEvent); + + if (eventKeyCode === 'tab') { + if (tabConfirmsNewValue && !isUndefined_default()(_this.activeValue) && _this.availableOptionCount <= 1) { + e.preventDefault(); + + _this.toggleValue(e, _this.activeValue); + } + } + + if (e.shiftKey || e.metaKey || e.ctrlKey) { + return; + } + + if (eventKeyCode === 'down') { + e.preventDefault(); + + _this.setState(function (state) { + return { + activeIndex: Math.min(state.activeIndex + 1, _this.availableOptionCount - 1) + }; + }); + + if (children && onScrollBottom) { + var _this$getCurrentValue3; + + var beforeLastChild = external_react_["Children"].toArray(children).length - (2 + ((_this$getCurrentValue3 = _this.getCurrentValues()) !== null && _this$getCurrentValue3 !== void 0 ? _this$getCurrentValue3 : []).length); + + if (_this.state.activeIndex === beforeLastChild) { + _this.handleScrollBottom(e); + } + } + } + + if (eventKeyCode === 'up') { + e.preventDefault(); + + _this.setState(function (state) { + return { + activeIndex: Math.max(state.activeIndex - 1, 0) + }; + }); + } + + if (eventKeyCode === 'enter' && !isUndefined_default()(_this.activeValue) && _this.state.open) { + e.preventDefault(); + + _this.toggleValue(e, _this.activeValue); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMenuOptionClick", function (e, _ref) { + var value = _ref.value; + e.preventDefault(); + + if (!_this.state.open) { + return; + } + + _this.toggleValue(e, value); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMenuOptionKeyDown", function (e, optionIndex) { + var currentKey = e.nativeEvent.key; // Checking for a single character to avoid complications from double-byte languages and emojis. + + if (currentKey.length === 1) { + var matches = []; + var character = { + index: 0, + value: currentKey + }; + + if (!_this.matchCharacter) { + if (currentKey === ' ') { + _this.resetMatches(); + + return; + } + + matches = Object(fuzzyMatch["a" /* fuzzyMatch */])(_this.availableMatchOptions, character); + } else if (_this.currentMatchOptions.length > 1) { + character.index = _this.matchCharacter.index + 1; + matches = Object(fuzzyMatch["a" /* fuzzyMatch */])(_this.currentMatchOptions, character); + } + + if (matches.length) { + var matchIndex = 0; // If the active option is a first character match, cycle to the next matching option. + + if (character.index === 0 && matches.length > 1) { + var activeMatchIndex = matches.indexOf(_this.availableMatchOptions[optionIndex]); + + if (activeMatchIndex >= 0) { + matchIndex = activeMatchIndex === matches.length - 1 ? 0 : activeMatchIndex + 1; + } + } + + var match = matches[matchIndex]; + + var optionToFocusRef = _this.optionRefsByKey[itemKeyFromValueLabel(match.value, match.label)]; + + if (optionToFocusRef != null) { + var _optionToFocusRef$foc; + + (_optionToFocusRef$foc = optionToFocusRef.focus) === null || _optionToFocusRef$foc === void 0 ? void 0 : _optionToFocusRef$foc.call(optionToFocusRef); + } + } + + _this.currentMatchOptions = matches; + _this.matchCharacter = character; + + if (_this.matchTimeout) { + clearTimeout(_this.matchTimeout); + } + + _this.matchTimeout = setTimeout(_this.resetMatches, 500); + e.preventDefault(); + e.stopPropagation(); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextChange", function (e, _ref2) { + var _this$props$onFilterC, _this$props6; + + var value = _ref2.value; + + _this.setState({ + filterKeyword: value, + open: true, + activeIndex: 0 + }); + + (_this$props$onFilterC = (_this$props6 = _this.props).onFilterChange) === null || _this$props$onFilterC === void 0 ? void 0 : _this$props$onFilterC.call(_this$props6, e, { + keyword: value + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextFocus", function () { + _this.setState({ + textHasFocus: true + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTextBlur", function () { + _this.setState({ + textHasFocus: false + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestOpen", function (e) { + var newState = { + open: true, + topValues: _this.getTopValues() + }; // SUI-3234: preserve existing behavior difference between behaviour is to show the placeholder if all parts of the the label + // are empty strings so we replicate this behaviour here + + + if (label.length === 0 || !multiple && label.every(function (labelNode) { + return labelNode === ''; + })) { + label = [placeholder]; + } + + var ariaLabel = label; // If there's more than one item selected, read out the selected total + // rather than reading out each selected item + + if (label.length > 1) { + ariaLabel = _this.wrapLabel({ + prefixLabel: prefixLabel, + label: ["".concat(currentValues.length, " items selected")], + suffixLabel: suffixLabel + }); + } + + var commonProps = _objectSpread({ + 'aria-describedby': describedBy, + 'aria-label': "".concat(labelText ? "".concat(labelText, ", ") : '').concat(ariaLabel), + 'aria-labelledby': labelText ? undefined : labelledBy, + 'aria-multiselectable': multiple || undefined, + 'aria-required': required, + 'data-select-appearance': appearance, + 'data-test': multiple ? 'multiselect' : 'select', + disabled: disabled, + elementRef: elementRef, + error: error + }, omit_default()(_this.props, keys_default()(SelectBase.propTypes))); + + if (multiple) { + commonProps['data-test-values'] = JSON.stringify(currentValues); + } else { + var _currentValues = _slicedToArray(currentValues, 1), + dataTestValue = _currentValues[0]; + + commonProps['data-test-value'] = dataTestValue; + } + + if (toggle) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(toggle, commonProps); + } + + if (appearance === 'link') { + return /*#__PURE__*/external_react_default.a.createElement(Link_default.a, _extends({}, commonProps, { + "data-select-appearance": "link" + }), !!icon && /*#__PURE__*/external_react_default.a.createElement(StyledLinkIcon, null, icon), label || placeholder, /*#__PURE__*/external_react_default.a.createElement(StyledLinkCaret, null, /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown, null))); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledButton, _extends({}, commonProps, { + $multiple: multiple, + appearance: appearance, + label: label, + error: error, + icon: icon, + inline: inline, + isMenu: true, + "aria-haspopup": "listbox", + "aria-owns": _this.menuId // @ts-expect-error - accept inconsistency with Button + , + onClick: _this.props.onClick + }, pick_default()(_this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.a.createElement(StyledCount, { + "data-role": "count" + }, "(", currentValues.length, ")")); + }); + + _defineProperty(_assertThisInitialized(_this), "createChildren", function () { + var _this$state = _this.state, + filterKeyword = _this$state.filterKeyword, + textHasFocus = _this$state.textHasFocus, + topValuesState = _this$state.topValues; + var _this$props12 = _this.props, + allowKeyMatching = _this$props12.allowKeyMatching, + allowNewValues = _this$props12.allowNewValues, + filter = _this$props12.filter, + multiple = _this$props12.multiple, + showSelectedValuesFirst = _this$props12.showSelectedValuesFirst, + isLoadingOptions = _this$props12.isLoadingOptions, + onScrollBottom = _this$props12.onScrollBottom; + + var currentValues = _this.getCurrentValues(); + + _this.availableOptionCount = 0; + _this.firstSelectedOptionIndex = undefined; + _this.selectedOptionCount = 0; + _this.activeValue = undefined; + _this.availableMatchOptions = []; + var foundExactMatch; + var childrenTopCount = 0; + var hasDivider = false; // used to avoid overwriting the selected item ref in multiple mode + + var foundSelectedAndEnabled; + var topValues = showSelectedValuesFirst === 'immediately' ? _this.getTopValues() : topValuesState; + var children = external_react_["Children"].toArray(_this.props.children).reduce(function (acc, item, i) { + // ignore Headings and Dividers + if (!isOption(item)) { + acc.push(item); + return acc; + } // Find out if the search string exactly matches a value + + + if (item.props.value === _this.state.filterKeyword) { + foundExactMatch = true; + } + + var selected = currentValues && currentValues.indexOf(item.props.value) >= 0; + var isFirstSelectedAndEnabled = !!selected && !item.props.disabled && !foundSelectedAndEnabled; + var useMatchOptions = allowKeyMatching && !multiple && !filter && !isLoadingOptions && !onScrollBottom; + var itemKey = itemKeyFromValueLabel(item.props.value, item.props.label); + var filterIndex = -1; + + if (useMatchOptions && !item.props.disabled && !item.props.hidden) { + _this.availableMatchOptions.push({ + label: item.props.label, + value: item.props.value + }); + + filterIndex = _this.availableMatchOptions.length - 1; + } // Format the Menu.Item + + + var clonedItem = /*#__PURE__*/Object(external_react_["cloneElement"])(item, { + key: item.key || i, + onClick: _this.handleMenuOptionClick, + onKeyDown: useMatchOptions ? function (e) { + return _this.handleMenuOptionKeyDown(e, filterIndex); + } : undefined, + selected: selected, + multiple: multiple, + role: 'option', + ref: function ref(element) { + return _this.handleOptionMount(element, itemKey, isFirstSelectedAndEnabled); + } + }); + + if (isFirstSelectedAndEnabled) { + foundSelectedAndEnabled = true; + } + + if (topValues && topValues.indexOf(item.props.value) >= 0) { + if (childrenTopCount === 0) { + acc.splice(childrenTopCount, 0, /*#__PURE__*/external_react_default.a.createElement(Menu_["Divider"], { + key: "topDivider" + })); + hasDivider = true; + } + + acc.splice(childrenTopCount, 0, clonedItem); + childrenTopCount += 1; + } else { + acc.push(clonedItem); + } + + return acc; + }, []); // In multiple mode, add missing items + + if (multiple) { + forEachRight_default()(currentValues, function (value) { + var matchedItem = find_default()(children, function (item) { + return isOption(item) && item.props && item.props.value === value; + }); + + if (!matchedItem) { + if (value === _this.state.filterKeyword) { + foundExactMatch = true; + } + + var isTopValue = topValues && topValues.indexOf(value) >= 0; + var topLength = topValues.length; + + if (childrenTopCount === 0) { + children.splice(0, 0, /*#__PURE__*/external_react_default.a.createElement(Menu_["Divider"], { + key: "topDivider" + })); + childrenTopCount += 1; + hasDivider = true; + } + + children.splice(isTopValue ? 0 : topLength + 1, 0, /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], { + label: String(value), + value: value, + key: "missing-value-".concat(value), + onClick: _this.handleMenuOptionClick, + multiple: multiple, + selected: true + })); + + if (isTopValue) { + childrenTopCount += 1; + } + } + }); + } + + var controlledFilter = filter === 'controlled'; // Filter the items + + var keywords = Object(filter_["stringToKeywords"])(filterKeyword); + children = controlledFilter ? children : children.filter(function (option) { + if (isOption(option)) { + return Object(filter_["testPhrase"])(option.props.label, keywords); + } + + return true; // Keep all headers and non-interactive options + }) // highlight the matched text + .map(function (option) { + if (!isOption(option)) { + return option; + } // highlight matched text + + + var matchRanges = keywords && Object(filter_["keywordLocations"])(option.props.label, keywords); + return /*#__PURE__*/Object(external_react_["cloneElement"])(option, { + matchRanges: matchRanges || undefined + }); + }); // Add the option to add the new value + + if (allowNewValues && !foundExactMatch && filterKeyword) { + var insertIndex = hasDivider ? childrenTopCount + 1 : childrenTopCount; + children.splice(insertIndex, 0, /*#__PURE__*/external_react_default.a.createElement(OptionBase["a" /* default */], { + label: "".concat(filterKeyword, " (new value)"), + value: filterKeyword, + key: "newValue", + multiple: multiple, + onClick: _this.handleMenuOptionClick + })); + } // Highlight the selected Items and remove hidden + + + children = children.reduce(function (acc, item) { + // ignore Dividers & Headings + if (!isOption(item)) { + acc.push(item); + return acc; + } // Ignore any hidden items + + + if (item.props && item.props.hidden) { + return acc; + } + + if (item.props.selected && !item.props.disabled && _this.firstSelectedOptionIndex == null) { + _this.firstSelectedOptionIndex = _this.availableOptionCount; + } + + var active = _this.availableOptionCount === _this.state.activeIndex; + _this.availableOptionCount += 1; + _this.selectedOptionCount += item.props.selected ? 1 : 0; + + if (!active || !textHasFocus) { + acc.push(item); + return acc; + } + + if (!item.props.disabled) { + _this.activeValue = item.props.value; + } + + var clonedItem = /*#__PURE__*/Object(external_react_["cloneElement"])(item, { + active: active, + id: _this.activeItemId, + ref: _this.handleActiveOptionMount + }); + acc.push(clonedItem); + return acc; + }, []); + _this.displayedValues = children.reduce(function (acc, item) { + if (isOption(item)) { + acc.push(item.props.value); + } + + return acc; + }, []); + return children; + }); + + _defineProperty(_assertThisInitialized(_this), "wrapLabel", function (_ref3) { + var prefixLabel = _ref3.prefixLabel, + label = _ref3.label, + suffixLabel = _ref3.suffixLabel; + var wrappedLabel = label; + + if (prefixLabel) { + wrappedLabel = ["".concat(prefixLabel, ": ")].concat(wrappedLabel); + } + + if (suffixLabel) { + wrappedLabel = castArray_default()(wrappedLabel).concat(" ".concat(suffixLabel)); + } + + return wrappedLabel; + }); + + _this.state = { + activeIndex: 0, + filterKeyword: '', + open: false, + textHasFocus: false, + topValues: [], + values: props.defaultValues || [] + }; + _this.controlledExternally = has_default()(props, 'values'); + _this.displayedValues = []; + _this.availableOptionCount = 0; + _this.firstSelectedOptionIndex = undefined; + _this.selectedOptionCount = 0; + _this.matchCharacter = null; + _this.matchTimeout = null; + _this.currentMatchOptions = []; + _this.availableMatchOptions = []; + _this.optionRefsByKey = {}; + + if (false) {} + + if (false) {} + + SelectBase.validateAppearance(props); + _this.menuId = Object(id_["createDOMID"])('menu'); + _this.activeItemId = Object(id_["createDOMID"])('active-item'); + return _this; + } + + _createClass(SelectBase, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (false) {} + + if (false) {} + + SelectBase.validateAppearance(this.props); + this.previousActiveIndex = prevState.activeIndex; + } + }, { + key: "getCurrentValues", + value: function getCurrentValues() { + var values = this.isControlled() ? this.props.values : this.state.values; + return this.props.multiple || values == null ? values : values.slice(0, 1); + } + }, { + key: "getTopValues", + value: function getTopValues() { + var _this$getCurrentValue5; + + // in non-multiple mode, don't move values to the top of the list + return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue5 = this.getCurrentValues()) !== null && _this$getCurrentValue5 !== void 0 ? _this$getCurrentValue5 : [] : []; + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "hasFilter", + value: function hasFilter() { + return !!this.props.filter; + } + }, { + key: "toggleValue", + value: function toggleValue(e, value) { + var _this$getCurrentValue6, _this$props$onChange3, _this$props14; + + var values = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : []; + var currentIndex = values.indexOf(value); + var _this$props13 = this.props, + name = _this$props13.name, + multiple = _this$props13.multiple; + var newValues; + + if (multiple) { + if (currentIndex >= 0) { + newValues = [].concat(_toConsumableArray(values.slice(0, currentIndex)), _toConsumableArray(values.slice(currentIndex + 1))); + } else { + newValues = values.concat([value]); + } + } else { + // non-multiple mode must always have a value + newValues = [value]; + } + + var uncontrolled = !this.isControlled(); + + if (uncontrolled) { + this.setState({ + values: newValues + }); + } + + if (multiple) { + // in uncontrolled multiple mode, keep the menu open + if (uncontrolled) { + this.setState({ + open: true + }); + } + } else { + // non-multiple mode only supports a single selection + // so close the menu once a selection is made + this.handleRequestClose({ + reason: 'contentClick' + }); + this.focus(); + } + + (_this$props$onChange3 = (_this$props14 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props14, e, { + values: newValues, + name: name + }); + } + /** + * Place focus on the toggle. + */ + + }, { + key: "focus", + value: function focus() { + var _this$dropdown; + + (_this$dropdown = this.dropdown) === null || _this$dropdown === void 0 ? void 0 : _this$dropdown.focus(); + } + }, { + key: "renderControls", + value: function renderControls(_ref4) { + var hasChildren = _ref4.hasChildren, + placement = _ref4.placement; + var filterKeyword = this.state.filterKeyword; + var _this$props15 = this.props, + inputId = _this$props15.inputId, + inputRef = _this$props15.inputRef, + multiple = _this$props15.multiple; // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731 + + var selectControls = /*#__PURE__*/external_react_default.a.createElement(StyledToggleAllControls, { + $placement: placement, + key: "selectAll" + }, /*#__PURE__*/external_react_default.a.createElement(StyledControlsLink, { + $disabled: !(this.availableOptionCount - this.selectedOptionCount), + onClick: this.handleSelectAll, + "data-test": "select-all", + style: { + marginRight: 20 + } + }, filterKeyword ? Object(i18n_["_"])('Select All Matches') : Object(i18n_["_"])('Select All')), /*#__PURE__*/external_react_default.a.createElement(StyledControlsLink, { + $disabled: !this.selectedOptionCount, + onClick: this.handleClearAll, + "data-test": "clear-all" + }, filterKeyword ? Object(i18n_["_"])('Clear All Matches') : Object(i18n_["_"])('Clear All'))); + return this.hasFilter() && /*#__PURE__*/external_react_default.a.createElement("div", { + key: "controls" + }, /*#__PURE__*/external_react_default.a.createElement(StyledFilter, { + key: "filter", + "data-test": "filter" + }, /*#__PURE__*/external_react_default.a.createElement(Text_default.a, { + value: filterKeyword, + autoCapitalize: "off", + autoComplete: "off", + autoCorrect: "off", + spellCheck: false, + onChange: this.handleTextChange, + onKeyDown: this.handleTextKeyDown, + onFocus: this.handleTextFocus, + onBlur: this.handleTextBlur, + placeholder: Object(i18n_["_"])('filter'), + role: "combobox", + "aria-expanded": "true", + "aria-label": Object(i18n_["_"])('Filter'), + "aria-activedescendant": this.activeItemId, + inputRef: inputRef, + inputId: inputId, + canClear: true, + startAdornment: /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, null, /*#__PURE__*/external_react_default.a.createElement(icons_Search, null)) + })), multiple && hasChildren && selectControls); + } + }, { + key: "render", + value: function render() { + var _this$getCurrentValue7, + _this2 = this; + + var _this$props16 = this.props, + children = _this$props16.children, + defaultPlacement = _this$props16.defaultPlacement, + inputId = _this$props16.inputId, + multiple = _this$props16.multiple, + repositionMode = _this$props16.repositionMode; + var filterEnabled = this.hasFilter(); + var currentValues = (_this$getCurrentValue7 = this.getCurrentValues()) !== null && _this$getCurrentValue7 !== void 0 ? _this$getCurrentValue7 : []; + var childrenArray = external_react_["Children"].toArray(children); + var isAnyValueSelected = currentValues.some(function (value) { + var matchedItem = find_default()(childrenArray, function (item) { + return isOption(item) && item.props.value === value; + }); + return matchedItem && !matchedItem.props.disabled; + }); + var finalChildren = this.createChildren(); + var toggle = this.createToggle(); + + var createMenu = function createMenu(_ref5) { + var anchorWidth = _ref5.anchorWidth, + maxHeight = _ref5.maxHeight, + placement = _ref5.placement; + // preserve separate widths for single vs. multi mode + var internalMenuStyle = _this2.props.multiple ? { + width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200) + } : { + minWidth: anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : undefined, + maxWidth: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 300) + }; + var tabIndex = currentValues.length > 0 && !isAnyValueSelected && !_this2.hasFilter() ? 0 : undefined; + return /*#__PURE__*/external_react_default.a.createElement(ResultsMenu_default.a, _extends({ + "aria-multiselectable": multiple || undefined, + childrenStart: _this2.renderControls({ + placement: placement, + hasChildren: !!finalChildren.length + }), + controlledExternally: _this2.hasFilter(), + placement: placement !== null && placement !== void 0 ? placement : undefined, + maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : undefined, + onScrollBottom: _this2.props.onScrollBottom ? _this2.handleScrollBottom : undefined, + "data-test": "results-menu", + isLoading: _this2.props.isLoadingOptions, + id: _this2.menuId + }, pick_default()(_this2.props, 'noOptionsMessage', 'footerMessage', 'animateLoading', 'loadingMessage', 'onScroll'), { + style: _objectSpread(_objectSpread({}, internalMenuStyle), _this2.props.menuStyle), + tabIndex: tabIndex + }), finalChildren); + }; + + return /*#__PURE__*/external_react_default.a.createElement(Dropdown_default.a, { + closeReasons: ['clickAway', 'escapeKey', 'offScreen', 'tabKey', 'toggleClick'], + inputId: inputId, + toggle: toggle, + onRequestOpen: this.handleRequestOpen, + onRequestClose: this.handleRequestClose, + open: this.state.open, + openWithArrowKeys: true, + repositionMode: repositionMode, + defaultPlacement: filterEnabled ? defaultPlacement : undefined, + canCoverAnchor: Object(ssrWindow["a" /* getWindow */])().innerHeight < 500, + ref: function ref(c) { + _this2.dropdown = c; + }, + retainFocus: false, + takeFocus: currentValues.length === 0 || currentValues.length > 0 && !isAnyValueSelected || !!filterEnabled + }, createMenu); + } + }]); + + return SelectBase; +}(external_react_["Component"]); + +_defineProperty(SelectBase_SelectBase, "propTypes", propTypes); + +_defineProperty(SelectBase_SelectBase, "defaultProps", defaultProps); + +_defineProperty(SelectBase_SelectBase, "Option", OptionBase["a" /* default */]); + +_defineProperty(SelectBase_SelectBase, "Divider", Menu_["Divider"]); + +_defineProperty(SelectBase_SelectBase, "Heading", Menu_["Heading"]); + +_defineProperty(SelectBase_SelectBase, "invalidLinkAppearanceProps", ['append', 'error', 'prepend']); + +/* harmony default export */ var Select_SelectBase = __nested_webpack_exports__["c"] = (SelectBase_SelectBase); + + +/***/ }), + +/***/ 65: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(99084); + +/***/ }), + +/***/ 7: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 98798: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 233); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 233: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ StaticContent_StaticContent; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_3959__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_3959__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/StaticContent/StaticContentStyles.ts + + + +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "StaticContentStyles__StyledBox", + componentId: "sxqyrp-0" +})(["", ";position:relative;margin:0;font-weight:", ";word-wrap:break-word;min-height:", ";padding:", ";[data-inline] + &[data-inline]{margin-left:", ";}"], themes_["mixins"].reset('flex'), themes_["variables"].fontWeightSemiBold, themes_["variables"].inputHeight, Object(themes_["pick"])({ + enterprise: { + comfortable: '6px 7px', + compact: '4px 5px' + }, + prisma: { + comfortable: '10px 0', + compact: '6px 0' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingQuarter, + prisma: themes_["variables"].spacingLarge +})); + +// CONCATENATED MODULE: ./src/StaticContent/StaticContent.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var propTypes = { + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + inline: external_prop_types_default.a.bool, + size: external_prop_types_default.a.oneOf(['small', 'medium']) +}; + +/** + * This component is intended for use in a control group, either to display a static value or + * between two controls. + */ +function StaticContent(_ref) { + var children = _ref.children, + _ref$inline = _ref.inline, + inline = _ref$inline === void 0 ? false : _ref$inline, + _ref$size = _ref.size, + size = _ref$size === void 0 ? 'medium' : _ref$size, + otherProps = _objectWithoutProperties(_ref, ["children", "inline", "size"]); + + // @docs-props-type StaticContentPropsBase + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + "data-test": "static-content", + "data-size": size, + inline: inline + }, otherProps), children); +} + +StaticContent.propTypes = propTypes; +/* harmony default export */ var StaticContent_StaticContent = (StaticContent); +// CONCATENATED MODULE: ./src/StaticContent/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 73997: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 206); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 206: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4197__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4197__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4197__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Switch_Switch; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4197__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4197__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4197__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4197__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-ui/AnimationToggle" +var AnimationToggle_ = __nested_webpack_require_4197__(48); +var AnimationToggle_default = /*#__PURE__*/__nested_webpack_require_4197__.n(AnimationToggle_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4197__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4197__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4197__(8); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Check" +var Check_ = __nested_webpack_require_4197__(94); +var Check_default = /*#__PURE__*/__nested_webpack_require_4197__.n(Check_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4197__(0); + +// CONCATENATED MODULE: ./src/Switch/CheckIcon.tsx + + + +function CheckIcon() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family; + + if (family === 'enterprise') { + return /*#__PURE__*/external_react_default.a.createElement(Check_default.a, { + inline: false, + size: "12px", + screenReaderText: null, + hideDefaultTooltip: true, + style: { + marginTop: '1px' + } + }); + } + + return /*#__PURE__*/external_react_default.a.createElement("svg", { + width: "12", + height: "12", + viewBox: "-1 -2 11 10", + style: { + display: 'block' + }, + xmlns: "http://www.w3.org/2000/svg" + }, /*#__PURE__*/external_react_default.a.createElement("path", { + d: "M8.70711 0.292893C9.09763 0.683417 9.09763 1.31658 8.70711 1.70711L4.32132 6.0929C3.73559 6.67862 2.78596 6.67869 2.20015 6.09305L0.292997 4.18646C-0.0975845 3.79599 -0.0976776 3.16282 0.292789 2.77224C0.683256 2.38166 1.31642 2.38157 1.707 2.77203L3.26061 4.32518L7.29289 0.292893C7.68342 -0.0976311 8.31658 -0.0976311 8.70711 0.292893Z", + fill: "currentColor" + })); +} +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4197__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4197__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_4197__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_4197__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4197__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4197__.n(Clickable_); + +// CONCATENATED MODULE: ./src/Switch/SwitchStyles.ts + + + + +var diameter = '18px'; +var toggleDiameter = '20px'; +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "SwitchStyles__StyledBox", + componentId: "sc-844ieu-0" +})(["display:inline;position:relative;color:", ";flex-shrink:0;padding:", ";[data-inline] + &{margin-left:", ";}"], Object(themes_["pickVariant"])('$switchState', { + error: { + enterprise: themes_["variables"].errorColor, + prisma: themes_["variables"].accentColorNegative + }, + disabled: { + enterprise: themes_["variables"].textDisabledColor, + prisma: themes_["variables"].contentColorDisabled + } +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc((", " - ", ") / 2) 0"], themes_["variables"].inputHeight, diameter), + prisma: { + compact: '6px 0', + comfortable: '10px 0' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: themes_["variables"].spacingSmall +})); +var StyledCheckboxClickable = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "SwitchStyles__StyledCheckboxClickable", + componentId: "sc-844ieu-1" +})(["", " position:relative;width:", ";height:", ";line-height:", ";padding:2px;border-radius:2px;cursor:pointer;flex:0 0 auto;border:", ";color:", ";", " &:focus{box-shadow:", ";}", " ", " &[disabled]{cursor:not-allowed;border-color:", ";", "}"], themes_["mixins"].reset('inline'), diameter, diameter, diameter, Object(themes_["pick"])({ + enterprise: Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray45), + dark: Object(external_styled_components_["css"])(["1px solid ", ""], themes_["variables"].gray80) + }), + prisma: Object(external_styled_components_["css"])(["2px solid ", ""], themes_["variables"].contentColorMuted) +}), Object(themes_["pick"])({ + enterprise: Object(themes_["pick"])({ + light: themes_["variables"].gray45, + dark: themes_["variables"].gray80 + }), + prisma: themes_["variables"].white +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["top:1px;padding:1px;border-radius:3px;", " ", ""], function (_ref) { + var $interactive = _ref.$interactive; + return $interactive && Object(external_styled_components_["css"])(["&:not([disabled]):not(:focus):hover{box-shadow:0 0 0 2px ", ",0 0 0 5px ", ";}"], themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayHover); + }, function (_ref2) { + var $selected = _ref2.$selected; + return !$selected && Object(external_styled_components_["css"])(["&:not([disabled]):not(:focus):hover{border-color:", ";}"], themes_["variables"].contentColorDefault); + }) +}), themes_["variables"].focusShadow, function (_ref3) { + var $selected = _ref3.$selected; + return $selected && Object(external_styled_components_["css"])(["&:not([disabled]){border-color:", ";background-color:", ";}"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray45, + dark: themes_["variables"].gray80 + }, + prisma: themes_["variables"].interactiveColorPrimary + }), Object(themes_["pick"])({ + enterprise: '#none', + prisma: Object(external_styled_components_["css"])(["", ";"], themes_["variables"].interactiveColorPrimary) + })); +}, function (_ref4) { + var $error = _ref4.$error; + return $error && Object(themes_["pick"])({ + enterprise: Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["&:not([disabled]){border-color:", ";color:", ";", "}"], themes_["variables"].errorColorL30, themes_["variables"].errorColor, function (_ref5) { + var $selected = _ref5.$selected; + return $selected && Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].errorColor); + }), + dark: Object(external_styled_components_["css"])(["border-color:", ";}"], themes_["variables"].errorColor) + }), + prisma: Object(external_styled_components_["css"])(["&:not([disabled]){border-color:", ";", "}"], themes_["variables"].accentColorNegative, function (_ref6) { + var $selected = _ref6.$selected; + return $selected && Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].accentColorNegative); + }) + }); +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].borderColor, + dark: themes_["variables"].gray45 + }, + prisma: themes_["variables"].contentColorDisabled +}), function (_ref7) { + var $selected = _ref7.$selected; + return $selected && Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["border-color:transparent;background-color:", ";"], themes_["variables"].interactiveColorBackgroundDisabled) + }); +}); +var StyledCheckboxSpan = StyledCheckboxClickable.withComponent('span'); +var StyledSome = external_styled_components_default.a.div.withConfig({ + displayName: "SwitchStyles__StyledSome", + componentId: "sc-844ieu-2" +})(["display:block;margin:", ";height:", ";width:", ";background:currentColor;border-radius:1px;"], Object(themes_["pick"])({ + enterprise: '2px', + prisma: '5px 2px' +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc(", " - 10px);"], diameter), + prisma: '2px' +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc(", " - 10px);"], diameter), + prisma: '8px' +})); +var StyledIndicator = external_styled_components_default.a.div.withConfig({ + displayName: "SwitchStyles__StyledIndicator", + componentId: "sc-844ieu-3" +})(["background-color:", ";border-color:", ";box-sizing:border-box;border-radius:50%;border-width:1px;position:absolute;left:-1px;top:-1px;", ";", " ", " ", ""], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray98, + dark: themes_["variables"].gray80 + }, + prisma: themes_["variables"].white +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].borderColor + }, + prisma: themes_["variables"].transparent +}), function (_ref8) { + var $delay = _ref8.$delay; + return $delay && Object(external_styled_components_["css"])(["transition:left ", ";"], $delay); +}, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["width:", ";height:", ";border-style:solid;"], diameter, diameter), + prisma: Object(external_styled_components_["css"])(["height:16px;width:16px;margin:2px;border-style:none;box-shadow:", ";"], themes_["variables"].embossShadow) +}), function (_ref9) { + var $disabled = _ref9.$disabled; + return $disabled && Object(external_styled_components_["css"])(["border-color:", ";border-style:solid;background-color:", ";"], Object(themes_["pick"])({ + enterprise: { + light: themes_["mixins"].colorWithAlpha(themes_["variables"].borderLightColor, 0.8), + dark: themes_["variables"].gray22 + }, + prisma: themes_["variables"].transparent + }), Object(themes_["pick"])({ + enterprise: { + dark: themes_["variables"].gray45 + }, + prisma: themes_["mixins"].colorWithAlpha(themes_["variables"].white, 0.3) + })); +}, function (_ref10) { + var $selected = _ref10.$selected; + return $selected && Object(external_styled_components_["css"])(["left:", ";"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc(100% - ", " + 1px)"], diameter), + prisma: Object(external_styled_components_["css"])(["calc(100% - ", " + 1px)"], toggleDiameter) + })); +}); +var StyledToggleOutline = external_styled_components_default.a.div.withConfig({ + displayName: "SwitchStyles__StyledToggleOutline", + componentId: "sc-844ieu-4" +})(["position:absolute;border:1px solid transparent;", ";border-radius:", ";top:-1px;right:-1px;bottom:-1px;left:-1px;z-index:1;", " ", ""], function (_ref11) { + var $delay = _ref11.$delay; + return $delay && Object(external_styled_components_["css"])(["transition:border-color ", ";"], $delay); +}, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["calc(", " * 0.5)"], diameter), + prisma: '15px' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["margin:-6px;"]) +}), function (_ref12) { + var $error = _ref12.$error; + return $error && Object(external_styled_components_["css"])(["border-color:", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].errorColor, + prisma: themes_["variables"].transparent + })); +}); +var StyledToggleClickable = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "SwitchStyles__StyledToggleClickable", + componentId: "sc-844ieu-5" +})(["position:relative;", " border-radius:", ";transition:background-color ", ";flex:0 0 auto;border:1px solid ", ";", " &:not([disabled]){&:focus{outline:0;box-shadow:", ";", "}&:hover ", "{background-color:", ";}&:hover ", "{background-color:", ";}};&[disabled]{border:1px solid ", ";background-color:", ";", " ", "}", ";", ""], Object(themes_["pick"])({ + enterprise: Object(themes_["pick"])({ + light: Object(external_styled_components_["css"])(["width:calc(", " * 2);background-color:", ";height:", ";"], diameter, themes_["variables"].gray98, diameter), + dark: Object(external_styled_components_["css"])(["width:calc(", " * 2);background-color:", ";height:", ";"], diameter, themes_["variables"].gray45, diameter) + }), + prisma: Object(external_styled_components_["css"])(["width:32px;background-color:", ";height:", ";top:1px;"], themes_["variables"].contentColorMuted, toggleDiameter) +}), diameter, function (props) { + return props.$delay; +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].borderColor + }, + prisma: themes_["variables"].transparent +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:inset 0 2px 0 rgba(0,0,0,0.1);"]) +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["", ",inset 0 2px 0 rgba(0,0,0,0.1);"], themes_["variables"].focusShadow), + prisma: themes_["variables"].focusShadow +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["> ", "{border-color:", ";}"], + /* sc-sel */ + StyledToggleOutline, themes_["mixins"].colorWithAlpha(themes_["variables"].focusColor, 0.8)) +}), +/* sc-sel */ +StyledIndicator, Object(themes_["pick"])({ + enterprise: Object(themes_["pick"])({ + light: themes_["variables"].gray96, + dark: '#b1bcc7' + }), + prisma: themes_["variables"].white +}), +/* sc-sel */ +StyledToggleOutline, Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayHover +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].borderLightColor, + dark: themes_["variables"].borderColor + }, + prisma: themes_["variables"].transparent +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray96, + dark: themes_["variables"].gray30 + }, + prisma: themes_["variables"].interactiveColorBackgroundDisabled +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:inset 0 2px 0 rgba(0,0,0,0.06);"]) +}), function (_ref13) { + var $selected = _ref13.$selected; + return $selected && Object(external_styled_components_["css"])(["border-color:transparent;background-color:", ";"], Object(themes_["pick"])({ + enterprise: Object(themes_["pick"])({ + light: themes_["variables"].accentColorL40, + dark: themes_["variables"].accentColorD20 + }), + prisma: themes_["mixins"].colorWithAlpha(themes_["variables"].interactiveColorPrimary, 0.7) + })); +}, function (_ref14) { + var $selected = _ref14.$selected; + return $selected && Object(external_styled_components_["css"])(["border-color:", ";background-color:", ";", ""], Object(themes_["pick"])({ + enterprise: themes_["variables"].accentColorL10, + prisma: themes_["variables"].transparent + }), Object(themes_["pick"])({ + enterprise: themes_["variables"].accentColorL10, + prisma: themes_["variables"].interactiveColorPrimary + }), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].embossShadow) + })); +}, function (_ref15) { + var $error = _ref15.$error; + return $error && Object(external_styled_components_["css"])(["border-color:", ";", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].errorColor, + prisma: themes_["variables"].transparent + }), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].accentColorNegative) + })); +}); +var StyledToggleSpan = StyledToggleClickable.withComponent('span'); +var StyledLabel = external_styled_components_default.a.label.withConfig({ + displayName: "SwitchStyles__StyledLabel", + componentId: "sc-844ieu-6" +})(["", " flex:1 1 auto;padding-left:", ";color:inherit;", ";"], themes_["mixins"].reset('inline-block'), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["", ";"], themes_["variables"].spacingQuarter), + prisma: '8px' +}), function (_ref16) { + var $disabled = _ref16.$disabled; + return !$disabled && Object(external_styled_components_["css"])(["cursor:pointer;"]); +}); + +// CONCATENATED MODULE: ./src/Switch/Switch.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + +var propTypes = { + appearance: external_prop_types_default.a.oneOf(['checkbox', 'toggle']), + children: external_prop_types_default.a.node, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + error: external_prop_types_default.a.bool, + id: external_prop_types_default.a.string, + inline: external_prop_types_default.a.bool, + + /** @private */ + interactive: external_prop_types_default.a.bool, + labelledBy: external_prop_types_default.a.string, + onClick: external_prop_types_default.a.func, + + /** @private. */ + required: external_prop_types_default.a.bool, + selected: external_prop_types_default.a.oneOf([true, false, 'some']), + selectedLabel: external_prop_types_default.a.string, + someSelectedLabel: external_prop_types_default.a.string, + unselectedLabel: external_prop_types_default.a.string, + value: external_prop_types_default.a.any +}; +var defaultProps = { + appearance: 'checkbox', + disabled: false, + error: false, + inline: false, + interactive: true, + selected: false +}; +// unclear why the manual ref is needed here (only for styled-components) +var StyledClickables = { + checkbox: StyledCheckboxClickable, + toggle: StyledToggleClickable +}; +var StyledSpans = { + checkbox: StyledCheckboxSpan, + toggle: StyledToggleSpan +}; +/** + * `Switch` is a basic form control with an on/off state. + */ + +var Switch_Switch = /*#__PURE__*/function (_Component) { + _inherits(Switch, _Component); + + var _super = _createSuper(Switch); + + _createClass(Switch, null, [{ + key: "validateProps", + // @docs-props-type SwitchPropsBase + value: function validateProps(_ref) { + var selected = _ref.selected, + appearance = _ref.appearance; + + if (false) {} + } + }]); + + function Switch(props) { + var _this; + + _classCallCheck(this, Switch); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "clickableId", void 0); + + _defineProperty(_assertThisInitialized(_this), "labelId", void 0); + + _defineProperty(_assertThisInitialized(_this), "toggle", null); + + _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", Switch.validateProps); + + _defineProperty(_assertThisInitialized(_this), "handleContainerClick", function (e) { + var _this$props$onClick, _this$props2; + + var _this$props = _this.props, + value = _this$props.value, + selected = _this$props.selected; + (_this$props$onClick = (_this$props2 = _this.props).onClick) === null || _this$props$onClick === void 0 ? void 0 : _this$props$onClick.call(_this$props2, e, { + value: value, + // @ts-expect-error - safe due to individual prop interfaces + selected: selected + }); + }); + + _this.labelId = Object(id_["createDOMID"])('label'); + _this.clickableId = Object(id_["createDOMID"])('clickable'); + Switch.validateProps(props); + return _this; + } + + _createClass(Switch, [{ + key: "focus", + + /** + * Place focus on the toggle. + */ + value: function focus() { + var _this$toggle; + + (_this$toggle = this.toggle) === null || _this$toggle === void 0 ? void 0 : _this$toggle.focus(); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props3 = this.props, + appearance = _this$props3.appearance, + children = _this$props3.children, + disabled = _this$props3.disabled, + error = _this$props3.error, + id = _this$props3.id, + inline = _this$props3.inline, + interactive = _this$props3.interactive, + labelledBy = _this$props3.labelledBy, + onClick = _this$props3.onClick, + required = _this$props3.required, + selected = _this$props3.selected, + selectedLabel = _this$props3.selectedLabel, + someSelectedLabel = _this$props3.someSelectedLabel, + unselectedLabel = _this$props3.unselectedLabel, + value = _this$props3.value, + otherProps = _objectWithoutProperties(_this$props3, ["appearance", "children", "disabled", "error", "id", "inline", "interactive", "labelledBy", "onClick", "required", "selected", "selectedLabel", "someSelectedLabel", "unselectedLabel", "value"]); + + var labelId = labelledBy; // consumer defined external label + + var clickableId = id; // consumer defined id + // if has internal label defined with children.... + + if (children) { + labelId = this.labelId; // must use generated labelId + + clickableId = id || this.clickableId; // must have an id + } + + var ariaChecked = selected === 'some' ? 'mixed' : selected; + var stateLabels = { + "true": selectedLabel, + "false": unselectedLabel, + some: someSelectedLabel + }; + var switchProps = { + disabled: disabled, + $interactive: interactive, + $error: error, + $selected: selected === 'some' || selected, + 'aria-labelledby': interactive ? labelId : undefined, + 'aria-checked': interactive ? ariaChecked : undefined, + 'aria-invalid': error ? true : undefined, + 'aria-required': required, + id: clickableId, + ref: function ref(c) { + _this2.toggle = c; + }, + onClick: disabled || !interactive ? undefined : this.handleContainerClick, + 'data-test': 'button', + 'data-selected': selected + }; + var StyledClickable = StyledClickables[appearance]; + var StyledSpan = StyledSpans[appearance]; + + var renderToggle = function renderToggle(delay) { + return function () { + var toggleChildren = /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(StyledIndicator, { + $delay: delay, + $disabled: disabled, + $error: !disabled && error, + $selected: selected + }), /*#__PURE__*/external_react_default.a.createElement(StyledToggleOutline, { + $delay: delay, + $error: !disabled && error + })); + return interactive ? /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({ + role: "switch" + }, switchProps, { + $delay: delay + }), toggleChildren) : /*#__PURE__*/external_react_default.a.createElement(StyledSpan, _extends({}, switchProps, { + $delay: delay + }), toggleChildren); + }; + }; + + var renderNonToggle = function renderNonToggle() { + var nonToggleChildren = /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, selected === true && appearance === 'checkbox' && /*#__PURE__*/external_react_default.a.createElement(CheckIcon, null), selected === 'some' && appearance === 'checkbox' && /*#__PURE__*/external_react_default.a.createElement(StyledSome, null)); + return interactive ? /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({ + "data-clickable": true, + role: appearance + }, switchProps), nonToggleChildren) : /*#__PURE__*/external_react_default.a.createElement(StyledSpan, switchProps, nonToggleChildren); + }; + + var switchState = disabled && 'disabled' || error && 'error' || null; + var hasCustomizedScreenReaderContent = !!selectedLabel || !!someSelectedLabel || !!unselectedLabel; + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + flex: true, + inline: inline, + "data-test": "switch", + "data-test-selected": selected, + "data-test-value": value, + "data-test-error": error ? true : undefined, + "data-error": error ? true : undefined, + "data-disabled": disabled ? true : undefined, + $switchState: switchState + }, otherProps), appearance === 'toggle' && /*#__PURE__*/external_react_default.a.createElement(AnimationToggle_default.a, { + on: renderToggle('200ms'), + off: renderToggle() + }), appearance !== 'toggle' && renderNonToggle(), interactive && hasCustomizedScreenReaderContent && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, stateLabels["".concat(selected)]), children && /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + $disabled: disabled, + "data-test": "label", + id: labelId, + htmlFor: clickableId, + "data-disabled": disabled || null + }, children)); + } + }]); + + return Switch; +}(external_react_["Component"]); + +_defineProperty(Switch_Switch, "propTypes", propTypes); + +_defineProperty(Switch_Switch, "defaultProps", defaultProps); + +/* harmony default export */ var src_Switch_Switch = (Switch_Switch); +// CONCATENATED MODULE: ./src/Switch/index.ts + + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 48: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(4995); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), + +/***/ 94: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(89439); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 52529: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 168); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), +/* 6 */, +/* 7 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64538); + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), +/* 11 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4669__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_4669__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), +/* 12 */, +/* 13 */, +/* 14 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79859); + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68973); + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), +/* 18 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5993__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_5993__.d(__nested_webpack_exports__, "a", function() { return getWindow; }); +/* unused harmony export ssrWindow */ +/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_5993__(27); +/* eslint-disable @typescript-eslint/no-empty-function */ + +var ssrWindow = { + document: _ssrDocument__WEBPACK_IMPORTED_MODULE_0__[/* ssrDocument */ "b"], + navigator: { + userAgent: '' + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + }, + history: { + replaceState: function replaceState() {}, + pushState: function pushState() {}, + go: function go() {}, + back: function back() {} + }, + CustomEvent: function CustomEvent() { + return this; + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + getComputedStyle: function getComputedStyle() { + return { + getPropertyValue: function getPropertyValue() { + return ''; + } + }; + }, + Image: function Image() {}, + Date: function Date() {}, + screen: {}, + setTimeout: function setTimeout() {}, + clearTimeout: function clearTimeout() {}, + matchMedia: function matchMedia() { + return {}; + }, + requestAnimationFrame: function requestAnimationFrame(callback) { + if (typeof setTimeout === 'undefined') { + callback(); + return null; + } + + return setTimeout(callback, 0); + }, + cancelAnimationFrame: function cancelAnimationFrame(id) { + if (typeof setTimeout === 'undefined') { + return; + } + + clearTimeout(id); + } +}; + +function getWindow() { + var win = typeof window !== 'undefined' ? window : ssrWindow; + return win; +} + + + +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92297); + +/***/ }), +/* 20 */, +/* 21 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79728); + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73592); + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(85015); + +/***/ }), +/* 24 */, +/* 25 */, +/* 26 */, +/* 27 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_8304__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_8304__.d(__nested_webpack_exports__, "a", function() { return getDocument; }); +/* harmony export (binding) */ __nested_webpack_require_8304__.d(__nested_webpack_exports__, "b", function() { return ssrDocument; }); +/* eslint-disable @typescript-eslint/no-empty-function */ +var ssrDocument = { + body: { + appendChild: function appendChild() { + return []; + } + }, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {}, + activeElement: { + blur: function blur() {}, + nodeName: '' + }, + querySelector: function querySelector() { + return null; + }, + querySelectorAll: function querySelectorAll() { + return []; + }, + getElementById: function getElementById() { + return null; + }, + createEvent: function createEvent() { + return { + initEvent: function initEvent() {} + }; + }, + createElement: function createElement() { + return { + children: [], + childNodes: [], + style: {}, + setAttribute: function setAttribute() {}, + getElementsByTagName: function getElementsByTagName() { + return []; + } + }; + }, + createElementNS: function createElementNS() { + return {}; + }, + importNode: function importNode() { + return null; + }, + location: { + hash: '', + host: '', + hostname: '', + href: '', + origin: '', + pathname: '', + protocol: '', + search: '' + } +}; + +function getDocument() { + var doc = typeof document !== 'undefined' ? document : ssrDocument; + return doc; +} + + + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(33492); + +/***/ }), +/* 29 */, +/* 30 */, +/* 31 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7350); + +/***/ }), +/* 32 */, +/* 33 */, +/* 34 */, +/* 35 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(69564); + +/***/ }), +/* 36 */, +/* 37 */, +/* 38 */, +/* 39 */, +/* 40 */, +/* 41 */, +/* 42 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28546); + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(65836); + +/***/ }), +/* 44 */, +/* 45 */, +/* 46 */, +/* 47 */, +/* 48 */, +/* 49 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(43346); + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(25474); + +/***/ }), +/* 51 */, +/* 52 */, +/* 53 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32305); + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(40828); + +/***/ }), +/* 55 */, +/* 56 */, +/* 57 */, +/* 58 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(73997); + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(91648); + +/***/ }), +/* 60 */, +/* 61 */, +/* 62 */, +/* 63 */, +/* 64 */, +/* 65 */, +/* 66 */, +/* 67 */, +/* 68 */, +/* 69 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1882); + +/***/ }), +/* 70 */, +/* 71 */, +/* 72 */, +/* 73 */, +/* 74 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(98023); + +/***/ }), +/* 75 */, +/* 76 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_11739__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_11739__.d(__nested_webpack_exports__, "a", function() { return assertDefined; }); +// see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245 for details +// regarding the css prop. certain (versions of) libraries included in the compilation +// - such as storybook->emotion - introduce the css prop using a global augmentation, +// which causes the prop to end up in our declaration files (via JSX.IntrinsicElements). +// it's difficult to control all nested dependencies and their types, which is why the +// css prop is omitted in the two prop helpers above - this ensures the css prop isn't +// erroneously included in react-ui's public api. +// see https://github.com/microsoft/TypeScript/pull/12253 +// see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html +function assertDefined(val, msg) { + if (val === undefined || val === null) { + throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected undefined or null'); + } +} + + + +/***/ }), +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(21585); + +/***/ }), +/* 82 */, +/* 83 */, +/* 84 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(21433); + +/***/ }), +/* 85 */, +/* 86 */, +/* 87 */, +/* 88 */, +/* 89 */, +/* 90 */, +/* 91 */, +/* 92 */, +/* 93 */, +/* 94 */, +/* 95 */, +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */, +/* 103 */, +/* 104 */, +/* 105 */, +/* 106 */, +/* 107 */, +/* 108 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(74129); + +/***/ }), +/* 109 */, +/* 110 */, +/* 111 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(24713); + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(55364); + +/***/ }), +/* 113 */, +/* 114 */, +/* 115 */, +/* 116 */, +/* 117 */, +/* 118 */, +/* 119 */, +/* 120 */, +/* 121 */, +/* 122 */, +/* 123 */, +/* 124 */, +/* 125 */, +/* 126 */, +/* 127 */, +/* 128 */, +/* 129 */, +/* 130 */, +/* 131 */, +/* 132 */, +/* 133 */, +/* 134 */, +/* 135 */, +/* 136 */, +/* 137 */, +/* 138 */, +/* 139 */, +/* 140 */, +/* 141 */, +/* 142 */, +/* 143 */, +/* 144 */, +/* 145 */, +/* 146 */, +/* 147 */, +/* 148 */, +/* 149 */, +/* 150 */, +/* 151 */, +/* 152 */, +/* 153 */, +/* 154 */, +/* 155 */, +/* 156 */, +/* 157 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39754); + +/***/ }), +/* 158 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(2404); + +/***/ }), +/* 159 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(84038); + +/***/ }), +/* 160 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(47954); + +/***/ }), +/* 161 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5323); + +/***/ }), +/* 162 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(67151); + +/***/ }), +/* 163 */ +/***/ (function(module, exports) { + +module.exports = __webpack_require__(98515); + +/***/ }), +/* 164 */, +/* 165 */, +/* 166 */, +/* 167 */, +/* 168 */ +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_15029__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_15029__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Table_Table; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "Body", function() { return /* reexport */ Table_Body; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "Caption", function() { return /* reexport */ Table_Caption; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "Cell", function() { return /* reexport */ Table_Cell; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "Head", function() { return /* reexport */ Table_Head; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "HeadCell", function() { return /* reexport */ Table_HeadCell; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "HeadDropdownCell", function() { return /* reexport */ Table_HeadDropdownCell; }); +__nested_webpack_require_15029__.d(__nested_webpack_exports__, "Row", function() { return /* reexport */ Table_Row; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_15029__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_15029__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_15029__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_15029__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/forEach" +var forEach_ = __nested_webpack_require_15029__(157); +var forEach_default = /*#__PURE__*/__nested_webpack_require_15029__.n(forEach_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_15029__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_15029__.n(has_); + +// EXTERNAL MODULE: external "lodash/indexOf" +var indexOf_ = __nested_webpack_require_15029__(81); +var indexOf_default = /*#__PURE__*/__nested_webpack_require_15029__.n(indexOf_); + +// EXTERNAL MODULE: external "lodash/isEqual" +var isEqual_ = __nested_webpack_require_15029__(158); +var isEqual_default = /*#__PURE__*/__nested_webpack_require_15029__.n(isEqual_); + +// EXTERNAL MODULE: external "lodash/isNumber" +var isNumber_ = __nested_webpack_require_15029__(74); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_15029__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_15029__.n(omit_); + +// EXTERNAL MODULE: external "lodash/throttle" +var throttle_ = __nested_webpack_require_15029__(31); +var throttle_default = /*#__PURE__*/__nested_webpack_require_15029__.n(throttle_); + +// EXTERNAL MODULE: external "react-resize-detector" +var external_react_resize_detector_ = __nested_webpack_require_15029__(159); +var external_react_resize_detector_default = /*#__PURE__*/__nested_webpack_require_15029__.n(external_react_resize_detector_); + +// EXTERNAL MODULE: external "@splunk/react-ui/EventListener" +var EventListener_ = __nested_webpack_require_15029__(16); +var EventListener_default = /*#__PURE__*/__nested_webpack_require_15029__.n(EventListener_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard" +var keyboard_ = __nested_webpack_require_15029__(7); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext" +var ScrollContainerContext_ = __nested_webpack_require_15029__(50); + +// EXTERNAL MODULE: external "lodash/findIndex" +var findIndex_ = __nested_webpack_require_15029__(111); +var findIndex_default = /*#__PURE__*/__nested_webpack_require_15029__.n(findIndex_); + +// EXTERNAL MODULE: external "lodash/includes" +var includes_ = __nested_webpack_require_15029__(15); +var includes_default = /*#__PURE__*/__nested_webpack_require_15029__.n(includes_); + +// EXTERNAL MODULE: external "lodash/without" +var without_ = __nested_webpack_require_15029__(59); +var without_default = /*#__PURE__*/__nested_webpack_require_15029__.n(without_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_15029__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_15029__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_15029__(0); + +// CONCATENATED MODULE: ./src/Table/BodyStyles.ts + + +var Styled = external_styled_components_default.a.tbody.withConfig({ + displayName: "BodyStyles__Styled", + componentId: "sc-1k5p6pq-0" +})(["", " z-index:0;"], themes_["mixins"].reset('table-row-group')); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_15029__(11); + +// EXTERNAL MODULE: ./src/utils/ssrWindow.ts +var ssrWindow = __nested_webpack_require_15029__(18); + +// CONCATENATED MODULE: ./src/Table/Body.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + +var propTypes = { + /** @private. Generally passed by Table rather than added directly. */ + actions: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + + /** @private. Generally passed by Table rather than added directly. */ + movableColumns: external_prop_types_default.a.bool, + + /** @private. Generally passed by Table rather than added directly. */ + rowExpansion: external_prop_types_default.a.oneOf(['single', 'multi', 'none', 'controlled']), + + /** @private. Generally passed by Table rather than added directly. */ + onRequestMoveRow: external_prop_types_default.a.func, + + /** @private. Generally passed by Table rather than added directly. */ + primaryColumnIndex: external_prop_types_default.a.number, + + /** @private. Generally passed by Table rather than added directly. */ + stripeRows: external_prop_types_default.a.bool +}; +var defaultProps = { + actions: false, + rowExpansion: 'none', + stripeRows: false +}; + +var Body_Body = /*#__PURE__*/function (_Component) { + _inherits(Body, _Component); + + var _super = _createSuper(Body); + + // @docs-props-type BodyPropsBase + function Body(props) { + var _this; + + _classCallCheck(this, Body); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "el", null); + + _defineProperty(_assertThisInitialized(_this), "rect", void 0); + + _defineProperty(_assertThisInitialized(_this), "rowHeight", void 0); + + _defineProperty(_assertThisInitialized(_this), "rows", void 0); + + _defineProperty(_assertThisInitialized(_this), "handleDragStart", function (dragIndex, dragDataId) { + var _this$el, _this$el$parentElemen, _this$el$parentElemen2, _this$el2; + + var window = Object(ssrWindow["a" /* getWindow */])(); + _this.rect = (_this$el = _this.el) === null || _this$el === void 0 ? void 0 : (_this$el$parentElemen = _this$el.parentElement) === null || _this$el$parentElemen === void 0 ? void 0 : (_this$el$parentElemen2 = _this$el$parentElemen.parentElement) === null || _this$el$parentElemen2 === void 0 ? void 0 : _this$el$parentElemen2.getBoundingClientRect(); + _this.rowHeight = (_this$el2 = _this.el) === null || _this$el2 === void 0 ? void 0 : _this$el2.children[0].getBoundingClientRect().height; + + _this.setState({ + dragIndex: dragIndex, + dragDataId: dragDataId + }); + + window.addEventListener('dragenter', _this.handleDragEnter); + window.addEventListener('dragover', _this.handleDragOver); + window.addEventListener('drop', _this.handleDrop); + window.addEventListener('dragend', _this.handleDragEnd); + }); + + _defineProperty(_assertThisInitialized(_this), "handleDragOver", function (e) { + e.preventDefault(); // necessary for the drop event to fire + + if (e.dataTransfer) { + e.dataTransfer.dropEffect = 'move'; + } + + var y = e.clientY; + + _this.updateScrollPosition(y); + + _this.updateDragPosition(y); + }); + + _defineProperty(_assertThisInitialized(_this), "handleDragEnter", function (e) { + e.preventDefault(); // necessary for the drop event to fire + + _this.setState({ + dragPosition: e.clientY + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleDrop", function (e) { + e.preventDefault(); // necessary to prevent cell from animating to original position; + }); + + _defineProperty(_assertThisInitialized(_this), "handleDragEnd", function () { + var _this$state = _this.state, + dragIndex = _this$state.dragIndex, + dragDataId = _this$state.dragDataId; + + var guidelineIndex = _this.calculateGuideIndex(); // The new index is not necessarily the same as the guidelineIndex + + + if (dragIndex !== undefined) { + var toIndex = dragIndex < guidelineIndex ? guidelineIndex - 1 : guidelineIndex; + + if (dragIndex !== toIndex) { + var _this$props$onRequest, _this$props; + + (_this$props$onRequest = (_this$props = _this.props).onRequestMoveRow) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, { + fromIndex: dragIndex, + toIndex: toIndex, + dataId: dragDataId + }); + } + } + + _this.setState({ + dragPosition: undefined + }); + + _this.cleanupDrag(); + }); + + _defineProperty(_assertThisInitialized(_this), "onRequestMoveRow", function (_ref) { + var dataId = _ref.dataId, + fromIndex = _ref.fromIndex, + toIndex = _ref.toIndex; + + _this.setState({ + dragDataId: dataId + }); + + if (toIndex < external_react_["Children"].toArray(_this.props.children).length) { + var _this$props$onRequest2, _this$props2; + + (_this$props$onRequest2 = (_this$props2 = _this.props).onRequestMoveRow) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props2, { + fromIndex: fromIndex, + toIndex: toIndex, + dataId: dataId + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + _this.el = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "updateDragPosition", throttle_default()(_this.updateDragPositionImpl, 100, { + trailing: false + })); + + _this.state = { + dragDataId: undefined, + expanded: [] + }; + _this.rowHeight = 0; + return _this; + } + + _createClass(Body, [{ + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.cleanupDrag(); + } + }, { + key: "handleRowExpansion", + value: function handleRowExpansion(event, key, onExpansion) { + var current = this.state.expanded; + + if (this.props.rowExpansion === 'single') { + if (includes_default()(current, key)) { + this.setState({ + expanded: [] + }); + } else { + this.setState({ + expanded: [key] + }); + } + } else if (this.props.rowExpansion === 'multi') { + if (includes_default()(current, key)) { + this.setState({ + expanded: without_default()(current, key) + }); + } else { + this.setState({ + expanded: current.concat(key) + }); + } + } + + onExpansion === null || onExpansion === void 0 ? void 0 : onExpansion(event); + } + }, { + key: "calculateGuideIndex", + value: function calculateGuideIndex() { + var _this$state2 = this.state, + dragIndex = _this$state2.dragIndex, + dragPosition = _this$state2.dragPosition; + + if (dragPosition === undefined || !this.el) { + return -1; + } + + this.rows = Array.from(this.el.children); + var overIndex = findIndex_default()(this.rows, function (row) { + var rect = row.getBoundingClientRect(); + return dragPosition > rect.top && dragPosition < rect.bottom; + }); + + if (overIndex === -1) { + // must be too far left or right; + var rect = this.el.getBoundingClientRect(); + return dragPosition < rect.top ? 0 : this.rows.length; + } + + if (dragIndex !== undefined && overIndex > dragIndex) { + return overIndex + 1; + } + + return overIndex; + } + }, { + key: "updateDragPositionImpl", + value: function updateDragPositionImpl(dragPosition) { + this.setState({ + dragPosition: dragPosition + }); + } + }, { + key: "updateScrollPosition", + value: function updateScrollPosition(y) { + var _this$el3, _this$el3$parentEleme; + + var rect = this.rect; + + if (((_this$el3 = this.el) === null || _this$el3 === void 0 ? void 0 : (_this$el3$parentEleme = _this$el3.parentElement) === null || _this$el3$parentEleme === void 0 ? void 0 : _this$el3$parentEleme.parentElement) && rect && this.rowHeight !== undefined && y < rect.top + this.rowHeight * 2 + 5) { + this.el.parentElement.parentElement.scrollTop -= 1; + } + } + }, { + key: "cleanupDrag", + value: function cleanupDrag() { + var window = Object(ssrWindow["a" /* getWindow */])(); + window.removeEventListener('dragenter', this.handleDragEnter); + window.removeEventListener('dragover', this.handleDragOver); + window.removeEventListener('drop', this.handleDrop); + window.removeEventListener('dragend', this.handleDragEnd); + this.updateDragPosition.cancel(); + this.rows = undefined; + this.rect = undefined; + } + }, { + key: "render", + value: function render() { + var _this$state$dragDataI, + _this2 = this; + + var _this$props3 = this.props, + actions = _this$props3.actions, + children = _this$props3.children, + movableColumns = _this$props3.movableColumns, + onRequestMoveRow = _this$props3.onRequestMoveRow, + rowExpansion = _this$props3.rowExpansion, + primaryColumnIndex = _this$props3.primaryColumnIndex, + stripeRows = _this$props3.stripeRows, + otherProps = _objectWithoutProperties(_this$props3, ["actions", "children", "movableColumns", "onRequestMoveRow", "rowExpansion", "primaryColumnIndex", "stripeRows"]); + + var rows = []; + var guidelineRowIndex = this.calculateGuideIndex(); + var activeElementId = (_this$state$dragDataI = this.state.dragDataId) === null || _this$state$dragDataI === void 0 ? void 0 : _this$state$dragDataI.toString(); + var filteredChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]); + filteredChildren.forEach(function (child, i) { + var showRowGuideline = 'none'; + + if (guidelineRowIndex === filteredChildren.length && i + 1 === filteredChildren.length) { + showRowGuideline = 'after'; + } else if (guidelineRowIndex === i) { + showRowGuideline = 'before'; + } + + if (child) { + if (false) {} + + var key = child.key; + var oddOrEven = i % 2 ? 'even' : 'odd'; + var stripe = stripeRows ? oddOrEven : 'none'; + var expanded = rowExpansion === 'controlled' ? child.props.expanded : includes_default()(_this2.state.expanded, key); + + var onExpansion = function onExpansion(e) { + _this2.handleRowExpansion(e, key, child.props.onExpansion); + }; + + rows.push( /*#__PURE__*/Object(external_react_["cloneElement"])(child, { + index: i, + showRowGuideline: showRowGuideline, + stripe: stripe, + actions: actions, + expanded: expanded, + expandable: rowExpansion !== 'none', + draggable: !!onRequestMoveRow, + movableColumns: movableColumns, + primaryColumnIndex: primaryColumnIndex, + onExpansion: onExpansion, + onRequestMoveRow: onRequestMoveRow ? _this2.onRequestMoveRow : undefined, + onDragStart: onRequestMoveRow ? _this2.handleDragStart : undefined, + key: child.key || child.props.dataId || i, + dataId: child.key || child.props.dataId || i, + activeElementId: activeElementId + })); + + if (expanded && child.props.expansionRow) { + external_react_["Children"].forEach(child.props.expansionRow, function (expansionRow, index) { + return rows.push( /*#__PURE__*/Object(external_react_["cloneElement"])(expansionRow, { + key: "".concat(key, "-expansion-").concat(index), + stripe: stripe, + movableColumns: movableColumns, + onRequestMoveRow: onRequestMoveRow, + 'data-expansion-row': 'true' + })); + }); + } + } + }); + + if (rows.length === 0) { + return null; + } + + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + "data-test": "body" + }, otherProps, { + ref: this.handleMount + }), rows); + } + }]); + + return Body; +}(external_react_["Component"]); + +_defineProperty(Body_Body, "splunkUiType", 'Table.Body'); + +_defineProperty(Body_Body, "propTypes", propTypes); + +_defineProperty(Body_Body, "defaultProps", defaultProps); + +/* harmony default export */ var Table_Body = (Body_Body); +// CONCATENATED MODULE: ./src/Table/TableStyles.ts + + +var TableStyles_Styled = external_styled_components_default.a.div.withConfig({ + displayName: "TableStyles__Styled", + componentId: "sc-1cmfss7-0" +})(["", ";max-width:100%;position:relative;z-index:1;@media print{max-height:none !important;}"], themes_["mixins"].reset('block')); +var StyledTableContainer = external_styled_components_default.a.div.withConfig({ + displayName: "TableStyles__StyledTableContainer", + componentId: "sc-1cmfss7-1" +})(["overflow:auto;&::before{content:'';width:100%;height:0;top:0;position:absolute;}"]); +var StyledTable = external_styled_components_default.a.table.withConfig({ + displayName: "TableStyles__StyledTable", + componentId: "sc-1cmfss7-2" +})(["", ";position:relative;border-collapse:collapse;border-spacing:0;min-width:100%;z-index:0;&[data-fixed-column='true']{table-layout:fixed;min-width:0;width:0;}", " @media print{width:100%;max-width:100%;table-layout:auto;}"], themes_["mixins"].reset('table'), function (_ref) { + var $resizableFillLayout = _ref.$resizableFillLayout; + return $resizableFillLayout && Object(external_styled_components_["css"])(["width:100%;min-width:100%;table-layout:fixed;"]); +}); +var StyledDockedScrollbar = external_styled_components_default.a.div.withConfig({ + displayName: "TableStyles__StyledDockedScrollbar", + componentId: "sc-1cmfss7-3" +})(["position:fixed;bottom:0;overflow:auto;z-index:calc(", " + 1);"], themes_["variables"].zindexFixedNavbar); +var StyledDockedScrollbarContent = external_styled_components_default.a.div.withConfig({ + displayName: "TableStyles__StyledDockedScrollbarContent", + componentId: "sc-1cmfss7-4" +})(["height:1px;"]); +var StyledTableCaption = external_styled_components_default.a.caption.withConfig({ + displayName: "TableStyles__StyledTableCaption", + componentId: "sc-1cmfss7-5" +})(["padding:", ";font-size:", ";caption-side:", ";"], Object(themes_["pick"])({ + enterprise: "".concat(themes_["variables"].spacingQuarter, " 0"), + prisma: "5px 0" +}), themes_["variables"].fontSizeLarge, function (_ref2) { + var side = _ref2.side; + return side; +}); + +// CONCATENATED MODULE: ./src/Table/Caption.tsx +function Caption_extends() { Caption_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Caption_extends.apply(this, arguments); } + +function Caption_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Caption_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Caption_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + +var Caption_propTypes = { + children: external_prop_types_default.a.node.isRequired, + side: external_prop_types_default.a.oneOf(['top', 'bottom']) +}; + +/** + * Tables that use a docked header must place the caption on the bottom side. + * Tables that use a fixed header cannot use captions. + */ +function Caption(_ref) { + var children = _ref.children, + _ref$side = _ref.side, + side = _ref$side === void 0 ? 'top' : _ref$side, + otherProps = Caption_objectWithoutProperties(_ref, ["children", "side"]); + + // @docs-props-type CaptionPropsBase + return /*#__PURE__*/external_react_default.a.createElement(StyledTableCaption, Caption_extends({ + "data-test": "caption", + side: side + }, otherProps), children); +} + +Caption.propTypes = Caption_propTypes; +Caption.splunkUiType = 'Table.Caption'; +/* harmony default export */ var Table_Caption = (Caption); +// CONCATENATED MODULE: ./src/Table/CellStyles.ts + + +var CellStyles_Styled = external_styled_components_default.a.td.withConfig({ + displayName: "CellStyles__Styled", + componentId: "sc-1955xk2-0" +})(["", " padding:", ";border-left:0 solid transparent;border-right:0 solid transparent;word-wrap:break-word;line-height:", ";vertical-align:top;", " ", " ", " ", " ", " ", " [data-expansion-row='true'] > &:first-child{padding-top:8px;}[data-expansion-row='true'] > &:last-child{padding-bottom:14px;}[data-has-movable-columns='true'] > &:not([data-movable-column='false']){", "}"], themes_["mixins"].reset('table-cell'), Object(themes_["pick"])({ + enterprise: '6px 12px', + prisma: { + comfortable: '14px 8px', + compact: '6px 8px' + } +}), themes_["variables"].lineHeight, Object(themes_["pickVariant"])('$align', { + center: Object(external_styled_components_["css"])(["text-align:center;"]), + left: Object(external_styled_components_["css"])(["text-align:left;"]), + right: Object(external_styled_components_["css"])(["text-align:right;"]) +}), Object(themes_["pickVariant"])('$variant', { + expand: { + enterprise: Object(external_styled_components_["css"])(["padding:6px 0 0 0;"]), + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:12px 0 0 0;"]), + compact: Object(external_styled_components_["css"])(["padding:4px 0 0 0;"]) + } + }, + actions: { + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:4px 8px;"]), + compact: Object(external_styled_components_["css"])(["padding:0 8px 0 0;"]) + } + }, + toggle: { + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:10px 0 0 0;"]), + compact: Object(external_styled_components_["css"])(["padding:6px 0 0 0;"]) + } + } +}), Object(themes_["pickVariant"])('$appearance', { + rowLink: { + enterprise: Object(external_styled_components_["css"])(["color:", ";*:hover > &{cursor:pointer;}"], themes_["variables"].linkColor), + prisma: Object(external_styled_components_["css"])(["color:", ";*:hover > &{cursor:pointer;}"], themes_["variables"].contentColorDefault) + }, + link: { + enterprise: Object(external_styled_components_["css"])(["color:", ";&:hover{cursor:pointer;color:{dark:variables.accentColorL20,light:variables.linkColor,};box-shadow:", ";}&:focus{color:{dark:variables.accentColorL20,light:variables.focusColor,};box-shadow:", ";}"], themes_["variables"].linkColor, themes_["variables"].focusShadowInset, themes_["variables"].focusShadowInset) + } +}), function (_ref) { + var $clickable = _ref.$clickable; + return $clickable && Object(external_styled_components_["css"])(["cursor:pointer;&:hover{background-color:", ";color:", ";}&:focus{box-shadow:", ";color:", ";}&:active{background:", ";}"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorL50, + dark: themes_["variables"].accentColorD50 + }, + prisma: themes_["variables"].interactiveColorOverlayHover + }), Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDefault + }), themes_["variables"].focusShadowInset, Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDefault + }), Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayActive + })); +}, function (_ref2) { + var $expanded = _ref2.$expanded; + return $expanded && Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlaySelected + })); +}, function (_ref3) { + var $disabled = _ref3.$disabled; + return $disabled && Object(external_styled_components_["css"])(["color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDisabled + })); +}, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["padding-left:29px;&:first-child{padding-left:28px;}"]) +})); + +// CONCATENATED MODULE: ./src/Table/Cell.tsx +function Cell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Cell_typeof = function _typeof(obj) { return typeof obj; }; } else { Cell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Cell_typeof(obj); } + +function Cell_extends() { Cell_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Cell_extends.apply(this, arguments); } + +function Cell_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Cell_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Cell_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function Cell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Cell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Cell_createClass(Constructor, protoProps, staticProps) { if (protoProps) Cell_defineProperties(Constructor.prototype, protoProps); if (staticProps) Cell_defineProperties(Constructor, staticProps); return Constructor; } + +function Cell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Cell_setPrototypeOf(subClass, superClass); } + +function Cell_setPrototypeOf(o, p) { Cell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Cell_setPrototypeOf(o, p); } + +function Cell_createSuper(Derived) { var hasNativeReflectConstruct = Cell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Cell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Cell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Cell_possibleConstructorReturn(this, result); }; } + +function Cell_possibleConstructorReturn(self, call) { if (call && (Cell_typeof(call) === "object" || typeof call === "function")) { return call; } return Cell_assertThisInitialized(self); } + +function Cell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Cell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Cell_getPrototypeOf(o) { Cell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Cell_getPrototypeOf(o); } + +function Cell_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + +var Cell_propTypes = { + align: external_prop_types_default.a.oneOf(['left', 'center', 'right']), + + /** @private */ + appearance: external_prop_types_default.a.oneOf(['data', 'link', 'rowLink']), + children: external_prop_types_default.a.node, + data: external_prop_types_default.a.any, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + onClick: external_prop_types_default.a.func, + + /** @private */ + onKeyDown: external_prop_types_default.a.func, + + /** @private */ + disabled: external_prop_types_default.a.bool, + + /** @private. */ + expand: external_prop_types_default.a.bool, + + /** @private. */ + variant: external_prop_types_default.a.oneOf(['toggle', 'expand', 'drag', 'actions']) +}; +var Cell_defaultProps = { + align: 'left' +}; + +var Cell_Cell = /*#__PURE__*/function (_Component) { + Cell_inherits(Cell, _Component); + + var _super = Cell_createSuper(Cell); + + function Cell() { + var _this; + + Cell_classCallCheck(this, Cell); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + Cell_defineProperty(Cell_assertThisInitialized(_this), "el", null); + + Cell_defineProperty(Cell_assertThisInitialized(_this), "handleMount", function (el) { + _this.el = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + Cell_defineProperty(Cell_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props = _this.props, + data = _this$props.data, + onClick = _this$props.onClick; + onClick === null || onClick === void 0 ? void 0 : onClick(e, data); + }); + + Cell_defineProperty(Cell_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props2 = _this.props, + data = _this$props2.data, + onClick = _this$props2.onClick, + onKeyDown = _this$props2.onKeyDown; + + if (Object(keyboard_["keycode"])(e.nativeEvent) === 'enter') { + onClick === null || onClick === void 0 ? void 0 : onClick(e, data); + } + + onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e); + }); + + return _this; + } + + Cell_createClass(Cell, [{ + key: "render", + value: function render() { + var _this$props3 = this.props, + align = _this$props3.align, + appearance = _this$props3.appearance, + children = _this$props3.children, + disabled = _this$props3.disabled, + elementRef = _this$props3.elementRef, + onClick = _this$props3.onClick, + onKeyDown = _this$props3.onKeyDown, + variant = _this$props3.variant, + otherProps = Cell_objectWithoutProperties(_this$props3, ["align", "appearance", "children", "disabled", "elementRef", "onClick", "onKeyDown", "variant"]); + + var clickable = onClick !== undefined; + var defaultAppearance = clickable ? 'link' : 'data'; + return /*#__PURE__*/external_react_default.a.createElement(CellStyles_Styled, Cell_extends({ + "data-test": "cell", + $align: align, + $appearance: appearance || defaultAppearance, + $clickable: clickable ? true : undefined, + $disabled: !!disabled, + $variant: variant, + onClick: this.handleClick, + onKeyDown: this.handleKeyDown, + ref: this.handleMount, + tabIndex: clickable ? 0 : undefined + }, otherProps), children); + } + }]); + + return Cell; +}(external_react_["Component"]); + +Cell_defineProperty(Cell_Cell, "splunkUiType", 'Table.Cell'); + +Cell_defineProperty(Cell_Cell, "propTypes", Cell_propTypes); + +Cell_defineProperty(Cell_Cell, "defaultProps", Cell_defaultProps); + +/* harmony default export */ var Table_Cell = (Cell_Cell); +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_15029__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_15029__.n(keys_); + +// EXTERNAL MODULE: external "lodash/isString" +var isString_ = __nested_webpack_require_15029__(23); +var isString_default = /*#__PURE__*/__nested_webpack_require_15029__.n(isString_); + +// EXTERNAL MODULE: external "lodash/merge" +var merge_ = __nested_webpack_require_15029__(112); +var merge_default = /*#__PURE__*/__nested_webpack_require_15029__.n(merge_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ArrowDown" +var ArrowDown_ = __nested_webpack_require_15029__(160); +var ArrowDown_default = /*#__PURE__*/__nested_webpack_require_15029__.n(ArrowDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ArrowUp" +var ArrowUp_ = __nested_webpack_require_15029__(161); +var ArrowUp_default = /*#__PURE__*/__nested_webpack_require_15029__.n(ArrowUp_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ArrowUpDown" +var ArrowUpDown_ = __nested_webpack_require_15029__(162); +var ArrowUpDown_default = /*#__PURE__*/__nested_webpack_require_15029__.n(ArrowUpDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/CaretSmallDown" +var CaretSmallDown_ = __nested_webpack_require_15029__(53); +var CaretSmallDown_default = /*#__PURE__*/__nested_webpack_require_15029__.n(CaretSmallDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/CaretsSmallUpDown" +var CaretsSmallUpDown_ = __nested_webpack_require_15029__(108); +var CaretsSmallUpDown_default = /*#__PURE__*/__nested_webpack_require_15029__.n(CaretsSmallUpDown_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Caret" +var Caret_ = __nested_webpack_require_15029__(54); +var Caret_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Caret_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_15029__(4); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_15029__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_15029__.n(ScreenReaderContent_); + +// CONCATENATED MODULE: ./src/Table/HeadInnerStyles.ts + + + +var tableHorizontalSpacing = '12px'; +var StyledDragContainer = external_styled_components_default.a.div.withConfig({ + displayName: "HeadInnerStyles__StyledDragContainer", + componentId: "sc-1sa0wng-0" +})(["position:absolute;cursor:move;top:0;", " padding:", ";"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["left:0;"]), + prisma: Object(external_styled_components_["css"])(["right:0;"]) +}), Object(themes_["pick"])({ + enterprise: '9px 12px', + prisma: { + comfortable: '17px 4px 14px', + compact: '9px 4px 6px' + } +})); +var StyledMenuIcon = external_styled_components_default.a.span.withConfig({ + displayName: "HeadInnerStyles__StyledMenuIcon", + componentId: "sc-1sa0wng-1" +})(["", " color:", ";position:relative;"], Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["display:inline-flex;"]), + enterprise: Object(external_styled_components_["css"])(["padding-left:4px;"]) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textGray, + prisma: themes_["variables"].contentColorDefault +})); +var StyledLabel = external_styled_components_default.a.span.withConfig({ + displayName: "HeadInnerStyles__StyledLabel", + componentId: "sc-1sa0wng-2" +})(["flex:0 1 auto;position:relative;word-wrap:break-word;word-break:break-word;", " ", " ", " ", " ", " + &{margin-left:", ";}"], Object(themes_["pick"])({ + enterprise: function enterprise(_ref) { + var $align = _ref.$align; + return $align !== 'right' && Object(external_styled_components_["css"])(["display:flex;justify-content:space-between;"]); + }, + prisma: Object(external_styled_components_["css"])(["display:flex;"]) +}), Object(themes_["pickVariant"])('$truncate', { + "true": Object(external_styled_components_["css"])(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]) +}), Object(themes_["pickVariant"])('$fill', { + "true": Object(external_styled_components_["css"])(["flex:1 0 0px;"]) +}), Object(themes_["pickVariant"])('$align', { + right: Object(external_styled_components_["css"])(["& > &{text-align:right;}"]), + left: Object(external_styled_components_["css"])(["& > &{text-align:left;}"]), + center: Object(external_styled_components_["css"])(["& > &{text-align:center;}"]) +}), +/* sc-sel */ +StyledDragContainer, Object(themes_["pick"])({ + enterprise: tableHorizontalSpacing +})); +var HeadInnerStyles_Styled = external_styled_components_default.a.div.withConfig({ + displayName: "HeadInnerStyles__Styled", + componentId: "sc-1sa0wng-3" +})(["", " ", ";position:relative;font-size:", ";", ";line-height:", ";justify-content:", ";padding:", ";", " ", " ", " &[data-helper]{background-color:", ";position:absolute;left:-10000px;top:-10000px;box-shadow:", ";box-sizing:border-box;background-repeat:repeat-x;", ";}@media print{background-image:none;}"], themes_["mixins"].reset('flex'), themes_["mixins"].clearfix(), Object(themes_["pick"])({ + enterprise: 'inherit', + prisma: '12px' +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["font-weight:bold;"]) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].lineHeight, + prisma: '16px' +}), Object(themes_["pickVariant"])('$align', { + center: 'center', + left: 'flex-start', + right: 'flex-end' +}), Object(themes_["pick"])({ + enterprise: '6px 12px', + prisma: { + comfortable: '16px 10px', + compact: '8px' + } +}), function (_ref2) { + var $hasActionsHead = _ref2.$hasActionsHead; + return $hasActionsHead && Object(external_styled_components_["css"])(["padding:0;"]); +}, function (_ref3) { + var $dragging = _ref3.$dragging; + return $dragging && Object(external_styled_components_["css"])(["opacity:0;"]); +}, function (_ref4) { + var $draggable = _ref4.$draggable; + return $draggable && Object(external_styled_components_["css"])(["padding-left:", ";-webkit-user-drag:element;user-select:none;"], Object(themes_["pick"])({ + enterprise: '16px' + })); +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorL50, + dark: themes_["variables"].accentColorD50 + }, + prisma: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlaySelected) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].overlayShadow, + prisma: themes_["variables"].dragShadow +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["border:1px solid ", ";"], themes_["variables"].borderColor) +})); +var StyledSortIcon = external_styled_components_default.a.span.withConfig({ + displayName: "HeadInnerStyles__StyledSortIcon", + componentId: "sc-1sa0wng-4" +})(["flex:0 0 auto;", ";", " color:", ";", ""], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["right:0;"]), + prisma: Object(external_styled_components_["css"])(["left:0;"]) +}), Object(themes_["pick"])({ + prisma: Object(external_styled_components_["css"])(["margin-right:4px;"]) +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].textGray, + dark: themes_["variables"].gray80 + } +}), function (_ref5) { + var $sorted = _ref5.$sorted; + return $sorted && Object(external_styled_components_["css"])(["color:", ";"], Object(themes_["pick"])({ + enterprise: themes_["variables"].accentColor, + prisma: themes_["variables"].contentColorDefault + })); +}); +var StyledResize = external_styled_components_default.a.button.withConfig({ + displayName: "HeadInnerStyles__StyledResize", + componentId: "sc-1sa0wng-5" +})(["", ";position:absolute;right:-5px;width:9px;top:0;bottom:0;z-index:1;cursor:col-resize;th:last-child > ", " > &{right:0;width:5px;}&::-moz-focus-inner{border:0;padding:0;}&:focus{outline:none;&::before{content:'';position:absolute;background:", ";box-shadow:", ";left:4px;width:1px;top:0;bottom:0;}}"], themes_["mixins"].reset('block'), +/* sc-sel */ +HeadInnerStyles_Styled, themes_["variables"].focusColor, themes_["variables"].focusShadow); // TODO: SUI-5361 remove StyledCaretUp and StyledCaretDown once have made a general way to address the multicolor icon problem + +var StyledCaretDown = external_styled_components_default()(CaretsSmallUpDown_default.a).withConfig({ + displayName: "HeadInnerStyles__StyledCaretDown", + componentId: "sc-1sa0wng-6" +})(["path:last-child{fill:transparent;}"]); +var StyledCaretUp = external_styled_components_default()(CaretsSmallUpDown_default.a).withConfig({ + displayName: "HeadInnerStyles__StyledCaretUp", + componentId: "sc-1sa0wng-7" +})(["path:first-child{fill:transparent;}"]); + +// CONCATENATED MODULE: ./src/Table/HeadCellStyles.ts + + + +var HeadCellStyles_Styled = external_styled_components_default.a.th.withConfig({ + displayName: "HeadCellStyles__Styled", + componentId: "sc-1hj81sa-0" +})(["", ";background-color:", ";box-sizing:content-box;text-align:left;vertical-align:", ";& + &{border-left:1px solid ", ";}", " ", " ", " ", ""], themes_["mixins"].reset('table-cell'), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray92, + dark: themes_["variables"].black + }, + prisma: themes_["variables"].interactiveColorBackground +}), function (_ref) { + var $variant = _ref.$variant; + return $variant ? 'middle' : 'top'; +}, Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorPage +}), function (_ref2) { + var $isFixed = _ref2.$isFixed, + $zIndex = _ref2.$zIndex; + return $isFixed && Object(external_styled_components_["css"])(["position:sticky;top:0;z-index:", ";&:not(:first-child)::before{content:'';height:100%;position:absolute;top:0;bottom:0;box-shadow:-1px 0 0 0 ", ";width:2px;border:0;left:0;margin-right:-2px;color:transparent;}&:not(:last-child)::after{content:'';height:100%;position:absolute;top:0;bottom:0;box-shadow:1px 0 0 0 ", ";width:2px;border:0;right:0;margin-left:-2px;color:transparent;}"], $zIndex, Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorPage + }), Object(themes_["pick"])({ + enterprise: themes_["variables"].backgroundColor, + prisma: themes_["variables"].backgroundColorPage + })); +}, function (_ref3) { + var $clickable = _ref3.$clickable; + return $clickable && Object(external_styled_components_["css"])(["cursor:pointer;&:focus{box-shadow:", ";outline:none;& > ", "{color:", ";background-color:", ";}}&:hover{outline:none;& > ", "{color:", ";background-color:", ";}}&:active{& > ", "{background-color:", ";}}"], themes_["variables"].focusShadowInset, + /* sc-sel */ + HeadInnerStyles_Styled, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorD10, + dark: themes_["variables"].linkColorHover + } + }), Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlaySelected + }), + /* sc-sel */ + HeadInnerStyles_Styled, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorD10, + dark: themes_["variables"].linkColorHover + } + }), Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayHover + }), + /* sc-sel */ + HeadInnerStyles_Styled, Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayActive + })); +}, function (_ref4) { + var $dragging = _ref4.$dragging; + return $dragging && Object(external_styled_components_["css"])(["background-color:", ";&:focus{box-shadow:none;}"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray80, + dark: themes_["variables"].gray20 + }, + prisma: themes_["mixins"].overlayColors(themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayDrag) + })); +}, Object(themes_["pickVariant"])('$variant', { + actions: Object(external_styled_components_["css"])(["& > ", "{padding-right:8px;}"], + /* sc-sel */ + HeadInnerStyles_Styled), + info: Object(external_styled_components_["css"])(["& > ", "{", ";}"], + /* sc-sel */ + HeadInnerStyles_Styled, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["padding-top:7px;"]), + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:16px 12px;"]), + compact: Object(external_styled_components_["css"])(["padding:6px 12px;"]) + } + })), + toggleAll: Object(external_styled_components_["css"])(["& > ", "{padding-top:", ";}"], + /* sc-sel */ + HeadInnerStyles_Styled, Object(themes_["pick"])({ + prisma: { + comfortable: '14px', + compact: '7px' + } + })) +})); +var StyledGuideLine = external_styled_components_default.a.div.withConfig({ + displayName: "HeadCellStyles__StyledGuideLine", + componentId: "sc-1hj81sa-1" +})(["", " width:1px;position:absolute;background-color:", ";height:100%;top:0;z-index:1;", ""], themes_["mixins"].reset('block'), Object(themes_["pick"])({ + enterprise: themes_["variables"].linkColor, + prisma: themes_["variables"].interactiveColorPrimary +}), Object(themes_["pickVariant"])('$position', { + before: Object(external_styled_components_["css"])(["float:left;", ":not(:first-child) > &{margin-left:-1px;}"], + /* sc-sel */ + HeadCellStyles_Styled), + after: Object(external_styled_components_["css"])(["right:0;"]) +})); + +// CONCATENATED MODULE: ./src/Table/RowDragCellStyles.ts + + +var RowDragCellStyles_Styled = external_styled_components_default.a.td.withConfig({ + displayName: "RowDragCellStyles__Styled", + componentId: "sc-9kbaj2-0" +})(["", " box-sizing:content-box;touch-action:none;width:", ";& + &{border-left:", ";}&:focus{box-shadow:", ";outline:none;}&:hover{background-color:", ";outline:none;}&:active{background-color:", ";}", ""], themes_["mixins"].reset('table-cell'), Object(themes_["pick"])({ + enterprise: '32px', + prisma: '36px' +}), Object(themes_["pick"])({ + enterprise: "1px solid ".concat(themes_["variables"].backgroundColor), + prisma: "1px solid ".concat(themes_["variables"].interactiveColorBorder) +}), themes_["variables"].focusShadowInset, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorL50, + dark: themes_["variables"].accentColorD50 + }, + prisma: themes_["variables"].interactiveColorOverlayHover +}), Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayActive +}), function (_ref) { + var $dragging = _ref.$dragging; + return $dragging && Object(external_styled_components_["css"])(["&:active{background-color:", ";}"], Object(themes_["pick"])({ + prisma: themes_["mixins"].overlayColors(themes_["variables"].backgroundColorPage, themes_["variables"].interactiveColorOverlayDrag) + })); +}); +var RowDragCellStyles_StyledGuideLine = external_styled_components_default.a.div.withConfig({ + displayName: "RowDragCellStyles__StyledGuideLine", + componentId: "sc-9kbaj2-1" +})(["", " width:100%;height:1px;position:absolute;left:0;z-index:1;", ""], themes_["mixins"].reset('block'), Object(themes_["pickVariant"])('$position', { + before: Object(external_styled_components_["css"])(["&::before{content:' ';border-top:1px solid;border-color:", ";width:100%;height:1px;top:0;position:absolute;}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].linkColor, + prisma: themes_["variables"].interactiveColorPrimary + })), + after: Object(external_styled_components_["css"])(["&::after{bottom:0;background-color:", ";}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].linkColor, + prisma: themes_["variables"].interactiveColorPrimary + })) +})); +var StyledDrag = external_styled_components_default.a.div.withConfig({ + displayName: "RowDragCellStyles__StyledDrag", + componentId: "sc-9kbaj2-2" +})(["", " ", ";justify-content:center;cursor:move;", " ", " &[data-helper]{background-color:", ";position:absolute;left:-10000px;top:-10000px;box-shadow:", ";box-sizing:border-box;background-repeat:repeat-x;", ";}@media print{background-image:none;}"], themes_["mixins"].reset('flex'), themes_["mixins"].clearfix(), function (_ref2) { + var $dragging = _ref2.$dragging; + return $dragging && Object(external_styled_components_["css"])(["opacity:0;"]); +}, function (_ref3) { + var $draggable = _ref3.$draggable; + return $draggable && Object(external_styled_components_["css"])(["padding:", ";-webkit-user-drag:element;user-select:none;"], Object(themes_["pick"])({ + enterprise: '9px 0', + prisma: { + comfortable: '16px 17px 15px', + compact: '9px 17px 6px' + } + })); +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorL50, + dark: themes_["variables"].accentColorD50 + }, + prisma: themes_["mixins"].overlayColors(themes_["variables"].interactiveColorBackground, themes_["variables"].interactiveColorOverlaySelected) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].overlayShadow, + prisma: themes_["variables"].dragShadow +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["border:1px solid ", ";"], themes_["variables"].borderColor) +})); + +// CONCATENATED MODULE: ./src/Table/DragHandleStyles.ts + + + + +var DragHandleStyles_StyledDrag = external_styled_components_default.a.div.withConfig({ + displayName: "DragHandleStyles__StyledDrag", + componentId: "sc-9eqfn5-0" +})(["display:block;cursor:move;background:", ";", ""], themes_["variables"].draggableBackground, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["width:7px;height:14px;"]), + prisma: Object(external_styled_components_["css"])(["width:6px;height:20px;margin-top:-3px;opacity:0;", ":focus &,", ":hover &,", " &,[data-helper] &{opacity:1;}"], + /* sc-sel */ + HeadCellStyles_Styled, + /* sc-sel */ + HeadCellStyles_Styled, + /* sc-sel */ + RowDragCellStyles_Styled) +})); + +// CONCATENATED MODULE: ./src/Table/DragHandle.tsx + + + + +var DragHandle_propTypes = { + screenReaderContent: external_prop_types_default.a.string +}; +var DragHandle_defaultProps = {}; + +function DragHandle(_ref) { + var screenReaderContent = _ref.screenReaderContent; + return /*#__PURE__*/external_react_default.a.createElement(DragHandleStyles_StyledDrag, null, /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, screenReaderContent)); +} + +DragHandle.propTypes = DragHandle_propTypes; +/* harmony default export */ var Table_DragHandle = (DragHandle); +// EXTERNAL MODULE: ./src/utils/ssrDocument.ts +var ssrDocument = __nested_webpack_require_15029__(27); + +// CONCATENATED MODULE: ./src/Table/HeadInner.tsx +function HeadInner_extends() { HeadInner_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return HeadInner_extends.apply(this, arguments); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function HeadInner_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = HeadInner_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function HeadInner_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + + + + + + + + + + + + +var HeadInner_propTypes = { + align: external_prop_types_default.a.oneOf(['left', 'center', 'right']), + columnId: external_prop_types_default.a.any, + hasActionsHead: external_prop_types_default.a.bool, + id: external_prop_types_default.a.string, + index: external_prop_types_default.a.number, + isMenu: external_prop_types_default.a.bool, + label: external_prop_types_default.a.node, + onAutosizeColumn: external_prop_types_default.a.func, + onDragEnd: external_prop_types_default.a.func, + onDragStart: external_prop_types_default.a.func, + onRequestResize: external_prop_types_default.a.func, + resizable: external_prop_types_default.a.bool, + sortDir: external_prop_types_default.a.oneOf(['none', 'asc', 'desc']), + truncate: external_prop_types_default.a.bool, + width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.number, external_prop_types_default.a.oneOf(['auto'])]) +}; +var sortDirections = new Set(['none', 'asc', 'desc']); +var sortDirToAriaLabelMap = Object.freeze({ + none: Object(i18n_["_"])('Click to sort'), + asc: Object(i18n_["_"])('Press to sort descending'), + desc: Object(i18n_["_"])('Press to sort ascending') +}); +var enterpriseSortDirToIconMap = Object.freeze({ + none: CaretsSmallUpDown_default.a, + asc: StyledCaretUp, + desc: StyledCaretDown +}); +var prismaSortDirToIconMap = Object.freeze({ + none: ArrowUpDown_default.a, + asc: ArrowUp_default.a, + desc: ArrowDown_default.a +}); + +function HeadInner(_ref) { + var index = _ref.index, + columnId = _ref.columnId, + id = _ref.id, + widthProp = _ref.width, + onDragEnd = _ref.onDragEnd, + onAutosizeColumn = _ref.onAutosizeColumn, + _ref$align = _ref.align, + align = _ref$align === void 0 ? 'left' : _ref$align, + label = _ref.label, + _ref$hasActionsHead = _ref.hasActionsHead, + hasActionsHead = _ref$hasActionsHead === void 0 ? false : _ref$hasActionsHead, + _ref$isMenu = _ref.isMenu, + isMenu = _ref$isMenu === void 0 ? false : _ref$isMenu, + onDragStart = _ref.onDragStart, + onRequestResize = _ref.onRequestResize, + _ref$resizable = _ref.resizable, + resizable = _ref$resizable === void 0 ? true : _ref$resizable, + _ref$sortDir = _ref.sortDir, + sortDir = _ref$sortDir === void 0 ? undefined : _ref$sortDir, + _ref$truncate = _ref.truncate, + truncate = _ref$truncate === void 0 ? true : _ref$truncate, + otherProps = HeadInner_objectWithoutProperties(_ref, ["index", "columnId", "id", "width", "onDragEnd", "onAutosizeColumn", "align", "label", "hasActionsHead", "isMenu", "onDragStart", "onRequestResize", "resizable", "sortDir", "truncate"]); + + if (false) {} + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var clickScreenReaderText = Object(i18n_["_"])('Click to open menu'); + + var _useState = Object(external_react_["useState"])(), + _useState2 = _slicedToArray(_useState, 2), + cloneEl = _useState2[0], + setCloneEl = _useState2[1]; + + var _useState3 = Object(external_react_["useState"])(false), + _useState4 = _slicedToArray(_useState3, 2), + isResizing = _useState4[0], + setResizing = _useState4[1]; + + var _useState5 = Object(external_react_["useState"])(false), + _useState6 = _slicedToArray(_useState5, 2), + isDragging = _useState6[0], + setIsDragging = _useState6[1]; + + var _useState7 = Object(external_react_["useState"])(0), + _useState8 = _slicedToArray(_useState7, 2), + startClientX = _useState8[0], + setStartClientX = _useState8[1]; + + var _useState9 = Object(external_react_["useState"])(0), + _useState10 = _slicedToArray(_useState9, 2), + startWidth = _useState10[0], + setStartWidth = _useState10[1]; + + var ref = Object(external_react_["useRef"])(null); // Cleanup dragend, and unmount during drag + + Object(external_react_["useEffect"])(function () { + return function () { + return cloneEl === null || cloneEl === void 0 ? void 0 : cloneEl.remove(); + }; + }, [cloneEl]); + var width; + var Icon; + var ariaLabel; + + if (sortDir !== undefined && sortDirections.has(sortDir)) { + var typeToIconMap = isEnterprise ? enterpriseSortDirToIconMap : prismaSortDirToIconMap; + Icon = typeToIconMap[sortDir]; + ariaLabel = sortDirToAriaLabelMap[sortDir]; + } + + if (widthProp === 'auto') { + var _el$parentElement; + + var el = ref.current; + var rect = el === null || el === void 0 ? void 0 : (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 ? void 0 : _el$parentElement.getBoundingClientRect(); + width = rect === null || rect === void 0 ? void 0 : rect.width; + } else { + width = widthProp; + } + + var handleResizeKeyDown = function handleResizeKeyDown(e) { + var key = Object(keyboard_["keycode"])(e.nativeEvent); + + if (onRequestResize === undefined || index === undefined) { + return; + } + + if (widthProp === 'auto') { + var _el$parentElement2; + + var _el = ref.current; + + var _rect = _el === null || _el === void 0 ? void 0 : (_el$parentElement2 = _el.parentElement) === null || _el$parentElement2 === void 0 ? void 0 : _el$parentElement2.getBoundingClientRect(); + + width = _rect === null || _rect === void 0 ? void 0 : _rect.width; + } else { + width = widthProp; + } + + if (width === undefined) { + return; + } + + if (key === 'left') { + e.preventDefault(); // prevent text selection + + var newWidth = Math.max(width - 10, 20); + onRequestResize(e, { + index: index, + columnId: columnId, + id: id, + width: newWidth + }); + } + + if (key === 'right') { + e.preventDefault(); // prevent text selection + + var _newWidth = width + 10; + + onRequestResize(e, { + index: index, + columnId: columnId, + id: id, + width: _newWidth + }); + } + }; + + var handleStartResize = function handleStartResize(e) { + if (widthProp === 'auto') { + var _el2$parentElement; + + var _el2 = ref.current; + + var _rect2 = _el2 === null || _el2 === void 0 ? void 0 : (_el2$parentElement = _el2.parentElement) === null || _el2$parentElement === void 0 ? void 0 : _el2$parentElement.getBoundingClientRect(); + + width = _rect2 === null || _rect2 === void 0 ? void 0 : _rect2.width; + } else { + width = widthProp; + } + + if (width === undefined) { + return; + } + + e.preventDefault(); // prevent text selection + + setStartClientX(e.clientX); + setStartWidth(width || 0); + setResizing(true); + }; + + var handleResize = function handleResize(e) { + var change = startClientX - e.clientX; + var newWidth = Math.max(startWidth - change, 16); + + if (index !== undefined) { + onRequestResize === null || onRequestResize === void 0 ? void 0 : onRequestResize(e, { + index: index, + columnId: columnId, + id: id, + width: newWidth + }); + } + }; + + var handleEndResize = function handleEndResize() { + setResizing(false); + }; + + var handleDragStart = function handleDragStart(e) { + var _el$textContent; + + var document = Object(ssrDocument["a" /* getDocument */])(); + var el = ref.current; + + if (e.dataTransfer.setDragImage && (el === null || el === void 0 ? void 0 : el.parentElement)) { + var _rect3 = el.parentElement.getBoundingClientRect(); + + var clone = el.cloneNode(true); + clone.style.width = "".concat(_rect3.width, "px"); + clone.style.height = "".concat(_rect3.height, "px"); + clone.setAttribute('data-helper', 'true'); + document.body.appendChild(clone); + e.dataTransfer.setDragImage(clone, e.clientX - _rect3.left, e.clientY - _rect3.top); + setIsDragging(true); + setCloneEl(clone); + } + + e.dataTransfer.effectAllowed = 'move'; + e.dataTransfer.setData('text', (_el$textContent = el === null || el === void 0 ? void 0 : el.textContent) !== null && _el$textContent !== void 0 ? _el$textContent : ''); // Required for Firefox + + onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(index, columnId); + }; + + var handleDragEnd = function handleDragEnd() { + setCloneEl(undefined); + setIsDragging(false); + onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(); + }; + + var handleDoubleClick = function handleDoubleClick(e) { + if (index !== undefined) { + onAutosizeColumn === null || onAutosizeColumn === void 0 ? void 0 : onAutosizeColumn(e, { + index: index, + columnId: columnId + }); + } + }; + + var draggable = !!onDragStart; + var window = Object(ssrWindow["a" /* getWindow */])(); + return /*#__PURE__*/external_react_default.a.createElement(HeadInnerStyles_Styled, HeadInner_extends({ + draggable: draggable || undefined, + onDragStart: draggable ? handleDragStart : undefined, + onDragEnd: draggable ? handleDragEnd : undefined, + ref: ref, + $hasActionsHead: !!hasActionsHead, + $align: align, + $draggable: draggable, + $dragging: !!isDragging + }, omit_default()(otherProps, [].concat(_toConsumableArray(Object.keys(HeadInner.propTypes)), ['id']))), isResizing && /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "mouseup", + listener: handleEndResize + }), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "mousemove", + listener: handleResize + })), onRequestResize && resizable && /*#__PURE__*/external_react_default.a.createElement(StyledResize, { + onMouseDown: handleStartResize, + onDoubleClick: handleDoubleClick, + onKeyDown: handleResizeKeyDown, + "data-test": "resize" + }), draggable && /*#__PURE__*/external_react_default.a.createElement(StyledDragContainer, null, /*#__PURE__*/external_react_default.a.createElement(Table_DragHandle, { + screenReaderContent: Object(i18n_["_"])('Press left or right arrow key to reorder the columns.') + })), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, { + $align: align, + $truncate: truncate, + $fill: isMenu + }, label, isMenu && + /*#__PURE__*/ + // this icon indicates "has a menu" in all themes + external_react_default.a.createElement(StyledMenuIcon, null, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Caret_default.a, { + "data-test": "caret-down", + screenReaderText: clickScreenReaderText, + hideDefaultTooltip: true, + size: 0.5 + }) : /*#__PURE__*/external_react_default.a.createElement(CaretSmallDown_default.a, { + "data-test": "caret-down", + "aria-label": clickScreenReaderText + }))), sortDir && /*#__PURE__*/external_react_default.a.createElement(StyledSortIcon, { + $sorted: sortDir !== 'none' + }, Icon !== undefined && (isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Icon, { + inline: true, + "aria-hidden": false, + "aria-label": ariaLabel, + viewBox: "-8 0 24 24" + }) : /*#__PURE__*/external_react_default.a.createElement(Icon, { + inline: true, + "aria-hidden": false, + "aria-label": ariaLabel + })))); +} + +HeadInner.propTypes = HeadInner_propTypes; +/* harmony default export */ var Table_HeadInner = (HeadInner); +// CONCATENATED MODULE: ./src/Table/TableContext.ts + +var TableContext = /*#__PURE__*/Object(external_react_["createContext"])({}); +TableContext.displayName = 'Table'; +/* harmony default export */ var Table_TableContext = (TableContext); +// CONCATENATED MODULE: ./src/Table/HeadCell.tsx +function HeadCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HeadCell_typeof = function _typeof(obj) { return typeof obj; }; } else { HeadCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HeadCell_typeof(obj); } + +function HeadCell_extends() { HeadCell_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return HeadCell_extends.apply(this, arguments); } + +function HeadCell_toConsumableArray(arr) { return HeadCell_arrayWithoutHoles(arr) || HeadCell_iterableToArray(arr) || HeadCell_unsupportedIterableToArray(arr) || HeadCell_nonIterableSpread(); } + +function HeadCell_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function HeadCell_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return HeadCell_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return HeadCell_arrayLikeToArray(o, minLen); } + +function HeadCell_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function HeadCell_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return HeadCell_arrayLikeToArray(arr); } + +function HeadCell_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function HeadCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function HeadCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function HeadCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeadCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeadCell_defineProperties(Constructor, staticProps); return Constructor; } + +function HeadCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) HeadCell_setPrototypeOf(subClass, superClass); } + +function HeadCell_setPrototypeOf(o, p) { HeadCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeadCell_setPrototypeOf(o, p); } + +function HeadCell_createSuper(Derived) { var hasNativeReflectConstruct = HeadCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeadCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeadCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeadCell_possibleConstructorReturn(this, result); }; } + +function HeadCell_possibleConstructorReturn(self, call) { if (call && (HeadCell_typeof(call) === "object" || typeof call === "function")) { return call; } return HeadCell_assertThisInitialized(self); } + +function HeadCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function HeadCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function HeadCell_getPrototypeOf(o) { HeadCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeadCell_getPrototypeOf(o); } + +function HeadCell_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + +var HeadCell_propTypes = { + align: external_prop_types_default.a.oneOf(['left', 'center', 'right']), + children: external_prop_types_default.a.node, + columnId: external_prop_types_default.a.any, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + + /** @private Indicates the presence of actions. */ + hasActionsHead: external_prop_types_default.a.bool, + + /** @private The index of the cell, skipping the info column. */ + index: external_prop_types_default.a.number, + + /** @private. */ + onAutosizeColumn: external_prop_types_default.a.func, + onSort: external_prop_types_default.a.func, + + /** @private. */ + onDragStart: external_prop_types_default.a.func, + + /** + * @private. Passed through and works as expected. + */ + onKeyDown: external_prop_types_default.a.func, + + /** @private. */ + onClick: external_prop_types_default.a.func, + + /** @private. */ + onRequestMoveColumn: external_prop_types_default.a.func, + + /** @private. */ + onRequestResize: external_prop_types_default.a.func, + resizable: external_prop_types_default.a.bool, + + /** @private. */ + showGuideline: external_prop_types_default.a.oneOf(['none', 'before', 'after']), + sortDir: external_prop_types_default.a.oneOf(['asc', 'desc', 'none']), + sortKey: external_prop_types_default.a.string, + truncate: external_prop_types_default.a.bool, + + /** + * Used internally to suppress focus and id when this `HeadCell` is superseded by one in an + * overlaid `HeadTable` for user interactions. + * @private + */ + visible: external_prop_types_default.a.bool, + width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.number, external_prop_types_default.a.oneOf(['auto'])]), + + /** @private. */ + variant: external_prop_types_default.a.oneOf(['toggleAll', 'info', 'actions']), + + /** @private. */ + zIndex: external_prop_types_default.a.number +}; +var HeadCell_defaultProps = { + align: 'left', + resizable: true, + showGuideline: 'none', + sortDir: 'none', + truncate: true, + visible: true, + zIndex: 1 +}; + +var HeadCell_HeadCell = /*#__PURE__*/function (_Component) { + HeadCell_inherits(HeadCell, _Component); + + var _super = HeadCell_createSuper(HeadCell); + + // @docs-props-type HeadCellPropsBase + function HeadCell(props) { + var _this; + + HeadCell_classCallCheck(this, HeadCell); + + _this = _super.call(this, props); + + HeadCell_defineProperty(HeadCell_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props$onClick, _this$props2; + + // ignore clicks on the resize handle + if (e.target.getAttribute('data-test') !== 'resize' && _this.props.onSort && _this.props.index !== undefined) { + var _this$props = _this.props, + sortKey = _this$props.sortKey, + sortDir = _this$props.sortDir, + id = _this$props.id, + _index = _this$props.index, + _columnId = _this$props.columnId; + + _this.props.onSort(e, { + sortKey: sortKey, + sortDir: sortDir, + id: id, + columnId: _columnId, + index: _index + }); + } + + (_this$props$onClick = (_this$props2 = _this.props).onClick) === null || _this$props$onClick === void 0 ? void 0 : _this$props$onClick.call(_this$props2); + }); + + HeadCell_defineProperty(HeadCell_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props3 = _this.props, + columnId = _this$props3.columnId, + index = _this$props3.index, + onKeyDown = _this$props3.onKeyDown, + onRequestMoveColumn = _this$props3.onRequestMoveColumn; + + if (e.target.getAttribute('data-test') !== 'resize') { + if (Object(keyboard_["keycode"])(e.nativeEvent) === 'enter') { + _this.handleClick(e); + } else if (Object(keyboard_["keycode"])(e.nativeEvent) === 'left' && index !== undefined && index > 0) { + onRequestMoveColumn === null || onRequestMoveColumn === void 0 ? void 0 : onRequestMoveColumn({ + fromIndex: index, + toIndex: index - 1, + columnId: columnId + }); + } else if (Object(keyboard_["keycode"])(e.nativeEvent) === 'right' && index !== undefined) { + onRequestMoveColumn === null || onRequestMoveColumn === void 0 ? void 0 : onRequestMoveColumn({ + fromIndex: index, + toIndex: index + 1, + columnId: columnId + }); + } + } + + if (index !== undefined) { + onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, { + index: index, + columnId: columnId + }); + } + }); + + HeadCell_defineProperty(HeadCell_assertThisInitialized(_this), "handleDragStart", function (index, columnId) { + var _this$props$onDragSta, _this$props4; + + _this.setState({ + isDragging: true + }); + + (_this$props$onDragSta = (_this$props4 = _this.props).onDragStart) === null || _this$props$onDragSta === void 0 ? void 0 : _this$props$onDragSta.call(_this$props4, index, columnId); + }); + + HeadCell_defineProperty(HeadCell_assertThisInitialized(_this), "handleDragEnd", function () { + _this.setState({ + isDragging: false + }); + }); + + HeadCell_defineProperty(HeadCell_assertThisInitialized(_this), "sortDirAriaMapping", { + asc: 'ascending', + desc: 'descending', + none: 'none' + }); + + _this.state = { + isDragging: false + }; + return _this; + } + + HeadCell_createClass(HeadCell, [{ + key: "render", + value: function render() { + var _this$props5 = this.props, + align = _this$props5.align, + children = _this$props5.children, + columnId = _this$props5.columnId, + elementRef = _this$props5.elementRef, + hasActionsHead = _this$props5.hasActionsHead, + id = _this$props5.id, + index = _this$props5.index, + onAutosizeColumn = _this$props5.onAutosizeColumn, + onClick = _this$props5.onClick, + onDragStart = _this$props5.onDragStart, + onRequestResize = _this$props5.onRequestResize, + onSort = _this$props5.onSort, + resizable = _this$props5.resizable, + showGuideline = _this$props5.showGuideline, + sortDir = _this$props5.sortDir, + style = _this$props5.style, + variant = _this$props5.variant, + truncateProp = _this$props5.truncate, + visible = _this$props5.visible, + width = _this$props5.width, + zIndex = _this$props5.zIndex; + var draggable = !!onDragStart; + var sortable = !!onSort && !!sortDir; + var hasOnClick = onClick !== undefined; + var mergedStyle = merge_default()(style, { + width: width + }); + var truncate = hasActionsHead ? false : truncateProp; + var headType = this.context.headType; + /* eslint-disable jsx-a11y/no-static-element-interactions */ + + return /*#__PURE__*/external_react_default.a.createElement(HeadCellStyles_Styled, HeadCell_extends({ + style: mergedStyle, + ref: elementRef, + "aria-sort": onSort && (this.sortDirAriaMapping[sortDir] || 'none'), + "data-test": "head-cell", + "data-test-label": isString_default()(children) ? children : undefined, + "data-test-sort-dir": onSort && sortDir, + id: visible ? id : undefined, + onClick: onSort || hasOnClick ? this.handleClick : undefined, + tabIndex: visible && (draggable || onSort || hasOnClick) ? 0 : undefined, + $dragging: this.state.isDragging || undefined, + $clickable: draggable || sortable || hasOnClick, + $variant: variant, + $zIndex: zIndex, + $isFixed: headType === 'fixed' + }, omit_default()(this.props, [].concat(HeadCell_toConsumableArray(Object.keys(HeadCell.propTypes)), ['id', 'style'])), { + onKeyDown: draggable || onSort || hasOnClick ? this.handleKeyDown : undefined + }), /*#__PURE__*/external_react_default.a.createElement(Table_HeadInner, { + label: children, + align: align, + columnId: columnId, + hasActionsHead: hasActionsHead, + id: id, + index: index, + resizable: visible && resizable, + onDragStart: onDragStart ? this.handleDragStart : undefined, + onDragEnd: onDragStart ? this.handleDragEnd : undefined, + onAutosizeColumn: onAutosizeColumn, + onRequestResize: onRequestResize, + sortDir: onSort && sortDir, + truncate: truncate, + width: width + }), showGuideline !== 'none' && /*#__PURE__*/external_react_default.a.createElement(StyledGuideLine, { + $position: showGuideline + })); + /* eslint-enable jsx-a11y/no-static-element-interactions */ + } + }]); + + return HeadCell; +}(external_react_["Component"]); + +HeadCell_defineProperty(HeadCell_HeadCell, "splunkUiType", 'Table.HeadCell'); + +HeadCell_defineProperty(HeadCell_HeadCell, "propTypes", HeadCell_propTypes); + +HeadCell_defineProperty(HeadCell_HeadCell, "defaultProps", HeadCell_defaultProps); + +HeadCell_defineProperty(HeadCell_HeadCell, "contextType", Table_TableContext); + +/* harmony default export */ var Table_HeadCell = (HeadCell_HeadCell); +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Info" +var Info_ = __nested_webpack_require_15029__(163); +var Info_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Info_); + +// EXTERNAL MODULE: external "@splunk/react-icons/ChevronRight" +var ChevronRight_ = __nested_webpack_require_15029__(43); +var ChevronRight_default = /*#__PURE__*/__nested_webpack_require_15029__.n(ChevronRight_); + +// CONCATENATED MODULE: ./src/Table/icons/HeadExpandRows.tsx + + + + + +/* This file works around the use of withSplunkTheme in Head. */ + +function HeadExpandRows() { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var screenReaderText = Object(i18n_["_"])('More Information'); + + return isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Info_default.a, { + hideDefaultTooltip: true, + screenReaderText: screenReaderText + }) : /*#__PURE__*/external_react_default.a.createElement(ChevronRight_default.a, { + "aria-label": screenReaderText, + height: "16px", + width: "16px" + }); +} +// EXTERNAL MODULE: external "@splunk/react-icons/DotsThreeVertical" +var DotsThreeVertical_ = __nested_webpack_require_15029__(84); +var DotsThreeVertical_default = /*#__PURE__*/__nested_webpack_require_15029__.n(DotsThreeVertical_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_15029__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Button_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Dropdown" +var Dropdown_ = __nested_webpack_require_15029__(22); +var Dropdown_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Dropdown_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Tooltip" +var Tooltip_ = __nested_webpack_require_15029__(42); +var Tooltip_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Tooltip_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/format" +var format_ = __nested_webpack_require_15029__(28); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ChevronRight" +var enterprise_ChevronRight_ = __nested_webpack_require_15029__(35); +var enterprise_ChevronRight_default = /*#__PURE__*/__nested_webpack_require_15029__.n(enterprise_ChevronRight_); + +// CONCATENATED MODULE: ./src/Table/icons/ExpansionRow.tsx +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { ExpansionRow_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function ExpansionRow_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + +var ExpansionRow_propTypes = { + className: external_prop_types_default.a.string, + expanded: external_prop_types_default.a.bool +}; + +var ExpansionRow_ExpansionRow = function ExpansionRow(_ref) { + var className = _ref.className, + expanded = _ref.expanded; + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isEnterprise = _useSplunkTheme.isEnterprise; + + var sharedProps = { + className: className + }; + + var enterpiseProps = _objectSpread(_objectSpread({}, sharedProps), {}, { + hideDefaultTooltip: true, + screenReaderText: null + }); + + var prismaProps = _objectSpread({}, sharedProps); + + var chevronRightIcon = isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(enterprise_ChevronRight_default.a, enterpiseProps) : /*#__PURE__*/external_react_default.a.createElement(ChevronRight_default.a, prismaProps); + return /*#__PURE__*/external_react_default.a.createElement("div", { + "aria-hidden": true, + title: expanded ? Object(i18n_["_"])('Collapse row') : Object(i18n_["_"])('Expand row') + }, chevronRightIcon); +}; + +var StyledExpansionRowIcon = external_styled_components_default()(ExpansionRow_ExpansionRow).withConfig({ + displayName: "ExpansionRow__StyledExpansionRowIcon", + componentId: "sc-1b6vao4-0" +})(["transition:transform ", ";", ""], Object(themes_["pick"])({ + enterprise: '300ms', + prisma: '200ms' +}), function (props) { + return props.expanded && Object(external_styled_components_["css"])(["transform:rotate(90deg);"]); +}); +StyledExpansionRowIcon.propTypes = ExpansionRow_propTypes; +/* harmony default export */ var icons_ExpansionRow = (StyledExpansionRowIcon); +// CONCATENATED MODULE: ./src/Table/RowDragCell.tsx +function RowDragCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RowDragCell_typeof = function _typeof(obj) { return typeof obj; }; } else { RowDragCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RowDragCell_typeof(obj); } + +function RowDragCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function RowDragCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function RowDragCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) RowDragCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) RowDragCell_defineProperties(Constructor, staticProps); return Constructor; } + +function RowDragCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) RowDragCell_setPrototypeOf(subClass, superClass); } + +function RowDragCell_setPrototypeOf(o, p) { RowDragCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RowDragCell_setPrototypeOf(o, p); } + +function RowDragCell_createSuper(Derived) { var hasNativeReflectConstruct = RowDragCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RowDragCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RowDragCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RowDragCell_possibleConstructorReturn(this, result); }; } + +function RowDragCell_possibleConstructorReturn(self, call) { if (call && (RowDragCell_typeof(call) === "object" || typeof call === "function")) { return call; } return RowDragCell_assertThisInitialized(self); } + +function RowDragCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function RowDragCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function RowDragCell_getPrototypeOf(o) { RowDragCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RowDragCell_getPrototypeOf(o); } + +function RowDragCell_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + +var RowDragCell_propTypes = { + activeElementId: external_prop_types_default.a.string, + dataId: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]), + index: external_prop_types_default.a.number, + onDragEnd: external_prop_types_default.a.func, + onDragStart: external_prop_types_default.a.func, + onKeyDown: external_prop_types_default.a.func, + onRequestMoveRow: external_prop_types_default.a.func, + rowSpan: external_prop_types_default.a.number, + showRowGuideline: external_prop_types_default.a.oneOf(['none', 'before', 'after']) +}; +var RowDragCell_defaultProps = { + showRowGuideline: 'none' +}; + +var RowDragCell_RowDragCell = /*#__PURE__*/function (_Component) { + RowDragCell_inherits(RowDragCell, _Component); + + var _super = RowDragCell_createSuper(RowDragCell); + + function RowDragCell(props) { + var _this; + + RowDragCell_classCallCheck(this, RowDragCell); + + _this = _super.call(this, props); + + RowDragCell_defineProperty(RowDragCell_assertThisInitialized(_this), "cloneEl", void 0); + + RowDragCell_defineProperty(RowDragCell_assertThisInitialized(_this), "el", null); + + RowDragCell_defineProperty(RowDragCell_assertThisInitialized(_this), "handleMount", function (el) { + _this.el = el; + }); + + RowDragCell_defineProperty(RowDragCell_assertThisInitialized(_this), "handleDragStart", function (e) { + var _this$el, _this$el$textContent, _this$el2, _this$props$onDragSta, _this$props; + + var document = Object(ssrDocument["a" /* getDocument */])(); + e.stopPropagation(); + + if (e.dataTransfer.setDragImage && ((_this$el = _this.el) === null || _this$el === void 0 ? void 0 : _this$el.parentElement)) { + // not supported in IE11 + var rect = _this.el.parentElement.getBoundingClientRect(); + + _this.cloneEl = _this.el.cloneNode(true); // TS: this seems safe to assume? + + _this.cloneEl.style.width = "".concat(rect.width, "px"); + _this.cloneEl.style.height = "".concat(rect.height, "px"); + + _this.cloneEl.setAttribute('data-helper', 'true'); + + document.body.appendChild(_this.cloneEl); + e.dataTransfer.setDragImage(_this.cloneEl, e.clientX - rect.left, e.clientY - rect.top); + + _this.setState({ + isDragging: true + }); + } + + e.dataTransfer.effectAllowed = 'move'; + e.dataTransfer.setData('text', (_this$el$textContent = (_this$el2 = _this.el) === null || _this$el2 === void 0 ? void 0 : _this$el2.textContent) !== null && _this$el$textContent !== void 0 ? _this$el$textContent : ''); // Required for Firefox + + (_this$props$onDragSta = (_this$props = _this.props).onDragStart) === null || _this$props$onDragSta === void 0 ? void 0 : _this$props$onDragSta.call(_this$props, _this.props.index, _this.props.dataId); + }); + + RowDragCell_defineProperty(RowDragCell_assertThisInitialized(_this), "handleDragEnd", function () { + var _this$props$onDragEnd, _this$props2; + + _this.cleanupDrag(); + + _this.setState({ + isDragging: false + }); + + (_this$props$onDragEnd = (_this$props2 = _this.props).onDragEnd) === null || _this$props$onDragEnd === void 0 ? void 0 : _this$props$onDragEnd.call(_this$props2); + }); + + RowDragCell_defineProperty(RowDragCell_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props3 = _this.props, + onRequestMoveRow = _this$props3.onRequestMoveRow, + index = _this$props3.index, + dataId = _this$props3.dataId, + onKeyDown = _this$props3.onKeyDown; + var code = Object(keyboard_["keycode"])(e.nativeEvent); + + if (code === 'up' || code === 'down') { + e.preventDefault(); + } + + if (code === 'up' && index !== undefined && index > 0) { + onRequestMoveRow === null || onRequestMoveRow === void 0 ? void 0 : onRequestMoveRow({ + fromIndex: index, + toIndex: index - 1, + dataId: dataId + }); + } else if (code === 'down' && index !== undefined) { + onRequestMoveRow === null || onRequestMoveRow === void 0 ? void 0 : onRequestMoveRow({ + fromIndex: index, + toIndex: index + 1, + dataId: dataId + }); + } + + if (index !== undefined) { + onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, { + index: index, + dataId: dataId + }); + } + }); + + _this.state = { + isDragging: false + }; + return _this; + } + + RowDragCell_createClass(RowDragCell, [{ + key: "componentDidMount", + value: function componentDidMount() { + // get handle of the element and add focus + var _this$props4 = this.props, + dataId = _this$props4.dataId, + activeElementId = _this$props4.activeElementId; + + if (dataId === activeElementId) { + var _this$el3, _this$el3$parentEleme; + + (_this$el3 = this.el) === null || _this$el3 === void 0 ? void 0 : (_this$el3$parentEleme = _this$el3.parentElement) === null || _this$el3$parentEleme === void 0 ? void 0 : _this$el3$parentEleme.focus(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.cleanupDrag(); + } + }, { + key: "cleanupDrag", + value: function cleanupDrag() { + if (this.cloneEl) { + if (this.cloneEl.remove) { + this.cloneEl.remove(); + } else { + var _this$cloneEl$parentN; + + (_this$cloneEl$parentN = this.cloneEl.parentNode) === null || _this$cloneEl$parentN === void 0 ? void 0 : _this$cloneEl$parentN.removeChild(this.cloneEl); // IE + } + + this.cloneEl = undefined; + } + } + }, { + key: "render", + value: function render() { + var _this$props5 = this.props, + showRowGuideline = _this$props5.showRowGuideline, + rowSpan = _this$props5.rowSpan; + return /*#__PURE__*/external_react_default.a.createElement(RowDragCellStyles_Styled, { + $align: "center", + "data-test": "drag", + $dragging: this.state.isDragging, + tabIndex: 0, + rowSpan: rowSpan, + onKeyDown: this.handleKeyDown + }, showRowGuideline !== 'none' && /*#__PURE__*/external_react_default.a.createElement(RowDragCellStyles_StyledGuideLine, { + $position: showRowGuideline + }), /*#__PURE__*/external_react_default.a.createElement(StyledDrag, { + draggable: true, + $draggable: true, + $dragging: this.state.isDragging || undefined, + onDragStart: this.handleDragStart, + onDragEnd: this.handleDragEnd, + ref: this.handleMount + }, /*#__PURE__*/external_react_default.a.createElement(Table_DragHandle, { + screenReaderContent: Object(i18n_["_"])('Press up or down arrow key to reorder the columns.') + }))); + } + }]); + + return RowDragCell; +}(external_react_["Component"]); + +RowDragCell_defineProperty(RowDragCell_RowDragCell, "propTypes", RowDragCell_propTypes); + +RowDragCell_defineProperty(RowDragCell_RowDragCell, "defaultProps", RowDragCell_defaultProps); + +/* harmony default export */ var Table_RowDragCell = (RowDragCell_RowDragCell); +// CONCATENATED MODULE: ./src/Table/RowStyles.ts + + + +var StyledStripeNone = external_styled_components_default.a.tr.withConfig({ + displayName: "RowStyles__StyledStripeNone", + componentId: "f0igqq-0" +})(["", " background-color:", ";", ";@media print{background-color:none;}", " ", ""], themes_["mixins"].reset('table-row'), Object(themes_["pick"])({ + prisma: themes_["variables"].transparent +}), function (_ref) { + var $clickable = _ref.$clickable; + return $clickable && Object(external_styled_components_["css"])(["cursor:pointer;&:hover{background-color:", ";}&:focus{box-shadow:", ";}"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].accentColorL50, + dark: themes_["variables"].accentColorD50 + }, + prisma: themes_["variables"].interactiveColorOverlayHover + }), themes_["variables"].focusShadowInset); +}, function (_ref2) { + var disabled = _ref2.disabled, + $expandable = _ref2.$expandable; + return !disabled && !$expandable && Object(external_styled_components_["css"])(["&:not([data-expansion-row='true']){&:hover{background-color:", ";}}"], Object(themes_["pick"])({ + prisma: themes_["variables"].interactiveColorOverlayHover + })); +}, function (_ref3) { + var disabled = _ref3.disabled; + return disabled && Object(external_styled_components_["css"])(["color:", ";"], Object(themes_["pick"])({ + prisma: themes_["variables"].contentColorDisabled + })); +}); +var StyledStripeOdd = external_styled_components_default()(StyledStripeNone).withConfig({ + displayName: "RowStyles__StyledStripeOdd", + componentId: "f0igqq-1" +})(["background-color:", ";"], Object(themes_["pick"])({ + enterprise: { + dark: themes_["variables"].gray22 + }, + prisma: themes_["variables"].transparent +})); +var StyledStripeEven = external_styled_components_default()(StyledStripeNone).withConfig({ + displayName: "RowStyles__StyledStripeEven", + componentId: "f0igqq-2" +})(["background-color:", ";"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray96, + dark: themes_["variables"].gray20 + }, + prisma: themes_["variables"].transparent +})); +var StyledCellSelectionDisabled = external_styled_components_default()(Table_Cell).withConfig({ + displayName: "RowStyles__StyledCellSelectionDisabled", + componentId: "f0igqq-3" +})(["&&{cursor:not-allowed;}"]); +var StyledCellExpansionDisabled = external_styled_components_default()(Table_Cell).withConfig({ + displayName: "RowStyles__StyledCellExpansionDisabled", + componentId: "f0igqq-4" +})(["width:", ";"], Object(themes_["pick"])({ + enterprise: '35px', + prisma: '40px' +})); + +// EXTERNAL MODULE: external "@splunk/react-ui/Switch" +var Switch_ = __nested_webpack_require_15029__(58); +var Switch_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Switch_); + +// CONCATENATED MODULE: ./src/Table/ToggleStyles.ts + + + +var StyledSwitch = external_styled_components_default()(Switch_default.a).withConfig({ + displayName: "ToggleStyles__StyledSwitch", + componentId: "sc-1x3ikch-0" +})(["margin:", ";justify-content:center;"], Object(themes_["pickVariant"])('$allRows', { + "true": { + enterprise: '-6px 0', + prisma: '-10px 0' + }, + "false": '-6px 0' +})); + +// CONCATENATED MODULE: ./src/Table/Toggle.tsx +function Toggle_extends() { Toggle_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Toggle_extends.apply(this, arguments); } + +function Toggle_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Toggle_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Toggle_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +var Toggle_propTypes = { + allRows: external_prop_types_default.a.bool, + disabled: external_prop_types_default.a.bool, + onClick: external_prop_types_default.a.func, + selected: external_prop_types_default.a.oneOf([true, false, 'some']) +}; + +function Toggle(_ref) { + var _ref$allRows = _ref.allRows, + allRows = _ref$allRows === void 0 ? false : _ref$allRows, + disabled = _ref.disabled, + _ref$selected = _ref.selected, + selected = _ref$selected === void 0 ? false : _ref$selected, + otherProps = Toggle_objectWithoutProperties(_ref, ["allRows", "disabled", "selected"]); + + var ariaLabel = allRows ? Object(i18n_["_"])('No rows selected') : Object(i18n_["_"])('Row unselected'); + + if (selected === 'some') { + ariaLabel = Object(i18n_["_"])('Some rows selected'); + } else if (selected) { + ariaLabel = allRows ? Object(i18n_["_"])('All rows selected') : Object(i18n_["_"])('Row selected'); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledSwitch, Toggle_extends({ + $allRows: allRows + }, otherProps, { + interactive: false, + disabled: disabled, + value: "", + selected: selected, + "aria-label": ariaLabel, + selectedLabel: allRows ? Object(i18n_["_"])('All rows selected') : Object(i18n_["_"])('Row selected'), + unselectedLabel: allRows ? Object(i18n_["_"])('No rows selected') : Object(i18n_["_"])('Row unselected'), + someSelectedLabel: Object(i18n_["_"])('Some rows selected') + })); +} + +Toggle.propTypes = Toggle_propTypes; +/* harmony default export */ var Table_Toggle = (Toggle); +// CONCATENATED MODULE: ./src/Table/Row.tsx +function Row_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Row_typeof = function _typeof(obj) { return typeof obj; }; } else { Row_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Row_typeof(obj); } + +function Row_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Row_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function Row_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function Row_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Row_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Row_createClass(Constructor, protoProps, staticProps) { if (protoProps) Row_defineProperties(Constructor.prototype, protoProps); if (staticProps) Row_defineProperties(Constructor, staticProps); return Constructor; } + +function Row_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Row_setPrototypeOf(subClass, superClass); } + +function Row_setPrototypeOf(o, p) { Row_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Row_setPrototypeOf(o, p); } + +function Row_createSuper(Derived) { var hasNativeReflectConstruct = Row_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Row_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Row_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Row_possibleConstructorReturn(this, result); }; } + +function Row_possibleConstructorReturn(self, call) { if (call && (Row_typeof(call) === "object" || typeof call === "function")) { return call; } return Row_assertThisInitialized(self); } + +function Row_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Row_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Row_getPrototypeOf(o) { Row_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Row_getPrototypeOf(o); } + +function Row_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function Row_extends() { Row_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Row_extends.apply(this, arguments); } + + + + + + + + + + + + + + + + + + +var StyledStripeComponents = { + odd: StyledStripeOdd, + even: StyledStripeEven, + none: StyledStripeNone +}; +/** @public */ + +var Row_propTypes = { + /** @private. Generally passed by Table rather than added directly. */ + activeElementId: external_prop_types_default.a.string, + actionPrimary: external_prop_types_default.a.element, + actionsSecondary: external_prop_types_default.a.element, + children: external_prop_types_default.a.node, + data: external_prop_types_default.a.any, + + /** @private. Generally passed by Table rather than added directly. */ + dataId: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]), + disabled: external_prop_types_default.a.bool, + + /** @private. Generally passed by Table rather than added directly. */ + draggable: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + + /** @private. */ + expandable: external_prop_types_default.a.bool, + expanded: external_prop_types_default.a.bool, + expansionRow: external_prop_types_default.a.oneOfType([external_prop_types_default.a.element, external_prop_types_default.a.arrayOf(external_prop_types_default.a.element)]), + + /** @private. Indicates whether the table has an actions column. */ + actions: external_prop_types_default.a.bool, + + /** @private. Generally passed by `Table` rather than added directly. */ + index: external_prop_types_default.a.number, + + /** @private. Generally passed by `Table` rather than added directly. */ + movableColumns: external_prop_types_default.a.bool, + onClick: external_prop_types_default.a.func, + + /** @private. Generally passed by `Table` rather than added directly. */ + onDragStart: external_prop_types_default.a.func, + onExpansion: external_prop_types_default.a.func, + + /** @private. This is passed through and works as expected. */ + onKeyDown: external_prop_types_default.a.func, + + /** @private. Generally passed by `Table` rather than added directly. */ + onRequestMoveRow: external_prop_types_default.a.func, + onRequestToggle: external_prop_types_default.a.func, + + /** @private. Generally passed by `Table` rather than added directly. */ + primaryColumnIndex: external_prop_types_default.a.number, + rowScreenReaderText: external_prop_types_default.a.string, + selected: external_prop_types_default.a.bool, + + /** @private. Generally passed by `Table` rather than added directly. */ + showRowGuideline: external_prop_types_default.a.oneOf(['none', 'before', 'after']), + + /** @private. */ + stripe: external_prop_types_default.a.oneOf(['odd', 'even', 'none']) +}; +var Row_defaultProps = { + stripe: 'none', + primaryColumnIndex: 0 +}; +var ActionsSecondaryToggle = /*#__PURE__*/external_react_default.a.forwardRef(function (props, ref) { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isCompact = _useSplunkTheme.isCompact; + + var prismaSize = isCompact ? '20px' : '24px'; + return /*#__PURE__*/external_react_default.a.createElement(Tooltip_default.a, Row_extends({ + content: Object(i18n_["_"])('Actions'), + contentRelationship: "label" + }, props), /*#__PURE__*/external_react_default.a.createElement(Button_default.a, { + appearance: "secondary", + "data-test": "actions-secondary-toggle", + icon: /*#__PURE__*/external_react_default.a.createElement(DotsThreeVertical_default.a, { + height: prismaSize, + width: prismaSize + }), + elementRef: ref + })); +}); + +var Row_Row = /*#__PURE__*/function (_Component) { + Row_inherits(Row, _Component); + + var _super = Row_createSuper(Row); + + function Row() { + var _this; + + Row_classCallCheck(this, Row); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + Row_defineProperty(Row_assertThisInitialized(_this), "elementRef", null); + + Row_defineProperty(Row_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props = _this.props, + data = _this$props.data, + onClick = _this$props.onClick; + var el = e.target; + + while (el) { + if (_this.elementRef === el) { + break; + } // Ignore clicks on row-actions + + + if (el.tagName === 'BUTTON' || el.tagName === 'A') { + return; + } + + el = el.parentNode; + } + + if (!e.defaultPrevented) { + onClick === null || onClick === void 0 ? void 0 : onClick(e, data); + } + }); + + Row_defineProperty(Row_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props2 = _this.props, + data = _this$props2.data, + onClick = _this$props2.onClick, + onKeyDown = _this$props2.onKeyDown; + + if (Object(keyboard_["keycode"])(e.nativeEvent) === 'enter' && onClick) { + onClick(e, data); + } + + onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e); + }); + + Row_defineProperty(Row_assertThisInitialized(_this), "handleToggle", function (e) { + var _this$props3 = _this.props, + data = _this$props3.data, + disabled = _this$props3.disabled, + onRequestToggle = _this$props3.onRequestToggle; + + if (!disabled) { + e.preventDefault(); + onRequestToggle === null || onRequestToggle === void 0 ? void 0 : onRequestToggle(e, data); + } + }); + + Row_defineProperty(Row_assertThisInitialized(_this), "handleExpansion", function (e) { + var _this$props4 = _this.props, + data = _this$props4.data, + onExpansion = _this$props4.onExpansion; + e.preventDefault(); + onExpansion === null || onExpansion === void 0 ? void 0 : onExpansion(e, data); + }); + + Row_defineProperty(Row_assertThisInitialized(_this), "renderActionPrimary", function () { + var actionPrimary = _this.props.actionPrimary; + + if (actionPrimary && actionPrimary.props.onClick) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(actionPrimary, { + onClick: function onClick(e) { + var _actionPrimary$props$, _actionPrimary$props; + + e.preventDefault(); + return (_actionPrimary$props$ = (_actionPrimary$props = actionPrimary.props).onClick) === null || _actionPrimary$props$ === void 0 ? void 0 : _actionPrimary$props$.call(_actionPrimary$props, e, _this.props.data); + } + }); + } + + return actionPrimary; + }); + + Row_defineProperty(Row_assertThisInitialized(_this), "renderActionsSecondary", function () { + var actionsSecondary = _this.props.actionsSecondary; + + if (actionsSecondary && actionsSecondary.props.children) { + var actions = external_react_["Children"].toArray(actionsSecondary.props.children).filter(external_react_["isValidElement"]); + var clonedActions = actions.map(function (action) { + if (action.props.onClick) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(action, { + onClick: function onClick(e) { + var _action$props$onClick, _action$props; + + e.preventDefault(); + return (_action$props$onClick = (_action$props = action.props).onClick) === null || _action$props$onClick === void 0 ? void 0 : _action$props$onClick.call(_action$props, e, _this.props.data); + } + }); + } + + return action; + }); + return /*#__PURE__*/Object(external_react_["cloneElement"])(actionsSecondary, { + children: clonedActions + }); + } + + return actionsSecondary; + }); + + Row_defineProperty(Row_assertThisInitialized(_this), "handleMount", function (el) { + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + _this.elementRef = el; + }); + + return _this; + } + + Row_createClass(Row, [{ + key: "render", + value: function render() { + var _childrenCloned$prima; + + var _this$props5 = this.props, + actions = _this$props5.actions, + actionPrimary = _this$props5.actionPrimary, + actionsSecondary = _this$props5.actionsSecondary, + activeElementId = _this$props5.activeElementId, + children = _this$props5.children, + dataId = _this$props5.dataId, + disabled = _this$props5.disabled, + draggable = _this$props5.draggable, + elementRef = _this$props5.elementRef, + expandable = _this$props5.expandable, + expanded = _this$props5.expanded, + expansionRow = _this$props5.expansionRow, + index = _this$props5.index, + movableColumns = _this$props5.movableColumns, + onClick = _this$props5.onClick, + onDragStart = _this$props5.onDragStart, + onExpansion = _this$props5.onExpansion, + onRequestMoveRow = _this$props5.onRequestMoveRow, + onRequestToggle = _this$props5.onRequestToggle, + primaryColumnIndex = _this$props5.primaryColumnIndex, + rowScreenReaderText = _this$props5.rowScreenReaderText, + selected = _this$props5.selected, + showRowGuideline = _this$props5.showRowGuideline, + stripe = _this$props5.stripe, + otherProps = Row_objectWithoutProperties(_this$props5, ["actions", "actionPrimary", "actionsSecondary", "activeElementId", "children", "dataId", "disabled", "draggable", "elementRef", "expandable", "expanded", "expansionRow", "index", "movableColumns", "onClick", "onDragStart", "onExpansion", "onRequestMoveRow", "onRequestToggle", "primaryColumnIndex", "rowScreenReaderText", "selected", "showRowGuideline", "stripe"]); + + var childrenCloned = !onClick ? external_react_["Children"].toArray(children).map(function (child) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(child, { + disabled: disabled + }); + }) // ensure consistent keys + : external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (child) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(child, { + appearance: 'rowLink', + disabled: disabled + }); + }); + var rowLabelValue; + + if (rowScreenReaderText) { + rowLabelValue = rowScreenReaderText; + } else if ((_childrenCloned$prima = childrenCloned[primaryColumnIndex]) === null || _childrenCloned$prima === void 0 ? void 0 : _childrenCloned$prima.props.children) { + var _childrenCloned$prima2; + + rowLabelValue = "".concat((_childrenCloned$prima2 = childrenCloned[primaryColumnIndex]) === null || _childrenCloned$prima2 === void 0 ? void 0 : _childrenCloned$prima2.props.children); + } else { + var _childrenCloned$; + + rowLabelValue = "".concat((_childrenCloned$ = childrenCloned[0]) === null || _childrenCloned$ === void 0 ? void 0 : _childrenCloned$.props.children); + + if (false) {} + } + + var selectedString = Object(format_["sprintf"])(Object(i18n_["_"])('%(selected)s'), { + selected: selected ? 'selected' : 'unselected' + }); + var StyledStripe = StyledStripeComponents[stripe]; + var StyledCellToggle = disabled ? StyledCellSelectionDisabled : Table_Cell; + var rowSpan = expanded ? external_react_["Children"].count(expansionRow) + 1 : undefined; + var dataMovableColumn = movableColumns ? 'false' : undefined; + var actionsSecondaryToggle = /*#__PURE__*/external_react_default.a.createElement(ActionsSecondaryToggle, null); + return /*#__PURE__*/external_react_default.a.createElement(StyledStripe, Row_extends({ + "data-test": "row", + "data-test-selected": onRequestToggle ? selected : undefined, + $clickable: !!onClick, + "data-has-movable-columns": movableColumns ? 'true' : undefined, + disabled: !!disabled, + $expandable: !!expandable, + ref: this.handleMount, + tabIndex: onClick ? 0 : undefined + }, omit_default()(otherProps, 'data'), { + onClick: onClick ? this.handleClick : undefined, + onKeyDown: this.handleKeyDown, + $rowSelected: !!(onRequestToggle && selected) + }), draggable && /*#__PURE__*/external_react_default.a.createElement(Table_RowDragCell, { + activeElementId: activeElementId, + dataId: dataId, + "data-movable-column": dataMovableColumn, + index: index, + onRequestMoveRow: onRequestMoveRow, + onDragStart: onDragStart, + rowSpan: rowSpan, + showRowGuideline: showRowGuideline + }), onRequestToggle && /*#__PURE__*/external_react_default.a.createElement(StyledCellToggle, { + "aria-label": Object(format_["sprintf"])(Object(i18n_["_"])('%(rowLabelValue)s %(selectedString)s'), { + rowLabelValue: rowLabelValue, + selectedString: selectedString + }), + appearance: onClick ? 'rowLink' : 'data', + "data-test": "toggle", + variant: "toggle", + "data-movable-column": dataMovableColumn, + onClick: this.handleToggle, + rowSpan: rowSpan, + role: "checkbox", + "aria-checked": selected + }, /*#__PURE__*/external_react_default.a.createElement(Table_Toggle, { + disabled: disabled, + selected: selected + })), expandable && expansionRow && /*#__PURE__*/external_react_default.a.createElement(Table_Cell, { + align: "center", + appearance: "data", + "aria-expanded": expanded, + "aria-label": Object(i18n_["_"])('Expandable row'), + "data-movable-column": dataMovableColumn, + "data-test": "expand", + expand: expanded, + onClick: this.handleExpansion, + rowSpan: rowSpan, + variant: "expand" + }, /*#__PURE__*/external_react_default.a.createElement(icons_ExpansionRow, { + expanded: expanded + })), expandable && !expansionRow && /*#__PURE__*/external_react_default.a.createElement(StyledCellExpansionDisabled, { + variant: "expand", + "data-movable-column": dataMovableColumn + }), childrenCloned, actions && !actionPrimary && !actionsSecondary && /*#__PURE__*/external_react_default.a.createElement(Table_Cell, { + align: "right", + appearance: disabled ? 'data' : 'rowLink', + "data-test": "row-actions", + variant: "actions", + "data-movable-column": dataMovableColumn + }), (actionPrimary || actionsSecondary) && /*#__PURE__*/external_react_default.a.createElement(Table_Cell, { + align: "right", + appearance: "rowLink", + "data-test": "row-actions", + variant: "actions", + "data-movable-column": dataMovableColumn + }, actionPrimary && this.renderActionPrimary(), actionsSecondary && /*#__PURE__*/external_react_default.a.createElement(Dropdown_default.a, { + toggle: actionsSecondaryToggle + }, this.renderActionsSecondary()))); + } + }]); + + return Row; +}(external_react_["Component"]); + +Row_defineProperty(Row_Row, "splunkUiType", 'Table.Row'); + +Row_defineProperty(Row_Row, "propTypes", Row_propTypes); + +Row_defineProperty(Row_Row, "defaultProps", Row_defaultProps); + +/* harmony default export */ var Table_Row = (Row_Row); +// CONCATENATED MODULE: ./src/Table/HeadStyles.ts + + + +var HeadStyles_Styled = external_styled_components_default.a.thead.withConfig({ + displayName: "HeadStyles__Styled", + componentId: "iap21t-0" +})(["", ";"], themes_["mixins"].reset('table-header-group')); +var StyledToggleAll = external_styled_components_default()(Table_HeadCell).withConfig({ + displayName: "HeadStyles__StyledToggleAll", + componentId: "iap21t-1" +})(["width:", ";"], Object(themes_["pick"])({ + enterprise: '42px', + prisma: '40px' +})); +var StyledInfo = external_styled_components_default()(Table_HeadCell).withConfig({ + displayName: "HeadStyles__StyledInfo", + componentId: "iap21t-2" +})(["width:", ";"], Object(themes_["pick"])({ + enterprise: '32px', + prisma: '40px' +})); +var StyledDragRow = external_styled_components_default()(Table_HeadCell).withConfig({ + displayName: "HeadStyles__StyledDragRow", + componentId: "iap21t-3" +})(["width:", ";"], Object(themes_["pick"])({ + enterprise: '32px', + prisma: '40px' +})); + +// CONCATENATED MODULE: ./src/Table/Head.tsx +function Head_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Head_typeof = function _typeof(obj) { return typeof obj; }; } else { Head_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Head_typeof(obj); } + +function Head_extends() { Head_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Head_extends.apply(this, arguments); } + +function Head_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Head_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Head_createClass(Constructor, protoProps, staticProps) { if (protoProps) Head_defineProperties(Constructor.prototype, protoProps); if (staticProps) Head_defineProperties(Constructor, staticProps); return Constructor; } + +function Head_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Head_setPrototypeOf(subClass, superClass); } + +function Head_setPrototypeOf(o, p) { Head_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Head_setPrototypeOf(o, p); } + +function Head_createSuper(Derived) { var hasNativeReflectConstruct = Head_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Head_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Head_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Head_possibleConstructorReturn(this, result); }; } + +function Head_possibleConstructorReturn(self, call) { if (call && (Head_typeof(call) === "object" || typeof call === "function")) { return call; } return Head_assertThisInitialized(self); } + +function Head_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Head_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Head_getPrototypeOf(o) { Head_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Head_getPrototypeOf(o); } + +function Head_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + +var Head_propTypes = { + /** @private. */ + actions: external_prop_types_default.a.arrayOf(external_prop_types_default.a.node), + + /** @private. */ + actionsColumnWidth: external_prop_types_default.a.number, + children: external_prop_types_default.a.node, + + /** @private. */ + dragPosition: external_prop_types_default.a.number, + + /** @private. */ + dragIndex: external_prop_types_default.a.number, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + + /** @private. */ + hasDragColumn: external_prop_types_default.a.bool, + + /** @private. */ + hasInfoColumn: external_prop_types_default.a.bool, + + /** @private. */ + onAutosizeColumn: external_prop_types_default.a.func, + + /** @private. */ + onDragStart: external_prop_types_default.a.func, + + /** @private. */ + onRequestMoveColumn: external_prop_types_default.a.func, + + /** @private. */ + onRequestResizeColumn: external_prop_types_default.a.func, + + /** @private. */ + onRequestToggleAllRows: external_prop_types_default.a.func, + + /** @private. */ + rowSelection: external_prop_types_default.a.oneOf(['all', 'some', 'none']) +}; +var Head_defaultProps = { + actions: [] +}; +var columnOneIndexOffset = 3; +var columnTwoIndexOffset = 2; +var columnThreeIndexOffset = 1; + +var Head_Head = /*#__PURE__*/function (_Component) { + Head_inherits(Head, _Component); + + var _super = Head_createSuper(Head); + + // @docs-props-type HeadPropsBase + function Head(props) { + var _this; + + Head_classCallCheck(this, Head); + + _this = _super.call(this, props); + + Head_defineProperty(Head_assertThisInitialized(_this), "cells", void 0); + + Head_defineProperty(Head_assertThisInitialized(_this), "el", null); + + Head_defineProperty(Head_assertThisInitialized(_this), "onRequestMoveColumn", function (_ref) { + var columnId = _ref.columnId, + fromIndex = _ref.fromIndex, + toIndex = _ref.toIndex; + + if (toIndex < external_react_["Children"].toArray(_this.props.children).length) { + var _this$props$onRequest, _this$props; + + // HeadCell never requests less than zero + (_this$props$onRequest = (_this$props = _this.props).onRequestMoveColumn) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, { + fromIndex: fromIndex, + toIndex: toIndex, + columnId: columnId + }); + } + }); + + Head_defineProperty(Head_assertThisInitialized(_this), "handleMount", function (el) { + _this.el = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + Head_defineProperty(Head_assertThisInitialized(_this), "handleDragStart", function (dragIndex, dragColumnId) { + var _this$props$onDragSta, _this$props2; + + var window = Object(ssrWindow["a" /* getWindow */])(); + + _this.setState({ + dragColumnId: dragColumnId + }); + + window.addEventListener('dragend', _this.handleDragEnd); + (_this$props$onDragSta = (_this$props2 = _this.props).onDragStart) === null || _this$props$onDragSta === void 0 ? void 0 : _this$props$onDragSta.call(_this$props2, { + dragIndex: dragIndex + }); + }); + + Head_defineProperty(Head_assertThisInitialized(_this), "handleDragEnd", function () { + var dragColumnId = _this.state.dragColumnId; + var dragIndex = _this.props.dragIndex; + + var guidelineIndex = _this.calculateGuideIndex(); // The new index is not necessarily the same as the guidelineIndex + + + var toIndex = dragIndex !== undefined && dragIndex < guidelineIndex ? guidelineIndex - 1 : guidelineIndex; + + if (dragIndex !== undefined && dragIndex !== toIndex) { + var _this$props$onRequest2, _this$props3; + + (_this$props$onRequest2 = (_this$props3 = _this.props).onRequestMoveColumn) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props3, { + fromIndex: dragIndex, + toIndex: toIndex, + columnId: dragColumnId + }); + } + + _this.cleanupDrag(); + }); + + _this.state = { + dragColumnId: undefined // the item being reordered + + }; + + if (false) {} + + return _this; + } + + Head_createClass(Head, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + if (false) {} + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.cleanupDrag(); + } + }, { + key: "getCellWidths", + value: function getCellWidths() { + var _this$el$firstElement, _this$el, _this$el$firstElement2; + + var window = Object(ssrWindow["a" /* getWindow */])(); + var headRowCells = Array.from((_this$el$firstElement = (_this$el = this.el) === null || _this$el === void 0 ? void 0 : (_this$el$firstElement2 = _this$el.firstElementChild) === null || _this$el$firstElement2 === void 0 ? void 0 : _this$el$firstElement2.children) !== null && _this$el$firstElement !== void 0 ? _this$el$firstElement : []); + var result = headRowCells.map(function (el) { + var computedStyle = window.getComputedStyle(el); + return el.clientWidth - parseFloat(computedStyle.getPropertyValue('padding-right')) - parseFloat(computedStyle.getPropertyValue('padding-left')); + }); + return result; + } + }, { + key: "getClientHeight", + value: function getClientHeight() { + var _this$el2; + + return (_this$el2 = this.el) === null || _this$el2 === void 0 ? void 0 : _this$el2.clientHeight; + } + }, { + key: "getEl", + value: function getEl() { + return this.el; + } + }, { + key: "calculateGuideIndex", + value: function calculateGuideIndex() { + var _this$el$firstElement3, _this$el3, _this$el3$firstElemen; + + var _this$props4 = this.props, + dragIndex = _this$props4.dragIndex, + dragPosition = _this$props4.dragPosition, + hasInfoColumn = _this$props4.hasInfoColumn, + hasDragColumn = _this$props4.hasDragColumn, + onRequestToggleAllRows = _this$props4.onRequestToggleAllRows; + + if (this.props.dragPosition === undefined || !this.el) { + return -1; + } + + this.cells = Array.from((_this$el$firstElement3 = (_this$el3 = this.el) === null || _this$el3 === void 0 ? void 0 : (_this$el3$firstElemen = _this$el3.firstElementChild) === null || _this$el3$firstElemen === void 0 ? void 0 : _this$el3$firstElemen.children) !== null && _this$el$firstElement3 !== void 0 ? _this$el$firstElement3 : []).slice(hasInfoColumn ? 1 : 0).slice(hasDragColumn ? 1 : 0).slice(onRequestToggleAllRows ? 1 : 0); + var overIndex = findIndex_default()(this.cells, function (cell) { + var rect = cell.getBoundingClientRect(); + return dragPosition !== undefined && dragPosition > rect.left && dragPosition < rect.right; + }); + + if (overIndex === -1) { + // must be too far left or right; + var rect = this.el.getBoundingClientRect(); + return dragPosition !== undefined && dragPosition < rect.left ? 0 : this.cells.length; + } + + if (dragIndex !== undefined && overIndex > dragIndex) { + return overIndex + 1; + } + + return overIndex; + } + }, { + key: "cleanupDrag", + value: function cleanupDrag() { + var window = Object(ssrWindow["a" /* getWindow */])(); + window.removeEventListener('dragend', this.handleDragEnd); + this.cells = undefined; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props5 = this.props, + actions = _this$props5.actions, + actionsColumnWidth = _this$props5.actionsColumnWidth, + children = _this$props5.children, + hasDragColumn = _this$props5.hasDragColumn, + hasInfoColumn = _this$props5.hasInfoColumn, + onAutosizeColumn = _this$props5.onAutosizeColumn, + onRequestMoveColumn = _this$props5.onRequestMoveColumn, + onRequestResizeColumn = _this$props5.onRequestResizeColumn, + onRequestToggleAllRows = _this$props5.onRequestToggleAllRows, + rowSelection = _this$props5.rowSelection; + var headType = this.context.headType; + var guidelineIndex = this.calculateGuideIndex(); + var validChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]); + var minimumIndex = validChildren.length + (actions.length || actionsColumnWidth ? 1 : 0); + var clonedChildren = validChildren.map(function (child, index, original) { + var showGuideline = 'none'; + + if (guidelineIndex === original.length && index + 1 === original.length) { + showGuideline = 'after'; + } else if (guidelineIndex === index) { + showGuideline = 'before'; + } + + return /*#__PURE__*/Object(external_react_["cloneElement"])(child, { + index: index, + showGuideline: showGuideline, + onRequestResize: onRequestResizeColumn, + onDragStart: onRequestMoveColumn ? _this2.handleDragStart : undefined, + onRequestMoveColumn: onRequestMoveColumn ? _this2.onRequestMoveColumn : undefined, + onAutosizeColumn: onAutosizeColumn, + key: child.key || child.props.columnId || index, + zIndex: minimumIndex - index + }); + }); + var toggleStateMap = { + all: true, + none: false, + some: 'some' + }; + var toggleState = rowSelection === undefined ? undefined : toggleStateMap[rowSelection]; + var ariaChecked = toggleState === 'some' ? 'mixed' : toggleState; + var defaultActionsColumnWidth = actionsColumnWidth || 48; + var testHookValue = headType === 'fixed' ? 'fixed-head' : 'head'; + return /*#__PURE__*/external_react_default.a.createElement(HeadStyles_Styled, Head_extends({ + ref: this.handleMount, + "data-test": testHookValue + }, omit_default()(this.props, keys_default()(Head.propTypes))), /*#__PURE__*/external_react_default.a.createElement(Table_Row, null, hasDragColumn && /*#__PURE__*/external_react_default.a.createElement(StyledDragRow, { + key: "drag_rows_head_cell", + "data-test": "drag-rows-head-cell", + align: "center", + resizable: false, + zIndex: minimumIndex + columnOneIndexOffset + }), onRequestToggleAllRows && /*#__PURE__*/external_react_default.a.createElement(StyledToggleAll, { + key: "toggle_all", + "data-test": "toggle-all", + resizable: false, + align: "center", + onClick: onRequestToggleAllRows, + variant: "toggleAll", + truncate: false, + role: "checkbox", + "aria-checked": ariaChecked, + zIndex: minimumIndex + columnTwoIndexOffset + }, /*#__PURE__*/external_react_default.a.createElement(Table_Toggle, { + selected: toggleState, + allRows: true + })), hasInfoColumn && /*#__PURE__*/external_react_default.a.createElement(StyledInfo, { + key: "more_info_head_cell", + "data-test": "more-info-head-cell", + align: "center", + resizable: false, + variant: "info", + zIndex: minimumIndex + columnThreeIndexOffset + }, /*#__PURE__*/external_react_default.a.createElement(HeadExpandRows, null)), clonedChildren, actions.length > 0 && /*#__PURE__*/external_react_default.a.createElement(Table_HeadCell, { + hasActionsHead: true, + key: "actions_head_cell", + "data-test": "actions-head-cell", + align: "right", + resizable: false, + width: defaultActionsColumnWidth, + style: { + minWidth: defaultActionsColumnWidth + }, + variant: "actions", + zIndex: 1 + }, actions), actions.length === 0 && actionsColumnWidth && /*#__PURE__*/external_react_default.a.createElement(Table_HeadCell, { + key: "actions_head_cell", + "data-test": "actions-head-cell", + align: "right", + resizable: false, + width: actionsColumnWidth, + style: { + minWidth: actionsColumnWidth + }, + variant: "actions", + zIndex: 1 + }, ' '))); + } + }], [{ + key: "validateChildrenWidth", + value: function validateChildrenWidth(props) { + if (false) { var hasChildWithoutWidth; } + } + }]); + + return Head; +}(external_react_["Component"]); + +Head_defineProperty(Head_Head, "contextType", Table_TableContext); + +Head_defineProperty(Head_Head, "splunkUiType", 'Table.Head'); + +Head_defineProperty(Head_Head, "propTypes", Head_propTypes); + +Head_defineProperty(Head_Head, "defaultProps", Head_defaultProps); + +/* harmony default export */ var Table_Head = (Head_Head); +// EXTERNAL MODULE: external "lodash/isFinite" +var isFinite_ = __nested_webpack_require_15029__(19); +var isFinite_default = /*#__PURE__*/__nested_webpack_require_15029__.n(isFinite_); + +// EXTERNAL MODULE: external "lodash/isFunction" +var isFunction_ = __nested_webpack_require_15029__(69); +var isFunction_default = /*#__PURE__*/__nested_webpack_require_15029__.n(isFunction_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_15029__(8); + +// EXTERNAL MODULE: external "@splunk/react-ui/Popover" +var Popover_ = __nested_webpack_require_15029__(21); +var Popover_default = /*#__PURE__*/__nested_webpack_require_15029__.n(Popover_); + +// CONCATENATED MODULE: ./src/Table/HeadDropdownCell.tsx +function HeadDropdownCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HeadDropdownCell_typeof = function _typeof(obj) { return typeof obj; }; } else { HeadDropdownCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HeadDropdownCell_typeof(obj); } + +function HeadDropdownCell_extends() { HeadDropdownCell_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return HeadDropdownCell_extends.apply(this, arguments); } + +function HeadDropdownCell_toConsumableArray(arr) { return HeadDropdownCell_arrayWithoutHoles(arr) || HeadDropdownCell_iterableToArray(arr) || HeadDropdownCell_unsupportedIterableToArray(arr) || HeadDropdownCell_nonIterableSpread(); } + +function HeadDropdownCell_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function HeadDropdownCell_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return HeadDropdownCell_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return HeadDropdownCell_arrayLikeToArray(o, minLen); } + +function HeadDropdownCell_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function HeadDropdownCell_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return HeadDropdownCell_arrayLikeToArray(arr); } + +function HeadDropdownCell_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function HeadDropdownCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function HeadDropdownCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function HeadDropdownCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeadDropdownCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeadDropdownCell_defineProperties(Constructor, staticProps); return Constructor; } + +function HeadDropdownCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) HeadDropdownCell_setPrototypeOf(subClass, superClass); } + +function HeadDropdownCell_setPrototypeOf(o, p) { HeadDropdownCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeadDropdownCell_setPrototypeOf(o, p); } + +function HeadDropdownCell_createSuper(Derived) { var hasNativeReflectConstruct = HeadDropdownCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeadDropdownCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeadDropdownCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeadDropdownCell_possibleConstructorReturn(this, result); }; } + +function HeadDropdownCell_possibleConstructorReturn(self, call) { if (call && (HeadDropdownCell_typeof(call) === "object" || typeof call === "function")) { return call; } return HeadDropdownCell_assertThisInitialized(self); } + +function HeadDropdownCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function HeadDropdownCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function HeadDropdownCell_getPrototypeOf(o) { HeadDropdownCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeadDropdownCell_getPrototypeOf(o); } + +function HeadDropdownCell_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + + + +/** @public */ + +var possibleCloseReasons = ['clickAway', 'contentClick', 'escapeKey', 'offScreen', 'tabKey', 'toggleClick']; +var HeadDropdownCell_propTypes = { + align: external_prop_types_default.a.oneOf(['left', 'center', 'right']), + canCoverHead: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node.isRequired, + closeReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)), + columnId: external_prop_types_default.a.any, + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'vertical', 'horizontal']), + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + focusToggleReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)), + + /** @private The index of the cell, skipping the info column. */ + index: external_prop_types_default.a.number, + label: external_prop_types_default.a.node, + + /** @private. */ + onAutosizeColumn: external_prop_types_default.a.func, + + /** @private. */ + onDragStart: external_prop_types_default.a.func, + + /** + * @private. This will be passed through, and will work as expected. + */ + onKeyDown: external_prop_types_default.a.func, + onRequestClose: external_prop_types_default.a.func, + + /** @private. */ + onRequestMoveColumn: external_prop_types_default.a.func, + onRequestOpen: external_prop_types_default.a.func, + + /** @private. */ + onRequestResize: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + repositionMode: external_prop_types_default.a.oneOf(['none', 'flip', 'any']), + resizable: external_prop_types_default.a.bool, + retainFocus: external_prop_types_default.a.bool, + + /** @private. */ + showGuideline: external_prop_types_default.a.oneOf(['none', 'before', 'after']), + takeFocus: external_prop_types_default.a.bool, + truncate: external_prop_types_default.a.bool, + + /** + * @private + * Used internally to suppress focus when this `HeadDropdownCell` is superseded by one in an + * overlaid `HeadTable` for user interactions. + */ + visible: external_prop_types_default.a.bool, + width: external_prop_types_default.a.number, + + /** @private. */ + variant: external_prop_types_default.a.oneOf(['toggleAll', 'info', 'actions']), + + /** @private. */ + zIndex: external_prop_types_default.a.number +}; +var HeadDropdownCell_defaultProps = { + align: 'left', + canCoverHead: true, + closeReasons: possibleCloseReasons, + defaultPlacement: 'below', + focusToggleReasons: ['contentClick', 'escapeKey', 'toggleClick'], + repositionMode: 'flip', + resizable: true, + retainFocus: false, + takeFocus: true, + truncate: true, + visible: true, + zIndex: 1 +}; + +var HeadDropdownCell_HeadDropdownCell = /*#__PURE__*/function (_Component) { + HeadDropdownCell_inherits(HeadDropdownCell, _Component); + + var _super = HeadDropdownCell_createSuper(HeadDropdownCell); + + // @docs-props-type HeadDropdownCellPropsBase + + /** + * Enumeration of the possible reasons for closing the Select. + * 'clickAway', 'escapeKey', and 'offScreen' are inherited from Popover, but repeated here for + * docs extraction. + */ + function HeadDropdownCell(props) { + var _this; + + HeadDropdownCell_classCallCheck(this, HeadDropdownCell); + + _this = _super.call(this, props); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "cellId", void 0); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "controlledExternally", void 0); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "popoverId", void 0); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleMount", function (el) { + _this.setState({ + el: el + }); + + Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el); + }); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleRequestClose", function (_ref) { + var reason = _ref.reason, + event = _ref.event; + var _this$props = _this.props, + closeReasons = _this$props.closeReasons, + columnId = _this$props.columnId, + focusToggleReasons = _this$props.focusToggleReasons, + index = _this$props.index, + onRequestClose = _this$props.onRequestClose; + + if (reason === 'clickAway' && event !== undefined) { + var el = event.target; + + while (el) { + // Ignore clicks on toggle. + if (el === _this.state.el) { + return; + } + + el = el.parentNode; + } + } + + if (_this.isOpen() && includes_default()(closeReasons, reason) && index !== undefined) { + if (includes_default()(focusToggleReasons, reason)) { + _this.focus(); + } + + if (!_this.isControlled()) { + _this.setState({ + open: false + }); + } + + onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose(event, { + index: index, + reason: reason, + columnId: columnId + }); + } + }); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleClick", function (e) { + var _this$props2 = _this.props, + columnId = _this$props2.columnId, + index = _this$props2.index; // ignore clicks on the resize handle + + if (e.target.getAttribute('data-test') === 'resize') { + return; + } + + _this.setState({ + clientX: e.clientX || undefined + }); + + if (_this.isOpen()) { + var _this$handleRequestCl, _this2; + + (_this$handleRequestCl = (_this2 = _this).handleRequestClose) === null || _this$handleRequestCl === void 0 ? void 0 : _this$handleRequestCl.call(_this2, { + reason: 'toggleClick', + event: e + }); + } else if (index !== undefined) { + var _this$props$onRequest, _this$props3; + + (_this$props$onRequest = (_this$props3 = _this.props).onRequestOpen) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props3, e, { + reason: 'toggleClick', + columnId: columnId, + index: index + }); + + if (!_this.isControlled()) { + _this.setState({ + open: true + }); + } + } + }); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleKeyDown", function (e) { + var _this$props4 = _this.props, + columnId = _this$props4.columnId, + index = _this$props4.index, + onKeyDown = _this$props4.onKeyDown, + onRequestMoveColumn = _this$props4.onRequestMoveColumn; + + if (e.target.getAttribute('data-test') !== 'resize') { + if (Object(keyboard_["keycode"])(e.nativeEvent) === 'enter') { + _this.handleClick(e); + } else if (Object(keyboard_["keycode"])(e.nativeEvent) === 'left' && index !== undefined && index > 0) { + onRequestMoveColumn === null || onRequestMoveColumn === void 0 ? void 0 : onRequestMoveColumn({ + fromIndex: index, + toIndex: index - 1, + columnId: columnId + }); + } else if (Object(keyboard_["keycode"])(e.nativeEvent) === 'right' && index !== undefined) { + onRequestMoveColumn === null || onRequestMoveColumn === void 0 ? void 0 : onRequestMoveColumn({ + fromIndex: index, + toIndex: index + 1, + columnId: columnId + }); + } + } + + if (index !== undefined) { + onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e, { + index: index, + columnId: columnId + }); + } + }); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleContentClick", function (event) { + _this.handleRequestClose({ + reason: 'contentClick', + event: event + }); + }); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleDragStart", function (index, columnId) { + var _this$props$onDragSta, _this$props5; + + _this.setState({ + isDragging: true + }); + + (_this$props$onDragSta = (_this$props5 = _this.props).onDragStart) === null || _this$props$onDragSta === void 0 ? void 0 : _this$props$onDragSta.call(_this$props5, index, columnId); + }); + + HeadDropdownCell_defineProperty(HeadDropdownCell_assertThisInitialized(_this), "handleDragEnd", function () { + _this.setState({ + isDragging: false + }); + }); + + _this.state = { + el: null, + isDragging: false, + open: false + }; + _this.controlledExternally = has_default()(props, 'open'); + _this.popoverId = Object(id_["createDOMID"])('popover'); + _this.cellId = Object(id_["createDOMID"])('cellId'); + + if (false) {} + + return _this; + } + + HeadDropdownCell_createClass(HeadDropdownCell, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (prevProps.visible && !this.props.visible) { + this.handleRequestClose({ + reason: 'offScreen' + }); + } + + if (false) {} + } + }, { + key: "focus", + + /** + * Place focus on the toggle. + */ + value: function focus() { + var _this$state$el; + + (_this$state$el = this.state.el) === null || _this$state$el === void 0 ? void 0 : _this$state$el.focus(); + } + }, { + key: "isOpen", + value: function isOpen() { + return this.isControlled() ? this.props.open : this.state.open; + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "render", + value: function render() { + var _el$getBoundingClient, + _this3 = this; + + var _this$props6 = this.props, + align = _this$props6.align, + canCoverHead = _this$props6.canCoverHead, + children = _this$props6.children, + closeReasons = _this$props6.closeReasons, + columnId = _this$props6.columnId, + defaultPlacement = _this$props6.defaultPlacement, + id = _this$props6.id, + index = _this$props6.index, + label = _this$props6.label, + onAutosizeColumn = _this$props6.onAutosizeColumn, + onDragStart = _this$props6.onDragStart, + onRequestResize = _this$props6.onRequestResize, + repositionMode = _this$props6.repositionMode, + resizable = _this$props6.resizable, + retainFocus = _this$props6.retainFocus, + showGuideline = _this$props6.showGuideline, + style = _this$props6.style, + takeFocus = _this$props6.takeFocus, + truncate = _this$props6.truncate, + variant = _this$props6.variant, + visible = _this$props6.visible, + width = _this$props6.width, + zIndex = _this$props6.zIndex; + var _this$state = this.state, + el = _this$state.el, + clientX = _this$state.clientX; + var cellId = id || this.cellId; + var headType = this.context.headType; + return /*#__PURE__*/external_react_default.a.createElement(HeadCellStyles_Styled, HeadDropdownCell_extends({ + style: merge_default()(style, { + width: width + }), + "data-test": "head-cell", + $dragging: this.state.isDragging || undefined, + $clickable: true, + $variant: variant, + id: visible ? cellId : undefined, + tabIndex: visible ? 0 : undefined, + ref: this.handleMount + }, omit_default()(this.props, [].concat(HeadDropdownCell_toConsumableArray(Object.keys(HeadDropdownCell.propTypes)), ['id', 'style'])), { + onClick: this.handleClick, + onKeyDown: this.handleKeyDown, + "aria-haspopup": true, + "aria-owns": this.popoverId, + "aria-expanded": this.isOpen(), + $isFixed: headType === 'fixed', + $zIndex: zIndex + }), /*#__PURE__*/external_react_default.a.createElement(Table_HeadInner, { + label: label, + align: align, + columnId: columnId, + id: id, + index: index, + isMenu: true, + resizable: visible && resizable, + onDragStart: onDragStart ? this.handleDragStart : undefined, + onDragEnd: onDragStart ? this.handleDragEnd : undefined, + onAutosizeColumn: onAutosizeColumn, + onRequestResize: onRequestResize, + truncate: truncate, + width: width + }), showGuideline !== 'none' && /*#__PURE__*/external_react_default.a.createElement(StyledGuideLine, { + $position: showGuideline + }), /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, { + align: "center", + open: !!el && this.isOpen(), + autoCloseWhenOffScreen: includes_default()(closeReasons, 'offScreen'), + anchor: el, + canCoverAnchor: canCoverHead, + retainFocus: retainFocus, + defaultPlacement: defaultPlacement, + onRequestClose: this.handleRequestClose, + repositionMode: repositionMode, + id: this.popoverId, + "aria-labelledby": id || this.cellId, + takeFocus: takeFocus, + pointTo: clientX !== undefined && isFinite_default()(clientX) ? { + x: clientX - ((_el$getBoundingClient = el === null || el === void 0 ? void 0 : el.getBoundingClientRect().left) !== null && _el$getBoundingClient !== void 0 ? _el$getBoundingClient : 0) + } : undefined + }, isFunction_default()(children) ? function () { + return ( + /*#__PURE__*/ + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions + external_react_default.a.createElement("div", { + onClick: _this3.handleContentClick + }, children.apply(void 0, arguments)) + ); + } : + /*#__PURE__*/ + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions + external_react_default.a.createElement("div", { + onClick: this.handleContentClick + }, children))); + } + }]); + + return HeadDropdownCell; +}(external_react_["Component"]); + +HeadDropdownCell_defineProperty(HeadDropdownCell_HeadDropdownCell, "splunkUiType", 'Table.HeadDropdownCell'); + +HeadDropdownCell_defineProperty(HeadDropdownCell_HeadDropdownCell, "possibleCloseReasons", possibleCloseReasons); + +HeadDropdownCell_defineProperty(HeadDropdownCell_HeadDropdownCell, "propTypes", HeadDropdownCell_propTypes); + +HeadDropdownCell_defineProperty(HeadDropdownCell_HeadDropdownCell, "defaultProps", HeadDropdownCell_defaultProps); + +HeadDropdownCell_defineProperty(HeadDropdownCell_HeadDropdownCell, "contextType", Table_TableContext); + +/* harmony default export */ var Table_HeadDropdownCell = (HeadDropdownCell_HeadDropdownCell); +// EXTERNAL MODULE: external "lodash/extend" +var extend_ = __nested_webpack_require_15029__(49); +var extend_default = /*#__PURE__*/__nested_webpack_require_15029__.n(extend_); + +// CONCATENATED MODULE: ./src/Table/HeadTableStyles.ts + + + +var HeadTableStyles_Styled = external_styled_components_default()(StyledTable).withConfig({ + displayName: "HeadTableStyles__Styled", + componentId: "g85wgf-0" +})(["min-width:0;table-layout:fixed;"]); +var StyledDockedContainer = external_styled_components_default.a.div.withConfig({ + displayName: "HeadTableStyles__StyledDockedContainer", + componentId: "g85wgf-1" +})(["overflow:hidden;position:fixed;box-shadow:", ";z-index:", ";@media print{display:none;}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].overlayShadow, + prisma: 'none' +}), themes_["variables"].zindexFixedNavbar); +var StyledFixedContainer = external_styled_components_default()(StyledDockedContainer).withConfig({ + displayName: "HeadTableStyles__StyledFixedContainer", + componentId: "g85wgf-2" +})(["position:absolute;box-shadow:none;z-index:1;"]); + +// CONCATENATED MODULE: ./src/Table/HeadTable.tsx +function HeadTable_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HeadTable_typeof = function _typeof(obj) { return typeof obj; }; } else { HeadTable_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HeadTable_typeof(obj); } + +function HeadTable_extends() { HeadTable_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return HeadTable_extends.apply(this, arguments); } + +function HeadTable_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = HeadTable_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function HeadTable_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function HeadTable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function HeadTable_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function HeadTable_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeadTable_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeadTable_defineProperties(Constructor, staticProps); return Constructor; } + +function HeadTable_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) HeadTable_setPrototypeOf(subClass, superClass); } + +function HeadTable_setPrototypeOf(o, p) { HeadTable_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeadTable_setPrototypeOf(o, p); } + +function HeadTable_createSuper(Derived) { var hasNativeReflectConstruct = HeadTable_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeadTable_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeadTable_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeadTable_possibleConstructorReturn(this, result); }; } + +function HeadTable_possibleConstructorReturn(self, call) { if (call && (HeadTable_typeof(call) === "object" || typeof call === "function")) { return call; } return HeadTable_assertThisInitialized(self); } + +function HeadTable_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function HeadTable_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function HeadTable_getPrototypeOf(o) { HeadTable_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeadTable_getPrototypeOf(o); } + +function HeadTable_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + +var HeadTable_propTypes = { + cellWidths: external_prop_types_default.a.arrayOf(external_prop_types_default.a.number).isRequired, + dragIndex: external_prop_types_default.a.number, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + hasDragColumn: external_prop_types_default.a.bool, + hasRowExpansion: external_prop_types_default.a.bool, + hasRowSelection: external_prop_types_default.a.bool, + headType: external_prop_types_default.a.oneOf(['docked', 'fixed']).isRequired, + horizontalOffset: external_prop_types_default.a.number, + isFixedColumn: external_prop_types_default.a.bool, + rowSelection: external_prop_types_default.a.oneOf(['all', 'some', 'none']), + tableStyle: external_prop_types_default.a.object, + tableWidth: external_prop_types_default.a.number.isRequired, + tHead: external_prop_types_default.a.element.isRequired, + top: external_prop_types_default.a.number.isRequired, + width: external_prop_types_default.a.number.isRequired +}; +var HeadTable_defaultProps = { + horizontalOffset: 0 +}; + +/** + * @private + * HeadTable is an internal component that provides a detached table head that can + * then be positioned in different ways outside of the main table. + */ +var HeadTable_HeadTable = /*#__PURE__*/function (_Component) { + HeadTable_inherits(HeadTable, _Component); + + var _super = HeadTable_createSuper(HeadTable); + + function HeadTable() { + var _this; + + HeadTable_classCallCheck(this, HeadTable); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + HeadTable_defineProperty(HeadTable_assertThisInitialized(_this), "head", null); + + HeadTable_defineProperty(HeadTable_assertThisInitialized(_this), "handleHeadMount", function (head) { + _this.head = head; + }); + + return _this; + } + + HeadTable_createClass(HeadTable, [{ + key: "getHead", + value: function getHead() { + return this.head; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + cellWidths = _this$props.cellWidths, + elementRef = _this$props.elementRef, + hasDragColumn = _this$props.hasDragColumn, + hasRowExpansion = _this$props.hasRowExpansion, + hasRowSelection = _this$props.hasRowSelection, + headType = _this$props.headType, + horizontalOffset = _this$props.horizontalOffset, + isFixedColumn = _this$props.isFixedColumn, + tableStyle = _this$props.tableStyle, + tableWidth = _this$props.tableWidth, + tHead = _this$props.tHead, + top = _this$props.top, + width = _this$props.width, + otherProps = HeadTable_objectWithoutProperties(_this$props, ["cellWidths", "elementRef", "hasDragColumn", "hasRowExpansion", "hasRowSelection", "headType", "horizontalOffset", "isFixedColumn", "tableStyle", "tableWidth", "tHead", "top", "width"]); + + var isDocked = headType === 'docked'; + var StyledContainer = isDocked ? StyledDockedContainer : StyledFixedContainer; + var indexOffset = 0; + + if (hasRowExpansion) { + indexOffset += 1; + } + + if (hasRowSelection) { + indexOffset += 1; + } + + if (hasDragColumn) { + indexOffset += 1; + } // Set the widths of the head cells if not fixed column + + + var cells = isFixedColumn ? external_react_["Children"].toArray(tHead.props.children) : // ensure consistent keys + external_react_["Children"].toArray(tHead.props.children).filter(external_react_["isValidElement"]).map(function (cell, i) { + return /*#__PURE__*/Object(external_react_["cloneElement"])(cell, { + style: extend_default()({}, cell.props.style, { + width: cellWidths[i + indexOffset] + }) + }); + }); + var clonedTHead = /*#__PURE__*/Object(external_react_["cloneElement"])(tHead, { + ref: this.handleHeadMount, + 'data-test': "".concat(headType, "-head") + }, cells); + return /*#__PURE__*/external_react_default.a.createElement(StyledContainer, { + style: { + top: top, + width: width + }, + ref: elementRef + }, /*#__PURE__*/external_react_default.a.createElement(HeadTableStyles_Styled, HeadTable_extends({ + "data-test": "".concat(headType, "-head-table"), + "data-fixed-column": isFixedColumn ? 'true' : undefined, + style: extend_default()({}, tableStyle, { + marginLeft: horizontalOffset, + width: isFixedColumn ? undefined : tableWidth + }) + }, omit_default()(otherProps, 'dragIndex')), clonedTHead)); + } + }]); + + return HeadTable; +}(external_react_["Component"]); + +HeadTable_defineProperty(HeadTable_HeadTable, "propTypes", HeadTable_propTypes); + +HeadTable_defineProperty(HeadTable_HeadTable, "defaultProps", HeadTable_defaultProps); + +/* harmony default export */ var Table_HeadTable = (HeadTable_HeadTable); +// EXTERNAL MODULE: ./src/utils/types.ts +var types = __nested_webpack_require_15029__(76); + +// CONCATENATED MODULE: ./src/Table/Table.tsx +function Table_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Table_typeof = function _typeof(obj) { return typeof obj; }; } else { Table_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Table_typeof(obj); } + +function Table_extends() { Table_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Table_extends.apply(this, arguments); } + +function Table_toConsumableArray(arr) { return Table_arrayWithoutHoles(arr) || Table_iterableToArray(arr) || Table_unsupportedIterableToArray(arr) || Table_nonIterableSpread(); } + +function Table_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function Table_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Table_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Table_arrayLikeToArray(o, minLen); } + +function Table_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function Table_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Table_arrayLikeToArray(arr); } + +function Table_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function Table_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Table_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Table_createClass(Constructor, protoProps, staticProps) { if (protoProps) Table_defineProperties(Constructor.prototype, protoProps); if (staticProps) Table_defineProperties(Constructor, staticProps); return Constructor; } + +function Table_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Table_setPrototypeOf(subClass, superClass); } + +function Table_setPrototypeOf(o, p) { Table_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Table_setPrototypeOf(o, p); } + +function Table_createSuper(Derived) { var hasNativeReflectConstruct = Table_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Table_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Table_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Table_possibleConstructorReturn(this, result); }; } + +function Table_possibleConstructorReturn(self, call) { if (call && (Table_typeof(call) === "object" || typeof call === "function")) { return call; } return Table_assertThisInitialized(self); } + +function Table_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function Table_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function Table_getPrototypeOf(o) { Table_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Table_getPrototypeOf(o); } + +function Table_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + // Exposed as static members of the Table class + + + + + + + + // Internal Helper Modules + + + + + + + +/** @public */ + +var Table_propTypes = { + actions: external_prop_types_default.a.arrayOf(external_prop_types_default.a.element), + actionsColumnWidth: external_prop_types_default.a.number, + children: external_prop_types_default.a.node, + dockOffset: external_prop_types_default.a.number, + dockScrollBar: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + headType: external_prop_types_default.a.oneOf(['docked', 'fixed', 'inline']), + innerStyle: external_prop_types_default.a.object, + onRequestToggleAllRows: external_prop_types_default.a.func, + onScroll: external_prop_types_default.a.func, + outerStyle: external_prop_types_default.a.object, + primaryColumnIndex: external_prop_types_default.a.number, + rowExpansion: external_prop_types_default.a.oneOf(['single', 'multi', 'controlled', 'none']), + rowSelection: external_prop_types_default.a.oneOf(['all', 'some', 'none']), + stripeRows: external_prop_types_default.a.bool, + tableStyle: external_prop_types_default.a.object, + onRequestMoveColumn: external_prop_types_default.a.func, + onRequestMoveRow: external_prop_types_default.a.func, + onRequestResizeColumn: external_prop_types_default.a.func +}; +var Table_defaultProps = { + actions: [], + dockOffset: 0, + headType: 'inline', + rowExpansion: 'none', + rowSelection: 'none', + resizableFillLayout: false, + primaryColumnIndex: 0 +}; + +var Table_Table = /*#__PURE__*/function (_Component) { + Table_inherits(Table, _Component); + + var _super = Table_createSuper(Table); + + Table_createClass(Table, null, [{ + key: "getHeadFocusState", + // @docs-props-type TablePropsBase + + /** + * @private + * @private + * Returns an object describing the focus state of the provided `head`. + * @param head - A reference to a mounted `Head` component. + * @returns {Object} focusState - An object containing a target (either 'headCell' or + * 'resizeButton') and an index. + */ + value: function getHeadFocusState(head) { + var _head$getEl, _head$getEl2; + + var document = Object(ssrDocument["a" /* getDocument */])(); + + if (head === undefined || head === null) { + return undefined; + } + + var headCells = (_head$getEl = head.getEl()) === null || _head$getEl === void 0 ? void 0 : _head$getEl.children[0].children; + var activeHeadCellIndex = indexOf_default()(headCells, document.activeElement); + + if (activeHeadCellIndex > -1) { + return { + target: 'headCell', + index: activeHeadCellIndex + }; + } + + var resizeButtons = (_head$getEl2 = head.getEl()) === null || _head$getEl2 === void 0 ? void 0 : _head$getEl2.querySelectorAll('[data-test=resize]'); + var activeResizeButtonIndex = indexOf_default()(resizeButtons, document.activeElement); + + if (activeResizeButtonIndex > -1) { + return { + target: 'resizeButton', + index: activeResizeButtonIndex + }; + } + + return undefined; + } + }, { + key: "getOffset", + value: function getOffset(el) { + var window = Object(ssrWindow["a" /* getWindow */])(); + var rect = el.getBoundingClientRect(); + return { + top: rect.top + window.pageYOffset, + left: rect.left + window.pageXOffset + }; + } + /** + * @private + * @private + * Applies the provided `headFocusState` to the provided `head`. + * @param head - A reference to a mounted `Head` component. + * @param {Object} headFocusState + * @param {String} headFocusState.target - Focus can be applied to a 'headCell' or a + * 'resizeButton'. + * @param {Number} headFocusState.index - The index of the element to set focus on. + */ + + }, { + key: "applyHeadFocusState", + value: function applyHeadFocusState(head, _ref) { + var _targetEl, _targetEl$focus; + + var target = _ref.target, + index = _ref.index; + + if (false) {} + + var targetEl; + + if (target === 'headCell') { + var _head$getEl3; + + targetEl = head === null || head === void 0 ? void 0 : (_head$getEl3 = head.getEl()) === null || _head$getEl3 === void 0 ? void 0 : _head$getEl3.children[0].children[index]; + } else if (target === 'resizeButton') { + var _head$getEl4; + + targetEl = head === null || head === void 0 ? void 0 : (_head$getEl4 = head.getEl()) === null || _head$getEl4 === void 0 ? void 0 : _head$getEl4.querySelectorAll('[data-test=resize]')[index]; + } + + if (false) {} + + (_targetEl = targetEl) === null || _targetEl === void 0 ? void 0 : (_targetEl$focus = _targetEl.focus) === null || _targetEl$focus === void 0 ? void 0 : _targetEl$focus.call(_targetEl); + } + }]); + + function Table(props) { + var _this; + + Table_classCallCheck(this, Table); + + _this = _super.call(this, props); + + Table_defineProperty(Table_assertThisInitialized(_this), "dockedScrollBar", null); + + Table_defineProperty(Table_assertThisInitialized(_this), "head", null); + + Table_defineProperty(Table_assertThisInitialized(_this), "headFocusState", void 0); + + Table_defineProperty(Table_assertThisInitialized(_this), "headTable", null); + + Table_defineProperty(Table_assertThisInitialized(_this), "headTableEl", null); + + Table_defineProperty(Table_assertThisInitialized(_this), "scrollSource", void 0); + + Table_defineProperty(Table_assertThisInitialized(_this), "table", null); + + Table_defineProperty(Table_assertThisInitialized(_this), "tableContainer", null); + + Table_defineProperty(Table_assertThisInitialized(_this), "updateDockedHeadState", function () { + var window = Object(ssrWindow["a" /* getWindow */])(); + + if (_this.isInline()) { + return; + } + + var _assertThisInitialize = Table_assertThisInitialized(_this), + tableContainer = _assertThisInitialize.tableContainer, + head = _assertThisInitialize.head, + table = _assertThisInitialize.table; + + var dockOffset = _this.props.dockOffset; + + if (!table || !head) { + return; + } + + var cellWidths = head.getCellWidths(); + var headHeight = head.getClientHeight(); + var tableTopWrtWindow = Table.getOffset(table).top - window.pageYOffset - (headHeight !== null && headHeight !== void 0 ? headHeight : 0) + table.offsetHeight; + var top = Math.min(tableTopWrtWindow, dockOffset); + + _this.setState({ + width: tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientWidth, + tableWidth: table === null || table === void 0 ? void 0 : table.clientWidth, + cellWidths: cellWidths, + top: top + }); + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleScroll", throttle_default()(_this.updateDockedHeadState, 0)); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleResize", throttle_default()(_this.updateDockedHeadState, 50)); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleContainerScroll", function (e) { + var _this$props$onScroll, _this$props; + + (_this$props$onScroll = (_this$props = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props, e); + + if ((_this.isFixed() || _this.headerIsDocked()) && _this.tableContainer) { + _this.setState({ + horizontalOffset: -_this.tableContainer.scrollLeft + }); + } + + if (_this.dockedScrollBar && _this.scrollSource !== 'dockedScrollBar' && _this.tableContainer) { + _this.scrollSource = 'container'; + _this.dockedScrollBar.scrollLeft = _this.tableContainer.scrollLeft; + } else { + _this.scrollSource = undefined; + } + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleDockedScrollBarScroll", function () { + if (_this.scrollSource !== 'container' && _this.tableContainer && _this.dockedScrollBar) { + _this.scrollSource = 'dockedScrollBar'; + _this.tableContainer.scrollLeft = _this.dockedScrollBar.scrollLeft; + } else { + _this.scrollSource = undefined; + } + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleDragStart", function (_ref2) { + var dragIndex = _ref2.dragIndex; + var window = Object(ssrWindow["a" /* getWindow */])(); + + _this.setState({ + dragIndex: dragIndex + }); + + window.addEventListener('dragenter', _this.handleDragEnter); + window.addEventListener('dragover', _this.handleDragOver); + window.addEventListener('drop', _this.handleDrop); + window.addEventListener('dragend', _this.handleDragEnd); + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleDragOver", function (e) { + e.preventDefault(); // necessary for the drop event to fire + + if (e.dataTransfer) { + e.dataTransfer.dropEffect = 'move'; + } + + _this.updateDragPosition(e.clientX); + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleDragEnter", function (e) { + e.preventDefault(); // necessary for the drop event to fire + + _this.setState({ + dragPosition: e.clientX + }); + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleDragEnd", function () { + _this.setState({ + dragPosition: undefined + }); + + _this.cleanupDrag(); + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleDrop", function (e) { + e.preventDefault(); // necessary to prevent cell from animating to original position; + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleHeadMount", function (comp) { + _this.head = comp; + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleHeadTableMount", function (headTable) { + if (headTable) { + // On mount, focus the applicable docked head cell if a primary head cell was focused. + if (_this.headFocusState) { + Table.applyHeadFocusState(headTable.getHead(), _this.headFocusState); + _this.headFocusState = undefined; + } + } else { + var _this$headTable; + + // On unmount, focus the applicable primary head cell if a docked head cell was focused. + var focusState = Table.getHeadFocusState((_this$headTable = _this.headTable) === null || _this$headTable === void 0 ? void 0 : _this$headTable.getHead()); + + if (focusState) { + Table.applyHeadFocusState(_this.head, focusState); + } + } + + _this.headTable = headTable; + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleHeadTableElementMount", function (el) { + _this.headTableEl = el; + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleHeadTableKeyUp", function (e) { + if (!_this.headTableEl || !_this.tableContainer || Object(keyboard_["keycode"])(e.nativeEvent) !== 'tab') { + return; + } + + var scrollAdjust = _this.headTableEl.scrollLeft; + + if (scrollAdjust !== 0) { + _this.headTableEl.scrollLeft = 0; + _this.tableContainer.scrollLeft += scrollAdjust; + } + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "handleAutosizeColumn", function (e, _ref3) { + var _this$tableContainer, _this$props$onRequest, _this$props2, _wrapper$parentNode; + + var index = _ref3.index, + columnId = _ref3.columnId; + var document = Object(ssrDocument["a" /* getDocument */])(); + + if (index === undefined) { + return; + } + + var offset = _this.props.rowExpansion === 'none' ? 1 : 2; + var cells = (_this$tableContainer = _this.tableContainer) === null || _this$tableContainer === void 0 ? void 0 : _this$tableContainer.querySelectorAll("thead th:nth-child(".concat(index + offset, "), tbody td:nth-child(").concat(index + offset, ")")); + var wrapper = document.createElement('div'); // TODO: find a styled-components compliant way to do this + + wrapper.style["float"] = 'left'; + wrapper.style.position = 'fixed'; + wrapper.style.top = '-100'; + wrapper.style.left = '0'; + wrapper.style.maxHeight = '10px'; + wrapper.style.overflow = 'hidden'; + forEach_default()(cells, function (cell) { + var clone = cell.cloneNode(true); // TS: this seems safe to assume? + + clone.style.display = 'block'; + clone.style.width = 'auto'; + wrapper.appendChild(clone); + }); + document.body.appendChild(wrapper); + (_this$props$onRequest = (_this$props2 = _this.props).onRequestResizeColumn) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props2, e, { + index: index, + columnId: columnId, + width: wrapper.clientWidth + 1 + }); + (_wrapper$parentNode = wrapper.parentNode) === null || _wrapper$parentNode === void 0 ? void 0 : _wrapper$parentNode.removeChild(wrapper); + }); + + Table_defineProperty(Table_assertThisInitialized(_this), "updateDragPosition", throttle_default()(_this.updateDragPositionImpl, 100, { + trailing: false + })); + + _this.state = { + dragPosition: undefined + }; + + if (false) {} + + return _this; + } + + Table_createClass(Table, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var head = this.head, + headTable = this.headTable; + + if (head && headTable) { + var cellWidths = head.getCellWidths(); + + if (!isEqual_default()(this.state.cellWidths, cellWidths)) { + this.updateDockedHeadState(); + } + } + + if (prevProps.headType === 'inline' && this.props.headType !== 'inline') { + this.updateDockedHeadState(); + } + + if (false) {} + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this.updateDockedHeadState(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.handleScroll.cancel(); + this.handleResize.cancel(); + this.cleanupDrag(); + } + }, { + key: "createHead", + value: function createHead(base) { + var _this$props3 = this.props, + actions = _this$props3.actions, + actionsColumnWidth = _this$props3.actionsColumnWidth, + onRequestMoveColumn = _this$props3.onRequestMoveColumn, + onRequestMoveRow = _this$props3.onRequestMoveRow, + onRequestResizeColumn = _this$props3.onRequestResizeColumn, + onRequestToggleAllRows = _this$props3.onRequestToggleAllRows, + rowExpansion = _this$props3.rowExpansion, + rowSelection = _this$props3.rowSelection; + var dragIndex = this.state.dragIndex; + var headCells = external_react_["Children"].toArray(base.props.children).filter(external_react_["isValidElement"]); + var validActions = actions.filter(external_react_["isValidElement"]); + var newHead = /*#__PURE__*/Object(external_react_["cloneElement"])(base, { + actions: validActions, + actionsColumnWidth: actionsColumnWidth, + dragIndex: dragIndex, + dragPosition: this.state.dragPosition, + hasInfoColumn: rowExpansion !== 'none', + hasDragColumn: !!onRequestMoveRow, + onAutosizeColumn: this.handleAutosizeColumn, + onDragStart: onRequestMoveColumn ? this.handleDragStart : undefined, + onRequestMoveColumn: onRequestMoveColumn, + onRequestResizeColumn: onRequestResizeColumn, + onRequestToggleAllRows: onRequestToggleAllRows, + ref: this.handleHeadMount, + rowSelection: rowSelection + }, headCells); + return newHead; + } + }, { + key: "createBody", + value: function createBody(base) { + var actions = this.props.actions; + var validActions = actions.filter(external_react_["isValidElement"]); + return /*#__PURE__*/Object(external_react_["cloneElement"])(base, { + actions: validActions.length > 0, + movableColumns: !!this.props.onRequestMoveColumn, + onRequestMoveRow: this.props.onRequestMoveRow, + primaryColumnIndex: this.props.primaryColumnIndex, + rowExpansion: this.props.rowExpansion, + stripeRows: this.props.stripeRows + }); + } + }, { + key: "isInline", + value: function isInline() { + return this.props.headType === 'inline'; + } + }, { + key: "headerIsDocked", + value: function headerIsDocked() { + return this.props.headType === 'docked'; + } + }, { + key: "isFixed", + value: function isFixed() { + return this.props.headType === 'fixed'; + } + }, { + key: "showDockedHeader", + value: function showDockedHeader() { + var window = Object(ssrWindow["a" /* getWindow */])(); + + if (!this.headerIsDocked() || !this.table || !this.head || !this.tableContainer) { + return false; + } + + var dockOffset = this.props.dockOffset; + var tableTop = Table.getOffset(this.tableContainer).top; + return window.pageYOffset >= tableTop - dockOffset; + } + }, { + key: "showDockedScrollBar", + value: function showDockedScrollBar() { + var window = Object(ssrWindow["a" /* getWindow */])(); + + if (!this.props.dockScrollBar || !this.table || !this.tableContainer) { + return false; + } + + var rect = this.tableContainer.getBoundingClientRect(); + return rect.bottom > window.innerHeight && rect.top < window.innerHeight; + } + }, { + key: "updateDragPositionImpl", + value: function updateDragPositionImpl(dragPosition) { + this.setState({ + dragPosition: dragPosition + }); + } + }, { + key: "cleanupDrag", + value: function cleanupDrag() { + var window = Object(ssrWindow["a" /* getWindow */])(); + window.removeEventListener('dragenter', this.handleDragEnter); + window.removeEventListener('dragover', this.handleDragOver); + window.removeEventListener('drop', this.handleDrop); + window.removeEventListener('dragend', this.handleDragEnd); + this.updateDragPosition.cancel(); // cancel throttle + } + }, { + key: "renderHeadTable", + value: function renderHeadTable(tHead, isFixedColumn) { + if (this.showDockedHeader()) { + // FIXME: handle inline + // Save the current head focus state so that it can be applied to the docked version + // after the `HeadTable` mounts. + this.headFocusState = Table.getHeadFocusState(this.head); + var _this$state = this.state, + cellWidths = _this$state.cellWidths, + dragIndex = _this$state.dragIndex, + horizontalOffset = _this$state.horizontalOffset, + tableWidth = _this$state.tableWidth, + top = _this$state.top, + width = _this$state.width; + + if (cellWidths === undefined || tableWidth === undefined || top === undefined || width === undefined) { + return false; + } + + return /*#__PURE__*/external_react_default.a.createElement(Table_HeadTable, { + headType: "docked", + tHead: tHead, + cellWidths: cellWidths, + dragIndex: dragIndex, + horizontalOffset: horizontalOffset, + tableWidth: tableWidth, + top: top, + width: width, + tableStyle: this.props.tableStyle, + isFixedColumn: isFixedColumn, + ref: this.handleHeadTableMount, + onKeyUp: this.handleHeadTableKeyUp, + elementRef: this.handleHeadTableElementMount, + hasDragColumn: !!this.props.onRequestMoveRow, + hasRowExpansion: this.props.rowExpansion !== 'none', + hasRowSelection: !!this.props.onRequestToggleAllRows + }); + } + + return false; + } + }, { + key: "renderDockedScrollbar", + value: function renderDockedScrollbar() { + var _this2 = this; + + var window = Object(ssrWindow["a" /* getWindow */])(); + + if (!this.showDockedScrollBar()) { + return false; + } + + var shiftPosition = 0; + + if (this.dockedScrollBar && this.head && this.table && this.head) { + var _this$head$getEl$offs, _this$head$getEl; + + var availableSpace = window.innerHeight - this.table.getBoundingClientRect().top - ((_this$head$getEl$offs = (_this$head$getEl = this.head.getEl()) === null || _this$head$getEl === void 0 ? void 0 : _this$head$getEl.offsetHeight) !== null && _this$head$getEl$offs !== void 0 ? _this$head$getEl$offs : 0); + shiftPosition = Math.min(availableSpace - this.dockedScrollBar.offsetHeight, 0); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledDockedScrollbar, { + style: { + width: this.state.width, + marginBottom: shiftPosition + }, + onScroll: this.handleDockedScrollBarScroll, + "data-test": "docked-scroll-bar", + ref: function ref(el) { + _this2.dockedScrollBar = el; + } + }, /*#__PURE__*/external_react_default.a.createElement(StyledDockedScrollbarContent, { + style: { + width: this.state.tableWidth + }, + "data-test": "docked-scroll-content" + })); + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$props4 = this.props, + children = _this$props4.children, + elementRef = _this$props4.elementRef, + headType = _this$props4.headType, + innerStyle = _this$props4.innerStyle, + onRequestResizeColumn = _this$props4.onRequestResizeColumn, + onRequestToggleAllRows = _this$props4.onRequestToggleAllRows, + outerStyle = _this$props4.outerStyle, + resizableFillLayout = _this$props4.resizableFillLayout, + rowSelection = _this$props4.rowSelection, + tableStyle = _this$props4.tableStyle; + var tHead; + var tBody; + var tCaption; + var isFixedColumn = !!onRequestResizeColumn; + external_react_["Children"].toArray(children).forEach(function (child) { + var splunkUiType = child.type.splunkUiType; + + if (splunkUiType === 'Table.Head') { + tHead = _this3.createHead(child); + + if (!isFixedColumn) { + // if all the HeadCells are fixed width, then the table is fixed. + isFixedColumn = !external_react_["Children"].toArray(child.props.children).filter(external_react_["isValidElement"]).some(function (th) { + return !has_default()(th.props, 'width'); + }); + } + } else if (splunkUiType === 'Table.Body') { + tBody = _this3.createBody(child); + } else if (splunkUiType === 'Table.Caption') { + // the html spec mandates that a caption must be the first table child. + // catch the caption here so that it can be placed first later. note: a + // caption can be placed on the bottom side of a table by adjusting the + // caption's side prop. + tCaption = child; + } + }); + Object(types["a" /* assertDefined */])(tHead, 'A Table.Head is required.'); + var headTable = this.renderHeadTable(tHead, isFixedColumn); // When a `headTable` is used, suppress focus interactions in the primary `Head`. Focus + // interactions will be handled by the overlaid `headTable` instead. + + var headCells = external_react_["Children"].toArray(tHead.props.children).filter(external_react_["isValidElement"]).map(function (cell) { + return ( + /*#__PURE__*/ + // TS: onClick is different for regular/dropdown head cells, that's ok + Object(external_react_["cloneElement"])(cell, { + visible: !headTable + }) + ); + }); + tHead = /*#__PURE__*/Object(external_react_["cloneElement"])(tHead, {}, headCells); + var defaultScrollContainer = this.context || Object(ssrWindow["a" /* getWindow */])(); + var scrollContainer = this.isFixed() ? this.tableContainer : defaultScrollContainer; + + if (resizableFillLayout) { + isFixedColumn = false; + } + + return /*#__PURE__*/external_react_default.a.createElement(TableStyles_Styled, Table_extends({ + "data-test": "table", + ref: elementRef, + style: outerStyle, + "data-test-row-selection": onRequestToggleAllRows ? rowSelection : undefined + }, omit_default()(this.props, [].concat(Table_toConsumableArray(Object.keys(Table.propTypes)), ['style']))), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: Object(ssrWindow["a" /* getWindow */])(), + eventType: "scroll", + listener: this.handleScroll, + options: { + passive: false, + capture: true + } + }), /*#__PURE__*/external_react_default.a.createElement(external_react_resize_detector_default.a, { + handleWidth: true, + onResize: this.handleResize + }), /*#__PURE__*/external_react_default.a.createElement(Table_TableContext.Provider, { + value: { + headType: headType + } + }, headTable, /*#__PURE__*/external_react_default.a.createElement(StyledTableContainer, { + onScroll: this.handleContainerScroll, + ref: function ref(el) { + _this3.tableContainer = el; + }, + style: innerStyle + }, /*#__PURE__*/external_react_default.a.createElement(ScrollContainerContext_["ScrollContainerProvider"], { + value: scrollContainer + }, /*#__PURE__*/external_react_default.a.createElement(StyledTable, { + ref: function ref(el) { + _this3.table = el; + }, + "data-test": "main-table", + style: tableStyle, + "data-fixed-column": isFixedColumn ? 'true' : undefined, + $resizableFillLayout: resizableFillLayout + }, tCaption, tHead, tBody))), this.renderDockedScrollbar())); + } + }]); + + return Table; +}(external_react_["Component"]); + +Table_defineProperty(Table_Table, "propTypes", Table_propTypes); + +Table_defineProperty(Table_Table, "contextType", ScrollContainerContext_["ScrollContainerContext"]); + +Table_defineProperty(Table_Table, "defaultProps", Table_defaultProps); + +Table_defineProperty(Table_Table, "Caption", Table_Caption); + +Table_defineProperty(Table_Table, "Head", Table_Head); + +Table_defineProperty(Table_Table, "HeadCell", Table_HeadCell); + +Table_defineProperty(Table_Table, "HeadDropdownCell", Table_HeadDropdownCell); + +Table_defineProperty(Table_Table, "Body", Table_Body); + +Table_defineProperty(Table_Table, "Row", Table_Row); + +Table_defineProperty(Table_Table, "Cell", Table_Cell); + +/* harmony default export */ var src_Table_Table = (Table_Table); + +// CONCATENATED MODULE: ./src/Table/index.ts + + + +/***/ }) +/******/ ]); + +/***/ }), + +/***/ 25338: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 194); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 104: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(37801); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4082__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_4082__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 164: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(60671); + +/***/ }), + +/***/ 17: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), + +/***/ 194: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5290__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_5290__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_5290__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Text_Text; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_5290__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_5290__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_5290__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_5290__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_5290__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_5290__.n(has_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_5290__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_5290__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_5290__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_5290__.n(omit_); + +// EXTERNAL MODULE: external "lodash/pickBy" +var pickBy_ = __nested_webpack_require_5290__(61); +var pickBy_default = /*#__PURE__*/__nested_webpack_require_5290__.n(pickBy_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ControlGroup" +var ControlGroup_ = __nested_webpack_require_5290__(104); + +// EXTERNAL MODULE: external "@splunk/react-icons/Cross" +var Cross_ = __nested_webpack_require_5290__(25); +var Cross_default = /*#__PURE__*/__nested_webpack_require_5290__.n(Cross_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close" +var Close_ = __nested_webpack_require_5290__(26); +var Close_default = /*#__PURE__*/__nested_webpack_require_5290__.n(Close_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search" +var Search_ = __nested_webpack_require_5290__(51); +var Search_default = /*#__PURE__*/__nested_webpack_require_5290__.n(Search_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier" +var Magnifier_ = __nested_webpack_require_5290__(46); +var Magnifier_default = /*#__PURE__*/__nested_webpack_require_5290__.n(Magnifier_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_5290__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_5290__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "@splunk/react-ui/TextArea" +var TextArea_ = __nested_webpack_require_5290__(164); +var TextArea_default = /*#__PURE__*/__nested_webpack_require_5290__.n(TextArea_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_5290__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/style" +var style_ = __nested_webpack_require_5290__(37); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_5290__(4); + +// EXTERNAL MODULE: external "@splunk/react-icons/SVGEnterprise" +var SVGEnterprise_ = __nested_webpack_require_5290__(32); +var SVGEnterprise_default = /*#__PURE__*/__nested_webpack_require_5290__.n(SVGEnterprise_); + +// CONCATENATED MODULE: ./src/Text/IconOutlinedHide.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + + + +function IconOutlinedHide(props) { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family, + density = _useSplunkTheme.density; + + if (family === 'enterprise') { + return /*#__PURE__*/external_react_default.a.createElement(SVGEnterprise_default.a, _extends({ + viewBox: "0 0 24 24", + size: 1.2, + screenReaderText: Object(i18n_["_"])('Hide password') + }, props), /*#__PURE__*/external_react_default.a.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M4.00691 3.89287C3.61638 3.50234 2.98322 3.50235 2.5927 3.89287C2.20217 4.2834 2.20217 4.91656 2.5927 5.30708L4.35908 7.07346C3.63043 7.75302 2.99174 8.52671 2.46085 9.37612L1.18794 11.4128C0.963393 11.7721 0.963395 12.2279 1.18794 12.5872L2.46085 14.6239C3.3213 16.0006 4.46494 17.1784 5.81576 18.0789L5.94933 18.1679C7.74121 19.3625 9.8466 20 12.0002 20C13.5116 20 14.9993 19.686 16.3715 19.0858L18.5982 21.3125C18.9887 21.703 19.6218 21.703 20.0124 21.3125C20.4029 20.922 20.4029 20.2888 20.0124 19.8983L4.00691 3.89287ZM14.8257 17.54L13.0353 15.7496C12.7056 15.8405 12.3583 15.889 11.9997 15.889C9.85196 15.889 8.11084 14.1479 8.11084 12.0001C8.11084 11.6415 8.15937 11.2943 8.25022 10.9646L5.77433 8.48871C5.15179 9.06078 4.60729 9.71541 4.15685 10.4361L3.17943 12L4.15685 13.5639C4.86685 14.6999 5.81053 15.6717 6.92516 16.4148L7.05873 16.5038C8.52208 17.4794 10.2415 18 12.0002 18C12.9658 18 13.9196 17.8431 14.8257 17.54Z", + fill: "currentColor" + }), /*#__PURE__*/external_react_default.a.createElement("path", { + d: "M10.9657 8.25019L15.7496 13.0342C15.8402 12.7049 15.8886 12.3581 15.8886 12.0001C15.8886 9.85232 14.1475 8.11121 11.9997 8.11121C11.6417 8.11121 11.2949 8.15959 10.9657 8.25019Z", + fill: "currentColor" + }), /*#__PURE__*/external_react_default.a.createElement("path", { + d: "M19.8435 13.5639C19.3932 14.2844 18.8488 14.939 18.2264 15.5109L19.6417 16.9262C20.3702 16.2467 21.0087 15.4731 21.5395 14.6239L22.8124 12.5872C23.037 12.2279 23.037 11.7721 22.8124 11.4128L21.5395 9.37612C20.6791 7.99942 19.5354 6.82164 18.1846 5.9211L18.051 5.83205C16.2591 4.63746 14.1538 4 12.0002 4C10.489 4 9.00149 4.31389 7.62941 4.91392L9.17525 6.45977C10.0811 6.15687 11.0347 6 12.0002 6C13.7589 6 15.4783 6.52059 16.9416 7.49615L17.0752 7.5852C18.1898 8.32829 19.1335 9.30013 19.8435 10.4361L20.8209 12L19.8435 13.5639Z", + fill: "currentColor" + })); + } + + var size = density === 'compact' ? '20' : '24'; + return /*#__PURE__*/external_react_default.a.createElement("svg", { + width: size, + height: size, + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + style: { + display: 'block' + } + }, /*#__PURE__*/external_react_default.a.createElement("title", null, Object(i18n_["_"])('Hide password')), /*#__PURE__*/external_react_default.a.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M4.00691 3.89287C3.61638 3.50234 2.98322 3.50235 2.5927 3.89287C2.20217 4.2834 2.20217 4.91656 2.5927 5.30708L4.35908 7.07346C3.63043 7.75302 2.99174 8.52671 2.46085 9.37612L1.18794 11.4128C0.963393 11.7721 0.963395 12.2279 1.18794 12.5872L2.46085 14.6239C3.3213 16.0006 4.46494 17.1784 5.81576 18.0789L5.94933 18.1679C7.74121 19.3625 9.8466 20 12.0002 20C13.5116 20 14.9993 19.686 16.3715 19.0858L18.5982 21.3125C18.9887 21.703 19.6218 21.703 20.0124 21.3125C20.4029 20.922 20.4029 20.2888 20.0124 19.8983L4.00691 3.89287ZM14.8257 17.54L13.0353 15.7496C12.7056 15.8405 12.3583 15.889 11.9997 15.889C9.85196 15.889 8.11084 14.1479 8.11084 12.0001C8.11084 11.6415 8.15937 11.2943 8.25022 10.9646L5.77433 8.48871C5.15179 9.06078 4.60729 9.71541 4.15685 10.4361L3.17943 12L4.15685 13.5639C4.86685 14.6999 5.81053 15.6717 6.92516 16.4148L7.05873 16.5038C8.52208 17.4794 10.2415 18 12.0002 18C12.9658 18 13.9196 17.8431 14.8257 17.54Z", + fill: "currentColor" + }), /*#__PURE__*/external_react_default.a.createElement("path", { + d: "M10.9657 8.25019L15.7496 13.0342C15.8402 12.7049 15.8886 12.3581 15.8886 12.0001C15.8886 9.85232 14.1475 8.11121 11.9997 8.11121C11.6417 8.11121 11.2949 8.15959 10.9657 8.25019Z", + fill: "currentColor" + }), /*#__PURE__*/external_react_default.a.createElement("path", { + d: "M19.8435 13.5639C19.3932 14.2844 18.8488 14.939 18.2264 15.5109L19.6417 16.9262C20.3702 16.2467 21.0087 15.4731 21.5395 14.6239L22.8124 12.5872C23.037 12.2279 23.037 11.7721 22.8124 11.4128L21.5395 9.37612C20.6791 7.99942 19.5354 6.82164 18.1846 5.9211L18.051 5.83205C16.2591 4.63746 14.1538 4 12.0002 4C10.489 4 9.00149 4.31389 7.62941 4.91392L9.17525 6.45977C10.0811 6.15687 11.0347 6 12.0002 6C13.7589 6 15.4783 6.52059 16.9416 7.49615L17.0752 7.5852C18.1898 8.32829 19.1335 9.30013 19.8435 10.4361L20.8209 12L19.8435 13.5639Z", + fill: "currentColor" + })); +} + +/* harmony default export */ var Text_IconOutlinedHide = (IconOutlinedHide); +// CONCATENATED MODULE: ./src/Text/IconOutlinedView.tsx +function IconOutlinedView_extends() { IconOutlinedView_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return IconOutlinedView_extends.apply(this, arguments); } + + + + + + +function IconOutlinedView(props) { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family, + density = _useSplunkTheme.density; + + if (family === 'enterprise') { + return /*#__PURE__*/external_react_default.a.createElement(SVGEnterprise_default.a, IconOutlinedView_extends({ + viewBox: "0 0 24 24", + size: 1.2, + screenReaderText: Object(i18n_["_"])('View password') + }, props), /*#__PURE__*/external_react_default.a.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M15.7745 11.8654C15.7745 14.0132 14.0334 15.7543 11.8857 15.7543C9.73788 15.7543 7.99677 14.0132 7.99677 11.8654C7.99677 9.71762 9.73788 7.9765 11.8857 7.9765C14.0334 7.9765 15.7745 9.71762 15.7745 11.8654ZM13.7745 11.8654C13.7745 12.9086 12.9289 13.7543 11.8857 13.7543C10.8424 13.7543 9.99677 12.9086 9.99677 11.8654C9.99677 10.8222 10.8424 9.9765 11.8857 9.9765C12.9289 9.9765 13.7745 10.8222 13.7745 11.8654Z", + fill: "currentColor" + }), /*#__PURE__*/external_react_default.a.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M11.8859 3.86536C9.73235 3.86536 7.62695 4.50282 5.83507 5.69741L5.7015 5.78646C4.35068 6.687 3.20704 7.86477 2.3466 9.24148L1.07369 11.2781C0.849136 11.6374 0.849137 12.0933 1.07369 12.4526L2.3466 14.4892C3.20704 15.8659 4.35068 17.0437 5.7015 17.9443L5.83507 18.0333C7.62695 19.2279 9.73235 19.8654 11.8859 19.8654C14.0395 19.8654 16.1449 19.2279 17.9368 18.0333L18.0703 17.9443C19.4212 17.0437 20.5648 15.8659 21.4252 14.4892L22.6982 12.4526C22.9227 12.0933 22.9227 11.6374 22.6982 11.2781L21.4252 9.24148C20.5648 7.86477 19.4212 6.687 18.0703 5.78645L17.9368 5.69741C16.1449 4.50282 14.0395 3.86536 11.8859 3.86536ZM6.94447 7.36151C8.40782 6.38594 10.1272 5.86536 11.8859 5.86536C13.6446 5.86536 15.364 6.38594 16.8274 7.36151L16.9609 7.45056C18.0756 8.19364 19.0193 9.16549 19.7293 10.3015L20.7067 11.8654L19.7293 13.4292C19.0193 14.5652 18.0756 15.5371 16.9609 16.2802L16.8274 16.3692C15.364 17.3448 13.6446 17.8654 11.8859 17.8654C10.1272 17.8654 8.40782 17.3448 6.94447 16.3692L6.8109 16.2802C5.69627 15.5371 4.75259 14.5652 4.04259 13.4292L3.06517 11.8654L4.04259 10.3015C4.75259 9.16549 5.69627 8.19364 6.8109 7.45056L6.94447 7.36151Z", + fill: "currentColor" + })); + } + + var size = density === 'compact' ? '20' : '24'; + return /*#__PURE__*/external_react_default.a.createElement("svg", { + width: size, + height: size, + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + style: { + display: 'block' + } + }, /*#__PURE__*/external_react_default.a.createElement("title", null, Object(i18n_["_"])('View password')), /*#__PURE__*/external_react_default.a.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M15.7745 11.8654C15.7745 14.0132 14.0334 15.7543 11.8857 15.7543C9.73788 15.7543 7.99677 14.0132 7.99677 11.8654C7.99677 9.71762 9.73788 7.9765 11.8857 7.9765C14.0334 7.9765 15.7745 9.71762 15.7745 11.8654ZM13.7745 11.8654C13.7745 12.9086 12.9289 13.7543 11.8857 13.7543C10.8424 13.7543 9.99677 12.9086 9.99677 11.8654C9.99677 10.8222 10.8424 9.9765 11.8857 9.9765C12.9289 9.9765 13.7745 10.8222 13.7745 11.8654Z", + fill: "currentColor" + }), /*#__PURE__*/external_react_default.a.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M11.8859 3.86536C9.73235 3.86536 7.62695 4.50282 5.83507 5.69741L5.7015 5.78646C4.35068 6.687 3.20704 7.86477 2.3466 9.24148L1.07369 11.2781C0.849136 11.6374 0.849137 12.0933 1.07369 12.4526L2.3466 14.4892C3.20704 15.8659 4.35068 17.0437 5.7015 17.9443L5.83507 18.0333C7.62695 19.2279 9.73235 19.8654 11.8859 19.8654C14.0395 19.8654 16.1449 19.2279 17.9368 18.0333L18.0703 17.9443C19.4212 17.0437 20.5648 15.8659 21.4252 14.4892L22.6982 12.4526C22.9227 12.0933 22.9227 11.6374 22.6982 11.2781L21.4252 9.24148C20.5648 7.86477 19.4212 6.687 18.0703 5.78645L17.9368 5.69741C16.1449 4.50282 14.0395 3.86536 11.8859 3.86536ZM6.94447 7.36151C8.40782 6.38594 10.1272 5.86536 11.8859 5.86536C13.6446 5.86536 15.364 6.38594 16.8274 7.36151L16.9609 7.45056C18.0756 8.19364 19.0193 9.16549 19.7293 10.3015L20.7067 11.8654L19.7293 13.4292C19.0193 14.5652 18.0756 15.5371 16.9609 16.2802L16.8274 16.3692C15.364 17.3448 13.6446 17.8654 11.8859 17.8654C10.1272 17.8654 8.40782 17.3448 6.94447 16.3692L6.8109 16.2802C5.69627 15.5371 4.75259 14.5652 4.04259 13.4292L3.06517 11.8654L4.04259 10.3015C4.75259 9.16549 5.69627 8.19364 6.8109 7.45056L6.94447 7.36151Z", + fill: "currentColor" + })); +} + +/* harmony default export */ var Text_IconOutlinedView = (IconOutlinedView); +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_5290__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_5290__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_5290__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_5290__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_5290__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_5290__.n(Button_); + +// CONCATENATED MODULE: ./src/Text/TextStyles.ts + + + + +var disabledStyles = Object(external_styled_components_["css"])(["&,&[type]{cursor:not-allowed;color:", ";&::placeholder{color:", ";}}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].textDisabledColor, + prisma: themes_["variables"].contentColorDisabled +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textDisabledColor, + prisma: themes_["variables"].contentColorDisabled +})); +var buttonStyles = Object(external_styled_components_["css"])(["border-radius:", ";cursor:pointer;font-size:0.83333em;flex-grow:0;", ";&:not([disabled]){color:", ";}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].borderRadius, + prisma: '50%' +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["width:", ";height:", ";"], themes_["variables"].inputHeight, themes_["variables"].inputHeight), + prisma: { + comfortable: Object(external_styled_components_["css"])(["width:26px;min-width:26px;min-height:26px;margin:8px;padding:0;"]), + compact: Object(external_styled_components_["css"])(["width:22px;min-width:22px;min-height:22px;margin:8px;padding:0;"]) + } +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +})); +var StyledClearButton = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "TextStyles__StyledClearButton", + componentId: "eg7n6t-0" +})(["display:none;visibility:hidden;", ""], buttonStyles); +var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "TextStyles__StyledSearchIconWrapper", + componentId: "eg7n6t-1" +})(["", ";color:", ";pointer-events:none;padding:", ";", ""], themes_["mixins"].reset('inline-block'), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +}), Object(themes_["pick"])({ + comfortable: '0 8px', + compact: '0 6px' +}), function (_ref) { + var $disabled = _ref.$disabled; + return $disabled && Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].textDisabledColor), + prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled) + })); +}); +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "TextStyles__StyledBox", + componentId: "eg7n6t-2" +})(["display:flex;justify-content:space-between;flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:", ";}}&:focus-within:not([disabled]){", "{", "}", "{visibility:visible;display:block;}}", ""], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: themes_["variables"].spacingSmall +}), +/* sc-sel */ +StyledSearchIconWrapper, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["display:none;"]) +}), +/* sc-sel */ +StyledClearButton, function (_ref2) { + var $isTimeInput = _ref2.$isTimeInput; + return $isTimeInput && Object(external_styled_components_["css"])(["@media screen and (min--moz-device-pixel-ratio:0){", "{display:none;}}"], + /* sc-sel */ + StyledClearButton); +}); +var StyledInputWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "TextStyles__StyledInputWrapper", + componentId: "eg7n6t-3" +})(["", ";flex-grow:1;min-height:", ";position:relative;overflow:hidden;border:1px solid ", ";border-radius:", ";box-sizing:border-box;background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);padding:", ";align-items:center;", " ", " &:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}", " ", " ", " ", ""], themes_["mixins"].reset('inline-flex'), themes_["variables"].inputHeight, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].gray20 + }, + prisma: themes_["variables"].interactiveColorBorder +}), themes_["variables"].borderRadius, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].white, + dark: themes_["variables"].gray22 + }, + prisma: themes_["variables"].transparent +}), Object(themes_["pick"])({ + enterprise: '0px 10px', + prisma: '0px 12px' +}), function (_ref3) { + var $hasEndAdornment = _ref3.$hasEndAdornment; + return $hasEndAdornment && Object(external_styled_components_["css"])(["padding-right:0;"]); +}, function (_ref4) { + var $hasStartAdornment = _ref4.$hasStartAdornment; + return $hasStartAdornment && Object(external_styled_components_["css"])(["padding-left:0;"]); +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].gray20 + }, + prisma: themes_["variables"].interactiveColorBorderHover +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor), + prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive) +}), function (_ref5) { + var $error = _ref5.$error; + return $error && Object(external_styled_components_["css"])(["&,&:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].errorColor, + prisma: themes_["variables"].accentColorNegative + }), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor), + prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive) + })); +}, function (_ref6) { + var $append = _ref6.$append; + return $append && Object(external_styled_components_["css"])(["margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;"]); +}, function (_ref7) { + var $prepend = _ref7.$prepend; + return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0;border-bottom-left-radius:0;"]); +}, function (_ref8) { + var disabled = _ref8.disabled; + return disabled && Object(external_styled_components_["css"])(["", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);"], Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray96, themes_["variables"].gray92), + dark: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray22, themes_["variables"].gray30) + }, + prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorderDisabled) + })); +}); +/* Some of these need greater specificity than input[type=text] */ + +var StyledInput = external_styled_components_default.a.input.withConfig({ + displayName: "TextStyles__StyledInput", + componentId: "eg7n6t-4" +})(["", ";&,&[type]{outline-style:none;border:0;background:transparent;color:", ";flex-grow:1;font-family:", ";font-size:inherit;line-height:inherit;&[type='time']{&::-webkit-calendar-picker-indicator{display:none;}height:", ";@media screen and (min--moz-device-pixel-ratio:0){padding-right:", ";}}position:relative;&::placeholder{color:", ";opacity:1;}", " ", "}"], themes_["mixins"].reset('inline-flex'), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), themes_["variables"].sansFontFamily, Object(themes_["pick"])({ + enterprise: '20px', + prisma: { + comfortable: '24px', + compact: '20px' + } +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: '14px' +}), themes_["variables"].contentColorMuted, function (_ref9) { + var $error = _ref9.$error; + return $error && Object(external_styled_components_["css"])(["&,&:hover{color:", ";}"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].errorColorD10, + dark: themes_["variables"].errorColorL20 + }, + prisma: themes_["variables"].contentColorActive + })); +}, function (_ref10) { + var disabled = _ref10.disabled; + return disabled && disabledStyles; +}); +var StyledVisibilityToggle = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "TextStyles__StyledVisibilityToggle", + componentId: "eg7n6t-5" +})(["", ""], buttonStyles); +var StyledPlaceholder = external_styled_components_default.a.span.withConfig({ + displayName: "TextStyles__StyledPlaceholder", + componentId: "eg7n6t-6" +})(["pointer-events:none;color:", ";position:absolute;overflow:hidden;font-size:inherit;line-height:inherit;height:", ";margin-right:", ";", ";", ";", ""], Object(themes_["pick"])({ + enterprise: themes_["variables"].textGray, + prisma: themes_["variables"].contentColorMuted +}), themes_["variables"].lineHeight, Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' +}), function (_ref11) { + var $hasStartAdornment = _ref11.$hasStartAdornment, + $startAdornmentWidth = _ref11.$startAdornmentWidth; + return $hasStartAdornment && ($startAdornmentWidth ? Object(external_styled_components_["css"])(["margin-left:", "px;"], $startAdornmentWidth) : Object(external_styled_components_["css"])(["margin-left:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + }))); +}, function (_ref12) { + var $hasEndAdornment = _ref12.$hasEndAdornment, + $endAdornmentWidth = _ref12.$endAdornmentWidth; + return $hasEndAdornment && ($endAdornmentWidth // calc(100% - padding - adorment width) + ? Object(external_styled_components_["css"])(["max-width:calc( 100% - ", " - ", "px );"], Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' + }), $endAdornmentWidth) : Object(external_styled_components_["css"])(["max-width:calc( 100% - ", " - ", " );"], Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' + }), Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + }))); +}, function (_ref13) { + var $hasBothAdornment = _ref13.$hasBothAdornment, + $endAdornmentWidth = _ref13.$endAdornmentWidth, + $startAdornmentWidth = _ref13.$startAdornmentWidth; + return $hasBothAdornment && Object(external_styled_components_["css"])(["max-width:calc(100% - ", "px - ", "px);"], $startAdornmentWidth, $endAdornmentWidth); +}); +var adornmentHolder = Object(external_styled_components_["css"])(["display:inline-flex;align-items:center;justify-content:center;height:", ";pointer-events:none;"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } +})); +var StyledStartAdornmentHolder = external_styled_components_default.a.div.withConfig({ + displayName: "TextStyles__StyledStartAdornmentHolder", + componentId: "eg7n6t-7" +})(["", " ", ";"], adornmentHolder, function (_ref14) { + var $width = _ref14.$width; + return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + })); +}); +var StyledEndAdornmentHolder = external_styled_components_default.a.div.withConfig({ + displayName: "TextStyles__StyledEndAdornmentHolder", + componentId: "eg7n6t-8" +})(["", " ", ";"], adornmentHolder, function (_ref15) { + var $width = _ref15.$width; + return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + })); +}); +var StyledAdornment = external_styled_components_default.a.div.withConfig({ + displayName: "TextStyles__StyledAdornment", + componentId: "eg7n6t-9" +})(["display:inline-flex;align-items:center;justify-content:center;position:absolute;pointer-events:none;z-index:1;height:", ";color:", ";", ";", ";", ""], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +}), function (_ref16) { + var $position = _ref16.$position; + return $position === 'start' ? Object(external_styled_components_["css"])(["top:1px;left:1px;"]) : Object(external_styled_components_["css"])(["top:1px;right:1px;"]); +}, function (_ref17) { + var disabled = _ref17.disabled; + return disabled && disabledStyles; +}, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["margin-left:-1px;margin-right:-1px;"]) +})); + +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_5290__(11); + +// CONCATENATED MODULE: ./src/Text/Text.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function Text_extends() { Text_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Text_extends.apply(this, arguments); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + + + + + + + + +/** @public */ + +var propTypes = { + appearance: external_prop_types_default.a.oneOf(['default', 'search']), + append: external_prop_types_default.a.bool, + autoCapitalize: external_prop_types_default.a.string, + autoComplete: external_prop_types_default.a.string, + autoCorrect: external_prop_types_default.a.string, + autoFocus: external_prop_types_default.a.bool, + canClear: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + + /** @private. */ + classNamePrivate: external_prop_types_default.a.string, + defaultValue: external_prop_types_default.a.string, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + endAdornment: external_prop_types_default.a.node, + error: external_prop_types_default.a.bool, + inline: external_prop_types_default.a.bool, + + /** @private. */ + inputClassName: external_prop_types_default.a.string, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + labelledBy: external_prop_types_default.a.string, + maxLength: external_prop_types_default.a.number, + multiline: external_prop_types_default.a.bool, + name: external_prop_types_default.a.string, + onBlur: external_prop_types_default.a.func, + onChange: external_prop_types_default.a.func, + onFocus: external_prop_types_default.a.func, + onKeyDown: external_prop_types_default.a.func, + onSelect: external_prop_types_default.a.func, + onInputClick: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + prepend: external_prop_types_default.a.bool, + + /** @private. */ + required: external_prop_types_default.a.bool, + rowsMax: external_prop_types_default.a.number, + rowsMin: external_prop_types_default.a.number, + spellCheck: external_prop_types_default.a.bool, + tabIndex: external_prop_types_default.a.number, + startAdornment: external_prop_types_default.a.node, + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + type: external_prop_types_default.a.string, + passwordVisibilityToggle: external_prop_types_default.a.bool, + useSyntheticPlaceholder: external_prop_types_default.a.bool, + value: external_prop_types_default.a.string +}; +var defaultProps = { + appearance: 'default', + append: false, + autoFocus: false, + canClear: false, + disabled: false, + error: false, + inline: false, + multiline: false, + placeholder: '', + prepend: false, + rowsMax: 8, + rowsMin: 2, + tabIndex: 0, + type: 'text', + passwordVisibilityToggle: false +}; + +/** Note: Text places role and aria props onto the input. All other props are placed on the wrapper. */ +var Text_Text = /*#__PURE__*/function (_Component) { + _inherits(Text, _Component); + + var _super = _createSuper(Text); + + _createClass(Text, null, [{ + key: "validateRows", + // @docs-props-type TextPropsBase + value: function validateRows(_ref) { + var rowsMin = _ref.rowsMin, + rowsMax = _ref.rowsMax; + + if (false) {} + } + }]); + + function Text(props) { + var _this; + + _classCallCheck(this, Text); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "input", null); + + _defineProperty(_assertThisInitialized(_this), "startAdornment", null); + + _defineProperty(_assertThisInitialized(_this), "endAdornment", null); + + _defineProperty(_assertThisInitialized(_this), "getAdornmentWidth", function () { + var startIconRect = _this.startAdornment ? _this.startAdornment.getBoundingClientRect() : undefined; + var startIconWidth = startIconRect && Math.round(startIconRect.width); + + if (_this.state.startAdornmentWidth !== startIconWidth) { + _this.setState({ + startAdornmentWidth: startIconWidth + }); + } + + var endIconRect = _this.endAdornment ? _this.endAdornment.getBoundingClientRect() : undefined; + var endIconWidth = endIconRect && Math.round(endIconRect.width); + + if (_this.state.endAdornmentWidth !== endIconWidth) { + _this.setState({ + endAdornmentWidth: endIconWidth + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) { + _this.input = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.inputRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e) { + var _this$props$onChange, _this$props; + + var value = e.target.value; + var name = _this.props.name; + + if (!_this.isControlled()) { + _this.setState({ + value: value + }); + } + + (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, { + value: value, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputKeyDown", function (e) { + var _this$props$onKeyDown, _this$props2; + + (_this$props$onKeyDown = (_this$props2 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props2, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputSelect", function (e) { + var _this$props$onSelect, _this$props3; + + (_this$props$onSelect = (_this$props3 = _this.props).onSelect) === null || _this$props$onSelect === void 0 ? void 0 : _this$props$onSelect.call(_this$props3, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputClick", function (e) { + var _this$props$onInputCl, _this$props4; + + (_this$props$onInputCl = (_this$props4 = _this.props).onInputClick) === null || _this$props$onInputCl === void 0 ? void 0 : _this$props$onInputCl.call(_this$props4, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputFocus", function (e) { + var _this$props$onFocus, _this$props5; + + (_this$props$onFocus = (_this$props5 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props5, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (e) { + var _this$props$onBlur, _this$props6; + + (_this$props$onBlur = (_this$props6 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props6, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleClear", function (e) { + var _this$props$onChange2, _this$props7; + + e.preventDefault(); + var value = ''; + var name = _this.props.name; + + if (!_this.isControlled()) { + _this.setState({ + value: value + }); + } + + (_this$props$onChange2 = (_this$props7 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props7, e, { + value: value, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleVisibilityToggle", function () { + _this.setState(function (state) { + return { + hideVisibility: !state.hideVisibility + }; + }); + }); + + _defineProperty(_assertThisInitialized(_this), "renderEndAdornment", function () { + var _controlGroupContext$; + + var _this$props8 = _this.props, + appearance = _this$props8.appearance, + endAdornment = _this$props8.endAdornment, + passwordVisibilityToggle = _this$props8.passwordVisibilityToggle, + disabled = _this$props8.disabled, + canClear = _this$props8.canClear, + splunkTheme = _this$props8.splunkTheme; + var isPrisma = splunkTheme.isPrisma, + isCompact = splunkTheme.isCompact, + isEnterprise = splunkTheme.isEnterprise; + var prismaSize = isCompact ? '20px' : '24px'; + var adornmentProps = { + ref: function ref(el) { + _this.endAdornment = el; + }, + disabled: disabled, + $position: 'end' + }; + + if (endAdornment) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, endAdornment); + } + + if (passwordVisibilityToggle && !disabled) { + var eyeIcon = _this.state.hideVisibility ? /*#__PURE__*/external_react_default.a.createElement(Text_IconOutlinedView, null) : /*#__PURE__*/external_react_default.a.createElement(Text_IconOutlinedHide, null); + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledVisibilityToggle, { + appearance: isPrisma ? 'secondary' : 'pill', + "data-test": "password-toggle", + inline: false, + onClick: _this.handleVisibilityToggle, + type: "button", + icon: eyeIcon + })); + } + + var controlGroupContext = _this.context; + var controlGroupLabel = (_controlGroupContext$ = controlGroupContext.labelAttrs) === null || _controlGroupContext$ === void 0 ? void 0 : _controlGroupContext$.text; + var clearButtonText = controlGroupLabel ? Object(i18n_["_"])("Clear ".concat(controlGroupLabel, " text field")) : Object(i18n_["_"])('Clear text field'); + + var displayValue = _this.getDisplayValue(); + + if (!isPrisma && appearance === 'search') { + if (!displayValue) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, { + $disabled: disabled + }, /*#__PURE__*/external_react_default.a.createElement(Search_default.a, { + screenReaderText: null, + hideDefaultTooltip: true, + size: "16px", + inline: false + }))); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, !disabled && /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, { + appearance: isPrisma ? 'secondary' : 'pill', + "data-test": "clear", + inline: false, + icon: isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + size: 1, + screenReaderText: clearButtonText + }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + "aria-label": clearButtonText + }), + onClick: _this.handleClear + }), /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, { + $disabled: disabled + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, { + screenReaderText: null, + hideDefaultTooltip: true, + size: "16px", + inline: false + }) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, { + width: prismaSize, + height: prismaSize + }))); + } + + if (!!displayValue && (isPrisma && appearance === 'search' || canClear)) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, !disabled && /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, { + "data-test": "clear", + appearance: isPrisma ? 'secondary' : 'pill', + onClick: _this.handleClear, + icon: isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + inline: false, + screenReaderText: clearButtonText + }) : /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + "aria-label": clearButtonText, + height: prismaSize, + inline: false, + width: prismaSize + }) + })); + } + + return undefined; + }); + + _defineProperty(_assertThisInitialized(_this), "renderStartAdornment", function () { + var _this$props9 = _this.props, + appearance = _this$props9.appearance, + startAdornment = _this$props9.startAdornment, + splunkTheme = _this$props9.splunkTheme, + disabled = _this$props9.disabled; + var isPrisma = splunkTheme.isPrisma, + isCompact = splunkTheme.isCompact; + var prismaSize = isCompact ? '20px' : '24px'; + var adornmentProps = { + ref: function ref(el) { + _this.startAdornment = el; + }, + disabled: disabled, + $position: 'start' + }; + + if (startAdornment) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, startAdornment); + } + + if (isPrisma && appearance === 'search') { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, { + $disabled: disabled + }, /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, { + "aria-label": "Search", + height: prismaSize, + width: prismaSize + }))); + } + + return undefined; + }); + + _defineProperty(_assertThisInitialized(_this), "getDisplayValue", function () { + var displayValue = _this.isControlled() ? _this.props.value : _this.state.value; + return displayValue; + }); + + _this.controlledExternally = has_default()(props, 'value'); + _this.state = { + value: props.defaultValue || '', + hideVisibility: true + }; + + if (false) {} + + if (false) {} + + if (has_default()(props, 'useSyntheticPlaceholder')) { + // eslint-disable-next-line no-console + console.warn("The 'Text' prop 'useSyntheticPlaceholder' has been marked for deprecation."); + } + + if (false) {} + + if (false) {} + + Text.validateRows(props); + return _this; + } + + _createClass(Text, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.getAdornmentWidth(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (false) {} + + if (false) {} + + Text.validateRows(this.props); + this.getAdornmentWidth(); + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "blur", + value: function blur() { + var _this$input; + + (_this$input = this.input) === null || _this$input === void 0 ? void 0 : _this$input.blur(); + } + /** + * Place focus on the input. + */ + + }, { + key: "focus", + value: function focus(options) { + var _this$input2; + + (_this$input2 = this.input) === null || _this$input2 === void 0 ? void 0 : _this$input2.focus(options); + } + }, { + key: "select", + value: function select() { + var _this$input3; + + (_this$input3 = this.input) === null || _this$input3 === void 0 ? void 0 : _this$input3.select(); + } + }, { + key: "render", + value: function render() { + var _this$props10 = this.props, + append = _this$props10.append, + autoCapitalize = _this$props10.autoCapitalize, + autoComplete = _this$props10.autoComplete, + autoCorrect = _this$props10.autoCorrect, + autoFocus = _this$props10.autoFocus, + children = _this$props10.children, + className = _this$props10.className, + classNamePrivate = _this$props10.classNamePrivate, + disabled = _this$props10.disabled, + describedBy = _this$props10.describedBy, + elementRef = _this$props10.elementRef, + error = _this$props10.error, + inline = _this$props10.inline, + inputClassName = _this$props10.inputClassName, + inputId = _this$props10.inputId, + labelledBy = _this$props10.labelledBy, + multiline = _this$props10.multiline, + maxLength = _this$props10.maxLength, + name = _this$props10.name, + passwordVisibilityToggle = _this$props10.passwordVisibilityToggle, + placeholder = _this$props10.placeholder, + prepend = _this$props10.prepend, + required = _this$props10.required, + spellCheck = _this$props10.spellCheck, + tabIndex = _this$props10.tabIndex, + title = _this$props10.title, + type = _this$props10.type, + useSyntheticPlaceholder = _this$props10.useSyntheticPlaceholder, + otherProps = _objectWithoutProperties(_this$props10, ["append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "multiline", "maxLength", "name", "passwordVisibilityToggle", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title", "type", "useSyntheticPlaceholder"]); + + var ariaProps = _objectSpread(_objectSpread({ + role: 'textbox' + }, pickBy_default()(otherProps, function (val, key) { + return key === 'role' || key.indexOf('aria-') === 0; + })), {}, { + 'aria-describedby': describedBy, + 'aria-labelledby': labelledBy, + 'aria-invalid': error || undefined + }); + + var boxProps = omit_default()(otherProps, ['inputRef', 'onBlur', 'onChange', 'onFocus', 'onKeyDown', 'onSelect', 'onInputClick', 'rowsMax', 'rowsMin'].concat(_toConsumableArray(keys_default()(ariaProps)))); + var displayValue = this.getDisplayValue(); + var displayProps = { + className: Object(style_["toClassName"])(className, inputClassName), + $append: append || undefined, + $error: error, + $prepend: prepend || undefined + }; + var passwordVisibility = this.state.hideVisibility ? 'password' : 'text'; + var computedType = passwordVisibilityToggle ? passwordVisibility : type; + + var inputProps = _objectSpread(_objectSpread({}, ariaProps), {}, { + 'data-test': 'textbox', + autoCapitalize: autoCapitalize, + autoComplete: autoComplete, + autoCorrect: autoCorrect, + autoFocus: autoFocus, + id: inputId, + maxLength: maxLength, + placeholder: placeholder && !useSyntheticPlaceholder ? placeholder : undefined, + name: name, + onChange: this.handleInputChange, + onKeyDown: this.handleInputKeyDown, + onSelect: this.handleInputSelect, + onClick: this.handleInputClick, + onFocus: this.handleInputFocus, + onBlur: this.handleInputBlur, + ref: this.handleInputMount, + required: required, + spellCheck: spellCheck, + style: { + height: this.state.height + }, + title: title, + tabIndex: tabIndex, + type: computedType, + value: displayValue, + $error: error + }); + + var haveSyntheticPlaceholder = useSyntheticPlaceholder && placeholder && !displayValue; // Do not render value in DOM when type is password, or passwordVisibilityToggle is enabled + + var dataTestValue = type === 'password' || passwordVisibilityToggle ? undefined : displayValue; // Firefox hack (SUI-2716). Remove when fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1427173 + + var isTimeInput = type === 'time'; + var hasEndAdornment = !!this.renderEndAdornment(); + var hasStartAdornment = !!this.renderStartAdornment(); + + if (multiline) { + return /*#__PURE__*/external_react_default.a.createElement(TextArea_default.a, this.props); + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, Text_extends({ + tabIndex: -1, + $isTimeInput: isTimeInput, + className: Object(style_["toClassName"])(className, classNamePrivate), + "data-test": "text", + "data-test-value": dataTestValue, + elementRef: elementRef, + flex: true, + inline: inline + }, boxProps), this.renderStartAdornment(), /*#__PURE__*/external_react_default.a.createElement(StyledInputWrapper, Text_extends({ + $hasEndAdornment: hasEndAdornment, + $hasStartAdornment: hasStartAdornment, + disabled: disabled + }, displayProps), hasStartAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledStartAdornmentHolder, { + $width: this.state.startAdornmentWidth + }), disabled ? /*#__PURE__*/external_react_default.a.createElement(StyledInput, Text_extends({ + className: Object(style_["toClassName"])(className, classNamePrivate), + "data-test": "textbox", + disabled: true, + readOnly: true, + type: computedType, + value: displayValue, + placeholder: placeholder && !useSyntheticPlaceholder ? placeholder : undefined + }, ariaProps)) : /*#__PURE__*/external_react_default.a.createElement(StyledInput, Text_extends({}, inputProps, { + onClick: this.handleInputClick + })), haveSyntheticPlaceholder && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, placeholder), haveSyntheticPlaceholder && /*#__PURE__*/external_react_default.a.createElement(StyledPlaceholder, { + $endAdornmentWidth: this.state.endAdornmentWidth, + $hasBothAdornment: hasStartAdornment && hasEndAdornment // used to calculate the max-width + , + $hasEndAdornment: hasEndAdornment, + $hasStartAdornment: hasStartAdornment, + $startAdornmentWidth: this.state.startAdornmentWidth, + "aria-hidden": true, + "data-role": "placeholder" + }, placeholder), children, hasEndAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledEndAdornmentHolder, { + $width: this.state.endAdornmentWidth + })), this.renderEndAdornment()); + } + }]); + + return Text; +}(external_react_["Component"]); + +_defineProperty(Text_Text, "propTypes", propTypes); + +_defineProperty(Text_Text, "defaultProps", defaultProps); + +_defineProperty(Text_Text, "componentType", 'Text'); + +_defineProperty(Text_Text, "contextType", ControlGroup_["ControlGroupContext"]); + +var TextWithThemeBase = Object(themes_["withSplunkTheme"])(Text_Text); +var TextWithTheme = TextWithThemeBase; +TextWithTheme.propTypes = Text_Text.propTypes; +TextWithTheme.componentType = Text_Text.componentType; +/* harmony default export */ var src_Text_Text = (TextWithTheme); +// CONCATENATED MODULE: ./src/Text/index.ts + + + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 25: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54719); + +/***/ }), + +/***/ 26: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68787); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 32: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(19838); + +/***/ }), + +/***/ 37: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(83778); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 46: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(80935); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 51: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(75795); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 61: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(71086); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 60671: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 208); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 104: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(37801); + +/***/ }), + +/***/ 11: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4082__) { + +"use strict"; +/* harmony export (binding) */ __nested_webpack_require_4082__.d(__nested_webpack_exports__, "a", function() { return updateReactRef; }); +/** + * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported. + * + * @param ref - The React callback or object ref. Can be `null` or `undefined`. + * @param current - The new value of the ref. + */ +function updateReactRef(ref, current) { + if (ref) { + if (typeof ref === 'function') { + ref(current); + } else { + // the public signature of this util uses React.Ref to mirror the way React types refs. + // the intention here is to signal "we will take care of setting 'current', not you". + ref.current = current; // eslint-disable-line no-param-reassign + } + } +} + + + +/***/ }), + +/***/ 16: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68973); + +/***/ }), + +/***/ 165: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(63950); + +/***/ }), + +/***/ 17: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(70181); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 208: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_5362__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_5362__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_5362__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_TextArea_TextArea; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_5362__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_5362__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_5362__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_5362__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/defer" +var defer_ = __nested_webpack_require_5362__(55); +var defer_default = /*#__PURE__*/__nested_webpack_require_5362__.n(defer_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_5362__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_5362__.n(has_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_5362__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_5362__.n(keys_); + +// EXTERNAL MODULE: external "lodash/noop" +var noop_ = __nested_webpack_require_5362__(165); +var noop_default = /*#__PURE__*/__nested_webpack_require_5362__.n(noop_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_5362__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_5362__.n(omit_); + +// EXTERNAL MODULE: external "lodash/pickBy" +var pickBy_ = __nested_webpack_require_5362__(61); +var pickBy_default = /*#__PURE__*/__nested_webpack_require_5362__.n(pickBy_); + +// EXTERNAL MODULE: external "lodash/throttle" +var throttle_ = __nested_webpack_require_5362__(31); +var throttle_default = /*#__PURE__*/__nested_webpack_require_5362__.n(throttle_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ControlGroup" +var ControlGroup_ = __nested_webpack_require_5362__(104); + +// EXTERNAL MODULE: external "@splunk/react-icons/Cross" +var Cross_ = __nested_webpack_require_5362__(25); +var Cross_default = /*#__PURE__*/__nested_webpack_require_5362__.n(Cross_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close" +var Close_ = __nested_webpack_require_5362__(26); +var Close_default = /*#__PURE__*/__nested_webpack_require_5362__.n(Close_); + +// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search" +var Search_ = __nested_webpack_require_5362__(51); +var Search_default = /*#__PURE__*/__nested_webpack_require_5362__.n(Search_); + +// EXTERNAL MODULE: external "@splunk/react-ui/EventListener" +var EventListener_ = __nested_webpack_require_5362__(16); +var EventListener_default = /*#__PURE__*/__nested_webpack_require_5362__.n(EventListener_); + +// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier" +var Magnifier_ = __nested_webpack_require_5362__(46); +var Magnifier_default = /*#__PURE__*/__nested_webpack_require_5362__.n(Magnifier_); + +// EXTERNAL MODULE: external "@splunk/ui-utils/style" +var style_ = __nested_webpack_require_5362__(37); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_5362__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_5362__(4); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_5362__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_5362__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Box" +var Box_ = __nested_webpack_require_5362__(6); +var Box_default = /*#__PURE__*/__nested_webpack_require_5362__.n(Box_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Button" +var Button_ = __nested_webpack_require_5362__(17); +var Button_default = /*#__PURE__*/__nested_webpack_require_5362__.n(Button_); + +// CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts + + + + +var disabledStyles = Object(external_styled_components_["css"])(["cursor:not-allowed;color:", ";&::placeholder{color:", ";}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].textDisabledColor, + prisma: themes_["variables"].contentColorDisabled +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].textDisabledColor, + prisma: themes_["variables"].contentColorDisabled +})); +var buttonStyles = Object(external_styled_components_["css"])(["border-radius:", ";cursor:pointer;font-size:0.83333em;flex-grow:0;", ";&:not([disabled]){color:", ";}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].borderRadius, + prisma: '50%' +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["width:", ";height:", ";"], themes_["variables"].inputHeight, themes_["variables"].inputHeight), + prisma: { + comfortable: Object(external_styled_components_["css"])(["width:26px;min-width:26px;min-height:26px;margin:8px;padding:0;"]), + compact: Object(external_styled_components_["css"])(["width:22px;min-width:22px;min-height:22px;margin:8px;padding:0;"]) + } +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +})); +var StyledClearButton = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "TextAreaStyles__StyledClearButton", + componentId: "gfy8yp-0" +})(["display:none;visibility:hidden;", ""], buttonStyles); +var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "TextAreaStyles__StyledSearchIconWrapper", + componentId: "gfy8yp-1" +})(["", ";color:", ";pointer-events:none;padding:", ";", ""], themes_["mixins"].reset('inline-block'), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +}), Object(themes_["pick"])({ + comfortable: '0 8px', + compact: '0 6px' +}), function (_ref) { + var $disabled = _ref.$disabled; + return $disabled && Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].textDisabledColor), + prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled) + })); +}); +var StyledBox = external_styled_components_default()(Box_default.a).withConfig({ + displayName: "TextAreaStyles__StyledBox", + componentId: "gfy8yp-2" +})(["display:flex;justify-content:space-between;flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:", ";}}&:focus-within:not([disabled]){", "{", "}", "{visibility:visible;display:block;}}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: themes_["variables"].spacingSmall +}), +/* sc-sel */ +StyledSearchIconWrapper, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["display:none;"]) +}), +/* sc-sel */ +StyledClearButton); +var StyledTextAreaWrapper = external_styled_components_default.a.span.withConfig({ + displayName: "TextAreaStyles__StyledTextAreaWrapper", + componentId: "gfy8yp-3" +})(["", " flex-grow:1;min-height:", ";position:relative;overflow:hidden;border:1px solid ", ";border-radius:", ";box-sizing:border-box;background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);padding:", ";", " ", " &:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}", " ", " ", " ", ""], themes_["mixins"].reset('inline-flex'), themes_["variables"].inputHeight, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].gray20 + }, + prisma: themes_["variables"].interactiveColorBorder +}), themes_["variables"].borderRadius, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].white, + dark: themes_["variables"].gray22 + }, + prisma: themes_["variables"].transparent +}), Object(themes_["pick"])({ + enterprise: '0px 0px 0px 10px', + prisma: '0px 12px' +}), function (_ref2) { + var $hasEndAdornment = _ref2.$hasEndAdornment; + return $hasEndAdornment && Object(external_styled_components_["css"])(["padding-right:0;"]); +}, function (_ref3) { + var $hasStartAdornment = _ref3.$hasStartAdornment; + return $hasStartAdornment && Object(external_styled_components_["css"])(["padding-left:0;"]); +}, Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].gray20 + }, + prisma: themes_["variables"].interactiveColorBorderHover +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor), + prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive) +}), function (_ref4) { + var $error = _ref4.$error; + return $error && Object(external_styled_components_["css"])(["&,&:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}"], Object(themes_["pick"])({ + enterprise: themes_["variables"].errorColor, + prisma: themes_["variables"].accentColorNegative + }), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor), + prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive) + })); +}, function (_ref5) { + var $append = _ref5.$append; + return $append && Object(external_styled_components_["css"])(["margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;"]); +}, function (_ref6) { + var $prepend = _ref6.$prepend; + return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0;border-bottom-left-radius:0;"]); +}, function (_ref7) { + var disabled = _ref7.disabled; + return disabled && Object(external_styled_components_["css"])(["", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);"], Object(themes_["pick"])({ + enterprise: { + light: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray96, themes_["variables"].gray92), + dark: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray22, themes_["variables"].gray30) + }, + prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorderDisabled) + })); +}); +var StyledTextArea = external_styled_components_default.a.textarea.withConfig({ + displayName: "TextAreaStyles__StyledTextArea", + componentId: "gfy8yp-4" +})(["", ";outline-style:none;border:0;background:transparent;color:", ";flex-grow:1;font-family:", ";font-size:inherit;line-height:inherit;padding-top:", ";padding-bottom:", ";padding-right:", ";position:relative;resize:none;overflow:auto;white-space:pre-wrap;&::placeholder{color:", ";opacity:1;}", " ", ""], themes_["mixins"].reset('inline-flex'), Object(themes_["pick"])({ + enterprise: themes_["variables"].textColor, + prisma: themes_["variables"].contentColorActive +}), themes_["variables"].sansFontFamily, Object(themes_["pick"])({ + enterprise: { + comfortable: themes_["variables"].spacingQuarter, + compact: '3px' + }, + prisma: { + comfortable: themes_["variables"].spacingSmall, + compact: '5px' + } +}), Object(themes_["pick"])({ + enterprise: { + comfortable: themes_["variables"].spacingQuarter, + compact: '3px' + }, + prisma: { + comfortable: themes_["variables"].spacingSmall, + compact: '5px' + } +}), Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' +}), themes_["variables"].contentColorMuted, function (_ref8) { + var $error = _ref8.$error; + return $error && Object(external_styled_components_["css"])(["&,&:hover{color:", ";}"], Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].errorColorD10, + dark: themes_["variables"].errorColorL20 + }, + prisma: themes_["variables"].contentColorActive + })); +}, function (_ref9) { + var disabled = _ref9.disabled; + return disabled && disabledStyles; +}); +var StyledVisibilityToggle = external_styled_components_default()(Button_default.a).withConfig({ + displayName: "TextAreaStyles__StyledVisibilityToggle", + componentId: "gfy8yp-5" +})(["", ""], buttonStyles); +var StyledPlaceholder = external_styled_components_default.a.span.withConfig({ + displayName: "TextAreaStyles__StyledPlaceholder", + componentId: "gfy8yp-6" +})(["pointer-events:none;color:", ";position:absolute;overflow:hidden;font-size:inherit;line-height:inherit;height:", ";margin-right:", ";", ";", ";", ""], Object(themes_["pick"])({ + enterprise: themes_["variables"].textGray, + prisma: themes_["variables"].contentColorMuted +}), themes_["variables"].lineHeight, Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' +}), function (_ref10) { + var $hasStartAdornment = _ref10.$hasStartAdornment, + $startAdornmentWidth = _ref10.$startAdornmentWidth; + return $hasStartAdornment && ($startAdornmentWidth ? Object(external_styled_components_["css"])(["margin-left:", "px;"], $startAdornmentWidth) : Object(external_styled_components_["css"])(["margin-left:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + }))); +}, function (_ref11) { + var $hasEndAdornment = _ref11.$hasEndAdornment, + $endAdornmentWidth = _ref11.$endAdornmentWidth; + return $hasEndAdornment && ($endAdornmentWidth // calc(100% - padding - adorment width) + ? Object(external_styled_components_["css"])(["max-width:calc( 100% - ", " - ", "px );"], Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' + }), $endAdornmentWidth) : Object(external_styled_components_["css"])(["max-width:calc( 100% - ", " - ", " );"], Object(themes_["pick"])({ + enterprise: '10px', + prisma: '14px' + }), Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + }))); +}, function (_ref12) { + var $hasBothAdornment = _ref12.$hasBothAdornment, + $endAdornmentWidth = _ref12.$endAdornmentWidth, + $startAdornmentWidth = _ref12.$startAdornmentWidth; + return $hasBothAdornment && Object(external_styled_components_["css"])(["max-width:calc(100% - ", "px - ", "px);"], $startAdornmentWidth, $endAdornmentWidth); +}); +var adornmentHolder = Object(external_styled_components_["css"])(["display:inline-flex;align-items:center;justify-content:center;height:", ";pointer-events:none;"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } +})); +var StyledStartAdornmentHolder = external_styled_components_default.a.div.withConfig({ + displayName: "TextAreaStyles__StyledStartAdornmentHolder", + componentId: "gfy8yp-7" +})(["", " ", ";"], adornmentHolder, function (_ref13) { + var $width = _ref13.$width; + return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + })); +}); +var StyledEndAdornmentHolder = external_styled_components_default.a.div.withConfig({ + displayName: "TextAreaStyles__StyledEndAdornmentHolder", + componentId: "gfy8yp-8" +})(["", " ", ";"], adornmentHolder, function (_ref14) { + var $width = _ref14.$width; + return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } + })); +}); +var StyledAdornment = external_styled_components_default.a.div.withConfig({ + displayName: "TextAreaStyles__StyledAdornment", + componentId: "gfy8yp-9" +})(["display:inline-flex;align-items:center;justify-content:center;position:absolute;pointer-events:none;z-index:1;height:", ";color:", ";", ";", ";", ""], Object(themes_["pick"])({ + enterprise: { + comfortable: '30px', + compact: '26px' + }, + prisma: { + comfortable: '38px', + compact: '30px' + } +}), Object(themes_["pick"])({ + enterprise: { + light: themes_["variables"].gray60, + dark: themes_["variables"].white + }, + prisma: themes_["variables"].contentColorMuted +}), function (_ref15) { + var $position = _ref15.$position; + return $position === 'start' ? Object(external_styled_components_["css"])(["top:1px;left:1px;"]) : Object(external_styled_components_["css"])(["top:1px;right:1px;"]); +}, function (_ref16) { + var disabled = _ref16.disabled; + return disabled && disabledStyles; +}, Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["margin-left:-1px;margin-right:-1px;"]) +})); + +// CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts +// This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui), +// which is MIT-licensed: +// +// The MIT License (MIT) +// +// Copyright (c) 2014 Call-Em-All +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// End of MIT license text. +function syncHeightWithShadow(_ref) { + var height = _ref.height, + rowsMax = _ref.rowsMax, + rowsMin = _ref.rowsMin, + shadow = _ref.shadow; + + if (shadow) { + var style = window.getComputedStyle(shadow); + var lineHeightValue = style.getPropertyValue('line-height'); // jsdom does not properly inherit/re-calculate the line-height property so we skip in these cases SUI-1943, SUI-2428 + + if (lineHeightValue === 'inherit' || lineHeightValue === 'normal') { + return false; + } + + var lineHeight = parseInt(lineHeightValue, 10); + var paddingTop = parseInt(style.getPropertyValue('padding-top'), 10); + var paddingBottom = parseInt(style.getPropertyValue('padding-bottom'), 10); + var borderTop = parseInt(style.getPropertyValue('border-top-width'), 10); + var borderBottom = parseInt(style.getPropertyValue('border-bottom-width'), 10); + var newHeight = shadow.scrollHeight + borderTop + borderBottom; + /* eslint-disable no-restricted-globals */ + // Leverage the global `isNaN` here for IE support, rather than Number.isNaN. + // We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable. + + if (newHeight === undefined || isNaN(newHeight)) { + return false; + } + /* eslint-enable no-restricted-globals */ + + + if (rowsMax >= rowsMin) { + var maxHeight = rowsMax * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom + 1; // need one extra. + + newHeight = Math.min(maxHeight, newHeight); + } + + var minHeight = rowsMin * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom + 1; // need one extra. + + newHeight = Math.max(minHeight, newHeight); + + if (height !== newHeight) { + return newHeight; + } + } + + return false; +} +// EXTERNAL MODULE: ./src/utils/updateReactRef.ts +var updateReactRef = __nested_webpack_require_5362__(11); + +// CONCATENATED MODULE: ./src/TextArea/TextArea.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + + + + + + + + + + + +/** @public */ + +var propTypes = { + appearance: external_prop_types_default.a.oneOf(['default', 'search']), + append: external_prop_types_default.a.bool, + autoCapitalize: external_prop_types_default.a.string, + autoComplete: external_prop_types_default.a.string, + autoCorrect: external_prop_types_default.a.string, + autoFocus: external_prop_types_default.a.bool, + canClear: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + + /** @private. */ + classNamePrivate: external_prop_types_default.a.string, + defaultValue: external_prop_types_default.a.string, + describedBy: external_prop_types_default.a.string, + disabled: external_prop_types_default.a.bool, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + endAdornment: external_prop_types_default.a.node, + error: external_prop_types_default.a.bool, + inline: external_prop_types_default.a.bool, + + /** @private. */ + inputClassName: external_prop_types_default.a.string, + inputId: external_prop_types_default.a.string, + inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + labelledBy: external_prop_types_default.a.string, + maxLength: external_prop_types_default.a.number, + name: external_prop_types_default.a.string, + onBlur: external_prop_types_default.a.func, + onChange: external_prop_types_default.a.func, + onFocus: external_prop_types_default.a.func, + onKeyDown: external_prop_types_default.a.func, + onSelect: external_prop_types_default.a.func, + onInputClick: external_prop_types_default.a.func, + placeholder: external_prop_types_default.a.string, + prepend: external_prop_types_default.a.bool, + + /** @private. */ + required: external_prop_types_default.a.bool, + rowsMax: external_prop_types_default.a.number, + rowsMin: external_prop_types_default.a.number, + spellCheck: external_prop_types_default.a.bool, + tabIndex: external_prop_types_default.a.number, + startAdornment: external_prop_types_default.a.node, + + /** @private */ + splunkTheme: external_prop_types_default.a.object, + value: external_prop_types_default.a.string +}; +var defaultProps = { + appearance: 'default', + append: false, + autoFocus: false, + canClear: false, + disabled: false, + error: false, + inline: false, + placeholder: '', + prepend: false, + rowsMax: 8, + rowsMin: 2, + tabIndex: 0 +}; + +/** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ +var TextArea_TextArea = /*#__PURE__*/function (_Component) { + _inherits(TextArea, _Component); + + var _super = _createSuper(TextArea); + + _createClass(TextArea, null, [{ + key: "validateRows", + // @docs-props-type TextAreaPropsBase + value: function validateRows(_ref) { + var rowsMin = _ref.rowsMin, + rowsMax = _ref.rowsMax; + + if (false) {} + } + }]); + + function TextArea(props) { + var _this; + + _classCallCheck(this, TextArea); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "input", null); + + _defineProperty(_assertThisInitialized(_this), "shadow", null); + + _defineProperty(_assertThisInitialized(_this), "startAdornment", null); + + _defineProperty(_assertThisInitialized(_this), "endAdornment", null); + + _defineProperty(_assertThisInitialized(_this), "getAdornmentWidth", function () { + var startIconRect = _this.startAdornment ? _this.startAdornment.getBoundingClientRect() : undefined; + var startIconWidth = startIconRect && Math.round(startIconRect.width); + + if (_this.state.startAdornmentWidth !== startIconWidth) { + _this.setState({ + startAdornmentWidth: startIconWidth + }); + } + + var endIconRect = _this.endAdornment ? _this.endAdornment.getBoundingClientRect() : undefined; + var endIconWidth = endIconRect && Math.round(endIconRect.width); + + if (_this.state.endAdornmentWidth !== endIconWidth) { + _this.setState({ + endAdornmentWidth: endIconWidth + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleResize", function () { + _this.syncHeightWithShadow(); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) { + _this.input = el; + Object(updateReactRef["a" /* updateReactRef */])(_this.props.inputRef, el); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e) { + var _this$props$onChange, _this$props; + + var value = e.target.value; + var name = _this.props.name; + + if (!_this.isControlled()) { + _this.setState({ + value: value + }); + } + + (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, { + value: value, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputKeyDown", function (e) { + var _this$props$onKeyDown, _this$props2; + + (_this$props$onKeyDown = (_this$props2 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props2, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputSelect", function (e) { + var _this$props$onSelect, _this$props3; + + (_this$props$onSelect = (_this$props3 = _this.props).onSelect) === null || _this$props$onSelect === void 0 ? void 0 : _this$props$onSelect.call(_this$props3, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputClick", function (e) { + var _this$props$onInputCl, _this$props4; + + (_this$props$onInputCl = (_this$props4 = _this.props).onInputClick) === null || _this$props$onInputCl === void 0 ? void 0 : _this$props$onInputCl.call(_this$props4, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputFocus", function (e) { + var _this$props$onFocus, _this$props5; + + (_this$props$onFocus = (_this$props5 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props5, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (e) { + var _this$props$onBlur, _this$props6; + + (_this$props$onBlur = (_this$props6 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props6, e); + }); + + _defineProperty(_assertThisInitialized(_this), "handleClear", function (e) { + var _this$props$onChange2, _this$props7; + + e.preventDefault(); + var value = ''; + var name = _this.props.name; + + if (!_this.isControlled()) { + _this.setState({ + value: value + }); + } + + (_this$props$onChange2 = (_this$props7 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props7, e, { + value: value, + name: name + }); + }); + + _defineProperty(_assertThisInitialized(_this), "syncHeightWithShadow", function () { + var newHeight = syncHeightWithShadow({ + height: _this.state.height, + rowsMax: _this.props.rowsMax, + rowsMin: _this.props.rowsMin, + shadow: _this.shadow + }); + + if (newHeight !== false) { + _this.setState({ + height: newHeight + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "renderEndAdornment", function () { + var _controlGroupContext$; + + var _this$props8 = _this.props, + appearance = _this$props8.appearance, + endAdornment = _this$props8.endAdornment, + disabled = _this$props8.disabled, + canClear = _this$props8.canClear, + splunkTheme = _this$props8.splunkTheme; + var isPrisma = splunkTheme.isPrisma, + isEnterprise = splunkTheme.isEnterprise, + isCompact = splunkTheme.isCompact; + var prismaSize = isCompact ? '20px' : '24px'; + var adornmentProps = { + ref: function ref(el) { + _this.endAdornment = el; + }, + disabled: disabled, + $position: 'end' + }; + + if (endAdornment) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, endAdornment); + } + + var controlGroupContext = _this.context; + var controlGroupLabel = (_controlGroupContext$ = controlGroupContext.labelAttrs) === null || _controlGroupContext$ === void 0 ? void 0 : _controlGroupContext$.text; + var clearButtonText = controlGroupLabel ? Object(i18n_["_"])("Clear ".concat(controlGroupLabel, " text field")) : Object(i18n_["_"])('Clear text field'); + + if (!isPrisma && appearance === 'search') { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, { + appearance: "pill", + "data-test": "clear", + inline: false, + icon: /*#__PURE__*/external_react_default.a.createElement(Close_default.a, { + size: 1, + screenReaderText: clearButtonText + }), + onClick: _this.handleClear + }), /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, { + $disabled: disabled + }, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, { + hideDefaultTooltip: true, + inline: false, + screenReaderText: null, + size: "16px" + }) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, { + height: prismaSize, + width: prismaSize + }))); + } + + var displayValue = _this.getDisplayValue(); + + if (!!displayValue && (isPrisma && appearance === 'search' || canClear)) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, !disabled && /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, { + "data-test": "clear", + appearance: "secondary", + onClick: _this.handleClear, + icon: /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, { + "aria-label": clearButtonText, + inline: false, + width: prismaSize, + height: prismaSize + }) + })); + } + + return undefined; + }); + + _defineProperty(_assertThisInitialized(_this), "renderStartAdornment", function () { + var _this$props9 = _this.props, + appearance = _this$props9.appearance, + startAdornment = _this$props9.startAdornment, + splunkTheme = _this$props9.splunkTheme, + disabled = _this$props9.disabled; + var isPrisma = splunkTheme.isPrisma, + isCompact = splunkTheme.isCompact; + var prismaSize = isCompact ? '20px' : '24px'; + var adornmentProps = { + ref: function ref(el) { + _this.startAdornment = el; + }, + disabled: disabled, + $position: 'start' + }; + + if (startAdornment) { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, startAdornment); + } + + if (isPrisma && appearance === 'search') { + return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, { + $disabled: disabled + }, /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, { + "aria-label": "Search", + height: prismaSize, + width: prismaSize + }))); + } + + return undefined; + }); + + _defineProperty(_assertThisInitialized(_this), "getDisplayValue", function () { + var displayValue = _this.isControlled() ? _this.props.value : _this.state.value; + return displayValue; + }); + + _this.controlledExternally = has_default()(props, 'value'); + _this.state = { + value: props.defaultValue || '' + }; + + if (false) {} + + if (false) {} + + if (false) {} + + TextArea.validateRows(props); + _this.handleResize = throttle_default()(_this.handleResize, 100); + return _this; + } + + _createClass(TextArea, [{ + key: "componentDidMount", + value: function componentDidMount() { + defer_default()(this.syncHeightWithShadow); // wait for styles to load + + this.getAdornmentWidth(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (false) {} + + if (false) {} + + this.syncHeightWithShadow(); + TextArea.validateRows(this.props); + this.getAdornmentWidth(); + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "blur", + value: function blur() { + var _this$input; + + (_this$input = this.input) === null || _this$input === void 0 ? void 0 : _this$input.blur(); + } + /** + * Place focus on the input. + */ + + }, { + key: "focus", + value: function focus() { + var _this$input2; + + (_this$input2 = this.input) === null || _this$input2 === void 0 ? void 0 : _this$input2.focus(); + } + }, { + key: "select", + value: function select() { + var _this$input3; + + (_this$input3 = this.input) === null || _this$input3 === void 0 ? void 0 : _this$input3.select(); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props10 = this.props, + append = _this$props10.append, + autoCapitalize = _this$props10.autoCapitalize, + autoComplete = _this$props10.autoComplete, + autoCorrect = _this$props10.autoCorrect, + autoFocus = _this$props10.autoFocus, + children = _this$props10.children, + className = _this$props10.className, + classNamePrivate = _this$props10.classNamePrivate, + disabled = _this$props10.disabled, + describedBy = _this$props10.describedBy, + elementRef = _this$props10.elementRef, + error = _this$props10.error, + inline = _this$props10.inline, + inputClassName = _this$props10.inputClassName, + inputId = _this$props10.inputId, + labelledBy = _this$props10.labelledBy, + maxLength = _this$props10.maxLength, + name = _this$props10.name, + placeholder = _this$props10.placeholder, + prepend = _this$props10.prepend, + required = _this$props10.required, + spellCheck = _this$props10.spellCheck, + tabIndex = _this$props10.tabIndex, + title = _this$props10.title, + otherProps = _objectWithoutProperties(_this$props10, ["append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "maxLength", "name", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title"]); + + var ariaProps = _objectSpread(_objectSpread({}, pickBy_default()(otherProps, function (val, key) { + return key === 'role' || key.indexOf('aria-') === 0; + })), {}, { + 'aria-describedby': describedBy, + 'aria-labelledby': labelledBy, + 'aria-invalid': error || undefined, + 'aria-multiline': true + }); + + var boxProps = omit_default()(otherProps, ['inputRef', 'onBlur', 'onChange', 'onFocus', 'onKeyDown', 'onSelect', 'onInputClick', 'rowsMax', 'rowsMin'].concat(_toConsumableArray(keys_default()(ariaProps)))); + var displayValue = this.getDisplayValue(); + var displayProps = { + className: Object(style_["toClassName"])(className, inputClassName), + $append: append || undefined, + $error: error, + $prepend: prepend || undefined + }; + + var inputProps = _objectSpread(_objectSpread({}, ariaProps), {}, { + 'data-test': 'textbox', + autoCapitalize: autoCapitalize, + autoComplete: autoComplete, + autoCorrect: autoCorrect, + autoFocus: autoFocus, + id: inputId, + maxLength: maxLength, + placeholder: placeholder, + name: name, + onChange: this.handleInputChange, + onKeyDown: this.handleInputKeyDown, + onSelect: this.handleInputSelect, + onClick: this.handleInputClick, + onFocus: this.handleInputFocus, + onBlur: this.handleInputBlur, + ref: this.handleInputMount, + role: 'textbox', + required: required, + spellCheck: spellCheck, + style: { + height: this.state.height + }, + title: title, + tabIndex: tabIndex, + value: displayValue, + $error: error + }); + + var hasEndAdornment = !!this.renderEndAdornment(); + var hasStartAdornment = !!this.renderStartAdornment(); + return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({ + tabIndex: -1, + className: Object(style_["toClassName"])(className, classNamePrivate), + "data-test": "text", + "data-test-value": displayValue, + elementRef: elementRef, + flex: true, + inline: inline + }, boxProps), this.renderStartAdornment(), /*#__PURE__*/external_react_default.a.createElement(StyledTextAreaWrapper, _extends({ + $hasEndAdornment: hasEndAdornment, + $hasStartAdornment: hasStartAdornment, + disabled: disabled + }, displayProps), hasStartAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledStartAdornmentHolder, { + $width: this.state.startAdornmentWidth + }), /*#__PURE__*/external_react_default.a.createElement(StyledTextArea, { + "aria-hidden": "true", + onChange: noop_default.a, + onClick: this.handleInputClick, + style: { + width: '100%', + position: 'absolute', + overflow: 'hidden', + left: -10000, + top: -10000 + }, + tabIndex: -1, + ref: function ref(el) { + _this2.shadow = el; + }, + value: displayValue + }), disabled ? /*#__PURE__*/external_react_default.a.createElement(StyledTextArea, _extends({ + as: "textarea", + className: Object(style_["toClassName"])(className, classNamePrivate), + "data-multiline": "true", + "data-test": "text", + disabled: true, + readOnly: true, + style: { + height: this.state.height + }, + value: displayValue, + placeholder: placeholder, + ref: function ref(el) { + _this2.shadow = el; + } + }, ariaProps)) : /*#__PURE__*/external_react_default.a.createElement(StyledTextArea, _extends({ + as: "textarea" + }, inputProps, { + onClick: this.handleInputClick + })), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, { + target: window, + eventType: "resize", + listener: this.handleResize + }), children, hasEndAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledEndAdornmentHolder, { + $width: this.state.endAdornmentWidth + })), this.renderEndAdornment()); + } + }]); + + return TextArea; +}(external_react_["Component"]); + +_defineProperty(TextArea_TextArea, "propTypes", propTypes); + +_defineProperty(TextArea_TextArea, "defaultProps", defaultProps); + +_defineProperty(TextArea_TextArea, "componentType", 'TextArea'); + +_defineProperty(TextArea_TextArea, "contextType", ControlGroup_["ControlGroupContext"]); + +var TextAreaWithThemeBase = Object(themes_["withSplunkTheme"])(TextArea_TextArea); +var TextAreaWithTheme = TextAreaWithThemeBase; +TextAreaWithTheme.propTypes = TextArea_TextArea.propTypes; +TextAreaWithTheme.componentType = TextArea_TextArea.componentType; +/* harmony default export */ var src_TextArea_TextArea = (TextAreaWithTheme); +// CONCATENATED MODULE: ./src/TextArea/index.ts + + + +/***/ }), + +/***/ 25: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54719); + +/***/ }), + +/***/ 26: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(68787); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 31: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7350); + +/***/ }), + +/***/ 37: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(83778); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 46: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(80935); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 51: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(75795); + +/***/ }), + +/***/ 55: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(64112); + +/***/ }), + +/***/ 6: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7596); + +/***/ }), + +/***/ 61: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(71086); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 28546: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 209); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 10: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(61448); + +/***/ }), + +/***/ 12: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(39137); + +/***/ }), + +/***/ 14: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(54345); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 209: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_4295__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_4295__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_4295__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_Tooltip_Tooltip; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_4295__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_4295__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_4295__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_4295__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/has" +var has_ = __nested_webpack_require_4295__(10); +var has_default = /*#__PURE__*/__nested_webpack_require_4295__.n(has_); + +// EXTERNAL MODULE: external "lodash/throttle" +var throttle_ = __nested_webpack_require_4295__(31); +var throttle_default = /*#__PURE__*/__nested_webpack_require_4295__.n(throttle_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Popover" +var Popover_ = __nested_webpack_require_4295__(21); +var Popover_default = /*#__PURE__*/__nested_webpack_require_4295__.n(Popover_); + +// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent" +var ScreenReaderContent_ = __nested_webpack_require_4295__(14); +var ScreenReaderContent_default = /*#__PURE__*/__nested_webpack_require_4295__.n(ScreenReaderContent_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_4295__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/id" +var id_ = __nested_webpack_require_4295__(8); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_4295__(4); + +// EXTERNAL MODULE: external "@splunk/react-icons/SVGEnterprise" +var SVGEnterprise_ = __nested_webpack_require_4295__(32); +var SVGEnterprise_default = /*#__PURE__*/__nested_webpack_require_4295__.n(SVGEnterprise_); + +// CONCATENATED MODULE: ./src/Tooltip/InfoIcon.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + + + + + + +function InfoCircle(props) { + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + family = _useSplunkTheme.family, + density = _useSplunkTheme.density; + + if (family === 'enterprise') { + return /*#__PURE__*/external_react_default.a.createElement(SVGEnterprise_default.a, _extends({ + screenReaderText: Object(i18n_["_"])('Info Circle'), + viewBox: "0 0 24 24" + }, props), /*#__PURE__*/external_react_default.a.createElement("path", { + fill: "currentColor", + d: "M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM13.2001 8.1999C13.2001 7.53716 12.6628 6.9999 12.0001 6.9999C11.3373 6.9999 10.8001 7.53716 10.8001 8.1999C10.8001 8.86264 11.3373 9.3999 12.0001 9.3999C12.6628 9.3999 13.2001 8.86264 13.2001 8.1999ZM11.0001 16.0094V11.9999C11.0001 11.4476 11.4478 10.9999 12.0001 10.9999C12.5524 10.9999 13.0001 11.4476 13.0001 11.9999V16.0094C13.0001 16.5617 12.5524 17.0094 12.0001 17.0094C11.4478 17.0094 11.0001 16.5617 11.0001 16.0094Z" + })); + } + + var size = density === 'compact' ? '20' : '24'; + return /*#__PURE__*/external_react_default.a.createElement("svg", { + width: size, + height: size, + viewBox: "0 0 24 24", + xmlns: "http://www.w3.org/2000/svg", + style: { + display: 'block' + } + }, /*#__PURE__*/external_react_default.a.createElement("path", { + d: "M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM13.2003 8.1999C13.2003 7.53716 12.663 6.9999 12.0003 6.9999C11.3376 6.9999 10.8003 7.53716 10.8003 8.1999C10.8003 8.86264 11.3376 9.3999 12.0003 9.3999C12.663 9.3999 13.2003 8.86264 13.2003 8.1999ZM11.0005 16.0094V11.9999C11.0005 11.4476 11.4482 10.9999 12.0005 10.9999C12.5528 10.9999 13.0005 11.4476 13.0005 11.9999V16.0094C13.0005 16.5617 12.5528 17.0094 12.0005 17.0094C11.4482 17.0094 11.0005 16.5617 11.0005 16.0094Z", + fill: "currentColor", + fillRule: "evenodd" + })); +} + +/* harmony default export */ var InfoIcon = (InfoCircle); +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_4295__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_4295__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Clickable" +var Clickable_ = __nested_webpack_require_4295__(12); +var Clickable_default = /*#__PURE__*/__nested_webpack_require_4295__.n(Clickable_); + +// CONCATENATED MODULE: ./src/Tooltip/TooltipStyles.ts + + + +var TooltipStyles_size = '16px'; +var Styled = external_styled_components_default.a.span.withConfig({ + displayName: "TooltipStyles__Styled", + componentId: "sc-67fvgm-0" +})(["", ";position:relative;"], themes_["mixins"].reset('block')); +var StyledInline = external_styled_components_default.a.span.withConfig({ + displayName: "TooltipStyles__StyledInline", + componentId: "sc-67fvgm-1" +})(["", ";position:relative;"], themes_["mixins"].reset('inline-block')); +var StyledToggle = external_styled_components_default.a.span.withConfig({ + displayName: "TooltipStyles__StyledToggle", + componentId: "sc-67fvgm-2" +})(["display:block;"]); +var StyledToggleInline = external_styled_components_default.a.span.withConfig({ + displayName: "TooltipStyles__StyledToggleInline", + componentId: "sc-67fvgm-3" +})(["display:inline-block;"]); +var StyledContent = external_styled_components_default.a.div.withConfig({ + displayName: "TooltipStyles__StyledContent", + componentId: "sc-67fvgm-4" +})(["padding:", ";font-size:", ";line-height:", ";user-select:none;"], Object(themes_["pick"])({ + enterprise: themes_["variables"].spacingHalf, + prisma: Object(themes_["pickVariant"])('$isLabel', { + "false": '12px 16px', + "true": '4px 8px' + }) +}), Object(themes_["pick"])({ + enterprise: themes_["variables"].fontSizeSmall, + prisma: 'inherit' +}), Object(themes_["pick"])({ + enterprise: '18px', + prisma: Object(themes_["pickVariant"])('$isLabel', { + "false": 'inherit', + "true": '18px' + }) +})); +var StyledButton = external_styled_components_default()(Clickable_default.a).withConfig({ + displayName: "TooltipStyles__StyledButton", + componentId: "sc-67fvgm-5" +})(["cursor:default;", " ", " &:focus{box-shadow:", ";}"], Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["display:inline-block;width:", ";height:", ";border:2px solid ", ";border-radius:", ";font-size:", ";font-weight:", ";line-height:calc(", " - 2px);text-align:center;color:", ";vertical-align:baseline;&:not([disabled]){&:hover{text-decoration:none;}}"], TooltipStyles_size, TooltipStyles_size, themes_["variables"].linkColor, TooltipStyles_size, themes_["variables"].fontSizeSmall, themes_["variables"].fontWeightSemiBold, TooltipStyles_size, themes_["variables"].linkColor), + prisma: Object(external_styled_components_["css"])(["color:", ";border-radius:50%;display:inline-block;vertical-align:middle;&:hover,&:focus{color:", ";background:", ";}"], themes_["variables"].contentColorMuted, themes_["variables"].contentColorActive, themes_["variables"].interactiveColorOverlayHover) +}), Object(themes_["pick"])({ + prisma: { + comfortable: Object(external_styled_components_["css"])(["padding:8px;"]), + compact: Object(external_styled_components_["css"])(["padding:6px;"]) + } +}), themes_["variables"].focusShadow); + +// CONCATENATED MODULE: ./src/Tooltip/Tooltip.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function Tooltip_extends() { Tooltip_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Tooltip_extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + + + + +var propTypes = { + /** @private */ + appearance: external_prop_types_default.a.string, + children: external_prop_types_default.a.node, + closeDelay: external_prop_types_default.a.number, + + /** @private */ + closeWhen: external_prop_types_default.a.oneOf(['default', 'notOnClick']), + content: external_prop_types_default.a.node, + contentRelationship: external_prop_types_default.a.oneOf(['label', 'description']), + defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'theme']), + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + inline: external_prop_types_default.a.bool, + onRequestClose: external_prop_types_default.a.func, + onRequestOpen: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + openDelay: external_prop_types_default.a.oneOfType([external_prop_types_default.a.oneOf(['primary', 'secondary']), external_prop_types_default.a.number]), + + /** @private */ + splunkTheme: external_prop_types_default.a.object +}; +var defaultProps = { + appearance: 'inverted', + closeDelay: 300, + closeWhen: 'default', + contentRelationship: 'description', + defaultPlacement: 'theme', + inline: true, + openDelay: 'primary' +}; + +/** + * The Tooltip component wraps arbitrary content to be displayed when the target element is hovered + * or focused. + */ +var Tooltip_Tooltip = /*#__PURE__*/function (_Component) { + _inherits(Tooltip, _Component); + + var _super = _createSuper(Tooltip); + + // @docs-props-type TooltipPropsBase + function Tooltip(props) { + var _this; + + _classCallCheck(this, Tooltip); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "ariaId", void 0); + + _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0); + + _defineProperty(_assertThisInitialized(_this), "popoverId", void 0); + + _defineProperty(_assertThisInitialized(_this), "timeout", void 0); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + // Handle mouse events with native events due to current issues with how they + // are handled by react. See https://github.com/facebook/react/issues/4251, + // https://github.com/facebook/react/issues/19419, and SUI-1232. + if (el) { + el.addEventListener('mouseenter', _this.handleMouseEnter); + el.addEventListener('mouseleave', _this.handleMouseLeave); + } else if (_this.state.anchorEl) { + _this.state.anchorEl.removeEventListener('mouseenter', _this.handleMouseEnter); + + _this.state.anchorEl.removeEventListener('mouseleave', _this.handleMouseLeave); + } + + _this.setState({ + anchorEl: el + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handlePopoverMount", function (el) { + if (el) { + el.addEventListener('mouseenter', _this.handleMouseEnterPopover); + el.addEventListener('mouseleave', _this.handleMouseLeavePopover); + } else if (_this.state.popoverEl) { + _this.state.popoverEl.removeEventListener('mouseenter', _this.handleMouseEnterPopover); + + _this.state.popoverEl.removeEventListener('mouseleave', _this.handleMouseLeavePopover); + } + + _this.setState({ + popoverEl: el + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handlePopoverOuterMount", function (el) { + _this.setState({ + popoverOuterEl: el + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleHitAreaMount", function (el) { + // Handle mouse events with native events due to current issues with how they + // are handled by react. See https://github.com/facebook/react/issues/4251, + // https://github.com/facebook/react/issues/19419, and SUI-1232. + if (el) { + el.addEventListener('mouseenter', _this.handleMouseEnterHitArea); + el.addEventListener('mousemove', _this.handleMouseMoveHitArea); + el.addEventListener('mouseleave', _this.handleMouseLeaveHitArea); + } else if (_this.state.hitAreaEl) { + _this.state.hitAreaEl.removeEventListener('mouseenter', _this.handleMouseEnterHitArea); + + _this.state.hitAreaEl.removeEventListener('mousemove', _this.handleMouseMoveHitArea); + + _this.state.hitAreaEl.removeEventListener('mouseleave', _this.handleMouseLeaveHitArea); + } + + _this.setState({ + hitAreaEl: el + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function (e) { + _this.handleRequestOpen(e, { + reason: 'mouseEnterToggle' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseEnterPopover", function (e) { + _this.handleRequestOpen(e, { + reason: 'mouseEnterPopover' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseEnterHitArea", function (e) { + _this.handleRequestOpen(e, { + reason: 'mouseEnterHitArea' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function (e) { + var reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'mouseLeaveToggle'; + + if (e.relatedTarget == null || e.relatedTarget !== _this.state.popoverEl && e.relatedTarget !== _this.state.popoverOuterEl) { + _this.handleRequestClose(e, { + reason: reason + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseLeavePopover", function (e) { + _this.handleMouseLeave(e, 'mouseLeavePopover'); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseLeaveHitArea", function (e) { + _this.handleMouseLeave(e, 'mouseLeaveHitArea'); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseMoveHitAreaImpl", function (e) { + _this.handleRequestClose(e, { + reason: 'mouseStopHitArea' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleMouseMoveHitArea", throttle_default()(_this.handleMouseMoveHitAreaImpl, 10)); + + _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) { + if (_this.props.closeWhen !== 'notOnClick') { + _this.handleRequestClose(e, { + reason: 'toggleClick' + }); + } + }); + + _defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) { + _this.handleRequestOpen(e, { + reason: 'focusToggle' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleBlur", function (e) { + _this.handleRequestClose(e, { + reason: 'blurToggle' + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handlePopoverOnRequestClose", function (data) { + _this.handleRequestClose(null, data); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (e, data) { + var closeDelay = _this.props.closeDelay; + + if (_this.timeout !== undefined) { + clearTimeout(_this.timeout); + } + + _this.timeout = setTimeout(function () { + var _this$props$onRequest, _this$props; + + if (!_this.isControlled()) { + _this.setState({ + open: false + }); + } + + (_this$props$onRequest = (_this$props = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, e, data); + }, closeDelay); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRequestOpen", function (e, data) { + var openDelay = _this.props.openDelay; + var normalDelay = openDelay === 'primary' ? 300 : 750; + var finalDelay = typeof openDelay === 'number' ? openDelay : normalDelay; + + if (_this.timeout !== undefined) { + clearTimeout(_this.timeout); + } + + _this.timeout = setTimeout(function () { + var wasOpen = _this.isOpen(); + + if (!_this.isControlled()) { + _this.setState({ + open: true + }); + } + + if (!wasOpen) { + var _this$props$onRequest2, _this$props2; + + (_this$props$onRequest2 = (_this$props2 = _this.props).onRequestOpen) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props2, e, data); + } + }, finalDelay); + }); + + _this.controlledExternally = has_default()(props, 'open'); + _this.popoverId = Object(id_["createDOMID"])('popover'); + _this.ariaId = Object(id_["createDOMID"])('aria-id'); + _this.state = { + anchorEl: null, + open: false, + popoverEl: null, + popoverOuterEl: null, + hitAreaEl: null + }; + return _this; + } + + _createClass(Tooltip, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + if (false) {} + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.timeout !== undefined) { + clearTimeout(this.timeout); + } + } + }, { + key: "isControlled", + value: function isControlled() { + return this.controlledExternally; + } + }, { + key: "isOpen", + value: function isOpen() { + var hasContent = !!this.props.content; + return !!this.state.anchorEl && this.isControlled() ? this.props.open : hasContent && this.state.open; + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + appearance = _this$props3.appearance, + children = _this$props3.children, + content = _this$props3.content, + defaultPlacement = _this$props3.defaultPlacement, + elementRef = _this$props3.elementRef, + inline = _this$props3.inline, + onRequestClose = _this$props3.onRequestClose, + onRequestOpen = _this$props3.onRequestOpen, + splunkTheme = _this$props3.splunkTheme, + contentRelationship = _this$props3.contentRelationship, + otherProps = _objectWithoutProperties(_this$props3, ["appearance", "children", "content", "defaultPlacement", "elementRef", "inline", "onRequestClose", "onRequestOpen", "splunkTheme", "contentRelationship"]); + + var anchorEl = this.state.anchorEl; + var hasContent = !!content; + var openRender = this.isOpen(); + var StyledComp = inline ? StyledInline : Styled; + var StyledToggleComp = inline ? StyledToggleInline : StyledToggle; + var isPrisma = splunkTheme.isPrisma; + var placement = isPrisma ? 'below' : 'above'; + var cloneProps; + + if (contentRelationship === 'label') { + cloneProps = { + labelledBy: this.ariaId, + 'aria-labelledby': this.ariaId // not all components support the `labelledBy` prop. + + }; + } else if (contentRelationship === 'description') { + cloneProps = { + describedBy: this.ariaId, + 'aria-describedby': this.ariaId + }; + } + + return /*#__PURE__*/external_react_default.a.createElement(StyledComp, Tooltip_extends({ + "data-test": "tooltip", + "data-test-open": openRender, + "data-test-popover-id": this.popoverId, + ref: elementRef + }, otherProps), /*#__PURE__*/external_react_default.a.createElement(StyledToggleComp, { + onClick: this.handleClick, + onFocus: this.handleFocus, + onBlur: this.handleBlur, + ref: this.handleMount, + "data-test": "toggle" + }, hasContent && /*#__PURE__*/Object(external_react_["isValidElement"])(children) ? /*#__PURE__*/Object(external_react_["cloneElement"])(children, cloneProps) : children, hasContent && !children && /*#__PURE__*/external_react_default.a.createElement(StyledButton, { + "aria-describedby": this.ariaId + }, isPrisma ? /*#__PURE__*/external_react_default.a.createElement(InfoIcon, { + hideDefaultTooltip: true, + screenReaderText: Object(i18n_["_"])('More info'), + style: { + height: '22px', + width: '22px' + } + }) : /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement("span", { + "aria-hidden": "true" + }, "?"), /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, Object(i18n_["_"])('More info')))), hasContent && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, { + "aria-hidden": "true", + id: this.ariaId + }, content)), /*#__PURE__*/external_react_default.a.createElement(Popover_default.a, { + role: "tooltip", + align: "center", + anchor: anchorEl // override Popver's default animation to make it faster + // this keeps the overall amount of time the Tooltip is on-screen the same + // even with the increased default closeDelay to address SUI-5116 + , + animationConfig: { + tension: 400 + }, + appearance: appearance, + closeReasons: ['offScreen', 'escapeKey'], + defaultPlacement: defaultPlacement === 'theme' ? placement : defaultPlacement, + id: this.popoverId, + open: openRender, + onRequestClose: this.handlePopoverOnRequestClose, + elementRef: this.handlePopoverMount, + hitAreaRef: this.handleHitAreaMount, + outerRef: this.handlePopoverOuterMount + }, /*#__PURE__*/external_react_default.a.createElement(StyledContent, { + $isLabel: contentRelationship === 'label' + }, content))); + } + }]); + + return Tooltip; +}(external_react_["Component"]); + +_defineProperty(Tooltip_Tooltip, "propTypes", propTypes); + +_defineProperty(Tooltip_Tooltip, "defaultProps", defaultProps); + +var TooltipWithTheme = Object(themes_["withSplunkTheme"])(Tooltip_Tooltip); +TooltipWithTheme.propTypes = Tooltip_Tooltip.propTypes; +/* harmony default export */ var src_Tooltip_Tooltip = (TooltipWithTheme); +// CONCATENATED MODULE: ./src/Tooltip/index.ts + + + +/***/ }), + +/***/ 21: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(79728); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 31: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(7350); + +/***/ }), + +/***/ 32: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(19838); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 8: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(32058); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 27198: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 234); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 234: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ src_TransitionOpen_TransitionOpen; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "lodash/keys" +var keys_ = __nested_webpack_require_3959__(9); +var keys_default = /*#__PURE__*/__nested_webpack_require_3959__.n(keys_); + +// EXTERNAL MODULE: external "lodash/omit" +var omit_ = __nested_webpack_require_3959__(5); +var omit_default = /*#__PURE__*/__nested_webpack_require_3959__.n(omit_); + +// EXTERNAL MODULE: external "@splunk/react-ui/Animation" +var Animation_ = __nested_webpack_require_3959__(40); + +// EXTERNAL MODULE: external "@splunk/ui-utils/focus" +var focus_ = __nested_webpack_require_3959__(29); + +// EXTERNAL MODULE: external "@splunk/ui-utils/style" +var style_ = __nested_webpack_require_3959__(37); + +// EXTERNAL MODULE: external "react-spring" +var external_react_spring_ = __nested_webpack_require_3959__(24); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// CONCATENATED MODULE: ./src/TransitionOpen/TransitionOpenStyles.ts + + + +var Styled = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({ + displayName: "TransitionOpenStyles__Styled", + componentId: "sc-1x58s0g-0" +})(["", ";", ";"], themes_["mixins"].reset('block'), function (_ref) { + var $hideOverflow = _ref.$hideOverflow; + return $hideOverflow && Object(external_styled_components_["css"])(["overflow:hidden;"]); +}); +var StyledInner = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({ + displayName: "TransitionOpenStyles__StyledInner", + componentId: "sc-1x58s0g-1" +})(["", ";", ";width:100%;"], themes_["mixins"].reset('table'), themes_["mixins"].clearfix()); + +// CONCATENATED MODULE: ./src/TransitionOpen/TransitionOpen.tsx +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + + + +var propTypes = { + animation: external_prop_types_default.a.oneOf(['slideFromTop', 'slideFromRight', 'slideFromBottom', 'slideFromLeft', 'expandHeight', 'expandWidth', 'none']), + animateOnMount: external_prop_types_default.a.bool, + children: external_prop_types_default.a.node, + className: external_prop_types_default.a.string, + id: external_prop_types_default.a.string, + innerClassName: external_prop_types_default.a.string, + innerStyle: external_prop_types_default.a.object, + onAnimationEnd: external_prop_types_default.a.func, + open: external_prop_types_default.a.bool, + outerClassName: external_prop_types_default.a.string, + outerId: external_prop_types_default.a.string, + outerStyle: external_prop_types_default.a.object, + renderChildrenWhenCollapsed: external_prop_types_default.a.bool, + retainFocus: external_prop_types_default.a.bool, + takeFocus: external_prop_types_default.a.bool +}; +var defaultProps = { + animation: 'expandHeight', + animateOnMount: false, + innerStyle: {}, + open: false, + outerStyle: {}, + renderChildrenWhenCollapsed: false, + retainFocus: false, + takeFocus: false +}; + +var TransitionOpen_TransitionOpen = /*#__PURE__*/function (_Component) { + _inherits(TransitionOpen, _Component); + + var _super = _createSuper(TransitionOpen); + + // @docs-props-type TransitionOpenPropsBase + function TransitionOpen(props) { + var _this; + + _classCallCheck(this, TransitionOpen); + + _this = _super.call(this, props); + + _defineProperty(_assertThisInitialized(_this), "allowAnimationUpdates", true); + + _defineProperty(_assertThisInitialized(_this), "getValue", function (el) { + var animation = _this.props.animation; + var value = 0; + + if (el) { + if (_this.props.takeFocus) { + Object(focus_["takeFocus"])(el, 'container'); + } + + switch (animation) { + case 'slideFromTop': + case 'slideFromBottom': + case 'expandHeight': + case 'none': + value = el.offsetHeight; + break; + + case 'slideFromLeft': + case 'slideFromRight': + case 'expandWidth': + value = el.offsetWidth; + break; + + default: // Intentionally left empty. + + } + } + + return value; + }); + + _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) { + var value = _this.getValue(el); + + _this.setState({ + value: value, + innerEl: el + }); + }); + + _defineProperty(_assertThisInitialized(_this), "handleRest", function () { + var _this$props$onAnimati, _this$props; + + if (_this.allowAnimationUpdates) { + _this.setState({ + animating: false + }); + } + + (_this$props$onAnimati = (_this$props = _this.props).onAnimationEnd) === null || _this$props$onAnimati === void 0 ? void 0 : _this$props$onAnimati.call(_this$props); + }); + + _defineProperty(_assertThisInitialized(_this), "handleTab", function (e) { + if (_this.state.innerEl) { + Object(focus_["handleTab"])(_this.state.innerEl, e); + } + }); + + _defineProperty(_assertThisInitialized(_this), "internalRender", function (_ref) { + var value = _ref.value, + transform = _ref.transform; + var _this$props2 = _this.props, + animation = _this$props2.animation, + className = _this$props2.className, + children = _this$props2.children, + id = _this$props2.id, + innerClassName = _this$props2.innerClassName, + innerStyle = _this$props2.innerStyle, + open = _this$props2.open, + outerClassName = _this$props2.outerClassName, + outerId = _this$props2.outerId, + outerStyle = _this$props2.outerStyle, + renderChildrenWhenCollapsed = _this$props2.renderChildrenWhenCollapsed; + var animating = _this.state.animating; + var dimension; + + if (animating) { + switch (animation) { + case 'slideFromTop': + case 'slideFromBottom': + case 'expandHeight': + case 'none': + dimension = 'height'; + break; + + case 'slideFromLeft': + case 'slideFromRight': + case 'expandWidth': + dimension = 'width'; + break; + + default: // Intentionally left empty. + + } + } + + if (!open && !animating && renderChildrenWhenCollapsed) { + return /*#__PURE__*/external_react_default.a.createElement(Styled, { + $hideOverflow: false, + className: Object(style_["toClassName"])(className, outerClassName), + style: _objectSpread(_objectSpread({}, outerStyle), dimension && _defineProperty({}, dimension, value)), + id: outerId + }, /*#__PURE__*/external_react_default.a.createElement(StyledInner, _extends({ + "data-test": "transition-open" + }, omit_default()(_this.props, keys_default()(TransitionOpen.propTypes)), { + ref: _this.handleMount, + tabIndex: -1, + className: innerClassName, + id: id, + onKeyDown: _this.props.retainFocus ? _this.handleTab : undefined, + style: _objectSpread(_objectSpread({}, innerStyle), {}, { + transform: transform, + display: 'none' + }) + }), children)); + } + /* eslint-disable jsx-a11y/no-static-element-interactions */ + + + return /*#__PURE__*/external_react_default.a.createElement(Styled, { + $hideOverflow: !open || animating, + className: Object(style_["toClassName"])(className, outerClassName), + style: _objectSpread(_objectSpread({}, outerStyle), dimension && _defineProperty({}, dimension, value)), + id: outerId + }, (open || animating) && /*#__PURE__*/external_react_default.a.createElement(StyledInner, _extends({ + "data-test": "transition-open" + }, omit_default()(_this.props, keys_default()(TransitionOpen.propTypes)), { + ref: _this.handleMount, + tabIndex: -1, + className: innerClassName, + id: id, + onKeyDown: _this.props.retainFocus ? _this.handleTab : undefined, + style: _objectSpread(_objectSpread({}, innerStyle), {}, { + transform: transform + }) + }), children)); + }); + + _defineProperty(_assertThisInitialized(_this), "getSpringTransition", function () { + var _this$props3 = _this.props, + open = _this$props3.open, + animation = _this$props3.animation; + var value = _this.state.value; + var toValue = { + value: open ? value : 0 + }; + var fromValue = { + value: open ? 0 : value + }; + var config = { + precision: 1 + }; // Only use precision when not using transform, otherwise transform animation will break + // Expansion doesn't require a valid value; the subsequent render animates it. + + if (animation === 'expandWidth' || animation === 'expandHeight' || animation === 'none') { + return { + to: toValue, + config: config + }; + } // Slide transitions require a valid value, render without transition first. + + + if (!value) { + return null; + } + + if (animation !== 'slideFromTop' && animation !== 'slideFromLeft') { + // Return the standard transition if not using a transform. + return { + to: toValue, + from: fromValue, + config: config + }; + } // The top and left directions require an additional transform of their inner content to match the outer dimension animation. + // This is needed to achieve a clipping effect from the outer div, rather than the consumer providing their own. + + + var orientation = animation === 'slideFromTop' ? 'Y' : 'X'; + var toTransform = "translate".concat(orientation, "(").concat(open ? 0 : -value, "px)"); + var fromTransform = "translate".concat(orientation, "(").concat(open ? -value : 0, "px)"); + return { + to: _objectSpread({ + transform: toTransform + }, toValue), + from: _objectSpread({ + transform: fromTransform + }, fromValue) + }; + }); + + _this.state = { + animating: props.animateOnMount ? props.open : false, + innerEl: null, + prevOpen: props.open // eslint-disable-line react/no-unused-state + + }; + return _this; + } + + _createClass(TransitionOpen, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + var value = this.getValue(this.state.innerEl); + + if (this.state.value !== value && !this.state.animating) { + this.setState({ + value: value + }); // eslint-disable-line react/no-did-update-set-state + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.allowAnimationUpdates = false; + } + }, { + key: "render", + value: function render() { + var animation = this.props.animation; + return /*#__PURE__*/external_react_default.a.createElement(Animation_["Spring"], _extends({}, this.getSpringTransition(), { + immediate: animation === 'none', + onRest: this.handleRest + }), // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.internalRender); + } + }]); + + return TransitionOpen; +}(external_react_["Component"]); + +_defineProperty(TransitionOpen_TransitionOpen, "propTypes", propTypes); + +_defineProperty(TransitionOpen_TransitionOpen, "defaultProps", defaultProps); + +_defineProperty(TransitionOpen_TransitionOpen, "getDerivedStateFromProps", function (props, state) { + if (props.open !== state.prevOpen) { + return { + animating: true, + prevOpen: props.open + }; + } + + return null; +}); + +/* harmony default export */ var src_TransitionOpen_TransitionOpen = (TransitionOpen_TransitionOpen); +// CONCATENATED MODULE: ./src/TransitionOpen/index.ts + + + +/***/ }), + +/***/ 24: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(36529); + +/***/ }), + +/***/ 29: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(1027); + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 37: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(83778); + +/***/ }), + +/***/ 40: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(66991); + +/***/ }), + +/***/ 5: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(90179); + +/***/ }), + +/***/ 9: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(95950); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 63616: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 240); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 240: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3858__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3858__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3858__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ Typography_Typography; }); +__nested_webpack_require_3858__.d(__nested_webpack_exports__, "Typography", function() { return /* reexport */ Typography; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3858__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3858__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3858__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3858__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/themes/mixins" +var mixins_ = __nested_webpack_require_3858__(80); +var mixins_default = /*#__PURE__*/__nested_webpack_require_3858__.n(mixins_); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3858__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3858__.n(external_styled_components_); + +// CONCATENATED MODULE: ./src/Typography/Typography.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + +var propTypes = { + children: external_prop_types_default.a.node.isRequired, + as: external_prop_types_default.a.string.isRequired, + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + family: external_prop_types_default.a.oneOf(['sansSerif', 'monospace']), + variant: external_prop_types_default.a.oneOf(mixins_["typographyVariants"]), + size: external_prop_types_default.a.number, + lineHeight: external_prop_types_default.a.number, + color: external_prop_types_default.a.oneOf(['active', 'default', 'disabled', 'inverted', 'muted', 'inherit']), + weight: external_prop_types_default.a.oneOf([300, 400, 500, 600, 700, 800, 900, 'light', 'normal', 'semiBold', 'bold', 'extraBold', 'heavy']), + withReset: external_prop_types_default.a.bool +}; +var StyledTypography = external_styled_components_default.a.p.withConfig({ + displayName: "Typography__StyledTypography", + componentId: "cgxs34-0" +})(["", ""], function (_ref) { + var $variant = _ref.$variant, + $typographyParams = _ref.$typographyParams; + return $variant ? mixins_default.a.typography($variant, $typographyParams) : mixins_default.a.typography($typographyParams); +}); +var weightNumberToWeightVariable = { + 300: 'light', + 400: 'normal', + 500: 'semiBold', + 600: 'semiBold', + 700: 'bold', + 800: 'extraBold', + 900: 'heavy' +}; +/** + * Typography renders text content with styling based on the Splunk Design System. + */ + +function Typography(_ref2) { + var children = _ref2.children, + as = _ref2.as, + elementRef = _ref2.elementRef, + variant = _ref2.variant, + family = _ref2.family, + size = _ref2.size, + lineHeight = _ref2.lineHeight, + color = _ref2.color, + weight = _ref2.weight, + withReset = _ref2.withReset, + otherProps = _objectWithoutProperties(_ref2, ["children", "as", "elementRef", "variant", "family", "size", "lineHeight", "color", "weight", "withReset"]); + + // @docs-props-type TypographyPropsBase + // TODO: Remove in next major version (SUI-5350) + if (false) {} + + var typographyParams = { + family: family, + size: size, + lineHeight: lineHeight, + color: color, + withReset: withReset, + weight: typeof weight === 'number' ? weightNumberToWeightVariable[weight] : weight + }; + return /*#__PURE__*/external_react_default.a.createElement(StyledTypography, _extends({ + as: as, + ref: elementRef, + "data-test": "typography", + $variant: variant, + $typographyParams: typographyParams + }, otherProps), children); +} +Typography.propTypes = propTypes; +/* harmony default export */ var Typography_Typography = (Typography); +// CONCATENATED MODULE: ./src/Typography/index.ts + + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 80: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(74666); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 24379: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 235); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(28219); + +/***/ }), + +/***/ 1: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5556); + +/***/ }), + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 235: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3959__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3959__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3959__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ WaitSpinner_WaitSpinner; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3959__(2); +var external_react_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_react_); + +// EXTERNAL MODULE: external "prop-types" +var external_prop_types_ = __nested_webpack_require_3959__(1); +var external_prop_types_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_prop_types_); + +// EXTERNAL MODULE: external "@splunk/react-ui/AnimationToggle" +var AnimationToggle_ = __nested_webpack_require_3959__(48); + +// EXTERNAL MODULE: external "@splunk/themes" +var themes_ = __nested_webpack_require_3959__(0); + +// EXTERNAL MODULE: external "@splunk/ui-utils/i18n" +var i18n_ = __nested_webpack_require_3959__(4); + +// EXTERNAL MODULE: external "styled-components" +var external_styled_components_ = __nested_webpack_require_3959__(3); +var external_styled_components_default = /*#__PURE__*/__nested_webpack_require_3959__.n(external_styled_components_); + +// CONCATENATED MODULE: ./src/WaitSpinner/WaitSpinnerStyles.ts + + +var Styled = external_styled_components_default.a.div.withConfig({ + displayName: "WaitSpinnerStyles__Styled", + componentId: "sc-1nu971z-0" +})(["", ";"], themes_["mixins"].reset('inline')); +var spin = Object(external_styled_components_["keyframes"])(["100%{transform:rotate(360deg);}"]); +var appearAnimation = Object(external_styled_components_["keyframes"])(["0%{transform:scale(0);opacity:0;}100%{transform:scale(1);opacity:1;}"]); +var prismaAnimationDuration = '2.07s'; +var StyledSvg = external_styled_components_default.a.svg.withConfig({ + displayName: "WaitSpinnerStyles__StyledSvg", + componentId: "sc-1nu971z-1" +})(["", " ", ""], Object(themes_["pickVariant"])('$size', { + small: { + enterprise: Object(external_styled_components_["css"])(["width:14px;height:14px;"]), + prisma: Object(external_styled_components_["css"])(["width:16px;height:16px;"]) + }, + medium: { + enterprise: Object(external_styled_components_["css"])(["width:19px;height:19px;"]), + prisma: Object(external_styled_components_["css"])(["width:24px;height:24px;"]) + }, + large: { + enterprise: Object(external_styled_components_["css"])(["width:19px;height:19px;"]), + prisma: Object(external_styled_components_["css"])(["width:40px;height:40px;"]) + } +}), function (_ref) { + var $animated = _ref.$animated; + return $animated && Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["transform-origin:center;animation:", " 1.2s steps(64) infinite;"], spin), + prisma: Object(external_styled_components_["css"])(["animation:", " ", " infinite linear,", " 500ms cubic-bezier(0.01,0,0,1);"], spin, prismaAnimationDuration, appearAnimation) + }); +}); +var prismaBaseAnimation = Object(external_styled_components_["keyframes"])(["0%{stroke-dasharray:110 10;stroke-dashoffset:-5.5;animation-timing-function:cubic-bezier(0.8,0,0.83,1);}50%{stroke-dasharray:26 94;stroke-dashoffset:-152;}100%{stroke-dasharray:110 10;stroke-dashoffset:-246.5;animation-timing-function:cubic-bezier(0.33,0,0.67,1);}"]); +var prismaFillAnimation = Object(external_styled_components_["keyframes"])(["0%{stroke-dasharray:7 113;stroke-dashoffset:3;animation-timing-function:cubic-bezier(0.8,0,0.83,1);}50%{stroke-dasharray:90 30;stroke-dashoffset:-60;}100%{stroke-dasharray:7 113;stroke-dashoffset:-238;animation-timing-function:cubic-bezier(0.33,0,0.67,1);}"]); +var StyledPrismaBasePath = external_styled_components_default.a.circle.withConfig({ + displayName: "WaitSpinnerStyles__StyledPrismaBasePath", + componentId: "sc-1nu971z-2" +})(["stroke:", ";stroke-width:2;fill:transparent;", " stroke-dasharray:110 10;stroke-dashoffset:-5.5;"], themes_["variables"].contentColorDisabled, function (_ref2) { + var $animated = _ref2.$animated; + return $animated && Object(external_styled_components_["css"])(["animation:", " ", " infinite;animation-fill-mode:backwards;"], prismaBaseAnimation, prismaAnimationDuration); +}); +var StyledPrismaFillPath = external_styled_components_default.a.circle.withConfig({ + displayName: "WaitSpinnerStyles__StyledPrismaFillPath", + componentId: "sc-1nu971z-3" +})(["fill:transparent;stroke-width:2;stroke:", ";stroke-dasharray:7 113;stroke-dashoffset:3;", ""], Object(themes_["pickVariant"])('$size', { + small: themes_["variables"].contentColorDefault, + medium: themes_["variables"].contentColorDefault, + large: themes_["variables"].interactiveColorPrimary +}), function (_ref3) { + var $animated = _ref3.$animated; + return $animated && Object(external_styled_components_["css"])(["animation:", " ", " infinite;"], prismaFillAnimation, prismaAnimationDuration); +}); +var StyledEnterpriseCircle = external_styled_components_default.a.circle.withConfig({ + displayName: "WaitSpinnerStyles__StyledEnterpriseCircle", + componentId: "sc-1nu971z-4" +})(["fill:transparent;stroke:", ";stroke-width:2px;", ""], Object(themes_["pick"])({ + enterprise: { + dark: themes_["variables"].white, + light: themes_["variables"].gray60 + }, + prisma: themes_["variables"].contentColorMuted +}), Object(themes_["pick"])({ + enterprise: Object(external_styled_components_["css"])(["stroke-dasharray:34 19;"]) +})); + +// CONCATENATED MODULE: ./src/WaitSpinner/WaitSpinner.tsx +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + + + + + + + +var propTypes = { + elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]), + screenReaderText: external_prop_types_default.a.string, + size: external_prop_types_default.a.oneOf(['small', 'medium', 'large']) +}; + +function WaitSpinner(_ref) { + var elementRef = _ref.elementRef, + _ref$screenReaderText = _ref.screenReaderText, + screenReaderText = _ref$screenReaderText === void 0 ? Object(i18n_["_"])('Waiting') : _ref$screenReaderText, + _ref$size = _ref.size, + size = _ref$size === void 0 ? 'small' : _ref$size, + otherProps = _objectWithoutProperties(_ref, ["elementRef", "screenReaderText", "size"]); + + // @docs-props-type WaitSpinnerPropsBase + var animated = Object(AnimationToggle_["useAnimationToggle"])() === 'on'; + + var _useSplunkTheme = Object(themes_["useSplunkTheme"])(), + isPrisma = _useSplunkTheme.isPrisma; + + var viewBox = isPrisma ? '0 0 40 40' : '0 0 19 19'; + return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({ + "data-test": "wait-spinner" + }, otherProps), /*#__PURE__*/external_react_default.a.createElement(StyledSvg, { + viewBox: viewBox, + version: "1.1", + xmlns: "http://www.w3.org/2000/svg", + ref: elementRef, + $animated: animated, + $size: size + }, screenReaderText && /*#__PURE__*/external_react_default.a.createElement("title", null, screenReaderText), /*#__PURE__*/external_react_default.a.createElement("g", null, isPrisma ? /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(StyledPrismaBasePath, { + r: "19", + cx: "20", + cy: "20", + $animated: animated, + $size: size + }), /*#__PURE__*/external_react_default.a.createElement(StyledPrismaFillPath, { + r: "19", + cx: "20", + cy: "20", + $animated: animated, + $size: size + })) : /*#__PURE__*/external_react_default.a.createElement(StyledEnterpriseCircle, { + cx: "9.5", + cy: "9.5", + r: "8.5" + })))); +} + +WaitSpinner.propTypes = propTypes; +/* harmony default export */ var WaitSpinner_WaitSpinner = (WaitSpinner); +// CONCATENATED MODULE: ./src/WaitSpinner/index.ts + + +/***/ }), + +/***/ 3: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(92568); + +/***/ }), + +/***/ 4: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(5191); + +/***/ }), + +/***/ 48: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(4995); + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 47954: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ArrowDown.tsx + function i(e, r) { + if (e == null) return {}; + var t = l(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function l(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M6.55086 12.3369C6.16033 11.9464 5.52717 11.9464 5.13664 12.3369C4.74612 12.7275 4.74612 13.3606 5.13664 13.7512L10.9391 19.5536C11.5249 20.1394 12.4746 20.1394 13.0604 19.5536L18.8628 13.7512C19.2534 13.3606 19.2534 12.7275 18.8628 12.3369C18.4723 11.9464 17.8391 11.9464 17.4486 12.3369L13 16.7855V5.00234C13 4.45006 12.5523 4.00234 12 4.00234C11.4477 4.00234 11 4.45006 11 5.00234V16.7861L6.55086 12.3369Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Table Sort Ascent/descent, Up/Down, multi-use + * @category Navigation + * @keywords arrow up/down, ascent/descent + * @variants outlined + */ var p = function e(r) { + var a = r.children, l = r.variant, c = i(r, [ "children", "variant" ]); + var d = s(l); + var v = "arrowdown-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, O = p.addIcon; + O(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 43102: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ p + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const l = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ArrowSquareTopRight.tsx + function u(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M0 1.46769C0 0.675592 0.636901 0 1.46525 0H5.99626C6.73263 0 7.32958 0.59737 7.32958 1.33426C7.32958 2.07116 6.73263 2.66852 5.99626 2.66852H2.66663V21.3315H21.3163V17.9995C21.3163 17.2626 21.9133 16.6652 22.6496 16.6652C23.386 16.6652 23.983 17.2626 23.983 17.9995V22.5323C23.983 23.3429 23.3263 24 22.5163 24H1.46665C0.656638 24 0 23.3429 0 22.5323V1.46769Z" + }), n().createElement("path", { + d: "M21.3334 4.55534L10.1478 15.7489C9.62706 16.2699 8.78286 16.2699 8.26216 15.7489C7.74147 15.2278 7.74147 14.383 8.26217 13.8619L19.4477 2.66852H14.2121C13.4757 2.66852 12.8787 2.07116 12.8787 1.33426C12.8787 0.59737 13.4757 0 14.2121 0H22C23.1046 0 24 0.896056 24 2.00139V9.74743C24 10.4843 23.4031 11.0817 22.6667 11.0817C21.9303 11.0817 21.3334 10.4843 21.3334 9.74743V4.55534Z" + })); + })); + f.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M0 2C0 0.895431 0.895431 0 2 0H22C23.1046 0 24 0.89543 24 2V22C24 23.1046 23.1046 24 22 24H2C0.89543 24 0 23.1046 0 22V2ZM11.3333 2.66667C10.597 2.66667 10 3.26362 10 4C10 4.73638 10.597 5.33333 11.3333 5.33333H16.781L7.05719 15.0572C6.53649 15.5779 6.53649 16.4221 7.05719 16.9428C7.57789 17.4635 8.42211 17.4635 8.94281 16.9428L18.6667 7.21895V12.6667C18.6667 13.403 19.2636 14 20 14C20.7364 14 21.3333 13.403 21.3333 12.6667V4.66667C21.3333 3.5621 20.4379 2.66667 19.3333 2.66667H11.3333Z" + })); + })); + var d = [ "default", "outlined", "filled" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var C = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description (This icon has no paddings, optimized for using with text link) View Open External represents an action to open link in new window + * @category Controls + * @keywords action, link, open, square, box + * @variants outlined,filled + */ var s = function e(r) { + var a = r.children, i = r.variant, c = u(r, [ "children", "variant" ]); + var d = C(i); + var v = "arrowsquaretopright-".concat(d); + var s = (0, t.useContext)(l.IconContext); + var p = f.get(d); + if (false) {} + if (s && p) { + var m = s.toRender, y = s.addIcon; + y(v, p()); + if (!m) { + return null; + } + } + + return n().createElement(o(), c, a, s ? n().createElement("use", { + href: "#".concat(v) + }) : !!p && p()); + }; + s.defaultProps = c; + /* harmony default export */ const p = s; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 77225: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ p + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const l = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ArrowSquareTopRightInset.tsx + function u(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M3 4.10623C3 3.51257 3.47768 3.00623 4.09895 3.00623H7.49725C8.04954 3.00623 8.49725 3.45394 8.49725 4.00623C8.49725 4.55851 8.04954 5.00623 7.49725 5.00623H5V18.9937H18.9874V16.4964C18.9874 15.9441 19.4352 15.4964 19.9874 15.4964C20.5397 15.4964 20.9874 15.9441 20.9874 16.4964V19.8937C20.9874 20.5012 20.495 20.9937 19.8874 20.9937H4.1C3.49248 20.9937 3 20.5012 3 19.8937V4.10623Z" + }), n().createElement("path", { + d: "M19.0002 6.42035L10.6109 14.8096C10.2204 15.2002 9.58722 15.2002 9.1967 14.8096C8.80618 14.4191 8.80618 13.7859 9.1967 13.3954L17.5859 5.00623H13.6592C13.1069 5.00623 12.6592 4.55851 12.6592 4.00623C12.6592 3.45394 13.1069 3.00623 13.6592 3.00623H19.5002C20.3287 3.00623 21.0002 3.6778 21.0002 4.50623V10.3117C21.0002 10.864 20.5525 11.3117 20.0002 11.3117C19.4479 11.3117 19.0002 10.864 19.0002 10.3117V6.42035Z" + })); + })); + f.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M3 4.5C3 3.67157 3.67157 3 4.5 3H19.5C20.3284 3 21 3.67157 21 4.5V19.5C21 20.3284 20.3284 21 19.5 21H4.5C3.67157 21 3 20.3284 3 19.5V4.5ZM11.5 5C10.9477 5 10.5 5.44772 10.5 6C10.5 6.55228 10.9477 7 11.5 7H15.5858L8.29289 14.2929C7.90237 14.6834 7.90237 15.3166 8.29289 15.7071C8.68342 16.0976 9.31658 16.0976 9.70711 15.7071L17 8.41421V12.5C17 13.0523 17.4477 13.5 18 13.5C18.5523 13.5 19 13.0523 19 12.5V6.5C19 5.67157 18.3284 5 17.5 5H11.5Z" + })); + })); + var d = [ "default", "outlined", "filled" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var C = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description View Open External represents an action to open link in new window + * @category Controls + * @keywords action, link, open, square, box + * @variants outlined,filled + */ var s = function e(r) { + var a = r.children, i = r.variant, c = u(r, [ "children", "variant" ]); + var d = C(i); + var v = "arrowsquaretoprightinset-".concat(d); + var s = (0, t.useContext)(l.IconContext); + var p = f.get(d); + if (false) {} + if (s && p) { + var m = s.toRender, y = s.addIcon; + y(v, p()); + if (!m) { + return null; + } + } + + return n().createElement(o(), c, a, s ? n().createElement("use", { + href: "#".concat(v) + }) : !!p && p()); + }; + s.defaultProps = c; + /* harmony default export */ const p = s; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 5323: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ArrowUp.tsx + function i(e, r) { + if (e == null) return {}; + var t = l(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function l(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M6.55135 11.6631C6.16082 12.0536 5.52766 12.0536 5.13713 11.6631C4.74661 11.2725 4.74661 10.6394 5.13713 10.2488L10.9396 4.44642C11.5253 3.86064 12.4751 3.86063 13.0609 4.44642L18.8633 10.2488C19.2538 10.6394 19.2538 11.2725 18.8633 11.6631C18.4728 12.0536 17.8396 12.0536 17.4491 11.6631L13 7.21397V19.0009C13 19.5532 12.5523 20.0009 12 20.0009C11.4477 20.0009 11 19.5532 11 19.0009V7.21441L6.55135 11.6631Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Table Sort Ascent/descent, Up/Down, multi-use + * @category Navigation + * @keywords arrow up/down, ascent/descent + * @variants outlined + */ var p = function e(r) { + var a = r.children, l = r.variant, c = i(r, [ "children", "variant" ]); + var d = s(l); + var v = "arrowup-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, O = p.addIcon; + O(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 67151: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ArrowUpDown.tsx + function i(e, r) { + if (e == null) return {}; + var t = l(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function l(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M11 6.9142L8.20711 9.70709C7.81658 10.0976 7.18342 10.0976 6.79289 9.70709C6.40237 9.31657 6.40237 8.6834 6.79289 8.29288L10.9393 4.14643C11.5251 3.56064 12.4749 3.56065 13.0607 4.14643L17.2071 8.29288C17.5976 8.6834 17.5976 9.31657 17.2071 9.70709C16.8166 10.0976 16.1834 10.0976 15.7929 9.70709L13 6.9142V17.0858L15.7929 14.2929C16.1834 13.9024 16.8166 13.9024 17.2071 14.2929C17.5976 14.6834 17.5976 15.3166 17.2071 15.7071L13.0607 19.8535C12.4749 20.4393 11.5251 20.4393 10.9393 19.8535L6.79289 15.7071C6.40237 15.3166 6.40237 14.6834 6.79289 14.2929C7.18342 13.9024 7.81658 13.9024 8.20711 14.2929L11 17.0858V6.9142Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Sort action which shows sortable status at field label on table header, swap up/down + * @category Controls + * @keywords arrows, ascent/descent, up/down, reverse + * @variants outlined + */ var p = function e(r) { + var a = r.children, l = r.variant, c = i(r, [ "children", "variant" ]); + var d = s(l); + var v = "arrowupdown-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, O = p.addIcon; + O(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 32305: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/CaretSmallDown.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M7.27904 9.00002C6.84633 9.00002 6.61792 9.51239 6.90715 9.83423L11.408 14.8426C11.6067 15.0637 11.9533 15.0636 12.1519 14.8425L16.6502 9.8341C16.9392 9.51223 16.7108 9 16.2782 9L7.27904 9.00002Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Select button pull down icon, Enterprise Table Sort Ascent/descent + * @category Controls + * @keywords arrow, increase/decrease + * @variants outlined + */ var p = function e(r) { + var a = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "caretsmalldown-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, m = p.addIcon; + m(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 37075: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/CaretSmallRight.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M8.77004 16.4985C8.77004 16.9313 9.28241 17.1597 9.60425 16.8704L14.6126 12.3696C14.8337 12.1709 14.8336 11.8243 14.6125 11.6257L9.60412 7.12744C9.28225 6.83834 8.77002 7.06678 8.77002 7.49943L8.77004 16.4985Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Control values in a component, etc. + * @category Controls + * @keywords arrow, increase/decrease + * @variants outlined + */ var p = function e(r) { + var a = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "caretsmallright-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, m = p.addIcon; + m(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 74129: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/CaretsSmallUpDown.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M16.4984 14.0001C16.9311 14.0001 17.1595 14.5124 16.8703 14.8343L12.3694 19.8426C12.1707 20.0637 11.8242 20.0637 11.6256 19.8425L7.12732 14.8342C6.83823 14.5123 7.06667 14.0001 7.49931 14.0001L16.4984 14.0001Z" + }), n().createElement("path", { + d: "M16.4984 9.99999C16.9311 9.99999 17.1595 9.48762 16.8703 9.16578L12.3694 4.15743C12.1707 3.93633 11.8242 3.93638 11.6256 4.15754L7.12732 9.16591C6.83822 9.48778 7.06667 10 7.49931 10L16.4984 9.99999Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Enterprise Table Sort, Increase/decrease + * @category Controls + * @keywords arrow, ascent/descent, up/down + * @variants outlined + */ var p = function e(r) { + var a = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "caretssmallupdown-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, m = p.addIcon; + m(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 16363: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ p + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var l = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const o = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/CheckCircle.tsx + function u(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var l = Object.getOwnPropertySymbols(e); + for (a = 0; a < l.length; a++) { + n = l[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, l; + for (l = 0; l < n.length; l++) { + a = n[l]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var d = new Map; + d.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M16.8739 10.0405C17.2645 9.64996 17.2645 9.01679 16.8739 8.62627C16.4834 8.23574 15.8502 8.23574 15.4597 8.62627L10.5247 13.5613L8.5405 11.5776C8.14992 11.1872 7.51675 11.1873 7.12629 11.5779C6.73582 11.9684 6.73591 12.6016 7.12649 12.9921L9.46426 15.3291C10.0501 15.9148 10.9997 15.9147 11.5854 15.329L16.8739 10.0405Z" + }), n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12Z" + })); + })); + d.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.8738 8.62627C17.2643 9.01679 17.2643 9.64996 16.8738 10.0405L11.5853 15.329C10.9996 15.9147 10.0499 15.9148 9.46414 15.3291L7.12637 12.9921C6.73579 12.6016 6.7357 11.9684 7.12616 11.5779C7.51663 11.1873 8.1498 11.1872 8.54038 11.5776L10.5246 13.5613L15.4596 8.62627C15.8501 8.23574 16.4833 8.23574 16.8738 8.62627Z" + })); + })); + var f = [ "default", "outlined", "filled" ]; + var v = function e(r) { + return f.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Success indicator used for indication of good status + * @category Actions + * @keywords status, severity, check, done, solved + * @variants outlined,filled + */ var C = function e(r) { + var a = r.children, i = r.variant, c = u(r, [ "children", "variant" ]); + var f = s(i); + var v = "checkcircle-".concat(f); + var C = (0, t.useContext)(o.IconContext); + var p = d.get(f); + if (false) {} + if (C && p) { + var m = C.toRender, y = C.addIcon; + y(v, p()); + if (!m) { + return null; + } + } + + return n().createElement(l(), c, a, C ? n().createElement("use", { + href: "#".concat(v) + }) : !!p && p()); + }; + C.defaultProps = c; + /* harmony default export */ const p = C; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 25154: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/Checkmark.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M20.7071 5.59294C21.0977 5.98347 21.0977 6.61663 20.7071 7.00716L10.1447 17.5695C9.55896 18.1553 8.60922 18.1553 8.02343 17.5695L3.29289 12.839C2.90237 12.4485 2.90237 11.8153 3.29289 11.4248C3.68342 11.0343 4.31658 11.0343 4.70711 11.4248L9.08409 15.8018L19.2929 5.59294C19.6835 5.20242 20.3166 5.20242 20.7071 5.59294Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Checkmark represents selected or done status + * @category Actions + * @keywords status, selected, severity, check, done, sovled + * @variants outlined + */ var p = function e(r) { + var a = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "checkmark-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, m = p.addIcon; + m(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 88685: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const o = __webpack_require__(59033); + var a = e.n(o); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ChevronLeft.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, o; + if (Object.getOwnPropertySymbols) { + var a = Object.getOwnPropertySymbols(e); + for (o = 0; o < a.length; o++) { + n = a[o]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var o, a; + for (a = 0; a < n.length; a++) { + o = n[a]; + if (r.indexOf(o) >= 0) continue; + t[o] = e[o]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M9.21419 12L15.5144 5.69985C15.9049 5.30933 15.9049 4.67616 15.5144 4.28564C15.1238 3.89511 14.4907 3.89511 14.1002 4.28564L7.44642 10.9394C6.86063 11.5252 6.86064 12.4749 7.44642 13.0607L14.1002 19.7144C14.4907 20.105 15.1238 20.105 15.5144 19.7144C15.9049 19.3239 15.9049 18.6907 15.5144 18.3002L9.21419 12Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Used for transition in a component like a Paginator + * @category Navigation + * @keywords arrow, open/close, prev/next, left/right + * @variants outlined + */ var p = function e(r) { + var o = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "chevronleft-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, O = p.addIcon; + O(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(a(), c, o, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 65836: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const o = __webpack_require__(59033); + var a = e.n(o); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ChevronRight.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, o; + if (Object.getOwnPropertySymbols) { + var a = Object.getOwnPropertySymbols(e); + for (o = 0; o < a.length; o++) { + n = a[o]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var o, a; + for (a = 0; a < n.length; a++) { + o = n[a]; + if (r.indexOf(o) >= 0) continue; + t[o] = e[o]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M14.7858 11.9999L8.48564 5.69972C8.09512 5.3092 8.09512 4.67603 8.48564 4.28551C8.87617 3.89499 9.50933 3.89499 9.89986 4.28551L16.5536 10.9393C17.1394 11.525 17.1394 12.4748 16.5536 13.0606L9.9012 19.713C9.51067 20.1035 8.87751 20.1035 8.48698 19.713C8.09646 19.3224 8.09646 18.6893 8.48698 18.2988L14.7858 11.9999Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Used for transition in a component. Collapsed accordion menu, click to expand + * @category Navigation + * @keywords arrow, open/close, expand/collapse + * @variants outlined + */ var p = function e(r) { + var o = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "chevronright-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, O = p.addIcon; + O(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(a(), c, o, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 54719: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/Cross.tsx + function i(e, r) { + if (e == null) return {}; + var t = l(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function l(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.2929 17.2929C4.90238 17.6834 4.90238 18.3166 5.2929 18.7071C5.68342 19.0976 6.31659 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Close, delete, or remove action + * @category Actions + * @keywords popover, window close, delete item, remove, x + * @variants outlined + */ var p = function e(r) { + var a = r.children, l = r.variant, c = i(r, [ "children", "variant" ]); + var d = s(l); + var v = "cross-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, O = p.addIcon; + O(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 5979: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/DotsThreeHorizontal.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M6.28933 12.0001C6.28933 11.0964 5.5567 10.3637 4.65297 10.3637C3.74923 10.3637 3.0166 11.0964 3.0166 12.0001C3.0166 12.9038 3.74923 13.6365 4.65297 13.6365C5.5567 13.6365 6.28933 12.9038 6.28933 12.0001Z" + }), n().createElement("path", { + d: "M12.0166 10.3637C12.9204 10.3637 13.653 11.0964 13.653 12.0001C13.653 12.9038 12.9204 13.6365 12.0166 13.6365C11.1129 13.6365 10.3802 12.9038 10.3802 12.0001C10.3802 11.0964 11.1129 10.3637 12.0166 10.3637Z" + }), n().createElement("path", { + d: "M19.3803 10.3637C20.284 10.3637 21.0166 11.0964 21.0166 12.0001C21.0166 12.9038 20.284 13.6365 19.3803 13.6365C18.4765 13.6365 17.7439 12.9038 17.7439 12.0001C17.7439 11.0964 18.4765 10.3637 19.3803 10.3637Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description More options for horizontal menu + * @category Navigation + * @keywords menu, options, more + * @variants outlined + */ var p = function e(r) { + var a = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "dotsthreehorizontal-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, m = p.addIcon; + m(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 21433: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ y + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var o = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const u = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/DotsThreeVertical.tsx + function l(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (a = 0; a < o.length; a++) { + n = o[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, o; + for (o = 0; o < n.length; o++) { + a = n[o]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var f = new Map; + f.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M12.0167 6.27273C12.9205 6.27273 13.6531 5.5401 13.6531 4.63636C13.6531 3.73263 12.9205 3 12.0167 3C11.113 3 10.3804 3.73263 10.3804 4.63636C10.3804 5.5401 11.113 6.27273 12.0167 6.27273Z" + }), n().createElement("path", { + d: "M13.6531 12C13.6531 12.9038 12.9205 13.6364 12.0167 13.6364C11.113 13.6364 10.3804 12.9038 10.3804 12C10.3804 11.0963 11.113 10.3636 12.0167 10.3636C12.9205 10.3636 13.6531 11.0963 13.6531 12Z" + }), n().createElement("path", { + d: "M13.6531 19.3637C13.6531 20.2674 12.9205 21 12.0167 21C11.113 21 10.3804 20.2674 10.3804 19.3637C10.3804 18.4599 11.113 17.7273 12.0167 17.7273C12.9205 17.7273 13.6531 18.4599 13.6531 19.3637Z" + })); + })); + var d = [ "default", "outlined" ]; + var v = function e(r) { + return d.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description More options for vertical menu + * @category Navigation + * @keywords menu, options, more + * @variants outlined + */ var p = function e(r) { + var a = r.children, i = r.variant, c = l(r, [ "children", "variant" ]); + var d = s(i); + var v = "dotsthreevertical-".concat(d); + var p = (0, t.useContext)(u.IconContext); + var y = f.get(d); + if (false) {} + if (p && y) { + var b = p.toRender, m = p.addIcon; + m(v, y()); + if (!b) { + return null; + } + } + + return n().createElement(o(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!y && y()); + }; + p.defaultProps = c; + /* harmony default export */ const y = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 31798: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = t => { + /******/ var r = t && t.__esModule ? + /******/ () => t["default"] + /******/ : () => t + /******/; + e.d(r, { + a: r + }); + /******/ return r; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (t, r) => { + /******/ for (var n in r) { + /******/ if (e.o(r, n) && !e.o(t, n)) { + /******/ Object.defineProperty(t, n, { + enumerable: true, + get: r[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var t = {}; + // ESM COMPAT FLAG + e.r(t); + // EXPORTS + e.d(t, { + default: () => /* binding */ s + }); + // CONCATENATED MODULE: external "react" + const r = __webpack_require__(96540); + var n = e.n(r); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var l = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const o = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ExclamationCircle.tsx + function u(e, t) { + if (e == null) return {}; + var r = i(e, t); + var n, a; + if (Object.getOwnPropertySymbols) { + var l = Object.getOwnPropertySymbols(e); + for (a = 0; a < l.length; a++) { + n = l[a]; + if (t.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + r[n] = e[n]; + } + } + return r; + } + function i(e, t) { + if (e == null) return {}; + var r = {}; + var n = Object.keys(e); + var a, l; + for (l = 0; l < n.length; l++) { + a = n[l]; + if (t.indexOf(a) >= 0) continue; + r[a] = e[a]; + } + return r; + } + var c = { + variant: "default" + }; + var d = new Map; + d.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M13.2003 15.8001C13.2003 16.4628 12.663 17.0001 12.0003 17.0001C11.3376 17.0001 10.8003 16.4628 10.8003 15.8001C10.8003 15.1374 11.3376 14.6001 12.0003 14.6001C12.663 14.6001 13.2003 15.1374 13.2003 15.8001Z" + }), n().createElement("path", { + d: "M11.0005 7.9906V12.0001C11.0005 12.5524 11.4482 13.0001 12.0005 13.0001C12.5528 13.0001 13.0005 12.5524 13.0005 12.0001V7.9906C13.0005 7.43832 12.5528 6.9906 12.0005 6.9906C11.4482 6.9906 11.0005 7.43832 11.0005 7.9906Z" + }), n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4Z" + })); + })); + d.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12ZM11.0001 7.9906V12.0001C11.0001 12.5524 11.4478 13.0001 12.0001 13.0001C12.5524 13.0001 13.0001 12.5524 13.0001 12.0001V7.9906C13.0001 7.43832 12.5524 6.9906 12.0001 6.9906C11.4478 6.9906 11.0001 7.43832 11.0001 7.9906ZM12.0001 17.0001C12.6628 17.0001 13.2001 16.4628 13.2001 15.8001C13.2001 15.1374 12.6628 14.6001 12.0001 14.6001C11.3373 14.6001 10.8001 15.1374 10.8001 15.8001C10.8001 16.4628 11.3373 17.0001 12.0001 17.0001Z" + })); + })); + var f = [ "default", "outlined", "filled" ]; + var v = function e(t) { + return f.indexOf(t) >= 0; + }; + var C = function e(t) { + return t === "default" || t && !v(t) ? "outlined" : t; + }; + /** + * @description (Deprecated) Recommend to use Exclamation Triangle for an error state instead of this. Severity Lv3-4 Watch Alert ( { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = t => { + /******/ var r = t && t.__esModule ? + /******/ () => t["default"] + /******/ : () => t + /******/; + e.d(r, { + a: r + }); + /******/ return r; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (t, r) => { + /******/ for (var n in r) { + /******/ if (e.o(r, n) && !e.o(t, n)) { + /******/ Object.defineProperty(t, n, { + enumerable: true, + get: r[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var t = {}; + // ESM COMPAT FLAG + e.r(t); + // EXPORTS + e.d(t, { + default: () => /* binding */ C + }); + // CONCATENATED MODULE: external "react" + const r = __webpack_require__(96540); + var n = e.n(r); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var l = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const o = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/ExclamationTriangle.tsx + function u(e, t) { + if (e == null) return {}; + var r = i(e, t); + var n, a; + if (Object.getOwnPropertySymbols) { + var l = Object.getOwnPropertySymbols(e); + for (a = 0; a < l.length; a++) { + n = l[a]; + if (t.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + r[n] = e[n]; + } + } + return r; + } + function i(e, t) { + if (e == null) return {}; + var r = {}; + var n = Object.keys(e); + var a, l; + for (l = 0; l < n.length; l++) { + a = n[l]; + if (t.indexOf(a) >= 0) continue; + r[a] = e[a]; + } + return r; + } + var c = { + variant: "default" + }; + var d = new Map; + d.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M10.701 3.75C11.2783 2.75 12.7217 2.75 13.2991 3.75L21.9593 18.75C22.5367 19.75 21.815 21 20.6603 21H3.33976C2.18507 21 1.46337 19.75 2.04072 18.75L10.701 3.75ZM12 5.5L4.20579 19H19.7942L12 5.5Z" + }), n().createElement("path", { + d: "M10.9998 13.6618V10.5C10.9998 9.94771 11.4475 9.5 11.9998 9.5C12.5521 9.5 12.9998 9.94771 12.9998 10.5V13.6618C12.9998 14.2141 12.5521 14.6618 11.9998 14.6618C11.4475 14.6618 10.9998 14.2141 10.9998 13.6618Z" + }), n().createElement("path", { + d: "M13.1998 16.9347C13.1998 17.5975 12.6626 18.1347 11.9998 18.1347C11.3371 18.1347 10.7998 17.5975 10.7998 16.9347C10.7998 16.272 11.3371 15.7347 11.9998 15.7347C12.6626 15.7347 13.1998 16.272 13.1998 16.9347Z" + })); + })); + d.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M10.701 3.75C11.2783 2.75 12.7217 2.75 13.2991 3.75L21.9593 18.75C22.5367 19.75 21.815 21 20.6603 21H3.33976C2.18507 21 1.46337 19.75 2.04072 18.75L10.701 3.75ZM10.9998 13.6618V10.5C10.9998 9.94771 11.4475 9.5 11.9998 9.5C12.5521 9.5 12.9998 9.94771 12.9998 10.5V13.6618C12.9998 14.2141 12.5521 14.6618 11.9998 14.6618C11.4475 14.6618 10.9998 14.2141 10.9998 13.6618ZM11.9998 18.1347C12.6626 18.1347 13.1998 17.5975 13.1998 16.9347C13.1998 16.272 12.6626 15.7347 11.9998 15.7347C11.3371 15.7347 10.7998 16.272 10.7998 16.9347C10.7998 17.5975 11.3371 18.1347 11.9998 18.1347Z" + })); + })); + var f = [ "default", "outlined", "filled" ]; + var v = function e(t) { + return f.indexOf(t) >= 0; + }; + var p = function e(t) { + return t === "default" || t && !v(t) ? "outlined" : t; + }; + /** + * @description Severity Lv5-9 Error (> Warning) [Red] *Use filled style + * @category Severity + * @keywords alert, exclamation, notification, caution, warning, error + * @variants outlined,filled + */ var s = function e(t) { + var a = t.children, i = t.variant, c = u(t, [ "children", "variant" ]); + var f = p(i); + var v = "exclamationtriangle-".concat(f); + var s = (0, r.useContext)(o.IconContext); + var C = d.get(f); + if (false) {} + if (s && C) { + var m = s.toRender, y = s.addIcon; + y(v, C()); + if (!m) { + return null; + } + } + + return n().createElement(l(), c, a, s ? n().createElement("use", { + href: "#".concat(v) + }) : !!C && C()); + }; + s.defaultProps = c; + /* harmony default export */ const C = s; + module.exports = t; + /******/})(); + +/***/ }), + +/***/ 99615: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ var e = { + /***/ 42519: + /***/ (e, r, t) => { + // EXPORTS + t.d(r, { + default: () => /* binding */ m + }); + // EXTERNAL MODULE: external "react" + var n = t(99497); + var o = t.n(n); + // EXTERNAL MODULE: external "prop-types" + var i = t(80023); + var a = t.n(i); + // CONCATENATED MODULE: external "styled-components" + const u = __webpack_require__(92568); + var l = t.n(u); + // CONCATENATED MODULE: ./src/SVG.tsx + function c() { + c = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return c.apply(this, arguments); + } + function f(e, r) { + if (e == null) return {}; + var t = s(e, r); + var n, o; + if (Object.getOwnPropertySymbols) { + var i = Object.getOwnPropertySymbols(e); + for (o = 0; o < i.length; o++) { + n = i[o]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function s(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var o, i; + for (i = 0; i < n.length; i++) { + o = n[i]; + if (r.indexOf(o) >= 0) continue; + t[o] = e[o]; + } + return t; + } + // sets the fill to SplunkThemeProvider variable + // inline by default + var v = l().svg.withConfig({ + displayName: "SVG__StyledSVG", + componentId: "sc-13m0oii-0" + })([ "display:inline-block;flex:0 0 auto;overflow:visible;vertical-align:middle;pointer-events:none;fill:currentColor;" ]); + var d = l()(v).withConfig({ + displayName: "SVG__BlockSVG", + componentId: "sc-13m0oii-1" + })([ "display:block;flex:0 0 auto;margin:0 auto;overflow:visible;" ]); + var p = { + children: a().node, + height: a().oneOfType([ a().number, a().string ]), + inline: a().bool, + width: a().oneOfType([ a().number, a().string ]) + }; + var y = { + inline: true, + height: "16px", + viewBox: "0 0 24 24", + width: "16px" + }; + function h(e) { + var r = e.children, t = e.height, n = e.inline, i = e.viewBox, a = e.width, u = f(e, [ "children", "height", "inline", "viewBox", "width" ]); + // @docs-props-type SVGPropsBase + var l = n ? v : d; + + return o().createElement(l, c({ + "aria-hidden": "true", + height: t, + tabIndex: -1, + viewBox: i, + width: a, + xmlns: "http://www.w3.org/2000/svg" + }, u), r); + } + h.defaultProps = y; + h.propTypes = p; + /* harmony default export */ const m = h; + /***/ }, + /***/ 80023: + /***/ e => { + e.exports = __webpack_require__(5556); + /***/ }, + /***/ 99497: + /***/ e => { + e.exports = __webpack_require__(96540); + /***/ + /******/ } + }; + /************************************************************************/ + /******/ // The module cache + /******/ var r = {}; + /******/ + /******/ // The require function + /******/ function t(n) { + /******/ // Check if module is in cache + /******/ var o = r[n]; + /******/ if (o !== undefined) { + /******/ return o.exports; + /******/ } + /******/ // Create a new module (and put it into the cache) + /******/ var i = r[n] = { + /******/ // no module.id needed + /******/ // no module.loaded needed + /******/ exports: {} + /******/ }; + /******/ + /******/ // Execute the module function + /******/ e[n](i, i.exports, t); + /******/ + /******/ // Return the exports of the module + /******/ return i.exports; + /******/ } + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ t.n = e => { + /******/ var r = e && e.__esModule ? + /******/ () => e["default"] + /******/ : () => e + /******/; + t.d(r, { + a: r + }); + /******/ return r; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ t.d = (e, r) => { + /******/ for (var n in r) { + /******/ if (t.o(r, n) && !t.o(e, n)) { + /******/ Object.defineProperty(e, n, { + enumerable: true, + get: r[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ t.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var n = {}; + // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. + (() => { + t.r(n); + /* harmony export */ t.d(n, { + /* harmony export */ IconContext: () => /* binding */ h + /* harmony export */ , + IconProvider: () => /* binding */ m + /* harmony export */ , + default: () => b + /* harmony export */ }); + /* harmony import */ var e = t(99497); + /* harmony import */ var r = t.n(e); + /* harmony import */ var o = t(80023); + /* harmony import */ var i = t.n(o); + /* harmony import */ var a = t(42519); + function u(e, r) { + return v(e) || s(e, r) || c(e, r) || l(); + } + function l() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function c(e, r) { + if (!e) return; + if (typeof e === "string") return f(e, r); + var t = Object.prototype.toString.call(e).slice(8, -1); + if (t === "Object" && e.constructor) t = e.constructor.name; + if (t === "Map" || t === "Set") return Array.from(e); + if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return f(e, r); + } + function f(e, r) { + if (r == null || r > e.length) r = e.length; + for (var t = 0, n = new Array(r); t < r; t++) { + n[t] = e[t]; + } + return n; + } + function s(e, r) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return; + var t = []; + var n = true; + var o = false; + var i = undefined; + try { + for (var a = e[Symbol.iterator](), u; !(n = (u = a.next()).done); n = true) { + t.push(u.value); + if (r && t.length === r) break; + } + } catch (e) { + o = true; + i = e; + } finally { + try { + if (!n && a["return"] != null) a["return"](); + } finally { + if (o) throw i; + } + } + return t; + } + function v(e) { + if (Array.isArray(e)) return e; + } + var d = { + children: i().node, + duplicateRepeatedIcons: i().bool + }; + var p = function e(t) { + var n = []; + t.forEach((function(e, t) { + n.push( + + // eslint-disable-next-line react/no-array-index-key + r().createElement("symbol", { + key: t, + id: t, + viewBox: "0 0 24 24" + }, e)); + })); + return n; + }; + var y = function e(t) { + var n = t.icons; + + return r().createElement(a["default"], { + style: { + display: "none" + } + }, r().createElement("defs", null, p(n))); + }; + var h = (0, e.createContext)(null); + /** + * IconProvider enables experimental features across icons that may change at any time + * and does not follow the semantic-versioning of the package. + * + * To use, wrap icons from '@splunk/react-icons/{icon}'. + */ var m = function t(n) { + var o = n.children, i = n.duplicateRepeatedIcons; + // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars + var a = (0, e.useState)(0), l = u(a, 2), c = l[0], f = l[1]; + var s = (0, e.useRef)(new Map); + var v = (0, e.useRef)(false); + // useEffect to avoid bad setState call in render, update on ref change + (0, e.useEffect)((function() { + f(s.current.size); + v.current = true; + }), []); + // duplicateRepeatedIcons is currently the only feature that can be enabled + // if it is disabled we can early exit + if (!i) { + + return r().createElement(r().Fragment, null, o); + } + var d = function e(r) { + return s.current.has(r); + }; + // function to add icon (key and paths) to ref + var p = function e(r, t) { + var n = d(r); + if (!n) { + // reset toRender to false as state has not been updated yet + v.current = false; + s.current.set(r, t); + } + return n; + }; + + return r().createElement(h.Provider, { + value: { + toRender: v.current, + addIcon: p, + getIconExists: d + } + }, r().createElement(y, { + icons: s.current + }), o); + }; + m.propTypes = d; + /* harmony default export */ const b = m; + })(); + module.exports = n; + /******/})(); + +/***/ }), + +/***/ 90089: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = t => { + /******/ var r = t && t.__esModule ? + /******/ () => t["default"] + /******/ : () => t + /******/; + e.d(r, { + a: r + }); + /******/ return r; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (t, r) => { + /******/ for (var n in r) { + /******/ if (e.o(r, n) && !e.o(t, n)) { + /******/ Object.defineProperty(t, n, { + enumerable: true, + get: r[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var t = {}; + // ESM COMPAT FLAG + e.r(t); + // EXPORTS + e.d(t, { + default: () => /* binding */ s + }); + // CONCATENATED MODULE: external "react" + const r = __webpack_require__(96540); + var n = e.n(r); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var l = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const o = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/InformationCircle.tsx + function u(e, t) { + if (e == null) return {}; + var r = i(e, t); + var n, a; + if (Object.getOwnPropertySymbols) { + var l = Object.getOwnPropertySymbols(e); + for (a = 0; a < l.length; a++) { + n = l[a]; + if (t.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + r[n] = e[n]; + } + } + return r; + } + function i(e, t) { + if (e == null) return {}; + var r = {}; + var n = Object.keys(e); + var a, l; + for (l = 0; l < n.length; l++) { + a = n[l]; + if (t.indexOf(a) >= 0) continue; + r[a] = e[a]; + } + return r; + } + var c = { + variant: "default" + }; + var d = new Map; + d.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + d: "M13.2003 8.1999C13.2003 7.53716 12.663 6.9999 12.0003 6.9999C11.3376 6.9999 10.8003 7.53716 10.8003 8.1999C10.8003 8.86264 11.3376 9.3999 12.0003 9.3999C12.663 9.3999 13.2003 8.86264 13.2003 8.1999Z" + }), n().createElement("path", { + d: "M11.0005 16.0094V11.9999C11.0005 11.4476 11.4482 10.9999 12.0005 10.9999C12.5528 10.9999 13.0005 11.4476 13.0005 11.9999V16.0094C13.0005 16.5617 12.5528 17.0094 12.0005 17.0094C11.4482 17.0094 11.0005 16.5617 11.0005 16.0094Z" + }), n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z" + })); + })); + d.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM11.0001 16.0094V11.9999C11.0001 11.4476 11.4478 10.9999 12.0001 10.9999C12.5524 10.9999 13.0001 11.4476 13.0001 11.9999V16.0094C13.0001 16.5617 12.5524 17.0094 12.0001 17.0094C11.4478 17.0094 11.0001 16.5617 11.0001 16.0094ZM12 6.9999C12.6628 6.9999 13.2 7.53716 13.2 8.1999C13.2 8.86264 12.6628 9.3999 12 9.3999C11.3373 9.3999 10.8 8.86264 10.8 8.1999C10.8 7.53716 11.3373 6.9999 12 6.9999Z" + })); + })); + var f = [ "default", "outlined", "filled" ]; + var v = function e(t) { + return f.indexOf(t) >= 0; + }; + var C = function e(t) { + return t === "default" || t && !v(t) ? "outlined" : t; + }; + /** + * @description Gives users quick information and tips on hover state. Use filled style for Severity Lv2 Syslog Information. + * @category Notifications + * @keywords alert, exclamation, notification, caution, warning, error, tooltip, severity + * @variants outlined,filled + */ var p = function e(t) { + var a = t.children, i = t.variant, c = u(t, [ "children", "variant" ]); + var f = C(i); + var v = "informationcircle-".concat(f); + var p = (0, r.useContext)(o.IconContext); + var s = d.get(f); + if (false) {} + if (p && s) { + var m = p.toRender, y = p.addIcon; + y(v, s()); + if (!m) { + return null; + } + } + + return n().createElement(l(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!s && s()); + }; + p.defaultProps = c; + /* harmony default export */ const s = p; + module.exports = t; + /******/})(); + +/***/ }), + +/***/ 80935: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ C + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/react-icons/SVG" + const a = __webpack_require__(59033); + var l = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/IconProvider" + const o = __webpack_require__(99615); + // CONCATENATED MODULE: ./src/icons/Magnifier.tsx + function u(e, r) { + if (e == null) return {}; + var t = i(e, r); + var n, a; + if (Object.getOwnPropertySymbols) { + var l = Object.getOwnPropertySymbols(e); + for (a = 0; a < l.length; a++) { + n = l[a]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function i(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var a, l; + for (l = 0; l < n.length; l++) { + a = n[l]; + if (r.indexOf(a) >= 0) continue; + t[a] = e[a]; + } + return t; + } + var c = { + variant: "default" + }; + var d = new Map; + d.set("outlined", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M15.0509 16.4635C13.7888 17.4283 12.2113 18.0015 10.5 18.0015C6.35786 18.0015 3 14.6436 3 10.5015C3 6.35933 6.35786 3.00146 10.5 3.00146C14.6421 3.00146 18 6.35933 18 10.5015C18 12.2112 17.4279 13.7873 16.4647 15.0489L20.7077 19.292C21.0983 19.6825 21.0983 20.3156 20.7077 20.7062C20.3172 21.0967 19.6841 21.0967 19.2935 20.7062L15.0509 16.4635ZM16 10.5015C16 13.539 13.5376 16.0015 10.5 16.0015C7.46243 16.0015 5 13.539 5 10.5015C5 7.4639 7.46243 5.00146 10.5 5.00146C13.5376 5.00146 16 7.4639 16 10.5015Z" + })); + })); + d.set("filled", (function() { + + return n().createElement(n().Fragment, null, n().createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M15.0509 16.4635C13.7888 17.4283 12.2113 18.0015 10.5 18.0015C6.35786 18.0015 3 14.6436 3 10.5015C3 6.35933 6.35786 3.00146 10.5 3.00146C14.6421 3.00146 18 6.35933 18 10.5015C18 12.2112 17.4279 13.7873 16.4647 15.0489L20.7077 19.292C21.0983 19.6825 21.0983 20.3156 20.7077 20.7062C20.3172 21.0967 19.6841 21.0967 19.2935 20.7062L15.0509 16.4635Z" + })); + })); + var f = [ "default", "outlined", "filled" ]; + var v = function e(r) { + return f.indexOf(r) >= 0; + }; + var s = function e(r) { + return r === "default" || r && !v(r) ? "outlined" : r; + }; + /** + * @description Search represents an action for searching + * @category Actions + * @keywords search, action, reporting, keyword + * @variants outlined,filled + */ var p = function e(r) { + var a = r.children, i = r.variant, c = u(r, [ "children", "variant" ]); + var f = s(i); + var v = "magnifier-".concat(f); + var p = (0, t.useContext)(o.IconContext); + var C = d.get(f); + if (false) {} + if (p && C) { + var m = p.toRender, y = p.addIcon; + y(v, C()); + if (!m) { + return null; + } + } + + return n().createElement(l(), c, a, p ? n().createElement("use", { + href: "#".concat(v) + }) : !!C && C()); + }; + p.defaultProps = c; + /* harmony default export */ const C = p; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 59033: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ var e = { + /***/ 80023: + /***/ e => { + e.exports = __webpack_require__(5556); + /***/ }, + /***/ 99497: + /***/ e => { + e.exports = __webpack_require__(96540); + /***/ + /******/ } + }; + /************************************************************************/ + /******/ // The module cache + /******/ var r = {}; + /******/ + /******/ // The require function + /******/ function t(n) { + /******/ // Check if module is in cache + /******/ var i = r[n]; + /******/ if (i !== undefined) { + /******/ return i.exports; + /******/ } + /******/ // Create a new module (and put it into the cache) + /******/ var o = r[n] = { + /******/ // no module.id needed + /******/ // no module.loaded needed + /******/ exports: {} + /******/ }; + /******/ + /******/ // Execute the module function + /******/ e[n](o, o.exports, t); + /******/ + /******/ // Return the exports of the module + /******/ return o.exports; + /******/ } + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ t.n = e => { + /******/ var r = e && e.__esModule ? + /******/ () => e["default"] + /******/ : () => e + /******/; + t.d(r, { + a: r + }); + /******/ return r; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ t.d = (e, r) => { + /******/ for (var n in r) { + /******/ if (t.o(r, n) && !t.o(e, n)) { + /******/ Object.defineProperty(e, n, { + enumerable: true, + get: r[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ t.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var n = {}; + // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. + (() => { + // ESM COMPAT FLAG + t.r(n); + // EXPORTS + t.d(n, { + default: () => /* binding */ h + }); + // EXTERNAL MODULE: external "react" + var e = t(99497); + var r = t.n(e); + // EXTERNAL MODULE: external "prop-types" + var i = t(80023); + var o = t.n(i); + // CONCATENATED MODULE: external "styled-components" + const l = __webpack_require__(92568); + var a = t.n(l); + // CONCATENATED MODULE: ./src/SVG.tsx + function u() { + u = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return u.apply(this, arguments); + } + function p(e, r) { + if (e == null) return {}; + var t = d(e, r); + var n, i; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (i = 0; i < o.length; i++) { + n = o[i]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function d(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var i, o; + for (o = 0; o < n.length; o++) { + i = n[o]; + if (r.indexOf(i) >= 0) continue; + t[i] = e[i]; + } + return t; + } + // sets the fill to SplunkThemeProvider variable + // inline by default + var f = a().svg.withConfig({ + displayName: "SVG__StyledSVG", + componentId: "sc-13m0oii-0" + })([ "display:inline-block;flex:0 0 auto;overflow:visible;vertical-align:middle;pointer-events:none;fill:currentColor;" ]); + var s = a()(f).withConfig({ + displayName: "SVG__BlockSVG", + componentId: "sc-13m0oii-1" + })([ "display:block;flex:0 0 auto;margin:0 auto;overflow:visible;" ]); + var v = { + children: o().node, + height: o().oneOfType([ o().number, o().string ]), + inline: o().bool, + width: o().oneOfType([ o().number, o().string ]) + }; + var c = { + inline: true, + height: "16px", + viewBox: "0 0 24 24", + width: "16px" + }; + function y(e) { + var t = e.children, n = e.height, i = e.inline, o = e.viewBox, l = e.width, a = p(e, [ "children", "height", "inline", "viewBox", "width" ]); + // @docs-props-type SVGPropsBase + var d = i ? f : s; + + return r().createElement(d, u({ + "aria-hidden": "true", + height: n, + tabIndex: -1, + viewBox: o, + width: l, + xmlns: "http://www.w3.org/2000/svg" + }, a), t); + } + y.defaultProps = c; + y.propTypes = v; + /* harmony default export */ const h = y; + })(); + module.exports = n; + /******/})(); + +/***/ }), + +/***/ 19838: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var i in t) { + /******/ if (e.o(t, i) && !e.o(r, i)) { + /******/ Object.defineProperty(r, i, { + enumerable: true, + get: t[i] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ m + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var i = e.n(t); + // CONCATENATED MODULE: external "prop-types" + const n = __webpack_require__(5556); + var o = e.n(n); + // CONCATENATED MODULE: external "lodash/isUndefined" + const a = __webpack_require__(62216); + var l = e.n(a); + // CONCATENATED MODULE: external "lodash/isString" + const d = __webpack_require__(85015); + var s = e.n(d); + // CONCATENATED MODULE: external "styled-components" + const c = __webpack_require__(92568); + var p = e.n(c); + // CONCATENATED MODULE: ./src/SVGEnterprise.tsx + function u() { + u = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var i in t) { + if (Object.prototype.hasOwnProperty.call(t, i)) { + e[i] = t[i]; + } + } + } + return e; + }; + return u.apply(this, arguments); + } + function v(e, r) { + if (e == null) return {}; + var t = f(e, r); + var i, n; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (n = 0; n < o.length; n++) { + i = o[n]; + if (r.indexOf(i) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, i)) continue; + t[i] = e[i]; + } + } + return t; + } + function f(e, r) { + if (e == null) return {}; + var t = {}; + var i = Object.keys(e); + var n, o; + for (o = 0; o < i.length; o++) { + n = i[o]; + if (r.indexOf(n) >= 0) continue; + t[n] = e[n]; + } + return t; + } + var x = p().svg.withConfig({ + displayName: "SVGEnterprise__InlineSVG", + componentId: "sc-9jxj7k-0" + })([ "display:inline-block;flex:0 0 auto;overflow:visible;vertical-align:middle;" ]); + var h = p().svg.withConfig({ + displayName: "SVGEnterprise__BlockSVG", + componentId: "sc-9jxj7k-1" + })([ "display:block;flex:0 0 auto;margin:0 auto;overflow:visible;" ]); + var y = /-?\d.?\d* -?\d+.?\d* \d+.?\d* \d+.?\d*/; + var b = { + children: o().node, + height: o().oneOfType([ o().number, o().string ]), + hideDefaultTooltip: o().bool, + inline: o().bool, + screenReaderText: o().oneOfType([ o().string, o().oneOf([ "null" ]) ]), + size: o().oneOfType([ o().number, o().string ]), + width: o().oneOfType([ o().number, o().string ]), + viewBox: o().string.isRequired, + preserveAspectRatio: o().oneOf([ "none", "xMinYMin", "xMidYMin", "xMaxYMin", "xMinYMid", "xMidYMid", "xMaxYMid", "xMinYMax", "xMidYMax", "xMaxYMax" ]) + }; + function g(e) { + var r = e.children, t = e.height, n = e.hideDefaultTooltip, o = n === void 0 ? false : n, a = e.inline, d = a === void 0 ? true : a, c = e.preserveAspectRatio, p = c === void 0 ? "xMidYMid" : c, f = e.screenReaderText, y = e.size, b = y === void 0 ? .75 : y, g = e.viewBox, m = e.width, M = v(e, [ "children", "height", "hideDefaultTooltip", "inline", "preserveAspectRatio", "screenReaderText", "size", "viewBox", "width" ]); + // @docs-props-type SVGPropsBase + if (false) {} + var O = typeof b !== "number" ? parseFloat(b) : b; + var w = s()(b) ? b.match(/[^\d]+/) : "em"; + var j = parseFloat(g.split(" ")[3]); + var T = parseFloat(g.split(" ")[2]); + var S = Math.max(T, j); + var Y = l()(t) ? j / S * O : t; + var R = l()(m) ? T / S * O : m; + var _ = d ? x : h; + var P = f && !o; + + return i().createElement(_, u({ + focusable: "false", + height: s()(Y) ? Y : "".concat(Y.toFixed(4)).concat(w), + width: s()(R) ? R : "".concat(R.toFixed(4)).concat(w), + viewBox: g, + "aria-label": o ? f !== null && f !== void 0 ? f : undefined : undefined, + "aria-hidden": !f, + preserveAspectRatio: p, + xmlns: "http://www.w3.org/2000/svg" + }, M), P && i().createElement("title", null, f), r); + } + g.propTypes = b; + /* harmony default export */ const m = g; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 52352: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ b + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "prop-types" + const o = __webpack_require__(5556); + var i = e.n(o); + // CONCATENATED MODULE: external "styled-components" + const a = __webpack_require__(92568); + var l = e.n(a); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGEnterprise" + const u = __webpack_require__(19838); + var c = e.n(u); + // CONCATENATED MODULE: ./src/SVGInternal.tsx + function p() { + p = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return p.apply(this, arguments); + } + function f(e, r) { + if (e == null) return {}; + var t = s(e, r); + var n, o; + if (Object.getOwnPropertySymbols) { + var i = Object.getOwnPropertySymbols(e); + for (o = 0; o < i.length; o++) { + n = i[o]; + if (r.indexOf(n) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue; + t[n] = e[n]; + } + } + return t; + } + function s(e, r) { + if (e == null) return {}; + var t = {}; + var n = Object.keys(e); + var o, i; + for (i = 0; i < n.length; i++) { + o = n[i]; + if (r.indexOf(o) >= 0) continue; + t[o] = e[o]; + } + return t; + } + var v = l()(c()).withConfig({ + displayName: "SVGInternal__StyledSVG", + componentId: "ksy9g7-0" + })([ "circle,ellipse,path,polygon,rect{fill:currentColor;}" ]); + var y = { + viewBox: i().string + }; + function d(e) { + var r = e.viewBox, t = r === void 0 ? "0 0 1500 1500" : r, o = f(e, [ "viewBox" ]); + + return n().createElement(v, p({ + viewBox: t + }, o)); + } + d.propTypes = y; + /* harmony default export */ const b = d; + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 40828: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ l + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/TriangleDownSmall" + const a = __webpack_require__(69588); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Caret.tsx + function i() { + i = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return i.apply(this, arguments); + } + function l(e) { + + return n().createElement(u(), i({ + screenReaderText: (0, o._)("(Menu)") + }, e)); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 89439: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Check.tsx + function l() { + l = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return l.apply(this, arguments); + } + /* eslint-disable max-len */ function i(e) { + + return n().createElement(u(), l({ + screenReaderText: (0, o._)("Check") + }, e), n().createElement("path", { + d: "M536.3 1278.364L1500 121.514 1354.11.283 513.7 1010.212l-391.44-319.52L0 837.61" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 16861: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/ChevronLeft.tsx + function l() { + l = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return l.apply(this, arguments); + } + function i(e) { + + return n().createElement(u(), l({ + screenReaderText: (0, o._)("Chevron Left"), + viewBox: "0 0 885 1500" + }, e), n().createElement("path", { + d: "M751.027 1500L0 750 750 0l134.59 134.59L269.177 750l615.41 615.41" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 69564: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ l + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/ChevronRight.tsx + function i() { + i = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return i.apply(this, arguments); + } + function l(e) { + + return n().createElement(u(), i({ + screenReaderText: (0, o._)("Chevron Right"), + viewBox: "0 0 885 1500" + }, e), n().createElement("path", { + d: "M134.59 0l750 750-751.028 750L0 1365.41 615.41 750 0 134.59" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 23390: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var l = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Clear.tsx + function u() { + u = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return u.apply(this, arguments); + } + /* eslint-disable max-len */ function i(e) { + + return n().createElement(l(), u({ + screenReaderText: (0, o._)("Clear") + }, e), n().createElement("path", { + d: "M918.315 750.645L1500 1332.33 1332.33 1500 750.645 918.315 167.67 1500 0 1332.33l581.685-582.975L0 167.67 167.67 0l582.975 581.685L1332.33 0 1500 167.67" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 68787: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ l + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Clear" + const a = __webpack_require__(23390); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Close.tsx + function i() { + i = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return i.apply(this, arguments); + } + function l(e) { + + return n().createElement(u(), i({ + screenReaderText: (0, o._)("Close") + }, e)); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 44673: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ l + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Error.tsx + function c() { + c = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return c.apply(this, arguments); + } + /* eslint-disable max-len */ function l(e) { + + return n().createElement(u(), c({ + screenReaderText: (0, o._)("Error") + }, e, { + viewBox: "0 0 1375 1500" + }), n().createElement("path", { + d: "M187.5 61.5h1000c103.553 0 187.5 83.947 187.5 187.5v1000c0 103.553-83.947 187.5-187.5 187.5h-1000C83.947 1436.5 0 1352.553 0 1249V249C0 145.447 83.947 61.5 187.5 61.5zm400.79 413.083l32.145 257.167c4.908 39.264 34.086 74.685 69.815 91.187 36.612-16.018 64.87-50.826 69.914-91.187l32.146-257.167C799.18 419.623 759.582 374 703.7 374h-26.8c-55.908 0-95.555 45.033-88.61 100.583zm101.293 644.209c63.283 0 114.584-51.301 114.584-114.584 0-63.282-51.301-114.583-114.584-114.583-63.282 0-114.583 51.3-114.583 114.583s51.3 114.584 114.583 114.584z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 63172: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var l = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/External.tsx + function u() { + u = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return u.apply(this, arguments); + } + /* eslint-disable max-len */ function i(e) { + + return n().createElement(l(), u({ + screenReaderText: (0, o._)("External"), + viewBox: "0 0 1500 1499" + }, e), n().createElement("path", { + d: "M1500 1125h-189.04v185.96H189.04V189.04H375V0H0v1500h1500v-375zm0-1125H723.288v190.068h469.52l-666.78 648.288 133.56 134.59 650.344-665.754v469.52l189.04 1.028L1500 0z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 98515: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Info.tsx + function c() { + c = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return c.apply(this, arguments); + } + /* eslint-disable max-len */ function i(e) { + + return n().createElement(u(), c({ + screenReaderText: (0, o._)("Info"), + viewBox: "0 0 750 1500" + }, e), n().createElement("path", { + d: "M187.5 562.5h375v750H750V1500H0v-187.5h187.5V750H0V562.5h187.5z" + }), n().createElement("circle", { + cx: "375", + cy: "187.5", + r: "187.5" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 17743: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ l + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/InfoCircle.tsx + function i() { + i = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return i.apply(this, arguments); + } + /* eslint-disable max-len */ function l(e) { + + return n().createElement(u(), i({ + screenReaderText: (0, o._)("Info Circle") + }, e), n().createElement("path", { + d: "M843.75 750v-93.75H562.5V750h93.75v281.25H562.5V1125h375v-93.75h-93.75V750zM750 1500C335.786 1500 0 1164.214 0 750S335.786 0 750 0s750 335.786 750 750-335.786 750-750 750zm0-937.5c51.777 0 93.75-41.973 93.75-93.75S801.777 375 750 375s-93.75 41.973-93.75 93.75S698.223 562.5 750 562.5z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 75795: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ u + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var c = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Search.tsx + function l() { + l = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return l.apply(this, arguments); + } + /* eslint-disable max-len */ function u(e) { + + return n().createElement(c(), l({ + screenReaderText: (0, o._)("Search") + }, e), n().createElement("path", { + d: "M1476.69 1268.412l-340.795-340.795c56.048-92.285 88.43-200.177 88.43-314.948C1224.324 277.195 947.634.506 612.16.506S0 277.197 0 612.67c0 335.472 276.69 612.16 612.162 612.16 114.77 0 222.663-32.385 314.948-88.43l340.795 340.796c30.406 30.405 75 30.405 105.406 0l103.38-103.378c30.405-30.406 30.405-75 0-105.406zM156.08 612.67c0-248.312 207.77-456.082 456.082-456.082 248.31 0 456.08 207.77 456.08 456.08 0 248.312-207.77 456.082-456.08 456.082-248.31 0-456.08-207.77-456.08-456.08z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 41240: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var u = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Success.tsx + function l() { + l = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return l.apply(this, arguments); + } + /* eslint-disable max-len */ function i(e) { + + return n().createElement(u(), l({ + screenReaderText: (0, o._)("Success") + }, e), n().createElement("path", { + d: "M750 1500C335.786 1500 0 1164.214 0 750S335.786 0 750 0s750 335.786 750 750-335.786 750-750 750zm-138.327-414.388l511.677-511.677-105.185-105.185L611.53 875.385 453.004 716.573 347.819 821.76l263.854 263.853z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 69588: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ i + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var l = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/TriangleDownSmall.tsx + function u() { + u = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return u.apply(this, arguments); + } + /* eslint-disable max-len */ function i(e) { + + return n().createElement(l(), u({ + screenReaderText: (0, o._)("Triangle Down Small"), + viewBox: "0 0 1063 677" + }, e), n().createElement("path", { + d: "M458.024 633l-397-458c-35-41-61-72-61-102-1-43 30-73 73-73h918c43 0 71 30 71 73 0 30-13 58-43 94l-415 466c-32 35-47 44-73 44-22 0-37-9-73-44z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 96051: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (() => { + // webpackBootstrap + /******/ "use strict"; + /******/ // The require scope + /******/ var e = {}; + /******/ + /************************************************************************/ + /******/ /* webpack/runtime/compat get default export */ + /******/ (() => { + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ e.n = r => { + /******/ var t = r && r.__esModule ? + /******/ () => r["default"] + /******/ : () => r + /******/; + e.d(t, { + a: t + }); + /******/ return t; + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/define property getters */ + /******/ (() => { + /******/ // define getter functions for harmony exports + /******/ e.d = (r, t) => { + /******/ for (var n in t) { + /******/ if (e.o(t, n) && !e.o(r, n)) { + /******/ Object.defineProperty(r, n, { + enumerable: true, + get: t[n] + }); + /******/ } + /******/ } + /******/ }; + /******/ })(); + /******/ + /******/ /* webpack/runtime/hasOwnProperty shorthand */ + /******/ (() => { + /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r) + /******/; + })(); + /******/ + /******/ /* webpack/runtime/make namespace object */ + /******/ (() => { + /******/ // define __esModule on exports + /******/ e.r = e => { + /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + /******/ Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }); + /******/ } + /******/ Object.defineProperty(e, "__esModule", { + value: true + }); + /******/ }; + /******/ })(); + /******/ + /************************************************************************/ var r = {}; + // ESM COMPAT FLAG + e.r(r); + // EXPORTS + e.d(r, { + default: () => /* binding */ u + }); + // CONCATENATED MODULE: external "react" + const t = __webpack_require__(96540); + var n = e.n(t); + // CONCATENATED MODULE: external "@splunk/ui-utils/i18n" + const o = __webpack_require__(5191); + // CONCATENATED MODULE: external "@splunk/react-icons/SVGInternal" + const a = __webpack_require__(52352); + var l = e.n(a); + // CONCATENATED MODULE: ./src/enterprise/Warning.tsx + function c() { + c = Object.assign || function(e) { + for (var r = 1; r < arguments.length; r++) { + var t = arguments[r]; + for (var n in t) { + if (Object.prototype.hasOwnProperty.call(t, n)) { + e[n] = t[n]; + } + } + } + return e; + }; + return c.apply(this, arguments); + } + /* eslint-disable max-len */ function u(e) { + + return n().createElement(l(), c({ + screenReaderText: (0, o._)("Warning"), + viewBox: "0 0 1500 1313" + }, e), n().createElement("path", { + d: "M.956 1196.326l668.58-1144.89C689.395 17.736 718.71 0 749.916 0c31.207 0 59.577 15.963 80.382 51.436l668.58 1144.89c7.565 12.416-23.642 116.174-77.544 116.174H85.474c-53.902 0-92.083-102.872-84.518-116.174zm643.333-684.743l32.146 257.167c4.908 39.264 34.086 74.685 69.815 91.187 36.612-16.018 64.87-50.826 69.914-91.187l32.146-257.167C855.18 456.623 815.582 411 759.7 411h-26.8c-55.908 0-95.555 45.033-88.61 100.583zm101.294 644.209c63.283 0 114.584-51.301 114.584-114.584 0-63.282-51.301-114.583-114.584-114.583-63.282 0-114.583 51.3-114.583 114.583s51.3 114.584 114.583 114.584z" + })); + } + module.exports = r; + /******/})(); + +/***/ }), + +/***/ 51962: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = SplunkThemeProvider; + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _styledComponents = __webpack_require__(92568); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +/** SplunkThemeProvider defaults to `prisma` `dark` `comfortable`, unless the properties have already been set. + * + * For example, here the nested `SplunkThemeProvider` defaults to `enterprise` `light`: + * ```jsx + * return ( + * + * Main part of the page in enterprise-light-comfortable. + * + * Part of the page in enterprise-light-compact. + * + * + * ) + */ +function SplunkThemeProvider(_ref) { + var family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density, + additionalThemeProperties = _ref.additionalThemeProperties, + customizeTheme = _ref.customizeTheme, + otherProps = _objectWithoutProperties(_ref, ["family", "colorScheme", "density", "additionalThemeProperties", "customizeTheme"]); + + var _ref2 = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + _ref2$splunkThemeV = _ref2.splunkThemeV1, + splunkThemeV1 = _ref2$splunkThemeV === void 0 ? {} : _ref2$splunkThemeV; + + var composedTheme = _objectSpread(_objectSpread({}, additionalThemeProperties), {}, { + splunkThemeV1: { + family: family || splunkThemeV1.family || 'prisma', + colorScheme: colorScheme || splunkThemeV1.colorScheme || 'dark', + density: density || splunkThemeV1.density || 'comfortable', + customizer: customizeTheme || splunkThemeV1.customizer + } + }); + + return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, _extends({ + theme: composedTheme + }, otherProps)); +} + +/***/ }), + +/***/ 82539: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * ## Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * + * @valueSet + */ +var measures = { + spacingQuarter: '5px', + spacingHalf: '10px', + spacing: '20px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '32px', + borderRadius: '3px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 7438: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * ## Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * * Larger containers, such as `Card` or `Modal`, use `spacing`. + * * `spacingHalf` and `spacingQuarter` are primarily for horizontal spacing between smaller elements. + * * Just because a desired value equals 20, 10, or 5 pixels, does not mean it's appropriate to + * use spacing variables. + * + * @valueSet + */ +var measures = { + spacingQuarter: '5px', + spacingHalf: '10px', + spacing: '20px', + fontSizeSmall: '12px', + fontSize: '12px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '28px', + borderRadius: '3px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 90387: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(71315)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var dragHandleDark = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA1SURBVHgB7dKhEQAgDAPAhHmwSKZHYtmHVtZVVNTkXS53UeG57yPYazLmrB8o6h8QgPqBOAOboRAPJUGIOAAAAABJRU5ErkJggg=="; // see babel-plugin-base64-png + +var dark = { + backgroundColor: _light["default"].gray20, + backgroundColorHover: _light["default"].gray30, + borderColor: _light["default"].gray22, + borderDarkColor: _light["default"].black, + borderLightColor: _light["default"].gray60, + textColor: _light["default"].white, + textGray: _light["default"].gray92, + textDisabledColor: _light["default"].gray45, + linkColor: _light["default"].accentColorL10, + linkColorHover: _light["default"].accentColorL20, + border: "1px solid ".concat(_light["default"].gray22), + borderDark: "1px solid ".concat(_light["default"].black), + borderLight: "1px solid ".concat(_light["default"].gray60), + focusShadowInset: "inset 0 0 1px 1px ".concat(_light["default"].gray25, ", inset 0 0 0 3px ").concat(_light["default"].focusColor), + draggableBackground: "url('data:image/png;base64,".concat(dragHandleDark, "') 0 0 / 8px 8px repeat") +}; +/** + * ## Syntax colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#6cd0f0', + syntaxBrown: '#fccf87', + syntaxGray: '#b5b5b5', + syntaxGreen: '#cef06c', + syntaxOrange: '#f7994a', + syntaxPink: '#f494e5', + syntaxPurple: '#c99eff', + syntaxRed: '#fa94aa', + syntaxTeal: '#45d4ba' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread({}, _light["default"]), dark), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 8395: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(71315)); + +var _dark = _interopRequireDefault(__webpack_require__(90387)); + +var _compact = _interopRequireDefault(__webpack_require__(7438)); + +var _comfortable = _interopRequireDefault(__webpack_require__(82539)); + +var _prismaAliases = _interopRequireDefault(__webpack_require__(32987)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function createEnterpriseTheme(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var cs = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var d = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + var pa = (0, _prismaAliases["default"])({ + colorScheme: colorScheme, + density: density + }); + return _objectSpread(_objectSpread(_objectSpread({}, cs), d), pa); +} + +var _default = createEnterpriseTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 71315: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var dragHandle = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA2SURBVHgB7dKhEQAgDAPAhDnxDMAcDIBnT1pZV1FRk3e53EWFc+2P4N3DmLN+oKh/QADqB+IMUKEQD/CeueAAAAAASUVORK5CYII="; // see babel-plugin-base64-pngimport { + +/** + * ## Brand colors + * + * @colorSet + */ + +var brandColors = { + brandColorL50: '#f5fbf5', + brandColorL40: '#dff2df', + brandColorL30: '#bee6be', + brandColorL20: '#9ed99e', + brandColorL10: '#7ecd7e', + brandColor: '#5cc05c', + brandColorD10: '#49b849', + brandColorD20: '#40a540', + brandColorD30: '#389038', + brandColorD40: '#307b30', + brandColorD50: '#286728' +}; +/** + * ## Grayscale colors + * + * @colorSet + */ + +var grays = { + white: '#ffffff', + gray98: '#f7f8fa', + gray96: '#f2f4f5', + gray92: '#e1e6eb', + gray80: '#c3cbd4', + gray60: '#818d99', + gray45: '#5c6773', + gray30: '#3c444d', + gray25: '#31373e', + gray22: '#2b3033', + gray20: '#171d21', + black: '#000000' +}; +/** + * ## Accent colors + * + * @colorSet + */ + +var accentColors = { + accentColorL50: '#ecf8ff', + accentColorL40: '#bfe9ff', + accentColorL30: '#7ed2ff', + accentColorL20: '#3ebcff', + accentColorL10: '#00a4fd', + accentColor: '#007abd', + accentColorD10: '#006eaa', + accentColorD20: '#006297', + accentColorD30: '#005684', + accentColorD40: '#004a71', + accentColorD50: '#003d5e' +}; +/** + * ## Error Colors + * + * @colorSet + */ + +var errorColors = { + errorColorL50: '#fcedec', + errorColorL40: '#f8dcd9', + errorColorL30: '#f1b9b3', + errorColorL20: '#ea958d', + errorColorL10: '#e37267', + errorColor: '#dc4e41', + errorColorD10: '#c84535', + errorColorD20: '#b23d30', + errorColorD30: '#9c3529', + errorColorD40: '#852d24', + errorColorD50: '#6f261d' +}; +/** + * ## Alert colors + * + * @colorSet + * */ + +var alertColors = { + alertColorL50: '#fef3ec', + alertColorL40: '#fde6d9', + alertColorL30: '#facdb3', + alertColorL20: '#f7b48c', + alertColorL10: '#f49b66', + alertColor: '#f1813f', + alertColorD10: '#da742e', + alertColorD20: '#c2672a', + alertColorD30: '#aa5a25', + alertColorD40: '#914d1f', + alertColorD50: '#79401a' +}; +/** + * ## Warning colors + * + * @colorSet + */ + +var warningColors = { + warningColorL50: '#fff9eb', + warningColorL40: '#fef2d7', + warningColorL30: '#fde5ae', + warningColorL20: '#fbd886', + warningColorL10: '#facb5d', + warningColor: '#f8be34', + warningColorD10: '#e0ac16', + warningColorD20: '#c79915', + warningColorD30: '#ae8613', + warningColorD40: '#957312', + warningColorD50: '#7d600f' +}; +/** + * ## Success colors + * + * @colorSet + */ + +var successColors = { + successColorL50: '#eef6ee', + successColorL40: '#ddecdd', + successColorL30: '#bbd9ba', + successColorL20: '#98c697', + successColorL10: '#76b374', + successColor: '#53a051', + successColorD10: '#479144', + successColorD20: '#40813d', + successColorD30: '#387135', + successColorD40: '#2f612e', + successColorD50: '#275126' +}; +/** + * ## Info colors + * + * @colorSet + */ + +var infoColors = { + infoColorL50: '#e5f0f5', + infoColorL40: '#cce2eb', + infoColorL30: '#99c5d7', + infoColorL20: '#66a7c4', + infoColorL10: '#338ab0', + infoColor: '#006d9c', + infoColorD10: '#00577c', + infoColorD20: '#004c6c', + infoColorD30: '#00415d', + infoColorD40: '#00364d', + infoColorD50: '#002b3e' +}; +/** + * ## Diverging colors + * + * @colorSet alphabetical + */ + +var divergingColors = { + diverging1ColorA: '#006d9c', + diverging1ColorB: '#ec9960', + diverging2ColorA: '#af575a', + diverging2ColorB: '#62b3b2', + diverging3ColorA: '#4fa484', + diverging3ColorB: '#f8be34', + diverging4ColorA: '#5a4575', + diverging4ColorB: '#708794', + diverging5ColorA: '#294e70', + diverging5ColorB: '#b6c75a' +}; +/** + * ## Categorical Colors + * + * @colorSet alphabetical + */ + +var categoricalColors = { + cat1Color: '#297ba5', + cat1ColorL: '#78b9d6', + cat2Color: '#4fa484', + cat2ColorL: '#74d5c2', + cat3Color: '#b6c75a', + cat3ColorL: '#dce6a5', + cat4Color: '#3c6188', + cat4ColorL: '#a0b2ca', + cat5Color: '#ec9960', + cat5ColorL: '#fac9a7', + cat6Color: '#a65c7d', + cat6ColorL: '#d3a7ba', + cat7Color: '#708794', + cat7ColorL: '#b2c0c8', + cat8Color: '#38b8bf', + cat8ColorL: '#92dde2', + cat9Color: '#ffde63', + cat9ColorL: '#ffeeae', + cat10Color: '#c19975', + cat10ColorL: '#d7bfab', + cat11Color: '#5a4575', + cat11ColorL: '#b7acca', + cat12Color: '#7ea77b', + cat12ColorL: '#b2cab0', + cat13Color: '#576d83', + cat13ColorL: '#a5b2bf', + cat14Color: '#d7c6b7', + cat14ColorL: '#e9ddd4', + cat15Color: '#339bb2', + cat15ColorL: '#66c3d0', + cat16Color: '#236d9b', + cat16ColorL: '#66a7c2', + cat17Color: '#e5dc80', + cat17ColorL: '#f1eab7', + cat18Color: '#96907f', + cat18ColorL: '#c1bcb3', + cat19Color: '#87bc65', + cat19ColorL: '#b6d7a3', + cat20Color: '#cf7e60', + cat20ColorL: '#e1b2a1', + cat21Color: '#7b5547', + cat21ColorL: '#dec4ba', + cat22Color: '#77d6d8', + cat22ColorL: '#abe6e8', + cat23Color: '#4a7f2c', + cat23ColorL: '#91b282', + cat24Color: '#f589ad', + cat24ColorL: '#f8b7ce', + cat25Color: '#6a2c5d', + cat25ColorL: '#cba3c2', + cat26Color: '#aaabae', + cat26ColorL: '#cccdce', + cat27Color: '#9a7438', + cat27ColorL: '#c3ab89', + cat28Color: '#a4d563', + cat28ColorL: '#c7e6a3', + cat29Color: '#7672a4', + cat29ColorL: '#ada9c8', + cat30Color: '#184b81', + cat30ColorL: '#a4bbe0' +}; +/** + * ## Usage-based colors + * + * @colorSet verbose + */ + +var usageColors = { + textColor: grays.gray30, + textGray: '#6b7785', + textDisabledColor: grays.gray80, + linkColor: accentColors.accentColorD10, + linkColorHover: accentColors.accentColor, + borderLightColor: grays.gray92, + borderColor: grays.gray80, + focusColor: accentColors.accentColorD10, + backgroundColorHover: grays.gray96, + backgroundColor: grays.white, + transparent: 'transparent' +}; +/** + * ## Syntax colors + * The following colors should only be used for syntax coloring of code. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#006aa3', + syntaxBlueLight: '#006d9c', + syntaxBrown: '#905b04', + syntaxGray: '#5c6773', + syntaxGreen: '#2f612e', + syntaxGreenLight: '#5ba383', + syntaxOrange: '#a44b0e', + syntaxPink: '#b9139e', + syntaxPurple: '#5317f2', + syntaxPurpleLight: '#b19cd9', + syntaxRed: '#ca163d', + syntaxRedLight: '#af575a', + syntaxTeal: '#1a7060' +}; +/** + * ## Shadows + * + * @shadowSet + */ + +var shadows = { + focusShadow: "0 0 1px 3px ".concat(usageColors.focusColor), + focusShadowInset: "inset 0 0 1px 1px ".concat(grays.white, ", inset 0 0 0 3px ").concat(usageColors.focusColor), + overlayShadow: '0 4px 8px rgba(0, 0, 0, 0.2)' +}; +/** + * ## Backgrounds + * + * @colorSet verbose + */ + +var backgrounds = { + draggableBackground: "url('data:image/png;base64,".concat(dragHandle, "') 0 0 / 8px 8px repeat") +}; +/** + * ## Border + * + * @valueSet + */ + +var borders = { + borderRadius: '3px', + border: "1px solid ".concat(usageColors.borderColor) +}; +var sansFontFamily = "'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif"; +/** + * ## Font family + * + * @valueSet + */ + +var fontFamily = { + sansFontFamily: sansFontFamily, + serifFontFamily: "Georgia, 'Times New Roman', Times, serif", + monoFontFamily: "'Splunk Platform Mono', Inconsolata, Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace", + fontFamily: sansFontFamily +}; +/** + * ## Font weights + * + * Based on [common weight name mappings](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping) + * + * @valueSet + */ + +var fontWeights = { + fontWeightLight: 300, + fontWeightNormal: 400, + fontWeightSemiBold: 500, + fontWeightBold: 700, + fontWeightHeavy: 800, + fontWeightExtraBold: 900 +}; +/** + * ## Layers + * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1. + * + * @valueSet + */ + +var zindexes = { + zindexLayer: 1000, + zindexFixedNavbar: 1030, + zindexModalBackdrop: 1040, + zindexModal: 1050, + zindexPopover: 1060, + zindexToastMessages: 2000 +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors), fontFamily), fontWeights), usageColors), backgrounds), shadows), borders), zindexes); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 32987: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _light = _interopRequireDefault(__webpack_require__(71315)); + +var _dark = _interopRequireDefault(__webpack_require__(90387)); + +var _compact = _interopRequireDefault(__webpack_require__(7438)); + +var _comfortable = _interopRequireDefault(__webpack_require__(82539)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function createPrismaAliases(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var cs = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var d = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + /** + * # Prisma Aliases + * The following aliases for prisma variables are provided for convenience. Just because an alias is provided, + * does not mean it is ideal for enterprise themes in all scenarios. + * + * They cover all values except most `interactiveColor*` variables. + * + * + * For example, use + * ``` css + * const myClickable = styled(Clickable)` + * color: ${variables.contentColorDefault}; + * } + * ``` + * instead of + * ``` css + * const myClickable = styled(Clickable)` + * color: ${pick({ + * enterprise: variables.textColor; + * prisma: variables.contentColorDefault; + * })}; + * } + * ``` + * + * @valueSet + */ + + var prismaAliases = { + accentColorPositive: cs.successColor, + accentColorWarning: cs.warningColor, + accentColorAlert: cs.alertColor, + accentColorNegative: cs.errorColor, + statusColorInfo: cs.infoColorL10, + statusColorNormal: cs.successColorL10, + statusColorLow: cs.warningColorL10, + statusColorMedium: cs.alertColorL10, + statusColorHigh: cs.errorColorL10, + statusColorCritical: cs.errorColorD20, + embossShadow: cs.overlayShadow, + dragShadow: cs.overlayShadow, + modalShadow: cs.overlayShadow, + backgroundColorPopup: cs.backgroundColor, + backgroundColorSection: cs.backgroundColor, + backgroundColorSidebar: cs.backgroundColor, + backgroundColorPage: cs.backgroundColor, + backgroundColorNavigation: cs.backgroundColor, + backgroundColorFloating: cs.backgroundColor, + backgroundColorDialog: cs.backgroundColor, + backgroundColorScrim: (0, _tinycolor["default"])(cs.gray30).setAlpha(0.8).toRgbString(), + contentColorActive: cs.textColor, + contentColorDefault: cs.textColor, + contentColorMuted: cs.textGray, + contentColorDisabled: cs.textDisabledColor, + contentColorInverted: colorScheme === 'dark' ? cs.gray30 : cs.gray30, + neutral100: colorScheme === 'dark' ? cs.gray25 : cs.gray98, + neutral200: colorScheme === 'dark' ? cs.gray30 : cs.gray96, + neutral300: colorScheme === 'dark' ? cs.gray45 : cs.gray92, + neutral400: colorScheme === 'dark' ? cs.gray60 : _tinycolor["default"].mix(cs.gray92, cs.gray80).toRgbString(), + neutral500: cs.gray80, + interactiveColorPrimary: cs.brandColor, + interactiveColorBorder: cs.borderColor, + spacingXSmall: d.spacingQuarter, + spacingSmall: d.spacingHalf, + spacingMedium: "calc(".concat(d.spacing, " * 0.75)"), + spacingLarge: d.spacing, + spacingXLarge: "calc(".concat(d.spacing, " * 1.5)"), + spacingXXLarge: "calc(".concat(d.spacing, " * 2)"), + spacingXXXLarge: "calc(".concat(d.spacing, " * 2.5)") + }; + return prismaAliases; +} + +var _default = createPrismaAliases; +exports["default"] = _default; + +/***/ }), + +/***/ 72443: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _utils = __webpack_require__(71334); + +/** + * The theme settings in `props.theme` are not considered an API to allow support for fallbacks + * and forward compatibility in future versions of `SplunkThemeProvider`. Use this utility to + * access `family`, `colorScheme`, and `density` from a component's props. This is useful + * in limited migration scenarios. Use `withSplunkTheme` or `useSplunkTheme` instead. + * + * ```js + * import getSettingsFromThemedProps from '@splunk/themes/getSettingsFromThemedProps'; + * ... + * const { family, colorScheme } = getSettingsFromThemedProps(props); + * + * ``` + * @param {object} props - The themed props passed to a styled-component. + * @returns {object} An object consisting of `{ family, colorScheme, density }`. + * @public + */ +function getSettingsFromThemedProps(props) { + var _props$theme; + + // props.theme is sometimes null + var _ref = ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.splunkThemeV1) || {}, + family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + + return (0, _utils.addThemeDefaults)({ + family: family, + colorScheme: colorScheme, + density: density + }); +} + +var _default = getSettingsFromThemedProps; +exports["default"] = _default; + +/***/ }), + +/***/ 91282: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearGetThemeCache = exports["default"] = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _enterprise = _interopRequireDefault(__webpack_require__(8395)); + +var _prisma = _interopRequireDefault(__webpack_require__(47804)); + +var _utils = __webpack_require__(71334); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * **NOTE:** Use cases for this function are limited. Instead, use `useSplunkTheme` in React components and `variables` in styled-components' CSS. + * This function is for use outside of React and styled-components. + * @file + */ + +/** + * The `getTheme` function returns all theme variables for a given theme. This function is memoized. + * + * ```js + * import getTheme from '@splunk/themes/getTheme'; + * + * const baseTheme = getTheme({family: 'prisma', colorScheme: 'light', density: 'compact' }); + * + * console.log(baseTheme.family, baseTheme.focusColor); + * ``` + * @param {object} [options] - The attributes of the theme as defined below. + * @param {'prisma' | 'enterprise'} [options.family = 'prisma'] + * @param {'dark' | 'light'} [options.colorScheme = 'dark'] + * @param {'comfortable' | 'compact'} [options.density = 'comfortable'] + * @param {Boolean} [options.isPrisma = true] + * @param {Boolean} [options.isEnterprise = false] + * @param {Boolean} [options.isComfortable = true] + * @param {Boolean} [options.isCompact = false] + * @param {Boolean} [options.isDark = true] + * @param {Boolean} [options.isLight = false] + * @returns {object} A flat object of all variables and their values. + * @public + */ +function getTheme() { + var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var _addThemeDefaults = (0, _utils.addThemeDefaults)(settings), + family = _addThemeDefaults.family, + colorScheme = _addThemeDefaults.colorScheme, + density = _addThemeDefaults.density; + + var isPrisma = family === 'prisma'; + var isEnterprise = family === 'enterprise'; + var isComfortable = density === 'comfortable'; + var isCompact = density === 'compact'; + var isDark = colorScheme === 'dark'; + var isLight = colorScheme === 'light'; + return Object.freeze(_objectSpread({ + colorScheme: colorScheme, + density: density, + family: family, + isPrisma: isPrisma, + isEnterprise: isEnterprise, + isComfortable: isComfortable, + isCompact: isCompact, + isDark: isDark, + isLight: isLight + }, family === 'enterprise' ? (0, _enterprise["default"])({ + colorScheme: colorScheme, + density: density + }) : (0, _prisma["default"])({ + colorScheme: colorScheme, + density: density + }))); +} + +var getThemeMemoized = (0, _memoize["default"])(getTheme, function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + + return "".concat(family).concat(colorScheme).concat(density); +}); + +var clearGetThemeCache = function clearGetThemeCache() { + var _getThemeMemoized$cac, _getThemeMemoized$cac2; + + return (_getThemeMemoized$cac = (_getThemeMemoized$cac2 = getThemeMemoized.cache).clear) === null || _getThemeMemoized$cac === void 0 ? void 0 : _getThemeMemoized$cac.call(_getThemeMemoized$cac2); +}; + +exports.clearGetThemeCache = clearGetThemeCache; +var _default = getThemeMemoized; +exports["default"] = _default; + +/***/ }), + +/***/ 28219: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + getSettingsFromThemedProps: true, + getTheme: true, + mixins: true, + pick: true, + pickVariant: true, + SplunkThemeProvider: true, + useSplunkTheme: true, + withSplunkTheme: true, + variables: true +}; +Object.defineProperty(exports, "getSettingsFromThemedProps", ({ + enumerable: true, + get: function get() { + return _getSettingsFromThemedProps["default"]; + } +})); +Object.defineProperty(exports, "getTheme", ({ + enumerable: true, + get: function get() { + return _getTheme["default"]; + } +})); +Object.defineProperty(exports, "mixins", ({ + enumerable: true, + get: function get() { + return _mixins["default"]; + } +})); +Object.defineProperty(exports, "pick", ({ + enumerable: true, + get: function get() { + return _pick["default"]; + } +})); +Object.defineProperty(exports, "pickVariant", ({ + enumerable: true, + get: function get() { + return _pickVariant["default"]; + } +})); +Object.defineProperty(exports, "SplunkThemeProvider", ({ + enumerable: true, + get: function get() { + return _SplunkThemeProvider["default"]; + } +})); +Object.defineProperty(exports, "useSplunkTheme", ({ + enumerable: true, + get: function get() { + return _useSplunkTheme["default"]; + } +})); +Object.defineProperty(exports, "withSplunkTheme", ({ + enumerable: true, + get: function get() { + return _withSplunkTheme["default"]; + } +})); +Object.defineProperty(exports, "variables", ({ + enumerable: true, + get: function get() { + return _variables["default"]; + } +})); + +var _getSettingsFromThemedProps = _interopRequireDefault(__webpack_require__(72443)); + +var _getTheme = _interopRequireDefault(__webpack_require__(91282)); + +var _mixins = _interopRequireDefault(__webpack_require__(74666)); + +var _pick = _interopRequireDefault(__webpack_require__(17130)); + +var _pickVariant = _interopRequireDefault(__webpack_require__(77669)); + +var _SplunkThemeProvider = _interopRequireDefault(__webpack_require__(51962)); + +var _useSplunkTheme = _interopRequireDefault(__webpack_require__(52778)); + +var _withSplunkTheme = _interopRequireDefault(__webpack_require__(53699)); + +var _variables = _interopRequireDefault(__webpack_require__(29290)); + +var _types = __webpack_require__(34522); + +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _types[key]; + } + }); +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/***/ }), + +/***/ 74666: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + typography: true +}; +Object.defineProperty(exports, "typography", ({ + enumerable: true, + get: function get() { + return _typography["default"]; + } +})); +exports["default"] = void 0; + +var _utilityMixins = _interopRequireWildcard(__webpack_require__(21684)); + +Object.keys(_utilityMixins).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _utilityMixins[key]; + } + }); +}); + +var _typography = _interopRequireWildcard(__webpack_require__(33457)); + +Object.keys(_typography).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _typography[key]; + } + }); +}); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var _default = _objectSpread(_objectSpread({}, _utilityMixins["default"]), {}, { + typography: _typography["default"] +}); + +exports["default"] = _default; + +/***/ }), + +/***/ 33457: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.typographyVariants = exports["default"] = void 0; + +var _styledComponents = __webpack_require__(92568); + +var _merge = _interopRequireDefault(__webpack_require__(55364)); + +var _variables = _interopRequireDefault(__webpack_require__(29290)); + +var _pick = _interopRequireDefault(__webpack_require__(17130)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _templateObject2() { + var data = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n "]); + + _templateObject2 = function _templateObject2() { + return data; + }; + + return data; +} + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n ", "\n\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n "]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var typographyVariants = ['body', 'title1', 'title2', 'title3', 'title4', 'title5', 'title6', 'title7', 'largeBody', 'smallBody', 'footnote', 'monoBody', 'monoSmallBody']; +exports.typographyVariants = typographyVariants; + +function isTypographyVariant(s) { + if (typeof s !== 'string') { + return false; + } + + return typographyVariants.includes(s); +} + +function getStylesForVariant(variant) { + var color = _variables["default"].contentColorDefault; + var family = _variables["default"].fontFamily; + var lineHeight = _variables["default"].lineHeight; // eslint-disable-line prefer-destructuring + + var size = _variables["default"].fontSize; + var weight = 'normal'; // TODO: After sections are removed from Heading update HeadingStyles accordingly to preserve section styles as typography variants SUI-5268 + + switch (variant) { + case 'title1': + color = _variables["default"].contentColorActive; + lineHeight = (0, _pick["default"])({ + enterprise: '20px', + prisma: '48px' + }); + size = (0, _pick["default"])({ + enterprise: '24px', + prisma: '36px' + }); + weight = (0, _pick["default"])({ + enterprise: '500', + prisma: _variables["default"].fontWeightBold + }); + break; + + case 'title2': + color = _variables["default"].contentColorActive; + lineHeight = (0, _pick["default"])({ + enterprise: '20px', + prisma: '24px' + }); + size = (0, _pick["default"])({ + enterprise: '18px', + prisma: '24px' + }); + weight = (0, _pick["default"])({ + enterprise: '500', + prisma: _variables["default"].fontWeightBold + }); + break; + + case 'title3': + color = _variables["default"].contentColorActive; + lineHeight = (0, _pick["default"])({ + enterprise: '20px', + prisma: '24px' + }); + size = (0, _pick["default"])({ + enterprise: '16px', + prisma: '20px' + }); + weight = (0, _pick["default"])({ + enterprise: '500', + prisma: _variables["default"].fontWeightBold + }); + break; + + case 'title4': + color = _variables["default"].contentColorActive; + lineHeight = (0, _pick["default"])({ + enterprise: '20px', + prisma: '24px' + }); + size = (0, _pick["default"])({ + enterprise: _variables["default"].fontSize, + prisma: '16px' + }); + weight = _variables["default"].fontWeightBold; + break; + + case 'title5': + color = _variables["default"].contentColorActive; + lineHeight = _variables["default"].lineHeight; + size = (0, _pick["default"])({ + enterprise: '12px', + prisma: _variables["default"].fontSize + }); + weight = (0, _pick["default"])({ + enterprise: _variables["default"].fontWeightSemiBold, + prisma: _variables["default"].fontWeightBold + }); + break; + + case 'title6': + color = _variables["default"].contentColorActive; + lineHeight = (0, _pick["default"])({ + enterprise: _variables["default"].lineHeight, + prisma: '16px' + }); + size = (0, _pick["default"])({ + enterprise: '12px', + prisma: '13px' + }); + weight = _variables["default"].fontWeightSemiBold; + break; + + case 'title7': + color = _variables["default"].contentColorActive; + lineHeight = '16px'; + size = _variables["default"].fontSizeSmall; + weight = _variables["default"].fontWeightSemiBold; + break; + + case 'largeBody': + color = _variables["default"].contentColorDefault; + lineHeight = '24px'; + size = _variables["default"].fontSizeLarge; + weight = 'normal'; + break; + + case 'smallBody': + color = _variables["default"].contentColorDefault; + lineHeight = '16px'; + size = _variables["default"].fontSizeSmall; + weight = 'normal'; + break; + + case 'footnote': + color = _variables["default"].contentColorDefault; + lineHeight = '13px'; + size = '10px'; + weight = 'normal'; + break; + + case 'monoBody': + family = _variables["default"].monoFontFamily; + break; + + case 'monoSmallBody': + color = _variables["default"].contentColorDefault; + family = _variables["default"].monoFontFamily; + lineHeight = '16px'; + size = _variables["default"].fontSizeSmall; + weight = 'normal'; + break; + + case 'body': + // Theme defaults set the 'body' style + break; + + default: + { + if (false) {} // Make sure this "never" happens https://www.typescriptlang.org/docs/handbook/2/narrowing.html#exhaustiveness-checking + + + var exhaustiveCheck = variant; + return exhaustiveCheck; + } + } + + return { + color: color, + family: family, + size: size, + weight: weight, + lineHeight: lineHeight, + withReset: true + }; +} + +var colorPropToVariableMap = { + active: _variables["default"].contentColorActive, + "default": _variables["default"].contentColorDefault, + disabled: _variables["default"].contentColorDisabled, + inverted: _variables["default"].contentColorInverted, + muted: _variables["default"].contentColorMuted, + inherit: 'inherit' +}; +var familyPropToVariableMap = { + sansSerif: _variables["default"].sansFontFamily, + monospace: _variables["default"].monoFontFamily +}; // As defined by [font-weight | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping) + +var weightPropToValueMap = { + light: _variables["default"].fontWeightLight, + normal: _variables["default"].fontWeightNormal, + semiBold: _variables["default"].fontWeightSemiBold, + bold: _variables["default"].fontWeightBold, + extraBold: _variables["default"].fontWeightExtraBold, + heavy: _variables["default"].fontWeightHeavy +}; +/** + * A mixin for styling text content using predefined typography variants + * and/or customizing font-settings with system parameters: e.g. size, weight, font-family. + * + * The default variant is `body` and will be used if no variant or settings + * are given: i.e. `typography()` or `typography({})`. + * Variants have the reset applied by default. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { typography } from '@splunk/themes/mixins'; + * + * const MyTitle = styled.h1` + * ${typography('title1')}; + * `; + * + * const MyCustomizedTitle = styled.h1` + * ${typography('title1', { color: 'inverted' })}; + * `; + * + * const CustomTitle = styled.h1` + * ${typography({size: 56, weight: 'light', color: 'inverted' })}; + * `; + * ``` + * @name typography + * @kind function + * @param {string} [variant] Use a predefined typography variant: + * `'body'`, + * `'title1'`, + * `'title2'`, + * `'title3'`, + * `'title4'`, + * `'title5'`, + * `'title6'`, + * `'title7'`, + * `'largeBody'`, + * `'smallBody'`, + * `'footnote'`, + * `'monoBody'`, or + * `'monoSmallBody'`, + * @param {object} [typographyParams] Customize the font settings or element using system values for: `family`, `size`, `lineHeight`, `color`, and `weight`. + * Default margin and padding can be removed with `withReset`. + * @public + */ + +function typography(variantOrParams, additionalParams) { + var variant = isTypographyVariant(variantOrParams) ? variantOrParams : undefined; + var params; + + if (variant && additionalParams !== undefined) { + params = additionalParams; + } else if (variant === undefined && _typeof(variantOrParams) === 'object' && additionalParams === undefined) { + params = variantOrParams; + } else { + params = {}; + } + + var variantParams = variant ? getStylesForVariant(variant) : {}; // Transform params to be ready for css literal below: i.e size="24" -> "24px" + + var transformedParams = _objectSpread(_objectSpread({}, params), {}, { + size: params.size ? "".concat(params.size, "px") : undefined, + lineHeight: params.lineHeight ? "".concat(params.lineHeight, "px") : undefined, + color: params.color ? colorPropToVariableMap[params.color] : undefined, + family: params.family ? familyPropToVariableMap[params.family] : undefined, + weight: params.weight ? weightPropToValueMap[params.weight] : undefined + }); + + var defaultTypographyParams = { + color: _variables["default"].contentColorDefault, + family: _variables["default"].fontFamily, + size: _variables["default"].fontSize, + weight: 'normal', + lineHeight: _variables["default"].lineHeight, + withReset: false + }; + var finalParams = (0, _merge["default"])(defaultTypographyParams, variantParams, transformedParams); + return function () { + return (0, _styledComponents.css)(_templateObject(), function () { + return finalParams.withReset && (0, _styledComponents.css)(_templateObject2()); + }, finalParams.color, finalParams.family, finalParams.size, finalParams.weight, finalParams.lineHeight); + }; +} + +var _default = typography; +exports["default"] = _default; + +/***/ }), + +/***/ 21684: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearfix = clearfix; +exports.ellipsis = ellipsis; +exports.printWidth100Percent = printWidth100Percent; +exports.printHide = printHide; +exports.printNoBackground = printNoBackground; +exports.printWrapAll = printWrapAll; +exports.screenReaderContent = screenReaderContent; +exports.overlayColors = overlayColors; +exports.colorWithAlpha = colorWithAlpha; +exports["default"] = exports.reset = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _styledComponents = __webpack_require__(92568); + +var _colorBlend = __webpack_require__(94581); + +var _variables = _interopRequireDefault(__webpack_require__(29290)); + +var _pick = _interopRequireDefault(__webpack_require__(17130)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n /* Generic resets */\n animation: none 0s ease 0s 1 normal none running;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n box-shadow: none;\n caption-side: top;\n clear: none;\n clip: auto;\n color-scheme: ", ";\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n empty-cells: show;\n float: none;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n list-style: disc outside none;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n pointer-events: auto;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-origin: 50% 50% 0;\n transform-style: flat;\n transition: none 0s ease 0s;\n user-select: auto;\n vertical-align: baseline;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n /* Splunk-specific resets */\n border-width: 1px;\n box-sizing: border-box;\n color: ", ";\n cursor: inherit;\n display: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +/** + * @file + * A collection of style-related helper functions. All of them return a single object containing + * DOM CSS properties, for example: `{ display: …, fontFamily: … }`. + */ + +/** + * The `reset` mixin resets css properties to their browser defaults, plus many to + * theme-specific values. This ensures an element is not inheriting inappropriate styles. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { reset } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${reset('block')}; + * ` + * ``` + * @name reset + * @kind function + * @param {string} [display=inline] Set the `display` property (block, inline-block, …) + * @public + */ +var reset = function reset() { + var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline'; + return function () { + return (0, _styledComponents.css)(_templateObject(), (0, _pick["default"])({ + /* + use pick() rather than relying on variables.colorScheme + because there's no guarantee that variables.colorScheme + has to match the css color-scheme prop + */ + dark: 'dark', + light: 'light' + }), (0, _pick["default"])({ + enterprise: _variables["default"].textColor, + prisma: _variables["default"].contentColorDefault + }), display, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor); + }; +}; +/** + * `clearfix` is used on a container to ensure its height is at least as tall as any floating + * children. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { clearfix } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${clearfix()}; + * ` + * ``` + * @public + */ + + +exports.reset = reset; + +function clearfix() { + return { + '&::after': { + display: 'table', + content: '""', + clear: 'both' + } + }; +} +/** + * Use `ellipsis` for overflowing text. Requires `display` to be set to `inline-block` or `block`. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { ellipsis } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${ellipsis()}; + * width: 300px; + * ` + * ``` + * @public + */ + + +function ellipsis() { + return { + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap' + }; +} +/** + * Force an element to be exactly 100% wide so that it doesn't overflow the page. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printWidth100Percent } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printWidth100Percent()}; + * } + * } + * } + * ` + * ``` + * @public + */ + + +function printWidth100Percent() { + return { + maxWidth: '100% !important', + width: '100% !important', + overflow: 'hidden !important' + }; +} +/** + * Hide an element (such as a button). + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printHide } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printHide()}; + * } + * } + * } + * ``` + * @public + */ + + +function printHide() { + return { + display: 'none !important' + }; +} +/** + * Remove background gradients and images. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printNoBackground } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printNoBackground()}; + * } + * } + * } + * ``` + * @public + */ + + +function printNoBackground() { + return { + background: 'none !important' + }; +} +/** + * Ensure that all text wraps so that it doesn't overflow the page. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printWrapAll } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printWrapAll()}; + * } + * } + * } + * ``` + * @public + */ + + +function printWrapAll() { + // TS: have to assert as CSSObject because csstype doesn't allow !important + return { + wordBreak: 'break-all !important', + wordWrap: 'break-word !important', + overflowWrap: 'break-word !important', + whiteSpace: 'normal !important' + }; +} +/** + * Visually hide content. Typically used to target content for assistive technologies. + * + * ##### Example + * ``` js + * import screenReaderContent from '@splunk/themes/mixins'; + * + * .myElement { + * ${props => props.theme.mixins.screenReaderContent()}; + * } + * ``` + * @public + */ + + +function screenReaderContent() { + return { + position: 'absolute', + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + height: '1px', + width: '1px', + margin: '-1px', + padding: 0, + border: 0 + }; +} + +/** + * Calculates how one color would appear over another using a normal blend mode. + * Colors can either be strings or functions, such as variable functions. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { overlayColors } from '@splunk/themes/mixins'; + * import { interactiveColorPrimary, interactiveColorOverlaySelected } from '@splunk/themes/variables'; + * + * const myButton = styled.button` + * background: ${overlayColors(interactiveColorPrimary, interactiveColorOverlaySelected)}; + * ` + * ``` + * @name overlayColors + * @kind function + * @param {string|function} background + * @param {string|function} foreground The color to overlay over the background. + * @public + */ +function overlayColors(c1, c2) { + return function (props) { + var c1Value = typeof c1 === 'function' ? c1(props) : c1; + var c2Value = typeof c2 === 'function' ? c2(props) : c2; + var c3 = (0, _colorBlend.normal)((0, _tinycolor["default"])(c1Value).toRgb(), (0, _tinycolor["default"])(c2Value).toRgb()); + return (0, _tinycolor["default"])(c3).toRgbString(); + }; +} +/** + * Sets the alpha value on a given color. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { colorWithAlpha } from '@splunk/themes/mixins'; + * import { interactiveColorPrimary } from '@splunk/themes/variables'; + * + * const myButton = styled.button` + * background: ${colorWithAlpha(interactiveColorPrimary, 0.5)}; + * ` + * ``` + * @name colorWithAlpha + * @kind function + * @param {string|function} color + * @param {number} alpha The alpha value accepts range between 0-1. + * @public + */ + + +function colorWithAlpha(color, alpha) { + return function (props) { + var colorValue = typeof color === 'function' ? color(props) : color; + + if (false) {} + + return (0, _tinycolor["default"])(colorValue).setAlpha(alpha).toRgbString(); + }; +} + +var _default = { + reset: reset, + clearfix: clearfix, + ellipsis: ellipsis, + printWidth100Percent: printWidth100Percent, + printHide: printHide, + printNoBackground: printNoBackground, + printWrapAll: printWrapAll, + screenReaderContent: screenReaderContent, + colorWithAlpha: colorWithAlpha, + overlayColors: overlayColors +}; +exports["default"] = _default; + +/***/ }), + +/***/ 17130: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isInterpolationResult = isInterpolationResult; +exports["default"] = exports.getThemeVariant = void 0; + +var _utils = __webpack_require__(71334); + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var valueToKey = { + enterprise: 'family', + prisma: 'family', + light: 'colorScheme', + dark: 'colorScheme', + compact: 'density', + comfortable: 'density' +}; + +function isInterpolationResult(tree) { + // for this to work as expected for objects/CSSProperties, it may be necessary to change + // it to only consider objects that have valid pick tree keys (but no other keys) + // as trees + return _typeof(tree) !== 'object' || Array.isArray(tree) || tree === null; +} +/** + * This function is exported for use in pickVariant exclusively. + */ + + +var getThemeVariant = function getThemeVariant(tree, theme) { + // If it's not an object with one of the six keys, it must be an end value. + var treeKey = Object.keys(tree).shift(); + + if (!treeKey) { + throw new Error('A pick tree cannot be empty.'); + } + + var themeKey = valueToKey[treeKey]; + + if (!themeKey) { + throw new Error("Invalid pick tree key: ".concat(treeKey)); + } // Recursively crawl the tree. + + + var themeCurrentValue = theme[themeKey]; + var treeValue = tree[themeCurrentValue]; // If it's not an object or it's a null value, it must be the end value. + + if (isInterpolationResult(treeValue)) { + return treeValue; // this may be undefined, when the css does not support the theme + } + + return getThemeVariant(treeValue, theme); +}; +/** + * Pick is used to create theme-specific css. + * + * This example selects an appropriate variable for the current theme. + * ``` + * import { pick, variables } from '@splunk/themes'; + * + * const Wrapper = styled.div` + * color: ${pick({ + * enterprise: { + * light: variables.grey35, + * dark: variables.grey92, + * }, + * prisma: variables.contentColorDefault, + * })} + * `; + * ``` + * This example selects an appropriate block of css for the current theme. + * ``` + * const Label = styled.div` + * ${pick({ + * enterprise: css` + * font-weight: ${variables.fontWeightSemiBold}; + * `, + * prisma: css` + * color: ${variables.contentColorDefault), + * `, + * })} + * `; + * ``` + * @param {object} themeOptions - An object consisting of a tree of theme options (`enterprise|prisma`, `light|dark`, or `compact|comfortable`). + * @returns {function} The returned function is called by `styled-components`, which provides the theme context. + * @public + */ + + +exports.getThemeVariant = getThemeVariant; + +var pick = function pick(tree) { + return function (_ref) { + var theme = _ref.theme; + var themeCleaned = (0, _utils.addThemeDefaults)(theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1); + return getThemeVariant(tree, themeCleaned); + }; +}; + +var _default = pick; +exports["default"] = _default; + +/***/ }), + +/***/ 77669: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _pick = __webpack_require__(17130); + +var _utils = __webpack_require__(71334); + +/** + * Pick Variant is used to create theme-specific css. + * + * This example selects an appropriate variable for the current theme. + * ``` + * import { pickVariant } from '@splunk/themes'; + * + * ... + * + * const Wrapper = styled.div` + * ${pickVariant('appearance', { + * filled: 'background: red', + * open: 'border: 1px solid red', + * })} + * `; + * ``` + * This example selects an appropriate block of css for the current theme. + * ``` + * const Wrapper = styled.div` + * ${pickVariant('appearance', { + * filled: { + * enterprise: 'background: green', + * prisma: 'background: blue', + * }, + * open: { + * enterprise: 'border: 1px solid green', + * prisma: 'border: 1px solid blue', + * }, + * })} + * `; + * ``` + * @param {string} propName - The prop name used to resolve the variants. The prop value must be a `string` or `boolean`. + * @param {object} themeOptions - An object consisting of a tree of theme options, with the prop variants the top of the tree and optional + * theme variants below (`enterprise|prisma`, `light|dark`, or `compact|comfortable`). + * @returns {function} The returned function is called by `styled-components`, which provides the props and theme context. + * @public + */ +var pickVariant = function pickVariant(propName, tree) { + return function (props) { + var _props$theme; + + // TS: must assume prop value can be used as string key + var variantKey = props[propName]; + var subTree = tree[variantKey]; + + if ((0, _pick.isInterpolationResult)(subTree)) { + return subTree; + } + + var theme = (0, _utils.addThemeDefaults)((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.splunkThemeV1); + return (0, _pick.getThemeVariant)(subTree, theme); + }; +}; + +var _default = pickVariant; +exports["default"] = _default; + +/***/ }), + +/***/ 57315: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _dataViz = _interopRequireDefault(__webpack_require__(63509)); + +var _light = _interopRequireDefault(__webpack_require__(76392)); + +var _dark = _interopRequireDefault(__webpack_require__(3714)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function createPrismaBase(_ref) { + var colorScheme = _ref.colorScheme; + var colorSchemeVars = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + /** + * ## Misc. colors + * + * @colorSet verbose + */ + + var usageColors = { + focusColor: (0, _tinycolor["default"])(colorSchemeVars.interactiveColorPrimary).setAlpha(0.7).toRgbString(), + transparent: 'transparent', + linkColor: colorSchemeVars.interactiveColorPrimary + }; + /** + * ## Interactive state shadows + * + * @shadowSet + * + */ + + var shadows = { + hoverShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(colorSchemeVars.interactiveColorOverlayHover), + focusShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(usageColors.focusColor), + focusShadowInset: "inset 0 0 0 3px ".concat(usageColors.focusColor) + }; + /** + * ## Backgrounds + * + * @colorSet verbose + */ + + var backgrounds = { + draggableBackground: "radial-gradient(circle at 1px 1px, ".concat(colorSchemeVars.contentColorMuted, ", ").concat(colorSchemeVars.contentColorMuted, " 1px, transparent 1px) 0 0 / 4px 6px") + }; + var sansFontFamily = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif"; + /** + * ## Font family + * + * @valueSet + */ + + var fontFamily = { + sansFontFamily: sansFontFamily, + serifFontFamily: "Georgia, 'Times New Roman', Times, serif", + monoFontFamily: "'Splunk Platform Mono', 'Roboto Mono', Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace", + fontFamily: sansFontFamily + }; + /** + * ## Font weights + * + * Based on [common weight name mappings](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping) + * + * @valueSet + */ + + var fontWeights = { + fontWeightLight: 300, + fontWeightNormal: 400, + fontWeightSemiBold: 500, + fontWeightBold: 700, + fontWeightHeavy: 800, + fontWeightExtraBold: 900 + }; + /** + * ## Layers + * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1. + * + * @valueSet + */ + + var zindexes = { + zindexLayer: 1000, + zindexFixedNavbar: 1030, + zindexModalBackdrop: 1040, + zindexModal: 1050, + zindexPopover: 1060, + zindexToastMessages: 2000 + }; + return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fontFamily), fontWeights), usageColors), _dataViz["default"]), shadows), backgrounds), zindexes); +} + +var _default = createPrismaBase; +exports["default"] = _default; + +/***/ }), + +/***/ 42216: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * ## Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * + * @valueSet + */ +var measures = { + spacingXSmall: '4px', + spacingSmall: '8px', + spacingMedium: '12px', + spacingLarge: '16px', + spacingXLarge: '24px', + spacingXXLarge: '32px', + spacingXXXLarge: '40px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '40px', + borderRadius: '4px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 52909: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * ## Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * * Larger containers, such as `Card` or `Modal`, use `spacing`. + * * `spacingHalf` and `spacingQuarter` are primarily for horizontal spacing between smaller elements. + * * Just because a desired value equals 20, 10, or 5 pixels, does not mean it's appropriate to + * use spacing variables. + * + * @valueSet + */ +var measures = { + spacingXSmall: '4px', + spacingSmall: '8px', + spacingMedium: '12px', + spacingLarge: '16px', + spacingXLarge: '24px', + spacingXXLarge: '32px', + spacingXXXLarge: '40px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '32px', + borderRadius: '4px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 3714: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * ## Background colors + * Background colors should be used only for backgrounds of higher level sections & containers of a UI. + * + * @colorSet verbose + */ +var backgroundColors = { + backgroundColorPopup: '#27292e', + backgroundColorSection: '#1a1c20', + backgroundColorSidebar: '#0b0c0e', + backgroundColorPage: '#111215', + backgroundColorNavigation: '#08090a', + backgroundColorFloating: '#ffffff', + backgroundColorDialog: '#1e2024', + backgroundColorScrim: 'rgba(0, 0, 0, 0.8)' +}; +/** + * ## Content colors + * Content colors should be used for text, icons and dividers. + * + * @colorSet verbose + */ + +var contentColors = { + contentColorActive: '#fafafa', + contentColorDefault: '#b5b5b5', + contentColorDisabled: '#6b6b6b', + contentColorInverted: '#000000', + contentColorMuted: '#909090' +}; +/** + * ## Interactive colors + * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content. + * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary. + * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two. + * + * @colorSet verbose + */ + +var interactiveColors = { + interactiveColorPrimary: '#3993FF', + interactiveColorBorder: 'rgba(255, 255, 255, 0.5)', + interactiveColorBorderHover: 'rgba(255, 255, 255, 0.7)', + interactiveColorBorderDisabled: 'rgba(255, 255, 255, 0.30)', + interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)', + interactiveColorOverlayHover: 'rgba(255, 255, 255, 0.05)', + interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.2)', + interactiveColorOverlayDrag: 'rgba(57, 147, 255, 0.16)', + interactiveColorBackground: '#272a2f', + interactiveColorBackgroundDisabled: 'rgba(255, 255, 255, 0.15)' +}; +/** + * ## Neutral colors + * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough. + * + * @colorSet verbose + */ + +var neutralColors = { + black: '#000000', + neutral100: '#33343b', + neutral200: '#43454b', + neutral300: '#505158', + neutral400: '#818285', + neutral500: '#acacad', + white: '#ffffff' +}; +/** + * ## Accent colors + * Accent colors aid and categorize the visual communication of the system response. + * + * @colorSet verbose + */ + +var accentColors = { + accentColorPositive: '#85f415', + accentColorWarning: '#f49106', + accentColorAlert: '#f0581f', + accentColorNegative: '#ff4242' +}; +/** + * ## Status colors + * Status colors are reserved for communicating urgency and severity associated with data objects. + * + * @colorSet verbose + */ + +var statusColors = { + statusColorInfo: '#61cafa', + statusColorNormal: '#85f415', + statusColorLow: '#2cbda3', + statusColorMedium: '#f49106', + statusColorHigh: '#ff4242', + statusColorCritical: '#ff3361' +}; +/** + * ## Elevation shadows + * + * @shadowSet + * + */ + +var elevationShadows = { + embossShadow: '0px 1px 5px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(0, 0, 0, 0.35)', + overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)', + dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)', + modalShadow: '0px 50px 200px #000000, 0px 29px 66px rgba(0, 0, 0, 0.41), 0px 14px 47px rgba(0, 0, 0, 0.17), 0px 5px 10px rgba(0, 0, 0, 0.15)' +}; +/** + * ## Syntax colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#6cd0f0', + syntaxBrown: '#fccf87', + syntaxGray: '#909090', + syntaxGreen: '#cef06c', + syntaxOrange: '#f7933f', + syntaxPink: '#f494e5', + syntaxPurple: '#ab74f1', + syntaxRed: '#e9627f', + syntaxTeal: '#45d4ba' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, accentColors), statusColors), elevationShadows), backgroundColors), contentColors), neutralColors), interactiveColors), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 63509: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = exports.highLow = exports.sequential = exports.divergent = exports.categorical = exports.staticColors = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * ## Data viz + * + * Colors should be used in their prescribed order. + * Don't mix-and-match between sets in the same visualization. + * + * ### Static colors + * + * @colorSet verbose + */ +var staticColors = { + static1: '#7B56DB', + static2: '#009CEB', + static3: '#00CDAF', + static4: '#DD9900', + static5: '#FF677B', + static6: '#CB2196', + static7: '#813193', + static8: '#0051B5', + static9: '#008C80', + static10: '#99B100', + static11: '#FFA476', + static12: '#FF6ACE', + static13: '#AE8CFF', + static14: '#00689D', + static15: '#00490A', + static16: '#465D00', + static17: '#9D6300', + static18: '#F6540B', + static19: '#FF969E', + static20: '#E47BFE' +}; +/** + * ### Categorical 1D + * + * @colorSet verbose + */ + +exports.staticColors = staticColors; +var categorical1D = { + categorical1D1: '#5C33FF', + categorical1D2: '#207865', + categorical1D3: '#AD3F20', + categorical1D4: '#003E80', + categorical1D5: '#78062A', + categorical1D6: '#2F8811', + categorical1D7: '#555555' +}; +/** + * ### Categorical 1L + * + * @colorSet verbose + */ + +var categorical1L = { + categorical1L1: '#9980FF', + categorical1L2: '#45D4BA', + categorical1L3: '#FB865C', + categorical1L4: '#66AAF9', + categorical1L5: '#E85B79', + categorical1L6: '#88EE66', + categorical1L7: '#F0B000' +}; +/** + * ### Categorical 2D + * + * @colorSet verbose + */ + +var categorical2D = { + categorical2D1: '#1F4D5B', + categorical2D2: '#CC0AD6', + categorical2D3: '#017FA2', + categorical2D4: '#D81E5B', + categorical2D5: '#621FFF', + categorical2D6: '#348350', + categorical2D7: '#555555' +}; +/** + * ### Categorical 2L + * + * @colorSet verbose + */ + +var categorical2L = { + categorical2L1: '#5599BE', + categorical2L2: '#FB9DFB', + categorical2L3: '#00BBEE', + categorical2L4: '#EE3399', + categorical2L5: '#9980FF', + categorical2L6: '#5FBF7F', + categorical2L7: '#F58B00' +}; + +var categorical = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, categorical1D), categorical1L), categorical2D), categorical2L); +/** + * ### Divergent 1D + * + * @colorSet verbose + */ + + +exports.categorical = categorical; +var divergent1D = { + divergent1D1: '#118832', + divergent1D2: '#1C6B2D', + divergent1D3: '#284D27', + divergent1D4: '#333022', + divergent1D5: '#692A21', + divergent1D6: '#9E2520', + divergent1D7: '#D41F1F' +}; +/** + * ### Divergent 1L + * + * @colorSet verbose + */ + +var divergent1L = { + divergent1L1: '#08AE37', + divergent1L2: '#55C169', + divergent1L3: '#A1D59C', + divergent1L4: '#EEE8CE', + divergent1L5: '#F4BAA9', + divergent1L6: '#F98C83', + divergent1L7: '#FF5E5E' +}; +/** + * ### Divergent 2D + * + * @colorSet verbose + */ + +var divergent2D = { + divergent2D1: '#0070F3', + divergent2D2: '#115BAD', + divergent2D3: '#224468', + divergent2D4: '#333022', + divergent2D5: '#692A21', + divergent2D6: '#9E2520', + divergent2D7: '#D41F1F' +}; +/** + * ### Divergent 2L + * + * @colorSet verbose + */ + +var divergent2L = { + divergent2L1: '#2A99FF', + divergent2L2: '#6BB3EE', + divergent2L3: '#ADCCDD', + divergent2L4: '#EEE8CE', + divergent2L5: '#F4BAA9', + divergent2L6: '#F98C83', + divergent2L7: '#FF5E5E' +}; +/** + * ### Divergent 3D + * + * @colorSet verbose + */ + +var divergent3D = { + divergent3D1: '#299986', + divergent3D2: '#277C52', + divergent3D3: '#24551F', + divergent3D4: '#333022', + divergent3D5: '#422879', + divergent3D6: '#602CA1', + divergent3D7: '#8747DA' +}; +/** + * ### Divergent 3L + * + * @colorSet verbose + */ + +var divergent3L = { + divergent3L1: '#14846C', + divergent3L2: '#45D4BA', + divergent3L3: '#9ADEC4', + divergent3L4: '#EEE8CE', + divergent3L5: '#D7BEE4', + divergent3L6: '#C093F9', + divergent3L7: '#9156DD' +}; +/** + * ### Divergent 4D + * + * @colorSet verbose + */ + +var divergent4D = { + divergent4D1: '#0D8387', + divergent4D2: '#1A6765', + divergent4D3: '#264C44', + divergent4D4: '#333022', + divergent4D5: '#693623', + divergent4D6: '#9F3B23', + divergent4D7: '#D54124' +}; +/** + * ### Divergent 4L + * + * @colorSet verbose + */ + +var divergent4L = { + divergent4L1: '#008287', + divergent4L2: '#2EA39B', + divergent4L3: '#5CC3AF', + divergent4L4: '#EEE8CE', + divergent4L5: '#ECA14E', + divergent4L6: '#E3723A', + divergent4L7: '#DA4325' +}; + +var divergent = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, divergent1D), divergent1L), divergent2D), divergent2L), divergent3D), divergent3L), divergent4D), divergent4L); +/** + * ### Sequential 1D + * + * @colorSet verbose + */ + + +exports.divergent = divergent; +var sequential1D = { + sequential1D1: '#118832', + sequential1D2: '#669922', + sequential1D3: '#9D9F0D', + sequential1D4: '#CBA700', + sequential1D5: '#D97A0D', + sequential1D6: '#D94E17', + sequential1D7: '#D41F1F' +}; +/** + * ### Sequential 1L + * + * @colorSet verbose + */ + +var sequential1L = { + sequential1L1: '#088F44', + sequential1L2: '#2EB82E', + sequential1L3: '#C3CC33', + sequential1L4: '#FFD442', + sequential1L5: '#FFA857', + sequential1L6: '#FF7149', + sequential1L7: '#FE3A3A' +}; +/** + * ### Sequential 2D + * + * @colorSet verbose + */ + +var sequential2D = { + sequential2D1: '#333022', + sequential2D2: '#3D2830', + sequential2D3: '#562E4C', + sequential2D4: '#6F3468', + sequential2D5: '#873A83', + sequential2D6: '#A0409F', + sequential2D7: '#B846BB' +}; +/** + * ### Sequential 2L + * + * @colorSet verbose + */ + +var sequential2L = { + sequential2L1: '#EEE8CE', + sequential2L2: '#E8C7CE', + sequential2L3: '#E1A6CD', + sequential2L4: '#DB86CD', + sequential2L5: '#D465CD', + sequential2L6: '#CE44CC', + sequential2L7: '#C723CC' +}; +/** + * ### Sequential 3D + * + * @colorSet verbose + */ + +var sequential3D = { + sequential3D1: '#333022', + sequential3D2: '#253223', + sequential3D3: '#244333', + sequential3D4: '#245442', + sequential3D5: '#246451', + sequential3D6: '#237561', + sequential3D7: '#238570' +}; +/** + * ### Sequential 3L + * + * @colorSet verbose + */ + +var sequential3L = { + sequential3L1: '#EEE8CE', + sequential3L2: '#B6ECD4', + sequential3L3: '#7EEFDA', + sequential3L4: '#45D4BA', + sequential3L5: '#35B9A0', + sequential3L6: '#249F86', + sequential3L7: '#14846C' +}; +/** + * ### Sequential 4D + * + * @colorSet verbose + */ + +var sequential4D = { + sequential4D1: '#333022', + sequential4D2: '#442519', + sequential4D3: '#64271F', + sequential4D4: '#832A24', + sequential4D5: '#A0312E', + sequential4D6: '#BD3737', + sequential4D7: '#DA3B30' +}; +/** + * ### Sequential 4L + * + * @colorSet verbose + */ + +var sequential4L = { + sequential4L1: '#EEE8CE', + sequential4L2: '#F5CEBF', + sequential4L3: '#FCB4B0', + sequential4L4: '#F99C96', + sequential4L5: '#F6847C', + sequential4L6: '#DF564D', + sequential4L7: '#DD2E2E' +}; +/** + * ### Sequential 5D + * + * @colorSet verbose + */ + +var sequential5D = { + sequential5D1: '#2E2E55', + sequential5D2: '#4B1773', + sequential5D3: '#77136A', + sequential5D4: '#A81A45', + sequential5D5: '#D24620', + sequential5D6: '#D97A0D', + sequential5D7: '#CBA700' +}; +/** + * ### Sequential 5L + * + * @colorSet verbose + */ + +var sequential5L = { + sequential5L1: '#EEE8CE', + sequential5L2: '#F2DD88', + sequential5L3: '#FFC355', + sequential5L4: '#FF9D66', + sequential5L5: '#FF7777', + sequential5L6: '#EE4477', + sequential5L7: '#DD22BB' +}; +/** + * ### Sequential 6D + * + * @colorSet verbose + */ + +var sequential6D = { + sequential6D1: '#1C3355', + sequential6D2: '#005580', + sequential6D3: '#007575', + sequential6D4: '#118832', + sequential6D5: '#669922', + sequential6D6: '#9D9F0D', + sequential6D7: '#CBA700' +}; +/** + * ### Sequential 6L + * + * @colorSet verbose + */ + +var sequential6L = { + sequential6L1: '#EEE8CE', + sequential6L2: '#E7E755', + sequential6L3: '#A3E052', + sequential6L4: '#0AD647', + sequential6L5: '#00BBBB', + sequential6L6: '#1182F3', + sequential6L7: '#6666DD' +}; + +var sequential = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sequential1D), sequential1L), sequential2D), sequential2L), sequential3D), sequential3L), sequential4D), sequential4L), sequential5D), sequential5L), sequential6D), sequential6L); +/** + * ### High low 1D + * + * @colorSet verbose + */ + + +exports.sequential = sequential; +var highLow1D = { + highLow1DHigh: '#1C6B2D', + highLow1DLow: '#9E2520' +}; +/** + * ### High low 1L + * + * @colorSet verbose + */ + +var highLow1L = { + highLow1LHigh: '#55C169', + highLow1LLow: '#F98C83' +}; +/** + * ### High low 2D + * + * @colorSet verbose + */ + +var highLow2D = { + highLow2DHigh: '#115BAD', + highLow2DLow: '#9E2520' +}; +/** + * ### High low 2L + * + * @colorSet verbose + */ + +var highLow2L = { + highLow2LHigh: '#6BB3EE', + highLow2LLow: '#F98C83' +}; +/** + * ### High low 3D + * + * @colorSet verbose + */ + +var highLow3D = { + highLow3DHigh: '#277C52', + highLow3DLow: '#602CA1' +}; +/** + * ### High low 3L + * + * @colorSet verbose + */ + +var highLow3L = { + highLow3LHigh: '#45D4BA', + highLow3LLow: '#C093F9' +}; +/** + * ### High low 4D + * + * @colorSet verbose + */ + +var highLow4D = { + highLow4DHigh: '#1A6765', + highLow4DLow: '#9F3B23' +}; +/** + * ### High low 4L + * + * @colorSet verbose + */ + +var highLow4L = { + highLow4LHigh: '#2EA39B', + highLow4LLow: '#E3723A' +}; + +var highLow = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, highLow1D), highLow1L), highLow2D), highLow2L), highLow3D), highLow3L), highLow4D), highLow4L); + +exports.highLow = highLow; + +var dataViz = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, staticColors), categorical), divergent), sequential), highLow); + +var _default = dataViz; +exports["default"] = _default; + +/***/ }), + +/***/ 47804: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(76392)); + +var _dark = _interopRequireDefault(__webpack_require__(3714)); + +var _compact = _interopRequireDefault(__webpack_require__(52909)); + +var _comfortable = _interopRequireDefault(__webpack_require__(42216)); + +var _base = _interopRequireDefault(__webpack_require__(57315)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function createPrismaTheme(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var colorSchemeVars = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var densityVars = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + var prismaBase = (0, _base["default"])({ + colorScheme: colorScheme + }); + return _objectSpread(_objectSpread(_objectSpread({}, prismaBase), colorSchemeVars), densityVars); +} + +var _default = createPrismaTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 76392: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * ## Background colors + * Background colors should be used only for backgrounds of higher level sections & containers of a UI. + * + * @colorSet verbose + */ +var backgroundColors = { + backgroundColorPopup: '#ffffff', + backgroundColorSection: '#ffffff', + backgroundColorSidebar: '#f8f8f8', + backgroundColorPage: '#f9f9f9', + backgroundColorNavigation: '#f7f7f7', + backgroundColorFloating: '#000000', + backgroundColorDialog: '#ffffff', + backgroundColorScrim: 'rgba(255, 255, 255, 0.75)' +}; +/** + * ## Content colors + * Content colors should be used for text, icons and dividers. + * + * @colorSet verbose + */ + +var contentColors = { + contentColorActive: '#2c2c2c', + contentColorDefault: '#4d4d4d', + contentColorDisabled: '#878787', + contentColorInverted: '#ffffff', + contentColorMuted: '#6b6b6b' +}; +/** + * ## Interactive colors + * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content. + * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary. + * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two. + * + * @colorSet verbose + */ + +var interactiveColors = { + interactiveColorPrimary: '#0264d7', + interactiveColorBorder: 'rgba(0, 0, 0, 0.4)', + interactiveColorBorderHover: 'rgba(0, 0, 0, 0.6)', + interactiveColorBorderDisabled: 'rgba(0, 0, 0, 0.3)', + interactiveColorOverlaySelected: 'rgba(0, 0, 0, 0.04)', + interactiveColorOverlayHover: 'rgba(0, 0, 0, 0.03)', + interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.07)', + interactiveColorOverlayDrag: 'rgba(2, 100, 215, 0.16)', + interactiveColorBackground: '#eeeeee', + interactiveColorBackgroundDisabled: 'rgba(0, 0, 0, 0.1)' +}; +/** + * ## Neutral colors + * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough. + * + * @colorSet verbose + */ + +var neutralColors = { + white: '#ffffff', + neutral100: '#f0f0f0', + neutral200: '#e6e6e6', + neutral300: '#dddddd', + neutral400: '#cacaca', + neutral500: '#b8b8b8', + black: '#000000' +}; +/** + * ## Accent colors + * Accent colors aid and categorize the visual communication of the system response. + * + * @colorSet verbose + */ + +var accentColors = { + accentColorPositive: '#407a06', + accentColorWarning: '#c97705', + accentColorAlert: '#c6400d', + accentColorNegative: '#e00000' +}; +/** + * ## Status colors + * Status colors are reserved for communicating urgency and severity associated with data objects. + * + * @colorSet verbose + */ + +var statusColors = { + statusColorInfo: '#006be5', + statusColorNormal: '#407a06', + statusColorLow: '#155a4e', + statusColorMedium: '#c97705', + statusColorHigh: '#e00000', + statusColorCritical: '#9e1534' +}; +/** + * ## Elevation shadows + * + * @shadowSet + * + */ + +var elevationShadows = { + embossShadow: ' 0px 1px 5px rgba(0, 0, 0, 0.07), 0px 0px 1px rgba(0, 0, 0, 0.07)', + overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)', + dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)', + modalShadow: '0px 50px 200px rgba(0, 0, 0, 0.3), 0px 29px 66px rgba(0, 0, 0, 0.08), 0px 29px 47px rgba(0, 0, 0, 0.08), 0px 5px 10px rgba(0, 0, 0, 0.03)' +}; +/** + * ## Syntax colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#0f7594', + syntaxBrown: '#9f6404', + syntaxGray: '#6b6b6b', + syntaxGreen: '#5c780c', + syntaxOrange: '#ba4f08', + syntaxPink: '#cc15ae', + syntaxPurple: '#7b4df5', + syntaxRed: '#db1e47', + syntaxTeal: '#1d7c6b' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, accentColors), statusColors), elevationShadows), backgroundColors), contentColors), neutralColors), interactiveColors), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 34522: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); + +/***/ }), + +/***/ 52778: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _react = __webpack_require__(96540); + +var _styledComponents = __webpack_require__(92568); + +var _utils = __webpack_require__(71334); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +/** + * React hook that allows theme variables to be easily used within a React functional component. + * This includes the basic configuration of `family`, `colorScheme` and `density`, + * as well as all the specific variables available in that theme. + * + * If no data `SplunkThemeProvider` was configured, the Prisma Dark Comfortable theme is returned. + * + * ``` + * import useSplunkTheme from '@splunk/themes/useSplunkTheme'; + * ... + * export function() { + * const { isComfortable, focusColor } = useSplunkTheme(); + * + * const style = { + * color: focusColor, + * padding: isComfortable ? '10px' : '5px', + * } + * + * ... + * + * return ( + *
+ * Hello + *
+ * ) + * } + * ``` + * @public + */ +var useSplunkTheme = function useSplunkTheme() { + var _ref = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + _ref$splunkThemeV = _ref.splunkThemeV1, + splunkThemeV1 = _ref$splunkThemeV === void 0 ? {} : _ref$splunkThemeV, + rest = _objectWithoutProperties(_ref, ["splunkThemeV1"]); + + var family = splunkThemeV1.family, + colorScheme = splunkThemeV1.colorScheme, + density = splunkThemeV1.density, + customizer = splunkThemeV1.customizer; + return _objectSpread(_objectSpread({}, rest), (0, _utils.getCustomizedTheme)({ + family: family, + colorScheme: colorScheme, + density: density + }, customizer)); +}; + +var _default = useSplunkTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 71334: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getCustomizedTheme = exports.addThemeDefaults = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _getTheme = _interopRequireDefault(__webpack_require__(91282)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * Accepts a theme object and returns supported values and defaults. + * @private + */ +var addThemeDefaults = function addThemeDefaults() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$family = _ref.family, + family = _ref$family === void 0 ? 'prisma' : _ref$family, + _ref$colorScheme = _ref.colorScheme, + colorScheme = _ref$colorScheme === void 0 ? 'dark' : _ref$colorScheme, + _ref$density = _ref.density, + density = _ref$density === void 0 ? 'comfortable' : _ref$density, + _ref$isPrisma = _ref.isPrisma, + isPrisma = _ref$isPrisma === void 0 ? true : _ref$isPrisma, + _ref$isEnterprise = _ref.isEnterprise, + isEnterprise = _ref$isEnterprise === void 0 ? false : _ref$isEnterprise, + _ref$isComfortable = _ref.isComfortable, + isComfortable = _ref$isComfortable === void 0 ? true : _ref$isComfortable, + _ref$isCompact = _ref.isCompact, + isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact, + _ref$isDark = _ref.isDark, + isDark = _ref$isDark === void 0 ? true : _ref$isDark, + _ref$isLight = _ref.isLight, + isLight = _ref$isLight === void 0 ? false : _ref$isLight; + + return { + family: family, + colorScheme: colorScheme, + density: density, + isPrisma: isPrisma, + isEnterprise: isEnterprise, + isComfortable: isComfortable, + isCompact: isCompact, + isDark: isDark, + isLight: isLight + }; +}; + +exports.addThemeDefaults = addThemeDefaults; + +function getCustomizedThemeUnmemo(settings, customizer) { + var variables = (0, _getTheme["default"])(settings); + + if (!customizer) { + return variables; + } + + return customizer(variables); +} +/** + * Accepts a theme object and customizer, and returns supported values and defaults. + * @private + */ + + +var getCustomizedTheme = (0, _memoize["default"])(getCustomizedThemeUnmemo, function () { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + family = _ref2.family, + colorScheme = _ref2.colorScheme, + density = _ref2.density; + + var customizer = arguments.length > 1 ? arguments[1] : undefined; + return "".concat(family, "-").concat(colorScheme, "-").concat(density, "-").concat(!!customizer); +}); +exports.getCustomizedTheme = getCustomizedTheme; + +/***/ }), + +/***/ 29290: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearVariablesCache = exports["default"] = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _getTheme = _interopRequireDefault(__webpack_require__(91282)); + +var _utils = __webpack_require__(71334); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * @file + * ## Theme Variables + * All variables are available in one util for use in styled-component templates. + * Each variable is a function which styled-components will call with the available theme information. + * If there is no SplunkThemeProvider, variables will default to Prisma Dark Comfortable. + * + * Variables will return `undefined` if the variable does not exist in the current theme. + * ``` + * import variables from '@splunk/themes/variables'; + * import styled from 'styled-components'; + * ... + * const PrismaWrapper = styled.div` + * color: ${variables.contentColorDefault}; + * `; + * ``` + * + * Variables may also be imported individually. + * ``` + * import { contentColorDefault } from '@splunk/themes/variables'; + * import styled from 'styled-components'; + * ... + * const PrismaWrapper = styled.div` + * color: ${contentColorDefault}; + * `; + * ``` + * + * This function must be used in conjunction with `pick` if different variables are needed in different themes. + * ``` + * import { pick, variables } from '@splunk/themes'; + * import styled from 'styled-components'; + * + * const Wrapper = styled.div` + * color: ${pick({ + * enterprise: variables.textColor, + * prisma: variables.contentColorDefault + * }); + * `; + * ``` + * ## Custom Variables + * Custom variables cannot be added to this package. However, `pick()` can be used to create sets of + * theme variables. These can be then be imported separately and used as above. + * ``` + * import pick from '@splunk/themes/pick'; + * + * export const myVariables = { + * orange: pick({ + * light: '#C80', + * dark: '#F90', + * }), + * space: pick({ + * enterprise: '20px', + * prisma: { + * comfortable: '16px', + * compact: '12px', + * }, + * }), + * }; + * ``` + */ +var getThemeVariable = function getThemeVariable(name, settings, customizer) { + var theme = (0, _utils.getCustomizedTheme)(settings, customizer); + var returnValue = theme[name]; + + if (false) {} + + return returnValue; +}; + +var getThemeVariableMemoized = (0, _memoize["default"])(getThemeVariable, function (name, _ref, customizer) { + var family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + return "".concat(name, "-").concat(family, "-").concat(colorScheme, "-").concat(density, "-").concat(!!customizer); +}); + +var clearVariablesCache = function clearVariablesCache() { + var _getThemeVariableMemo, _getThemeVariableMemo2; + + return (_getThemeVariableMemo = (_getThemeVariableMemo2 = getThemeVariableMemoized.cache).clear) === null || _getThemeVariableMemo === void 0 ? void 0 : _getThemeVariableMemo.call(_getThemeVariableMemo2); +}; +/** + * The `get` helper will insert a theme variable into a `styled-components` css template. + * Note, this will return `undefined` if the variable does not exist in the current theme. + * This function must be used in conjunction with `pick` if different variables are needed in different themes. + * ``` + * import get from '@splunk/themes/get'; + * ... + * const Wrapper = styled.div` + * color: ${get('contentColorDefaultDefault')}; // prisma theme only + * `; + * ``` + * @param {string} name - The name of the variable to get from the current theme configuration. + * @returns {function} The returned function is called by `styled-components`, which provides the theme context. + * @private + */ + + +exports.clearVariablesCache = clearVariablesCache; + +var get = function get(name) { + return function (_ref2) { + var _ref2$theme = _ref2.theme; + _ref2$theme = _ref2$theme === void 0 ? {} : _ref2$theme; + var splunkThemeV1 = _ref2$theme.splunkThemeV1; + + var _ref3 = splunkThemeV1 || {}, + family = _ref3.family, + colorScheme = _ref3.colorScheme, + density = _ref3.density, + customizer = _ref3.customizer; + + return getThemeVariableMemoized(name, { + family: family, + colorScheme: colorScheme, + density: density + }, customizer); + }; +}; + +var variableNames = Object.keys(_objectSpread(_objectSpread({}, (0, _getTheme["default"])({ + family: 'prisma' +})), (0, _getTheme["default"])({ + family: 'enterprise' +}))); // each variable is converted to a get() function. +// TS: The AllVariables type allows safe access to all variables shared across themes, +// and unsafe access to variables exclusive to Enterprise or Prisma + +var variables = variableNames.reduce(function (acc, currentValue) { + // using defineProperty instead of acc[currentValue] to work around readonly issue + Object.defineProperty(acc, currentValue, { + value: get(currentValue) + }); + return acc; +}, {}); +var _default = variables; +exports["default"] = _default; + +/***/ }), + +/***/ 53699: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _styledComponents = __webpack_require__(92568); + +var _utils = __webpack_require__(71334); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +// implementation for both + +/** + * `withSplunkTheme` allows theme variables to be used within a React class component. + * This includes the basic configuration of `family`, `colorScheme` and `density`, + * as well as all the specific variables available in that theme. + * + * If no data `SplunkThemeProvider` was configured, the Prisma Dark Comfortable theme is returned. + * + * ``` + * import React, { Component } from 'react'; + * import PropTypes from 'prop-types'; + * import withSplunkTheme from '@splunk/themes/withSplunkTheme'; + * + * + * class MyComponent extends Component { + * static propTypes = { + * splunkTheme: PropTypes.object, + * }; + * + * render() { + * const { isComfortable, focusColor } = this.props.splunkTheme; + * + * const style = { + * color: focusColor, + * padding: isComfortable ? '10px' : '5px', + * } + * + * return ( + *
+ * Hello + *
+ * ) + * } + * } + * + * const MyComponentWithTheme = withSplunkTheme(MyComponent); + * MyComponentWithTheme.propTypes = MyComponent.propTypes; + * + * export default MyComponentWithTheme; + * + * ``` + * @name withSplunkTheme + * @function + * @public + */ +function withSplunkTheme( // eslint-disable-line @typescript-eslint/explicit-module-boundary-types +Component) { + var ComponentWithSplunkTheme = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { + var _ref = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + splunkThemeV1 = _ref.splunkThemeV1, + rest = _objectWithoutProperties(_ref, ["splunkThemeV1"]); + + var _ref2 = splunkThemeV1 || {}, + family = _ref2.family, + colorScheme = _ref2.colorScheme, + density = _ref2.density, + customizer = _ref2.customizer; + + var themeSettings = (0, _utils.addThemeDefaults)({ + family: family, + colorScheme: colorScheme, + density: density + }); + + var splunkTheme = _objectSpread(_objectSpread({}, rest), (0, _utils.getCustomizedTheme)(themeSettings, customizer)); + + return /*#__PURE__*/_react["default"].createElement(Component, _extends({}, props, { + ref: ref, + splunkTheme: splunkTheme + })); + }); + + var displayName = Component.displayName || Component.name || 'Component'; + ComponentWithSplunkTheme.displayName = "withSplunkTheme(".concat(displayName, ")"); + return ComponentWithSplunkTheme; +} // see https://github.com/Microsoft/TypeScript/issues/28938 for the two "as T" assertions above + + +var _default = withSplunkTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 74224: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.expandShortHandHex = expandShortHandHex; +exports.isValidHexColor = isValidHexColor; +exports.isCSSColor = isCSSColor; +exports.extendedColorKeywords = void 0; + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/* eslint-disable import/prefer-default-export */ + +/** + * @file + * A set of functions for Color. + */ + +/** + * Converts shorthand hex color value to the equivalent six-digit hexadecimal value. + * + * + * @param {String|null|undefined} value - Three-digit or four-digit shorthand hexadecimal value to be converted. + * @returns {String|null|undefined} value - If valid three or four-digit shorthand hexadecimal value, returns + * converted six-digit or eight-digit code; original value otherwise. + * @public + */ +function expandShortHandHex(value) { + if (typeof value === 'string') { + var startsWithPound = value.startsWith('#'); + var valueWithoutPound = startsWithPound ? value.slice(1) : value; + var isShorthanded = /^[0-9A-F]{3,4}$/i.test(valueWithoutPound); + + var _valueWithoutPound = _slicedToArray(valueWithoutPound, 4), + r = _valueWithoutPound[0], + g = _valueWithoutPound[1], + b = _valueWithoutPound[2], + _valueWithoutPound$ = _valueWithoutPound[3], + a = _valueWithoutPound$ === void 0 ? '' : _valueWithoutPound$; + + var sixHexadecimal = isShorthanded ? "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b).concat(a).concat(a) : valueWithoutPound; + return startsWithPound ? "#".concat(sixHexadecimal) : sixHexadecimal; + } + + return value; +} +/** + * Returns true when `value` is a valid ``. + * ``s are strings that can be 3, 4, 6, or 8 digits and must start with `#`. + * + * @param {string} value + * @returns {boolean} + * @public + */ + + +function isValidHexColor(value) { + return /(^#[0-9a-f]{3}$)|(^#[0-9a-f]{6}$)|(^#[0-9a-f]{4}$)|(^#[0-9a-f]{8}$)/i.test(value.toString().toLowerCase()); +} +/** + * `Array` containing `string`s of the [named colors](https://www.w3.org/TR/css-color-4/#named-colors) from [CSS Color Module 4](https://www.w3.org/TR/css-color-4). + * @public + */ + + +var extendedColorKeywords = ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen']; +/** + * Validates if the given string is a [ type](https://www.w3.org/TR/css-color-4/#color-type) in CSS. + * + * Supports: + * - ``s 3, 4, 6 and 8 digit + * - ``https://www.w3.org/TR/css-color-4/#named-colors + * - `'currentColor'` + * - `'transparent'` + * + * Does not support: + * - the color-functions: ``, ``, ``, ``, ``, ``, ``, and ``. + * - `` + * - `` + * + * @param {string} value + * @returns {boolean} + * @public + */ + +exports.extendedColorKeywords = extendedColorKeywords; + +function isCSSColor(value) { + if (typeof value !== 'string') { + return false; + } // + + + if (isValidHexColor(value)) { + return true; + } // , transparent, currentColor + // Check last so iterating extendedColorKeywords is last resort + + + return value === 'transparent' || value === 'currentColor' || extendedColorKeywords.includes(value.toLowerCase()); +} + +/***/ }), + +/***/ 23601: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.stringToKeywords = stringToKeywords; +exports.testPhrase = testPhrase; +exports.keywordLocationsAll = keywordLocationsAll; +exports.keywordLocations = keywordLocations; +exports.filterByKeywords = filterByKeywords; + +var _includes = _interopRequireDefault(__webpack_require__(79859)); + +var _isString = _interopRequireDefault(__webpack_require__(85015)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * @file + * A set of functions for filtering items, often menu items. For simple use cases, + * use `filterByKeywords`. Use `stringToKeywords` and `testPhrase` when more control + * of the filtering is necessary. + */ + +/** + * Converts a string (filterPhrase) to an array of keyword tokens. Tokens are usually words, but can + * be a multi-word phrase if quotes are used. The output is suitable for the `testPhrase` function. + * + * @param {String} filterPhrase - The phrase to be broken into keywork tokens. + * @returns {String[]} + * @public + */ +function stringToKeywords(filterPhrase) { + if (!(0, _isString["default"])(filterPhrase)) { + return []; + } + + return (filterPhrase.match(/(?:[^\s"]+|"[^"]*")+/g) || []).map(function (word) { + return word.replace(/^"(.*)"$/, '$1').toLowerCase(); + }); +} +/** + * Tests if a phrase matches a list of keywords. All keywords must be included in the phrase for a + * match. + * + * Examples: + * ```js + * stringToKeywords('Named Bob'); // ['Named', 'Bob'] + * stringToKeywords('"Named Bob"'); // ['Named Bob'] + * stringToKeywords('A Street Cat "Named Bob"'); // ['A', 'Street', 'Cat', 'Named Bob'] + * ``` + * + * @param {String} phrase - The test phrase. + * @param {String[]} keywords - An array of keywords, as returned by `stringToKeywords`. + * @returns {Boolean} + * @public + */ + + +function testPhrase(phrase, keywords) { + if (!(0, _isString["default"])(phrase)) { + return false; + } + + var p = phrase.toLowerCase(); + return keywords.every(function (keyword) { + return (0, _includes["default"])(p, keyword); + }); +} +/** + * Looks for keyword locations in a phrase. Not all keywords need to match for results to be returned. + * + * @param {String} phrase - The test phrase. + * @param {String[]} keywords - An array of keywords, as returned by `stringToKeywords`. + * @returns {Object[] | false} An array of matches with keyword, start index, and end index. Array is sorted + * by start and end index. Keyword + * ranges may overlap. Example: + * ```js + * [ + * { + * keyword: 'the dash', + * start: 0, + * end: 8, + * }, + * { + * keyword: 'sales', + * start: 12, + * end: 17, + * }, + * ] + * ``` + * @private + */ + + +function keywordLocationsAll(phrase, keywords) { + if (!(0, _isString["default"])(phrase) || !keywords || !keywords.length) { + return false; + } + + var p = phrase.toLowerCase(); + var matches = keywords.reduce(function (acc, keyword) { + var start = p.indexOf(keyword); + + if (start >= 0) { + acc.push({ + keyword: keyword, + start: start, + end: start + keyword.length + }); + } + + return acc; + }, []).sort(function (a, b) { + if (a.start !== b.start) { + return a.start > b.start ? 1 : -1; + } + + return a.end > b.end ? 1 : -1; + }); + return matches; +} +/** + * Looks for keyword locations in a phrase and return portions of the string that match one or more + * keywords. The return value can be used to highlight the matched text. + * + * @param {String} phrase - The test phrase. + * @param {String[]} keywords - An array of keywords, as returned by `stringToKeywords`. + * @returns {Object[] | false} An array of location with start index and end index. Keyword + * ranges can overlap. Example: + * ```js + * [ + * { + * start: 0, + * end: 8, + * }, + * { + * start: 12, + * end: 17, + * }, + * ] + * ``` + * @public + */ + + +function keywordLocations(phrase, keywords) { + var matches = keywordLocationsAll(phrase, keywords); + + if (!matches || matches.length !== keywords.length) { + return false; + } + + var _matches$ = matches[0], + start = _matches$.start, + end = _matches$.end; + var locations = []; + + function pushLocation() { + locations.push({ + start: start, + end: end + }); + } + + matches.slice(1).forEach(function (match) { + if (match.start > end) { + pushLocation(); + start = match.start; + end = match.end; + } else if (match.end > end) { + end = match.end; + } + }); + pushLocation(); + return locations; +} +/** + * Filters an array of `items` against the `filterPhrase`. + * + * @param {Array} items - An array of strings or objects to filter. + * @param {String} filterPhrase + * @param {Function} [valueGetter] - An optional function that returns the property of interest if + * filtering an array of objects. + * @returns {Array} A filtered list of items. + * @public + */ + + +function filterByKeywords(items, filterPhrase) { + var valueGetter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (item) { + return item; + }; + var keywords = stringToKeywords(filterPhrase); + return items.filter(function (item) { + return testPhrase(valueGetter(item), keywords); + }); +} + +/***/ }), + +/***/ 1027: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getSortedTabbableElements = getSortedTabbableElements; +exports.isTabKey = isTabKey; +exports.handleTab = handleTab; +exports.takeFocus = takeFocus; +exports.handleFocus = handleFocus; +exports.updateTabIndex = exports.getNewIndex = exports.calculateIndex = void 0; + +var _keyboard = __webpack_require__(64538); + +var _defer = _interopRequireDefault(__webpack_require__(64112)); + +var _filter = _interopRequireDefault(__webpack_require__(87612)); + +var _sortBy = _interopRequireDefault(__webpack_require__(33031)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * @file + * Utilities for managing focus in the browser. + */ +var tabbableSelectors = ['a[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', '[contenteditable]']; +var tabbableSelectorsWithTabIndex = tabbableSelectors.concat(['[tabindex]']); + +var isHidden = function isHidden(element) { + return !(element.offsetWidth || element.offsetHeight || element.getClientRects().length > 0) || getComputedStyle(element).visibility === 'hidden'; +}; +/** + * Sorts the tabbable elements in the provided container. + * + * @param {Element} container - The target container. + * @param {Object} options + * If set, will neither use "tabindex" as an indicator of selectability nor disqualify elements based on "tabindex=-1" + * @param {boolean} options.ignoreTabIndex + * @returns {Element[]} + * @public + */ + + +function getSortedTabbableElements(container) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + ignoreTabIndex = _ref.ignoreTabIndex; + + var tabbableElementSelector = (ignoreTabIndex ? tabbableSelectors : tabbableSelectorsWithTabIndex).join(', '); + var elems = container.querySelectorAll(tabbableElementSelector); + var tabbableElems = (0, _filter["default"])(elems, function (el) { + return !isHidden(el) && (ignoreTabIndex || el.tabIndex >= 0) || el === document.activeElement; + }); + var reducedElements = tabbableElems.reduce(function (accumulator, currentElement) { + var prevElement = accumulator[accumulator.length - 1]; + var isPrevElementRadio = (prevElement === null || prevElement === void 0 ? void 0 : prevElement.getAttribute('type')) === 'radio'; + var isCurrElementRadio = currentElement.getAttribute('type') === 'radio'; + var sameRadioGroup = currentElement.getAttribute('name') === (prevElement === null || prevElement === void 0 ? void 0 : prevElement.getAttribute('name')); // Reduce radio elements to a single Tab stop, ensuring only one per group is focusable + + if (isPrevElementRadio && isCurrElementRadio && sameRadioGroup) { + if (currentElement.checked) { + // replace previous radio with current checked radio + accumulator.pop(); + accumulator.push(currentElement); + } + } else { + accumulator.push(currentElement); + } + + return accumulator; + }, []); + return (0, _sortBy["default"])(reducedElements, function (el) { + if (el.tabIndex > 0) { + return -1 / el.tabIndex; + } + + return 0; + }); +} + +function isTabKey(event) { + return !((0, _keyboard.keycode)(event) !== 'tab' || event.metaKey || event.altKey || event.controlKey); +} +/** + * A key event handler that moves focus among tabbable elements within a container. + * + * @param {Element} container - The target container. + * @param {Event} event - The key event to handle. + * @returns {Element|null} The element focus was applied to or `null` if focus was not applied. + * @public + */ + + +function handleTab(container, event) { + // Ignore events bubbling up from portals + if (!container.contains(document.activeElement)) { + return null; + } // Ensure this is a valid event + + + if (!isTabKey(event)) { + return null; + } + + var tabbableElements = getSortedTabbableElements(container); + + if (tabbableElements.length === 0) { + // if the container is focused, don't allow the focus to leave. + if (document.activeElement === container) { + event.preventDefault(); + return container; + } + + return null; + } // Find the current index or set default. + + + var currentElement = event && event.target || container.querySelector(':focus'); + var currentIndex = tabbableElements.indexOf(currentElement); + + if (currentIndex === -1) { + currentIndex = event.shiftKey ? 0 : tabbableElements.length - 1; + } // Shift the array instead of the current index. + + + if (event.shiftKey) { + tabbableElements.unshift(tabbableElements.pop()); // move last to first + } else { + tabbableElements.push(tabbableElements.shift()); // move first to last + } // Focus + + + event.preventDefault(); + tabbableElements[currentIndex].focus(); + return tabbableElements[currentIndex]; +} +/** + * A helper method that focuses on the first focusable element in a container. + * If a contained element already has focus, focus does not shift. + * + * @param {Element} container - The container that takes focus. + * @param {String} [defaultElement='first'] - The target of focus, either 'first' or 'container'. + * @returns {Element|null} The element that was focused, or null if no element was focused. + * @public + */ + + +function takeFocus(container) { + var defaultElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'first'; + var currentElement = container.querySelector(':focus'); + + if (currentElement) { + return currentElement; + } + + if (defaultElement === 'first') { + var targetEl = getSortedTabbableElements(container)[0]; + + if (targetEl) { + (0, _defer["default"])(function () { + return targetEl.focus(); + }); + return targetEl; + } + } + + if (container.hasAttribute('tabIndex')) { + (0, _defer["default"])(function () { + return container.focus(); + }); + return container; + } + + return null; +} +/** + * An enumeration of possible navigation directions. + * @readonly + * @enum {string} + */ + + +var focusMoveDirection = Object.freeze({ + NONE: 'none', + NEXT: 'next', + PREVIOUS: 'previous' +}); +/** + * Helper function to calculate the new index from the current index. + * + * This function determines the new index for focus navigation based on the current index, + * the direction of movement, and whether looping is enabled. It either caps at the start/end + * of the array or loops around based on the `enableLoop` flag. + * + * @returns {number} - The new index. Returns the current index for invalid direction or out-of-bounds index when looping is disabled. + */ + +var calculateIndex = function calculateIndex(_ref2) { + var itemsLength = _ref2.itemsLength, + currentIndex = _ref2.currentIndex, + direction = _ref2.direction, + enableLoop = _ref2.enableLoop; + + // Check if the direction is valid + if (direction === focusMoveDirection.NONE || ![focusMoveDirection.NONE, focusMoveDirection.NEXT, focusMoveDirection.PREVIOUS].includes(direction)) { + return currentIndex; // Return current index for invalid direction + } + + var increment = direction === focusMoveDirection.NEXT ? 1 : -1; + + if (!enableLoop) { + var newIndex = currentIndex + increment; + + if (newIndex >= itemsLength || newIndex < 0) { + return currentIndex; + } + + return newIndex; + } + + return (currentIndex + increment + itemsLength) % itemsLength; +}; +/** + * Helper function to get the new focusable index in the items array based on the keyCode. + * + * This function calculates the next focusable index in a list of items, depending on the provided keyCode + * (e.g., arrow keys, home, end, tab). It takes into account the current focus index, orientation of navigation + * (horizontal or vertical), looping behavior, and specific key handling rules. + * + * @returns {number} - The new focusable index. Returns -1 if no valid index is found. + */ + + +exports.calculateIndex = calculateIndex; + +var getNewIndex = function getNewIndex(keyCode, itemsLength, currentIndex, _ref3) { + var enableLoop = _ref3.enableLoop, + orientation = _ref3.orientation, + enableTab = _ref3.enableTab, + enableHomeEnd = _ref3.enableHomeEnd; + + // If the current focused item is not in the actionItems, then focus on the first focusable item. + if (currentIndex < 0 || currentIndex >= itemsLength) { + return 0; + } + + if (keyCode === 'home') { + return enableHomeEnd ? 0 : -1; + } + + if (keyCode === 'end') { + return enableHomeEnd ? itemsLength - 1 : -1; + } + + var direction = focusMoveDirection.NONE; + + if (orientation === 'horizontal') { + if (keyCode === 'left') { + direction = focusMoveDirection.PREVIOUS; + } + + if (keyCode === 'right') { + direction = focusMoveDirection.NEXT; + } + } else if (orientation === 'vertical') { + if (keyCode === 'up') { + direction = focusMoveDirection.PREVIOUS; + } + + if (keyCode === 'down') { + direction = focusMoveDirection.NEXT; + } + } + + if (enableTab) { + if (keyCode === 'tabShift') { + direction = focusMoveDirection.PREVIOUS; + } + + if (keyCode === 'tab') { + direction = focusMoveDirection.NEXT; + } + } + + if (direction !== focusMoveDirection.NONE) { + return calculateIndex({ + itemsLength: itemsLength, + currentIndex: currentIndex, + direction: direction, + enableLoop: enableLoop + }); + } + + return -1; +}; +/** + * Helper function to update the tabindex of action items, setting the active item to be focusable + */ + + +exports.getNewIndex = getNewIndex; + +var updateTabIndex = function updateTabIndex(activeIndex, actionItems) { + actionItems.forEach(function (el, index) { + return el.setAttribute('tabindex', index === activeIndex ? '0' : '-1'); + }); +}; +/** + * Handles focus navigation for a list of action items based on key presses. + * + * @param {string} key - The key code representing the key pressed. The key value is obtained from the `keycode` method from '@splunk/ui-utils/keyboard'. + * @param {HTMLElement[]} actionItems - An array of HTML elements representing the action items. + * @param {number} currentIndex - The current index of the focused item. + * @param {Object} [options={ enableLoop: false, orientation: 'horizontal', enableTab: false, enableHomeEnd: true }] - Configuration options. + * @param {boolean} [options.enableLoop=false] - Whether navigation should loop around the ends of the list. + * @param {string} [options.orientation='horizontal'] - Navigation orientation: 'horizontal' (left/right arrow keys) or 'vertical' (up/down arrow keys). + * @param {boolean} [options.enableTab=false] - Enable navigation with the Tab key. + * @param {boolean} [options.enableHomeEnd=true] - Enable navigation with Home and End keys. + * @public + */ + + +exports.updateTabIndex = updateTabIndex; + +function handleFocus(key, actionItems, currentIndex) { + var _ref4 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + _ref4$enableLoop = _ref4.enableLoop, + enableLoop = _ref4$enableLoop === void 0 ? false : _ref4$enableLoop, + _ref4$orientation = _ref4.orientation, + orientation = _ref4$orientation === void 0 ? 'horizontal' : _ref4$orientation, + _ref4$enableTab = _ref4.enableTab, + enableTab = _ref4$enableTab === void 0 ? false : _ref4$enableTab, + _ref4$enableHomeEnd = _ref4.enableHomeEnd, + enableHomeEnd = _ref4$enableHomeEnd === void 0 ? true : _ref4$enableHomeEnd; + + var itemsLength = actionItems.length; // If tab key navigation is disabled, the group should have only one tab stop. + // `updateTabIndex` adjusts the tabindex of all items accordingly for forward navigation. + + if (!enableTab && key === 'tab') { + updateTabIndex(0, actionItems); + return; + } + + var newIndex = getNewIndex(key, itemsLength, currentIndex, { + enableLoop: enableLoop, + orientation: orientation, + enableTab: enableTab, + enableHomeEnd: enableHomeEnd + }); + + if (newIndex >= 0 && newIndex < itemsLength) { + var _actionItems$newIndex, _actionItems$newIndex2; + + updateTabIndex(newIndex, actionItems); + (_actionItems$newIndex = (_actionItems$newIndex2 = actionItems[newIndex]).focus) === null || _actionItems$newIndex === void 0 ? void 0 : _actionItems$newIndex.call(_actionItems$newIndex2); + } // If tab key navigation is disabled, the group should only have one tab stop. + // `updateTabIndex` adjusts the tabindex of all items accordingly for the backward navigation. + + + if (newIndex === -1 && !enableTab && key === 'tabShift') { + updateTabIndex(currentIndex, actionItems); + } +} + +/***/ }), + +/***/ 33492: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.sprintf = sprintf; +exports.abbreviateNumber = abbreviateNumber; +exports.bytesToFileSize = bytesToFileSize; +exports.smartTrim = smartTrim; + +var _toNumber = _interopRequireDefault(__webpack_require__(99374)); + +var _i18n = __webpack_require__(5191); + +var _math = __webpack_require__(69253); + +var _sprintf = __webpack_require__(93389); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * @file + * Number and String format utilities. + */ + +/** + * Returns a formatted string. + * + * ```js + * const text = sprintf('%1$s %2$s a %3$s', 'Polly', 'wants', 'cracker') // 'Polly wants a cracker' + * ``` + * + * #### Format Specification + * The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: + * + * * An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments are placed in the same order as the placeholders in the input string. + * * An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. + * * An optional padding specifier that says what character to use for padding, if specified. Possible values are `0` or any other character preceded by a (`'`) (single quote). The default is to pad with *spaces*. + * * An optional `-` sign that causes `sprintf` to left-align the result of this placeholder. The default is to right-align the result. + * * An optional number that says how many characters the result has. If the value to be returned is shorter than this number, the result is padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. + * * An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits are displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. + * * A type specifier that can be any of the following: + * * `%` — yields a literal `%` character + * * `b` — yields an integer as a binary number + * * `c` — yields an integer as the character with that ASCII value + * * `d` or `i` — yields an integer as a signed decimal number + * * `e` — yields a float using scientific notation + * * `u` — yields an integer as an unsigned decimal number + * * `f` — yields a float as is; see notes on precision above + * * `g` — yields a float as is; see notes on precision above + * * `o` — yields an integer as an octal number + * * `s` — yields a string as is + * * `t` — yields `true` or `false` + * * `T` — yields the type of the argument
1 + * * `v` — yields the primitive value of the specified argument + * * `x` — yields an integer as a hexadecimal number (lower-case) + * * `X` — yields an integer as a hexadecimal number (upper-case) + * * `j` — yields a JavaScript object or array as a JSON encoded string + * + * This utility was adapted from [Alexandru's sprintf-js implementation](https://github.com/alexei/sprintf.js). + * + * @param {string} fmt - The string to format and insert values into. + * @param {Any} values - The values to insert into the format string. See specification above. + * @public + */ +function sprintf(key) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + return (0, _sprintf.sprintfFormat)((0, _sprintf.sprintfParse)(key), [key].concat(rest)); +} +/** + * Abbreviates a number by rounding to no more than three decimal places and by appending a + * suffix: K/M/B. Additionally, the resulting number is formatted using a given locale. + * + * Examples: + * * `99549` returns `99.5K` + * * `1159000` returns `1.16M` + * * `9500`, `de-de` returns `9,5K` + * + * @param {Number|String} number The number to abbreviate. + * @param {String} [locale='en-us'] + * @returns {String} The abbreviated and localized number if `number` is positive. The localized + * number if negative. + * @public + */ + + +function abbreviateNumber(number) { + var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-us'; + var value = (0, _toNumber["default"])(number); + + if (value <= 1000) { + return value.toLocaleString(locale); + } + + if (value < 10000) { + return sprintf((0, _i18n._)('%sK'), (0, _math.roundToDecimal)(value / 1000, -2).toLocaleString(locale)); + } + + if (value < 100000) { + return sprintf((0, _i18n._)('%sK'), (0, _math.roundToDecimal)(value / 1000, -1).toLocaleString(locale)); + } + + if (value < 999500) { + return sprintf((0, _i18n._)('%sK'), (0, _math.roundToDecimal)(value / 1000, 0).toLocaleString(locale)); + } + + if (value < 10000000) { + return sprintf((0, _i18n._)('%sM'), (0, _math.roundToDecimal)(value / 1000000, -2).toLocaleString(locale)); + } + + if (value < 100000000) { + return sprintf((0, _i18n._)('%sM'), (0, _math.roundToDecimal)(value / 1000000, -1).toLocaleString(locale)); + } + + if (value < 999500000) { + return sprintf((0, _i18n._)('%sM'), (0, _math.roundToDecimal)(value / 1000000, 0).toLocaleString(locale)); + } + + if (value < 10000000000) { + return sprintf((0, _i18n._)('%sB'), (0, _math.roundToDecimal)(value / 1000000000, -2).toLocaleString(locale)); + } + + if (value < 100000000000) { + return sprintf((0, _i18n._)('%sB'), (0, _math.roundToDecimal)(value / 1000000000, -1).toLocaleString(locale)); + } + + return sprintf((0, _i18n._)('%sB'), (0, _math.roundToDecimal)(value / 1000000000, 0).toLocaleString(locale)); +} +/** + * Abbreviates a number by rounding to no more than two decimal places and by converting to + * binary prefixes (B/KB/MB/GB/TB). Additionally, the resulting number is formatted using a + * given locale. + * + * Examples: + * * `100` returns `100 B` + * * `1200` returns `1.17 KB` + * * `96619136`, `de-de` returns `92,14 MB` + * + * @param {Number|String} bytes The number of bytes to abbreviate. + * @param {String} [locale='en-us'] + * @throws {RangeError} If `bytes` is less than zero. + * @return {String} The abbreviated and localized number. + * @public + */ + + +function bytesToFileSize(bytes) { + var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-us'; + var kbFileSize = (bytes || 0) / 1024; + + if (kbFileSize < 0) { + throw new RangeError('bytes must be >= 0'); + } + + if (Math.floor(kbFileSize) === 0) { + return sprintf((0, _i18n._)('%s B'), bytes.toLocaleString(locale)); + } + + var mbFileSize = kbFileSize / 1024; + + if (Math.floor(mbFileSize) === 0) { + return sprintf((0, _i18n._)('%s KB'), (0, _math.roundToDecimal)(kbFileSize, -2).toLocaleString(locale)); + } + + var gbFileSize = mbFileSize / 1024; + + if (Math.floor(gbFileSize) === 0) { + return sprintf((0, _i18n._)('%s MB'), (0, _math.roundToDecimal)(mbFileSize, -2).toLocaleString(locale)); + } + + var tbFileSize = gbFileSize / 1024; + + if (Math.floor(tbFileSize) === 0) { + return sprintf((0, _i18n._)('%s GB'), (0, _math.roundToDecimal)(gbFileSize, -2).toLocaleString(locale)); + } + + return sprintf((0, _i18n._)('%s TB'), (0, _math.roundToDecimal)(tbFileSize, -2).toLocaleString(locale)); +} +/** + * Trim a String by replacing characters in the middle with an ellipsis. + * + * Examples: + * * `1234567890`, `7` returns `123...7890` + * * `1234567890`, `10` returns `1234567890` + * * `1234567890`, `50` returns `1234567890` + * * `1234567890`, `2`, `{ precomposed: true }` returns `1…0` + * + * @param {String} string The input string. + * @param {Number} maxCharsFromString How many characters to take from `string`. + * @param {Object} [options] * `precomposed`: Use one ellipsis character (…) + * instead of three periods. Defaults to `false`. + * @return {String} The trimmed result. Note that the total length might be up to three characters + * more than `maxCharsFromString`. If `string` is falsy or if `maxCharsFromString` is less than 1, + * `string` is returned. + * @public + */ + + +function smartTrim(string, maxCharsFromString) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$precomposed = _ref.precomposed, + precomposed = _ref$precomposed === void 0 ? false : _ref$precomposed; + + if (!string || maxCharsFromString < 1 || string.length <= maxCharsFromString) { + return string; + } + + var ellipsis = precomposed ? '…' : '...'; + + if (maxCharsFromString === 1) { + return "".concat(string[0]).concat(ellipsis); + } + + var midpoint = Math.ceil(string.length / 2); + var toRemove = string.length - maxCharsFromString; + var lstrip = Math.ceil(toRemove / 2); + var rstrip = toRemove - lstrip; + return "".concat(string.substring(0, midpoint - lstrip)).concat(ellipsis).concat(string.substring(midpoint + rstrip)); +} + +/***/ }), + +/***/ 5191: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.gettext = gettext; +exports._ = _; +exports.setSharedTranslator = setSharedTranslator; +exports.resetSharedTranslator = resetSharedTranslator; + +/** + * @file + * Internationalization / translation utility. The exported `gettext` (and its alias `_`) uses + * a shared translator function that's set to `window.gettext` by default. If `window.gettext` isn't + * available, the identify function is used, turning `gettext` and `_` into no-ops. + * + * Caution is advised when using `setSharedTranslator` and `resetSharedTranslator`. Always restore + * the translator after changing it, and never assume that the translator hasn't been changed by + * external code during long-running operations. + * + * If used in combination with Splunk Enterprise, `window.gettext` is provided by default. Using the `gettext` + * and `_` syntax ensures that messages can be extracted, and a catalog file can be generated + * automatically. + */ +var internalTranslator; +/** + * Translates text using the shared translator. By default, this is `window.gettext` if it's available. Otherwise, + * the identify function is used. + * @param {String} text The text to translate. + * @return {String} The translated text. + * @public + */ + +function gettext() { + return internalTranslator.apply(void 0, arguments); +} +/** + * This is an alias for `gettext`. + * @param {String} text The text to translate. + * @return {String} The translated text. + * @public + */ + + +function _() { + return internalTranslator.apply(void 0, arguments); +} +/** + * Sets the shared translator. It is used by all subsequent calls of `gettext` and `_`. + * @param {function} newTranslator - A function that returns the translated string. + * @public + */ + + +function setSharedTranslator(newTranslator) { + internalTranslator = newTranslator; +} +/** + * Resets the shared translator to `window.gettext` if available, and the identify function otherwise. + * This function is invoked automatically during module load. + * @public + */ + + +function resetSharedTranslator() { + setSharedTranslator(typeof window !== 'undefined' && window.gettext || function (message) { + return message; + }); +} + +resetSharedTranslator(); + +/***/ }), + +/***/ 32058: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createGUID = createGUID; +exports.createDOMID = createDOMID; + +/** + * Creates a Globally Unique Identifier in the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, + * where each x is replaced with a hexadecimal digit from 0 to f, and y is replaced with a + * hexadecimal digit from 8 to b. This is not compatible with DOM ids, which must + * start with a letter. + * + * @returns {String} + * @public + */ +function createGUID() { + var template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; + return template.replace(/[xy]/g, function (_char) { + var random = Math.floor(Math.random() * 16); + var value = _char === 'x' ? random : random % 4 + 8; + return value.toString(16); + }); +} +/** + * Creates a Globally Unique Identifier prefixed with one or more letters to create a valid DOM id. + * + * @param {String} [prefix=id] A prefix, which must start with a letter and may only contain + * letters, digits, hyphens, and underscores. + * @returns {String} + * @public + */ + + +function createDOMID() { + var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id'; + + if (prefix.match(/^[a-zA-Z][\w-]*$/)) { + return "".concat(prefix, "-").concat(createGUID()); + } + + throw new Error('createDOMID: Prefix must start with a letter and may only contain letters, digits, hyphens and underscores'); +} + +/***/ }), + +/***/ 64538: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isNumber = isNumber; +exports.isDecimal = isDecimal; +exports.isMinus = isMinus; +exports.isNumeric = isNumeric; +exports.addsCharacter = addsCharacter; +exports.keycode = void 0; + +var _keycode = _interopRequireDefault(__webpack_require__(36545)); + +var _isUndefined = _interopRequireDefault(__webpack_require__(62216)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * @file + * Utilities for handling keyboard events. + */ + +/** + * A utility for mapping key names with their numeric codes. This is an alias for [the third-party + * library, keycode](https://github.com/timoxley/keycode). + * @public + */ +var keycode = _keycode["default"]; +/** + * Whenever possible this library uses event.key because it has fewer issues than event.keyCode. + * However, Safari 9.0 and earlier only support it for a few keys, such as Enter, and the QA + * test suite doesn't provide it. + */ + +exports.keycode = keycode; + +function isValidKey(key) { + return (0, _isUndefined["default"])(key) ? false : key !== 'Unidentified'; +} +/** + * Tests if the event key is a number. + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @returns {Boolean} + * @public + */ + + +function isNumber(_ref) { + var key = _ref.key, + keyCode = _ref.keyCode; + + if (isValidKey(key)) { + var keys = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; + return keys.indexOf(key) >= 0; + } + + return keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105; +} +/** + * Tests if the event key is a decimal. + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @param {Object} [options] + * @param {String} [locale.string = 'en-US'] - The locale determines the decimal separator. Supported locale formats are: `xx`, `xx-XX`, and `xx_XX`. + * @returns {Boolean} + * @public + */ + + +function isDecimal(_ref2) { + var key = _ref2.key, + keyCode = _ref2.keyCode; + + var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? 'en-US' : _ref3$locale; + + // A more robust and expandable solution would be to use formatToParts() once IE requirements are dropped. + var formattedNumber = new Intl.NumberFormat(locale.replace('_', '-')).format(1.2); + var decimalSeparator = formattedNumber.indexOf(',') > -1 ? ',' : '.'; + + if (isValidKey(key)) { + return key === decimalSeparator || key === 'Decimal'; + } + + if (decimalSeparator === '.' && keyCode === keycode('numpad .')) { + return true; + } + + return keyCode === keycode(decimalSeparator); +} +/** + * Tests if the event key is a minus sign. + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @returns {Boolean} + * @public + */ + + +function isMinus(_ref4) { + var key = _ref4.key, + keyCode = _ref4.keyCode; + + if (isValidKey(key)) { + return key === '-' || key === 'Subtract'; + } + + return keyCode === keycode('numpad -') || keyCode === keycode('-'); +} +/** + * Tests if the event key is a numeric character (number, decimal, or minus). + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @param {Object} [options] + * @param {String} [locale.string = 'en-US'] - The locale determines the decimal separator. Supported locale formats are: `xx`, `xx-XX`, and `xx_XX`. + * @returns {Boolean} + * @public + */ + + +function isNumeric(event, options) { + return isNumber(event) || isDecimal(event, options) || isMinus(event); +} +/** + * Tests if the event key adds a character. Enter and Tab return false even though they + * add characters in some situations. + * Caveat: Safari 9.0 and earlier might return undefined as this cannot be practically + * determined. + * @param {Event} event - A keyboard event that includes a key. + * @returns {Boolean|Undefined} + * @public + */ + + +function addsCharacter(_ref5) { + var key = _ref5.key; + + if (isValidKey(key)) { + // IE 11 named characters + var names = ['Add', 'Decimal', 'Divide', 'Multiply', 'Spacebar', 'Subtract']; // If key is one character it's assumed to be inserting a character rather than some other + // type of action. + + return key.length === 1 || names.indexOf(key) >= 0; + } // Safari 9.0 and earlier may return undefined + + + return undefined; +} + +/***/ }), + +/***/ 69253: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.strictParseFloat = strictParseFloat; +exports.roundToDecimal = roundToDecimal; +exports.floorPowerOfTen = floorPowerOfTen; +exports.isLessThanMinSafeInt = isLessThanMinSafeInt; +exports.isGreaterThanMaxSafeInt = isGreaterThanMaxSafeInt; + +var _isNumber = _interopRequireDefault(__webpack_require__(98023)); + +var _round = _interopRequireDefault(__webpack_require__(36944)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * @file + * Math and floating point utilities. + */ +var decimalOrScientificRegex = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i; +var minSafeInteger = -9007199254740991; // required as long as we support IE11 + +var maxSafeInteger = 9007199254740991; // required as long as we support IE11 + +/** + * A strict version of `parseFloat` that requires the entire input string to be valid decimal + * or scientific format. + * + * @param {String} string + * @returns {(Number|NaN)} + * @public + */ + +function strictParseFloat(string) { + // if the number is not in decimal or scientific format, return NaN explicitly + // instead of letting JavaScript do its loose parsing + return !decimalOrScientificRegex.test(string) ? NaN : parseFloat(string); +} +/** + * + * Rounds a number to a specific exponent of base 10. + * + * Examples: + * * `value` 125.678 and `exp` -2 rounds to 125.68 + * * `value` 125.678 and `exp` -1 rounds to 125.7 + * * `value` 125.678 and `exp` 0 rounds to 126 + * * `value` 125.678 and `exp` 1 rounds to 130 + * * `value` 125.678 and `exp` 2 rounds to 100 + * + * @param {Number} value + * @param {Number} [exp=0] Exponent of base 10 of the decimal place to round to. + * @returns {(Number|NaN)} The rounded number or NaN if `value` is not a Number or `exp` isn't + * an integer. + * @public + */ + + +function roundToDecimal(value) { + var exp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return (0, _round["default"])(value, exp * -1); +} +/** + * Returns the nearest whole power of ten less or equal to the given number. + * + * Examples: + * * 10 returns 10 + * * 11 returns 10 + * * 99 returns 10 + * * 100 returns 100 + * + * @param {Number} number + * @returns {(Number|NaN)} The result if `number` is positive, `0` if `number` is `0`, `NaN` if + * `number` is negative. + * @public + */ + + +function floorPowerOfTen(number) { + return Math.pow(10, Math.floor(Math.log(number) / Math.LN10)); +} +/** + * Determines if the given number is less than the minimum safe integer (-9007199254740991). + * @param {Number} number + * @return {Boolean} `true` if the given number is less than the minimum safe integer, `false` + * otherwise (or if `number` isn't a Number). + * @public + */ + + +function isLessThanMinSafeInt(number) { + if (!(0, _isNumber["default"])(number)) { + return false; + } + + return number <= minSafeInteger; +} +/** + * Determines if the given number is greater than the maximum safe integer (9007199254740991). + * @param {Number} number + * @return {Boolean} `true` if the given number is greater than the maximum safe integer, `false` + * otherwise (or if `number` isn't a Number). + * @public + */ + + +function isGreaterThanMaxSafeInt(number) { + if (!(0, _isNumber["default"])(number)) { + return false; + } + + return number >= maxSafeInteger; +} + +/***/ }), + +/***/ 93389: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.sprintfFormat = sprintfFormat; +exports.sprintfParse = sprintfParse; + +var _has = _interopRequireDefault(__webpack_require__(61448)); + +var _repeat = _interopRequireDefault(__webpack_require__(12493)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +// This file was adapted from [Alexandru's sprintf-js implementation](https://github.com/alexei/sprintf.js), +// which is BSD-3-Clause-licensed: +// +// Copyright (c) 2007-present, Alexandru Mărășteanu +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of this software nor the names of its contributors may be +// used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// End of BSD-3-Clause license text. + +/** + * RegExs used by sprintf. + * @private + */ +var re = { + notType: /[^T]/, + notPrimitive: /[^v]/, + number: /[diefg]/, + numericArg: /[bcdiefguxX]/, + json: /[j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, + key: /^([a-z_][a-z_\d]*)/i, + keyAccess: /^\.([a-z_][a-z_\d]*)/i, + indexAccess: /^\[(\d+)\]/, + sign: /^[+-]/ +}; +/** + * Internal helper. + * @private + */ + +function sprintf(key) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + // eslint-disable-next-line no-use-before-define + return sprintfFormat(sprintfParse(key), [key].concat(rest)); +} +/** + * Internal implementation of sprintf. + * @private + */ + + +function sprintfFormat(parseTree, argv) { + /* eslint-disable default-case, no-bitwise, no-nested-ternary */ + var treeLength = parseTree.length; + var cursor = 1; + var arg; + var output = ''; + var i; + var k; + var ph; + var pad; + var padCharacter; + var padLength; + var isPositive; + var sign; + + for (i = 0; i < treeLength; i += 1) { + if (typeof parseTree[i] === 'string') { + output += parseTree[i]; + } else if (_typeof(parseTree[i]) === 'object') { + ph = parseTree[i]; // convenience purposes only + + if (ph.keys) { + // keyword argument + arg = argv[cursor]; + + for (k = 0; k < ph.keys.length; k += 1) { + if (!(0, _has["default"])(arg, ph.keys[k])) { + throw new Error(sprintf('[sprintf] property "%s" does not exist', ph.keys[k])); + } + + arg = arg[ph.keys[k]]; + } + } else if (ph.paramNo) { + // positional argument (explicit) + arg = argv[ph.paramNo]; + } else { + // positional argument (implicit) + arg = argv[cursor]; + cursor += 1; + } + + if (re.notType.test(ph.type) && re.notPrimitive.test(ph.type) && arg instanceof Function) { + arg = arg(); + } + + if (re.numericArg.test(ph.type) && typeof arg !== 'number' && Number.isNaN(Number(arg))) { + throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)); + } + + if (re.number.test(ph.type)) { + isPositive = arg >= 0; + } + + switch (ph.type) { + case 'b': + arg = parseInt(arg, 10).toString(2); + break; + + case 'c': + arg = String.fromCharCode(parseInt(arg, 10)); + break; + + case 'd': + case 'i': + arg = parseInt(arg, 10); + break; + + case 'j': + arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width, 10) : 0); + break; + + case 'e': + arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential(); + break; + + case 'f': + arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg); + break; + + case 'g': + arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg); + break; + + case 'o': + arg = (parseInt(arg, 10) >>> 0).toString(8); + break; + + case 's': + arg = String(arg); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 't': + arg = String(!!arg); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 'T': + arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase(); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 'u': + arg = parseInt(arg, 10) >>> 0; + break; + + case 'v': + arg = arg.valueOf(); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 'x': + arg = (parseInt(arg, 10) >>> 0).toString(16); + break; + + case 'X': + arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase(); + break; + } + + if (re.json.test(ph.type)) { + output += arg; + } else { + if (re.number.test(ph.type) && (!isPositive || ph.sign)) { + sign = isPositive ? '+' : '-'; + arg = arg.toString().replace(re.sign, ''); + } else { + sign = ''; + } + + padCharacter = ph.padChar ? ph.padChar === '0' ? '0' : ph.padChar.charAt(1) : ' '; + padLength = ph.width - (sign + arg).length; + pad = ph.width ? padLength > 0 ? (0, _repeat["default"])(padCharacter, padLength) : '' : ''; + output += ph.align ? sign + arg + pad : padCharacter === '0' ? sign + pad + arg : pad + sign + arg; + } + } + } + + return output; + /* eslint-enable default-case, no-bitwise, no-nested-ternary */ +} +/** + * Cache used by sprintfParse + * @private + */ + + +var sprintfParseCache = Object.create(null); +/** + * Creates an AST of fmt. + * + * @param {String} fmt - The target string. + * @returns {Array} An AST of fmt. + * @private + */ + +function sprintfParse(fmt) { + if (sprintfParseCache[fmt]) { + return sprintfParseCache[fmt]; + } + + var current = fmt; + var match; + var argNames = 0; + var parseTree = []; + + while (current) { + /* eslint-disable no-cond-assign, no-bitwise */ + if ((match = re.text.exec(current)) !== null) { + parseTree.push(match[0]); + } else if ((match = re.modulo.exec(current)) !== null) { + parseTree.push('%'); + } else if ((match = re.placeholder.exec(current)) !== null) { + if (match[2]) { + argNames |= 1; + var replacementField = match[2]; + var fieldMatch = []; + var fieldList = []; + + if ((fieldMatch = re.key.exec(replacementField)) !== null) { + fieldList.push(fieldMatch[1]); + + while ((replacementField = replacementField.substring(fieldMatch[0].length)) !== '') { + if ((fieldMatch = re.keyAccess.exec(replacementField)) !== null) { + fieldList.push(fieldMatch[1]); + } else if ((fieldMatch = re.indexAccess.exec(replacementField)) !== null) { + fieldList.push(fieldMatch[1]); + } else { + throw new SyntaxError('[sprintf] failed to parse named argument key'); + } + } + } else { + throw new SyntaxError('[sprintf] failed to parse named argument key'); + } + + match[2] = fieldList; + } else { + argNames |= 2; + } + + if (argNames === 3) { + throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported'); + } + + parseTree.push({ + placeholder: match[0], + paramNo: match[1], + keys: match[2], + sign: match[3], + padChar: match[4], + align: match[5], + width: match[6], + precision: match[7], + type: match[8] + }); + } else { + throw new SyntaxError('[sprintf] unexpected placeholder'); + } + + current = current.substring(match[0].length); + /* eslint-enable no-cond-assign, no-bitwise */ + } + + sprintfParseCache[fmt] = parseTree; + return sprintfParseCache[fmt]; +} + +/***/ }), + +/***/ 83778: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.toClassName = toClassName; + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* eslint-disable import/prefer-default-export */ +// This file was adapted from [JedWatson's classnames](https://github.com/JedWatson/classnames), +// which is MIT-licensed: +// +// The MIT License (MIT) +// +// Copyright (c) 2018 Jed Watson +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// End of MIT license text. + +/** + * A simple utility for conditionally joining class names together for React components. It + * extracts all of the strings from the provided arguments and joins them together with spaces. If an + * object is passed, the keys with truthy values are used. Arguments like `false`, `null`, and + * `undefined` are ignored. Adapted from + * [JedWatson's classnames](https://github.com/JedWatson/classnames). + * @param {...Any} + * @returns {String} className suitable for a React component. + * @public + */ +function toClassName() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return args.reduce(function (accum, arg) { + if (!arg) { + return accum; + } + + var argType = _typeof(arg); + + if (argType === 'string') { + accum.push(arg); + } else if (Array.isArray(arg)) { + accum.push(toClassName.apply(void 0, _toConsumableArray(arg))); + } else if (argType === 'object') { + return accum.concat(Object.keys(arg).filter(function (key) { + return arg[key]; + })); + } + + return accum; + }, []).join(' '); +} + +/***/ }), + +/***/ 93755: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isIE11 = isIE11; + +/* eslint-disable import/prefer-default-export */ + +/** + * Returns true if the current environment is Internet Explorer 11. + * + * @returns {Boolean} + * @public + */ +function isIE11() { + return !!navigator.userAgent.match(/Trident\/7\./); +} + +/***/ }), + +/***/ 79214: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_187__(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, __nested_webpack_require_187__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_187__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_187__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_187__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_187__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_187__.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 +/******/ __nested_webpack_require_187__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_187__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_187__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_187__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_187__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_187__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_187__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_187__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_187__(__nested_webpack_require_187__.s = 241); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 2: +/***/ (function(module, exports) { + +module.exports = __webpack_require__(96540); + +/***/ }), + +/***/ 241: +/***/ (function(module, __nested_webpack_exports__, __nested_webpack_require_3761__) { + +"use strict"; +// ESM COMPAT FLAG +__nested_webpack_require_3761__.r(__nested_webpack_exports__); + +// EXPORTS +__nested_webpack_require_3761__.d(__nested_webpack_exports__, "default", function() { return /* reexport */ useForceUpdate_useForceUpdate; }); + +// EXTERNAL MODULE: external "react" +var external_react_ = __nested_webpack_require_3761__(2); + +// CONCATENATED MODULE: ./src/useForceUpdate/useForceUpdate.tsx +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + +/** + * This is a private component not intended for use outside @splunk/react-ui + * + * Triggers a rerender of a functional component. Useful as an escape hatch when a render is needed regardless of state. + * See https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate + * + */ + +function useForceUpdate() { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + var _useReducer = Object(external_react_["useReducer"])(function (x) { + return x + 1; + }, 0), + _useReducer2 = _slicedToArray(_useReducer, 2), + ignored = _useReducer2[0], + forceUpdate = _useReducer2[1]; + + return forceUpdate; +} + +/* harmony default export */ var useForceUpdate_useForceUpdate = (useForceUpdate); +// CONCATENATED MODULE: ./src/useForceUpdate/index.ts + + + +/***/ }) + +/******/ }); + +/***/ }), + +/***/ 15476: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); +exports.A = void 0; + +var _lodash = __webpack_require__(2543); + +var _rxjs = __webpack_require__(89688); + +var _search = __webpack_require__(17104); + +var _savedSearch = __webpack_require__(7897); + +var _progressTracker = __webpack_require__(84118); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * A class that simplifies creating and accessing Splunk search jobs. All of the instance + * methods return [Observables](http://reactivex.io/rxjs/manual/overview.html#introduction). + * + * Although `SearchJob`'s instance methods return Observables, `SearchJob` itself is not an + * Observable. Calling `SearchJob.create` or `SearchJob.fromSavedSearch` makes the appropriate + * requests to the server immediately, rather than waiting for a subscriber to one of its instance methods. + * @file + */ +function returnTrue() { + return true; +} + +function isDone(searchState) { + return (0, _lodash.get)(searchState, ['content', 'isDone'], false) || (0, _lodash.get)(searchState, ['content', 'isFailed'], false) || (0, _lodash.get)(searchState, ['content', 'isFinalized'], false); +} + +var maxSafeInterval = Math.pow(2, 31) - 1; + +var SearchJob = /*#__PURE__*/function () { + _createClass(SearchJob, null, [{ + key: "create", + + /** + * Create a new `SearchJob` instance. This instance can represent a new *or* an existing search job + * on the server depending on the cache option and the current search jobs on the server. + * + * Some things to keep in mind when working with search jobs and the cache: + * * Never call `cancel` or set `cancelOnUnload` when `cache` is `true`. This might cancel a search job used elsewhere. + * * When `cache` is `false`, call `cancel` on the search job when done with it to free up resources. + * * When `cache` is `true` and the search job is no longer needed locally, call `stopKeepAlive` to free up resources. + * * If there aren't any follow-up actions on the search job, consider setting `keepAlive` to `false`. + * + * Examples + * ```js + * // Create a simple search + * const mySearchJob = SearchJob.create({ + * search: 'index=_internal | head 10', + * earliest_time: '-60m@m', + * latest_time: 'now', + * }); + * + * // Create a search in a specific context + * const mySearchJob = SearchJob.create({ + * search: 'index=_internal | head 10', + * earliest_time: '-60m@m', + * latest_time: 'now', + * }, { + * app: 'awesome_app', + * owner: 'admin', + * }); + * ``` + * + * @param {Object} searchParams - Search parameters. See the [Splunk documentation on the + * `search/jobs` REST endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs) + * for available parameters. + * @param {String} searchParams.search - The search string. This is the only required search param. + * @param {Object} [dispatchOptions] - Dispatch options. + * @param {String} [dispatchOptions.app] - App namespace to use. + * @param {String} [dispatchOptions.owner] - User namespace to use. + * @param {String} [dispatchOptions.sharing] - Must be one of [ 'app' | 'global' | 'system' ]. + * @param {Boolean} [dispatchOptions.keepAlive=false] - Keep the search alive after it completes by polling + * the touch endpoint. Call `stopKeepAlive` (or `cancel`) when the search job is no longer needed. + * @param {Boolean} [dispatchOptions.cache=false] - If true, will try and reuse an existing + * search job if it has the same request params. + * @param {Boolean} [options.cancelOnUnload=!options.cache] - Cancel the search job when the page + * unloads. Defaults to true if cache is false. Do not use with cached search jobs. + * @param {Number} [dispatchOptions.cacheLimit=600] - The maximum age (in seconds) of a search + * job to use if using a cached job. + * @returns {SearchJob} A new SearchJob instance. + * @public + */ + value: function create(searchParams) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var app = _ref.app, + owner = _ref.owner, + sharing = _ref.sharing, + _ref$cache = _ref.cache, + cache = _ref$cache === void 0 ? false : _ref$cache, + _ref$cacheLimit = _ref.cacheLimit, + cacheLimit = _ref$cacheLimit === void 0 ? 600 : _ref$cacheLimit, + _ref$cancelOnUnload = _ref.cancelOnUnload, + cancelOnUnload = _ref$cancelOnUnload === void 0 ? !cache : _ref$cancelOnUnload, + constructorOptions = _objectWithoutProperties(_ref, ["app", "owner", "sharing", "cache", "cacheLimit", "cancelOnUnload"]); + + var search = (0, _search.addLeadingSearchCommand)(searchParams.search); + + var qualifiedSearchParams = _objectSpread(_objectSpread({}, searchParams), {}, { + search: search + }); + + var searchJobSid = cache ? (0, _search.getCachedSearch)(qualifiedSearchParams, { + cacheLimit: cacheLimit + }, SearchJob.splunkConfig, SearchJob.baseFetchInit).then(function (cachedSearch) { + var sid = (0, _lodash.get)(cachedSearch, ['content', 'sid'], null); + + if ((0, _lodash.isNull)(sid)) { + return (0, _search.createSearchJob)(_objectSpread({ + 'webframework.cache.hash': (0, _search.createJava5HashForString)(search) + }, qualifiedSearchParams), { + app: app, + owner: owner, + sharing: sharing + }, SearchJob.splunkConfig, SearchJob.baseFetchInit); + } + + return { + sid: sid + }; + }) : (0, _search.createSearchJob)(qualifiedSearchParams, { + app: app, + owner: owner, + sharing: sharing + }, SearchJob.splunkConfig, SearchJob.baseFetchInit); + return new SearchJob(searchJobSid, _objectSpread({ + cancelOnUnload: cancelOnUnload + }, constructorOptions)); + } + /** + * Creates a search job from a saved search. + * + * Example: + * ```js + * const mySearchJob = SearchJob.fromSavedSearch({ + * name: 'My Saved Search', + * app: 'search', + * owner: 'me', + * }, { cache: 'scheduled' }); + * ``` + * + * @param {Object} savedSearch - Identify the target saved search by its name, app, and owner. + * Name is always required. App and owner might be required depending on the permissions of the + * target saved search. + * @param {String} savedSearch.name - The name of the target saved search. + * @param {String} [savedSearch.app] - The app of the target saved search. + * @param {String} [savedSearch.owner] - The owner of the target saved search. + * @param {Object} [options={}] + * @param {Object} [options.dispatchParams={}] - Parameters to use when dispatching a new the + * search job. Ignored if a cached search job is used. See [Splunk REST API docs for the + * `saved/searches/${name}/dispatch` endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D.2Fdispatch) + * for available parameters. + * @param {Boolean} [options.keepAlive=false] - Keep the search alive after it completes by polling + * the touch endpoint. Call `stopKeepAlive` (or `cancel`) when the search job is no longer needed. + * @param {Boolean} [options.cancelOnUnload=false] - Cancel the search job when the page + * unloads. This will impact others if the search job is shared. + * @param {String} [options.cache='any'] - Use a search job that already exists. Accepted values: + * * none - Dispatch a new job + * * scheduled - Use the most recent scheduled search job. + * * any - Use the most recent search job. + * @param {Number} [options.cacheLimit=Infinity] - The maximum age (in seconds) of a search + * job to use if using a cached job. + * @returns {SearchJob} A new SearchJob instance. + * @public + */ + + }, { + key: "fromSavedSearch", + value: function fromSavedSearch(savedSearch) { + var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var _ref2$cache = _ref2.cache, + cache = _ref2$cache === void 0 ? 'any' : _ref2$cache, + _ref2$cacheLimit = _ref2.cacheLimit, + cacheLimit = _ref2$cacheLimit === void 0 ? Infinity : _ref2$cacheLimit, + _ref2$dispatchParams = _ref2.dispatchParams, + dispatchParams = _ref2$dispatchParams === void 0 ? {} : _ref2$dispatchParams, + constructorOptions = _objectWithoutProperties(_ref2, ["cache", "cacheLimit", "dispatchParams"]); + + if (cache !== 'any' && cache !== 'none' && cache !== 'scheduled') { + throw new Error("Invalid value for cache: '".concat(cache, "'. cache must be 'none', 'any', or 'scheduled'")); + } + + var searchJobSid; + + if (cache === 'none') { + searchJobSid = (0, _savedSearch.dispatch)(savedSearch, dispatchParams, SearchJob.splunkConfig, SearchJob.baseFetchInit); + } else { + var params = cache === 'scheduled' ? { + search: 'isScheduled=true' + } : {}; + searchJobSid = (0, _savedSearch.getLatest)(savedSearch, params, SearchJob.splunkConfig, SearchJob.baseFetchInit).then(function (latestSearch) { + var sid = (0, _lodash.get)(latestSearch, ['name'], null); + + if ((0, _lodash.isNull)(sid)) { + return (0, _savedSearch.dispatch)(savedSearch, dispatchParams, SearchJob.splunkConfig, SearchJob.baseFetchInit); + } + + if (cacheLimit > 0) { + var threshold = Date.now() / 1000 - cacheLimit; + + if (threshold > latestSearch.content.start) { + return (0, _savedSearch.dispatch)(savedSearch, dispatchParams, SearchJob.splunkConfig, SearchJob.baseFetchInit); + } + } + + return { + sid: sid + }; + }); + } + + return new SearchJob(searchJobSid, constructorOptions); + } + /** + * Creates a SearchJob instance from a search job that already exists on the server. + * + * Example: + * ```js + * const mySearchJob = SearchJob.fromSid('sid-of-search-job-that-already-exists'); + * ``` + * + * @param {String} sid - The search job sid. + * @param {Object} [options] + * @param {Boolean} [options.keepAlive=false] - Keep the search alive after it completes by polling + * the touch endpoint. Call `stopKeepAlive` (or `cancel`) when the search job is no longer needed. + * @returns {SearchJob} A new SearchJob instance. + * @public + */ + + }, { + key: "fromSid", + value: function fromSid(sid) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return new SearchJob(_rxjs.Observable.of({ + sid: sid + }), options); + } + /** + * Sets the splunk config values used when creating requests to the server. Defaults to the + * values provided by `@splunk/splunk-utils/config`. + * + * This can be used to run searches outside of a Splunkweb environment. + * + * This is an advanced API and not relevant for typical usage. + * + * **Warning:** The configuration will be set for all requests made by all `SearchJob` instances. It + * is not possible at this time to set the splunk config on an individual `SearchJob` instance due to + * batching of requests. + * + * @param {Object} [splunkConfig] + * @public + */ + + }, { + key: "setSplunkConfig", + value: function setSplunkConfig(splunkConfig) { + SearchJob.splunkConfig = splunkConfig; + (0, _progressTracker.setSplunkConfig)(splunkConfig); + } + /** + * Sets the base fetch init used when creating requests to the server. Defaults to the + * defaultFetchInit provided by `@splunk/splunk-utils/fetch`. + * + * This can be used to set up authentication when running searches outside of a Splunkweb + * environment. + * + * This is an advanced API and not relevant for typical usage. + * + * **Warning:** The base fetch init will be set for all requests made by all `SearchJob` instances. It + * is not possible at this time to set the base fetch init on an individual `SearchJob` instance due to + * batching of requests. + * + * @param {Object} [baseFetchInit] + * @public + */ + + }, { + key: "setBaseFetchInit", + value: function setBaseFetchInit(baseFetchInit) { + SearchJob.baseFetchInit = baseFetchInit; + (0, _progressTracker.setBaseFetchInit)(baseFetchInit); + } + }, { + key: "defaultPreviewFetchPredicate", + + /** + * The default fetch predicate for `SearchJob#getResultsPreview`. + * + * @param {Object} searchState + * @returns {Boolean} - True if it is a real time search or there are preview results. + * @private + */ + value: function defaultPreviewFetchPredicate(searchState) { + if ((0, _lodash.get)(searchState, ['content', 'isRealTimeSearch'], false)) { + return true; + } + + return (0, _lodash.get)(searchState, ['content', 'resultPreviewCount'], 0) > 0; + } + /** + * An internal utility method that makes a request to `search/jobs/job/${endpoint}`. + * + * @param {String} sid - The sid of the search job. + * @param {String} endpoint - The endpoint to poll. + * @param {Object} [requestParams] - Specific to the endpoint. + * @returns {Observable} + * @private + */ + + }, { + key: "getData", + value: function getData(sid, endpoint, requestParams) { + return _rxjs.Observable.fromPromise((0, _search.getData)(sid, endpoint, requestParams, SearchJob.splunkConfig, SearchJob.baseFetchInit)); + } + /** + * Constructor. Generally, use the static create methods instead. + * + * @param {Promise|Observable} searchJobSid - Resolves with an object containing the sid of a + * search job on the server. + * @param {Object} [options={}] + * @param {Boolean} [options.cancelOnUnload=false] - Cancel the search job when the page unloads. + * Do not use with cached search jobs. + * @param {Boolean} [options.keepAlive=false] - Keep the search alive after it completes by polling + * the touch endpoint. Call `stopKeepAlive` or `cancel` when the search job is no longer needed. + * @returns {SearchJob} this + * @private + */ + + }]); + + function SearchJob(searchJobSid) { + var _this = this; + + var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref3$cancelOnUnload = _ref3.cancelOnUnload, + cancelOnUnload = _ref3$cancelOnUnload === void 0 ? false : _ref3$cancelOnUnload, + _ref3$keepAlive = _ref3.keepAlive, + keepAlive = _ref3$keepAlive === void 0 ? false : _ref3$keepAlive; + + _classCallCheck(this, SearchJob); + + _defineProperty(this, "handleUnload", function () { + _this.cancel(); + }); + + this.searchJobSid = _rxjs.Observable.from(searchJobSid); + ['getSid', 'getProgress', 'whenDone'].forEach(function (method) { + _this[method] = (0, _lodash.memoize)(_this[method]); + }); + this.ttl = null; + + if (cancelOnUnload && typeof window !== 'undefined' && (0, _lodash.has)(window, 'addEventListener')) { + window.addEventListener('beforeunload', this.handleUnload); + } + + if (keepAlive) { + this.startKeepAlive(); + } else { + this.keepAliveSubscription = null; + } + } + /** + * Returns an Observable that emits the sid once the search is created on the server. + * + * Example: + * ```js + * const sidSubscription = mySearchJob.getSid().subscribe(sid => { + * // Do something with the sid. + * }); + * ``` + * + * @returns {Observable} + * @public + */ + + + _createClass(SearchJob, [{ + key: "getSid", + value: function getSid() { + return this.searchJobSid.map(function (_ref4) { + var sid = _ref4.sid; + return sid; + }); + } + /** + * Returns an Observable that emits search progress updates. + * + * Simple Example: + * ```js + * const progressSubscription = mySearchJob.getProgress().subscribe(searchState => { + * // Do something with the searchState. + * }); + * + * // If the search is not done, but is not longer needed, unsubscribe to release resources. + * progressSubscription.unsubscribe(); + * ``` + * + * Example handling errors and completion: + * ```js + * const progressSubscription = mySearchJob.getProgress().subscribe({ + * next: searchState => { + * // Do something with the search state. + * }, + * error: err => { + * // The search failed. Do something with the err. + * }, + * complete: () => { + * // The search has completed successfully. + * }, + * }); + * ``` + * + * @returns {Observable} + * @public + */ + + }, { + key: "getProgress", + value: function getProgress() { + return this.getSid().concatMap(_progressTracker.track).publishReplay(1).refCount(); + } + /** + * Returns an Observable that emits when the search is done. + * + * Example: + * ```js + * const doneSubscription = mySearchJob.whenDone().subscribe(searchState => { + * // Do something with the searchState. + * }); + * + * // If the search is not done, but is not longer needed, unsubscribe to release resources. + * doneSubscription.unsubscribe(); + * ``` + * @returns {Observable} + * @public + */ + + }, { + key: "whenDone", + value: function whenDone() { + return this.getProgress().last().publishReplay(1).refCount(); + } + /** + * Returns an Observable that emits results when the search is done. + * + * Example: + * ```js + * const resultsSubscription = mySearchJob.getResults().subscribe(results => { + * // Do something with the results. + * }); + * + * // If the search is not done but is not longer needed, unsubscribe to release resources. + * resultsSubscription.unsubscribe(); + * ``` + * @param requestParams {Object} - [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fresults) + * @returns {Observable} + * @public + */ + + }, { + key: "getResults", + value: function getResults() { + var requestParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return this.whenDone().concatMap(function (searchState) { + return SearchJob.getData(searchState.content.sid, 'results', requestParams); + }).publishReplay(1).refCount(); + } + /** + * An internal utility method that polls search/jobs/job/${endpoint} on progress updates emitted by + * getProgress. + * + * @param {String} endpoint - The endpoint to poll. + * @param {Object} [requestParams] - Specific to the endpoint. + * @param {Object} [dispatchOptions] + * @param {Function} [dispatchOptions.fetchPredicate] - Return false to skip fetching for a + * particular beat of progress. The function is passed the search state. + * @returns {Observable} + * @private + */ + + }, { + key: "pollData", + value: function pollData(endpoint) { + var requestParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var dispatchOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var fetchPredicate = dispatchOptions.fetchPredicate || returnTrue; // About this implementation: + // `exhaustMap` is used to avoid race conditions. This ignores a progress update if + // data is still being fetched for the previous progress update. Ignoring a random progress + // update to let the result data catch up is fine, as long as it is not the final progress + // update. To avoid skipping the final update, we filter it out of the initial Observable + // and concat it after exhaustMap. This ensures that the final progress update executes + // once and only once. + + return this.getProgress().filter(fetchPredicate).filter(function (searchState) { + return !isDone(searchState); + }).exhaustMap(function (searchState) { + return SearchJob.getData(searchState.content.sid, endpoint, requestParams); + }).concat(this.whenDone().filter(fetchPredicate).concatMap(function (searchState) { + return SearchJob.getData(searchState.content.sid, endpoint, requestParams); + })).publishReplay(1).refCount(); + } + /** + * Returns an Observable that emits result previews. + * + * Example: + * ```js + * const resultsPreviewSubscription = mySearchJob.getResultsPreview().subscribe(results => { + * // Do something with the results. + * }); + * + * // If the search is not done but is not longer needed, unsubscribe to release resources. + * resultsPreviewSubscription.unsubscribe(); + * ``` + * + * @param {Object} requestParams - [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fresults_preview) + * @param {Object} [dispatchOptions] + * @param {Function} [dispatchOptions.fetchPredicate] - Return false to skip fetching for a + * particular beat of progress. The function is passed the search state. + * @returns {Observable} + * @public + */ + + }, { + key: "getResultsPreview", + value: function getResultsPreview() { + var requestParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var dispatchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return this.pollData('results_preview', requestParams, _objectSpread({ + fetchPredicate: SearchJob.defaultPreviewFetchPredicate + }, dispatchOptions)); + } + /** + * Returns an Observable that emits events. + * + * Example: + * ```js + * const eventsSubscription = mySearchJob.getEvents().subscribe(events => { + * // Do something with the events. + * }); + * + * // If the search is not done but is not longer needed, unsubscribe to release resources. + * eventsSubscription.unsubscribe(); + * ``` + * + * @param {Object} requestParams - [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fevents) + * @param {Object} [dispatchOptions] + * @param {Function} [dispatchOptions.fetchPredicate] - Return false to skip fetching for a + * particular beat of progress. The function is passed the search state. + * @public + */ + + }, { + key: "getEvents", + value: function getEvents() { + var requestParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var dispatchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return this.pollData('events', requestParams, dispatchOptions); + } + /** + * Returns an Observable that emits the search summary. + * + * Example: + * ```js + * const summarySubscription = mySearchJob.getSummary().subscribe(summary => { + * // Do something with the summary. + * }); + * + * // If the search is not done but is not longer needed, unsubscribe to release resources. + * summarySubscription.unsubscribe(); + * ``` + * + * @param {Object} requestParams - [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fsummary) + * @param {Object} [dispatchOptions] + * @param {Function} [dispatchOptions.fetchPredicate] - Return false to skip fetching for a + * particular beat of progress. The function is passed the search state. + * @returns {Observable} + * @public + */ + + }, { + key: "getSummary", + value: function getSummary() { + var requestParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var dispatchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return this.pollData('summary', requestParams, dispatchOptions); + } + /** + * Returns an Observable that emits the search timeline. + * + * Example: + * ```js + * const timelineSubscription = mySearchJob.getTimeline().subscribe(timeline => { + * // Do something with the timeline. + * }); + * + * // If the search is not done but is not longer needed, unsubscribe to release resources. + * timelineSubscription.unsubscribe(); + * ``` + * + * @param {Object} requestParams - [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Ftimeline) + * @param {Object} [dispatchOptions] + * @param {Function} [dispatchOptions.fetchPredicate] - Return false to skip fetching for a + * particular beat of progress. The function is passed the search state. + * @returns {Observable} + * @public + */ + + }, { + key: "getTimeline", + value: function getTimeline() { + var requestParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var dispatchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return this.pollData('timeline', requestParams, dispatchOptions); + } + /** + * Helper method for applying actions to a search. + * + * @param {String} action - The action to take. + * @param {Object} [params] - Any additional params supported by the particular action. + * @returns {Observable} A hot Observable. + * @private + */ + + }, { + key: "control", + value: function control(action) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var obs = this.getSid().concatMap(function (sid) { + return _rxjs.Observable.fromPromise((0, _search.postAction)(sid, _objectSpread({ + action: action + }, params), SearchJob.splunkConfig, SearchJob.baseFetchInit)); + }).publishReplay(1); + obs.connect(); + return obs; + } + /** + * Pauses the search. + * + * Example: + * ```js + * mySearchJob.pause(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.pause().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "pause", + value: function pause() { + return this.control('pause'); + } + /** + * Unpauses the search. + * + * Example: + * ```js + * mySearchJob.unpause(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.unpause().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "unpause", + value: function unpause() { + return this.control('unpause'); + } + /** + * Finalizes the search. + * + * Example: + * ```js + * mySearchJob.finalize(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.finalize().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "finalize", + value: function finalize() { + return this.control('finalize'); + } + /** + * Cancels the search. + * + * Warning: Make sure there are no subscribers to the search job before cancelling it. + * + * Example: + * ```js + * mySearchJob.cancel(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.cancel().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "cancel", + value: function cancel() { + this.stopKeepAlive(); + + if (typeof window !== 'undefined' && (0, _lodash.has)(window, 'removeEventListener')) { + window.removeEventListener('beforeunload', this.handleUnload); + } + + return this.control('cancel'); + } + /** + * Touches the search. + * + * Example: + * ```js + * mySearchJob.touch(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.touch().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "touch", + value: function touch() { + return this.control('touch'); + } + /** + * Sets the TTL (time to live) of the search. + * + * Example: + * ```js + * mySearchJob.setTTL(100); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.setTTL(100).subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @param {Number} nextTTL + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "setTTL", + value: function setTTL(nextTTL) { + this.ttl = nextTTL; + + if (this.keepAliveSubscription) { + this.startKeepAlive(); + } + + return this.control('setttl', { + ttl: nextTTL + }); + } + /** + * Sets the priority of the search. + * + * Example: + * ```js + * mySearchJob.setPriority(1); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.setPriority(1).subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @param {Number} nextPriority + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "setPriority", + value: function setPriority(nextPriority) { + return this.control('setpriority', { + priority: nextPriority + }); + } + /** + * Enables previews of the search results. + * + * Example: + * ```js + * mySearchJob.enablePreview(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.enablePreview().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "enablePreview", + value: function enablePreview() { + return this.control('enablepreview'); + } + /** + * Disables previews of the search results. + * + * Example: + * ```js + * mySearchJob.disablePreview(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.disablePreview().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "disablePreview", + value: function disablePreview() { + return this.control('disablepreview'); + } + /** + * Saves the search. + * + * Example: + * ```js + * mySearchJob.save(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.save().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "save", + value: function save() { + return this.control('save'); + } + /** + * Unsaves the search. + * + * Example: + * ```js + * mySearchJob.unsave(); + * ``` + * + * Example with server response: + * ```js + * mySearchJob.unsave().subscribe(response => { + * // Do something with the response. + * }) + * ``` + * + * @returns {Observable} A "hot" Observable that emits the server response. + * @public + */ + + }, { + key: "unsave", + value: function unsave() { + return this.control('unsave'); + } + /** + * Keeps the search alive on the server by touching it periodically once it is complete. + * @public + */ + + }, { + key: "startKeepAlive", + value: function startKeepAlive() { + var _this2 = this; + + this.stopKeepAlive(); + this.keepAliveSubscription = this.whenDone()["catch"](function () { + return _rxjs.Observable.empty(); + }).map(function (searchState) { + var ttl = (0, _lodash.isNull)(_this2.ttl) ? (0, _lodash.get)(searchState, ['content', 'ttl']) : _this2.ttl; // Multiple by 500 to convert ttl to millisecond and divide by 2 to touch the search + // job halfway through the ttl. + + return Math.min(ttl * 500, maxSafeInterval); + }).concatMap(function (interval) { + return _rxjs.Observable.interval(interval); + }).exhaustMap(function () { + return _this2.touch(); + })["catch"](function (err, caught) { + return caught; + }) // Retry if touch failed. + .subscribe(); + } + /** + * Stops the keep alive process. Call this method to dispose of resources if this search job is no + * longer used and has a keep alive process. If this search job is not using the cache, consider + * using `cancel` instead. + * @public + */ + + }, { + key: "stopKeepAlive", + value: function stopKeepAlive() { + if (this.keepAliveSubscription) { + this.keepAliveSubscription.unsubscribe(); + this.keepAliveSubscription = null; + } + } + /** + * Called when the user navigates away from the page. + * @private + */ + + }]); + + return SearchJob; +}(); + +_defineProperty(SearchJob, "splunkConfig", undefined); + +_defineProperty(SearchJob, "baseFetchInit", undefined); + +var _default = SearchJob; +exports.A = _default; + +/***/ }), + +/***/ 84118: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.track = exports.setSplunkConfig = exports.setIntervalTest = exports.setBaseFetchInit = exports.resetTest = void 0; + +var _lodash = __webpack_require__(2543); + +var _rxjs = __webpack_require__(89688); + +var _search = __webpack_require__(17104); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * A class that polls the server for the status of one or more jobs. This module only exports + * a singleton of this class, not the class itself. + * @private + */ +var ProgressTracker = /*#__PURE__*/function () { + function ProgressTracker() { + var _this = this; + + _classCallCheck(this, ProgressTracker); + + _defineProperty(this, "setSplunkConfig", function (splunkConfig) { + _this.splunkConfig = splunkConfig; + }); + + _defineProperty(this, "setBaseFetchInit", function (baseFetchInit) { + _this.baseFetchInit = baseFetchInit; + }); + + _defineProperty(this, "setIntervalTest", function (longInterval) { + var shortInterval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : longInterval; + + if (false) {} else { + throw new Error('progressTracker#setIntervalTest is only available in test environment.'); + } + }); + + _defineProperty(this, "resetTest", function () { + if (false) {} else { + throw new Error('progressTracker#resetTest is only available in test environment.'); + } + }); + + _defineProperty(this, "track", function (sid) { + // If we already have an observable for the requested search, return it. + if (_this.observableCache[sid]) { + return _this.observableCache[sid]; + } // Otherwise, create a new observable for the search, add it to the cache, and return it. + + + _this.observableCache[sid] = _rxjs.Observable.create(function (observer) { + _this.searchSubscribers[sid] = observer; + + _this.queueNextFetch(); // Return the unsubscribe function. + + + return function () { + delete _this.searchSubscribers[sid]; + delete _this.observableCache[sid]; + + if ((0, _lodash.isEmpty)(_this.searchSubscribers)) { + _this.unqueueNextFetch(); + } + }; + }) // Use publish replay to make this Observable shareable, with the last update cached. + // New subscribers will receive the last update immediately. + .publishReplay(1) // Use refCount to simplify handling multiple subscribers. The creation function will + // be called when the first subscriber subscribes and unsubscribe will be called when + // the last subscriber unsubscribes. + .refCount(); + return _this.observableCache[sid]; + }); + + _defineProperty(this, "unqueueNextFetch", function () { + if (_this.heartbeatSubscription) { + _this.heartbeatSubscription.unsubscribe(); + + _this.heartbeatSubscription = null; + } + }); + + _defineProperty(this, "queueNextFetch", function () { + _this.unqueueNextFetch(); // Only queue a fetch if there are subscribers. + + + if (!(0, _lodash.isEmpty)(_this.searchSubscribers)) { + _this.heartbeatSubscription = _this.createHeartbeat().subscribe(_this.handleProgress); + } + }); + + _defineProperty(this, "handleProgress", function (res) { + if (!res || !(0, _lodash.isArray)(res.entry)) { + if (false) {} + } else { + res.entry.forEach(function (entry) { + var sid = entry.content.sid; // Check that the subscriber is still subscribed. It could have + // unsubscribed between the fetch call and response. + + if (_this.searchSubscribers[sid]) { + _this.searchSubscribers[sid].next(entry); + } // Check that the subscriber is still subscribed. It could have + // unsubscribed in the `next` call. + + + if (_this.searchSubscribers[sid]) { + // A search is complete when it is done or has been finalized + if (entry.content.isDone || entry.content.isFinalized) { + _this.searchSubscribers[sid].complete(); + } + } + }); // Reconcile returned searches with requested ones and trigger an error for + // searches that were requested but not returned. + + var returnedSearches = res.entry.map(function (entry) { + return entry.content.sid; + }); + (0, _lodash.difference)(_this.requestedSearches, returnedSearches).forEach(function (sid) { + if (_this.searchSubscribers[sid]) { + _this.searchSubscribers[sid].error(new Error("Search ".concat(sid, " not found. The search may have been cancelled while there are still subscribers."))); + } + }); + } + }); + + this.initialize(); + } + /** + * Initializes the instance. Used by the constructor and resetTest. + * @private + */ + + + _createClass(ProgressTracker, [{ + key: "initialize", + value: function initialize() { + this.unqueueNextFetch(); + this.longInterval = 1000; + this.shortInterval = 100; + this.heartbeatSubscription = null; + this.requestedSearches = null; + this.searchSubscribers = {}; + this.observableCache = {}; + this.splunkConfig = undefined; + this.baseFetchInit = undefined; + } + /** + * Set the Splunk config values used for requests to the server. + * + * @param {Object} [splunkConfig] + * @public + */ + + }, { + key: "createHeartbeat", + + /** + * Fetches the searches from the server and emits the appropriate response the the appropriate + * observers. + * + * TODO: Consider accepting a TestScheduler here that would be passed to `Observable.interval`. + * This could simplify the unit tests. + * + * @param interval {Number} - The polling interval. + * @private + */ + value: function createHeartbeat() { + var _this2 = this; + + return _rxjs.Observable.timer(this.shortInterval, this.longInterval) // Make a request for the current jobs each heart beat. Use exhaustMap to avoid the + // unlikely situation where the response from the server takes longer than the + // interval length. + .exhaustMap(function () { + if ((0, _lodash.isEmpty)(_this2.searchSubscribers)) { + return _rxjs.Observable.empty(); + } + + _this2.requestedSearches = (0, _lodash.keys)(_this2.searchSubscribers); + return _rxjs.Observable.fromPromise((0, _search.batchGetSearches)(_this2.requestedSearches, {}, _this2.splunkConfig, _this2.baseFetchInit)); + }) // Something went wrong with the fetch. Log the error to the console, but don't + // throw. Continue polling next inerval. + ["catch"](function (err, caught) { + if (false) {} + + return caught; + }); + } + }]); + + return ProgressTracker; +}(); + +var progressTracker = new ProgressTracker(); +var resetTest = progressTracker.resetTest, + setBaseFetchInit = progressTracker.setBaseFetchInit, + setIntervalTest = progressTracker.setIntervalTest, + setSplunkConfig = progressTracker.setSplunkConfig, + track = progressTracker.track; +exports.track = track; +exports.setSplunkConfig = setSplunkConfig; +exports.setIntervalTest = setIntervalTest; +exports.setBaseFetchInit = setBaseFetchInit; +exports.resetTest = resetTest; + +/***/ }), + +/***/ 75602: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.extractAppName = extractAppName; +exports.versionLabel = exports.username = exports.splunkdPath = exports.serverTimezoneInfo = exports.rootPath = exports.portNumber = exports.locale = exports.config = exports.buildPushNumber = exports.buildNumber = exports.appBuild = exports.app = exports.isAvailable = exports.CSRFToken = void 0; + +var _lodash = __webpack_require__(2543); + +var _cookie = __webpack_require__(65097); + +/** + * A set of constants describing the server environment. If window.$C isn't defined, most of the + * values on this page are also undefined. + * + * The constants may be imported independently, such as: + * ``` + * import { buildNumber, locale, rootPath } from '@splunk/splunk-utils/config'; + * @file + */ + +/* global global */ +// If this is running in Node, the root is the `global` object. If it's running in the browser, +// root is the `window` object. +var root = typeof window === 'undefined' ? __webpack_require__.g : window; +/** + * A function to get a $C prop. Returns undefined if $C isn't available. + * @private + */ + +function get$CEntry(prop) { + return (0, _lodash.get)(root, ['$C', prop]); +} +/** + * The CSRF token. This may be `null` if the token isn't found in the cookie. + * + * @constant + * + * @public + */ + + +var CSRFToken = (0, _cookie.getEntry)("splunkweb_csrf_token_".concat(get$CEntry('MRSPARKLE_PORT_NUMBER'))); +/** + * If `window.$C` is undefined or invalid, isAvailable is `false`. + * @constant + * @public + */ + +exports.CSRFToken = CSRFToken; +var isAvailable = !!get$CEntry('SPLUNKD_PATH'); +/** + * Extracts app name from the URL. To enable testing, this function is exported and pathname + * can be overridden. + * @private + */ + +exports.isAvailable = isAvailable; + +function extractAppName() { + var pathname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _lodash.get)(root, ['document', 'location', 'pathname'], ''); + var pathMatch = pathname.match(/\w\w.\w\w\/(app|manager)\/([^/]+)/); + return pathMatch ? pathMatch[2] : undefined; +} +/** + * The name of the current app as shown in the URL (not the display name). + * @constant + * @public + */ + + +var app = extractAppName(); +/** + * The build number of the current app. + * @constant + * @public + */ + +exports.app = app; +var appBuild = get$CEntry('APP_BUILD'); +/** + * A hash string of the current build. + * @constant + * @type {string} + * @public + */ + +exports.appBuild = appBuild; +var buildNumber = get$CEntry('BUILD_NUMBER'); +/** + * A incremented number configured per instance. Defaults to 0. + * @constant + * @public + */ + +exports.buildNumber = buildNumber; +var buildPushNumber = get$CEntry('BUILD_PUSH_NUMBER'); +/** + * The full object of window.$C. + * @constant + * @public + */ + +exports.buildPushNumber = buildPushNumber; +var config = (0, _lodash.get)(root, '$C'); +/** + * The current locale, such as "en-US". + * @constant + * @public + */ + +exports.config = config; +var locale = get$CEntry('LOCALE'); +/** + * The port that Splunk Web is using. Defaults to 8000. + * @constant + * @public + */ + +exports.locale = locale; +var portNumber = get$CEntry('MRSPARKLE_PORT_NUMBER'); +/** + * Splunk may not be running in the root directory, so the locale may not be the first element + * in the pathname. If it is running in the root directory, ```rootPath``` is an empty + * string. Otherwise it returns the root. For example, in the page + * ``` + * http://splunk.domain.com/my-root-dir/en-US/app/search/search + * ``` + * ```rootPath``` is set to ```'my-root-dir'```. + * @constant + * @public + */ + +exports.portNumber = portNumber; +var rootPath = get$CEntry('MRSPARKLE_ROOT_PATH'); +/** + * The serialized Splunk Enterprise time zone data. This can be parsed for use in formatting Epoch times + * on the client. + * @constant + * @public + */ + +exports.rootPath = rootPath; +var serverTimezoneInfo = get$CEntry('SERVER_ZONEINFO'); +/** + * The Splunk Web proxing to splunkd, such as ```/en-US/splunkd/__raw```. + * @constant + * @public + */ + +exports.serverTimezoneInfo = serverTimezoneInfo; +var splunkdPath = get$CEntry('SPLUNKD_PATH'); +/** + * The username of the current user. + * @constant + * @public + */ + +exports.splunkdPath = splunkdPath; +var username = get$CEntry('USERNAME'); +/** + * The version label of splunkd. + * @constant + * @public + */ + +exports.username = username; +var versionLabel = get$CEntry('VERSION_LABEL'); +exports.versionLabel = versionLabel; + +/***/ }), + +/***/ 37446: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.findErrorMessage = findErrorMessage; +exports.handleResponse = handleResponse; +exports.handleError = handleError; +exports.defaultFetchInit = void 0; + +var _lodash = __webpack_require__(2543); + +var _config = __webpack_require__(75602); + +/** + * A collection of utils for making [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) + * requests to the [Splunk REST API](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTprolog) + * and working with the responses. + * @file + */ + +/** + * A default initialization object for fetch requests. It includes the required credentials and headers. + * @constant + * @public + */ +var defaultFetchInit = { + method: 'GET', + credentials: 'include', + headers: { + 'X-Splunk-Form-Key': _config.CSRFToken, + 'X-Requested-With': 'XMLHttpRequest', + 'Content-Type': 'application/x-www-form-urlencoded' + } +}; +/** + * Finds an error message, if available, in a Splunk REST API response. + * @param {Object} response - The response from the Splunk server. + * @returns {Object|undefined} The error message object, or undefined if no error is found. + * @public + */ +// eslint-disable-next-line consistent-return + +exports.defaultFetchInit = defaultFetchInit; + +function findErrorMessage() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + messages = _ref.messages; + + if (Array.isArray(messages)) { + return (0, _lodash.find)(messages, function (_ref2) { + var type = _ref2.type; + return type === 'ERROR' || type === 'FATAL' || type === 'risky_command'; + }); + } +} +/** + * Rejects responses with a status different than the expected. Otherwise, resolves with the JSON + * response or `null` if the response status code is 204. + * + * @param {Number|Number[]} expectedStatus - The status code of a successful response. + * @returns {Function} A response handler. + * @public + */ + + +function handleResponse(expectedStatus) { + return function (res) { + if ((0, _lodash.includes)([].concat(expectedStatus), res.status)) { + return res.status === 204 ? null : res.json(); + } + + return Promise.reject(res); + }; +} +/** + * Handles a failed Splunk REST API response by looking for an error message in the response. Returns + * a rejection for further handling by the end consumer. + * + * @param {String} defaultMessage - This is used if a message from the server + * is not found or if the response from the server couldn't be parsed as JSON. + * @returns {Function} An error handler. + * @public + */ + + +function handleError(defaultMessage) { + return function (res) { + var dfd = null; + + try { + dfd = res.json(); + } catch (e) { + // If body is not JSON + return Promise.reject(new Error(defaultMessage)); + } + + return dfd.then(function (data) { + // If the action failed, most of the time you get an error message. + var errorMessage = findErrorMessage(data); + + if (errorMessage) { + return Promise.reject(new Error(errorMessage.text)); + } // Sometimes there is no error message. + + + return Promise.reject(new Error(defaultMessage)); + }); + }; +} + +/***/ }), + +/***/ 7897: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.get = get; +exports.dispatch = dispatch; +exports.getHistory = getHistory; +exports.getLatest = getLatest; + +var _querystring = _interopRequireDefault(__webpack_require__(47186)); + +var _fetch = __webpack_require__(37446); + +var _url = __webpack_require__(69211); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * A set of utilities for working with saved searches in the Splunk platform, including getting them, dispatching + * them, and getting their history. + * @file + */ + +/** + * Makes a GET request to the `saved/searches/{name}` REST API endpoint. + * + * @param {Object} savedSearch - Identify the target saved search by its name (required), app (optional), and owner (optional). + * @param {String} savedSearch.name - The name of the target saved search. + * @param {String} [savedSearch.app] - The app of the target saved search. + * @param {String} [savedSearch.owner] - The owner of the target saved search. + * @param {Object} [params] - The request parameters. See the [Splunk documentation on the + * `saved/searches/{name}` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D) + * for available parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} A promise with the results from the server. + * @public + */ +function get(_ref) { + var name = _ref.name, + app = _ref.app, + owner = _ref.owner; + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + var url = (0, _url.createRESTURL)("saved/searches/".concat(name), { + app: app, + owner: owner + }, configOptions); + + var qs = _querystring["default"].encode(_objectSpread({ + output_mode: 'json' + }, params)); + + return fetch("".concat(url, "?").concat(qs), baseFetchInit).then((0, _fetch.handleResponse)(200))["catch"]((0, _fetch.handleError)("Failed to get saved search: ".concat(name))); +} +/** + * Makes a POST request to the `saved/searches/{name}/dispatch` REST API endpoint. + * + * @param {Object} savedSearch - Identify the target saved search by its name (required), app (optional), and owner (optional). + * @param {String} savedSearch.name - The name of the target saved search. + * @param {String} [savedSearch.app] - The app of the target saved search. + * @param {String} [savedSearch.owner] - The owner of the target saved search. + * @param {Object} [params] - The request parameters. See the [Splunk documentation on the + * `saved/searches/{name}/dispatch` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D.2Fdispatch) + * for available parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} A promise with the results from the server. + * @public + */ + + +function dispatch(_ref2) { + var name = _ref2.name, + app = _ref2.app, + owner = _ref2.owner; + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + var url = (0, _url.createRESTURL)("saved/searches/".concat(name, "/dispatch"), { + app: app, + owner: owner + }, configOptions); + return fetch(url, _objectSpread(_objectSpread({}, baseFetchInit), {}, { + method: 'POST', + body: _querystring["default"].encode(_objectSpread(_objectSpread({}, params), {}, { + output_mode: 'json' + })) + })).then((0, _fetch.handleResponse)(201))["catch"]((0, _fetch.handleError)("Failed to dispatch saved search: ".concat(name))); +} +/** + * Makes a GET request to the `saved/searches/{name}/history` REST API endpoint. + * + * @param {Object} savedSearch - Identify the target saved search by its name (required), app (optional), and owner (optional). + * @param {String} savedSearch.name - The name of the target saved search. + * @param {String} [savedSearch.app] - The app of the target saved search. + * @param {String} [savedSearch.owner] - The owner of the target saved search. + * @param {Object} [params] - The request parameters. See the [Splunk documentation on the + * `saved/searches/{name}/history` REST endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D.2Fhistory) + * for available parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} A promise with the results from the server. + * @public + */ + + +function getHistory(_ref3) { + var name = _ref3.name, + app = _ref3.app, + owner = _ref3.owner; + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + var url = (0, _url.createRESTURL)("saved/searches/".concat(name, "/history"), { + app: app, + owner: owner + }, configOptions); + + var qs = _querystring["default"].encode(_objectSpread({ + output_mode: 'json' + }, params)); + + return fetch("".concat(url, "?").concat(qs), baseFetchInit).then((0, _fetch.handleResponse)(200))["catch"]((0, _fetch.handleError)("Failed to get history for saved search: ".concat(name))); +} +/** + * Gets the most recent search job for the specified saved search. + * + * @param {Object} savedSearch - Identify the target saved search by its name (required), app (optional), and owner (optional). + * @param {String} savedSearch.name - The name of the target saved search. + * @param {String} [savedSearch.app] - The app of the target saved search. + * @param {String} [savedSearch.owner] - The owner of the target saved search. + * @param {Object} [params] - The request parameters. See the [Splunk documentation on the + * `saved/searches/{name}/history` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D.2Fhistory) + * for available parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} A promise that resolves with the latest search job, or `undefined` if no search + * jobs exist for the specified saved search. + * @public + */ + + +function getLatest(savedSearch) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + return getHistory(savedSearch, _objectSpread(_objectSpread({}, params), {}, { + sort_key: 'start', + sort_dir: 'desc', + count: 1 + }), configOptions, baseFetchInit).then(function (data) { + return data.entry[0]; + }); +} + +/***/ }), + +/***/ 17104: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addLeadingSearchCommand = addLeadingSearchCommand; +exports.stripLeadingSearchCommand = stripLeadingSearchCommand; +exports.createJava5HashForString = createJava5HashForString; +exports.getCachedSearch = getCachedSearch; +exports.createSearchJob = createSearchJob; +exports.oneShot = oneShot; +exports.postAction = postAction; +exports.getData = getData; +exports.batchGetSearches = batchGetSearches; +exports.validateSearch = validateSearch; + +var _lodash = __webpack_require__(2543); + +var _querystring = _interopRequireDefault(__webpack_require__(47186)); + +var _fetch = __webpack_require__(37446); + +var _url = __webpack_require__(69211); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var propertiesIgnoredByCache = ['webframework.cache.hash', 'app', 'owner', 'provenance', 'refresh', 'refreshType']; +/** + * A set of utilities for creating, getting, and manipulating search jobs in the Splunk platform. + * @file + */ + +/** + * Returns a fully qualified search string by prepending the "search " + * command of unqualified searches. This method deems strings as unqualified + * if it doesn't start with a pipe ( | ) or "search ". + * + * @param {String} search - The search string. + * @returns {String} + * @public + */ + +function addLeadingSearchCommand(search) { + var trimmedSearch = search.trim(); + + if ((0, _lodash.startsWith)(trimmedSearch, '|')) { + return search; + } + + if ((0, _lodash.startsWith)(trimmedSearch, 'search ') && trimmedSearch.length > 7) { + return search; + } + + return "search ".concat(trimmedSearch); +} +/** + * Returns an unqualified search string by removing the leading "search " + * command. This method does a simple search at the beginning of the + * search. + * + * @param {String} search - The search string. + * @returns {String} + * @public + */ + + +function stripLeadingSearchCommand(search) { + var trimmedSearch = search.trim(); + + if ((0, _lodash.startsWith)(trimmedSearch, 'search ')) { + return trimmedSearch.substring(7); + } + + return search; +} +/** + * Hashes a string using the algorithm from the `java.lang.String` hashCode function in Java SE 5 + * and prepends with "java5". This is the hash function used by the splunkjs searchmanager to find + * similar searches that are already active on the server. + * + * The returned hash might be negative. + * + * @param {String} s - The string to hash. + * @returns {String} The hash. + * @public + */ + + +function createJava5HashForString(s) { + var h = 0; + /* eslint-disable no-plusplus, no-bitwise */ + + for (var i = 0, n = s.length; i < n; i++) { + // (x|0) converts to 32-bit int + h = (31 * h | 0) + s.charCodeAt(i) | 0; + } + /* eslint-enable no-plusplus, no-bitwise */ + + + h = h.toString(16); + return "java5:".concat(h); +} +/** + * Makes a request to the search/jobs REST API endpoint to fetch any existing searches matching the provided + * cache config. To qualify, the search must be created with the same request as the search options + * provided, less the options specifically called out as propertiesIgnoredByCache. + * + * @param searchParameters {Object} - The search parameters. See the [Splunk documentation on the + * `search/jobs` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs) + * for available parameters. + * @param {Object} [cacheOptions] - Options to pass to the caching system. + * @param {Number} [cacheOptions.cacheLimit] - The maximum age in seconds of any artifact for it to qualify as a valid cached search. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} Resolves with search state if a cached job is found, otherwise resolves `null`. + * @public + */ + + +function getCachedSearch(searchParameters) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$cacheLimit = _ref.cacheLimit, + cacheLimit = _ref$cacheLimit === void 0 ? 0 : _ref$cacheLimit; + + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + // mimics the hashing traditional in splunkjs + var hash = createJava5HashForString(searchParameters.search); + + var qs = _querystring["default"].encode({ + output_mode: 'json', + search: "request.webframework.cache.hash=".concat(hash) + }); + + return fetch("".concat((0, _url.createRESTURL)('search/jobs', {}, configOptions), "?").concat(qs), baseFetchInit).then(function (res) { + return res.json(); + }).then(function (body) { + var targetParams = (0, _lodash.omit)(searchParameters, propertiesIgnoredByCache); + var candidateJobs = body.entry.filter(function (entry) { + return (0, _lodash.isEqual)(targetParams, (0, _lodash.omit)(entry.content.request, propertiesIgnoredByCache)); + }); + + if (candidateJobs.length > 0) { + var newestJob = (0, _lodash.maxBy)(candidateJobs, function (entry) { + return new Date(entry.published).valueOf(); + }); + var ageThreshold = cacheLimit <= 0 ? 0 : new Date().valueOf() - cacheLimit * 1000; + + if (new Date(newestJob.published).valueOf() > ageThreshold) { + return newestJob; + } + } // No matched searches, no cached + + + return null; + })["catch"]((0, _fetch.handleError)('Failed to get cached jobs.')); +} +/** + * Makes a request to the search/jobs REST API endpoint to create a new search job. + * + * @param searchParameters {Object} - The search parameters. See the [Splunk documentation on the + * `search/jobs` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs) + * for available parameters. + * @param [namespaceOptions] {Object} + * @param {String} [namespaceOptions.app] - App namespace to use. + * @param {String} [namespaceOptions.owner] - User namespace to use. + * @param {Sting} [namespaceOptions.sharing] - Must be one of [ '' | 'app' | 'global' | 'system' ]. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} If successful, the promise resolves with an object containing the new search + * job's sid. + * @public + */ + + +function createSearchJob(searchParameters) { + var namespaceOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + return fetch((0, _url.createRESTURL)('search/jobs', namespaceOptions, configOptions), _objectSpread(_objectSpread({}, baseFetchInit), {}, { + method: 'POST', + body: _querystring["default"].encode(_objectSpread({ + output_mode: 'json' + }, searchParameters)) + })).then((0, _fetch.handleResponse)(201))["catch"]((0, _fetch.handleError)('Failed to create search job.')); +} +/** + * Creates a one-shot search in which the search results are returned with the initial request to + * create the search job. + * @param searchParameters {Object} - The search parameters. See the [Splunk documentation on the + * `search/jobs` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs) + * for available parameters. + * @param [namespaceOptions] {Object} + * @param {String} [namespaceOptions.app] - App namespace to use. + * @param {String} [namespaceOptions.owner] - User namespace to use. + * @param {Sting} [namespaceOptions.sharing] - Must be one of [ '' | 'app' | 'global' | 'system' ]. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} If successful, the promise resolves with the search job results. + * @public + */ + + +function oneShot(searchParameters) { + var namespaceOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + return fetch((0, _url.createRESTURL)('search/jobs', namespaceOptions, configOptions), _objectSpread(_objectSpread({}, baseFetchInit), {}, { + method: 'POST', + body: _querystring["default"].encode(_objectSpread(_objectSpread({ + output_mode: 'json' + }, searchParameters), {}, { + exec_mode: 'oneshot' + })) + })).then((0, _fetch.handleResponse)(200))["catch"]((0, _fetch.handleError)('Failed to create one shot search job')); +} +/** + * Makes a POST request to the `search/jobs/${search_id}/control` REST API endpoint to perform an action on a + * search job. + * + * @param sid {String} - The search ID of the search to perform the action on. + * @param [parameters] {Object} - The request parameters. See the [Splunk documentation on the + * `search/jobs/{search_id}/control` REST API endpoint](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fcontrol) + * for available parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} A promise with the results from the server. + * @public + */ + + +function postAction(sid) { + var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + return fetch((0, _url.createRESTURL)("search/jobs/".concat(sid, "/control"), {}, configOptions), _objectSpread(_objectSpread({}, baseFetchInit), {}, { + method: 'POST', + body: _querystring["default"].encode(_objectSpread(_objectSpread({}, parameters), {}, { + output_mode: 'json' + })) + })).then((0, _fetch.handleResponse)(200))["catch"]((0, _fetch.handleError)("Action ".concat(parameters.action, " failed on search job ").concat(sid))); +} +/** + * Makes a GET request to the `search/jobs/${search_id}/${endpoint}` REST API endpoint to get data + * from the specified search job. + * + * @param sid {String} - The search ID of the search job to get data from. + * @param [endpoint = ''] {String} - The endpoint to use. Must be one of the following: + * + * * default (empty string) - The progress or current state of the job. [See documentation for + * available parameters.](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D) + * * events - A list of events matched by the job. [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fevents) + * * results - Get the search results. Only available when the search job is done or + * finalized. [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fresults) + * * results_preview - Get a preview of the search results, if enabled. [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fresults_preview) + * * summary - Get the `getFieldsAndStats` output of the events to date. [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fsummary) + * * timeline - Get event distribution over time of the untransformed events read to date. [See documentation for available parameters. + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Ftimeline) + * @param [parameters] {Object} - See the [Splunk documentation on the endpoint + * used](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D) + * for the available parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * + * @returns {Promise} - A promise with the results from the server. + * @public + */ + + +function getData(sid) { + var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var parameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var configOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var baseFetchInit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _fetch.defaultFetchInit; + + var qs = _querystring["default"].encode(_objectSpread({ + output_mode: 'json' + }, parameters)); + + var url = (0, _url.createRESTURL)("search/jobs/".concat(sid).concat(endpoint && "/".concat(endpoint)), {}, configOptions); + return fetch("".concat(url, "?").concat(qs), baseFetchInit).then((0, _fetch.handleResponse)([200, 204]))["catch"]((0, _fetch.handleError)("Failed to get ".concat(endpoint || 'status', " for job ").concat(sid))); +} +/** + * Gets the status of multiple searches in a single request. + * + * @param sids {String[]} - An array of search IDs to get. + * @param [parameters] {Object} - See the [Splunk documentation on the search/jobs REST API endpoint + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fjobs) for + * supported parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} - A promise with the results from the server. + * @public + */ + + +function batchGetSearches(sids) { + var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + + var qs = _querystring["default"].encode(_objectSpread({ + output_mode: 'json', + id: sids, + count: sids.length + }, parameters)); + + return fetch("".concat((0, _url.createRESTURL)('search/jobs', {}, configOptions), "?").concat(qs), baseFetchInit).then((0, _fetch.handleResponse)(200))["catch"]((0, _fetch.handleError)('Failed to get batch status of jobs.')); +} +/** + * Verifies a search string is valid using the `search/parser` endpoint. + * + * @param {String} search - The search string to verify. + * @param [parameters] {Object} - See the [Splunk documentation on the search/parser endpoint + * ](http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTsearch#search.2Fparser) for + * supported parameters. + * @param {Object} [configOptions] - Splunk config options passed to url.createRESTURL. Defaults to + * the values provided by @splunk/splunk-utils/config. + * @param {Object} [baseFetchInit] - Options passed to the fetch call. Defaults to the defaultFetchInit + * in `@splunk/splunk-utils/fetch`. + * @returns {Promise} A promise that resolves to an object containing a `valid` property set to + * `true` if the search string is valid, or `false` if otherwise. If the search string is valid, the + * object also contains a `data` property set to the response data received from the server. If + * the search string is invalid, the object also contains an `error` property set to the error + * message received from the server. If the request itself fails, the promise is rejected. + * @public + */ + + +function validateSearch(search) { + var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var baseFetchInit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _fetch.defaultFetchInit; + + var qs = _querystring["default"].encode(_objectSpread({ + output_mode: 'json', + parse_only: true, + q: addLeadingSearchCommand(search) + }, parameters)); + + return fetch("".concat((0, _url.createRESTURL)('search/parser', {}, configOptions), "?").concat(qs), baseFetchInit).then((0, _fetch.handleResponse)(200)).then(function (data) { + return { + valid: true, + data: data + }; + })["catch"](function (res) { + return res.json().then(function (data) { + var defaultError = 'Failed to validate search string.'; + var foundError = (0, _fetch.findErrorMessage)(data); + var errorMessage = foundError ? foundError.text : defaultError; + return res.status === 400 ? Promise.resolve({ + valid: false, + error: errorMessage + }) : Promise.reject(new Error(errorMessage)); + }); + }); +} + +/***/ }), + +/***/ 78598: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaultTheme = defaultTheme; +exports.getThemeOptions = getThemeOptions; + +/** + * A set of functions for dealing with Splunk themes. + * @file + */ +var defaultThemeSplunkThemeProviderMap = { + enterprise: { + family: 'enterprise', + colorScheme: 'light', + density: 'comfortable' + }, + enterpriseDark: { + family: 'enterprise', + colorScheme: 'dark', + density: 'comfortable' + }, + prismaLight: { + family: 'prisma', + colorScheme: 'light', + density: 'comfortable' + }, + prismaDark: { + family: 'prisma', + colorScheme: 'dark', + density: 'comfortable' + }, + lite: { + family: 'enterprise', + colorScheme: 'light', + density: 'comfortable' + } +}; +/** + * Determines a default theme name based on the current environment, such as `$C`. + * + * @param {Object} [scope=window (if available)] - The environment. + * @return {String} The theme name (`enterprise`, `lite`, ...) + * @public + */ + +function defaultTheme() { + var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof window !== 'undefined' ? window : null; + + if (!scope) { + return 'enterprise'; + } + /* eslint-disable no-underscore-dangle */ + + + var partialsTheme = scope.__splunkd_partials__ && scope.__splunkd_partials__['/services/server/info'] && scope.__splunkd_partials__['/services/server/info'].entry[0].content.product_type; + var scopeTheme = scope.__splunk_ui_theme__; + /* eslint-enable no-underscore-dangle */ + + var cTheme = scope.$C && scope.$C.SPLUNK_UI_THEME; + return scopeTheme || cTheme || partialsTheme || 'enterprise'; +} +/** + * + * @param {string} theme + * @return {object} An object with the props expected by from @splunk/themes + */ + + +function getThemeOptions(theme) { + return defaultThemeSplunkThemeProviderMap[theme] || defaultThemeSplunkThemeProviderMap.enterprise; +} + +/***/ }), + +/***/ 69211: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.withConfig = withConfig; +exports.insertCacheBuster = exports.createURL = exports.createStaticURL = exports.createRESTURL = exports.createDocsURL = exports.createAppDocsURL = void 0; + +var _querystring = __webpack_require__(47186); + +var config = _interopRequireWildcard(__webpack_require__(75602)); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * A set of functions for generating Splunk Web URLs. They may be imported independently, such as: + * ``` + * import { createURL, createStaticURL } from '@splunk/splunk-utils/url'; + * ``` + * @file + */ +function withConfig(_ref) { + var appBuild = _ref.appBuild, + buildNumber = _ref.buildNumber, + buildPushNumber = _ref.buildPushNumber, + locale = _ref.locale, + rootPath = _ref.rootPath, + splunkdPath = _ref.splunkdPath; + + /** + * Inserts a cache buster into the given path. + * + * @param path {String} - The path to inject the cache buster into. + * @param configOptions {Object} - Config options including `appBuild`, `buildPushNumber`, and + * `buildNumber`. Defaults to the values provided by `@splunk/splunk-utils/config`. + * @return {String} Returns the path with the cache buster `/@9850fc87a5ee`. + * @private + */ + function insertCacheBuster(path) { + var configOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var options = _objectSpread({ + appBuild: appBuild, + buildPushNumber: buildPushNumber, + buildNumber: buildNumber + }, configOptions); + + var match = path.match(/(^|\w\w-\w\w\/)static\//); + + if (!match) { + return path; + } + + var insertPosition = match.index + match[0].length - 1; + var isApp = path.match(/(^|\w\w-\w\w|)static\/app/); + var appBuildString = isApp ? ":".concat(options.appBuild || 0) : ''; + var buildPushString = options.buildPushNumber ? ".".concat(options.buildPushNumber) : ''; + var cacheBusterString = "/@".concat(options.buildNumber).concat(buildPushString).concat(appBuildString); + var before = path.substr(0, insertPosition); + var after = path.substr(insertPosition); + return "".concat(before).concat(cacheBusterString).concat(after); + } + /** + * Returns a full path for the current appserver location. + * This is required for proxy compatiblity, localization, and cache busting. + * + * For example: + * ```js + * createURL('app/search/job'); // "/splunk/en-US/app/search/job" + * createURL('/app/search/job'); // "/splunk/en-US/app/search/job" + * createURL('app/search/job', {id:3, user:'me' }); // "/splunk/en-US/app/search/job?id=3&user=me" + * ``` + * + * Static paths are augmented with a cache buster: + * ```js + * createURL('/static/js/foo.js'); // "/splunk/en-US/static/@12345/js/foo.js" + * createURL('/static/js/foo.js'); // "/splunk/en-US/static/@12345.1/js/foo.js" + * createURL('/static/app/search/js/foo.js'); // "/splunk/en-US/static/@12345.1:0/app/search/js/foo.js" + * ``` + * + * @public + * @param path {String} + * @param [queryParams] {Object} An object of the query parameters. + * @param configOptions {Object} - Config options including `appBuild`, `buildPushNumber`, + * `buildNumber`, `rootPath`, and `locale`. Defaults to the values provided by + * `@splunk/splunk-utils/config`. + * @return {String} Returns a valid URL with correct root path, locale, and cache buster. + * @alias createURL + */ + + + function createURL(pathInput, queryParams) { + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var options = _objectSpread({ + appBuild: appBuild, + buildPushNumber: buildPushNumber, + buildNumber: buildNumber, + rootPath: rootPath, + locale: locale + }, configOptions); + + var path = pathInput || '/'; + var query = queryParams ? "?".concat((0, _querystring.stringify)(queryParams)) : ''; + + if (path.charAt(0) !== '/') { + path = "/".concat(path); + } + + path = "".concat(options.rootPath || '', "/").concat(options.locale).concat(path).concat(query); + return insertCacheBuster(path, options); + } + /** + * Prepends Splunk Web path information necessary to access a static asset. For example: + * ``` + * createURL('fonts/roboto-regular-webfont.woff'); // "/splunk/en-US/static/@12345/fonts/roboto-regular-webfont.woff" + * createURL('app/search/fonts/roboto-regular-webfont.woff'); // "/splunk/en-US/static/@12345.1:0/app/search/fonts/roboto-regular-webfont.woff" + * ``` + * @public + * @param {String} path - A path to a static resource. + * @param [queryParams] {Object} An object of the query parameters. + * @param configOptions {Object} - Config options including `appBuild`, `buildPushNumber`, + * `buildNumber`, `rootPath`, and `locale`. Defaults to the values provided by + * `@splunk/splunk-utils/config`. + * @return {String} Returns a valid URL with correct root path, locale, and cache buster. + * @alias createStaticURL + */ + + + function createStaticURL(path) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + return createURL.apply(void 0, ["static/".concat(path)].concat(rest)); + } + /** + * Creates a fully qualified URL for the specified endpoint. + * For example: + * ``` + * createRESTURL('server/info'); // "/en-US/splunkd/__raw/services/server/info" + * createRESTURL('saved/searches', {app: 'search'}); // "/en-US/splunkd/__raw/servicesNS/-/search/saved/searches" + * ``` + * @public + * @param {String} endpoint - An endpoint to a REST API. + * @param {Object} options + * @param {String} [options.app] - App namespace to use. + * @param {String} [options.owner] - User namespace to use. + * @param {Sting} [options.sharing] - Must be one of [ '' | 'app' | 'global' | 'system' ]. + * @param {Object} [configOptions] - Config options including `splunkdPath`. Defaults to the value + * provided by `@splunk/splunk-utils/config`. + * @return {String} The URL of the REST API endpoint. + * @alias createRESTURL + */ + + + function createRESTURL(endpoint) { + var namespaceOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var configOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + // Return the endpoint if it's a full path. + if (/^http[s]?:\/\//.test(endpoint)) { + return endpoint; + } + + var basePath = configOptions.splunkdPath || splunkdPath || ''; // If it's an absolute path, + + if (/^\/.*/.test(endpoint)) { + // Append the splunkdPath if the endpoint includes services. Otherwise, return the endpoint. + return /^\/services/.test(endpoint) ? "".concat(basePath).concat(endpoint) : endpoint; + } // If neither an app nor owner is provided, use /services/ endpoint. + + + if (!namespaceOptions.app && !namespaceOptions.owner) { + return "".concat(basePath, "/services/").concat(endpoint); + } // Build a namespaced path. + + + var owner; + + if (namespaceOptions.sharing) { + owner = 'nobody'; + } else if (namespaceOptions.owner) { + owner = encodeURIComponent(namespaceOptions.owner); + } else { + owner = '-'; + } + + var app; + + if (namespaceOptions.sharing === 'system') { + app = 'system'; + } else if (namespaceOptions.app) { + app = encodeURIComponent(namespaceOptions.app); + } else { + app = '-'; + } + + return "".concat(basePath, "/servicesNS/").concat(owner, "/").concat(app, "/").concat(endpoint); + } + /** Create docs URL private method. + * @param {Object} [params] + * @private + */ + + + function createDocsURLFromParams(params, configOptions) { + return createURL('/help', params, configOptions); + } + /** Create docs URL using location string. + * For example: + * ``` + * createDocsURL('learnmore.timerange.picker'); // "/en-US/help?location=learnmore.timerange.picker" + * ``` + * @public + * @param {String} location - Required. + * @return {String} The URL of the Splunk help document. + * @alias createDocsURL + */ + + + function createDocsURL(location, configOptions) { + return createDocsURLFromParams({ + location: location + }, configOptions); + } + /** Create app docs URL using location string, which needs to add [appName:appVersion] prefix before the location string. + * For example: + * ``` + * createAppDocsURL('learnmore.timerange.picker', { appName: 'splunk_app_aws', appVersion: '5.0.3'}); // "/en-US/help?location=learnmore.timerange.picker" + * ``` + * @public + * @param {String} location - Required. + * @param {Object} options - Required. + * @param {String} options.appName - App name. + * @param {String} options.appVersion - App version. + * @return {String} The URL of the Splunk app help document. + * @alias createAppDocsURL + */ + + + function createAppDocsURL(location, _ref2, configOptions) { + var appName = _ref2.appName, + appVersion = _ref2.appVersion; + return createDocsURLFromParams({ + location: "[".concat(appName, ":").concat(appVersion, "]").concat(location) + }, configOptions); + } + + return { + createAppDocsURL: createAppDocsURL, + createDocsURL: createDocsURL, + createRESTURL: createRESTURL, + createStaticURL: createStaticURL, + createURL: createURL, + insertCacheBuster: insertCacheBuster + }; +} + +var _withConfig = withConfig(config), + createAppDocsURL = _withConfig.createAppDocsURL, + createDocsURL = _withConfig.createDocsURL, + createRESTURL = _withConfig.createRESTURL, + createStaticURL = _withConfig.createStaticURL, + createURL = _withConfig.createURL, + insertCacheBuster = _withConfig.insertCacheBuster; + +exports.insertCacheBuster = insertCacheBuster; +exports.createURL = createURL; +exports.createStaticURL = createStaticURL; +exports.createRESTURL = createRESTURL; +exports.createDocsURL = createDocsURL; +exports.createAppDocsURL = createAppDocsURL; + +/***/ }), + +/***/ 23910: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = SplunkThemeProvider; + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _styledComponents = __webpack_require__(92568); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +/** SplunkThemeProvider defaults to `prisma` `dark` `comfortable`, unless the properties have already been set. + * + * For example, here the nested `SplunkThemeProvider` defaults to `enterprise` `light`: + * ```jsx + * return ( + * + * Main part of the page in enterprise-light-comfortable. + * + * Part of the page in enterprise-light-compact. + * + * + * ) + */ +function SplunkThemeProvider(_ref) { + var family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density, + additionalThemeProperties = _ref.additionalThemeProperties, + customizeTheme = _ref.customizeTheme, + otherProps = _objectWithoutProperties(_ref, ["family", "colorScheme", "density", "additionalThemeProperties", "customizeTheme"]); + + var _ref2 = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + _ref2$splunkThemeV = _ref2.splunkThemeV1, + splunkThemeV1 = _ref2$splunkThemeV === void 0 ? {} : _ref2$splunkThemeV; + + var composedTheme = _objectSpread(_objectSpread({}, additionalThemeProperties), {}, { + splunkThemeV1: { + family: family || splunkThemeV1.family || 'prisma', + colorScheme: colorScheme || splunkThemeV1.colorScheme || 'dark', + density: density || splunkThemeV1.density || 'comfortable', + customizer: customizeTheme || splunkThemeV1.customizer + } + }); + + return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, _extends({ + theme: composedTheme + }, otherProps)); +} + +/***/ }), + +/***/ 16959: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * + * @valueSet + */ +var measures = { + spacingQuarter: '5px', + spacingHalf: '10px', + spacing: '20px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '32px', + borderRadius: '3px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 61842: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * * Larger containers, such as `Card` or `Modal`, use `spacing`. + * * `spacingHalf` and `spacingQuarter` are primarily for horizontal spacing between smaller elements. + * * Just because a desired value equals 20, 10, or 5 pixels, does not mean it's appropriate to + * use spacing variables. + * + * @valueSet + */ +var measures = { + spacingQuarter: '5px', + spacingHalf: '10px', + spacing: '20px', + fontSizeSmall: '12px', + fontSize: '12px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '28px', + borderRadius: '3px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 51663: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(94151)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var dragHandleDark = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA1SURBVHgB7dKhEQAgDAPAhHmwSKZHYtmHVtZVVNTkXS53UeG57yPYazLmrB8o6h8QgPqBOAOboRAPJUGIOAAAAABJRU5ErkJggg=="; // see babel-plugin-base64-png + +var dark = { + backgroundColor: _light["default"].gray20, + backgroundColorHover: _light["default"].gray30, + borderColor: _light["default"].gray22, + borderDarkColor: _light["default"].black, + borderLightColor: _light["default"].gray60, + textColor: _light["default"].white, + textGray: _light["default"].gray92, + textDisabledColor: _light["default"].gray45, + linkColor: _light["default"].accentColorL10, + linkColorHover: _light["default"].accentColorL20, + border: "1px solid ".concat(_light["default"].gray22), + borderDark: "1px solid ".concat(_light["default"].black), + borderLight: "1px solid ".concat(_light["default"].gray60), + focusShadowInset: "inset 0 0 1px 1px ".concat(_light["default"].gray25, ", inset 0 0 0 3px ").concat(_light["default"].focusColor), + draggableBackground: "url('data:image/png;base64,".concat(dragHandleDark, "') 0 0 / 8px 8px repeat") +}; + +var theme = _objectSpread(_objectSpread({}, _light["default"]), dark); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 97903: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(94151)); + +var _dark = _interopRequireDefault(__webpack_require__(51663)); + +var _compact = _interopRequireDefault(__webpack_require__(61842)); + +var _comfortable = _interopRequireDefault(__webpack_require__(16959)); + +var _prismaAliases = _interopRequireDefault(__webpack_require__(2991)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function createEnterpriseTheme(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var cs = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var d = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + var pa = (0, _prismaAliases["default"])({ + colorScheme: colorScheme, + density: density + }); + return _objectSpread(_objectSpread(_objectSpread({}, cs), d), pa); +} + +var _default = createEnterpriseTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 94151: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var dragHandle = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA2SURBVHgB7dKhEQAgDAPAhDnxDMAcDIBnT1pZV1FRk3e53EWFc+2P4N3DmLN+oKh/QADqB+IMUKEQD/CeueAAAAAASUVORK5CYII="; // see babel-plugin-base64-pngimport { + +/** + * # Brand Colors + * + * @colorSet + */ + +var brandColors = { + brandColorL50: '#f5fbf5', + brandColorL40: '#dff2df', + brandColorL30: '#bee6be', + brandColorL20: '#9ed99e', + brandColorL10: '#7ecd7e', + brandColor: '#5cc05c', + brandColorD10: '#49b849', + brandColorD20: '#40a540', + brandColorD30: '#389038', + brandColorD40: '#307b30', + brandColorD50: '#286728' +}; +/** + * # Grayscale Colors + * + * @colorSet + */ + +var grays = { + white: '#ffffff', + gray98: '#f7f8fa', + gray96: '#f2f4f5', + gray92: '#e1e6eb', + gray80: '#c3cbd4', + gray60: '#818d99', + gray45: '#5c6773', + gray30: '#3c444d', + gray25: '#31373e', + gray22: '#2b3033', + gray20: '#171d21', + black: '#000000' +}; +/** + * # Accent Colors + * + * @colorSet + */ + +var accentColors = { + accentColorL50: '#ecf8ff', + accentColorL40: '#bfe9ff', + accentColorL30: '#7ed2ff', + accentColorL20: '#3ebcff', + accentColorL10: '#00a4fd', + accentColor: '#007abd', + accentColorD10: '#006eaa', + accentColorD20: '#006297', + accentColorD30: '#005684', + accentColorD40: '#004a71', + accentColorD50: '#003d5e' +}; +/** + * # Error Colors + * + * @colorSet + */ + +var errorColors = { + errorColorL50: '#fcedec', + errorColorL40: '#f8dcd9', + errorColorL30: '#f1b9b3', + errorColorL20: '#ea958d', + errorColorL10: '#e37267', + errorColor: '#dc4e41', + errorColorD10: '#c84535', + errorColorD20: '#b23d30', + errorColorD30: '#9c3529', + errorColorD40: '#852d24', + errorColorD50: '#6f261d' +}; +/** + * # Alert Colors + * + * @colorSet + * */ + +var alertColors = { + alertColorL50: '#fef3ec', + alertColorL40: '#fde6d9', + alertColorL30: '#facdb3', + alertColorL20: '#f7b48c', + alertColorL10: '#f49b66', + alertColor: '#f1813f', + alertColorD10: '#da742e', + alertColorD20: '#c2672a', + alertColorD30: '#aa5a25', + alertColorD40: '#914d1f', + alertColorD50: '#79401a' +}; +/** + * # Warning Colors + * + * @colorSet + */ + +var warningColors = { + warningColorL50: '#fff9eb', + warningColorL40: '#fef2d7', + warningColorL30: '#fde5ae', + warningColorL20: '#fbd886', + warningColorL10: '#facb5d', + warningColor: '#f8be34', + warningColorD10: '#e0ac16', + warningColorD20: '#c79915', + warningColorD30: '#ae8613', + warningColorD40: '#957312', + warningColorD50: '#7d600f' +}; +/** + * # Success Colors + * + * @colorSet + */ + +var successColors = { + successColorL50: '#eef6ee', + successColorL40: '#ddecdd', + successColorL30: '#bbd9ba', + successColorL20: '#98c697', + successColorL10: '#76b374', + successColor: '#53a051', + successColorD10: '#479144', + successColorD20: '#40813d', + successColorD30: '#387135', + successColorD40: '#2f612e', + successColorD50: '#275126' +}; +/** + * # Info Colors + * + * @colorSet + */ + +var infoColors = { + infoColorL50: '#e5f0f5', + infoColorL40: '#cce2eb', + infoColorL30: '#99c5d7', + infoColorL20: '#66a7c4', + infoColorL10: '#338ab0', + infoColor: '#006d9c', + infoColorD10: '#00577c', + infoColorD20: '#004c6c', + infoColorD30: '#00415d', + infoColorD40: '#00364d', + infoColorD50: '#002b3e' +}; +/** + * # Diverging Colors + * + * @colorSet alphabetical + */ + +var divergingColors = { + diverging1ColorA: '#006d9c', + diverging1ColorB: '#ec9960', + diverging2ColorA: '#af575a', + diverging2ColorB: '#62b3b2', + diverging3ColorA: '#4fa484', + diverging3ColorB: '#f8be34', + diverging4ColorA: '#5a4575', + diverging4ColorB: '#708794', + diverging5ColorA: '#294e70', + diverging5ColorB: '#b6c75a' +}; +/** + * # Categorical Colors + * + * @colorSet alphabetical + */ + +var categoricalColors = { + cat1Color: '#297ba5', + cat1ColorL: '#78b9d6', + cat2Color: '#4fa484', + cat2ColorL: '#74d5c2', + cat3Color: '#b6c75a', + cat3ColorL: '#dce6a5', + cat4Color: '#3c6188', + cat4ColorL: '#a0b2ca', + cat5Color: '#ec9960', + cat5ColorL: '#fac9a7', + cat6Color: '#a65c7d', + cat6ColorL: '#d3a7ba', + cat7Color: '#708794', + cat7ColorL: '#b2c0c8', + cat8Color: '#38b8bf', + cat8ColorL: '#92dde2', + cat9Color: '#ffde63', + cat9ColorL: '#ffeeae', + cat10Color: '#c19975', + cat10ColorL: '#d7bfab', + cat11Color: '#5a4575', + cat11ColorL: '#b7acca', + cat12Color: '#7ea77b', + cat12ColorL: '#b2cab0', + cat13Color: '#576d83', + cat13ColorL: '#a5b2bf', + cat14Color: '#d7c6b7', + cat14ColorL: '#e9ddd4', + cat15Color: '#339bb2', + cat15ColorL: '#66c3d0', + cat16Color: '#236d9b', + cat16ColorL: '#66a7c2', + cat17Color: '#e5dc80', + cat17ColorL: '#f1eab7', + cat18Color: '#96907f', + cat18ColorL: '#c1bcb3', + cat19Color: '#87bc65', + cat19ColorL: '#b6d7a3', + cat20Color: '#cf7e60', + cat20ColorL: '#e1b2a1', + cat21Color: '#7b5547', + cat21ColorL: '#dec4ba', + cat22Color: '#77d6d8', + cat22ColorL: '#abe6e8', + cat23Color: '#4a7f2c', + cat23ColorL: '#91b282', + cat24Color: '#f589ad', + cat24ColorL: '#f8b7ce', + cat25Color: '#6a2c5d', + cat25ColorL: '#cba3c2', + cat26Color: '#aaabae', + cat26ColorL: '#cccdce', + cat27Color: '#9a7438', + cat27ColorL: '#c3ab89', + cat28Color: '#a4d563', + cat28ColorL: '#c7e6a3', + cat29Color: '#7672a4', + cat29ColorL: '#ada9c8', + cat30Color: '#184b81', + cat30ColorL: '#a4bbe0' +}; +/** + * # Usage-based Colors + * + * @colorSet verbose + */ + +var usageColors = { + textColor: grays.gray30, + textGray: '#6b7785', + textDisabledColor: grays.gray80, + linkColor: accentColors.accentColorD10, + linkColorHover: accentColors.accentColor, + borderLightColor: grays.gray92, + borderColor: grays.gray80, + focusColor: accentColors.accentColorD10, + backgroundColorHover: grays.gray96, + backgroundColor: grays.white, + transparent: 'transparent' +}; +/** + * # Syntax Colors + * The following colors should only be used for syntax coloring of code. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#2662fc', + syntaxBlueLight: '#006d9c', + syntaxBrown: '#a67f59', + syntaxGray: '#8293a7', + syntaxGreen: '#5ca300', + syntaxGreenLight: '#5ba383', + syntaxOrange: '#f58220', + syntaxPink: '#cf00cf', + syntaxPurple: '#7738ff', + syntaxPurpleLight: '#b19cd9', + syntaxRed: '#d90700', + syntaxRedLight: '#af575a', + syntaxTeal: '#00a8ab' +}; +/** + * # Shadows + * + * @shadowSet + */ + +var shadows = { + focusShadow: "0 0 1px 3px ".concat(usageColors.focusColor), + focusShadowInset: "inset 0 0 1px 1px ".concat(grays.white, ", inset 0 0 0 3px ").concat(usageColors.focusColor), + overlayShadow: '0 4px 8px rgba(0, 0, 0, 0.2)' +}; +/** + * # Backgrounds + * + * @colorSet verbose + */ + +var backgrounds = { + draggableBackground: "url('data:image/png;base64,".concat(dragHandle, "') 0 0 / 8px 8px repeat") +}; +/** + * # Border + * + * @valueSet + */ + +var borders = { + borderRadius: '3px', + border: "1px solid ".concat(usageColors.borderColor) +}; +var sansFontFamily = "'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif"; +/** + * # Fonts + * + * @valueSet + */ + +var fonts = { + sansFontFamily: sansFontFamily, + serifFontFamily: "Georgia, 'Times New Roman', Times, serif", + monoFontFamily: "'Splunk Platform Mono', Inconsolata, Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace", + fontFamily: sansFontFamily, + fontWeightBold: '700', + fontWeightSemiBold: '500' +}; +/** + * # Layers + * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1. + * + * @valueSet + */ + +var zindexes = { + zindexFixedNavbar: 1030, + zindexModalBackdrop: 1040, + zindexModal: 1050, + zindexPopover: 1060, + zindexToastMessages: 2000 +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors), fonts), usageColors), backgrounds), shadows), borders), zindexes); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 2991: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _light = _interopRequireDefault(__webpack_require__(94151)); + +var _dark = _interopRequireDefault(__webpack_require__(51663)); + +var _compact = _interopRequireDefault(__webpack_require__(61842)); + +var _comfortable = _interopRequireDefault(__webpack_require__(16959)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function createPrismaAliases(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var cs = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var d = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + /** + * # Prisma Aliases + * The following aliases for prisma variables are provided for convenience. Just because an alias is provided, + * does not mean it is ideal for enterprise themes in all scenarios. + * + * They cover all values except most `interactiveColor*` variables. + * + * + * For example, use + * ``` css + * const myClickable = styled(Clickable)` + * color: ${variables.contentColorDefault}; + * } + * ``` + * instead of + * ``` css + * const myClickable = styled(Clickable)` + * color: ${pick({ + * enterprise: variables.textColor; + * prisma: variables.contentColorDefault; + * })}; + * } + * ``` + * + * @valueSet + */ + + var prismaAliases = { + accentColorPositive: cs.successColor, + accentColorWarning: cs.warningColor, + accentColorAlert: cs.alertColor, + accentColorNegative: cs.errorColor, + statusColorInfo: cs.infoColorL10, + statusColorNormal: cs.successColorL10, + statusColorLow: cs.warningColorL10, + statusColorMedium: cs.alertColorL10, + statusColorHigh: cs.errorColorL10, + statusColorCritical: cs.errorColorD20, + embossShadow: cs.overlayShadow, + dragShadow: cs.overlayShadow, + modalShadow: cs.overlayShadow, + backgroundColorPopup: cs.backgroundColor, + backgroundColorSection: cs.backgroundColor, + backgroundColorSidebar: cs.backgroundColor, + backgroundColorPage: cs.backgroundColor, + backgroundColorNavigation: cs.backgroundColor, + backgroundColorFloating: cs.backgroundColor, + backgroundColorDialog: cs.backgroundColor, + backgroundColorScrim: (0, _tinycolor["default"])(cs.gray30).setAlpha(0.8).toRgbString(), + contentColorActive: cs.textColor, + contentColorDefault: cs.textColor, + contentColorMuted: cs.textGray, + contentColorDisabled: cs.textDisabledColor, + contentColorInverted: colorScheme === 'dark' ? cs.gray30 : cs.gray30, + neutral100: colorScheme === 'dark' ? cs.gray25 : cs.gray98, + neutral200: colorScheme === 'dark' ? cs.gray30 : cs.gray96, + neutral300: colorScheme === 'dark' ? cs.gray45 : cs.gray92, + neutral400: colorScheme === 'dark' ? cs.gray60 : _tinycolor["default"].mix(cs.gray92, cs.gray80).toRgbString(), + neutral500: cs.gray80, + interactiveColorPrimary: cs.brandColor, + interactiveColorBorder: cs.borderColor, + spacingXSmall: d.spacingQuarter, + spacingSmall: d.spacingHalf, + spacingMedium: "calc(".concat(d.spacing, " * 0.75)"), + spacingLarge: d.spacing, + spacingXLarge: "calc(".concat(d.spacing, " * 1.5)"), + spacingXXLarge: "calc(".concat(d.spacing, " * 2)"), + spacingXXXLarge: "calc(".concat(d.spacing, " * 2.5)") + }; + return prismaAliases; +} + +var _default = createPrismaAliases; +exports["default"] = _default; + +/***/ }), + +/***/ 68367: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _utils = __webpack_require__(290); + +/** + * The theme settings in `props.theme` are not considered an API to allow support for fallbacks + * and forward compatibility in future versions of `SplunkThemeProvider`. Use this utility to + * access `family`, `colorScheme`, and `density` from a component's props. This is useful + * in limited migration scenarios. Use `withSplunkTheme` or `useSplunkTheme` instead. + * + * ```js + * import getSettingsFromThemedProps from '@splunk/themes/getSettingsFromThemedProps'; + * ... + * const { family, colorScheme } = getSettingsFromThemedProps(props); + * + * ``` + * @param {object} props - The themed props passed to a styled-component. + * @returns {object} An object consisting of `{ family, colorScheme, density }`. + * @public + */ +function getSettingsFromThemedProps(props) { + var _props$theme; + + // props.theme is sometimes null + var _ref = ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.splunkThemeV1) || {}, + family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + + return (0, _utils.addThemeDefaults)({ + family: family, + colorScheme: colorScheme, + density: density + }); +} + +var _default = getSettingsFromThemedProps; +exports["default"] = _default; + +/***/ }), + +/***/ 78886: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearGetThemeCache = exports["default"] = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _enterprise = _interopRequireDefault(__webpack_require__(97903)); + +var _prisma = _interopRequireDefault(__webpack_require__(71232)); + +var _utils = __webpack_require__(290); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * **NOTE:** Use cases for this function are limited. Instead, use `useSplunkTheme` in React components and `variables` in styled-components' CSS. + * This function is for use outside of React and styled-components. + * @file + */ + +/** + * The `getTheme` function returns all theme variables for a given theme. This function is memoized. + * + * ```js + * import getTheme from '@splunk/themes/getTheme'; + * + * const baseTheme = getTheme({family: 'prisma', colorScheme: 'light', density: 'compact' }); + * + * console.log(baseTheme.family, baseTheme.focusColor); + * ``` + * @param {object} [options] - The attributes of the theme as defined below. + * @param {'prisma' | 'enterprise'} [options.family = 'prisma'] + * @param {'dark' | 'light'} [options.colorScheme = 'dark'] + * @param {'comfortable' | 'compact'} [options.density = 'comfortable'] + * @returns {object} A flat object of all variables and their values. + * @public + */ +function getTheme() { + var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var _addThemeDefaults = (0, _utils.addThemeDefaults)(settings), + family = _addThemeDefaults.family, + colorScheme = _addThemeDefaults.colorScheme, + density = _addThemeDefaults.density; + + return Object.freeze(_objectSpread({ + colorScheme: colorScheme, + density: density, + family: family + }, family === 'enterprise' ? (0, _enterprise["default"])({ + colorScheme: colorScheme, + density: density + }) : (0, _prisma["default"])({ + colorScheme: colorScheme, + density: density + }))); +} + +var getThemeMemoized = (0, _memoize["default"])(getTheme, function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + + return "".concat(family).concat(colorScheme).concat(density); +}); + +var clearGetThemeCache = function clearGetThemeCache() { + var _getThemeMemoized$cac, _getThemeMemoized$cac2; + + return (_getThemeMemoized$cac = (_getThemeMemoized$cac2 = getThemeMemoized.cache).clear) === null || _getThemeMemoized$cac === void 0 ? void 0 : _getThemeMemoized$cac.call(_getThemeMemoized$cac2); +}; + +exports.clearGetThemeCache = clearGetThemeCache; +var _default = getThemeMemoized; +exports["default"] = _default; + +/***/ }), + +/***/ 78967: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + getSettingsFromThemedProps: true, + getTheme: true, + mixins: true, + pick: true, + pickVariant: true, + SplunkThemeProvider: true, + useSplunkTheme: true, + withSplunkTheme: true, + variables: true +}; +Object.defineProperty(exports, "getSettingsFromThemedProps", ({ + enumerable: true, + get: function get() { + return _getSettingsFromThemedProps["default"]; + } +})); +Object.defineProperty(exports, "getTheme", ({ + enumerable: true, + get: function get() { + return _getTheme["default"]; + } +})); +Object.defineProperty(exports, "mixins", ({ + enumerable: true, + get: function get() { + return _mixins["default"]; + } +})); +Object.defineProperty(exports, "pick", ({ + enumerable: true, + get: function get() { + return _pick["default"]; + } +})); +Object.defineProperty(exports, "pickVariant", ({ + enumerable: true, + get: function get() { + return _pickVariant["default"]; + } +})); +Object.defineProperty(exports, "SplunkThemeProvider", ({ + enumerable: true, + get: function get() { + return _SplunkThemeProvider["default"]; + } +})); +Object.defineProperty(exports, "useSplunkTheme", ({ + enumerable: true, + get: function get() { + return _useSplunkTheme["default"]; + } +})); +Object.defineProperty(exports, "withSplunkTheme", ({ + enumerable: true, + get: function get() { + return _withSplunkTheme["default"]; + } +})); +Object.defineProperty(exports, "variables", ({ + enumerable: true, + get: function get() { + return _variables["default"]; + } +})); + +var _getSettingsFromThemedProps = _interopRequireDefault(__webpack_require__(68367)); + +var _getTheme = _interopRequireDefault(__webpack_require__(78886)); + +var _mixins = _interopRequireDefault(__webpack_require__(17597)); + +var _pick = _interopRequireDefault(__webpack_require__(78310)); + +var _pickVariant = _interopRequireDefault(__webpack_require__(98177)); + +var _SplunkThemeProvider = _interopRequireDefault(__webpack_require__(23910)); + +var _useSplunkTheme = _interopRequireDefault(__webpack_require__(31198)); + +var _withSplunkTheme = _interopRequireDefault(__webpack_require__(21215)); + +var _variables = _interopRequireDefault(__webpack_require__(68870)); + +var _types = __webpack_require__(39342); + +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _types[key]; + } + }); +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/***/ }), + +/***/ 17597: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearfix = clearfix; +exports.ellipsis = ellipsis; +exports.printWidth100Percent = printWidth100Percent; +exports.printHide = printHide; +exports.printNoBackground = printNoBackground; +exports.printWrapAll = printWrapAll; +exports.screenReaderContent = screenReaderContent; +exports.overlayColors = overlayColors; +exports.colorWithAlpha = colorWithAlpha; +exports["default"] = exports.reset = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _styledComponents = __webpack_require__(92568); + +var _colorBlend = __webpack_require__(94581); + +var _variables = _interopRequireDefault(__webpack_require__(68870)); + +var _pick = _interopRequireDefault(__webpack_require__(78310)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n /* Generic resets */\n animation: none 0s ease 0s 1 normal none running;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n box-shadow: none;\n caption-side: top;\n clear: none;\n clip: auto;\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n empty-cells: show;\n float: none;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n list-style: disc outside none;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n pointer-events: auto;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-origin: 50% 50% 0;\n transform-style: flat;\n transition: none 0s ease 0s;\n user-select: auto;\n vertical-align: baseline;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n /* Splunk-specific resets */\n border-width: 1px;\n box-sizing: border-box;\n color: ", ";\n cursor: inherit;\n display: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +/** + * @file + * A collection of style-related helper functions. All of them return a single object containing + * DOM CSS properties, for example: `{ display: …, fontFamily: … }`. + */ + +/** + * The `reset` mixin resets css properties to their browser defaults, plus many to + * theme-specific values. This ensures an element is not inheriting inappropriate styles. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { reset } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${reset('block')}; + * ` + * ``` + * @name reset + * @kind function + * @param {string} [display=inline] Set the `display` property (block, inline-block, …) + * @public + */ +var reset = function reset() { + var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline'; + return function () { + return (0, _styledComponents.css)(_templateObject(), (0, _pick["default"])({ + enterprise: _variables["default"].textColor, + prisma: _variables["default"].contentColorDefault + }), display, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor); + }; +}; +/** + * `clearfix` is used on a container to ensure its height is at least as tall as any floating + * children. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { clearfix } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${clearfix()}; + * ` + * ``` + * @public + */ + + +exports.reset = reset; + +function clearfix() { + return { + '&::after': { + display: 'table', + content: '""', + clear: 'both' + } + }; +} +/** + * Use `ellipsis` for overflowing text. Requires `display` to be set to `inline-block` or `block`. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { ellipsis } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * ${clearfix()}; + * width: 300px; + * ` + * ``` + * @public + */ + + +function ellipsis() { + return { + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap' + }; +} +/** + * Force an element to be exactly 100% wide so that it doesn't overflow the page. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printWidth100Percent } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printWidth100Percent()}; + * } + * } + * } + * ` + * ``` + * @public + */ + + +function printWidth100Percent() { + return { + maxWidth: '100% !important', + width: '100% !important', + overflow: 'hidden !important' + }; +} +/** + * Hide an element (such as a button). + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printHide } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printHide()}; + * } + * } + * } + * ``` + * @public + */ + + +function printHide() { + return { + display: 'none !important' + }; +} +/** + * Remove background gradients and images. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printNoBackground } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printNoBackground()}; + * } + * } + * } + * ``` + * @public + */ + + +function printNoBackground() { + return { + background: 'none !important' + }; +} +/** + * Ensure that all text wraps so that it doesn't overflow the page. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { printWrapAll } from '@splunk/themes/mixins'; + * + * const myBlock = styled.div` + * @media print { + * .myElement { + * ${printWrapAll()}; + * } + * } + * } + * ``` + * @public + */ + + +function printWrapAll() { + // TS: have to assert as CSSObject because csstype doesn't allow !important + return { + wordBreak: 'break-all !important', + wordWrap: 'break-word !important', + overflowWrap: 'break-word !important', + whiteSpace: 'normal !important' + }; +} +/** + * Visually hide content. Typically used to target content for assistive technologies. + * + * ##### Example + * ``` js + * import screenReaderContent from '@splunk/themes/mixins'; + * + * .myElement { + * ${props => props.theme.mixins.screenReaderContent()}; + * } + * ``` + * @public + */ + + +function screenReaderContent() { + return { + position: 'absolute', + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + height: '1px', + width: '1px', + margin: '-1px', + padding: 0, + border: 0 + }; +} + +/** + * Calculates how one color would appear over another using a normal blend mode. + * Colors can either be strings or functions, such as variable functions. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { overlayColors } from '@splunk/themes/mixins'; + * import { interactiveColorPrimary, interactiveColorOverlaySelected } from '@splunk/themes/variables'; + * + * const myButton = styled.button` + * background: ${overlayColors(interactiveColorPrimary, interactiveColorOverlaySelected)}; + * ` + * ``` + * @name overlayColors + * @kind function + * @param {string|function} background + * @param {string|function} foreground The color to overlay over the background. + * @public + */ +function overlayColors(c1, c2) { + return function (props) { + var c1Value = typeof c1 === 'function' ? c1(props) : c1; + var c2Value = typeof c2 === 'function' ? c2(props) : c2; + var c3 = (0, _colorBlend.normal)((0, _tinycolor["default"])(c1Value).toRgb(), (0, _tinycolor["default"])(c2Value).toRgb()); + return (0, _tinycolor["default"])(c3).toRgbString(); + }; +} +/** + * Sets the alpha value on a given color. + * + * ##### Example + * ```js + * import styled from 'styled-components'; + * import { colorWithAlpha } from '@splunk/themes/mixins'; + * import { interactiveColorPrimary } from '@splunk/themes/variables'; + * + * const myButton = styled.button` + * background: ${colorWithAlpha(interactiveColorPrimary, 0.5)}; + * ` + * ``` + * @name colorWithAlpha + * @kind function + * @param {string|function} color + * @param {number} alpha The alpha value accepts range between 0-1. + * @public + */ + + +function colorWithAlpha(color, alpha) { + return function (props) { + var colorValue = typeof color === 'function' ? color(props) : color; + + if (false) {} + + return (0, _tinycolor["default"])(colorValue).setAlpha(alpha).toRgbString(); + }; +} + +var _default = { + reset: reset, + clearfix: clearfix, + ellipsis: ellipsis, + printWidth100Percent: printWidth100Percent, + printHide: printHide, + printNoBackground: printNoBackground, + printWrapAll: printWrapAll, + screenReaderContent: screenReaderContent, + colorWithAlpha: colorWithAlpha, + overlayColors: overlayColors +}; +exports["default"] = _default; + +/***/ }), + +/***/ 78310: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isInterpolationResult = isInterpolationResult; +exports["default"] = exports.getThemeVariant = void 0; + +var _utils = __webpack_require__(290); + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var valueToKey = { + enterprise: 'family', + prisma: 'family', + light: 'colorScheme', + dark: 'colorScheme', + compact: 'density', + comfortable: 'density' +}; + +function isInterpolationResult(tree) { + // for this to work as expected for objects/CSSProperties, it may be necessary to change + // it to only consider objects that have valid pick tree keys (but no other keys) + // as trees + return _typeof(tree) !== 'object' || Array.isArray(tree) || tree === null; +} +/** + * This function is exported for use in pickVariant exclusively. + */ + + +var getThemeVariant = function getThemeVariant(tree, theme) { + // If it's not an object with one of the six keys, it must be an end value. + var treeKey = Object.keys(tree).shift(); + + if (!treeKey) { + throw new Error('A pick tree cannot be empty.'); + } + + var themeKey = valueToKey[treeKey]; + + if (!themeKey) { + throw new Error("Invalid pick tree key: ".concat(treeKey)); + } // Recursively crawl the tree. + + + var themeCurrentValue = theme[themeKey]; + var treeValue = tree[themeCurrentValue]; // If it's not an object or it's a null value, it must be the end value. + + if (isInterpolationResult(treeValue)) { + return treeValue; // this may be undefined, when the css does not support the theme + } + + return getThemeVariant(treeValue, theme); +}; +/** + * Pick is used to create theme-specific css. + * + * This example selects an appropriate variable for the current theme. + * ``` + * import { pick, variables } from '@splunk/themes'; + * + * const Wrapper = styled.div` + * color: ${pick({ + * enterprise: { + * light: variables.grey35, + * dark: variables.grey92, + * }, + * prisma: variables.contentColorDefault, + * })} + * `; + * ``` + * This example selects an appropriate block of css for the current theme. + * ``` + * const Label = styled.div` + * ${pick({ + * enterprise: css` + * font-weight: ${variables.fontWeightSemiBold}; + * `, + * prisma: css` + * color: ${variables.contentColorDefault), + * `, + * })} + * `; + * ``` + * @param {object} themeOptions - An object consisting of a tree of theme options (`enterprise|prisma`, `light|dark`, or `compact|comfortable`). + * @returns {function} The returned function is called by `styled-components`, which provides the theme context. + * @public + */ + + +exports.getThemeVariant = getThemeVariant; + +var pick = function pick(tree) { + return function (_ref) { + var theme = _ref.theme; + var themeCleaned = (0, _utils.addThemeDefaults)(theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1); + return getThemeVariant(tree, themeCleaned); + }; +}; + +var _default = pick; +exports["default"] = _default; + +/***/ }), + +/***/ 98177: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _pick = __webpack_require__(78310); + +var _utils = __webpack_require__(290); + +/** + * Pick Variant is used to create theme-specific css. + * + * This example selects an appropriate variable for the current theme. + * ``` + * import { pickVariant } from '@splunk/themes'; + * + * ... + * + * const Wrapper = styled.div` + * ${pickVariant('appearance', { + * filled: 'background: red', + * open: 'border: 1px solid red', + * })} + * `; + * ``` + * This example selects an appropriate block of css for the current theme. + * ``` + * const Wrapper = styled.div` + * ${pickVariant('appearance', { + * filled: { + * enterprise: 'background: green', + * prisma: 'background: blue', + * }, + * open: { + * enterprise: 'border: 1px solid green', + * prisma: 'border: 1px solid blue', + * }, + * })} + * `; + * ``` + * @param {string} propName - The prop name used to resolve the variants. The prop value must be a `string` or `boolean`. + * @param {object} themeOptions - An object consisting of a tree of theme options, with the prop variants the top of the tree and optional + * theme variants below (`enterprise|prisma`, `light|dark`, or `compact|comfortable`). + * @returns {function} The returned function is called by `styled-components`, which provides the props and theme context. + * @public + */ +var pickVariant = function pickVariant(propName, tree) { + return function (props) { + var _props$theme; + + // TS: must assume prop value can be used as string key + var variantKey = props[propName]; + var subTree = tree[variantKey]; + + if ((0, _pick.isInterpolationResult)(subTree)) { + return subTree; + } + + var theme = (0, _utils.addThemeDefaults)((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.splunkThemeV1); + return (0, _pick.getThemeVariant)(subTree, theme); + }; +}; + +var _default = pickVariant; +exports["default"] = _default; + +/***/ }), + +/***/ 36607: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _tinycolor = _interopRequireDefault(__webpack_require__(87021)); + +var _light = _interopRequireDefault(__webpack_require__(60364)); + +var _dark = _interopRequireDefault(__webpack_require__(94574)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function createPrismaBase(_ref) { + var colorScheme = _ref.colorScheme; + var colorSchemeVars = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + /** + * # Misc Colors + * + * @colorSet verbose + */ + + var usageColors = { + focusColor: (0, _tinycolor["default"])(colorSchemeVars.interactiveColorPrimary).setAlpha(0.7).toRgbString(), + transparent: 'transparent', + linkColor: colorSchemeVars.interactiveColorPrimary + }; + /** + * # Interactive State Shadows + * + * @shadowSet + * + */ + + var shadows = { + hoverShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(colorSchemeVars.interactiveColorOverlayHover), + focusShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(usageColors.focusColor), + focusShadowInset: "inset 0 0 0 3px ".concat(usageColors.focusColor) + }; + /** + * # Backgrounds + * + * @colorSet verbose + */ + + var backgrounds = { + draggableBackground: "radial-gradient(circle at 1px 1px, ".concat(colorSchemeVars.contentColorMuted, ", ").concat(colorSchemeVars.contentColorMuted, " 1px, transparent 1px) 0 0 / 4px 6px") + }; + var sansFontFamily = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif"; + /** + * # Fonts + * + * @valueSet + */ + + var fonts = { + sansFontFamily: sansFontFamily, + serifFontFamily: "Georgia, 'Times New Roman', Times, serif", + monoFontFamily: "'Splunk Platform Mono', 'Roboto Mono', Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace", + fontFamily: sansFontFamily, + fontWeightBold: '700', + fontWeightSemiBold: '500' + }; + /** + * # Layers + * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1. + * + * @valueSet + */ + + var zindexes = { + zindexFixedNavbar: 1030, + zindexModalBackdrop: 1040, + zindexModal: 1050, + zindexPopover: 1060, + zindexToastMessages: 2000 + }; + return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fonts), usageColors), shadows), backgrounds), zindexes); +} + +var _default = createPrismaBase; +exports["default"] = _default; + +/***/ }), + +/***/ 55804: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * + * @valueSet + */ +var measures = { + spacingXSmall: '4px', + spacingSmall: '8px', + spacingMedium: '12px', + spacingLarge: '16px', + spacingXLarge: '24px', + spacingXXLarge: '32px', + spacingXXXLarge: '40px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '40px', + borderRadius: '4px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 99617: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** + * # Measures + * Spacing is used for margin on any element or padding on containers, but can be used for other + * properties that position elements. + * * Larger containers, such as `Card` or `Modal`, use `spacing`. + * * `spacingHalf` and `spacingQuarter` are primarily for horizontal spacing between smaller elements. + * * Just because a desired value equals 20, 10, or 5 pixels, does not mean it's appropriate to + * use spacing variables. + * + * @valueSet + */ +var measures = { + spacingXSmall: '4px', + spacingSmall: '8px', + spacingMedium: '12px', + spacingLarge: '16px', + spacingXLarge: '24px', + spacingXXLarge: '32px', + spacingXXXLarge: '40px', + fontSizeSmall: '12px', + fontSize: '14px', + fontSizeLarge: '16px', + fontSizeXLarge: '18px', + fontSizeXXLarge: '24px', + lineHeight: '20px', + inputHeight: '32px', + borderRadius: '4px' +}; +var _default = measures; +exports["default"] = _default; + +/***/ }), + +/***/ 94574: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * # Background Colors + * Background colors should be used only for backgrounds of higher level sections & containers of a UI. + * + * @colorSet verbose + */ +var backgroundColors = { + backgroundColorPopup: '#27292e', + backgroundColorSection: '#1a1c20', + backgroundColorSidebar: '#0b0c0e', + backgroundColorPage: '#111215', + backgroundColorNavigation: '#08090a', + backgroundColorFloating: '#ffffff', + backgroundColorDialog: '#1e2024', + backgroundColorScrim: 'rgba(0, 0, 0, 0.8)' +}; +/** + * # Content Colors + * Content colors should be used for text, icons and dividers. + * + * @colorSet verbose + */ + +var contentColors = { + contentColorActive: '#fafafa', + contentColorDefault: '#b5b5b5', + contentColorDisabled: '#6b6b6b', + contentColorInverted: '#000000', + contentColorMuted: '#909090' +}; +/** + * # Interactive Colors + * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content. + * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary. + * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two. + * + * @colorSet verbose + */ + +var interactiveColors = { + interactiveColorPrimary: '#3993FF', + interactiveColorBorder: 'rgba(255, 255, 255, 0.5)', + interactiveColorBorderHover: 'rgba(255, 255, 255, 0.7)', + interactiveColorBorderDisabled: 'rgba(255, 255, 255, 0.30)', + interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)', + interactiveColorOverlayHover: 'rgba(255, 255, 255, 0.05)', + interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.2)', + interactiveColorOverlayDrag: 'rgba(57, 147, 255, 0.16)', + interactiveColorBackground: '#272a2f', + interactiveColorBackgroundDisabled: 'rgba(255, 255, 255, 0.15)' +}; +/** + * # Neutral Colors + * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough. + * + * @colorSet verbose + */ + +var neutralColors = { + black: '#000000', + neutral100: '#33343b', + neutral200: '#43454b', + neutral300: '#505158', + neutral400: '#818285', + neutral500: '#acacad', + white: '#ffffff' +}; +/** + * # Accent Colors + * Accent colors aid and categorize the visual communication of the system response. + * + * @colorSet verbose + */ + +var accentColors = { + accentColorPositive: '#27f561', + accentColorWarning: '#ffd442', + accentColorAlert: '#ff9750', + accentColorNegative: '#ff5c5c' +}; +/** + * # Status Colors + * Status colors are reserved for communicating urgency and severity associated with data objects. + * + * @colorSet verbose + */ + +var statusColors = { + statusColorInfo: '#61cafa', + statusColorNormal: '#85eb48', + statusColorLow: '#fae75f', + statusColorMedium: '#f5b53f', + statusColorHigh: '#ec4B43', + statusColorCritical: '#a81916' +}; +/** + * # Elevation Shadows + * + * @shadowSet + * + */ + +var elevationShadows = { + embossShadow: '0px 1px 5px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(0, 0, 0, 0.35)', + overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)', + dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)', + modalShadow: '0px 50px 200px #000000, 0px 29px 66px rgba(0, 0, 0, 0.41), 0px 14px 47px rgba(0, 0, 0, 0.17), 0px 5px 10px rgba(0, 0, 0, 0.15)' +}; +/** + * # Syntax Colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#6cd0f0', + syntaxBrown: '#fccf87', + syntaxGray: '#7d7d7d', + syntaxGreen: '#cef06c', + syntaxOrange: '#f7933f', + syntaxPink: '#f494e5', + syntaxPurple: '#a870ef', + syntaxRed: '#e85b79', + syntaxTeal: '#45d4ba' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, accentColors), statusColors), elevationShadows), backgroundColors), contentColors), neutralColors), interactiveColors), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 71232: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _light = _interopRequireDefault(__webpack_require__(60364)); + +var _dark = _interopRequireDefault(__webpack_require__(94574)); + +var _compact = _interopRequireDefault(__webpack_require__(99617)); + +var _comfortable = _interopRequireDefault(__webpack_require__(55804)); + +var _base = _interopRequireDefault(__webpack_require__(36607)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function createPrismaTheme(_ref) { + var colorScheme = _ref.colorScheme, + density = _ref.density; + var colorSchemeVars = { + light: _light["default"], + dark: _dark["default"] + }[colorScheme]; + var densityVars = { + compact: _compact["default"], + comfortable: _comfortable["default"] + }[density]; + var prismaBase = (0, _base["default"])({ + colorScheme: colorScheme + }); + return _objectSpread(_objectSpread(_objectSpread({}, prismaBase), colorSchemeVars), densityVars); +} + +var _default = createPrismaTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 60364: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * # Background Colors + * Background colors should be used only for backgrounds of higher level sections & containers of a UI. + * + * @colorSet verbose + */ +var backgroundColors = { + backgroundColorPopup: '#ffffff', + backgroundColorSection: '#ffffff', + backgroundColorSidebar: '#f8f8f8', + backgroundColorPage: '#f9f9f9', + backgroundColorNavigation: '#f7f7f7', + backgroundColorFloating: '#000000', + backgroundColorDialog: '#ffffff', + backgroundColorScrim: 'rgba(255, 255, 255, 0.75)' +}; +/** + * # Content Colors + * Content colors should be used for text, icons and dividers. + * + * @colorSet verbose + */ + +var contentColors = { + contentColorActive: '#2c2c2c', + contentColorDefault: '#4d4d4d', + contentColorDisabled: '#878787', + contentColorInverted: '#ffffff', + contentColorMuted: '#6b6b6b' +}; +/** + * # Interactive Colors + * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content. + * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary. + * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two. + * + * @colorSet verbose + */ + +var interactiveColors = { + interactiveColorPrimary: '#0264d7', + interactiveColorBorder: 'rgba(0, 0, 0, 0.4)', + interactiveColorBorderHover: 'rgba(0, 0, 0, 0.6)', + interactiveColorBorderDisabled: 'rgba(0, 0, 0, 0.3)', + interactiveColorOverlaySelected: 'rgba(0, 0, 0, 0.04)', + interactiveColorOverlayHover: 'rgba(0, 0, 0, 0.03)', + interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.07)', + interactiveColorOverlayDrag: 'rgba(2, 100, 215, 0.16)', + interactiveColorBackground: '#eeeeee', + interactiveColorBackgroundDisabled: 'rgba(0, 0, 0, 0.1)' +}; +/** + * # Neutral Colors + * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough. + * + * @colorSet verbose + */ + +var neutralColors = { + white: '#ffffff', + neutral100: '#f0f0f0', + neutral200: '#e6e6e6', + neutral300: '#dddddd', + neutral400: '#cacaca', + neutral500: '#b8b8b8', + black: '#000000' +}; +/** + * # Accent Colors + * Accent colors aid and categorize the visual communication of the system response. + * + * @colorSet verbose + */ + +var accentColors = { + accentColorPositive: '#118832', + accentColorWarning: '#cca700', + accentColorAlert: '#cf750c', + accentColorNegative: '#d41f1f' +}; +/** + * # Status Colors + * Status colors are reserved for communicating urgency and severity associated with data objects. + * + * @colorSet verbose + */ + +var statusColors = { + statusColorInfo: '#61cafa', + statusColorNormal: '#85eb48', + statusColorLow: '#fae75f', + statusColorMedium: '#f5b53f', + statusColorHigh: '#ec4B43', + statusColorCritical: '#9c0300' +}; +/** + * # Elevation Shadows + * + * @shadowSet + * + */ + +var elevationShadows = { + embossShadow: ' 0px 1px 5px rgba(0, 0, 0, 0.07), 0px 0px 1px rgba(0, 0, 0, 0.07)', + overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)', + dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)', + modalShadow: '0px 50px 200px rgba(0, 0, 0, 0.3), 0px 29px 66px rgba(0, 0, 0, 0.08), 0px 29px 47px rgba(0, 0, 0, 0.08), 0px 5px 10px rgba(0, 0, 0, 0.03)' +}; +/** + * # Syntax Colors + * Syntax colors are used only for code blocks. + * + * @colorSet verbose alphabetical + */ + +var syntaxColors = { + syntaxBlue: '#107d9f', + syntaxBrown: '#a26604', + syntaxGray: '#737373', + syntaxGreen: '#607d0d', + syntaxOrange: '#b75808', + syntaxPink: '#d015b2', + syntaxPurple: '#7f52f5', + syntaxRed: '#df1f48', + syntaxTeal: '#1e816f' +}; + +var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, accentColors), statusColors), elevationShadows), backgroundColors), contentColors), neutralColors), interactiveColors), syntaxColors); + +var _default = theme; +exports["default"] = _default; + +/***/ }), + +/***/ 39342: +/***/ (() => { + +"use strict"; + + +/***/ }), + +/***/ 31198: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _react = __webpack_require__(96540); + +var _styledComponents = __webpack_require__(92568); + +var _utils = __webpack_require__(290); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +/** + * React hook that allows theme variables to be easily used within a React functional component. + * This includes the basic configuration of `family`, `colorScheme` and `density`, + * as well as all the specific variables available in that theme. + * + * If no data `SplunkThemeProvider` was configured, the Prisma Dark Comfortable theme is returned. + * + * ``` + * import useSplunkTheme from '@splunk/themes/useSplunkTheme'; + * ... + * export function() { + * const { density, focusColor } = useSplunkTheme(); + * + * const style = { + * color: focusColor, + * padding: density === 'comfortable' ? '10px' : '5px', + * } + * + * ... + * + * return ( + *
+ * Hello + *
+ * ) + * } + * ``` + * @public + */ +var useSplunkTheme = function useSplunkTheme() { + var _ref = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + _ref$splunkThemeV = _ref.splunkThemeV1, + splunkThemeV1 = _ref$splunkThemeV === void 0 ? {} : _ref$splunkThemeV, + rest = _objectWithoutProperties(_ref, ["splunkThemeV1"]); + + var family = splunkThemeV1.family, + colorScheme = splunkThemeV1.colorScheme, + density = splunkThemeV1.density, + customizer = splunkThemeV1.customizer; + return _objectSpread(_objectSpread({}, rest), (0, _utils.getCustomizedTheme)({ + family: family, + colorScheme: colorScheme, + density: density + }, customizer)); +}; + +var _default = useSplunkTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 290: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getCustomizedTheme = exports.addThemeDefaults = void 0; + +var _lodash = __webpack_require__(2543); + +var _getTheme = _interopRequireDefault(__webpack_require__(78886)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * Accepts a theme object and returns supported values and defaults. + * @private + */ +var addThemeDefaults = function addThemeDefaults() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$family = _ref.family, + family = _ref$family === void 0 ? 'prisma' : _ref$family, + _ref$colorScheme = _ref.colorScheme, + colorScheme = _ref$colorScheme === void 0 ? 'dark' : _ref$colorScheme, + _ref$density = _ref.density, + density = _ref$density === void 0 ? 'comfortable' : _ref$density; + + return { + family: family, + colorScheme: colorScheme, + density: density + }; +}; + +exports.addThemeDefaults = addThemeDefaults; + +function getCustomizedThemeUnmemo(settings, customizer) { + var variables = (0, _getTheme["default"])(settings); + + if (!customizer) { + return variables; + } + + return customizer(variables); +} +/** + * Accepts a theme object and customizer, and returns supported values and defaults. + * @private + */ + + +var getCustomizedTheme = (0, _lodash.memoize)(getCustomizedThemeUnmemo, function () { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + family = _ref2.family, + colorScheme = _ref2.colorScheme, + density = _ref2.density; + + var customizer = arguments.length > 1 ? arguments[1] : undefined; + return "".concat(family, "-").concat(colorScheme, "-").concat(density, "-").concat(!!customizer); +}); +exports.getCustomizedTheme = getCustomizedTheme; + +/***/ }), + +/***/ 68870: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clearVariablesCache = exports["default"] = void 0; + +var _memoize = _interopRequireDefault(__webpack_require__(50104)); + +var _getTheme = _interopRequireDefault(__webpack_require__(78886)); + +var _utils = __webpack_require__(290); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * @file + * ## Theme Variables + * All variables are available in one util for use in styled-component templates. + * Each variable is a function which styled-components will call with the available theme information. + * If there is no SplunkThemeProvider, variables will default to Prisma Dark Comfortable. + * + * Variables will return `undefined` if the variable does not exist in the current theme. + * ``` + * import variables from '@splunk/themes/variables'; + * import styled from 'styled-components'; + * ... + * const PrismaWrapper = styled.div` + * color: ${variables.contentColorDefault}; + * `; + * ``` + * + * Variables may also be imported individually. + * ``` + * import { contentColorDefault } from '@splunk/themes/variables'; + * import styled from 'styled-components'; + * ... + * const PrismaWrapper = styled.div` + * color: ${contentColorDefault}; + * `; + * ``` + * + * This function must be used in conjunction with `pick` if different variables are needed in different themes. + * ``` + * import { pick, variables } from '@splunk/themes'; + * import styled from 'styled-components'; + * + * const Wrapper = styled.div` + * color: ${pick({ + * enterprise: variables.textColor, + * prisma: variables.contentColorDefault + * }); + * `; + * ``` + * ## Custom Variables + * Custom variables cannot be added to this package. However, `pick()` can be used to create sets of + * theme variables. These can be then be imported separately and used as above. + * ``` + * import pick from '@splunk/themes/pick'; + * + * export const myVariables = { + * orange: pick({ + * light: '#C80', + * dark: '#F90', + * }), + * space: pick({ + * enterprise: '20px', + * prisma: { + * comfortable: '16px', + * compact: '12px', + * }, + * }), + * }; + * ``` + */ +var getThemeVariable = function getThemeVariable(name, settings, customizer) { + var theme = (0, _utils.getCustomizedTheme)(settings, customizer); + var returnValue = theme[name]; + + if (false) {} + + return returnValue; +}; + +var getThemeVariableMemoized = (0, _memoize["default"])(getThemeVariable, function (name, _ref, customizer) { + var family = _ref.family, + colorScheme = _ref.colorScheme, + density = _ref.density; + return "".concat(name, "-").concat(family, "-").concat(colorScheme, "-").concat(density, "-").concat(!!customizer); +}); + +var clearVariablesCache = function clearVariablesCache() { + var _getThemeVariableMemo, _getThemeVariableMemo2; + + return (_getThemeVariableMemo = (_getThemeVariableMemo2 = getThemeVariableMemoized.cache).clear) === null || _getThemeVariableMemo === void 0 ? void 0 : _getThemeVariableMemo.call(_getThemeVariableMemo2); +}; +/** + * The `get` helper will insert a theme variable into a `styled-components` css template. + * Note, this will return `undefined` if the variable does not exist in the current theme. + * This function must be used in conjunction with `pick` if different variables are needed in different themes. + * ``` + * import get from '@splunk/themes/get'; + * ... + * const Wrapper = styled.div` + * color: ${get('contentColorDefaultDefault')}; // prisma theme only + * `; + * ``` + * @param {string} name - The name of the variable to get from the current theme configuration. + * @returns {function} The returned function is called by `styled-components`, which provides the theme context. + * @private + */ + + +exports.clearVariablesCache = clearVariablesCache; + +var get = function get(name) { + return function (_ref2) { + var _ref2$theme = _ref2.theme; + _ref2$theme = _ref2$theme === void 0 ? {} : _ref2$theme; + var splunkThemeV1 = _ref2$theme.splunkThemeV1; + + var _ref3 = splunkThemeV1 || {}, + family = _ref3.family, + colorScheme = _ref3.colorScheme, + density = _ref3.density, + customizer = _ref3.customizer; + + return getThemeVariableMemoized(name, { + family: family, + colorScheme: colorScheme, + density: density + }, customizer); + }; +}; + +var variableNames = Object.keys(_objectSpread(_objectSpread({}, (0, _getTheme["default"])({ + family: 'prisma' +})), (0, _getTheme["default"])({ + family: 'enterprise' +}))); // each variable is converted to a get() function. +// TS: The AllVariables type allows safe access to all variables shared across themes, +// and unsafe access to variables exclusive to Enterprise or Prisma + +var variables = variableNames.reduce(function (acc, currentValue) { + // using defineProperty instead of acc[currentValue] to work around readonly issue + Object.defineProperty(acc, currentValue, { + value: get(currentValue) + }); + return acc; +}, {}); +var _default = variables; +exports["default"] = _default; + +/***/ }), + +/***/ 21215: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _react = _interopRequireWildcard(__webpack_require__(96540)); + +var _styledComponents = __webpack_require__(92568); + +var _utils = __webpack_require__(290); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +// implementation for both + +/** + * `withSplunkTheme` allows theme variables to be used within a React class component. + * This includes the basic configuration of `family`, `colorScheme` and `density`, + * as well as all the specific variables available in that theme. + * + * If no data `SplunkThemeProvider` was configured, the Prisma Dark Comfortable theme is returned. + * + * ``` + * import React, { Component } from 'react'; + * import PropTypes from 'prop-types'; + * import withSplunkTheme from '@splunk/themes/withSplunkTheme'; + * + * + * class MyComponent extends Component { + * static propTypes = { + * splunkTheme: PropTypes.object, + * }; + * + * render() { + * const { density, focusColor } = this.props.splunkTheme; + * + * const style = { + * color: focusColor, + * padding: density === 'comfortable' ? '10px' : '5px', + * } + * + * return ( + *
+ * Hello + *
+ * ) + * } + * } + * + * const MyComponentWithTheme = withSplunkTheme(MyComponent); + * MyComponentWithTheme.propTypes = MyComponent.propTypes; + * + * export default MyComponentWithTheme; + * + * ``` + * @name withSplunkTheme + * @function + * @public + */ +function withSplunkTheme( // eslint-disable-line @typescript-eslint/explicit-module-boundary-types +Component) { + var ComponentWithSplunkTheme = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { + var _ref = (0, _react.useContext)(_styledComponents.ThemeContext) || {}, + splunkThemeV1 = _ref.splunkThemeV1, + rest = _objectWithoutProperties(_ref, ["splunkThemeV1"]); + + var _ref2 = splunkThemeV1 || {}, + family = _ref2.family, + colorScheme = _ref2.colorScheme, + density = _ref2.density, + customizer = _ref2.customizer; + + var themeSettings = (0, _utils.addThemeDefaults)({ + family: family, + colorScheme: colorScheme, + density: density + }); + + var splunkTheme = _objectSpread(_objectSpread({}, rest), (0, _utils.getCustomizedTheme)(themeSettings, customizer)); + + return /*#__PURE__*/_react["default"].createElement(Component, _extends({}, props, { + ref: ref, + splunkTheme: splunkTheme + })); + }); + + var displayName = Component.displayName || Component.name || 'Component'; + ComponentWithSplunkTheme.displayName = "withSplunkTheme(".concat(displayName, ")"); + return ComponentWithSplunkTheme; +} // see https://github.com/Microsoft/TypeScript/issues/28938 for the two "as T" assertions above + + +var _default = withSplunkTheme; +exports["default"] = _default; + +/***/ }), + +/***/ 1115: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.normalizeUnit = normalizeUnit; +exports.normalizeSnapUnit = normalizeSnapUnit; +exports.getUnitLabel = getUnitLabel; +exports.removeRealTime = removeRealTime; +exports.removeISOTimezone = removeISOTimezone; +exports.isEpoch = isEpoch; +exports.isISO = isISO; +exports.isAbsolute = isAbsolute; +exports.getISOWithTimeZone = getISOWithTimeZone; +exports.parseTimeString = parseTimeString; +exports.isValidTime = isValidTime; +exports.isRealTime = isRealTime; +exports.isWholeDay = isWholeDay; +exports.isEarliestEmpty = isEarliestEmpty; +exports.isLatestNow = isLatestNow; +exports.isAllTime = isAllTime; +exports.timeRangesAreEquivalent = timeRangesAreEquivalent; +exports.findPresetLabel = findPresetLabel; +exports.createRangeLabel = createRangeLabel; +exports.formatDuration = formatDuration; +exports.getAcceleratedTimeRange = exports.getRealTimeEarliest = exports.getRelativeLatest = exports.getRelativeEarliest = exports.getToSnap = exports.getFromUnit = exports.getFromSnap = exports.getFromNumber = void 0; + +var _lodash = __webpack_require__(2543); + +var _format = __webpack_require__(30376); + +var _config = __webpack_require__(75602); + +var _i18n = __webpack_require__(20259); + +var _moment = _interopRequireDefault(__webpack_require__(61605)); + +var _timeUnits = __webpack_require__(37136); + +/** + * Utilities for interpreting, parsing, and validating time ranges. Each function can be imported + * separately. + * ``` + * import { normalizeUnit, createRangeLabel } from '@splunk/time-range-utils/time' + * ``` + * + * @file + */ + +/** + * Normalizes units to it's shortest version, such as `s` for `sec` and `mon` for `month`. + * @name normalizeUnit + * @function + * @public + * @param {string} unit - The unit, such as `s` or `quarter`. + * @param {bool} [removeInvalid=true] - When true, returns an empty string for invalid units, + * when false + * returns 's' for invalid units. + * @returns {string} Returns the normalized unit or empty string. + */ +function normalizeUnit(abbr, removeInvalid = true) { + const hasUnit = (0, _lodash.has)(_timeUnits.timeUnits, abbr); + const defaultUnit = removeInvalid ? '' : _timeUnits.timeUnits.s.abbr; + return hasUnit ? _timeUnits.timeUnits[abbr].abbr : defaultUnit; +} +/** + * Normalizes snap units to it's shortest version, this is the same as normalizeUnit, but also + * supports weekdays, such as `w5`. + * @public + * @param {string} unit - The unit, such as `s`, `quarter` or `w0`. + * @param {bool} [removeInvalid=true] - When true, returns an empty string for invalid units, + * when false returns 's' for invalid units. + * @returns {string} Returns the normalized unit or empty string. + */ + + +function normalizeSnapUnit(abbr, removeInvalid = true) { + const hasUnit = (0, _lodash.has)(_timeUnits.snapUnits, abbr); + const defaultUnit = removeInvalid ? '' : _timeUnits.timeUnits.s.abbr; + return hasUnit ? _timeUnits.snapUnits[abbr].abbr : defaultUnit; +} +/** + * Returns a label for a unit abbreviation, such as 'second' for 's' or 'sec'. + * @public + * @param {object} unit - The unit, such as `s`, `quarter` or `w0`. + * @param {object} [plural=false] - Whether the returned label should be plural. + * @returns {string} + */ + + +function getUnitLabel(unit, plural = false) { + return _timeUnits.snapUnits[unit][plural ? 'plural' : 'singular']; +} +/** + * Strips rt from the beginning of a time string when found. This makes a time string compatible + * with the time parser. To ensure capability with the time parser 'rt' returns 'now'. + * @public + * @param {string} time - The time string such as `47165491` or `rt-2h@m`. + * @returns {string} Returns the time string. + */ + + +function removeRealTime(time) { + if (time === 'rt') { + return 'now'; + } + + return time.replace(/^rt/, ''); +} +/** + * Removes the timezone from an iso time string + * @public + * @param {string} time - The time string such as `47165491` or `-2h@m`. + * @returns {string} + */ + + +function removeISOTimezone(time) { + return time.replace(/[+-]\d?\d:\d\d$/, ''); +} +/** + * Validates that a string represents a unix epoch time. + * @public + * @param {string} time - The time string such as `47165491` or `-2h@m`. + * @returns {bool} + */ + + +function isEpoch(time) { + return (0, _lodash.isFinite)(time) || (0, _lodash.isString)(time) && /^\d+((\.\d+)|(\d*))$/.test(time); +} +/** + * Validates that a string represents an ISO time. + * @public + * @param {string} time - The time string such as `47165491` or `-2h@m`. + * @returns {bool} + */ + + +function isISO(time) { + return !!time.match(/^\d\d\d\d-\d\d?-\d\d?T\d\d?:\d\d?(:\d\d?)?(\.\d\d?\d?)?([+-]\d\d?:\d\d|Z)?$/); +} +/** + * Validates that a string represents an ISO or unix epoch time. + * @public + * @param {string} time - The time string such as `47165491` or `-2h@m`. + * @returns {bool} + */ + + +function isAbsolute(time) { + if (time === undefined) { + return false; + } + + return isEpoch(time) || isISO(time); +} +/** + * Adds timezone to ISO time. + * @public + * @param {string} time - The time string such as “2020-09-17T09:44:12.404”. + * @param {string} [momentTimeZoneName] + * @returns {string} - ISO with timezone “2020-09-17T16:44:12.404Z” + */ + + +function getISOWithTimeZone(time, momentTimeZoneName) { + if (!(0, _lodash.isString)(time)) { + return null; + } + + if (momentTimeZoneName) { + return _moment.default.tz(time, momentTimeZoneName).toISOString(); + } + + return (0, _moment.default)(time).toISOString(); +} +/** + * Parses a time string for inspection or form population. + * + * Example parse for a relative time string: + * ``` + * { + * string: '-3d@qtr+2hr', + * type: ['relative'], // 'relative', 'realTime', 'iso', or 'epoch' + * isFullyParsed: true, + * modifiers: [ + * { + * string: '-3d@qtr', + * isParsed: true, + * unit: 'd', + * amount: -3, + * snap: 'q', + * }, + * { + * string: '+2hr', + * isParsed: true, + * unit: 'h', + * amount: +2, + * snap: false, + * }, + * ], + * } + * ``` + * Example parse for a epoch time: + * ``` + * { + * string: '89451357', + * type: ['epoch'], + * isFullyParsed: true, + * modifiers: [], + * } + * + * @public + * @param {string} time - The time string such as `47165491` or `-2h@m`. + * @returns {object} + */ + + +function parseTimeString(timeString) { + if (!(0, _lodash.isString)(timeString)) { + return false; + } + + const ast = { + string: timeString, + isFullyParsed: true, + modifiers: [] + }; + + if (isISO(timeString)) { + ast.type = 'iso'; + return ast; + } + + if (isEpoch(timeString)) { + ast.type = 'epoch'; + return ast; + } + + const segments = timeString.trim().replace(/-/g, '\n-').replace(/\+/g, '\n+').split('\n'); // If only snap has been provided push empty string to beginning of segments. + + if (segments[0].charAt(0) === '@') { + segments.unshift(''); + } + + if (segments[0] === 'rt' || segments[0] === 'rtnow') { + ast.type = 'realTime'; + } else if (['rt', 'now', 'rtnow', ''].indexOf(segments[0]) < 0) { + ast.isFullyParsed = false; + return ast; + } else { + ast.type = 'relative'; + } + + ast.modifiers = segments.slice(1).map(segmentString => { + const segment = { + string: segmentString, + isParsed: false + }; + const sParse = segmentString.match(/^(([-+]\d*)([a-zA-Z]*))?(@([a-zA-Z][a-zA-Z0-7]*))?$/); // 2 3 4 5 + + if (sParse) { + segment.unit = sParse[3] && normalizeUnit(sParse[3], false); + segment.amount = segment.unit ? parseInt(sParse[2], 10) || 1 : 0; + segment.snap = !!sParse[4] && normalizeSnapUnit(sParse[5], false); + segment.isParsed = true; + + if (sParse[5] && !_timeUnits.snapUnits[sParse[5]] || // invalid unit + sParse[3] && !_timeUnits.timeUnits[sParse[3]] || // invalid snap unit + segmentString.length === 1 // unqualified - or + + ) { + ast.isFullyParsed = false; + segment.isParsed = false; + } + } else { + ast.isFullyParsed = false; + } + + return segment; + }); + return ast; +} +/** + * Validates that a string is a valid time string. + * @public + * @param {string} time - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {bool} + */ + + +function isValidTime(time) { + return parseTimeString(time).isFullyParsed; +} +/** + * Validates that a string represents a real-time search. + * @public + * @param {string} time - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {bool} + */ + + +function isRealTime(time) { + const parse = parseTimeString(time); + return parse && parse.type === 'realTime' && parse.isFullyParsed; +} +/** + * Validates that a iso time string is a whole day. + * @public + * @param {string|object} time - A time string (such as `2008-09-15T15:53:00+05:00`) or a + * @splunk/moment time instance. + * @returns {bool} + */ + + +function isWholeDay(time) { + if ((0, _lodash.isString)(time) && isISO(time) || _moment.default.isMoment(time) && time.isValid()) { + const timeMoment = (0, _moment.default)(time); + return timeMoment.valueOf() === timeMoment.startOf('day').valueOf(); + } + + return false; +} +/** + * Validate that a time string acts is either empty or `0`. + * @public + * @param {string} time - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {bool} + */ + + +function isEarliestEmpty(time) { + if (time === '0') { + return true; + } + + return !time; +} +/** + * Validate that a time string acts is either empty or now + * @public + * @param {string} time - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {bool} + */ + + +function isLatestNow(time) { + if (!time) { + return true; + } + + return (0, _lodash.isString)(time) && time === 'now'; +} +/** + * Validate that a time range acts is equivalent to all-time. + * @public + * @param {string} earliest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {string} latest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {bool} + */ + + +function isAllTime(earliest, latest) { + return isEarliestEmpty(removeRealTime(earliest)) && isLatestNow(removeRealTime(latest)); +} +/** + * Validate that two time range are equivalent. This normalizes the two comparisons using + * isEarliestEmpty() and isLatestNow(). + * @public + * @param {object} range1 - The time string range such as `{ earliest: '-1d', latest: 'now' }`. + * @param {object} range2 - The time string range such as `{ earliest: '0', latest: '-1d' }`. + * @returns {bool} + */ + + +function timeRangesAreEquivalent(range1, range2) { + const earliest1 = range1.earliest; + const latest1 = range1.latest; + const earliest2 = range2.earliest; + const latest2 = range2.latest; + let earliestEqual = false; + let latestEqual = false; + + if (isEarliestEmpty(earliest1) && isEarliestEmpty(earliest2)) { + earliestEqual = true; + } else { + earliestEqual = earliest1 === earliest2; + } + + if (isLatestNow(latest1) && isLatestNow(latest2)) { + latestEqual = true; + } else { + latestEqual = latest1 === latest2; + } + + return earliestEqual && latestEqual; +} +/** + * Searches through an array of presets and returns any equivalent labels using + * timeRangesAreEquivalent(). + * @public + * @param {array} presets - An array of presents such as: + * ``` + * [ + * { label: '30 second window', earliest: 'rt-30s', latest: 'rt' }, + * { label: 'Today', earliest: '@d', latest: 'now' }, + * { label: 'Previous year', earliest: '-1y@y', latest: '@y' }, + * { label: 'Last 15 minutes', earliest: '-15m', latest: 'now' }, + * { label: 'All time', earliest: '0', latest: '' }, + * ] + * ``` + * @param {string} earliest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {string} latest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {string | false } The matched preset label. + */ + + +function findPresetLabel(presets, earliest, latest) { + /* JSDoc and eslint cannot agree on the appropriate format of this */ + + /* eslint-disable */ + const currentPreset = (0, _lodash.find)(presets, preset => { + const range2 = { + earliest: preset.earliest, + latest: preset.latest + }; + return timeRangesAreEquivalent({ + earliest, + latest + }, range2); + }); + /* eslint-enable */ + + return currentPreset ? currentPreset.label : false; +} +/** + * Generates a label for a real-time time search. + * For example: '5 minute window' or 'Real-time' + * @private + * @param {string} earliest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {string} latest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {null|string} + */ + + +function createRealTimeLabel(earliest, latest) { + if (isRealTime(earliest) || isRealTime(latest)) { + const earliestParse = parseTimeString(earliest); + const earliestModifier = earliestParse.modifiers[0]; + const latestParse = parseTimeString(latest); + const labelTemplates = { + s: (0, _i18n._)('%(time)d second window'), + m: (0, _i18n._)('%(time)d minute window'), + h: (0, _i18n._)('%(time)d hour window'), + d: (0, _i18n._)('%(time)d day window'), + w: (0, _i18n._)('%(time)d week window'), + mon: (0, _i18n._)('%(time)d month window'), + q: (0, _i18n._)('%(time)d quarter window'), + y: (0, _i18n._)('%(time)d year window') + }; + + if (earliestModifier && earliestParse.type === 'realTime' && latestParse.type === 'realTime' && latestParse.modifiers.length === 0 && (0, _lodash.has)(labelTemplates, earliestModifier.unit) && earliestParse.modifiers.length === 1) { + return (0, _format.sprintf)(labelTemplates[earliestModifier.unit], { + time: Math.abs(earliestModifier.amount) + }); + } // Other Real-Time. + + + return (0, _i18n._)('Real-time'); + } + + return false; +} +/** + * Generates a label for a relative time search. + * For example: 'Last 5 minutes' + * @private + * @param {string} earliest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {string} latest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {null|string} + */ + + +function createRelativeTimeLabel(earliest, latest) { + const earliestParse = parseTimeString(earliest); + const earliestModifier = earliestParse.modifiers[0]; + const latestParse = parseTimeString(latest); + const latestModifier = latestParse.modifiers[0]; + + if (earliestParse.type === 'realTime' || latestParse.type === 'realTime' || !earliestModifier || earliestParse.modifiers.length > 1 || latestParse.modifiers.length > 1) { + return false; + } + + if (earliestModifier.amount < 0 && (!earliestModifier.snap || earliestModifier.unit === earliestModifier.snap) && (isLatestNow(latest) || latestModifier && !latestModifier.amount) && (!latestModifier || !latestModifier.snap || earliestModifier.unit === latestModifier.snap)) { + const amount = Math.abs(earliestModifier.amount); + const pluralKey = amount > 1 ? 'plural' : 'singular'; + return (0, _format.sprintf)((0, _i18n._)('Last %(amount)d %(unit)s'), { + amount, + unit: _timeUnits.timeUnits[earliestModifier.unit][pluralKey] + }); + } + + return false; +} +/** + * Compares two moment instances to determine if they are on the same day. + * @private + * @param {object} earliest - @splunk/moment time instance + * @param {object} latest - @splunk/moment time instance + * @returns {bool} + */ + + +function areSameDay(a, b) { + const aTime = a.clone().startOf('day'); + const bTime = b.clone().startOf('day'); + return aTime.isSame(bTime); +} +/** + * Determines whether the date is the start of a year, month or day. + * @private + * @param {object} date - @splunk/moment time instance + * @returns {'year'|'month'|'date'|undefined} + */ + + +function largestDateUnit(date) { + return (0, _lodash.find)(['year', 'month', 'date'], unit => { + const dateStart = date.clone().startOf(unit); + return date.isSame(dateStart); + }); +} +/** + * Finds the largest date unit that can describe a date range: years, months or days. + * @private + * @param {object} earliest - @splunk/moment time instance + * @param {object} latest - @splunk/moment time instance + * @returns {'year'|'month'|'date'|null} + */ + + +function findSingleDateUnit(a, b) { + if (!(isWholeDay(a) && isWholeDay(b))) { + return null; + } + + if (a.month() === 0 && b.month() === 0 && a.date() === 1 && b.date() === 1) { + return 'year'; + } + + if (a.year() === b.year() && a.date() === 1 && b.date() === 1 || a.year() + 1 === b.year() && b.month() === 0 && a.date() === 1 && b.date() === 1) { + return 'month'; + } + + return 'date'; +} +/** + * Generates a date range label for a single year, month or day. + * For example: '2017', 'Feb 2017' or 'Feb 18, 2017' + * @private + * @param {object} date - @splunk/moment time instance + * @param {'year'|'month'|'date'} unit + * @returns {string} + */ + + +function createSingleUnitOnLabel(date, unit) { + switch (unit) { + case 'year': + return date.format('YYYY'); + + case 'month': + return (0, _format.sprintf)((0, _i18n._)('%(month)s %(year)s'), { + month: date.format('MMM'), + year: date.format('YYYY') + }); + + default: + return date.format('ll'); + } +} +/** + * Generates a date range label for a range of years, months or days. + * For example: '2015 though 2017', 'Feb – Apr, 2017' or 'Feb 17 – 18, 2017' + * @private + * @param {object} earliest - @splunk/moment time instance + * @param {object} latest - @splunk/moment time instance + * @param {'year'|'month'|'date'} unit + * @returns {string} + */ + + +function createSingleUnitThroughLabel(a, b, unit) { + const b2 = b.subtract(1, unit === 'date' ? 'day' : unit); + + switch (unit) { + case 'year': + return (0, _format.sprintf)((0, _i18n._)('%(earliestYear)s – %(latestYear)s'), { + earliestYear: a.format('YYYY'), + latestYear: b2.format('YYYY') + }); + + case 'month': + return (0, _format.sprintf)((0, _i18n._)('%(earliestMonth)s – %(latestMonth)s, %(inYear)s'), { + earliestMonth: a.format('MMM'), + latestMonth: b2.format('MMM'), + inYear: b2.format('YYYY') + }); + + case 'date': + if (a.year() === b2.year()) { + if (a.month() === b2.month()) { + return (0, _format.sprintf)((0, _i18n._)('%(earliestMonth)s %(earliestDayOfMonth)s – %(latestDayOfMonth)s, %(latestYear)s'), { + earliestMonth: a.format('MMM'), + earliestDayOfMonth: a.format('D'), + latestDayOfMonth: b2.format('D'), + latestYear: b2.format('YYYY') + }); + } + + return (0, _format.sprintf)((0, _i18n._)('%(earliestMonth)s %(earliestDayOfMonth)s – %(latestMonth)s %(latestDayOfMonth)s, %(latestYear)s'), { + earliestMonth: a.format('MMM'), + earliestDayOfMonth: a.format('D'), + latestMonth: b2.format('MMM'), + latestDayOfMonth: b2.format('D'), + latestYear: b2.format('YYYY') + }); + } + + return (0, _format.sprintf)((0, _i18n._)('%(earliestMonth)s %(earliestDayOfMonth)s, %(earliestYear)s – %(latestMonth)s %(latestDayOfMonth)s, %(latestYear)s'), { + earliestMonth: a.format('MMM'), + earliestDayOfMonth: a.format('D'), + earliestYear: a.format('YYYY'), + latestMonth: b2.format('MMM'), + latestDayOfMonth: b2.format('D'), + latestYear: b2.format('YYYY') + }); + + default: + return (0, _format.sprintf)((0, _i18n._)('%(month)s %(earliestDayOfMonth)s – %(latestDayOfMonth)s, %(inYear)s'), { + month: a.format('MMM'), + earliestDayOfMonth: a.format('D'), + latestDayOfMonth: b2.format('D'), + inYear: b2.format('YYYY') + }); + } +} +/** + * Generates date-time label with the minimum specificity for time:minute, seconds or milliseconds. + * For example: 'Feb 18, 2017 4:12:30.567 AM' + * @private + * @param {object} date - @splunk/moment time instance + * @returns {string} + */ + + +function createDateTimeLabel(date) { + try { + if (date.millisecond()) { + return date.splunkFormat('llms'); + } + + if (date.second()) { + return date.splunkFormat('lls'); + } + + return date.splunkFormat('lll'); + } catch (e) { + return date.format('MMM D, YYYY H:mm.SS'); + } +} +/** + * Generates time label with the minimum specificity for time: minute, seconds or milliseconds. + * For example: '6:00 AM', '6:00:20 AM' or '6:00:20.712 AM' + * @private + * @param {object} time - @splunk/moment time instance + * @returns {string} + */ + + +function createTimeLabel(time) { + if (time.millisecond()) { + try { + return time.splunkFormat('LTMS'); + } catch (e) { + return time.format('LTS'); + } + } + + if (time.second()) { + return time.format('LTS'); + } + + return time.format('LT'); +} +/** + * Generates a date-time label with the minimum specificity for time: minute, seconds or milliseconds. + * For example: 'Feb 17, 2017 6:00 AM – Feb 18, 2017 12:20 AM' + * @private + * @param {object} earliestTime - @splunk/moment time instance + * @param {object} latestTime - @splunk/moment time instance + * @returns {string} + */ + + +function createTimeRangeLabel(a, b) { + let format; + + if (a.millisecond() || b.millisecond()) { + format = 'llms'; + } else if (a.second() || b.second()) { + format = 'lls'; + } else { + format = 'lll'; + } + + let aFormatted; + let bFormatted; + + try { + aFormatted = a.splunkFormat(format); + bFormatted = b.splunkFormat(format); + } catch (e) { + aFormatted = a.format('lll'); + bFormatted = b.format('lll'); + } + + return (0, _format.sprintf)((0, _i18n._)('%(earliestDateTime)s – %(latestDateTime)s'), { + earliestDateTime: aFormatted, + latestDateTime: bFormatted + }); +} +/** + * Generates a label for a time range on a single date. + * For example: '6:00:20.850 AM to 8:00:40.490 PM, Feb 17, 2017' + * @private + * @param {object} earliestTime - @splunk/moment time instance + * @param {object} latestTime - @splunk/moment time instance + * @returns {string} + */ + + +function createPartOfDayLabel(a, b) { + return (0, _format.sprintf)((0, _i18n._)('%(earliestTime)s – %(latestTime)s, %(date)s'), { + earliestTime: createTimeLabel(a), + latestTime: createTimeLabel(b), + date: a.format('ll') + }); +} + +function conformToMaxChars(label, shortLabel, maxChars) { + // if label is shorter than the shortLabel and longer than maxChars, use the label. + // This scenario may arise due to long translations of the shortLabel. + return maxChars && label.length > Math.max(shortLabel.length, maxChars) ? shortLabel : label; +} +/** + * Generates a label for a date range when provided two ISO date formats. + * @private + * @param {string} earliest - An ISO time string, or other splunk time string. + * @param {string} latest - An ISO time string, or other splunk time string . + * @param {number} maxChars - If the generated label is too long, it will abbreviate + to a more generic form, such as 'Between Date-times' instead of 'Feb 17, 2017 6:00 AM to Feb 18, 2017 12:20 AM'. + * @returns {null|string} + */ + + +function createDateTimeRangeLabel(earliest, latest, maxChars) { + const a = isISO(earliest) ? (0, _moment.default)(earliest).locale(_config.locale || 'en_US') : undefined; + const b = isISO(latest) ? (0, _moment.default)(latest).locale(_config.locale || 'en_US') : undefined; + + if (a && b) { + // During Year, Month Day + const unit = findSingleDateUnit(a, b); // Single Year, Month or Day + + const next = unit && (0, _moment.default)(a).add(1, unit === 'date' ? 'days' : unit); + + if (unit) { + // Check if yesterday of date 'b' is the same as date 'a' + if (unit === 'date' && (0, _moment.default)(a).add(1, 'days').isSame(b)) { + return createSingleUnitOnLabel(a, unit); + } // For a single date unit of 'month' or 'year', check if date 'b' is the next 'month' or 'year', respectively + + + if (unit !== 'date' && next[unit]() === b[unit]()) { + return createSingleUnitOnLabel(a, unit); + } + } + + if (unit) { + return conformToMaxChars(createSingleUnitThroughLabel(a, b, unit), (0, _i18n._)('Date Range'), maxChars); + } // Part of Day + + + if (areSameDay(a, b)) { + return conformToMaxChars(createPartOfDayLabel(a, b), (0, _i18n._)('Part of a Day'), maxChars); + } // Full + + + return conformToMaxChars(createTimeRangeLabel(a, b), (0, _i18n._)('Between Date-times'), maxChars); + } + + if (a && isLatestNow(latest)) { + // Since + const unit = largestDateUnit(a); + const since = unit ? createSingleUnitOnLabel(a, unit) : createDateTimeLabel(a); + const longLabel = (0, _format.sprintf)((0, _i18n._)('Since %(dateTime)s'), { + dateTime: since + }); + return conformToMaxChars(longLabel, (0, _i18n._)('Since Date-time'), maxChars); + } + + if (isEarliestEmpty(earliest) && b) { + // Before + const unit = largestDateUnit(b); + const before = unit ? createSingleUnitOnLabel(b, unit) : createDateTimeLabel(b); + const longLabel = (0, _format.sprintf)((0, _i18n._)('Before %(dateTime)s'), { + dateTime: before + }); + return conformToMaxChars(longLabel, (0, _i18n._)('Before Date-time'), maxChars); + } + + return null; +} +/** + * Returns 'All-time' is the search is all-time or a close equivalent. + * @private + * @param {string} earliest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {string} latest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @returns {string} + */ + + +function createAllTimeLabel(earliest, latest) { + if (isEarliestEmpty(earliest) && isLatestNow(latest)) { + return (0, _i18n._)('All time'); + } + + return false; +} +/** + * Creates an appropriate label for a time range, using a preset label if available. + * @public + * @param {string} earliest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {string} latest - The time string such as `rt` , `rtnow` or `-2h@m`. + * @param {object} [options] - An array of presents such as: + * @param {string} [options.locale='en_US'] - An array of presents such as: + * @param {number} [options.maxChars] - If the generated label is too long, it will abbreviate + * to a more generic form, such as 'Between Date-times' instead of 'Feb 17, 2017 6:00 AM to Feb 18, 2017 12:20 AM'. + * `Infinity` and `0` allow labels of any length. + * @param {array} [options.presets] - An array of presents such as: + * ``` + * [ + * { label: '30 second window', earliest: 'rt-30s', latest: 'rt' }, + * { label: 'Today', earliest: '@d', latest: 'now' }, + * { label: 'Previous year', earliest: '-1y@y', latest: '@y' }, + * { label: 'Last 15 minutes', earliest: '-15m', latest: 'now' }, + * { label: 'All time', earliest: '0', latest: '' }, + * ] + * ``` + * @returns {string} Returns `'Custom time'` if one cannot be made. + */ + + +function createRangeLabel(earliest, latest, { + presets, + maxChars +} = {}) { + const earliestTrimed = earliest.trim(); + const latestTrimed = latest.trim(); + return createAllTimeLabel(earliestTrimed, latestTrimed) || presets && findPresetLabel(presets, earliestTrimed, latestTrimed) || createRealTimeLabel(earliestTrimed, latestTrimed) || createRelativeTimeLabel(earliestTrimed, latestTrimed) || createDateTimeRangeLabel(earliestTrimed, latestTrimed, maxChars) || (0, _i18n._)('Custom time'); +} + +function pluralize(singular, plural, numberOf) { + if (numberOf === 0) { + return null; + } + + return numberOf === 1 ? singular : (0, _format.sprintf)(plural, { + numberOf + }); +} +/** + * Takes a duration in milliseconds and returns a string describing the duration in terms of + * years, months, days, hours, minutes, seconds and milliseconds. + * If a unit isn't needed it's omitted, e.g. durations less than a year won't include '0 years'. + * @public + * @param {string|number} ms - The duration in milliseconds. + * @returns {string} A formatted duration string, for example `27 days 16 hours 36 minutes 59 seconds`. + * Durations <= 0 return `null`. + */ + + +function formatDuration(ms) { + if (ms <= 0) { + return null; + } + + const duration = _moment.default.duration(ms); + + return [pluralize((0, _i18n._)('1 year'), (0, _i18n._)('%(numberOf)d years'), duration.years()), pluralize((0, _i18n._)('1 month'), (0, _i18n._)('%(numberOf)d months'), duration.months()), pluralize((0, _i18n._)('1 day'), (0, _i18n._)('%(numberOf)d days'), duration.days()), pluralize((0, _i18n._)('1 hour'), (0, _i18n._)('%(numberOf)d hours'), duration.hours()), pluralize((0, _i18n._)('1 minute'), (0, _i18n._)('%(numberOf)d minutes'), duration.minutes()), pluralize((0, _i18n._)('1 second'), (0, _i18n._)('%(numberOf)d seconds'), duration.seconds()), pluralize((0, _i18n._)('1 millisecond'), (0, _i18n._)('%(numberOf)d milliseconds'), duration.milliseconds())].filter(display => !!display).join(' '); +} +/** + * Gets the number of units from the earliest string + * @param {string} earliest + * @returns {number} + */ + + +const getFromNumber = earliest => { + const parseEarliest = parseTimeString(earliest).modifiers[0]; + return parseEarliest && Math.abs(parseInt(parseEarliest.amount, 10)) || 0; +}; +/** + * Returns true if the earliest string contains a snap unit + * @param {string} earliest + * @returns {boolean} + */ + + +exports.getFromNumber = getFromNumber; + +const getFromSnap = earliest => { + const parseEarliest = parseTimeString(earliest).modifiers[0]; + return !!parseEarliest && !!parseEarliest.snap; +}; +/** + * Returns the time unit of the earliest string + * Defaults to seconds + * @param {string} earliest + * @returns {string} + */ + + +exports.getFromSnap = getFromSnap; + +const getFromUnit = earliest => { + const parseEarliest = parseTimeString(earliest).modifiers[0]; + return parseEarliest && parseEarliest.unit || 's'; +}; +/** + * Returns if the latest string has a snap unit + * @param {string} latest + */ + + +exports.getFromUnit = getFromUnit; + +const getToSnap = latest => { + const parseLatest = parseTimeString(latest).modifiers[0]; + return parseLatest && !!parseLatest.snap || false; +}; +/** + * Returns the earliest time string in relative format + * @param {number} fromNumber + * @param {boolean} fromSnap + * @param {string} fromUnit + * @returns {string} + */ + + +exports.getToSnap = getToSnap; + +const getRelativeEarliest = (fromNumber, fromSnap, fromUnit) => { + const earliestSnap = fromSnap ? `@${fromUnit}` : ''; + return `-${fromNumber}${fromUnit}${earliestSnap}`; +}; +/** + * Returns the latest time string in relative format + * @param {string} fromUnit + * @param {boolean} toSnap + */ + + +exports.getRelativeEarliest = getRelativeEarliest; + +const getRelativeLatest = (fromUnit, toSnap) => { + return toSnap ? `@${fromUnit}` : 'now'; +}; +/** + * Returns the earliest time string in real time format + * @param {number} fromNumber + * @param {string} fromUnit + * @return {string} + */ + + +exports.getRelativeLatest = getRelativeLatest; + +const getRealTimeEarliest = (fromNumber, fromUnit) => { + return `rt-${fromNumber}${fromUnit}`; +}; +/** + * Returns the earliest and latest time range based on duration + * @param {time} string (ISO format) + * @param {number} duration + * @param {string} unit + * @return {earliest, latest} + */ + + +exports.getRealTimeEarliest = getRealTimeEarliest; + +const getAcceleratedTimeRange = (time, duration, unit) => { + const format = 'YYYY-MM-DDTHH:mm:ss.SSSZ'; + const earliest = getISOWithTimeZone((0, _moment.default)(time).subtract(duration, unit).format(format)); + const latest = getISOWithTimeZone((0, _moment.default)(time).add(duration, unit).format(format)); + return { + earliest, + latest + }; +}; + +exports.getAcceleratedTimeRange = getAcceleratedTimeRange; + +/***/ }), + +/***/ 80528: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +var _interopRequireDefault = __webpack_require__(24994); + +__webpack_unused_export__ = ({ + value: true +}); +exports.U5 = getISO; +__webpack_unused_export__ = void 0; + +var _querystring = _interopRequireDefault(__webpack_require__(47186)); + +var _lodash = __webpack_require__(2543); + +var _url = __webpack_require__(69211); + +var _fetch = __webpack_require__(37446); + +/** + * This utility currently only has one function for parsing a time string on the server. + * ``` + * import { getISO } from '@splunk/time-range-utils/timeParser' + * ``` + * + * @file + */ + +/** + * Fetches the parsed time from splunkd with a browser fetch. + * When the promise is resolved, a data object is returned with up to three properties: + * * time (the original time provided for for validation and identification purposes) + * * iso (the parsed time value) + * * error. + * + * Example usage: + * ``` + * getISO('-2d@h') + * .then(data => { + * this.setState({ + * parseLatest: {error: data.error, iso: data.iso, time: data.time, }, + * }); + * }) + * .catch(data => { + * this.setState({ + * parseLatest: {error: data.error, iso: '', time: data.time, }, + * }); + * }); + * ``` + * @public + * @function + * @name getISO + * @param {string} time - The time string such as `47165491` or `-2h@m`. + * @returns {promise} + */ +function getISO(time) { + const qs = _querystring.default.stringify({ + output_mode: 'json', + time + }); + + const path = (0, _url.createRESTURL)('search/timeparser'); + return fetch(`${path}?${qs}`, _fetch.defaultFetchInit).then((0, _fetch.handleResponse)(200)).then(data => { + // can get away with doing this below because only one timestamp will be returned + const value = (0, _lodash.keys)(data)[0]; + return { + error: null, + iso: data[value], + time + }; + }).catch(error => ({ + error, + time + })); +} + +var _default = { + getISO +}; +__webpack_unused_export__ = _default; + +/***/ }), + +/***/ 37136: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +var _interopRequireDefault = __webpack_require__(24994); + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.snapUnits = exports.timeUnits = void 0; + +var _defineProperty2 = _interopRequireDefault(__webpack_require__(43693)); + +var _i18n = __webpack_require__(20259); + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +const u = {}; +/* eslint-disable no-multi-assign */ + +u.s = u.sec = u.secs = u.second = u.seconds = { + abbr: 's', + singular: (0, _i18n._)('second'), + plural: (0, _i18n._)('seconds') +}; +u.m = u.min = u.mins = u.minute = u.minutes = { + abbr: 'm', + singular: (0, _i18n._)('minute'), + plural: (0, _i18n._)('minutes') +}; +u.h = u.hr = u.hrs = u.hour = u.hours = { + abbr: 'h', + singular: (0, _i18n._)('hour'), + plural: (0, _i18n._)('hours') +}; +u.d = u.day = u.days = { + abbr: 'd', + singular: (0, _i18n._)('day'), + plural: (0, _i18n._)('days') +}; +u.w = u.week = u.weeks = { + abbr: 'w', + singular: (0, _i18n._)('week'), + plural: (0, _i18n._)('weeks') +}; +u.mon = u.month = u.months = { + abbr: 'mon', + singular: (0, _i18n._)('month'), + plural: (0, _i18n._)('months') +}; +u.q = u.qtr = u.qtrs = u.quarter = u.quarters = { + abbr: 'q', + singular: (0, _i18n._)('quarter'), + plural: (0, _i18n._)('quarters') +}; +u.y = u.yr = u.yrs = u.year = u.years = { + abbr: 'y', + singular: (0, _i18n._)('year'), + plural: (0, _i18n._)('years') +}; +/* eslint-enable no-multi-assign */ + +const timeUnits = u; // snap units can additionally include days of the week. + +exports.timeUnits = timeUnits; + +const snapUnits = _objectSpread({}, u); + +exports.snapUnits = snapUnits; +snapUnits.w0 = { + abbr: 'w0', + singular: (0, _i18n._)('Sunday'), + plural: (0, _i18n._)('Sundays') +}; +snapUnits.w1 = { + abbr: 'w1', + singular: (0, _i18n._)('Monday'), + plural: (0, _i18n._)('Mondays') +}; +snapUnits.w2 = { + abbr: 'w2', + singular: (0, _i18n._)('Tuesday'), + plural: (0, _i18n._)('Tuesdays') +}; +snapUnits.w3 = { + abbr: 'w3', + singular: (0, _i18n._)('Wednesday'), + plural: (0, _i18n._)('Wednesdays') +}; +snapUnits.w4 = { + abbr: 'w4', + singular: (0, _i18n._)('Thursday'), + plural: (0, _i18n._)('Thursdays') +}; +snapUnits.w5 = { + abbr: 'w5', + singular: (0, _i18n._)('Friday'), + plural: (0, _i18n._)('Fridays') +}; +snapUnits.w6 = { + abbr: 'w6', + singular: (0, _i18n._)('Saturday'), + plural: (0, _i18n._)('Saturdays') +}; +snapUnits.w7 = { + abbr: 'w7', + singular: (0, _i18n._)('Sunday'), + plural: (0, _i18n._)('Sundays') +}; + +/***/ }), + +/***/ 65097: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getEntry = getEntry; + +/* eslint-disable import/prefer-default-export */ + +/** + * Retrieves the cookie value for the reference name passed in. + * This can be `null` if the token or the reference name is not found in the cookie. + * + * For example: + * ``` + * const CSRFToken = getEntry('splunkweb_csrf_token_8000'); + * ``` + * + * @param {String} name Reference to the name in the cookie. + * + * @returns {String|null} If found, returns the cookie value associated with the name; null otherwise. + * + * @public + * + */ +function getEntry(name) { + if (typeof document === 'undefined') { + return null; + } + + var regex = new RegExp("(^|; ?)".concat(name, "=([^;]+)")); + var value = null; + + try { + var match = document.cookie.match(regex); + value = match ? match[2] : null; + } catch (e) {// no-op, let `value` remain null + } + + return value; +} + +/***/ }), + +/***/ 30376: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.sprintf = sprintf; +exports.abbreviateNumber = abbreviateNumber; +exports.bytesToFileSize = bytesToFileSize; +exports.smartTrim = smartTrim; + +var _lodash = __webpack_require__(2543); + +var _i18n = __webpack_require__(20259); + +var _math = __webpack_require__(44185); + +var _sprintf = __webpack_require__(62145); + +/** + * @file + * Number and String format utilities. + */ + +/** + * Returns a formatted string. + * + * ```js + * const text = sprintf('%1$s %2$s a %3$s', 'Polly', 'wants', 'cracker') // 'Polly wants a cracker' + * ``` + * + * #### Format Specification + * The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: + * + * * An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments are placed in the same order as the placeholders in the input string. + * * An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. + * * An optional padding specifier that says what character to use for padding, if specified. Possible values are `0` or any other character preceded by a (`'`) (single quote). The default is to pad with *spaces*. + * * An optional `-` sign that causes `sprintf` to left-align the result of this placeholder. The default is to right-align the result. + * * An optional number that says how many characters the result has. If the value to be returned is shorter than this number, the result is padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. + * * An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits are displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. + * * A type specifier that can be any of the following: + * * `%` — yields a literal `%` character + * * `b` — yields an integer as a binary number + * * `c` — yields an integer as the character with that ASCII value + * * `d` or `i` — yields an integer as a signed decimal number + * * `e` — yields a float using scientific notation + * * `u` — yields an integer as an unsigned decimal number + * * `f` — yields a float as is; see notes on precision above + * * `g` — yields a float as is; see notes on precision above + * * `o` — yields an integer as an octal number + * * `s` — yields a string as is + * * `t` — yields `true` or `false` + * * `T` — yields the type of the argument1 + * * `v` — yields the primitive value of the specified argument + * * `x` — yields an integer as a hexadecimal number (lower-case) + * * `X` — yields an integer as a hexadecimal number (upper-case) + * * `j` — yields a JavaScript object or array as a JSON encoded string + * + * This utility was adapted from [Alexandru's sprintf-js implementation](https://github.com/alexei/sprintf.js). + * + * @param {string} fmt - The string to format and insert values into. + * @param {Any} values - The values to insert into the format string. See specification above. + * @public + */ +function sprintf(key) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + return (0, _sprintf.sprintfFormat)((0, _sprintf.sprintfParse)(key), [key].concat(rest)); +} +/** + * Abbreviates a number by rounding to no more than three decimal places and by appending a + * suffix: K/M/B. Additionally, the resulting number is formatted using a given locale. + * + * Examples: + * * `99549` returns `99.5K` + * * `1159000` returns `1.16M` + * * `9500`, `de-de` returns `9,5K` + * + * @param {Number|String} number The number to abbreviate. + * @param {String} [locale='en-us'] + * @returns {String} The abbreviated and localized number if `number` is positive. The localized + * number if negative. + * @public + */ + + +function abbreviateNumber(number) { + var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-us'; + var value = (0, _lodash.toNumber)(number); + + if (value <= 1000) { + return value.toLocaleString(locale); + } + + if (value < 10000) { + return sprintf((0, _i18n._)('%sK'), (0, _math.roundToDecimal)(value / 1000, -2).toLocaleString(locale)); + } + + if (value < 100000) { + return sprintf((0, _i18n._)('%sK'), (0, _math.roundToDecimal)(value / 1000, -1).toLocaleString(locale)); + } + + if (value < 999500) { + return sprintf((0, _i18n._)('%sK'), (0, _math.roundToDecimal)(value / 1000, 0).toLocaleString(locale)); + } + + if (value < 10000000) { + return sprintf((0, _i18n._)('%sM'), (0, _math.roundToDecimal)(value / 1000000, -2).toLocaleString(locale)); + } + + if (value < 100000000) { + return sprintf((0, _i18n._)('%sM'), (0, _math.roundToDecimal)(value / 1000000, -1).toLocaleString(locale)); + } + + if (value < 999500000) { + return sprintf((0, _i18n._)('%sM'), (0, _math.roundToDecimal)(value / 1000000, 0).toLocaleString(locale)); + } + + if (value < 10000000000) { + return sprintf((0, _i18n._)('%sB'), (0, _math.roundToDecimal)(value / 1000000000, -2).toLocaleString(locale)); + } + + if (value < 100000000000) { + return sprintf((0, _i18n._)('%sB'), (0, _math.roundToDecimal)(value / 1000000000, -1).toLocaleString(locale)); + } + + return sprintf((0, _i18n._)('%sB'), (0, _math.roundToDecimal)(value / 1000000000, 0).toLocaleString(locale)); +} +/** + * Abbreviates a number by rounding to no more than two decimal places and by converting to + * binary prefixes (B/KB/MB/GB/TB). Additionally, the resulting number is formatted using a + * given locale. + * + * Examples: + * * `100` returns `100 B` + * * `1200` returns `1.17 KB` + * * `96619136`, `de-de` returns `92,14 MB` + * + * @param {Number|String} bytes The number of bytes to abbreviate. + * @param {String} [locale='en-us'] + * @throws {RangeError} If `bytes` is less than zero. + * @return {String} The abbreviated and localized number. + * @public + */ + + +function bytesToFileSize(bytes) { + var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-us'; + var kbFileSize = (bytes || 0) / 1024; + + if (kbFileSize < 0) { + throw new RangeError('bytes must be >= 0'); + } + + if (Math.floor(kbFileSize) === 0) { + return sprintf((0, _i18n._)('%s B'), bytes.toLocaleString(locale)); + } + + var mbFileSize = kbFileSize / 1024; + + if (Math.floor(mbFileSize) === 0) { + return sprintf((0, _i18n._)('%s KB'), (0, _math.roundToDecimal)(kbFileSize, -2).toLocaleString(locale)); + } + + var gbFileSize = mbFileSize / 1024; + + if (Math.floor(gbFileSize) === 0) { + return sprintf((0, _i18n._)('%s MB'), (0, _math.roundToDecimal)(mbFileSize, -2).toLocaleString(locale)); + } + + var tbFileSize = gbFileSize / 1024; + + if (Math.floor(tbFileSize) === 0) { + return sprintf((0, _i18n._)('%s GB'), (0, _math.roundToDecimal)(gbFileSize, -2).toLocaleString(locale)); + } + + return sprintf((0, _i18n._)('%s TB'), (0, _math.roundToDecimal)(tbFileSize, -2).toLocaleString(locale)); +} +/** + * Trim a String by replacing characters in the middle with an ellipsis. + * + * Examples: + * * `1234567890`, `7` returns `123...7890` + * * `1234567890`, `10` returns `1234567890` + * * `1234567890`, `50` returns `1234567890` + * * `1234567890`, `2`, `{ precomposed: true }` returns `1…0` + * + * @param {String} string The input string. + * @param {Number} maxCharsFromString How many characters to take from `string`. + * @param {Object} [options] * `precomposed`: Use one ellipsis character (…) + * instead of three periods. Defaults to `false`. + * @return {String} The trimmed result. Note that the total length might be up to three characters + * more than `maxCharsFromString`. If `string` is falsy or if `maxCharsFromString` is less than 1, + * `string` is returned. + * @public + */ + + +function smartTrim(string, maxCharsFromString) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$precomposed = _ref.precomposed, + precomposed = _ref$precomposed === void 0 ? false : _ref$precomposed; + + if (!string || maxCharsFromString < 1 || string.length <= maxCharsFromString) { + return string; + } + + var ellipsis = precomposed ? '…' : '...'; + + if (maxCharsFromString === 1) { + return "".concat(string[0]).concat(ellipsis); + } + + var midpoint = Math.ceil(string.length / 2); + var toRemove = string.length - maxCharsFromString; + var lstrip = Math.ceil(toRemove / 2); + var rstrip = toRemove - lstrip; + return "".concat(string.substring(0, midpoint - lstrip)).concat(ellipsis).concat(string.substring(midpoint + rstrip)); +} + +/***/ }), + +/***/ 20259: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.gettext = gettext; +exports._ = _; +exports.setSharedTranslator = setSharedTranslator; +exports.resetSharedTranslator = resetSharedTranslator; + +/** + * @file + * Internationalization / translation utility. The exported `gettext` (and its alias `_`) uses + * a shared translator function that's set to `window.gettext` by default. If `window.gettext` isn't + * available, the identify function is used, turning `gettext` and `_` into no-ops. + * + * Caution is advised when using `setSharedTranslator` and `resetSharedTranslator`. Always restore + * the translator after changing it, and never assume that the translator hasn't been changed by + * external code during long-running operations. + * + * If used in combination with Splunk Enterprise, `window.gettext` is provided by default. Using the `gettext` + * and `_` syntax ensures that messages can be extracted, and a catalog file can be generated + * automatically. + */ +var internalTranslator; +/** + * Translates text using the shared translator. By default, this is `window.gettext` if it's available. Otherwise, + * the identify function is used. + * @param {String} text The text to translate. + * @return {String} The translated text. + * @public + */ + +function gettext() { + return internalTranslator.apply(void 0, arguments); +} +/** + * This is an alias for `gettext`. + * @param {String} text The text to translate. + * @return {String} The translated text. + * @public + */ + + +function _() { + return internalTranslator.apply(void 0, arguments); +} +/** + * Sets the shared translator. It is used by all subsequent calls of `gettext` and `_`. + * @param {function} newTranslator - A function that returns the translated string. + * @public + */ + + +function setSharedTranslator(newTranslator) { + internalTranslator = newTranslator; +} +/** + * Resets the shared translator to `window.gettext` if available, and the identify function otherwise. + * This function is invoked automatically during module load. + * @public + */ + + +function resetSharedTranslator() { + setSharedTranslator(typeof window !== 'undefined' && window.gettext || function (message) { + return message; + }); +} + +resetSharedTranslator(); + +/***/ }), + +/***/ 97478: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createGUID = createGUID; +exports.createDOMID = createDOMID; + +/** + * Creates a Globally Unique Identifier in the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, + * where each x is replaced with a hexadecimal digit from 0 to f, and y is replaced with a + * hexadecimal digit from 8 to b. This is not compatible with DOM ids, which must + * start with a letter. + * + * @returns {String} + * @public + */ +function createGUID() { + var template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; + return template.replace(/[xy]/g, function (_char) { + var random = Math.floor(Math.random() * 16); + var value = _char === 'x' ? random : random % 4 + 8; + return value.toString(16); + }); +} +/** + * Creates a Globally Unique Identifier prefixed with one or more letters to create a valid DOM id. + * + * @param {String} [prefix=id] A prefix, which must start with a letter and may only contain + * letters, digits, hyphens, and underscores. + * @returns {String} + * @public + */ + + +function createDOMID() { + var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id'; + + if (prefix.match(/^[a-zA-Z][\w-]*$/)) { + return "".concat(prefix, "-").concat(createGUID()); + } + + throw new Error('createDOMID: Prefix must start with a letter and may only contain letters, digits, hyphens and underscores'); +} + +/***/ }), + +/***/ 4214: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isNumber = isNumber; +exports.isDecimal = isDecimal; +exports.isMinus = isMinus; +exports.isNumeric = isNumeric; +exports.addsCharacter = addsCharacter; +exports.keycode = void 0; + +var _keycode = _interopRequireDefault(__webpack_require__(36545)); + +var _lodash = __webpack_require__(2543); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * @file + * Utilities for handling keyboard events. + */ + +/** + * A utility for mapping key names with their numeric codes. This is an alias for [the third-party + * library, keycode](https://github.com/timoxley/keycode). + * @public + */ +var keycode = _keycode["default"]; +/** + * Whenever possible this library uses event.key because it has fewer issues than event.keyCode. + * However, Safari 9.0 and earlier only support it for a few keys, such as Enter, and the QA + * test suite doesn't provide it. + */ + +exports.keycode = keycode; + +function isValidKey(key) { + return (0, _lodash.isUndefined)(key) ? false : key !== 'Unidentified'; +} +/** + * Tests if the event key is a number. + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @returns {Boolean} + * @public + */ + + +function isNumber(_ref) { + var key = _ref.key, + keyCode = _ref.keyCode; + + if (isValidKey(key)) { + var keys = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; + return keys.indexOf(key) >= 0; + } + + return keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105; +} +/** + * Tests if the event key is a decimal. + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @param {Object} [options] + * @param {String} [locale.string = 'en-US'] - The locale determines the decimal separator. Supported locale formats are: `xx`, `xx-XX`, and `xx_XX`. + * @returns {Boolean} + * @public + */ + + +function isDecimal(_ref2) { + var key = _ref2.key, + keyCode = _ref2.keyCode; + + var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? 'en-US' : _ref3$locale; + + // A more robust and expandable solution would be to use formatToParts() once IE requirements are dropped. + var formattedNumber = new Intl.NumberFormat(locale.replace('_', '-')).format(1.2); + var decimalSeparator = formattedNumber.indexOf(',') > -1 ? ',' : '.'; + + if (isValidKey(key)) { + return key === decimalSeparator || key === 'Decimal'; + } + + if (decimalSeparator === '.' && keyCode === keycode('numpad .')) { + return true; + } + + return keyCode === keycode(decimalSeparator); +} +/** + * Tests if the event key is a minus sign. + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @returns {Boolean} + * @public + */ + + +function isMinus(_ref4) { + var key = _ref4.key, + keyCode = _ref4.keyCode; + + if (isValidKey(key)) { + return key === '-' || key === 'Subtract'; + } + + return keyCode === keycode('numpad -') || keyCode === keycode('-'); +} +/** + * Tests if the event key is a numeric character (number, decimal, or minus). + * @param {Event} event - A keyboard event that includes a key, a keyCode, or both. + * @param {Object} [options] + * @param {String} [locale.string = 'en-US'] - The locale determines the decimal separator. Supported locale formats are: `xx`, `xx-XX`, and `xx_XX`. + * @returns {Boolean} + * @public + */ + + +function isNumeric(event, options) { + return isNumber(event) || isDecimal(event, options) || isMinus(event); +} +/** + * Tests if the event key adds a character. Enter and Tab return false even though they + * add characters in some situations. + * Caveat: Safari 9.0 and earlier might return undefined as this cannot be practically + * determined. + * @param {Event} event - A keyboard event that includes a key. + * @returns {Boolean|Undefined} + * @public + */ + + +function addsCharacter(_ref5) { + var key = _ref5.key; + + if (isValidKey(key)) { + // IE 11 named characters + var names = ['Add', 'Decimal', 'Divide', 'Multiply', 'Spacebar', 'Subtract']; // If key is one character it's assumed to be inserting a character rather than some other + // type of action. + + return key.length === 1 || names.indexOf(key) >= 0; + } // Safari 9.0 and earlier may return undefined + + + return undefined; +} + +/***/ }), + +/***/ 44185: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.strictParseFloat = strictParseFloat; +exports.roundToDecimal = roundToDecimal; +exports.floorPowerOfTen = floorPowerOfTen; +exports.isLessThanMinSafeInt = isLessThanMinSafeInt; +exports.isGreaterThanMaxSafeInt = isGreaterThanMaxSafeInt; + +var _lodash = __webpack_require__(2543); + +/** + * @file + * Math and floating point utilities. + */ +var decimalOrScientificRegex = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i; +var minSafeInteger = -9007199254740991; // required as long as we support IE11 + +var maxSafeInteger = 9007199254740991; // required as long as we support IE11 + +/** + * A strict version of `parseFloat` that requires the entire input string to be valid decimal + * or scientific format. + * + * @param {String} string + * @returns {(Number|NaN)} + * @public + */ + +function strictParseFloat(string) { + // if the number is not in decimal or scientific format, return NaN explicitly + // instead of letting JavaScript do its loose parsing + return !decimalOrScientificRegex.test(string) ? NaN : parseFloat(string); +} +/** + * + * Rounds a number to a specific exponent of base 10. + * + * Examples: + * * `value` 125.678 and `exp` -2 rounds to 125.68 + * * `value` 125.678 and `exp` -1 rounds to 125.7 + * * `value` 125.678 and `exp` 0 rounds to 126 + * * `value` 125.678 and `exp` 1 rounds to 130 + * * `value` 125.678 and `exp` 2 rounds to 100 + * + * @param {Number} value + * @param {Number} [exp=0] Exponent of base 10 of the decimal place to round to. + * @returns {(Number|NaN)} The rounded number or NaN if `value` is not a Number or `exp` isn't + * an integer. + * @public + */ + + +function roundToDecimal(value) { + var exp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return (0, _lodash.round)(value, exp * -1); +} +/** + * Returns the nearest whole power of ten less or equal to the given number. + * + * Examples: + * * 10 returns 10 + * * 11 returns 10 + * * 99 returns 10 + * * 100 returns 100 + * + * @param {Number} number + * @returns {(Number|NaN)} The result if `number` is positive, `0` if `number` is `0`, `NaN` if + * `number` is negative. + * @public + */ + + +function floorPowerOfTen(number) { + return Math.pow(10, Math.floor(Math.log(number) / Math.LN10)); +} +/** + * Determines if the given number is less than the minimum safe integer (-9007199254740991). + * @param {Number} number + * @return {Boolean} `true` if the given number is less than the minimum safe integer, `false` + * otherwise (or if `number` isn't a Number). + * @public + */ + + +function isLessThanMinSafeInt(number) { + if (!(0, _lodash.isNumber)(number)) { + return false; + } + + return number <= minSafeInteger; +} +/** + * Determines if the given number is greater than the maximum safe integer (9007199254740991). + * @param {Number} number + * @return {Boolean} `true` if the given number is greater than the maximum safe integer, `false` + * otherwise (or if `number` isn't a Number). + * @public + */ + + +function isGreaterThanMaxSafeInt(number) { + if (!(0, _lodash.isNumber)(number)) { + return false; + } + + return number >= maxSafeInteger; +} + +/***/ }), + +/***/ 98370: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); +exports.v = void 0; + +/* eslint-disable import/prefer-default-export, prefer-promise-reject-errors */ + +/** + * Adds a cancel function on your promise to cancel future execution of then or catch functions. + * `makeCancelable` also cancels all callbacks attached to new promises returned by then or catch. + * + * @param {Promise} promise - The value to be evaluated. + * @returns {Promise} + * @public + */ +var makeCancelable = function makeCancelable(promise) { + var isCanceled = false; + var wrappedPromise = new Promise(function (resolve, reject) { + promise.then(function (val) { + if (isCanceled) { + reject({ + isCanceled: true + }); + } else { + resolve(val); + } + }); + promise["catch"](function (error) { + if (isCanceled) { + reject({ + isCanceled: true + }); + } else { + reject(error); + } + }); + }); + return { + promise: wrappedPromise, + cancel: function cancel() { + isCanceled = true; + } + }; +}; + +exports.v = makeCancelable; + +/***/ }), + +/***/ 62145: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.sprintfFormat = sprintfFormat; +exports.sprintfParse = sprintfParse; + +var _lodash = __webpack_require__(2543); + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +// This file was adapted from [Alexandru's sprintf-js implementation](https://github.com/alexei/sprintf.js), +// which is BSD-3-Clause-licensed: +// +// Copyright (c) 2007-present, Alexandru Mărășteanu +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of this software nor the names of its contributors may be +// used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// End of BSD-3-Clause license text. + +/** + * RegExs used by sprintf. + * @private + */ +var re = { + notType: /[^T]/, + notPrimitive: /[^v]/, + number: /[diefg]/, + numericArg: /[bcdiefguxX]/, + json: /[j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, + key: /^([a-z_][a-z_\d]*)/i, + keyAccess: /^\.([a-z_][a-z_\d]*)/i, + indexAccess: /^\[(\d+)\]/, + sign: /^[+-]/ +}; +/** + * Internal helper. + * @private + */ + +function sprintf(key) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + // eslint-disable-next-line no-use-before-define + return sprintfFormat(sprintfParse(key), [key].concat(rest)); +} +/** + * Internal implementation of sprintf. + * @private + */ + + +function sprintfFormat(parseTree, argv) { + /* eslint-disable default-case, no-bitwise, no-nested-ternary */ + var treeLength = parseTree.length; + var cursor = 1; + var arg; + var output = ''; + var i; + var k; + var ph; + var pad; + var padCharacter; + var padLength; + var isPositive; + var sign; + + for (i = 0; i < treeLength; i += 1) { + if (typeof parseTree[i] === 'string') { + output += parseTree[i]; + } else if (_typeof(parseTree[i]) === 'object') { + ph = parseTree[i]; // convenience purposes only + + if (ph.keys) { + // keyword argument + arg = argv[cursor]; + + for (k = 0; k < ph.keys.length; k += 1) { + if (!(0, _lodash.has)(arg, ph.keys[k])) { + throw new Error(sprintf('[sprintf] property "%s" does not exist', ph.keys[k])); + } + + arg = arg[ph.keys[k]]; + } + } else if (ph.paramNo) { + // positional argument (explicit) + arg = argv[ph.paramNo]; + } else { + // positional argument (implicit) + arg = argv[cursor]; + cursor += 1; + } + + if (re.notType.test(ph.type) && re.notPrimitive.test(ph.type) && arg instanceof Function) { + arg = arg(); + } + + if (re.numericArg.test(ph.type) && typeof arg !== 'number' && Number.isNaN(Number(arg))) { + throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)); + } + + if (re.number.test(ph.type)) { + isPositive = arg >= 0; + } + + switch (ph.type) { + case 'b': + arg = parseInt(arg, 10).toString(2); + break; + + case 'c': + arg = String.fromCharCode(parseInt(arg, 10)); + break; + + case 'd': + case 'i': + arg = parseInt(arg, 10); + break; + + case 'j': + arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width, 10) : 0); + break; + + case 'e': + arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential(); + break; + + case 'f': + arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg); + break; + + case 'g': + arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg); + break; + + case 'o': + arg = (parseInt(arg, 10) >>> 0).toString(8); + break; + + case 's': + arg = String(arg); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 't': + arg = String(!!arg); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 'T': + arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase(); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 'u': + arg = parseInt(arg, 10) >>> 0; + break; + + case 'v': + arg = arg.valueOf(); + arg = ph.precision ? arg.substring(0, ph.precision) : arg; + break; + + case 'x': + arg = (parseInt(arg, 10) >>> 0).toString(16); + break; + + case 'X': + arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase(); + break; + } + + if (re.json.test(ph.type)) { + output += arg; + } else { + if (re.number.test(ph.type) && (!isPositive || ph.sign)) { + sign = isPositive ? '+' : '-'; + arg = arg.toString().replace(re.sign, ''); + } else { + sign = ''; + } + + padCharacter = ph.padChar ? ph.padChar === '0' ? '0' : ph.padChar.charAt(1) : ' '; + padLength = ph.width - (sign + arg).length; + pad = ph.width ? padLength > 0 ? (0, _lodash.repeat)(padCharacter, padLength) : '' : ''; + output += ph.align ? sign + arg + pad : padCharacter === '0' ? sign + pad + arg : pad + sign + arg; + } + } + } + + return output; + /* eslint-enable default-case, no-bitwise, no-nested-ternary */ +} +/** + * Cache used by sprintfParse + * @private + */ + + +var sprintfParseCache = Object.create(null); +/** + * Creates an AST of fmt. + * + * @param {String} fmt - The target string. + * @returns {Array} An AST of fmt. + * @private + */ + +function sprintfParse(fmt) { + if (sprintfParseCache[fmt]) { + return sprintfParseCache[fmt]; + } + + var current = fmt; + var match; + var argNames = 0; + var parseTree = []; + + while (current) { + /* eslint-disable no-cond-assign, no-bitwise */ + if ((match = re.text.exec(current)) !== null) { + parseTree.push(match[0]); + } else if ((match = re.modulo.exec(current)) !== null) { + parseTree.push('%'); + } else if ((match = re.placeholder.exec(current)) !== null) { + if (match[2]) { + argNames |= 1; + var replacementField = match[2]; + var fieldMatch = []; + var fieldList = []; + + if ((fieldMatch = re.key.exec(replacementField)) !== null) { + fieldList.push(fieldMatch[1]); + + while ((replacementField = replacementField.substring(fieldMatch[0].length)) !== '') { + if ((fieldMatch = re.keyAccess.exec(replacementField)) !== null) { + fieldList.push(fieldMatch[1]); + } else if ((fieldMatch = re.indexAccess.exec(replacementField)) !== null) { + fieldList.push(fieldMatch[1]); + } else { + throw new SyntaxError('[sprintf] failed to parse named argument key'); + } + } + } else { + throw new SyntaxError('[sprintf] failed to parse named argument key'); + } + + match[2] = fieldList; + } else { + argNames |= 2; + } + + if (argNames === 3) { + throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported'); + } + + parseTree.push({ + placeholder: match[0], + paramNo: match[1], + keys: match[2], + sign: match[3], + padChar: match[4], + align: match[5], + width: match[6], + precision: match[7], + type: match[8] + }); + } else { + throw new SyntaxError('[sprintf] unexpected placeholder'); + } + + current = current.substring(match[0].length); + /* eslint-enable no-cond-assign, no-bitwise */ + } + + sprintfParseCache[fmt] = parseTree; + return sprintfParseCache[fmt]; +} + +/***/ }), + +/***/ 4146: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var reactIs = __webpack_require__(44363); + +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; +var TYPE_STATICS = {}; +TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; +TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; + +function getStatics(component) { + // React v16.11 and below + if (reactIs.isMemo(component)) { + return MEMO_STATICS; + } // React v16.12 and above + + + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + } + + return targetComponent; +} + +module.exports = hoistNonReactStatics; + + +/***/ }), + +/***/ 36545: +/***/ ((module, exports) => { + +// Source: http://jsfiddle.net/vWx8V/ +// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes + +/** + * Conenience method returns corresponding value for given keyName or keyCode. + * + * @param {Mixed} keyCode {Number} or keyName {String} + * @return {Mixed} + * @api public + */ + +function keyCode(searchInput) { + // Keyboard Events + if (searchInput && 'object' === typeof searchInput) { + var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode + if (hasKeyCode) searchInput = hasKeyCode + } + + // Numbers + if ('number' === typeof searchInput) return names[searchInput] + + // Everything else (cast to string) + var search = String(searchInput) + + // check codes + var foundNamedKey = codes[search.toLowerCase()] + if (foundNamedKey) return foundNamedKey + + // check aliases + var foundNamedKey = aliases[search.toLowerCase()] + if (foundNamedKey) return foundNamedKey + + // weird character? + if (search.length === 1) return search.charCodeAt(0) + + return undefined +} + +/** + * Compares a keyboard event with a given keyCode or keyName. + * + * @param {Event} event Keyboard event that should be tested + * @param {Mixed} keyCode {Number} or keyName {String} + * @return {Boolean} + * @api public + */ +keyCode.isEventKey = function isEventKey(event, nameOrCode) { + if (event && 'object' === typeof event) { + var keyCode = event.which || event.keyCode || event.charCode + if (keyCode === null || keyCode === undefined) { return false; } + if (typeof nameOrCode === 'string') { + // check codes + var foundNamedKey = codes[nameOrCode.toLowerCase()] + if (foundNamedKey) { return foundNamedKey === keyCode; } + + // check aliases + var foundNamedKey = aliases[nameOrCode.toLowerCase()] + if (foundNamedKey) { return foundNamedKey === keyCode; } + } else if (typeof nameOrCode === 'number') { + return nameOrCode === keyCode; + } + return false; + } +} + +exports = module.exports = keyCode; + +/** + * Get by name + * + * exports.code['enter'] // => 13 + */ + +var codes = exports.code = exports.codes = { + 'backspace': 8, + 'tab': 9, + 'enter': 13, + 'shift': 16, + 'ctrl': 17, + 'alt': 18, + 'pause/break': 19, + 'caps lock': 20, + 'esc': 27, + 'space': 32, + 'page up': 33, + 'page down': 34, + 'end': 35, + 'home': 36, + 'left': 37, + 'up': 38, + 'right': 39, + 'down': 40, + 'insert': 45, + 'delete': 46, + 'command': 91, + 'left command': 91, + 'right command': 93, + 'numpad *': 106, + 'numpad +': 107, + 'numpad -': 109, + 'numpad .': 110, + 'numpad /': 111, + 'num lock': 144, + 'scroll lock': 145, + 'my computer': 182, + 'my calculator': 183, + ';': 186, + '=': 187, + ',': 188, + '-': 189, + '.': 190, + '/': 191, + '`': 192, + '[': 219, + '\\': 220, + ']': 221, + "'": 222 +} + +// Helper aliases + +var aliases = exports.aliases = { + 'windows': 91, + '⇧': 16, + '⌥': 18, + '⌃': 17, + '⌘': 91, + 'ctl': 17, + 'control': 17, + 'option': 18, + 'pause': 19, + 'break': 19, + 'caps': 20, + 'return': 13, + 'escape': 27, + 'spc': 32, + 'spacebar': 32, + 'pgup': 33, + 'pgdn': 34, + 'ins': 45, + 'del': 46, + 'cmd': 91 +} + +/*! + * Programatically add the following + */ + +// lower case chars +for (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32 + +// numbers +for (var i = 48; i < 58; i++) codes[i - 48] = i + +// function keys +for (i = 1; i < 13; i++) codes['f'+i] = i + 111 + +// numpad keys +for (i = 0; i < 10; i++) codes['numpad '+i] = i + 96 + +/** + * Get by code + * + * exports.name[13] // => 'Enter' + */ + +var names = exports.names = exports.title = {} // title for backward compat + +// Create reverse mapping +for (i in codes) names[codes[i]] = i + +// Add aliases +for (var alias in aliases) { + codes[alias] = aliases[alias] +} + + +/***/ }), + +/***/ 55580: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110), + root = __webpack_require__(9325); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; + + +/***/ }), + +/***/ 21549: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var hashClear = __webpack_require__(22032), + hashDelete = __webpack_require__(63862), + hashGet = __webpack_require__(66721), + hashHas = __webpack_require__(12749), + hashSet = __webpack_require__(35749); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; + + +/***/ }), + +/***/ 80079: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var listCacheClear = __webpack_require__(63702), + listCacheDelete = __webpack_require__(70080), + listCacheGet = __webpack_require__(24739), + listCacheHas = __webpack_require__(48655), + listCacheSet = __webpack_require__(31175); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; + + +/***/ }), + +/***/ 68223: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110), + root = __webpack_require__(9325); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), + +/***/ 53661: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var mapCacheClear = __webpack_require__(63040), + mapCacheDelete = __webpack_require__(17670), + mapCacheGet = __webpack_require__(90289), + mapCacheHas = __webpack_require__(4509), + mapCacheSet = __webpack_require__(72949); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; + + +/***/ }), + +/***/ 32804: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110), + root = __webpack_require__(9325); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; + + +/***/ }), + +/***/ 76545: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110), + root = __webpack_require__(9325); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), + +/***/ 38859: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var MapCache = __webpack_require__(53661), + setCacheAdd = __webpack_require__(31380), + setCacheHas = __webpack_require__(51459); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), + +/***/ 37217: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var ListCache = __webpack_require__(80079), + stackClear = __webpack_require__(51420), + stackDelete = __webpack_require__(90938), + stackGet = __webpack_require__(63605), + stackHas = __webpack_require__(29817), + stackSet = __webpack_require__(80945); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; + + +/***/ }), + +/***/ 51873: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var root = __webpack_require__(9325); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), + +/***/ 37828: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var root = __webpack_require__(9325); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), + +/***/ 28303: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110), + root = __webpack_require__(9325); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; + + +/***/ }), + +/***/ 91033: +/***/ ((module) => { + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; + + +/***/ }), + +/***/ 83729: +/***/ ((module) => { + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; + + +/***/ }), + +/***/ 77947: +/***/ ((module) => { + +/** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; + + +/***/ }), + +/***/ 17277: +/***/ ((module) => { + +/** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; + + +/***/ }), + +/***/ 79770: +/***/ ((module) => { + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; + + +/***/ }), + +/***/ 15325: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIndexOf = __webpack_require__(96131); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; + + +/***/ }), + +/***/ 29905: +/***/ ((module) => { + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; + + +/***/ }), + +/***/ 70695: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseTimes = __webpack_require__(78096), + isArguments = __webpack_require__(72428), + isArray = __webpack_require__(56449), + isBuffer = __webpack_require__(3656), + isIndex = __webpack_require__(30361), + isTypedArray = __webpack_require__(37167); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; + + +/***/ }), + +/***/ 34932: +/***/ ((module) => { + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; + + +/***/ }), + +/***/ 14528: +/***/ ((module) => { + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; + + +/***/ }), + +/***/ 14248: +/***/ ((module) => { + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + + +/***/ }), + +/***/ 87805: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseAssignValue = __webpack_require__(43360), + eq = __webpack_require__(75288); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignMergeValue; + + +/***/ }), + +/***/ 16547: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseAssignValue = __webpack_require__(43360), + eq = __webpack_require__(75288); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; + + +/***/ }), + +/***/ 26025: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var eq = __webpack_require__(75288); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; + + +/***/ }), + +/***/ 74733: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var copyObject = __webpack_require__(21791), + keys = __webpack_require__(95950); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; + + +/***/ }), + +/***/ 43838: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var copyObject = __webpack_require__(21791), + keysIn = __webpack_require__(37241); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; + + +/***/ }), + +/***/ 43360: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var defineProperty = __webpack_require__(93243); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; + + +/***/ }), + +/***/ 87133: +/***/ ((module) => { + +/** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; + + +/***/ }), + +/***/ 9999: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stack = __webpack_require__(37217), + arrayEach = __webpack_require__(83729), + assignValue = __webpack_require__(16547), + baseAssign = __webpack_require__(74733), + baseAssignIn = __webpack_require__(43838), + cloneBuffer = __webpack_require__(93290), + copyArray = __webpack_require__(23007), + copySymbols = __webpack_require__(92271), + copySymbolsIn = __webpack_require__(48948), + getAllKeys = __webpack_require__(50002), + getAllKeysIn = __webpack_require__(83349), + getTag = __webpack_require__(5861), + initCloneArray = __webpack_require__(76189), + initCloneByTag = __webpack_require__(77199), + initCloneObject = __webpack_require__(35529), + isArray = __webpack_require__(56449), + isBuffer = __webpack_require__(3656), + isMap = __webpack_require__(87730), + isObject = __webpack_require__(23805), + isSet = __webpack_require__(38440), + keys = __webpack_require__(95950), + keysIn = __webpack_require__(37241); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; + + +/***/ }), + +/***/ 39344: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(23805); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; + + +/***/ }), + +/***/ 20085: +/***/ ((module) => { + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ +function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); +} + +module.exports = baseDelay; + + +/***/ }), + +/***/ 83915: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var SetCache = __webpack_require__(38859), + arrayIncludes = __webpack_require__(15325), + arrayIncludesWith = __webpack_require__(29905), + arrayMap = __webpack_require__(34932), + baseUnary = __webpack_require__(27301), + cacheHas = __webpack_require__(19219); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; + + +/***/ }), + +/***/ 80909: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseForOwn = __webpack_require__(30641), + createBaseEach = __webpack_require__(38329); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + + +/***/ }), + +/***/ 59855: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseForOwnRight = __webpack_require__(24603), + createBaseEach = __webpack_require__(38329); + +/** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEachRight = createBaseEach(baseForOwnRight, true); + +module.exports = baseEachRight; + + +/***/ }), + +/***/ 23777: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseEach = __webpack_require__(80909); + +/** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; + + +/***/ }), + +/***/ 16574: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseEach = __webpack_require__(80909); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; + + +/***/ }), + +/***/ 2523: +/***/ ((module) => { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), + +/***/ 83120: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayPush = __webpack_require__(14528), + isFlattenable = __webpack_require__(45891); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; + + +/***/ }), + +/***/ 86649: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var createBaseFor = __webpack_require__(83221); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + + +/***/ }), + +/***/ 30641: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseFor = __webpack_require__(86649), + keys = __webpack_require__(95950); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; + + +/***/ }), + +/***/ 24603: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseForRight = __webpack_require__(35827), + keys = __webpack_require__(95950); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; + + +/***/ }), + +/***/ 35827: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var createBaseFor = __webpack_require__(83221); + +/** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseForRight = createBaseFor(true); + +module.exports = baseForRight; + + +/***/ }), + +/***/ 47422: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var castPath = __webpack_require__(31769), + toKey = __webpack_require__(77797); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + + +/***/ }), + +/***/ 82199: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayPush = __webpack_require__(14528), + isArray = __webpack_require__(56449); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; + + +/***/ }), + +/***/ 72552: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Symbol = __webpack_require__(51873), + getRawTag = __webpack_require__(659), + objectToString = __webpack_require__(59350); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + + +/***/ }), + +/***/ 20426: +/***/ ((module) => { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); +} + +module.exports = baseHas; + + +/***/ }), + +/***/ 28077: +/***/ ((module) => { + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; + + +/***/ }), + +/***/ 96131: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseFindIndex = __webpack_require__(2523), + baseIsNaN = __webpack_require__(85463), + strictIndexOf = __webpack_require__(76959); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; + + +/***/ }), + +/***/ 12027: +/***/ ((module) => { + +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; + + +/***/ }), + +/***/ 27185: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var SetCache = __webpack_require__(38859), + arrayIncludes = __webpack_require__(15325), + arrayIncludesWith = __webpack_require__(29905), + arrayMap = __webpack_require__(34932), + baseUnary = __webpack_require__(27301), + cacheHas = __webpack_require__(19219); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; + + +/***/ }), + +/***/ 27534: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; + + +/***/ }), + +/***/ 60270: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsEqualDeep = __webpack_require__(87068), + isObjectLike = __webpack_require__(40346); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; + + +/***/ }), + +/***/ 87068: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stack = __webpack_require__(37217), + equalArrays = __webpack_require__(25911), + equalByTag = __webpack_require__(21986), + equalObjects = __webpack_require__(50689), + getTag = __webpack_require__(5861), + isArray = __webpack_require__(56449), + isBuffer = __webpack_require__(3656), + isTypedArray = __webpack_require__(37167); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; + + +/***/ }), + +/***/ 29172: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getTag = __webpack_require__(5861), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; + + +/***/ }), + +/***/ 41799: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stack = __webpack_require__(37217), + baseIsEqual = __webpack_require__(60270); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + + +/***/ }), + +/***/ 85463: +/***/ ((module) => { + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; + + +/***/ }), + +/***/ 45083: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isFunction = __webpack_require__(1882), + isMasked = __webpack_require__(87296), + isObject = __webpack_require__(23805), + toSource = __webpack_require__(47473); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; + + +/***/ }), + +/***/ 16038: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getTag = __webpack_require__(5861), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; + + +/***/ }), + +/***/ 4901: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + isLength = __webpack_require__(30294), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; + + +/***/ }), + +/***/ 15389: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseMatches = __webpack_require__(93663), + baseMatchesProperty = __webpack_require__(87978), + identity = __webpack_require__(83488), + isArray = __webpack_require__(56449), + property = __webpack_require__(50583); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + +/***/ }), + +/***/ 88984: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isPrototype = __webpack_require__(55527), + nativeKeys = __webpack_require__(3650); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; + + +/***/ }), + +/***/ 72903: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(23805), + isPrototype = __webpack_require__(55527), + nativeKeysIn = __webpack_require__(90181); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; + + +/***/ }), + +/***/ 5128: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseEach = __webpack_require__(80909), + isArrayLike = __webpack_require__(64894); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; + + +/***/ }), + +/***/ 93663: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsMatch = __webpack_require__(41799), + getMatchData = __webpack_require__(10776), + matchesStrictComparable = __webpack_require__(67197); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; + + +/***/ }), + +/***/ 87978: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsEqual = __webpack_require__(60270), + get = __webpack_require__(58156), + hasIn = __webpack_require__(80631), + isKey = __webpack_require__(28586), + isStrictComparable = __webpack_require__(30756), + matchesStrictComparable = __webpack_require__(67197), + toKey = __webpack_require__(77797); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; + + +/***/ }), + +/***/ 85250: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stack = __webpack_require__(37217), + assignMergeValue = __webpack_require__(87805), + baseFor = __webpack_require__(86649), + baseMergeDeep = __webpack_require__(42824), + isObject = __webpack_require__(23805), + keysIn = __webpack_require__(37241), + safeGet = __webpack_require__(14974); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; + + +/***/ }), + +/***/ 42824: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assignMergeValue = __webpack_require__(87805), + cloneBuffer = __webpack_require__(93290), + cloneTypedArray = __webpack_require__(71961), + copyArray = __webpack_require__(23007), + initCloneObject = __webpack_require__(35529), + isArguments = __webpack_require__(72428), + isArray = __webpack_require__(56449), + isArrayLikeObject = __webpack_require__(83693), + isBuffer = __webpack_require__(3656), + isFunction = __webpack_require__(1882), + isObject = __webpack_require__(23805), + isPlainObject = __webpack_require__(11331), + isTypedArray = __webpack_require__(37167), + safeGet = __webpack_require__(14974), + toPlainObject = __webpack_require__(69884); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; + + +/***/ }), + +/***/ 46155: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayMap = __webpack_require__(34932), + baseGet = __webpack_require__(47422), + baseIteratee = __webpack_require__(15389), + baseMap = __webpack_require__(5128), + baseSortBy = __webpack_require__(73937), + baseUnary = __webpack_require__(27301), + compareMultiple = __webpack_require__(43714), + identity = __webpack_require__(83488), + isArray = __webpack_require__(56449); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; + + +/***/ }), + +/***/ 76001: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var basePickBy = __webpack_require__(97420), + hasIn = __webpack_require__(80631); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; + + +/***/ }), + +/***/ 97420: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGet = __webpack_require__(47422), + baseSet = __webpack_require__(73170), + castPath = __webpack_require__(31769); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; + + +/***/ }), + +/***/ 47237: +/***/ ((module) => { + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + + +/***/ }), + +/***/ 17255: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGet = __webpack_require__(47422); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; + + +/***/ }), + +/***/ 21988: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayMap = __webpack_require__(34932), + baseIndexOf = __webpack_require__(96131), + baseIndexOfWith = __webpack_require__(12027), + baseUnary = __webpack_require__(27301), + copyArray = __webpack_require__(23007); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; +} + +module.exports = basePullAll; + + +/***/ }), + +/***/ 84051: +/***/ ((module) => { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; + + +/***/ }), + +/***/ 69302: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var identity = __webpack_require__(83488), + overRest = __webpack_require__(56757), + setToString = __webpack_require__(32865); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; + + +/***/ }), + +/***/ 73170: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assignValue = __webpack_require__(16547), + castPath = __webpack_require__(31769), + isIndex = __webpack_require__(30361), + isObject = __webpack_require__(23805), + toKey = __webpack_require__(77797); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; + + +/***/ }), + +/***/ 19570: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var constant = __webpack_require__(37334), + defineProperty = __webpack_require__(93243), + identity = __webpack_require__(83488); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ 25160: +/***/ ((module) => { + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + + +/***/ }), + +/***/ 73937: +/***/ ((module) => { + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; + + +/***/ }), + +/***/ 78096: +/***/ ((module) => { + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; + + +/***/ }), + +/***/ 77556: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Symbol = __webpack_require__(51873), + arrayMap = __webpack_require__(34932), + isArray = __webpack_require__(56449), + isSymbol = __webpack_require__(44394); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; + + +/***/ }), + +/***/ 54128: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var trimmedEndIndex = __webpack_require__(31800); + +/** Used to match leading whitespace. */ +var reTrimStart = /^\s+/; + +/** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ +function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; +} + +module.exports = baseTrim; + + +/***/ }), + +/***/ 27301: +/***/ ((module) => { + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; + + +/***/ }), + +/***/ 55765: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var SetCache = __webpack_require__(38859), + arrayIncludes = __webpack_require__(15325), + arrayIncludesWith = __webpack_require__(29905), + cacheHas = __webpack_require__(19219), + createSet = __webpack_require__(44517), + setToArray = __webpack_require__(84247); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; + + +/***/ }), + +/***/ 19931: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var castPath = __webpack_require__(31769), + last = __webpack_require__(68090), + parent = __webpack_require__(68969), + toKey = __webpack_require__(77797); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; + + +/***/ }), + +/***/ 30514: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayMap = __webpack_require__(34932); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; + + +/***/ }), + +/***/ 19219: +/***/ ((module) => { + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; + + +/***/ }), + +/***/ 80741: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArrayLikeObject = __webpack_require__(83693); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; + + +/***/ }), + +/***/ 24066: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var identity = __webpack_require__(83488); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; + + +/***/ }), + +/***/ 31769: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArray = __webpack_require__(56449), + isKey = __webpack_require__(28586), + stringToPath = __webpack_require__(61802), + toString = __webpack_require__(13222); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; + + +/***/ }), + +/***/ 49653: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Uint8Array = __webpack_require__(37828); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), + +/***/ 93290: +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(9325); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; + + +/***/ }), + +/***/ 76169: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var cloneArrayBuffer = __webpack_require__(49653); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; + + +/***/ }), + +/***/ 73201: +/***/ ((module) => { + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; + + +/***/ }), + +/***/ 93736: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Symbol = __webpack_require__(51873); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; + + +/***/ }), + +/***/ 71961: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var cloneArrayBuffer = __webpack_require__(49653); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; + + +/***/ }), + +/***/ 53730: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isSymbol = __webpack_require__(44394); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; + + +/***/ }), + +/***/ 43714: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var compareAscending = __webpack_require__(53730); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; + + +/***/ }), + +/***/ 23007: +/***/ ((module) => { + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; + + +/***/ }), + +/***/ 21791: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assignValue = __webpack_require__(16547), + baseAssignValue = __webpack_require__(43360); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), + +/***/ 92271: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var copyObject = __webpack_require__(21791), + getSymbols = __webpack_require__(4664); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; + + +/***/ }), + +/***/ 48948: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var copyObject = __webpack_require__(21791), + getSymbolsIn = __webpack_require__(86375); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; + + +/***/ }), + +/***/ 55481: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var root = __webpack_require__(9325); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ 20999: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseRest = __webpack_require__(69302), + isIterateeCall = __webpack_require__(36800); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + + +/***/ }), + +/***/ 38329: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArrayLike = __webpack_require__(64894); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + + +/***/ }), + +/***/ 83221: +/***/ ((module) => { + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + + +/***/ }), + +/***/ 62006: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIteratee = __webpack_require__(15389), + isArrayLike = __webpack_require__(64894), + keys = __webpack_require__(95950); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; + + +/***/ }), + +/***/ 73893: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var root = __webpack_require__(9325), + toInteger = __webpack_require__(61489), + toNumber = __webpack_require__(99374), + toString = __webpack_require__(13222); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite, + nativeMin = Math.min; + +/** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; +} + +module.exports = createRound; + + +/***/ }), + +/***/ 44517: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Set = __webpack_require__(76545), + noop = __webpack_require__(63950), + setToArray = __webpack_require__(84247); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; + + +/***/ }), + +/***/ 53138: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isPlainObject = __webpack_require__(11331); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; + + +/***/ }), + +/***/ 93243: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ 25911: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var SetCache = __webpack_require__(38859), + arraySome = __webpack_require__(14248), + cacheHas = __webpack_require__(19219); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; + + +/***/ }), + +/***/ 21986: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Symbol = __webpack_require__(51873), + Uint8Array = __webpack_require__(37828), + eq = __webpack_require__(75288), + equalArrays = __webpack_require__(25911), + mapToArray = __webpack_require__(20317), + setToArray = __webpack_require__(84247); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; + + +/***/ }), + +/***/ 50689: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getAllKeys = __webpack_require__(50002); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), + +/***/ 38816: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var flatten = __webpack_require__(35970), + overRest = __webpack_require__(56757), + setToString = __webpack_require__(32865); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; + + +/***/ }), + +/***/ 34840: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; + +module.exports = freeGlobal; + + +/***/ }), + +/***/ 50002: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetAllKeys = __webpack_require__(82199), + getSymbols = __webpack_require__(4664), + keys = __webpack_require__(95950); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), + +/***/ 83349: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetAllKeys = __webpack_require__(82199), + getSymbolsIn = __webpack_require__(86375), + keysIn = __webpack_require__(37241); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; + + +/***/ }), + +/***/ 12651: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isKeyable = __webpack_require__(74218); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; + + +/***/ }), + +/***/ 10776: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isStrictComparable = __webpack_require__(30756), + keys = __webpack_require__(95950); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; + + +/***/ }), + +/***/ 56110: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsNative = __webpack_require__(45083), + getValue = __webpack_require__(10392); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; + + +/***/ }), + +/***/ 28879: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var overArg = __webpack_require__(74335); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ 659: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Symbol = __webpack_require__(51873); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; + + +/***/ }), + +/***/ 4664: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayFilter = __webpack_require__(79770), + stubArray = __webpack_require__(63345); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), + +/***/ 86375: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayPush = __webpack_require__(14528), + getPrototype = __webpack_require__(28879), + getSymbols = __webpack_require__(4664), + stubArray = __webpack_require__(63345); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; + + +/***/ }), + +/***/ 5861: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var DataView = __webpack_require__(55580), + Map = __webpack_require__(68223), + Promise = __webpack_require__(32804), + Set = __webpack_require__(76545), + WeakMap = __webpack_require__(28303), + baseGetTag = __webpack_require__(72552), + toSource = __webpack_require__(47473); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; + + +/***/ }), + +/***/ 10392: +/***/ ((module) => { + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; + + +/***/ }), + +/***/ 49326: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var castPath = __webpack_require__(31769), + isArguments = __webpack_require__(72428), + isArray = __webpack_require__(56449), + isIndex = __webpack_require__(30361), + isLength = __webpack_require__(30294), + toKey = __webpack_require__(77797); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; + + +/***/ }), + +/***/ 22032: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var nativeCreate = __webpack_require__(81042); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; + + +/***/ }), + +/***/ 63862: +/***/ ((module) => { + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; + + +/***/ }), + +/***/ 66721: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var nativeCreate = __webpack_require__(81042); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; + + +/***/ }), + +/***/ 12749: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var nativeCreate = __webpack_require__(81042); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; + + +/***/ }), + +/***/ 35749: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var nativeCreate = __webpack_require__(81042); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; + + +/***/ }), + +/***/ 76189: +/***/ ((module) => { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; + + +/***/ }), + +/***/ 77199: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var cloneArrayBuffer = __webpack_require__(49653), + cloneDataView = __webpack_require__(76169), + cloneRegExp = __webpack_require__(73201), + cloneSymbol = __webpack_require__(93736), + cloneTypedArray = __webpack_require__(71961); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; + + +/***/ }), + +/***/ 35529: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseCreate = __webpack_require__(39344), + getPrototype = __webpack_require__(28879), + isPrototype = __webpack_require__(55527); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; + + +/***/ }), + +/***/ 45891: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Symbol = __webpack_require__(51873), + isArguments = __webpack_require__(72428), + isArray = __webpack_require__(56449); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; + + +/***/ }), + +/***/ 30361: +/***/ ((module) => { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), + +/***/ 36800: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var eq = __webpack_require__(75288), + isArrayLike = __webpack_require__(64894), + isIndex = __webpack_require__(30361), + isObject = __webpack_require__(23805); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; + + +/***/ }), + +/***/ 28586: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArray = __webpack_require__(56449), + isSymbol = __webpack_require__(44394); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; + + +/***/ }), + +/***/ 74218: +/***/ ((module) => { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; + + +/***/ }), + +/***/ 87296: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var coreJsData = __webpack_require__(55481); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; + + +/***/ }), + +/***/ 55527: +/***/ ((module) => { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; + + +/***/ }), + +/***/ 30756: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(23805); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + + +/***/ }), + +/***/ 63702: +/***/ ((module) => { + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; + + +/***/ }), + +/***/ 70080: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assocIndexOf = __webpack_require__(26025); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; + + +/***/ }), + +/***/ 24739: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assocIndexOf = __webpack_require__(26025); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; + + +/***/ }), + +/***/ 48655: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assocIndexOf = __webpack_require__(26025); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; + + +/***/ }), + +/***/ 31175: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var assocIndexOf = __webpack_require__(26025); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; + + +/***/ }), + +/***/ 63040: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Hash = __webpack_require__(21549), + ListCache = __webpack_require__(80079), + Map = __webpack_require__(68223); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; + + +/***/ }), + +/***/ 17670: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getMapData = __webpack_require__(12651); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; + + +/***/ }), + +/***/ 90289: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getMapData = __webpack_require__(12651); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; + + +/***/ }), + +/***/ 4509: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getMapData = __webpack_require__(12651); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; + + +/***/ }), + +/***/ 72949: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getMapData = __webpack_require__(12651); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; + + +/***/ }), + +/***/ 20317: +/***/ ((module) => { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), + +/***/ 67197: +/***/ ((module) => { + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; + + +/***/ }), + +/***/ 62224: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var memoize = __webpack_require__(50104); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; + + +/***/ }), + +/***/ 81042: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var getNative = __webpack_require__(56110); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), + +/***/ 3650: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var overArg = __webpack_require__(74335); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; + + +/***/ }), + +/***/ 90181: +/***/ ((module) => { + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; + + +/***/ }), + +/***/ 86009: +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +var freeGlobal = __webpack_require__(34840); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + + +/***/ }), + +/***/ 59350: +/***/ ((module) => { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; + + +/***/ }), + +/***/ 74335: +/***/ ((module) => { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + + +/***/ }), + +/***/ 56757: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var apply = __webpack_require__(91033); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; + + +/***/ }), + +/***/ 68969: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGet = __webpack_require__(47422), + baseSlice = __webpack_require__(25160); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; + + +/***/ }), + +/***/ 9325: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var freeGlobal = __webpack_require__(34840); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), + +/***/ 14974: +/***/ ((module) => { + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +module.exports = safeGet; + + +/***/ }), + +/***/ 31380: +/***/ ((module) => { + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; + + +/***/ }), + +/***/ 51459: +/***/ ((module) => { + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; + + +/***/ }), + +/***/ 84247: +/***/ ((module) => { + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; + + +/***/ }), + +/***/ 32865: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseSetToString = __webpack_require__(19570), + shortOut = __webpack_require__(51811); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), + +/***/ 51811: +/***/ ((module) => { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; + + +/***/ }), + +/***/ 51420: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var ListCache = __webpack_require__(80079); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; + + +/***/ }), + +/***/ 90938: +/***/ ((module) => { + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; + + +/***/ }), + +/***/ 63605: +/***/ ((module) => { + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; + + +/***/ }), + +/***/ 29817: +/***/ ((module) => { + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; + + +/***/ }), + +/***/ 80945: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var ListCache = __webpack_require__(80079), + Map = __webpack_require__(68223), + MapCache = __webpack_require__(53661); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; + + +/***/ }), + +/***/ 76959: +/***/ ((module) => { + +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; + + +/***/ }), + +/***/ 61802: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var memoizeCapped = __webpack_require__(62224); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), + +/***/ 77797: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isSymbol = __webpack_require__(44394); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; + + +/***/ }), + +/***/ 47473: +/***/ ((module) => { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; + + +/***/ }), + +/***/ 31800: +/***/ ((module) => { + +/** Used to match a single whitespace character. */ +var reWhitespace = /\s/; + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ +function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; +} + +module.exports = trimmedEndIndex; + + +/***/ }), + +/***/ 54664: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var copyObject = __webpack_require__(21791), + createAssigner = __webpack_require__(20999), + keysIn = __webpack_require__(37241); + +/** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ +var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); +}); + +module.exports = assignIn; + + +/***/ }), + +/***/ 99084: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArray = __webpack_require__(56449); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; + + +/***/ }), + +/***/ 78659: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseClamp = __webpack_require__(87133), + toNumber = __webpack_require__(99374); + +/** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); +} + +module.exports = clamp; + + +/***/ }), + +/***/ 37334: +/***/ ((module) => { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), + +/***/ 38221: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isObject = __webpack_require__(23805), + now = __webpack_require__(10124), + toNumber = __webpack_require__(99374); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; + + +/***/ }), + +/***/ 64112: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseDelay = __webpack_require__(20085), + baseRest = __webpack_require__(69302); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; + + +/***/ }), + +/***/ 75288: +/***/ ((module) => { + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; + + +/***/ }), + +/***/ 19747: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayEvery = __webpack_require__(17277), + baseEvery = __webpack_require__(23777), + baseIteratee = __webpack_require__(15389), + isArray = __webpack_require__(56449), + isIterateeCall = __webpack_require__(36800); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = every; + + +/***/ }), + +/***/ 43346: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = __webpack_require__(54664); + + +/***/ }), + +/***/ 87612: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayFilter = __webpack_require__(79770), + baseFilter = __webpack_require__(16574), + baseIteratee = __webpack_require__(15389), + isArray = __webpack_require__(56449); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; + + +/***/ }), + +/***/ 7309: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var createFind = __webpack_require__(62006), + findIndex = __webpack_require__(24713); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; + + +/***/ }), + +/***/ 24713: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseFindIndex = __webpack_require__(2523), + baseIteratee = __webpack_require__(15389), + toInteger = __webpack_require__(61489); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; + + +/***/ }), + +/***/ 35970: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseFlatten = __webpack_require__(83120); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; + + +/***/ }), + +/***/ 39754: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayEach = __webpack_require__(83729), + baseEach = __webpack_require__(80909), + castFunction = __webpack_require__(24066), + isArray = __webpack_require__(56449); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; + + +/***/ }), + +/***/ 27386: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayEachRight = __webpack_require__(77947), + baseEachRight = __webpack_require__(59855), + castFunction = __webpack_require__(24066), + isArray = __webpack_require__(56449); + +/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ +function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEachRight; + + +/***/ }), + +/***/ 58156: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGet = __webpack_require__(47422); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), + +/***/ 61448: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseHas = __webpack_require__(20426), + hasPath = __webpack_require__(49326); + +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ +function has(object, path) { + return object != null && hasPath(object, path, baseHas); +} + +module.exports = has; + + +/***/ }), + +/***/ 80631: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseHasIn = __webpack_require__(28077), + hasPath = __webpack_require__(49326); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), + +/***/ 83488: +/***/ ((module) => { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ 79859: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIndexOf = __webpack_require__(96131), + isArrayLike = __webpack_require__(64894), + isString = __webpack_require__(85015), + toInteger = __webpack_require__(61489), + values = __webpack_require__(35880); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; + + +/***/ }), + +/***/ 21585: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIndexOf = __webpack_require__(96131), + toInteger = __webpack_require__(61489); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ +function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); +} + +module.exports = indexOf; + + +/***/ }), + +/***/ 5287: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayMap = __webpack_require__(34932), + baseIntersection = __webpack_require__(27185), + baseRest = __webpack_require__(69302), + castArrayLikeObject = __webpack_require__(80741); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; + + +/***/ }), + +/***/ 72428: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsArguments = __webpack_require__(27534), + isObjectLike = __webpack_require__(40346); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ 56449: +/***/ ((module) => { + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; + + +/***/ }), + +/***/ 64894: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isFunction = __webpack_require__(1882), + isLength = __webpack_require__(30294); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; + + +/***/ }), + +/***/ 83693: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArrayLike = __webpack_require__(64894), + isObjectLike = __webpack_require__(40346); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; + + +/***/ }), + +/***/ 3656: +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +var root = __webpack_require__(9325), + stubFalse = __webpack_require__(89935); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + + +/***/ }), + +/***/ 62193: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseKeys = __webpack_require__(88984), + getTag = __webpack_require__(5861), + isArguments = __webpack_require__(72428), + isArray = __webpack_require__(56449), + isArrayLike = __webpack_require__(64894), + isBuffer = __webpack_require__(3656), + isPrototype = __webpack_require__(55527), + isTypedArray = __webpack_require__(37167); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; + + +/***/ }), + +/***/ 2404: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsEqual = __webpack_require__(60270); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; + + +/***/ }), + +/***/ 92297: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var root = __webpack_require__(9325); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; + + +/***/ }), + +/***/ 1882: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + isObject = __webpack_require__(23805); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; + + +/***/ }), + +/***/ 30294: +/***/ ((module) => { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), + +/***/ 87730: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsMap = __webpack_require__(29172), + baseUnary = __webpack_require__(27301), + nodeUtil = __webpack_require__(86009); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; + + +/***/ }), + +/***/ 98023: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); +} + +module.exports = isNumber; + + +/***/ }), + +/***/ 23805: +/***/ ((module) => { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ 40346: +/***/ ((module) => { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + + +/***/ }), + +/***/ 11331: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + getPrototype = __webpack_require__(28879), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; + + +/***/ }), + +/***/ 38440: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsSet = __webpack_require__(16038), + baseUnary = __webpack_require__(27301), + nodeUtil = __webpack_require__(86009); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; + + +/***/ }), + +/***/ 85015: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + isArray = __webpack_require__(56449), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; + + +/***/ }), + +/***/ 44394: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseGetTag = __webpack_require__(72552), + isObjectLike = __webpack_require__(40346); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; + + +/***/ }), + +/***/ 37167: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var baseIsTypedArray = __webpack_require__(4901), + baseUnary = __webpack_require__(27301), + nodeUtil = __webpack_require__(86009); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), + +/***/ 62216: +/***/ ((module) => { + +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; + + +/***/ }), + +/***/ 95950: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayLikeKeys = __webpack_require__(70695), + baseKeys = __webpack_require__(88984), + isArrayLike = __webpack_require__(64894); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), + +/***/ 37241: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayLikeKeys = __webpack_require__(70695), + baseKeysIn = __webpack_require__(72903), + isArrayLike = __webpack_require__(64894); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; + + +/***/ }), + +/***/ 68090: +/***/ ((module) => { + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; + + +/***/ }), + +/***/ 2543: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; + + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = true && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' + + + + + + + diff --git a/apps/splunk_instrumentation/bin/README.md b/apps/splunk_instrumentation/bin/README.md new file mode 100755 index 00000000..b34f4357 --- /dev/null +++ b/apps/splunk_instrumentation/bin/README.md @@ -0,0 +1,17 @@ +# app/bin/ + +This is where you put any scripts you want to add to this app. + +This is also the only directory from the app that splunk puts on the python +module lookup path, so any supporting libraries should live here as well. + + +instrumentation.py +------------------ + + +this is the main entry point to run the instrumentation script. this is called from +the mod input with a token for splunkd. But you can run directly with +env INST_MODE=DEV and it will use the splunkrc.json for creds + + INST_MODE=DEV python instrumentation.py \ No newline at end of file diff --git a/apps/splunk_instrumentation/bin/instrumentation.py b/apps/splunk_instrumentation/bin/instrumentation.py new file mode 100755 index 00000000..b8b1d435 --- /dev/null +++ b/apps/splunk_instrumentation/bin/instrumentation.py @@ -0,0 +1,221 @@ +# scripted inputs entry point + +import os +import sys +import argparse +import datetime +import splunk_instrumentation.datetime_util as datetime_util +from time import sleep + +''' +This must happen before splunk_instrumentation.constants is imported. +''' +parser = argparse.ArgumentParser() +parser.add_argument('--scheme', action='store_true') +parser.add_argument('-v', '--validate-arguments', action='store_true') +parser.add_argument('--no-collect', action='store_true', help='will not collect and index data') +parser.add_argument('--no-send', action='store_true', help='will not query _telemetry and send data') +parser.add_argument('-m', '--mode', default="INPUT", help='is required if not running from splund modular inputs') +parser.add_argument('--test-schema') +parser.add_argument('--log-level') +parser.add_argument('--username') +parser.add_argument('--password') +parser.add_argument('--execution-id') +parser.add_argument('--quickdraw-url', help='used to override the quickdraw-url') +parser.add_argument('--run-unscheduled', help='Run even if not scheduled', default=False) +parser.add_argument('--default-quickdraw', help='used to override the quickdraw-url response') +parser.add_argument('--start-date', help='first date to query, in YYYY-MM-DD format (defaults to yesterday)') +parser.add_argument('--stop-date', help='last date to query, in YYY-MM-DD format (inclusive) (defaults to yesterday)') +parser.add_argument('--batch-num', help='batch number') +args = parser.parse_args() + + +# configuration is done through environmental variables. Convert command line to environmental. + +if args.mode: + os.environ['INST_MODE'] = args.mode +if args.no_collect: + os.environ['INST_NO_COLLECT'] = args.no_collect +if args.no_send: + os.environ['INST_NO_SEND'] = args.no_send +if args.test_schema: + os.environ['INST_TEST_SCHEMA'] = args.test_schema +if args.log_level: + os.environ['INST_DEBUG_LEVEL'] = args.log_level +if args.execution_id: + os.environ['INST_EXECUTION_ID'] = args.execution_id +if args.quickdraw_url: + os.environ['QUICKDRAW_URL'] = args.quickdraw_url +if args.default_quickdraw: + os.environ['DEFAULT_QUICKDRAW'] = args.default_quickdraw +if args.username: + os.environ['SPLUNK_USERNAME'] = args.username +if args.password: + os.environ['SPLUNK_PASSWORD'] = args.password +if args.run_unscheduled: + os.environ['RUN_UNSCHEDULE'] = args.run_unscheduled + + +# Routine to get the value of an input token +def get_key(): + # read everything from stdin + config_str = sys.stdin.read() + # stdin is just a token + os.environ['INST_TOKEN'] = config_str.rstrip() + +if not os.environ.get("SPLUNK_DB"): + os.environ['SPLUNK_DB'] = os.path.join(os.environ.get('SPLUNK_HOME') + 'var', 'lib', 'splunk') + +# the default mode is INPUT and is what scripted inputs uses and implies +# there is a token passed in to stdin. +if os.environ['INST_MODE'] == "INPUT": + get_key() + +# these imports inlude splunk_instrumentation.constants which need to be imported after environmental vars are set +from splunk_instrumentation.constants import SPLUNKRC, INST_PRE_EXECUTE_SLEEP, SPLUNKD_URI, BATCHES_PER_HOUR, BATCHES_MAX_SIZE # noqa: E402 +from splunk_instrumentation.service_bundle import ServiceBundle # noqa: E402 +from splunk_instrumentation.splunkd import Splunkd # noqa: E402 +from splunk_instrumentation.input import run_input # noqa: E402 +from splunk_instrumentation.report import report # noqa: E402 + + +def normalize_date_range_params(args, report_start_date): + ''' + Normalizes date range used for Data collection. + Start date for Data collection could be args.start_date, reportStartDate or yesterday + End data for Data collection could be args.stop_date or yesterday + :param args: List of arguments provided through CLI + :param report_start_date: reportStartDate specified in telemetry.conf + :return: + ''' + yesterday = datetime.date.today() - datetime.timedelta(days=1) + + args.start_date = datetime_util.str_to_date(args.start_date) if args.start_date\ + else datetime_util.str_to_date(report_start_date) if report_start_date else yesterday + + args.stop_date = datetime_util.str_to_date(args.stop_date) if args.stop_date else yesterday + + +def validate_date_range(args): + # SPL-153360 This can happen when the user has gone from no opt-in to some opt-in + # on the same day of the scheduled collection, before the script has run. This is + # due to the TelemetryHandler.cpp file, which detects the switch from no opt-in to + # some opt-in and sets the reportStartDate to today. + # + # When the script finally runs, it has an default stop date of yesterday, but + # reportStartDate sets the lower bound, which is today in that case. We do not + # want to generate alarming error messages, so just log the occurrence and exit + # gracefully. + if args.stop_date < args.start_date: + report.report('collection-canceled', { + 'reason': 'Start date is after stop date. No data to collect.', + 'start_date': args.start_date, + 'stop_date': args.stop_date + }) + exit(0) + + +def should_input_run(telemetry_conf_service, batch_num): + ''' + Compares current time with the scheduledDay and scheduledHour + to determine whether Input should execute or not + :param telemetry_conf_service: Service for telemetry.conf + :return: True if current time matched scheduling in telemetry.conf + ''' + scheduled_day = telemetry_conf_service.content.get('scheduledDay') + scheduled_hour = telemetry_conf_service.content.get('scheduledHour') + # Compare day and hour to time now + now = datetime.datetime.now() + + # we execute all savedseaerches in batches[0, BATCHES_MAX_SIZE) in two hours; verify if current batch number should be part of + # scheduledHour [0, BATCHES_PER_HOUR) or scheduledHour + 1 [BATCHES_PER_HOUR, BATCHES_MAX_SIZE); + should_run = False + if (scheduled_day == '*' or scheduled_day == str(now.weekday())): + if batch_num is not None: + # all batches which are marked to be executed at scheduledHour will have 'execute_hour' value of 0; + # all batches which marked to be executed at (scheduledHour + 1) will have 1. + execute_hour = batch_num // BATCHES_PER_HOUR + if(scheduled_hour == str(now.hour) and execute_hour == 0): + should_run = True + elif (int(scheduled_hour) + 1 == now.hour and execute_hour == 1): + should_run = True + else: + # batch num is not provided as part of this script invocation; run all batches by default + if(scheduled_hour == str(now.hour)): + should_run = True + + report.report('schedule-data', { + 'schedule': { + 'day': scheduled_day, + 'hour': scheduled_hour + }, + 'now': { + 'day': str(now.weekday()), + 'hour': str(now.hour) + }, + 'batchNum': str(batch_num), + 'should_run': should_run + }) + return should_run + + +def process_input_params(telemetry_conf_service, args): + ''' + Processes Input date range params and sets reportStartDate in telemetery.conf + :param telemetry_conf_service: Service for telemetry.conf + :param args: List of arguments passed to Scripted input + :return: + ''' + report_start_date = telemetry_conf_service.content.get('reportStartDate') + report.report('reportStartDate', report_start_date) + + normalize_date_range_params(args, report_start_date) + validate_date_range(args) + + # update the 'reportStartDate' before triggering input.py ONLY if + # 1. if the batch num not provided; we execute all batches by default OR + # 2. if it is currently executing the last batch (BATCHES_MAX_SIZE - 1, since we start from 0) OR + # 3. if it is an unscheduled invocation + batch_num = get_batch_num(args) + if((batch_num is None) or (batch_num == BATCHES_MAX_SIZE - 1) or os.environ.get('RUN_UNSCHEDULE')): + reportStartDate = args.stop_date + if type(args.stop_date) == datetime.date: + reportStartDate = reportStartDate.strftime('%Y-%m-%d') + telemetry_conf_service.update({ + 'reportStartDate': reportStartDate + }) + + +def get_batch_num(args): + ''' + get input argument --batch-num + ''' + if args.batch_num and args.batch_num != "None": + return int(args.batch_num); + return None; + + +# Routine to index data +def main(): + if os.environ['INST_MODE'] == "DEV": + splunkd = Splunkd(**SPLUNKRC) + else: + sleep(INST_PRE_EXECUTE_SLEEP) + splunkd = Splunkd(token=os.environ['INST_TOKEN'], server_uri=SPLUNKD_URI) + + services = ServiceBundle(splunkd) + telemetry_conf_service = services.telemetry_conf_service + + batch_num = get_batch_num(args) + if os.environ.get('RUN_UNSCHEDULE') or should_input_run(telemetry_conf_service, batch_num): + process_input_params(telemetry_conf_service, args) + run_input({'start': args.start_date, 'stop': args.stop_date, 'batchNum': batch_num}) + else: + # indicate to caller that input wasn't executed + sys.exit(114) + + +# Script must implement these args: scheme, validate-arguments +main() + +sys.exit(0) diff --git a/apps/splunk_instrumentation/bin/makejson.py b/apps/splunk_instrumentation/bin/makejson.py new file mode 100755 index 00000000..51d375df --- /dev/null +++ b/apps/splunk_instrumentation/bin/makejson.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python +import sys +import json +import re +from distutils.util import strtobool +from splunk_instrumentation.splunklib.searchcommands import ( + StreamingCommand, + Configuration, + Option, + dispatch +) + +FIELD_NAME_REGEX = "[_a-zA-Z0-9\-\. ]*" +FIELDS_REGEX = '([_a-zA-Z0-9\-\. \*]+)((?i:\((json|string|int|float|bool)\)|\[(json|string|int|float|bool)?\]))?' +ERROR_INVALID_FIELD_NAME = "Invalid field name %s. Fields must be expressed in the format '" + FIELDS_REGEX + "'." +ERROR_FIELD_PATH_CONFLICT = "Can't create field %s due to conflict." + + +def convert_field(val, field_type, default=None): + try: + if field_type == STRING: + return val + elif field_type == INT: + return int(val) + elif field_type == FLOAT: + return float(val) + elif field_type == BOOL: + return bool(strtobool(val)) + elif field_type == JSON: + return json.loads(val) + else: + # auto detect type if none is specified, defaults to string + convert_val = convert_field(val, INT) + if convert_val is not None: + return convert_val + + convert_val = convert_field(val, FLOAT) + if convert_val is not None: + return convert_val + + return val + + except ValueError: # return default if forced conversion fails + return default + + +def convert_list(vals, field_type): + res = [] + for idx, val in enumerate(vals): + res.append(convert_field(val, field_type, default=val)) + return res + + +AUTO, JSON, INT, STRING, FLOAT, BOOL = ["AUTO", "JSON", "INT", "STRING", "FLOAT", "BOOL"] + + +@Configuration() +class MakeJsonCommand(StreamingCommand): + _validFields = [{ + "regex": re.compile(FIELD_NAME_REGEX), + "type": AUTO, + "forceArray": False + }] + + output = Option( + doc=""" + Name of field that contains the JSON output. + """, + require=True) + + def get_field_type(self, field): + for validField in self._validFields: + if validField["regex"].match(field): + return validField["type"], validField["forceArray"] + + return None, None + + def get_json(self, data): + res = {} + + for k, v in data.items(): + field_type, force_array = self.get_field_type(k) + if field_type: + dotpath = k.split(".") + + # Setup the correct amount of nested dicts based on the dot path + target = res + for segment in dotpath[:-1]: + target.setdefault(segment, {}) + target = target[segment] + + try: + if isinstance(v, list): + target[dotpath[-1]] = convert_list(v, field_type) + elif v is not None: + converted_val = convert_field(v, field_type, default=v) + target[dotpath[-1]] = [ + converted_val] if force_array else \ + converted_val + else: + target[dotpath[-1]] = None + + except TypeError: + raise Exception(ERROR_FIELD_PATH_CONFLICT % k) + return res + + def set_valid_fields(self): + errors = [] + self._validFields = [] + + for jsonField in self.fieldnames: + match = re.search("^" + FIELDS_REGEX + "$", jsonField) + + if match and match.group(1): + field_type = match.group(2) + + if field_type: + force_array = ( + field_type[:1] == "[") # force conversion to array + field_type = field_type[1:-1].upper() + if field_type == "": + field_type = AUTO + else: + force_array = False + field_type = AUTO + + regex_pattern = match.group(1).replace(".", "\\.") \ + .replace("*", FIELD_NAME_REGEX) + + self._validFields.append({ + "type": field_type, + "forceArray": force_array, + "regex": re.compile("^" + regex_pattern + "$") + + }) + + else: + errors.append(ERROR_INVALID_FIELD_NAME % jsonField) + + if len(self._validFields) == 0: + self._validFields.append({ + "regex": re.compile(FIELD_NAME_REGEX), + "type": AUTO, + "forceArray": False + }) + + return errors + + def prepare(self): + errors = self.set_valid_fields() + for error in errors: + self.write_error(error) + + if len(errors) > 0: + self.error_exit(Exception("Fieldname validation failed " + "for makejson command.")) + + def stream(self, results): + error_counts = {} + found_results = 0 + + for res in results: + found_results += 1 + try: + json_val = self.get_json(res) + res[self.output] = json.dumps(json_val) + except Exception as e: + if e.message in error_counts: + error_counts[e.message] += 1 + else: + error_counts[e.message] = 1 + + res[self.output] = "{}" + + yield res + + # report all errors + for err in error_counts: + if error_counts[err] > 0: + self.write_error( + err + " (" + str(error_counts[err]) + " of " + str( + found_results) + " events)") + + +dispatch(command_class=MakeJsonCommand, argv=sys.argv, module_name= __name__) diff --git a/apps/splunk_instrumentation/bin/on_splunk_start.py b/apps/splunk_instrumentation/bin/on_splunk_start.py new file mode 100755 index 00000000..9e7821c5 --- /dev/null +++ b/apps/splunk_instrumentation/bin/on_splunk_start.py @@ -0,0 +1,195 @@ +''' +Synopsis: + + splunk cmd python on_splunk_start.py + +Usage: + + Called on splunk start. Not intended to be called manually, except for testing. + +"Managed" Variable Sync Strategy: + + Managed variables like the deployment ID have complex lifecycles, and + require synchronization among multiple nodes in a splunk deployment. + This leads to their abstraction behind "manager" class interfaces. + + The strategy for syncing them is as follows: + + * On Splunk start (when this script is triggered): + ** Pull (or "sync") whatever value is at the cluster master, + overwriting any local value. + *** Since configuring clustering often requires a splunk restart, + this provides immediate sync up when clustering is enabled. + ** Call the getter for the managed value. + *** The getters are designed to generate a new value + if one does not yet exist (perhaps this is a new installation, + and there was no cluster master to read from). + + * On read (when the value is required to perform a task, or to create an event) + ** Only call the getter. + ** Typically, it is looked up in the conf file, and created anew if needed. + ** Special handling may apply, see the corresponding manager class. + ** If a new value is created, it *must* be passed to the telemetry endpoint + to be persisted. Only this endpoint ensures replication to the cluster master. + + * On nightly scripted input + ** Again, the value is pulled from the cluster master if possible + ** This ensures liveness in the system, such that disagreements about + these values can eventually be resolved by conforming to the choice + of a single node. Basically, each night, the last search head to + replicate a choice to the cluster master the prior day will have won, + and all search heads will agree. + ** In case there is no cluster master, it's usally a single instance, + or the existing conf file replication is relied upon for syncing + the managed values. +''' + +import sys +import time +import logging + +from splunk_instrumentation.splunkd import Splunkd +from splunk_instrumentation.service_bundle import ServiceBundle +from splunk_instrumentation.deployment_id_manager import DeploymentIdManager +import splunk_instrumentation.constants as constants +from splunk_instrumentation.salt_manager import SaltManager + +NAME = "InstrumentationInit" + +logger = logging.getLogger(NAME) + + +class OnSplunkStart(object): + + @staticmethod + def wait_for_kv_store_started(services): + ''' + Migration of the deployment ID from V1 of instrumentation + requires waiting until the KV store is ready. We'll give + it 5 minutes, then proceed without out. + ''' + + t_start = time.time() + status = services.server_info_service.content.get('kvStoreStatus') + + while status == 'starting' and (time.time() - t_start) < (5 * 60): + time.sleep(10) + services.server_info_service.fetch() + status = services.server_info_service.content.get('kvStoreStatus') + + @staticmethod + def initialize_salt(salt_manager): + ''' + Create a new telemetry salt for this deployment, if needed. + ''' + salt_manager.sync_with_cluster() + salt_manager.get_salt() + + @staticmethod + def initialize_deployment_id(services, deployment_id_manager): + ''' + Creates a new deployment ID for this deployment, if needed. + ''' + + deployment_id_manager.sync_deployment_id() + deployment_id = deployment_id_manager.get_deployment_id() + prefix = deployment_id_manager.get_deployment_id_prefix() + + # Ensure the correct prefix is set given the current product type + if prefix and not deployment_id.startswith(prefix + '-'): + stripped_deployment_id = deployment_id + for possible_prefix in [p + '-' for p in constants.DEPLOYMENT_ID_PREFIXES]: + if deployment_id.startswith(possible_prefix): + stripped_deployment_id = deployment_id[len(possible_prefix):] + break + + deployment_id_manager.set_deployment_id( + prefix + '-' + stripped_deployment_id) + + @staticmethod + def opt_in_for_cloud_instrumentation(services): + ''' + Configures cloud instance instrumentation settings + ''' + settings = {} + + current_opt_in_version = services.telemetry_conf_service.content.get('optInVersion') + swa_endpoint_url = '/splunkd/__raw/servicesNS/nobody/splunk_instrumentation/telemetry-metric' + + # Being explicit about all opt-ins. Licensing's default + # is changing to True for on-prem. Need to make sure it + # remains disabled for cloud. + settings.update({ + 'optInVersionAcknowledged': current_opt_in_version, + 'sendAnonymizedWebAnalytics': True, + 'sendAnonymizedUsage': True, + 'sendLicenseUsage': True, + 'onCloudInstance': True, + 'swaEndpoint': swa_endpoint_url + }) + + services.telemetry_conf_service.update(settings) + + @staticmethod + def migrate_licensing_opt_in_default(services): + ''' + Checks if the current opt-in values have been acknowledged + by the user. If not, they are the previous defaults, so we + can enable license data reporting as the new default. + + Note that we could not simply push a new default out in the + default/telemetry.conf file, since splunkd will not write + a value to local conf files if their value is the same as + the default value. This means we would have risked changing + explicit opt-outs to opt-ins without user permissions. + ''' + + # Check legacy showOptInModal field to see if a user has acked + # the licensing opt-in/opt-out. + + if services.telemetry_conf_service.content.get('showOptInModal') == '0': + return + + # Check the new optInVersionAcknowledged flag + + opt_in_version_acked = services.telemetry_conf_service.content.get('optInVersionAcknowledged') + if opt_in_version_acked is not None and int(opt_in_version_acked) != 0: + return + + services.telemetry_conf_service.update({'sendLicenseUsage': True}) + + +def main(services, + salt_manager, + deployment_id_manager, + OnSplunkStart): + + OnSplunkStart.wait_for_kv_store_started(services) + + OnSplunkStart.initialize_salt(salt_manager) + + OnSplunkStart.initialize_deployment_id(services, deployment_id_manager) + + if services.server_info_service.is_cloud(): + OnSplunkStart.opt_in_for_cloud_instrumentation(services) + else: + # Cloud should never opt-in for license sharing, + # so only apply the default on-prem + OnSplunkStart.migrate_licensing_opt_in_default(services) + + +if __name__ == '__main__': + try: + token = sys.stdin.read().rstrip() + splunkd = Splunkd(token=token, server_uri=constants.SPLUNKD_URI) + services = ServiceBundle(splunkd) + salt_manager = SaltManager(services) + deployment_id_manager = DeploymentIdManager( + services.splunkd, + telemetry_conf_service=services.telemetry_conf_service, + server_info_service=services.server_info_service + ) + main(services, salt_manager, deployment_id_manager, OnSplunkStart) + except Exception as e: + logger.error(e) + exit(0) diff --git a/apps/splunk_instrumentation/bin/output_telemetry.py b/apps/splunk_instrumentation/bin/output_telemetry.py new file mode 100755 index 00000000..282be5ec --- /dev/null +++ b/apps/splunk_instrumentation/bin/output_telemetry.py @@ -0,0 +1,218 @@ +#!/usr/bin/env python + +import sys +import json +from splunk_instrumentation.splunklib import binding +from splunk_instrumentation.splunklib.searchcommands import ( + ReportingCommand, + Configuration, + validators, + Option, + dispatch +) + +APP_NAME = "splunk_instrumentation" + +ERROR_INVALID_JSON = "Invalid JSON" + +ERROR_ENDPOINT_401 = "Authentication error" +ERROR_ENDPOINT_404 = "Endpoint missing" +ERROR_ENDPOINT_405 = "Wrong method" + +HTTP_ERRORS = { + 401: ERROR_ENDPOINT_401, + 404: ERROR_ENDPOINT_404, + 405: ERROR_ENDPOINT_405 +} + +TELEMETRY_REQUEST_RETRY_TIMES = 5 + +# The command should be used with all 3 of these options or none +options_combo = [ + "component", + "type", + "optinrequired" +] + +visibility_options = [ + "anonymous", + "license", + "support" +] + +# Global validator instances +BOOLEAN_VALIDATOR = validators.Boolean() +FIELDNAME_VALIDATOR = validators.Fieldname() +STRING_VALIDATOR = validators.Match("Valid string", "^[a-zA-Z0-9._\-]+$") +TYPE_VALIDATOR = validators.Match("event or aggregate", "event|aggregate") +OPTIN_VALIDATOR = validators.Integer(1) + + +@Configuration() +class OutputTelemetryCommand(ReportingCommand): + input = Option( + doc=''' + Name of field that contains telemetry endpoint payload. + ''', + require=True, validate=FIELDNAME_VALIDATOR + ) + optinrequired = Option( + doc=''' + Minimum version of opt-in required by customer (e.g. 1 for Ivory, 2 for Kimono, 3 for Minty) + ''', + require=False, validate=OPTIN_VALIDATOR + ) + type = Option( + doc=''' + Either "event" or "aggregate". + Aggregate data should be used for statistics aggregated over time, + whereas event data should be used for instantaneous data. + ''', + require=False, + validate=TYPE_VALIDATOR + ) + component = Option( + doc=''' + A name given to the data, to describe its content. + ''', + require=False + ) + anonymous = Option( + doc=''' + Whether or not data is categorized as Diagnostic. + ''', + require=False, validate=BOOLEAN_VALIDATOR + ) + license = Option( + doc=''' + Whether or not data is categorized as License Usage. + ''', + require=False, validate=BOOLEAN_VALIDATOR + ) + support = Option( + doc=''' + Whether or not data is categorized as Support Usage. + ''', + require=False, validate=BOOLEAN_VALIDATOR + ) + + def __init__(self): + super(OutputTelemetryCommand, self).__init__() + self.visibility_options = {} + self.options_combo = [] + + def prepare(self): + errors = [] + + # Do additional arg validation if explicit args are provided + self.visibility_options = {k: self.options[k].value for k in visibility_options if k in self.options + and self.options[k].value is not None} + self.options_combo = [o for o in options_combo if o in self.options and + self.options[o].value is not None] + + missing_options = [o for o in options_combo if o not in self.options_combo] + if 0 < len(missing_options) < len(options_combo): + errors.append("When specifying component, type, or" + " optinrequired, all options must be specified. Missing: " + + ','.join(missing_options) + '.') + + for err in errors: + self.write_error(err) + + # Don't try to execute the command if there are argument errors + if len(errors) > 0: + self.error_exit(ValueError("Argument validation failed " + "for outputtelemetry command.")) + + def reduce(self, results): + if self.input is None: + return + + error_counts = {} + found_results = 0 + + for result in results: + found_results += 1 + error = None + event_str = None + response = None + try: + event = json.loads(result[self.input]) + + if "data" not in event: + event = {"data": event} + + for opt in self.options_combo: + event[opt] = getattr(self, opt) + + # Fix up the casing for the endpoint + if "optinrequired" in event: + event["optInRequired"] = event["optinrequired"] + del event["optinrequired"] + + if len(self.visibility_options) > 0: + event["visibility"] = [k for k in self.visibility_options if self.visibility_options[k] is True] + + event_str = json.dumps(event) + response = self.make_telemetry_request(event_str) + + except ValueError: + error = ERROR_INVALID_JSON + except binding.HTTPError as http_error: + if http_error.status == 429: + response, error = self.retry_telemetry_request(error, event_str) + else: + error = self.format_error_message(http_error) + + if error is not None: + if error in error_counts: + error_counts[error] += 1 + else: + error_counts[error] = 1 + + yield { + "event": event_str, + "telemetry_response": + response.body.readall().decode("utf-8") if response is not None else "", + "telemetry_send_status": + error if error is not None else "submitted" + } + + for err , mes in error_counts.items(): + if error_counts[err] > 0: + self.write_error(err + " (" + str(error_counts[err]) + + " of " + str(found_results) + " events)") + + def retry_telemetry_request(self, error, event_str): + retry_count = TELEMETRY_REQUEST_RETRY_TIMES + while retry_count > 0: + try: + return self.make_telemetry_request(event_str), None + except binding.HTTPError as http_error: + if http_error.status == 429: + retry_count -= 1 + continue + else: + return None, http_error.message + return None, error + + def format_error_message(self, http_error): + if http_error.status in HTTP_ERRORS: + return HTTP_ERRORS[http_error.status] + if hasattr(http_error,'message'): + return http_error.message + return str(http_error) + + def make_telemetry_request(self, event_str): + return self.service.request( + "/servicesNS/" + self._metadata.searchinfo.owner + "/" + + self._metadata.searchinfo.app + "/telemetry-metric", + method="POST", + headers=[('Content-Type', 'application/json')], + body=event_str, + owner=self._metadata.searchinfo.owner, + app=self._metadata.searchinfo.app + ) + + +dispatch(OutputTelemetryCommand, sys.argv, sys.stdin, sys.stdout, __name__) diff --git a/apps/splunk_instrumentation/bin/schedule_delete.py b/apps/splunk_instrumentation/bin/schedule_delete.py new file mode 100755 index 00000000..a85b0cfe --- /dev/null +++ b/apps/splunk_instrumentation/bin/schedule_delete.py @@ -0,0 +1,41 @@ +import os +import sys +import json +import time +import splunk_instrumentation.constants as constants +PATH = os.sep.join([os.environ.get('SPLUNK_HOME'), 'var', 'run', 'diags']) + + +def list_files(): + return [file for file in os.listdir(PATH) if file.endswith('.json')] + + +def filter_files(jsonList): + for file in jsonList: + full_path = PATH + "/" + file + data = json.load(open(str(full_path))) + # if over 30 days, delete + if ((time.time() - data['timeCreated']) >= constants.MAX_DIAG_AGE): + delete_file(full_path) + return + + +def delete_file(path): + try: + os.remove(path.split('json')[0] + 'tar.gz') + os.remove(path) + finally: + return + + +def main(): + + try: + json_files = list_files() + filter_files(json_files) + finally: + return + + +main() +sys.exit(0) diff --git a/apps/splunk_instrumentation/bin/set_deployment_id.py b/apps/splunk_instrumentation/bin/set_deployment_id.py new file mode 100755 index 00000000..9b0c17bb --- /dev/null +++ b/apps/splunk_instrumentation/bin/set_deployment_id.py @@ -0,0 +1,31 @@ +''' +DEPRECATED + + This script was originally used to set the deployment ID for cloud instances. + + Now, all cloud configuration is handled in splunk_instrumentation/bin/on_splunk_start.py + + This file remains to support legacy cloud provisioning logic, but is now a no-op. + + The previous doc string follows below. + +Synopsis: + + splunk cmd python set_deployment_id.py -u SPLUNK_USER -p SPLUNK_PASSWORD --prefix PREFIX + +Description: + + Sets the deployment ID for the instrumentation app via CLI. Intended for + deployment automation purposes. + + Calls splunkd via the splunk-sdk, utilizing the same logic that generates + the deployment ID in splunkweb during instrumentation opt-in via the web UI. + +Expectations: + + SPLUNK_USER must have edit_telemetry_settings capability (the default for admin). +''' +from __future__ import print_function + +print("set_deployment_id.py - This script is deprecated. Please remove any dependencies on it.") +exit(0) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..d5d2d26e Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..d5d2d26e Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/client_eligibility.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/client_eligibility.cpython-39.pyc new file mode 100755 index 00000000..ca1001b7 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/client_eligibility.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/constants.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/constants.cpython-39.opt-1.pyc new file mode 100755 index 00000000..581994fe Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/constants.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/constants.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/constants.cpython-39.pyc new file mode 100755 index 00000000..4f07e803 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/constants.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/datetime_util.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/datetime_util.cpython-39.opt-1.pyc new file mode 100755 index 00000000..2543a105 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/datetime_util.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/datetime_util.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/datetime_util.cpython-39.pyc new file mode 100755 index 00000000..2543a105 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/datetime_util.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/deployment_id_manager.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/deployment_id_manager.cpython-39.opt-1.pyc new file mode 100755 index 00000000..d4247fc5 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/deployment_id_manager.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/deployment_id_manager.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/deployment_id_manager.cpython-39.pyc new file mode 100755 index 00000000..f6c641be Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/deployment_id_manager.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/input.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/input.cpython-39.pyc new file mode 100755 index 00000000..be9dc215 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/input.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/instrumentation_controller.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/instrumentation_controller.cpython-39.pyc new file mode 100755 index 00000000..777a1c7d Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/instrumentation_controller.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/report.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/report.cpython-39.opt-1.pyc new file mode 100755 index 00000000..18c323d6 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/report.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/report.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/report.cpython-39.pyc new file mode 100755 index 00000000..18c323d6 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/report.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/salt_manager.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/salt_manager.cpython-39.opt-1.pyc new file mode 100755 index 00000000..dc945e66 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/salt_manager.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/salt_manager.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/salt_manager.cpython-39.pyc new file mode 100755 index 00000000..dc945e66 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/salt_manager.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/schedule_manager.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/schedule_manager.cpython-39.pyc new file mode 100755 index 00000000..eb69c019 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/schedule_manager.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/server_info_service.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/server_info_service.cpython-39.opt-1.pyc new file mode 100755 index 00000000..01311dc1 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/server_info_service.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/server_info_service.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/server_info_service.cpython-39.pyc new file mode 100755 index 00000000..d877d02c Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/server_info_service.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/service_bundle.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/service_bundle.cpython-39.opt-1.pyc new file mode 100755 index 00000000..a1ac2a9e Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/service_bundle.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/service_bundle.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/service_bundle.cpython-39.pyc new file mode 100755 index 00000000..8d56a01b Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/service_bundle.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/swa_injection_tool.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/swa_injection_tool.cpython-39.opt-1.pyc new file mode 100755 index 00000000..77ad1e7e Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/swa_injection_tool.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/telemetry_conf_service.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/telemetry_conf_service.cpython-39.opt-1.pyc new file mode 100755 index 00000000..cf7cbb47 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/telemetry_conf_service.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/telemetry_conf_service.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/telemetry_conf_service.cpython-39.pyc new file mode 100755 index 00000000..2a7e1813 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/__pycache__/telemetry_conf_service.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/cli_token.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/cli_token.py new file mode 100755 index 00000000..03601ac3 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/cli_token.py @@ -0,0 +1,38 @@ +import subprocess + + +def get_existing_token(splunk_uri): + ''' + Returns an existing token for splunk_uri, or None if there + is no active session for the given uri. + ''' + token_proc = subprocess.Popen(('splunk _authtoken %s' % splunk_uri), + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + + (token_out, token_err) = token_proc.communicate() + + if token_proc.returncode != 0: + return None + else: + return token_out.strip() + + +def login(splunk_uri): + ''' + Prompts the user to login to the given splunk_uri. + ''' + subprocess.check_call(('splunk login -uri %s' % splunk_uri), shell=True) + + +def get_token(splunk_uri): + ''' + Get a token for the given splunk_uri, prompting + the user to login if required. + ''' + token = get_existing_token(splunk_uri) + if not token: + login(splunk_uri) + token = get_existing_token(splunk_uri) + return token diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/client_eligibility.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/client_eligibility.py new file mode 100755 index 00000000..5998c120 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/client_eligibility.py @@ -0,0 +1,324 @@ +''' +Methods for determining client (browser) eligibility. + +For reference, all server roles defined by ServerRoles.cpp are: + +- indexer +- universal_forwarder +- heavyweight_forwarder +- lightweight_forwarder +- license_master +- cluster_master +- cluster_slave +- cluster_search_head +- deployment_server +- deployment_client +- search_head +- search_peer +- kv_store +- management_console +- shc_captain +- shc_member +- shc_deployer + +This list may change. Refer to _predefinedRole_literals in +ServerRoles.cpp to be certain. +''' + + +import sys + +def get_eligibility(services, opt_in_version=None, username=None): + ''' + Gathers eligibility data describing the instrumentation actions that + the current server supports for the given user. + + IMPORTANT: Provided services should be configured with system access, + as we will be using them to read the distributed search config. + + Legacy Behavior (up to and including Splunk 7.0): + + This method returned a dict with 2 fields: + + - is_eligible + + Should the instrumentation UI be shown? + - reason + + Why not? + + This result was augmented in the instrumentation controller to take user + capabilities into account and returned to the caller (often the instrumentation + page, or some other page checking if it should show the opt-in modal). + + However, as the UI has grown more complex - integration diag UI and its + own visibility constraints - this proved to be inflexible. + + Current Behavior (as of Nightlight): + + To allow the UI to handle more complicated user capability and server + configuration scenarios, we've begun to include information about all + relevant checks in separate fields. To include: + + - messages + + May include warnings/errors to be displayed on the UI + - can_server_edit_telemetry_settings + + True for single instance and search heads + - can_server_get_diag + + True for single instance and search heads + - is_client_agreement_current + + Is the optInVersion given by the client up to date? + + This is used to reject clients that have yet updated + their code to reflect the most recent data sharing + terms. + - can_user_edit_telemetry_settings + + True if the requested user has edit_telemetry_settings + - can_user_get_diag + + True if the requested user has get_diag + - can_show_telemetry_ui + + True if telemetry settings related UI should be shown + + This includes the opt-in modal and the telemetry settings & report logs + on the instrumentation page (but not diag UI). + - can_show_diag_ui + + True if diag related UI should be shown + + Note: Though some of these fields are based on the same criteria now, they + are kept separate to allow them to vary independently in the future + without requiring client code changes. + + As some pages may still be compiled against outdated opt-in modals from Splunk + core, the legacy flags are still supported and retain their original meaning. + These can now be understood as: + + - is_eligible + + Should the telemetry-specific instrumentation UI be shown? + + Equivalent to new 'can_show_telemetry_ui' field + - reason + + Why not? + ''' + + result = { + 'messages': [], + + # Legacy fields + 'is_eligible': True, + 'reason': None, + + # Server eligibility fields + 'can_server_edit_telemetry_settings': True, + 'can_server_get_diag': True, + + # Client eligibility fields + 'is_client_agreement_current': True, + + # User eligibility fields + 'can_user_edit_telemetry_settings': True, + 'can_user_get_diag': True, + + # Summary fields + 'can_show_telemetry_ui': True, + 'can_show_diag_ui': True, + } + + if services.server_info_service.content.get('isFree', '0') == '1': + # Skip the following calls, as they will throw on free Splunk, + # and the checks they make are not required. + return result + + unsupported_server_msg = ( + 'Instrumentation settings are not accessible on this server. ' + 'Please access the settings from a search head.' + ) + if (not check_server_roles_for_eligibility( + services.server_info_service.content.get('server_roles'))): + result['can_server_edit_telemetry_settings'] = False + result['can_server_get_diag'] = False + if result['is_eligible']: + result['is_eligible'] = False + result['reason'] = unsupported_server_msg + + currentOptInVersion = services.telemetry_conf_service.content.get('optInVersion') + if opt_in_version != '*' and opt_in_version != currentOptInVersion: + result['is_client_agreement_current'] = False + if result['is_eligible']: + result['is_eligible'] = False + result['reason'] = 'The client does not support the current instrumentation agreement' + + # If we're not running on a free license (where there are no users), + # validate that the user has the requisite capabilities. + if services.server_info_service.content.get('isFree', '0') != '1' and username: + capabilities = ( + services.splunkd.get_json( + '/services/authentication/users/%s' % (username if sys.version_info >= (3, 0) else username.encode('utf-8')) + ) + ['entry'][0]['content']['capabilities'] + ) + if ('edit_telemetry_settings' not in capabilities): + result['can_user_edit_telemetry_settings'] = False + if result['is_eligible']: + result['is_eligible'] = False + result['reason'] = 'You do not have permissions to edit telemetry settings' + + if ('get_diag' not in capabilities): + result['can_user_get_diag'] = False + + if not check_peers_have_telemetry_index(services): + result['messages'].append({ + 'text': ('Some search peers are incompatible with instrumentation. ' + 'To use these features, ensure that all peers are running ' + 'Splunk Enterprise 6.5.0 or later.'), + 'type': 'warning' + }) + + # Only want to show the unsupported server message if + # the user would otherwise be able to access some + # functionality. + # Note: May need a separate message for each feature + # in the future, but at the moment the server + # requirements are the same for telemetry & + # diag, so we use one unified message. + if ( + (result['can_user_edit_telemetry_settings'] and + not result['can_server_edit_telemetry_settings']) + or + (result['can_user_get_diag'] and + not result['can_server_get_diag']) + ): + result['messages'].append({ + 'type': 'warning', + 'text': unsupported_server_msg + }) + + result['can_show_telemetry_ui'] = ( + result['can_user_edit_telemetry_settings'] and + result['can_server_edit_telemetry_settings'] and + result['is_client_agreement_current'] + ) + + result['can_show_diag_ui'] = ( + result['can_user_get_diag'] and + result['can_server_get_diag'] + ) + + return result + + +def check_server_roles_for_eligibility(server_roles): + ''' + Args: + - server_roles: A list of server roles (strings) + + Returns: + True or False, indicating whether this server type is supported + ''' + + roles = {} + for role in server_roles: + roles[role] = True + + # The whitelist determines what nodes are even considered + # for instrumentation eligibility. All nodes that contain + # any of these server roles will be considered (but may + # ultimately still be rejected based on the blacklist, etc.) + whitelist = [ + # Search heads are the typical place to access the UI. + 'search_head', + # Some search heads lack the search_head role and instead + # report as shc_member or shc_captain + 'shc_member', + 'shc_captain', + 'cluster_search_head', + # Have to whitelist indexer to cover single instance deployments. + # (A single instance is not a "search head" - search heads only + # exist when paired with separate indexers). + 'indexer' + ] + + # The blacklist immediately rejects servers that have any of + # the blacklisted roles. + blacklist = [ + # The cluster master does not propagate conf settings to the search + # heads, so we blacklist it for the UI to avoid inconsistent configurations + # in the cluster. + 'cluster_master', + # We've whitelisted indexers to handle the single instance case. + # However, in a distributed deployment you should only be configuring + # settings on the SH's (since they will propagate values correctly + # within the cluster), so we'll blacklist cluster_slaves to catch + # this case. + 'cluster_slave', + ] + + special_case_rejections = [ + # Any indexer that is a search peer is in a distributed environment. + # In a distributed environment, the instrumentation UI must be accessed + # by a search head. So we disable the UI if we see indexer and search_peer + # roles, without the search_head role. The explicit check for the search_head + # role was added to cover the DMC case, in which the search heads are themselves + # made search peers of the DMC node, but should still show the UI. + roles.get('indexer') and roles.get('search_peer') and not roles.get('search_head'), + + # Previously we always rejected the heavywieght forwarder via the blacklist. + # SPL-151920 revealed that the heavyweight_forwarder role is added to search + # heads when configuring forwarding from the UI until the next restart. This, + # due to some incongruency in how server roles are determined at runtime vs + # startup time (runtime sets hw/f when tcpouts are enabled, startup time apparently + # only checks for the SplunkForwarder app to be enabled). + # + # For details about the heavyweight_forwarder role assignment, see discussion + # in SPL-76190, or you may have luck with the following search in splunk main: + # + # git --no-pager grep -EHni 'declareServerRole.*heavy' -- '*.h' '*.cpp' + # + # In any case, the only search head that shouldn't show the instrumentation settings + # is the cluster master, which is covered by the blacklist, so here we go... + roles.get('heavyweight_forwarder') and not ( + roles.get('cluster_search_head') + or roles.get('search_head') + or roles.get('shc_captain') + or roles.get('shc_member') + ) + ] + + if (any((roles.get(role) for role in whitelist)) and + not any((roles.get(role) for role in blacklist)) and + not any(special_case_rejections)): + return True + return False + + +def check_peers_have_telemetry_index(services): + splunkd = services.splunkd + + dist_search_disabled = True + try: + dist_search_disabled = ( + splunkd.get_json('/services/search/distributed/config') + ['entry'][0]['content']['disabled'] + ) + except Exception: + # Proceed as if it's disabled if we can't hit the endpoint + pass + + if dist_search_disabled: + return True + + search_peers = splunkd.get_json('/services/search/distributed/peers')['entry'] + if search_peers: + for peer in search_peers: + if (peer['content']['status'].lower() == 'up' and + not peer['content']['disabled'] and + '_telemetry' not in peer['content']['searchable_indexes']): + return False + + return True + + +if __name__ == '__main__': + from splunk_instrumentation.splunkd import Splunkd + from splunk_instrumentation.service_bundle import ServiceBundle + from splunk_instrumentation.cli_token import get_token + + bundle = ServiceBundle(Splunkd(token=get_token('https://localhost:8089'))) + + from pprint import pprint + + pprint(get_eligibility(bundle, opt_in_version='*')) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/constants.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/constants.py new file mode 100755 index 00000000..e5f95863 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/constants.py @@ -0,0 +1,114 @@ +from __future__ import absolute_import +import random +import os +import sys +import json +import splunk.rest as rest +from splunk_instrumentation.datetime_util import utcNow + +LAST_READ_TIME_FILE = '.last_read' + +COLLECTION_NAME = "instrumentation" +INSTRUMENTATION_SOURCETYPE = 'splunk_telemetry' +INSTRUMENTATION_INDEX_NAME = '_telemetry' +INTROSPECTION_INDEX_NAME = '_introspection' +AUDIT_INDEX_NAME = '_telemetry' +AUDIT_SOURCETYPE = "splunk_telemetry_log" + +INST_PRE_EXECUTE_SLEEP = 60 + +INST_VERSION = 1 + +DEPLOYMENT_ID_PREFIXES = ['CLOUD', 'CLOUDLIGHT'] + +# QUICKDRAW_URL is the QUICKDRAW_URL to hit +# DEFAULT_QUICKDRAW is the default url returned if we request QUICKDRAW_URL +DEFAULT_QUICKDRAW = {"url": "https://e1345286.api.splkmobile.com/1.0/e1345286"} +if os.environ.get('DEFAULT_QUICKDRAW'): + DEFAULT_QUICKDRAW = {"url": os.environ.get('DEFAULT_QUICKDRAW')} +QUICKDRAW_URL = os.environ.get('QUICKDRAW_URL') or "https://quickdraw.splunk.com/telemetry/destination" +INST_DEBUG_LEVEL = os.environ.get('INST_DEBUG_LEVEL') or "ERROR" + +INST_MODE = os.environ.get('INST_MODE') or "INPUT" +INST_NO_COLLECT = os.environ.get('INST_NO_COLLECT') or False +INST_NO_SEND = os.environ.get('INST_NO_SEND') or False +INST_COLLECT_DATE = os.environ.get('INST_COLLECT_DATE') or False +INST_SCHEMA_FILE = os.environ.get('INST_SCHEMA_FILE') or os.path.dirname(os.path.realpath(__file__)) + '/schema.json' +INST_EXECUTION_ID = os.environ.get('INST_EXECUTION_ID') or "".join(random.choice('0123456789ABCDEF') for i in range(30)) +INST_EXECUTION_START_TIME = utcNow() +INST_KV_OWNER = "nobody" + +INST_APP_NAME = "splunk_instrumentation" + +INST_PROFILE_OWNER = "nobody" +INST_PROFILE_APP = "splunk_instrumentation" + +INST_LICENSE_TYPES = ['anonymous', 'license'] + +SPLUNKD_URI = rest.makeSplunkdUri() +SPLUNKRC = {"token": os.environ.get('INST_TOKEN') or None, + "server_uri": os.environ.get('INST_SERVER_URI') or SPLUNKD_URI + } + +VISIBILITY_FIELDS_BY_NAME = { + "license": "sendLicenseUsage", + "anonymous": "sendAnonymizedUsage", + "support": "sendSupportUsage" +} + +VISIBILITY_CONF_FIELDS = [ + 'sendLicenseUsage', + 'sendAnonymizedUsage', + 'sendSupportUsage' +] + +CLUSTER_MASTER_REQUIRED_CONF_FIELDS = VISIBILITY_CONF_FIELDS + ['deploymentID', 'swaEndpoint', + 'telemetrySalt', 'scheduledDay', + 'scheduledHour', 'reportStartDate'] + +MAX_DIAG_AGE = 86400 * 30 + +ENDPOINTS = { + 'APP_INFO': { + 'INFO': 'telemetry/general', + 'READONLY_INFO': 'configs/conf-telemetry/general', + 'RETRY': 'telemetry/general/retryEdit' + }, + 'SERVER_INFO': 'server/info', + 'KV_STORE': { + 'DEPLOYMENT_ID': 'storage/collections/data/instrumentation/instrumentation_deploymentID' + }, + 'MASTER_SETTINGS': 'telemetry/general/masterSettings', + "DIAG_ENDPOINT": 'diag', + "DIAG_STATUS": 'diag/status' +} + +DIAG_STATUS_MSG = { + 'SUCCESS': 'Succeeded', + 'NOT_EXIST': 'Does not exist', + 'FAIL': 'Failed', + 'PROGRESS': 'In progress' +} +# Adds our bin directory to the path, it should be on there anyway, but no harm... +path = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + '/../') +sys.path.append(path) + +#scripted input [instrumentation.py] specific configs for executing savedsearches in batches +BATCHES_PER_HOUR = 6 +BATCHES_MAX_SIZE = 12 +DEFAULT_BATCH_NUM = 0 # must be between [0, BATCHES_MAX_SIZE) + +# loads dev setup +if INST_MODE == "DEV": + if not os.environ.get("SPLUNK_DB"): + os.environ['SPLUNK_DB'] = os.path.join(os.environ.get('SPLUNK_HOME') + 'var', 'lib', 'splunk') + INST_PRE_EXECUTE_SLEEP = 1 + if os.environ.get("SPLUNK_USERNAME"): + SPLUNKRC = { + "username": os.environ.get("SPLUNK_USERNAME"), + "password": os.environ.get("SPLUNK_PASSWORD") + } + elif not os.environ.get('INST_KEY'): + rc_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'splunkrc.json') + SPLUNKRC = json.loads(open(rc_file, 'r').read()) + diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..b571aba9 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..b571aba9 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/data_point.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/data_point.cpython-39.opt-1.pyc new file mode 100755 index 00000000..bac52003 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/data_point.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/data_point.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/data_point.cpython-39.pyc new file mode 100755 index 00000000..bac52003 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/data_point.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/report_data_point.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/report_data_point.cpython-39.opt-1.pyc new file mode 100755 index 00000000..dbe61b5e Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/report_data_point.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/report_data_point.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/report_data_point.cpython-39.pyc new file mode 100755 index 00000000..dbe61b5e Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/report_data_point.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/spl_data_point.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/spl_data_point.cpython-39.opt-1.pyc new file mode 100755 index 00000000..518bd600 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/spl_data_point.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/spl_data_point.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/spl_data_point.cpython-39.pyc new file mode 100755 index 00000000..3e0f3916 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/__pycache__/spl_data_point.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/data_point.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/data_point.py new file mode 100755 index 00000000..55443133 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/data_point.py @@ -0,0 +1,24 @@ + +dataPointClasses = [] + + +def dataPointFactory(dataPointSchema, options={}): + for dataPointClass in dataPointClasses: + if dataPointClass.__name__ == dataPointSchema.type: + return dataPointClass(dataPointSchema, options) + return False + + +def registerDataPoint(dataPointClass): + for dataPointClassOther in dataPointClasses: + if dataPointClass.__name__ == dataPointClassOther.__name__: + return + dataPointClasses.append(dataPointClass) + + +class DataPoint(object): + + def __init__(self, dataPointSchema, options={}): + self.dataPointSchema = dataPointSchema + self.options = options or {} + super(DataPoint, self).__init__() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/mock_data_point.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/mock_data_point.py new file mode 100755 index 00000000..3d801c7d --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/mock_data_point.py @@ -0,0 +1,14 @@ +from __future__ import absolute_import +from splunk_instrumentation.dataPoints.data_point import DataPoint +from splunk_instrumentation.dataPoints.data_point import registerDataPoint + + +class MockDataPoint(DataPoint): + def __init__(self, dataPointSchema, options={}): + super(MockDataPoint, self).__init__(dataPointSchema, options) + + def collect(self): + return self.dataPointSchema.dataPointSchema['results'] + + +registerDataPoint(MockDataPoint) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/report_data_point.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/report_data_point.py new file mode 100755 index 00000000..bc4fdaec --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/report_data_point.py @@ -0,0 +1,50 @@ +from __future__ import absolute_import +from splunk_instrumentation.dataPoints.data_point import DataPoint +from splunk_instrumentation.dataPoints.data_point import registerDataPoint +from splunk_instrumentation.datetime_util import localNow +from splunk_instrumentation.report import report + + +class ReportDataPoint(DataPoint): + def __init__(self, dataPointSchema, options={}): + super(ReportDataPoint, self).__init__(dataPointSchema, options) + + def collect(self, dateRange): + ''' + :param dateRange: dict("start" : date , "stop" : date) + :return: + ''' + + def nested_set(dic, path, value): + array_test = path.split("[") + array_test = len(array_test) == 2 + keys = path.split(".") + for key in keys[:-1]: + dic = dic.setdefault(key, {}) + + if array_test: + dic.setdefault(keys[-1], []) + dic[keys[-1]].append(value) + else: + dic[keys[-1]] = value + + mappings = self.dataPointSchema.dataPointSchema.get('mapping') + results = {} + + for mapping in mappings: + path = mapping.get('path') + report_path = mapping.get('report_path') + if report_path: + data = report.get(report_path) + date_value = mapping.get('date_value') + if date_value: + data = localNow().strftime(date_value) + + nested_set(results, path, data) + + eventList = [{"data": results}] + + return eventList + + +registerDataPoint(ReportDataPoint) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/spl_data_point.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/spl_data_point.py new file mode 100755 index 00000000..866fc191 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/dataPoints/spl_data_point.py @@ -0,0 +1,44 @@ +from __future__ import absolute_import +from splunk_instrumentation.dataPoints.data_point import DataPoint +from splunk_instrumentation.dataPoints.data_point import registerDataPoint +from datetime import datetime, date, time +from splunk_instrumentation.indexing.instrumentation_index import InstrumentationIndex +from splunk_instrumentation.datetime_util import date_to_timestamp_str, local + + +class SPLDataPoint(DataPoint): + def __init__(self, dataPointSchema, options={}): + super(SPLDataPoint, self).__init__(dataPointSchema, options) + + def collect(self, dateRange): + ''' + :param dateRange: dict("start" : date , "stop" : date) + :return: + ''' + + saved_search = self.dataPointSchema.dataPointSchema.get('saved_search') + spl = self.dataPointSchema.dataPointSchema.get('spl') + if saved_search: + spl = ' '.join(['|', 'savedsearch', saved_search]) + + splunkrc = self.options.get('splunkrc') + instrumentationIndex = InstrumentationIndex(splunkrc=splunkrc) + + kwargs = { + "earliest_time": dateRange['start'], + "latest_time": dateRange['stop'] + } + + if isinstance(kwargs['earliest_time'], date): + kwargs['earliest_time'] = date_to_timestamp_str( + datetime.combine(kwargs['earliest_time'], time.min).replace(tzinfo=local)) + if isinstance(kwargs['latest_time'], date): + kwargs['latest_time'] = date_to_timestamp_str( + datetime.combine(kwargs['latest_time'], time.max).replace(tzinfo=local)) + + events = instrumentationIndex.query_runner.search(spl, **kwargs) + + return events + + +registerDataPoint(SPLDataPoint) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/datetime_util.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/datetime_util.py new file mode 100755 index 00000000..76f20c46 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/datetime_util.py @@ -0,0 +1,147 @@ +from datetime import datetime, date, tzinfo, timedelta +import time as _time +import calendar + +''' +All datetimes are saved as utc time the calls is utc + +ex: datetime.utcnow().replace(tzinfo=utc) + +The catch is that all dates are based on local time. The reasoning is daily reports are done as a local report. But +having datetime in UTC there is no confusion between machines +''' + +ZERO = timedelta(0) +HOUR = timedelta(hours=1) + + +# A UTC class. +class UTC(tzinfo): + """UTC""" + + def utcoffset(self, dt): + return ZERO + + def tzname(self, dt): + return "UTC" + + def dst(self, dt): + return ZERO + + +utc = UTC() + +# A class capturing the platform's idea of local time. +STDOFFSET = timedelta(seconds=-_time.timezone) +if _time.daylight: + DSTOFFSET = timedelta(seconds=-_time.altzone) +else: + DSTOFFSET = STDOFFSET + +DSTDIFF = DSTOFFSET - STDOFFSET + + +class LocalTimezone(tzinfo): + def utcoffset(self, dt): + if self._isdst(dt): + return DSTOFFSET + else: + return STDOFFSET + + def dst(self, dt): + if self._isdst(dt): + return DSTDIFF + else: + return ZERO + + def tzname(self, dt): + return _time.tzname[self._isdst(dt)] + + def _isdst(self, dt): + tt = (dt.year, dt.month, dt.day, + dt.hour, dt.minute, dt.second, + dt.weekday(), 0, 0) + stamp = _time.mktime(tt) + tt = _time.localtime(stamp) + return tt.tm_isdst > 0 + + +local = LocalTimezone() + + +def date_to_timestamp(dateObj): + ''' + takes different time formats and returns a utc timestamp in seconds as integer + ''' + # convert datetime to utc time + if isinstance(dateObj, datetime): + if not dateObj.tzinfo: + dateObj = dateObj.replace(tzinfo=utc) + return int(calendar.timegm(dateObj.astimezone(utc).timetuple())) + # convert date to midnight local time + if isinstance(dateObj, date): + dateObj = datetime.combine(dateObj, datetime.min.time()).replace(tzinfo=local) + return int(calendar.timegm(dateObj.astimezone(utc).timetuple())) + + # floating point and int is assumed to be UTC + if isinstance(dateObj, float): + return int(float(dateObj)) + if isinstance(dateObj, int): + return int(dateObj) + + return 0 + + +def datetime_to_date(dateObj): + result = dateObj.astimezone(local) + return result.date() + + +def date_to_datetime(dateObj): + result = date_to_timestamp(dateObj) + return datetime.utcfromtimestamp(result).replace(tzinfo=utc) + + +def date_to_timestamp_str(dateObj): + return "%d" % date_to_timestamp(dateObj) + + +def localNow(): + return datetime.now(local) + + +def utcNow(): + return datetime.utcnow().replace(tzinfo=utc) + + +def get_time(): + return _time.gmtime() + + +def local_date_to_utc(date, time): + return datetime.combine(date, time).replace(tzinfo=local).astimezone(utc) + + +# date is always based on local machine timezone +def today(): + return date.today() + + +def str_to_date(string): + ''' + Expects a YYYY-MM-DD string, returns a date object. + ''' + return date(*[int(x) for x in string.split('-')]) + + +def json_serial(obj): + """JSON serializer for objects not serializable by default json code""" + + if isinstance(obj, date): + serial = obj.isoformat() + return serial + if isinstance(obj, datetime): + serial = obj.isoformat() + return serial + + raise TypeError("Type not serializable") diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/deployment_id_manager.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/deployment_id_manager.py new file mode 100755 index 00000000..3975fc9a --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/deployment_id_manager.py @@ -0,0 +1,195 @@ +import json +import uuid +import splunk_instrumentation.constants as constants +from splunk_instrumentation.service_bundle import ServiceBundle +import splunk_instrumentation.splunklib as splunklib +from splunk_instrumentation.splunklib.data import Record + + +class DeploymentIdManager(object): + ''' + Manages the initialization and retrieval of the deployment ID. + + Historical Note: The deployment ID was originally stored in the KV + store. This approach was abandoned due to stability and availability + concerns of the KV store. This class handles detecting existing + deployment ID settings in the KV store and migrates it to telemetry.conf. + The conf file approach should be more reliable than the KV store (since + conf files are available on all splunk product types, cannot be disabled + by the user, and do not rely on an external mongo process). + ''' + + # Randomly generated namespace to use when generating uuids + instrumentationUuidNamespace = uuid.UUID('6622c08d-93f1-4af0-bb9a-c58580975285') + + # The deployment ID for this splunk deployment + deployment_id = None + + def __init__(self, + splunkd, + services=None, + telemetry_conf_service=None, + server_info_service=None): + + self.services = services or ServiceBundle( + splunkd, + telemetry_conf_service=telemetry_conf_service, + server_info_service=server_info_service) + + self.splunkd = self.services.splunkd + self.telemetry_conf_service = self.services.telemetry_conf_service + self.server_info_service = self.services.server_info_service + self._kv_store_deployment_id = None + self._prefix = None + + def get_deployment_id(self, no_create=False): + """ + Gets the deployment ID for this splunk instance. + + If no deployment ID is known yet, the behavior depends + on the TelemetryConfService used to instantiate this object. + - If the TelemetryConfService is read only, `None` is returned. + - If the TelemetryConfService is writable, any deployment ID in + the KV store is migrated to the conf file, or a new one is + generated and written to the conf file. + """ + + if self.deployment_id is not None: + return self.deployment_id + + self.deployment_id = self.telemetry_conf_service.content.get('deploymentID') + deployment_id_is_in_conf_file = self.deployment_id is not None + + can_write_conf_file = not self.telemetry_conf_service.is_read_only + + # Check the KV store for an existing ID + if not self.deployment_id and self.kv_store_is_available(): + if self.has_deployment_id_in_kv_store(): + self.deployment_id = self.kv_store_deployment_id + + # We can't write to the conf file, so we don't want to generate a new + # deployment ID either. (Since we can't persist it, it would be a one-time- + # only deployment ID.) Instead, we'll just return what we have, which will + # be either `None`, or the deployment ID from the KV store. + if not can_write_conf_file or no_create: + # May still be `None`! + return self.deployment_id + + # Create ID on demand if none yet exists + if self.deployment_id is None: + self.generate_new_deployment_id() + + if not deployment_id_is_in_conf_file and can_write_conf_file: + self.write_deployment_id_to_conf_file() + + return self.deployment_id + + def sync_deployment_id(self): + ''' + Get deployment id from cluster master + ''' + + # If we can't persist the value to the conf file, + # let's not bother trying to fetch it from the cluster master[s], + # or else we'll end up going back to the cluster master every time + # we need to look it up. Considering that this lookup may happen + # more than once per page load, the performance impact could be + # significant. + if self.telemetry_conf_service.is_read_only: + return + + try: + resp = self.splunkd.request( + constants.ENDPOINTS['MASTER_SETTINGS'], + method='GET', + owner='nobody', + app=constants.INST_APP_NAME) + data = splunklib.data.load(resp.get('body').read()) + entry = data['feed'].get('entry') + if entry: + if type(entry) is list: + deploymentList = [value['content'].get('deploymentID') for value in entry] + if deploymentList: + deploymentList.sort() + self.deployment_id = deploymentList[0] + elif type(entry) is Record: + self.deployment_id = entry['content'].get('deploymentID') + + if self.deployment_id: + self.write_deployment_id_to_conf_file() + except Exception: + # Cluster master sync is best-effort only + pass + + def generate_new_deployment_id(self): + ''' + Generates a new deployment id and saves it to self.deployment_id + ''' + prefix = self.get_deployment_id_prefix() + self.deployment_id = str(uuid.uuid5(self.instrumentationUuidNamespace, + self.server_info_service.content.get('master_guid'))) + if prefix: + self.deployment_id = prefix + '-' + self.deployment_id + + def get_deployment_id_prefix(self): + ''' + Determines the correct deployment ID prefix for this deployment. + ''' + if self._prefix: + return self._prefix + + prefix = None + if self.server_info_service.is_cloud(): + prefix = 'CLOUD' + if self.server_info_service.is_lite(): + prefix += 'LIGHT' + + self._prefix = prefix + return self._prefix + + def kv_store_is_available(self): + ''' + Returns true if the kv store status is reported as "ready" + ''' + return self.server_info_service.content.get('kvStoreStatus') == 'ready' + + def has_deployment_id_in_kv_store(self): + ''' + Returns True if the KV store has an entry for the deployment ID. + ''' + return self.kv_store_deployment_id is not None + + def set_deployment_id(self, deployment_id): + ''' + Explicitly sets the deployment ID. + ''' + self.deployment_id = deployment_id + self.write_deployment_id_to_conf_file() + + def write_deployment_id_to_conf_file(self): + ''' + Writes self.deployment_id to the telemetry conf file. + ''' + self.telemetry_conf_service.update({ + 'deploymentID': self.deployment_id + }) + self.telemetry_conf_service.fetch() + self.deployment_id = self.telemetry_conf_service.content.get('deploymentID') + + @property + def kv_store_deployment_id(self): + ''' + Returns the KV store + ''' + try: + if not self._kv_store_deployment_id: + resp = self.splunkd.get( + constants.ENDPOINTS['KV_STORE']['DEPLOYMENT_ID'], + owner=constants.INST_KV_OWNER, + app=constants.INST_APP_NAME) + field_descriptor = json.loads(resp['body'].read()) + self._kv_store_deployment_id = field_descriptor['value'] + + return self._kv_store_deployment_id + except Exception: + return None diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/deployment_node_list.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/deployment_node_list.py new file mode 100755 index 00000000..cabd2bed --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/deployment_node_list.py @@ -0,0 +1,260 @@ +import re +import splunk_instrumentation.constants as constants + + +def host_from_uri(uri): + match = re.findall(r'https?://([^:/]+)', uri) + if match: + return match[0] + return None + + +def make_node(host, uri, roles, auth_method): + return { + 'host': host, + 'uri': uri, + 'roles': roles, + 'authMethod': auth_method + } + + +class NodeList(object): + """ + Collecting the list of nodes in a deployment + """ + + def __init__(self, service, server_uri=constants.SPLUNKD_URI): + self.nodes = [] + self.err_msgs = [] + self.service = service + self.server_uri = server_uri + + def get_server_roles(self): + return self.service.get_json('/services/server/info')['entry'][0]['content']['server_roles'] + + def get_server_conf_cluster_master_uris(self): + """ + This method is used to read cluster master stanzas from server.conf . + :return: the cluster master uris from server.conf cm stanzas if there is one or more, [] otherwise + """ + cm_uris = [] + server_conf_dict = {} + server_conf_resp = self.service.get_json('/services/configs/conf-server') + + # Add all stanzas in server conf to a dict for later use + for stanza in server_conf_resp['entry']: + server_conf_dict[stanza['name']] = stanza + + if 'clustering' in server_conf_dict: + # Bug SPL-203589, telemetry info is incorrect when search head has 2 indexer cluster connected + # /services/configs/conf-server changed, we need parse the CM info from the new field + key_in_content = 'master_uri' + if not key_in_content in server_conf_dict['clustering']['content'] or not server_conf_dict['clustering']['content'][key_in_content]: + key_in_content = 'manager_uri' + cm_stanza_names = server_conf_dict['clustering']['content'][key_in_content].split(',') + + if isinstance(cm_stanza_names, list) and len(cm_stanza_names) > 0: + for stanza_name in cm_stanza_names: + if stanza_name in server_conf_dict: + cm_uris.append(server_conf_dict[stanza_name]['content'][key_in_content]) + + return cm_uris + + def is_search_head(self): + return 'search_head' in self.get_server_roles() + + def is_shc_enabled(self): + try: + shc_config = self.service.get_json('/services/shcluster/config') + return not shc_config['entry'][0]['content']['disabled'] + except Exception: + # May fail if user doesn't have list_search_head_clustering capabilty + return False + + def append_self(self): + """ + Adds the local node to the node list result + """ + if self.is_search_head(): + role = 'search head' + else: + role = 'single instance' + + self.nodes.append(make_node(host=host_from_uri(self.server_uri), + uri=self.server_uri, + roles=[role], + auth_method=role)) + + def append_shc_members(self): + """ + Adds SHC members to the node list result + """ + try: + shc_member_entries = self.service.get_json('/services/shcluster/member/members', count=-1)['entry'] + + # print SHC_members_info + for member in shc_member_entries: + roles = ['SHC member'] + if member['content']['is_captain']: + roles.append('SHC captain') + uri = member['content']['mgmt_uri'] + self.nodes.append(make_node(host=host_from_uri(uri), + uri=uri, + roles=roles, + auth_method='search head')) + except Exception: + self.err_msgs.append('Could not locate any search head cluster members in this deployment') + + def append_cluster_master(self): + """ + Adds cluster master to the node list result. + """ + try: + cluster_master_info = self.service.get_json('/services/cluster/config')['entry'][0]['content'] + + if cluster_master_info['disabled']: + return None + + def append_nodes(host_uri): + self.nodes.append(make_node(host=host_from_uri(host_uri), + uri=host_uri, + roles=['cluster master'], + auth_method='cluster master')) + + # If there is more than 1 CM, this output is a '?', so check if valid uri + if re.match(r'https?://[^:/]+', cluster_master_info['master_uri']): + uri = cluster_master_info['master_uri'] + append_nodes(uri) + else: + # Fetch cm uri's from server.conf + cluster_master_uris = self.get_server_conf_cluster_master_uris() + + if cluster_master_uris: + for uri in cluster_master_uris: + append_nodes(uri) + + except Exception: + self.err_msgs.append('Failed to locate a Cluster Master in this deployment') + + def append_search_peers(self): + """ + Adds search peers to the node list result + """ + try: + search_peer_entries = self.service.get_json('/services/search/distributed/peers', count=-1)['entry'] + for peer in search_peer_entries: + + uri = "{scheme}://{host_port}".format( + scheme=('https' if peer['content']['is_https'] else 'http'), + host_port=peer['name'] + ) + roles = [] + for role in peer['content']['server_roles']: + clean_role_name = role.replace('_', ' ') + roles.append(clean_role_name) + + if not roles: + roles = ['indexer'] + + host = peer['content']['host'] + if not host: + host = host_from_uri(uri) or uri + + self.nodes.append(make_node(host=host, + uri=uri, + roles=roles, + auth_method='indexer')) + except Exception: + self.err_msgs.append('Failed to locate any search peers/indexers in this deployment') + + # # MVP does not support license master + # def append_license_master(self): + # try: + # license_master_info = self.service.get('/services/licenser/localslave', output_mode='json') + # uri = json.loads(license_master_info.get('body').read())['entry'][0]['content']['master_uri'] + # license_master = {'host': re.findall(r'https?://([^:/]+)', uri)[0], + # 'uri': uri, + # 'roles': ['license master'], + # auth_token: 'license master'} + # self.nodes.append(license_master) + # except Exception as ex: + # self.err_msgs.append('Failed to locate a License Master in this deployment') + + def fetch_nodes(self): + """ + Gets the License master, SHC Captain, SHC members, Cluster master and + indexers/search peers + :return: dictionary containing the list of nodes in a deployment + """ + + self.nodes = [] + self.err_msgs = [] + + # Get the search heads + if self.is_shc_enabled(): + self.append_shc_members() + elif self.is_search_head(): + self.append_self() + + # Get the Cluster Master + self.append_cluster_master() + + # Get the search peers or indexers + self.append_search_peers() + + if len(self.nodes) == 0: + self.append_self() + + return {'nodes': self.nodes, 'errors': self.err_msgs} + + +if __name__ == '__main__': + ''' + This file can be run as a standalone CLI script for debugging. + + There are a few reasons you might do this: + + - To quickly iterate on the endpoint when the target splunk is + on a remote host. + + - To easily use printf/pdb/ipdb for debugging local or remote + splunks, without having to jump through hoops to setup a remote + debugger connection to the endpoint process that splunkd + spawns, or redirect error logs, etc. + + Usage: + + # CD to ensure python load path is setup correctly + cd path/to/app_splunk_instrumentation/splunk_instrumentation/bin + + # Use splunk's python so the splunk libs are on the load path too + splunk cmd python -m splunk_instrumentation.deployment_node_list + + # Alternatively, with a remote splunk + splunk cmd python -m splunk_instrumentation.deployment_node_list https://remote_splunk:8089 + + Example: + + $ splunk cmd python -m splunk_instrumentation.deployment_node_list + {'errors': ['Could not locate any search head cluster members in this deployment', + 'Failed to locate a Cluster Master in this deployment'], + 'nodes': [{'authMethod': 'indexer', + 'host': u'9ac296fad4e8', + 'roles': [u'indexer', u'license_master', u'search_peer'], + 'uri': 'https://localhost:8090'}]} + ''' + + import sys + from splunk_instrumentation.splunkd import Splunkd + from splunk_instrumentation.cli_token import get_token + from pprint import pprint + + if len(sys.argv) > 1: + splunk_uri = sys.argv[1] + else: + splunk_uri = 'https://localhost:8089' + + service = Splunkd(server_uri=splunk_uri, token=get_token(splunk_uri)) + + node_list = NodeList(service) + pprint(node_list.fetch_nodes()) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/__init__.py new file mode 100755 index 00000000..74d8ab18 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/__init__.py @@ -0,0 +1,9 @@ +import uuid + + +def make_uuid(): + """ + Makes a UUID that's consistent with the splunkd diag endpoints, + which enforce capitalization as well as UUID format. + """ + return str(uuid.uuid4()).upper() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/batch_runner.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/batch_runner.py new file mode 100755 index 00000000..23ae077b --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/batch_runner.py @@ -0,0 +1,143 @@ +import time +import sys +if sys.version_info >= (3, 0): + from queue import Queue +else: + from Queue import Queue + +from threading import Thread +from splunk_instrumentation.diag import make_uuid + + +class Task(object): + """ + is the base class for all task that need running + """ + + def run(self): + """ + to be overridden by new class + :return: {} + """ + return {} + + def get_id(self): + """ + all running task require an ID + :return: str + """ + if not hasattr(self, 'task_id'): + self.task_id = make_uuid() + return self.task_id + + def to_dict(self): + """ + used for logging meta data + :return: + """ + return {} + + +class BatchRunner(object): + """ + + BatchRunner will run Task in parallel threads + + example + + class MyTask(Task): + def run(): + print "running" + + batch = BatchRunner() + + batch.add_task(new MyTask()) + batch.add_task(new MyTask()) + + batch.run() + + + """ + + def __init__(self, config={}, limit=3): + """ + + :param config: object to be passed to the task object + :param limit: max concurrent threads + """ + self.limit = limit + self.task_queue = Queue() + self.config = config + self.batch_id = make_uuid() + + def get_batch_id(self): + """ + the unique ID for the patch process + :return: str + """ + return self.batch_id + + def to_dict(self): + """ + used for logging meta data + :return: + """ + return self.config + + def work_thread(self): + """ + grabs the next task to run and runs the task + then marks it as done. + + Will loop until queue is empty + + This method is ran in it's own thread + + """ + while not self.task_queue.empty(): + task = self.task_queue.get() + + try: + task.run() + except Exception: + # Don't kill the worker thread + # just because a single task barfed + pass + + self.task_queue.task_done() + + def add_task(self, task): + """ + adds a Task instance to the queue + + :param task: + :return: + """ + self.task_queue.put(task) + + def run(self): + """ + this is the main entry point to start a batch + + logs all items in the queue as "queued" + + calls spawn thread to start batch + + returns after all tasks are ran + + """ + self.spawn_threads() + + self.task_queue.join() + + def spawn_threads(self): + """ + creates threads. Will create threads up to self.limit + + each thread will start by running work_thread + """ + for x in range(self.limit): + worker = Thread(target=self.work_thread, args=()) + worker.daemon = True + time.sleep(1) # this is arbitrary wait just so that there is not three request at the same time + worker.start() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_main.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_main.py new file mode 100755 index 00000000..4d5cd33e --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_main.py @@ -0,0 +1,35 @@ +#!/usr/bin/python +import os +import sys +import json + +"""Spawn multiple workers and wait for them to complete""" + +path = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), + '..', '..', '..', 'bin')) +sys.path.append(path) +from splunk_instrumentation.diag.batch_runner import BatchRunner # noqa +from splunk_instrumentation.diag.diag_task import DiagTask # noqa +from splunk_instrumentation.splunkd import Splunkd # noqa +from splunk_instrumentation.diag.diag_service import DiagService # noqa + + +configurationStr = sys.stdin.read() + +configuration = json.loads(configurationStr) + +splunkd = Splunkd(token=configuration['token'], server_uri=configuration['server_uri']) + +diag_service = DiagService(splunkd) + +batchRunner = BatchRunner(config=configuration['payload']) +diag_service.batch_id = batchRunner.batch_id + +for config in configuration['payload']['nodes']: + batchRunner.add_task(DiagTask({"node": config, "configuration": configuration['payload']['configuration']}, + diag_service=diag_service)) + +print(json.dumps({'batch_id': batchRunner.batch_id}) + '\r\n') +sys.stdout.flush() + +batchRunner.run() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_service.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_service.py new file mode 100755 index 00000000..5654e1cb --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_service.py @@ -0,0 +1,89 @@ +import json +import time + +from splunk_instrumentation.constants import ENDPOINTS, INST_APP_NAME, DIAG_STATUS_MSG + + +class DiagService(object): + """ + DiagService is a helper class that manages node diags and tracks them in events + """ + + def __init__(self, splunkd=None, diag_filepath="", batch_id=None): + self.splunkd = splunkd + self.diag_filepath = diag_filepath + self.batch_id = batch_id + + def get_batch_id(self): + """ + return the unique id for the batch of diags being ran + there is one idea for all the diags ran in a batch. + + :return: + batch id + + """ + return self.batch_id + + def create_node_diag_task(self, config): + """ + takes a config and calls the diag endpoint to create a diag + + :param config: + { node : {}, + configuration : {} + } + :return: + { diagFilename : "", + size : n + } + """ + configuration = config['configuration'].copy() + configuration.pop('mode', None) # Remove debug only field + + body = json.dumps({ + 'batchID': self.get_batch_id(), + 'node': { + 'uri': config['node']['uri'], + 'authMethod': config['node']['authMethod'] + }, + 'configuration': configuration + }) + + try: + create_resp = self.splunkd.service.request(ENDPOINTS['DIAG_ENDPOINT'], + method="POST", + body=body, + headers=[('content-type', 'application/json')], + owner='nobody', + app=INST_APP_NAME) + except Exception as ex: + raise Exception("Diag Remote Failed: {}".format(ex)) + + if create_resp.status < 200 or create_resp.status >= 300: + raise Exception("Diag Remote invalid status {}".format(create_resp.status)) + + data = create_resp.get('body').read() + data = json.loads(data) + + sync_error_count = 0 + while True: + try: + statuses = self.splunkd.get_json(ENDPOINTS['DIAG_STATUS'], + owner='nobody', + app=INST_APP_NAME) + for item in statuses: + json_item = json.loads(item) + if (json_item['daigID'] == data['diagID']): + status = item + break + + except Exception as ex: + sync_error_count += 1 + if sync_error_count > 5: + return {'status': 'failed', 'description': str(ex)} + + if status.get('status') != DIAG_STATUS_MSG['PROGRESS']: + return status + + time.sleep(2) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_task.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_task.py new file mode 100755 index 00000000..166c5b0f --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/diag/diag_task.py @@ -0,0 +1,35 @@ +from splunk_instrumentation.diag.batch_runner import Task + + +class DiagTask(Task): + """ + Is a batch_runner task for diags. + """ + + def __init__(self, config, diag_service): + """ + + :param config: the diags config from request { node:..., configuration:...} + :param diag_service: DiagService instance + """ + self.config = config + self.diag_service = diag_service + + def run(self): + """ + calls the diag service to create a diag from a remote machine + :return: + { diagFilename : "", + size : n + } + """ + + return self.diag_service.create_node_diag_task(self.config) + + def to_dict(self): + """ + returns the config + :return: + config + """ + return self.config.get('node') diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..8399d25b Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..8399d25b Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/event_writer.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/event_writer.cpython-39.opt-1.pyc new file mode 100755 index 00000000..7340789f Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/event_writer.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/event_writer.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/event_writer.cpython-39.pyc new file mode 100755 index 00000000..7340789f Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/event_writer.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/instrumentation_index.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/instrumentation_index.cpython-39.opt-1.pyc new file mode 100755 index 00000000..e8f2737f Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/instrumentation_index.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/instrumentation_index.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/instrumentation_index.cpython-39.pyc new file mode 100755 index 00000000..a06fb517 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/instrumentation_index.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/query_runner.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/query_runner.cpython-39.opt-1.pyc new file mode 100755 index 00000000..06d9e4b0 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/query_runner.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/query_runner.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/query_runner.cpython-39.pyc new file mode 100755 index 00000000..06d9e4b0 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/__pycache__/query_runner.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/base_class.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/base_class.py new file mode 100755 index 00000000..19ab4a46 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/base_class.py @@ -0,0 +1,82 @@ +""" +BaseClass. + +This base class manages connection to splunkd. +""" + +import time + +import splunk_instrumentation.splunklib as splunklib +from splunk_instrumentation.constants import SPLUNKRC, INST_APP_NAME +from splunk_instrumentation.splunkd import Splunkd + + +class BaseClass(object): + """BaseClass.""" + + def __init__(self, splunkrc=None, index_name=None, inst_key=None, inst_host=None, inst_port=None): + """ + Constructor. + + Grab SPLUNKRC from parameter or from constants.py + """ + self.splunkrc = splunkrc or SPLUNKRC + self._splunkd_search = self.__connect_to_splunkd(search=True) + self._splunkd = self.__connect_to_splunkd() + + # Public API + # ---------- + def submit(self, event, host=None, source=None, sourcetype=None): + """Submit a new event directly to the index.""" + self._index.submit( + event, host=host, source=source, sourcetype=sourcetype) + + def search(self, search_cmd, **kwargs): + """Submit a new search.""" + return self._query(search_cmd, **kwargs) + + # "Private" methods + # ----------------- + + def _set_index(self, name): + if name: + self.__ensure_index_exists(name) + self._index = self._splunkd.indexes[name] + self.index_name = name + + def __ensure_index_exists(self, name): + if not self._splunkd.has_index(name): + self._splunkd.indexes.create(name) + + def _query(self, search_cmd, **kwargs): + """Query. + + Note that earliest is inclusive & latest is exclusive: + [earliest, latest) + (Prevents getting last-second events again during the next query) + """ + job = self._splunkd_search.search(search_cmd, **kwargs) + + while not job.is_done(): + time.sleep(0.2) + + return splunklib.results.ResultsReader(job.results(count=0)) + + def __connect_to_splunkd(self, search=False): + if search: + # WITH NAMESPACE + splunkrc_copy = {key: self.splunkrc[key] for key in self.splunkrc} + if 'owner' not in splunkrc_copy: + splunkrc_copy['owner'] = '-' + if 'app' not in splunkrc_copy: + splunkrc_copy['app'] = INST_APP_NAME + + return Splunkd(**splunkrc_copy) + else: + splunkrc_copy = {key: self.splunkrc[key] for key in self.splunkrc} + + if 'owner' in splunkrc_copy: + splunkrc_copy.pop('owner') + if 'app' in splunkrc_copy: + splunkrc_copy.pop('app') + return Splunkd(**self.splunkrc) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/event_writer.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/event_writer.py new file mode 100755 index 00000000..9f7ef468 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/event_writer.py @@ -0,0 +1,83 @@ +import json +import logging +import sys + +from splunk_instrumentation.splunkd import Splunkd +from splunk_instrumentation.constants import SPLUNKRC +from splunk_instrumentation.datetime_util import json_serial +from splunk_instrumentation.constants import INSTRUMENTATION_SOURCETYPE + + +class EventWriter(object): + """ Event Writer class + This class handles writing to the index. + It grabs a splunkd object according to the splunkrc params provided: + - If splunkrc is a dictionary, it will create a new splunkd object. + - If given other object type, it will do do Dependency Injection on _splunkd + + """ + def __init__(self, splunkrc=None, index_name=None): + self.splunkrc = splunkrc or SPLUNKRC + self.socket = None + self._index = None + + if type(self.splunkrc) is dict: + self._splunkd = Splunkd(**self.splunkrc) + else: + self._splunkd = splunkrc + + if index_name: + if self._splunkd.has_index(index_name): + self._index = self._splunkd.get_index(index_name) + else: + logging.error('ERROR: INDEX IS NOT AVAILABLE') + raise Exception("ERROR INDEX UNAVAILABLE") + + def submit(self, event, host=None, source=None, sourcetype=INSTRUMENTATION_SOURCETYPE): + # Note: We used to use the ordinary index.submit method from splunklib, + # instead of using a socket. However, that method uses receivers/simple, + # an endpoint that bypasses index time field extraction (which we rely on). + temp_socket = self._index.attach(host=host, source=source, sourcetype=sourcetype) + temp_socket.send(self.marshal_event(event)) + temp_socket.close() + + def open_socket(self, host=None, source=None, sourcetype=INSTRUMENTATION_SOURCETYPE): + ''' + Opens a socket to stream events to be indexed, saving it as + an instance variable for later use when submit_via_socket is called. + :param host: + :param source: + :param sourcetype: + :return: + ''' + self.socket = self._index.attach(host=host, source=source, sourcetype=sourcetype) + return self.socket + + def close_socket(self): + ''' + Closes socket and set it to none + ''' + if self.socket: + self.socket.close() + self.socket = None + + def submit_via_socket(self, event): + """ + Submit the event provided using socket connection. + """ + event = self.marshal_event(event) + if not self.socket: + self.open_socket() + self.socket.send(event) + + @staticmethod + def marshal_event(event): + ''' + Marshals the given event into a json string, suitable for passing + to an open receivers/stream socket. + ''' + if not isinstance(event, (str, bytes)): + event = json.dumps(event, default=json_serial) + if isinstance(event, str) and sys.version_info >= (3, 0): + event = event.encode() + return event diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/instrumentation_index.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/instrumentation_index.py new file mode 100755 index 00000000..149e0332 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/instrumentation_index.py @@ -0,0 +1,91 @@ +import json +from splunk_instrumentation.constants import INSTRUMENTATION_INDEX_NAME, INSTRUMENTATION_SOURCETYPE, INST_LICENSE_TYPES +from splunk_instrumentation.datetime_util import local, date_to_timestamp_str +from splunk_instrumentation.indexing.event_writer import EventWriter +from splunk_instrumentation.indexing.query_runner import QueryRunner +from datetime import timedelta, datetime, time + +RANGE_TYPE_TIMESTAMP = 1 +RANGE_TYPE_DATE = 2 + + +class InstrumentationIndex(object): + def __init__(self, splunkrc=None, index_name=INSTRUMENTATION_INDEX_NAME, + query_runner=None, event_writer=None): + self.index_name = index_name + if query_runner: + self.query_runner = query_runner + else: + self.query_runner = QueryRunner(splunkrc, self.index_name) + if event_writer: + self.event_writer = event_writer + else: + self.event_writer = EventWriter(splunkrc, self.index_name) + + # Public API + # ---------- + + def process_new_events(self, start, end, batchNum, callback, visibility=[], time_range=None): + ''' + Calls `callback` with an iterable of new events. + If callback does not throw an exception, the events will no + longer be "new." + ''' + + events = self._query_by_date(start, end, batchNum, visibility, time_range) + + results = [] + for event in events: + results.append(json.loads(event.get('_raw'))) + callback(results) + + def close_connection(self): + ''' + calling close socket + ''' + self.event_writer.close_socket() + + def pipe_json(self, event): + self.event_writer.submit_via_socket(event) + + # "Private" methods + # ----------------- + + def _query_by_date(self, t_start, t_end, batchNum, visibility, time_limit=None): + ''' + earliest and latest makes the assumtion that _telemery events are indexed the day after they happen + :param t_start: + :param t_end: + :param visibility: + :return: + ''' + search_cmd = 'search index=' + self.index_name + search_cmd += " sourcetype=" + INSTRUMENTATION_SOURCETYPE + " | spath date | search " + if time_limit: + kwargs = { + "earliest_time": date_to_timestamp_str(time_limit['start']), + "latest_time": date_to_timestamp_str(time_limit['stop']) + } + else: + kwargs = { + "earliest_time": date_to_timestamp_str(datetime.combine(t_start, time.min).replace(tzinfo=local)), + "latest_time": date_to_timestamp_str(datetime.combine(t_end + timedelta(days=1), + time.max).replace(tzinfo=local)) + } + if t_start: + search_cmd += (' date>=%s' % t_start.strftime("%Y-%m-%d")) + if t_end: + search_cmd += (' date<=%s' % t_end.strftime("%Y-%m-%d")) + if batchNum: + search_cmd += (' batchNum=%s ' % str(batchNum)) + + + visibility_cmd = self._get_visibility_cmd(visibility) + search_cmd += " (%s)" % visibility_cmd + return self.query_runner.search(search_cmd, **kwargs) + + def _get_visibility_cmd(self, visibility): + if not visibility: + visibility = INST_LICENSE_TYPES + + return " OR ".join(["visibility= *" + str(x) + "*" for x in visibility]) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/kv_store.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/kv_store.py new file mode 100755 index 00000000..d8527d0d --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/kv_store.py @@ -0,0 +1,67 @@ +import json +import xml.dom.minidom as dom +if sys.version_info >= (3, 0): + from urllib.parse import urlencode +else: + from urllib import urlencode + +from splunk_instrumentation.report import report + +from splunk_instrumentation.constants import SPLUNKRC, INST_KV_OWNER, INST_KV_APP, KV_STORE_ENDPOINT, COLLECTION_NAME + +from splunk_instrumentation.indexing.base_class import BaseClass + + +class KvStore(BaseClass): + + def __init__(self, splunkrc=None): + splunkrc = (splunkrc or SPLUNKRC).copy() + splunkrc['owner'] = splunkrc.get('owner') or INST_KV_OWNER + splunkrc['app'] = splunkrc.get('app') or INST_KV_APP + + super(KvStore, self).__init__(splunkrc) + self.headers = [('content-type', 'application/json')] + self.service = self._splunkd.service + self.prepare_collection() + + def to_json(self, data): + return json.dumps(data) + + def prepare_collection(self): + payload = self.service.request(KV_STORE_ENDPOINT["config"], method="GET", headers=self.headers, + owner=self.splunkrc['owner'], app=self.splunkrc['app']) + collections = self.parse_collection(payload) + if COLLECTION_NAME not in collections: + report.report('noKVStore', True) + + def parse_collection(self, payload): + data = dom.parseString(payload['body'].read()) + return [node.firstChild.data for node in data.getElementsByTagName('title')] + + def create_collection(self, name): + data = urlencode({"name": name}) + try: + self.service.request(KV_STORE_ENDPOINT["config"], method="POST", body=data, headers=self.headers, + owner=self.splunkrc['owner'], app=self.splunkrc['app']) + except Exception: + return False + return True + + def set_key(self, key, value): + # _key is unique to each of the entries. + value = json.dumps({"value": value, "_key": key}) + try: + self.service.request(KV_STORE_ENDPOINT["document"], method="POST", body=value, headers=self.headers, + owner=self.splunkrc['owner'], app=self.splunkrc['app']) + except Exception: + self.service.request(KV_STORE_ENDPOINT["document"]+"/"+key, method="POST", body=value, headers=self.headers, + owner=self.splunkrc['owner'], app=self.splunkrc['app']) + + def get_key(self, key, default=None): + try: + payload = self.service.request(KV_STORE_ENDPOINT["document"]+"/"+key, method="GET", headers=self.headers, + owner=self.splunkrc['owner'], app=self.splunkrc['app']) + value = json.loads(str(payload['body'])) + return value.get('value') + except Exception: + return default diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/query_runner.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/query_runner.py new file mode 100755 index 00000000..ddef7925 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/indexing/query_runner.py @@ -0,0 +1,64 @@ +from splunk_instrumentation.splunkd import Splunkd +from splunk_instrumentation.constants import SPLUNKRC, INST_APP_NAME, INSTRUMENTATION_INDEX_NAME +import splunk_instrumentation.splunklib.results as splunklib + +import time +import logging + + +class QueryRunnerResult(splunklib.ResultsReader): + def __init__(self, stream, job=None): + super(QueryRunnerResult, self).__init__(stream) + self.job = job + + +class QueryRunner(object): + """ Query Runner. + a class to handle query to splunkd. + It grabs a splunkd object according to the splunkrc params provided: + - If splunkrc is a dictionary, it will create a new splunkd object. + - If given other object type, it will do do Dependency Injection on _splunkd + """ + def __init__(self, + splunkrc, + index_name=INSTRUMENTATION_INDEX_NAME, + owner='-', + app=INST_APP_NAME, result_reader=QueryRunnerResult): + self.splunkrc = splunkrc or SPLUNKRC + self.result_reader = result_reader + + if type(self.splunkrc) is dict: + self._splunkd = Splunkd(**self.splunkrc) + else: + self._splunkd = splunkrc + + self._splunkd.namespace['owner'] = owner + self._splunkd.namespace['app'] = app + + if self._splunkd.has_index(index_name): + self._index = self._splunkd.get_index(index_name) + else: + logging.error('ERROR: INDEX IS NOT AVAILABLE') + raise(Exception("ERROR INDEX UNAVAILABLE")) + + def search(self, search_cmd, **kwargs): + """Submit a new search. + It is a wrapper to the private method _query. + """ + return self._query(search_cmd, **kwargs) + + def _query(self, search_cmd, **kwargs): + """Query. + + Note that earliest is inclusive & latest is exclusive: + [earliest, latest) + (Prevents getting last-second events again during the next query) + """ + job = self._splunkd.search(search_cmd, **kwargs) + + while not job.is_done(): + time.sleep(0.2) + result = self.result_reader(job.results(count=0)) + if hasattr(result, 'job'): + result.job = job + return result diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/input.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/input.py new file mode 100755 index 00000000..d75d1eb6 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/input.py @@ -0,0 +1,142 @@ +''' +This is the main entry point to scripted inputs to run + +checks if this instance should run the app and then runs the app + +''' +from __future__ import absolute_import + +from splunk_instrumentation.constants import INST_EXECUTION_ID, INST_SCHEMA_FILE, INST_DEBUG_LEVEL +import sys +import logging +from splunk_instrumentation.report import report +from time import sleep +from splunk_instrumentation.schedule_manager import ScheduleManager +from splunk_instrumentation.dataPoints.data_point import dataPointFactory +from splunk_instrumentation.metrics.metrics_schema import load_schema +from splunk_instrumentation.metrics.instance_profile import get_instance_profile, is_lead_node +from splunk_instrumentation.constants import INTROSPECTION_INDEX_NAME + +logging.root.setLevel(INST_DEBUG_LEVEL) +formatter = logging.Formatter('%(levelname)s %(message)s') +handler = logging.StreamHandler(stream=sys.stderr) +handler.setFormatter(formatter) +logging.root.addHandler(handler) + +report.report('executionID', INST_EXECUTION_ID) + + +def pre_run(profile): + ''' + Do some work to keep the environment healthy + - sync deployment id from CM to current node + - sync salt from CM to current node + - retry transaction if retryTransaction in telemtry.conf is not empty + + :param profile + :return: None + ''' + + profile.sync_deployment_id() + profile.sync_salt() + + # if current node is a single search head or a seach head captain in SHC env + # call profile.retry_transaction() to retry sync telemetry conf values to Cluster Master + # TelemetryHandler.cpp SHOULD sync telemetry.conf to CM already whenever any value is changed. + # This is to handle the case when it failed + if (profile.roles.get('search_head') and + not profile.roles.get('shc_member')) \ + or profile.roles.get('sh_captain'): + report.report("profile.retry_transaction", True) + profile.retry_transaction() + + +def run_phase_1_for_all_nodes(dateRange, schema_file): + ''' + phase 1 runs by all nodes to collect role based data and index to data to _introspection + phase 1 does not check opt in options + + :param profile + :param dateRange + :param schema_file + :return: None + ''' + + report.report('Running_Phase[]', 1) + ms = load_schema(schema_file, '*') + sm = ScheduleManager(ms, dataPointFactory) + + # to add phase 1 and ignore visibility + sm.phase_1(dateRange, INTROSPECTION_INDEX_NAME) + + +def can_run_phase2(profile): + ''' + determine if current node can run phase 2 + the requirement is that the current node needs to be the lead node and + that the deployment is opted-in (profile.visibility is not empty) + + :param profile + :return: Boolean + ''' + if is_lead_node(profile.roles) is False: + report.report("lead node", False) + return False + + report.report("lead node", True) + report.report("profile.visibility", profile.visibility) + if not profile.visibility: + report.report("not-opted-in", True) + return False + + if not profile.opt_in_is_up_to_date(): + report.report("opt-in-out-of-date-license-only", True) + + report.report("profile.cluster_mode", profile.profile.get('cluster_mode')) + report.report("profile.roles", profile.roles) + + if profile.server_info.get('product_type') == "splunk": + report.report("instance.type", 'Cloud') + return False + + return True + + +def run_phase_2(profile, dateRange, schema_file): + ''' + phase 2 runs by lead node only and only runs when a deployment is opted in. + sm.phase_2() does the following: + - collects and indexes data points marked as phase = 2 + - query data collected by phase = 1 and phase = 2 and send the data to splunkx + + :param profile + :param dateRange + :param schema_file + :return: None + ''' + report.report('Running_Phase[]', 2) + ms = load_schema(schema_file, profile.visibility) + sm = ScheduleManager(ms, dataPointFactory) + + sleep(5) + sm.phase_2(dateRange, INTROSPECTION_INDEX_NAME) + + +def run_input(dateRange): + profile = get_instance_profile() + pre_run(profile) + + logging.info("INST Started") + try: + run_phase_1_for_all_nodes(dateRange, INST_SCHEMA_FILE) + except Exception as ex: + report.report('input.error', str(ex)) + + if can_run_phase2(profile): + try: + run_phase_2(profile, dateRange, INST_SCHEMA_FILE) + report.send() + except Exception as ex: + report.report('input.error', str(ex)) + + logging.info("INST Done") diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/instrumentation_controller.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/instrumentation_controller.py new file mode 100755 index 00000000..513917c6 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/instrumentation_controller.py @@ -0,0 +1,373 @@ +import logging +import traceback +import os +import sys +import json +import datetime +from zipfile import ZipFile, ZIP_DEFLATED +from string import Template +import base64 +from splunk.persistconn.application import PersistentServerConnectionApplication +import splunk.rest +import splunk.auth +import splunk.entity as en + +if sys.version_info >= (3, 0): + from io import BytesIO as ZipIO +else: + from cStringIO import StringIO as ZipIO + +logging.basicConfig(level=logging.INFO, + format='%(asctime)s %(levelname)s [%(name)s:%(lineno)d] %(message)s', + filename=os.path.join(os.environ.get('SPLUNK_HOME'), 'var', 'log', 'splunk', + 'splunk_instrumentation.log'), + filemode='a') + +# logger = logging.getLogger(__name__) +# Unfortunately, __name__ is something like +# pschand__instrumentation_controller__in_C__Program_Files_Splunk_etc_apps_splunk_instrumentation_bin_splunk_instrumentation +# when this script is run by PersistentServerConnectionApplication, so it's hard-coded here. +logger = logging.getLogger('instrumentation_controller') + +logger.setLevel(logging.INFO) + +if sys.platform == "win32": + import msvcrt + # Binary mode is required for persistent mode on Windows. + msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) + msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) + +path = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + '/../../bin') +sys.path.append(path) + +try: + import splunk_instrumentation.client_eligibility as client_eligibility + from splunk_instrumentation.service_bundle import ServiceBundle + from splunk_instrumentation.splunkd import Splunkd + import splunk_instrumentation.metrics.instance_profile as si_instance_profile + import splunk_instrumentation.packager as si_packager +except Exception: + raise + + +class InstrumentationRestHandler(PersistentServerConnectionApplication): + + def __init__(self, + command_line=None, + command_arg=None, + entity=None, + services=None, + system_services=None, + packager=None, + instance_profile=None): + PersistentServerConnectionApplication.__init__(self) + self.deploymentID = '' + self.session = None + self.server_uri = '' + + self.command_line = command_line + self.command_arg = command_arg + self.en = entity or en + self.services = services + self.system_services = system_services + self.packager = packager or si_packager + self.instance_profile = instance_profile or si_instance_profile + + def splunkrc(self): + return { + 'token': self.session['authtoken'], + 'server_uri': splunk.rest.makeSplunkdUri() + } + + def system_splunkrc(self): + return { + 'token': self.system_authtoken, + 'server_uri': splunk.rest.makeSplunkdUri() + } + + def parse_arg(self, arg): + try: + arg = json.loads(arg) + except Exception: + raise Exception(["Payload must be a json parsable string"]) + return arg + + def get_query(self, arg, key): + for value in (arg['query'] or []): + if key == value[0]: + return value[1] + + def get_earliest_and_latest(self, **kwargs): + self.assert_earliest_and_latest_provided(**kwargs) + return self.timestamp_to_internal_repr(kwargs.get('earliest'), kwargs.get('latest')) + + def assert_earliest_and_latest_provided(self, **kwargs): + if not kwargs.get('earliest') or not kwargs.get('latest'): + raise Exception("earliest and latest query params are required") + + def timestamp_to_internal_repr(self, *args): + result = [] + for arg in args: + # the arguments passed in are sting with format of -- ex 2016-3-4 + # the conversion is done by hand instead of strptime because of the lack of padding + # on date and month + date_array = arg.split("-") + result.append(datetime.date(year=int(date_array[0]), month=int(date_array[1]), day=int(date_array[2]))) + + if len(result) == 1: + return result[0] + else: + return result + + def check_telemetry_authorization(self, path): + # For a free license (where there are no users), there's nothing to check. + if self.services.server_info_service.content.get('isFree', '0') == '1': + return + + if self.session is None: + raise splunk.RESTException(500, "No session found.") + logger.debug('username = %s' % self.session['user']) + userentity = self.en.getEntity('authentication/users', self.session['user'], + sessionKey=self.session['authtoken']) + logger.debug('userentity.properties["capabilities"] = %s' % userentity.properties['capabilities']) + + if 'edit_telemetry_settings' not in userentity.properties['capabilities']: + logger.error('Access denied for path "%s". Returning 404. Insufficient user permissions' % path) + raise splunk.RESTException(404) + + def get_instrumentation_eligibility(self, optInVersion=None, **kwargs): + ''' + Determines whether the UI for the instrumentation app should be visible, + including the initial opt-in modal and all settings/logs pages. + This is determined by user capabilities, license type, and server roles. + ''' + + if self.session is None: + raise splunk.RESTException(500, "No session found.") + + result = client_eligibility.get_eligibility( + self.system_services, + username=self.session['user'], + opt_in_version=optInVersion + ) + + return json.dumps(result) + + def response_to_eligibility_request(self, arg): + return { + 'payload': self.get_instrumentation_eligibility(**dict(arg['query'])), + 'headers': { + 'Content-Type': 'application/json' + }, + 'status': 200 + } + + def response_to_export_request(self, path, visibility, arg): + self.check_telemetry_authorization(path) + if arg['method'] != 'GET': + return {'payload': 'Only GET is allowed for /%s.' % path, 'status': 405} + usage_data = UsageData(True, visibility, self.splunkrc(), self.packager, + self.instance_profile, **dict(arg['query'])) + + # Need to do base64 encoding, since zip files are a binary format. + base64_payload = base64.b64encode(usage_data.payload()) + if sys.version_info > (3, 0): + base64_payload = base64_payload.decode() + + return { + 'payload_base64': base64_payload, + 'headers': { + 'Content-Type': usage_data.content_type(), + 'Content-Disposition': 'attachment; filename="%s"' % usage_data.filename() + }, + 'status': 200 + } + + def response_to_send_request(self, path, visibility, arg): + self.check_telemetry_authorization(path) + if arg['method'] != 'POST': + return {'payload': 'Only POST is allowed for /%s.' % path, 'status': 405} + usage_data = UsageData(False, visibility, self.splunkrc(), self.packager, + self.instance_profile, **dict(arg['query'])) + usage_data.send() + return { + 'payload': usage_data.payload(), + 'status': 200 + } + + def handle(self, arg): + ''' + Takes the parsed request data passed by splunkd to + PersistentServerConnectionApplication.handle and returns a response. + :param arg: JSON object + :return: JSON object + ''' + + arg = self.parse_arg(arg) + logger.debug('arg = %s' % json.dumps(arg)) + if 'query' not in arg: + arg['query'] = [] + + try: + if 'session' not in arg: + raise splunk.RESTException(500, "No session found.") + self.session = arg['session'] + + if 'system_authtoken' not in arg: + raise splunk.RESTException(500, "No system auth token found.") + self.system_authtoken = arg['system_authtoken'] + + if self.services: + self.splunkd = self.services.splunkd + else: + self.splunkd = Splunkd(**self.splunkrc()) + self.services = ServiceBundle(self.splunkd) + + if not self.system_services: + splunkd = Splunkd(**self.system_splunkrc()) + self.system_services = ServiceBundle(splunkd) + + usage_data_endpoint_table = { + 'anonymous_usage_data': {'visibility': 'anonymous', 'action': 'export'}, + 'license_usage_data': {'visibility': 'license', 'action': 'export'}, + 'support_usage_data': {'visibility': 'support', 'action': 'export'}, + 'send_anonymous_usage_data': {'visibility': 'anonymous', 'action': 'send'}, + 'send_license_usage_data': {'visibility': 'license', 'action': 'send'}, + 'send_support_usage_data': {'visibility': 'support', 'action': 'send'} + } + + path = arg['path_info'] + if path == 'instrumentation_eligibility': + return self.response_to_eligibility_request(arg) + elif path in usage_data_endpoint_table: + visibility = usage_data_endpoint_table[path]['visibility'] + if (usage_data_endpoint_table[path]['action'] == 'export'): + return self.response_to_export_request(path, visibility, arg) + else: + return self.response_to_send_request(path, visibility, arg) + else: + return { + 'payload': '"%s" not found' % path, + 'status': 404, + 'headers': { + 'Content-Type': 'text/plain' + } + } + + except splunk.RESTException as e: + logger.error(e) + return {'payload': 'Exception caught: %s' % e.msg, 'status': e.statusCode} + except Exception as e: + logger.error('ERROR: ' + traceback.format_exc()) + return {'payload': traceback.format_exception_only(type(e), e)[-1], 'status': 500} + + +class UsageData(object): + + _data_types_by_visibility = { + 'anonymous': 'Diagnostic', + 'license': 'License Usage', + 'support': 'Support Usage' + } + + def __init__(self, forExport, visibility, splunkrc, packager, instance_profile, **kwargs): + self.visibility = visibility + self.splunkrc = splunkrc + self.packager = packager + self.instance_profile = instance_profile + + try: + self.earliest, self.latest = self.get_earliest_and_latest(**kwargs) + if self.isMoreThanOneYear(): + logger.error("Date range must be less than 1 year.") + raise splunk.RESTException(403, "Date range must be less than 1 year.") + + self.events = self.get_events_package(forExport) + if forExport: + data_type = UsageData._data_types_by_visibility[self.visibility] + self.zip_file_name, json_file_name = self.get_file_names(data_type) + value = self.get_file_content() + zipped_payload = self.zip_compress(json_file_name, value) + self._payload = zipped_payload + else: + self._payload = '{"sent_count": %d}' % len(self.events) + except Exception as e: + logger.exception(e) + raise + + def send(self): + if self.events: + self.send_events_package() + + def get_events_package(self, forExport=False): + _packager = self.packager.Packager(splunkrc=self.splunkrc) + return _packager.build_package(self.earliest, self.latest, [self.visibility], forExport) + + def send_events_package(self): + _packager = self.packager.Packager(splunkrc=self.splunkrc) + _packager.manual_send_package(self.events, self.earliest, self.latest, [self.visibility]) + + def get_earliest_and_latest(self, **kwargs): + self.assert_earliest_and_latest_provided(**kwargs) + return self.timestamp_to_internal_repr(kwargs.get('earliest'), kwargs.get('latest')) + + def assert_earliest_and_latest_provided(self, **kwargs): + if not kwargs.get('earliest') or not kwargs.get('latest'): + raise Exception("earliest and latest query params are required") + + def timestamp_to_internal_repr(self, *args): + result = [] + for arg in args: + # the arguments passed in are sting with format of -- ex 2016-3-4 + # the conversion is done by hand instead of strptime because of the lack of padding + # on date and month + date_array = arg.split("-") + result.append(datetime.date(year=int(date_array[0]), month=int(date_array[1]), day=int(date_array[2]))) + + if len(result) == 1: + return result[0] + else: + return result + + def get_file_names(self, data_type, file_type=['zip', 'json']): + filename = Template('%s Data - %s to %s.$filename' % ( + data_type, + ('%d.%02d.%02d' % (self.earliest.year, self.earliest.month, self.earliest.day)), + ('%d.%02d.%02d' % (self.latest.year, self.latest.month, self.latest.day)) + )) + return [filename.substitute(filename=ft) for ft in file_type] + + def zip_compress(self, json_file_name, value): + temp = ZipIO() + with ZipFile(temp, 'w', ZIP_DEFLATED) as myzip: + myzip.writestr(json_file_name, value) + return temp.getvalue() + + def get_file_content(self): + _packager = self.packager.Packager(splunkrc=self.splunkrc) + _instance_profile = self.instance_profile.get_instance_profile(splunkrc=self.splunkrc) + deployment_id = _instance_profile.get_deployment_id() + transaction_id = _packager.get_transactionID() + value = self.get_events_package(forExport=True) + + ret_value = { + "deploymentID": deployment_id, + "transactionID": transaction_id, + "data": value} + return json.dumps(ret_value) + + def isMoreThanOneYear(self): + copyEarliest = self.earliest.replace(year=self.earliest.year + 1) + if self.latest > copyEarliest: + return True + return False + + def payload(self): + return self._payload + + def content_type(self): + return 'application/zip' + + def filename(self): + return self.zip_file_name diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..ed9d7006 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..ed9d7006 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/instance_profile.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/instance_profile.cpython-39.opt-1.pyc new file mode 100755 index 00000000..5e749db9 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/instance_profile.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/instance_profile.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/instance_profile.cpython-39.pyc new file mode 100755 index 00000000..6d61122f Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/instance_profile.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_collection_manager.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_collection_manager.cpython-39.pyc new file mode 100755 index 00000000..a5be7d53 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_collection_manager.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_schema.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_schema.cpython-39.opt-1.pyc new file mode 100755 index 00000000..94760e50 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_schema.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_schema.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_schema.cpython-39.pyc new file mode 100755 index 00000000..1fb35aaa Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_schema.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_transforms.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_transforms.cpython-39.opt-1.pyc new file mode 100755 index 00000000..dd616141 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_transforms.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_transforms.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_transforms.cpython-39.pyc new file mode 100755 index 00000000..a12e0ef1 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/__pycache__/metrics_transforms.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/instance_profile.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/instance_profile.py new file mode 100755 index 00000000..8c256aaf --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/instance_profile.py @@ -0,0 +1,234 @@ +"""InstanceProfile class.""" + +from builtins import object +from splunk_instrumentation.report import report +from splunk_instrumentation.splunklib import data as spldata +from splunk_instrumentation.constants import SPLUNKRC, VISIBILITY_FIELDS_BY_NAME +from splunk_instrumentation.indexing.query_runner import QueryRunner +from splunk_instrumentation.telemetry_conf_service import TelemetryConfService +from splunk_instrumentation.server_info_service import ServerInfoService +from splunk_instrumentation.deployment_id_manager import DeploymentIdManager +from splunk_instrumentation.service_bundle import ServiceBundle +from splunk_instrumentation.salt_manager import SaltManager + + +class InstanceProfile(object): + """InstanceProfile. + + This class will retrieve the instance's information. + + self.server_info = server information will be stored here + self.visibility = visibility information will be stored here + """ + + def __init__(self, splunkrc=SPLUNKRC, telemetryConfService=None, serverInfoService=None): + """Constructor. + It grabs a query_runner object according to the splunkrc params provided: + - If splunkrc is a dictionary, it will instantiates a new QueryRuner object. + - If given other object type, it will do Dependency Injection on query_runner + """ + splunkrc = (splunkrc or SPLUNKRC) + if type(splunkrc) is dict: + self.query_runner = QueryRunner(splunkrc) + else: + self.query_runner = splunkrc + + self.profile = {} + self.service = self.query_runner._splunkd.service + + if not telemetryConfService: + self.telemetry_conf_service = TelemetryConfService(self.service) + else: + self.telemetry_conf_service = telemetryConfService + + if not serverInfoService: + self.server_info_service = ServerInfoService(self.service) + else: + self.server_info_service = serverInfoService + + self.telemetry_conf_service.fetch() + self.server_info_service.fetch() + + self.service_bundle = ServiceBundle(self.service, + telemetry_conf_service=self.telemetry_conf_service, + server_info_service=self.server_info_service) + + self.salt_manager = SaltManager(self.service_bundle) + + self.deployment_id_manager = DeploymentIdManager( + self.service, + telemetry_conf_service=self.telemetry_conf_service, + server_info_service=self.server_info_service) + + self.roles = {role: True for role in self.server_info['server_roles']} + + # gets cluster info from endpoint + self._load_json({"end_point": "cluster/config/config", "name": "cluster_config"}) + + # Valid values: (master | slave | searchhead | disabled) + # Note that for a searchhead (with SHC or not) the value will be 'disabled' (rather than 'searchhead') + # if there is no indexer clustering. + # If call fails set cluster_mode to disabled. + self.profile['cluster_mode'] = self._nested_get(self.profile, 'cluster_config.entry.content.mode', 'disabled') + + # gets search captain info from endpoint. noProxy is required so that it fails when instance is not the captain + self._load_json({"end_point": "shcluster/captain/info", "name": "captain_info"}, noProxy=True, default={}) + + # if captain/info returns a value it is captain : overwrites server roles + # this is failing so removing for the time being + # self.roles['shc_captain'] = bool(self.profile.get('captain_info')) + + # if mode is not disabled then add in_cluster to roles : overwrites server roles + # Note: 'in_cluster' doesn't mean 'in a cluster', it means 'in a deployment that has indexer clustering'. + self.roles['in_cluster'] = not self.profile.get('cluster_mode') == 'disabled' + # overwrites server roles + self.roles['cluster_master'] = self.profile.get('cluster_mode') == 'master' + + # determines if the current node has lead_role + self.roles['lead_node'] = self.eval_instance() + + self._get_visibility() + + def eval_instance(self): + req_list = [ + { + "requirements": ['indexer', '!search_peer', '!cluster_slave', + '!shc_member', '!cluster_master', + '!shc_captain', '!cluster_search_head'], + "label": "Single", + "result": True + }, + + { + "requirements": ['cluster_master'], + "label": "Cluster Master", + "result": True + }, + { + "requirements": ['!cluster_master', 'in_cluster'], + "label": "Cluster Member not Cluster Master", + "result": False + }, + # assume we are already not a cluster member from the above requirements + { + "requirements": ['shc_captain'], + "label": "Search Captain in a non cluster", + "result": True + }, + { + "requirements": ['!cluster_master', 'search_head', '!search_peer', + '!in_cluster', '!cluster_slave', '!shc_member'], + "label": "Single Search Head", + "result": True + }, + ] + + for req in req_list: + result = evaluate_roles(self.roles, req["requirements"]) + + if result: + report.report("instance.type", req["label"]) + return req["result"] + else: + report.report("instance.type", None) + + def opt_in_is_up_to_date(self): + return self.telemetry_conf_service.opt_in_is_up_to_date() + + @property + def server_info(self): + return self.server_info_service.content + + @property + def server_is_cloud(self): + return int(self.telemetry_conf_service.content.get('onCloudInstance') or 0) + + def retry_transaction(self): + self.telemetry_conf_service.retry_cluster_master_sync_transaction() + + def sync_deployment_id(self): + self.deployment_id_manager.sync_deployment_id() + + def sync_salt(self): + self.salt_manager.sync_with_cluster() + + def get_deployment_id(self): + return self.deployment_id_manager.get_deployment_id() + + def _get_visibility(self): + self.visibility = [] + for name, field in VISIBILITY_FIELDS_BY_NAME.items(): + if int(self.telemetry_conf_service.content.get(field) or 0): + self.visibility.append(name) + + if not self.opt_in_is_up_to_date(): + self.visibility = ['license'] if 'license' in self.visibility else [] + + self.visibility.sort() + + def _nested_get(self, dic, path, default=0, separator='.'): + """NestedGet. + default path separator is . + default value is 0 + """ + keys = path.split(separator) + for key in keys[:-1]: + dic = dic.setdefault(key, {}) + + if type(dic) is dict: + return default + return dic.get(keys[-1]) + + def _load_json(self, endpoint, noProxy=False, default={}): + ''' + calls endpoint['end_point'] and assigns the results to `self.profile[end_point['name']]` + :param endpoint: + :return: + ''' + try: + path = self._construct_path(endpoint, noProxy) + payload = self.service.http.request(path, + {'method': 'GET', + 'headers': self.service._auth_headers}).get('body') + + if payload: + result = (spldata.load(payload.read())) + self.profile[endpoint['name']] = result['feed'] + # often if license does not permit this call it will return a 402 as exception + except Exception: + self.profile[endpoint['name']] = default + return False + + return True + + def _construct_path(self, endpoint, noProxy): + path = self.service.authority \ + + self.service._abspath(endpoint["end_point"], owner=self.query_runner._splunkd.namespace['owner'], + app=self.query_runner._splunkd.namespace['app']) + if (noProxy): + path += "?noProxy=true" + return path + + +def get_instance_profile(splunkrc=None, telemetryConfService=None, serverInfoService=None): + get_instance_profile.instance = get_instance_profile.instance or InstanceProfile( + splunkrc, telemetryConfService, serverInfoService) + return get_instance_profile.instance + + +def evaluate_roles(roles, rules): + for reqi in rules: + if (reqi[0] == "!"): + reqi = reqi.replace("!", "") + if roles.get(reqi): + return False + elif not roles.get(reqi): + return False + return True + + +def is_lead_node(roles): + return 'lead_node' in roles and roles['lead_node'] is True + + +get_instance_profile.instance = None diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_collection_manager.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_collection_manager.py new file mode 100755 index 00000000..fb9b7fd3 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_collection_manager.py @@ -0,0 +1,151 @@ +from __future__ import absolute_import +from past.builtins import basestring +from builtins import object +import json +import os +import uuid +from datetime import datetime + +from splunk_instrumentation.metrics.metrics_transforms import transform_object, hash_specific_value_by_key +from splunk_instrumentation.constants import INST_EXECUTION_ID +from splunk_instrumentation.datetime_util import date_to_timestamp, utcNow, str_to_date +from splunk_instrumentation.report import report +from splunk_instrumentation.metrics.instance_profile import get_instance_profile, evaluate_roles +from splunk_instrumentation.salt_manager import SaltManager +from splunk_instrumentation.splunkd import Splunkd +from splunk_instrumentation.service_bundle import ServiceBundle +from splunk_instrumentation.constants import SPLUNKRC + + +class MetricsCollectionManager(object): + def __init__(self, metricSchema, dataPointFactory, splunkrc=None, phase=1): + self.metricSchema = metricSchema + self.dataPointFactory = dataPointFactory + self.splunkrc = splunkrc + self.profile = get_instance_profile() + self.phase = phase + + splunkd = Splunkd(**SPLUNKRC) + services = ServiceBundle(splunkd) + salt_manager = SaltManager(services) + self.salt = salt_manager.get_salt() + self.scheme = {"hash": self.salt} + + def collect_data(self, dateRange, callback=None): + ''' + loads all data classes from schema and collects data for yesterday. + callback will be run after it collects data + ''' + self._collect_classes_data(dateRange, callback) + + def _collect_classes_data(self, dateRange, callback=None): + # get all MetricsSchemaClass (one savedsearch definition) from schema.json marked with 'self.phase' + classes = self.metricSchema.getEventClassByfield(self.phase, "phase", 2) + classes_batch = [] + if os.environ.get('RUN_UNSCHEDULE') or dateRange.get("batchNum") is None: + classes_batch = classes + else: + # fetch all classes marked with current batch number in schema.json + current_batchNum = dateRange["batchNum"] + classes_batch = [clsDef for clsDef in classes if clsDef.batch == current_batchNum or clsDef.batch == '*'] + + for classDef in classes_batch: + rules = classDef.getRoles() + if evaluate_roles(self.profile.roles, rules): + self._collect_class_data(classDef, dateRange, callback) + + def _collect_class_data(self, classDef, dateRange, callback=None): + ''' + run data collections and call callbacks on it. + ''' + try: + if not isinstance(dateRange, dict): + dateRange = {"start": dateRange} + dateRange["stop"] = dateRange.get("stop") or dateRange.get("start") + + if isinstance(dateRange["start"], datetime) or isinstance(dateRange["stop"], datetime): + raise "Requires_date_not_datetime" + + dataPoints = classDef.getDataPoints() + + for dataPoint in dataPoints: + report.start_profiling() + dataPointResult = self.collect_data_point(dataPoint, dateRange) + + if hasattr(dataPointResult, 'job'): + try: + report.report('components[]', { + "component": classDef.component, + "runDuration": float(dataPointResult.job["runDuration"]), + "scanCount": int(dataPointResult.job["scanCount"]), + "resultCount": int(dataPointResult.job["resultCount"]), + "isFailed": dataPointResult.job["isFailed"], + "searchProviders": len(dataPointResult.job["searchProviders"]), + "sid": dataPointResult.job["sid"] + + }) + except Exception: + report.report('components[]', { + "component": classDef.component, + "error": "could not log report" + }) + + dataPointResult = [ + self.data_point_results_transform(classDef, event, dateRange) for event in dataPointResult] + + callback(dataPointResult) + + except Exception as e: + report.report('exceptions[]', str(e)) + + def collect_data_point(self, dataPoint, dateRange): + dataPointObj = self.dataPointFactory(dataPoint, options={"splunkrc": self.splunkrc}) + data = dataPointObj.collect(dateRange) + return data + + def data_point_results_transform(self, class_def, data_point_result, date_range): + fields = class_def.index_fields + hash_key = class_def.getHashKey() + + result = {"data": None} + if data_point_result['data']: + if (isinstance(data_point_result['data'], basestring)): + data = json.loads(data_point_result['data']) + else: + data = data_point_result['data'] + + data = hash_specific_value_by_key(data=data, hash_key=hash_key, scheme=self.scheme) + data = transform_object(data=data, fields=fields) + result['data'] = data + + result['timestamp'] = date_to_timestamp(utcNow()) + + result['component'] = class_def.component + result['date'] = date_range['stop'].isoformat() + + data_point_time = data_point_result.get('_time') + + if not date_range['stop'] == date_range['start']: + try: + if data_point_result.get('date'): + result['date'] = data_point_result.get('date') + elif data_point_time and 'T' in data_point_time: + result['date'] = data_point_result.get('_time').split('T')[0] + except Exception: + result['date'] = date_range['stop'].isoformat() + + # SPECIAL CASE: + # At least one (the indexer cluster member count) data point is retrieved + # on the fly during data collection. Its time/date will be "today" though + # it really pertains to the stop date (typically yesterday in prod). + # Note - There is discussion of having each node persist this data so the + # true historical values can be retrieved later. That would eliminate + # this situation. + if str_to_date(result['date']) > date_range['stop']: + result['date'] = date_range['stop'] + result['eventID'] = str(uuid.uuid4()).upper() + result['batchNum'] = date_range["batchNum"] + result['visibility'] = class_def.visibility or "anonymous" + result['executionID'] = INST_EXECUTION_ID + + return result diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_schema.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_schema.py new file mode 100755 index 00000000..82a73db6 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_schema.py @@ -0,0 +1,111 @@ +from builtins import map +import json +from splunk_instrumentation.constants import DEFAULT_BATCH_NUM + +class MetricsSchemaDataPoint(object): + def __init__(self, dataPointSchema): + self.dataPointSchema = dataPointSchema + + @property + def type(self): + return self.dataPointSchema['type'] + + +class MetricsSchemaClass(object): + + def __init__(self, classSchema): + self.classSchema = classSchema + + @property + def component(self): + return self.classSchema['component'] + + @property + def visibility(self): + return self.classSchema.get('visibility') + + @property + def batch(self): + classSchema_batch = self.classSchema.get('batch') + return self.classSchema.get('batch') or DEFAULT_BATCH_NUM + + @property + def fields(self): + return self.classSchema.get('fields') or [] + + @property + def on_send(self): + return self.classSchema.get('on_send') or False + + @property + def index_fields(self): + return self.classSchema.get('index_fields') or [] + + def getDataPoints(self): + dataPoints = [] + for dataPoint in self.classSchema['dataPoints']: + dataPoints.append(MetricsSchemaDataPoint(dataPoint)) + return dataPoints + + def getHashKey(self): + hash_key = self.classSchema.get('hash_key') + if hash_key is None: + hash_key = [] + elif not isinstance(hash_key, list): + hash_key = [hash_key] + return hash_key + + def getRoles(self): + roles = self.classSchema.get('roles') + # default is to run telemetry data collection on lead node only + if roles is None: + roles = ['lead_node'] + elif not isinstance(roles, list): + roles = [roles] + return roles + + +class MetricsDelivery(object): + def __init__(self, delivery): + self.delivery = delivery + + @property + def url(self): + return self.delivery.get('url') + + @url.setter + def url(self, url): + self.delivery['url'] = url + + @property + def version(self): + return self.delivery.get('version') + + +class MetricsSchema(object): + + def __init__(self, schema, visibility=None): + self.schema = schema + self.delivery = MetricsDelivery(schema['delivery']) + self.visibility = visibility + + def getEventClasses(self): + classes = self.schema['classes'] + return map(MetricsSchemaClass, classes) + + def getEventClassByfield(self, value, fieldname="component", default=None): + classes = self.schema['classes'] + result = [] + for classDef in classes: + if classDef.setdefault(fieldname, default) == value and \ + (self.visibility == '*' or + set(self.visibility).intersection(classDef['visibility'].split(','))): + result.append(MetricsSchemaClass(classDef)) + return result + + +def load_schema(schema_file, visibility=None): + schema = None + with open(schema_file or "schema.json") as json_file: + schema = json.load(json_file) + return MetricsSchema(schema, visibility) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_transforms.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_transforms.py new file mode 100755 index 00000000..8b786774 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/metrics/metrics_transforms.py @@ -0,0 +1,81 @@ +import hashlib +import sys + +metrics_transforms = {} + + +def transform_hash(data, scheme=None): + scheme = scheme or {"hash": "default"} + subject = str(data) + scheme.get('hash') + if sys.version_info >= (3, 0): + subject = subject.encode() + hash_object = hashlib.sha224(subject) + hex_dig = hash_object.hexdigest() + return hex_dig + + +metrics_transforms['sha256'] = transform_hash +metrics_transforms['hash'] = transform_hash + + +def hash_specific_value_helper(data, each_hash_key, scheme): + ''' + recursively check hash keys in data + ''' + for key in data: + if isinstance(data[key], dict): + hash_specific_value_helper(data[key], each_hash_key, scheme) + elif key == each_hash_key: + data[key] = transform_hash(data[key], scheme) + + +def hash_specific_value_by_key(data, hash_key, scheme): + ''' + hash values corresponding to keys containing in hash_key + :param data: + :param hash_key: a list of keys got from schema + :param scheme: containing hash salt + :return: + ''' + for key in hash_key: + hash_specific_value_helper(data, key, scheme) + return data + + +def metrics_transform(type, value, scheme=None): + if isinstance(value, list): + for idx, val in enumerate(value): + value[idx] = metrics_transform(type, val, scheme) + elif isinstance(value, dict): + for idx, val in value.items(): + value[idx] = metrics_transform(type, val, scheme) + else: + value = metrics_transforms[type](value) + return value + + +def transform_object(data, fields): + def nested_set(dic, path, value): + keys = path.split(".") + for key in keys[:-1]: + dic = dic.setdefault(key, {}) + dic[keys[-1]] = value + + def nested_get(dic, path): + keys = path.split(".") + for key in keys[:-1]: + dic = dic.setdefault(key, {}) + return dic[keys[-1]] + + for field in fields: + field['path'] = field.get('path') or field.get('name') + field['search_path'] = field.get('search_path') or field['path'] + field['set_path'] = field.get('set_path') or field['path'] + if data.get(field['search_path']) is not None: + value = nested_get(data, field['search_path']) + if field.get('transform'): + value = metrics_transform(field['transform'], value) + + nested_set(data, field['set_path'], value) + + return data diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__init__.py new file mode 100755 index 00000000..38067660 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__init__.py @@ -0,0 +1,257 @@ +from splunk_instrumentation.indexing.instrumentation_index import InstrumentationIndex +from splunk_instrumentation.packager.send_log import SendLog +from splunk_instrumentation.packager.send_data import SendData +import random +import logging +from logging.handlers import RotatingFileHandler +from datetime import datetime, timedelta, time +from splunk_instrumentation.datetime_util import local, utc, utcNow, json_serial +from splunk_instrumentation.metrics.instance_profile import get_instance_profile +import splunk_instrumentation.metrics.metrics_schema as metrics_schema +from splunk_instrumentation.constants import INST_SCHEMA_FILE, INST_EXECUTION_START_TIME +from splunk_instrumentation.packager.quick_draw import get_quick_draw +from splunk_instrumentation.report import report +from splunk_instrumentation.metrics.metrics_transforms import transform_object +from splunk_instrumentation.dataPoints.data_point import dataPointFactory +from splunk_instrumentation.dataPoints.spl_data_point import SPLDataPoint # noqa +from splunk_instrumentation.dataPoints.report_data_point import ReportDataPoint # noqa +from splunk_instrumentation.splunklib import binding +from splunk_instrumentation.constants import INTROSPECTION_INDEX_NAME +import os +import json + +logger = logging.getLogger(__name__) + +dataLogger = logging.getLogger('TelemetryCloudData') +dataLogger.setLevel(logging.INFO) +handler = RotatingFileHandler(os.path.join(os.environ.get('SPLUNK_HOME'), 'var', + 'log', 'splunk', 'splunk_instrumentation_cloud.log'), + mode='a', maxBytes=5000000, backupCount=5) +formatter = logging.Formatter('{"datetime": "%(asctime)s", "log_level": "%(levelname)s", ' + '"component": "%(name)s", "data": %(message)s}') +handler.setFormatter(formatter) +dataLogger.addHandler(handler) + + +class Packager(object): + """ Packager Class. + + This class acts as the gateaway for the data. + """ + def __init__( + self, splunkrc=None, deploymentID=None, schema=None, factory=None, + send_data=None, send_log=None, instance_profile=None, + quick_draw=None): + self._splunkrc = splunkrc + self.deploymentID = deploymentID + self.transaction_id = None + if not instance_profile: + self.instance_profile = get_instance_profile(self._splunkrc) + else: + self.instance_profile = instance_profile + if not schema: + schema = metrics_schema.load_schema(INST_SCHEMA_FILE, visibility=self.instance_profile.visibility) + self.schema = schema + if not factory: + factory = dataPointFactory + self.factory = factory + self.deliverySchema = self.schema.delivery + if not quick_draw: + qd = get_quick_draw() + else: + qd = quick_draw + if qd: + self.deliverySchema.url = qd.get('url') + + self.transaction_id = self.get_transactionID() + + if not send_data: + self.sd = SendData( + deploymentID=self.instance_profile.get_deployment_id(), + deliverySchema=self.deliverySchema, + transaction_id=self.get_transactionID()) + else: + self.sd = send_data + + if not send_log: + self.sl = SendLog(splunkrc=self._splunkrc) + else: + self.sl = send_log + + self.result = None + self.is_cloud = self.instance_profile.server_is_cloud + + def package_send(self, dateRange, index_name=INTROSPECTION_INDEX_NAME): + """Auto send and log data. + + First we look at our index and check the start, stop, and visibility + Next we query based on that, and send it. + """ + visibility = self.instance_profile.visibility + if visibility is False: + return False + + time_range = {"start": INST_EXECUTION_START_TIME, "stop": utcNow()} + + events = self._query_events( + dateRange['start'], dateRange['stop'], dateRange['batchNum'], visibility, False, time_range=time_range, index_name=index_name) + + if len(events) == 0: + report.report('send-canceled', True) + return False + return self._send_package(events, dateRange['start'], dateRange['stop'], dateRange['batchNum'], time_range=time_range) + + def manual_send_package(self, events, start, stop, visibility): + """Handling manually sending package from the UI. + + This is just a wrapper for _send_package + events = events from index + start = from datetime picker + stop = from datetime picker + visibility = [anonymous, license] + """ + + time_range = { + "start": datetime.combine(start, time.min).replace(tzinfo=local).astimezone(utc), + "stop": datetime.combine(stop + timedelta(days=1), time.max).replace(tzinfo=local).astimezone(utc) + } + return self._send_package( + events, start, stop, method='manual', visibility=visibility, time_range=time_range) + + def build_package(self, start, stop, visiblity, forExport=False): + return self._query_events( + start, stop, visiblity, forExport) + + def get_transactionID(self): + if self.transaction_id: + return self.transaction_id + allowedCharacters = '0123456789ABCDEF' + transaction_id = ''.join(random.choice(allowedCharacters) for i in range(8)) + '-' + ''.join( + random.choice(allowedCharacters) for i in range(4)) + \ + '-' + ''.join(random.choice(allowedCharacters) for i in range(4)) + \ + '-' + ''.join(random.choice(allowedCharacters) for i in range(4)) + \ + '-' + ''.join(random.choice(allowedCharacters) for i in range(12)) + self.transaction_id = transaction_id + return self.transaction_id + + def _get_visibility(self, events): + result = {} + i = get_instance_profile(self._splunkrc) + visibility = i.visibility + + for event in events: + vis = event.get('visibility') or [] + for key in vis.split(','): + if key in visibility: + result[key] = True + return sorted(result.keys()) + + def _query_events( + self, start, stop, batchNum, + visibility=[], forExport=False, time_range=None, index_name=INTROSPECTION_INDEX_NAME): + ''' + + :param start: datetime.date + :param stop: datetime.date can be the same as start + :param batchNum: batch number + :param visibility: + :param forExport: true if this is for export and forces visibility values to visibility field on events + :param time_range: {start,stop} the timecode range to limit event _time + :param index_name: specifies which index to query for telemetry events (default: _introspection) + :return: + ''' + + if isinstance(start, datetime) or isinstance(stop, datetime): + raise ("Requires_date_not_datetime") + + i = InstrumentationIndex(splunkrc=self._splunkrc, index_name=index_name) + result = [] + + def process_events(events): + for data in events: + self._transform_data(data) + result.append(data) + + profile = report.start_profiling() + + i.process_new_events( + start, stop, batchNum, process_events, visibility=visibility, time_range=time_range) + report.report("query_telemetry", {"count": len(result)}, profile) + if forExport: + result = self._mark_visibility(result, visibility, 'manual') + + return result + + def _transform_data(self, data): + classDef = self.schema.getEventClassByfield(data['component']) + if (len(classDef)): + data['data'] = transform_object(data['data'], classDef[0].fields) + + return data + + def _send_package( + self, events, start, stop, batchNum, method='auto', visibility=None, time_range=None): + """Sending package and log it. + + If offline (or quickdraw not available), log failed to the index. + If on cloud, log events to splunk_instrumentation_cloud.log, instead of sending to quickdraw + events = events from index + start = from datetime picker + stop = from datetime picker + batchNum = batch number + method = ['auto', 'manual'] + visibility = [anonymous, license] + """ + + visibility = visibility or self._get_visibility(events) + count = len(events) + self.sl.send_attempted(start, stop, batchNum, visibility=visibility, time_range=time_range, method=method, count=count) + try: + events = self._mark_visibility(events, visibility, method) + if self.is_cloud: + self.sd.bundle_DTOs(events) + for event in events: + dataLogger.info(json.dumps(event, default=json_serial)) + else: + if self.deliverySchema.url: + self.sd.send_data(events) + else: + raise Exception('Quickdraw is not available') + self.sl.send_completed(start, stop, batchNum, visibility=visibility, time_range=time_range, method=method, + count=count) + except binding.HTTPError as e: + logger.error(e) + self.sl.send_failed(start, stop, batchNum, visibility=visibility, time_range=time_range, method=method, count=None) + report.report("send_failed", True) + raise + except Exception as e: + logger.error(e) + self.sl.send_failed(start, stop, batchNum, visibility=visibility, time_range=time_range, method=method, count=None) + report.report("send_failed", True) + raise + except Exception: + logger.error("Unknown Error") + self.sl.send_failed(start, stop, batchNum, visibility=visibility, time_range=time_range, method=method, count=None) + report.report("send_failed", True) + raise + + def _mark_visibility(self, events, visibility, method='auto'): + """Marking visibility. + + It alters the visibility field according to their choice from the UI + events = events from index + visibility = [anonymous, license] from UI + """ + if method == 'manual': + for event in events: + event['visibility'] = ','.join(visibility) + elif method == 'auto': + for event in events: + temp = [] + for vis in event['visibility'].split(','): + if vis in visibility: + temp.append(vis) + event['visibility'] = ','.join(temp) + else: + raise Exception("Should never reach this.") + return events diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..ca49f2b9 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..12692ae7 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/quick_draw.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/quick_draw.cpython-39.opt-1.pyc new file mode 100755 index 00000000..c5e7f2de Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/quick_draw.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/quick_draw.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/quick_draw.cpython-39.pyc new file mode 100755 index 00000000..c5e7f2de Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/quick_draw.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_data.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_data.cpython-39.opt-1.pyc new file mode 100755 index 00000000..08406234 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_data.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_data.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_data.cpython-39.pyc new file mode 100755 index 00000000..34919a2a Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_data.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_log.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_log.cpython-39.opt-1.pyc new file mode 100755 index 00000000..966a44bd Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_log.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_log.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_log.cpython-39.pyc new file mode 100755 index 00000000..b91b4f33 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/__pycache__/send_log.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/quick_draw.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/quick_draw.py new file mode 100755 index 00000000..68d111b0 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/quick_draw.py @@ -0,0 +1,31 @@ +import requests +from splunk_instrumentation.constants import QUICKDRAW_URL, DEFAULT_QUICKDRAW + + +def get_quick_draw(qd_url=None, requests_transport_adapter=None): + """A factory to get the quickdraw result. + + If not supplied with qd_url, it will grab QUICKDRAW_URL from constants. + If not supplied with requests_transport_adapter, it will use the defaults + provided by the Requests library. + """ + if get_quick_draw.quick_draw_results: + return get_quick_draw.quick_draw_results + url = qd_url or QUICKDRAW_URL + try: + with requests.sessions.Session() as session: + if requests_transport_adapter: + session.adapters.clear() + session.mount('http', requests_transport_adapter) + # Make sure that we can't get stuck here by specifying a brief + # timeout. + # See SPL-141718 [Splunkweb Appserver may take a long time to + # start due to SWA/splunk_instrumentation] for more details. + response = session.get(url, timeout=10).json() + get_quick_draw.quick_draw_results = response + except Exception: + return DEFAULT_QUICKDRAW + return response + + +get_quick_draw.quick_draw_results = None diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/send_data.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/send_data.py new file mode 100755 index 00000000..97e070d2 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/send_data.py @@ -0,0 +1,66 @@ +from builtins import range +from builtins import object +import json +import time +import requests +from splunk_instrumentation.report import report +from splunk_instrumentation.datetime_util import json_serial + +CDS_API_VERSION = "1" + + +class SendData(object): + def __init__(self, endpoint=None, authKey=None, + deploymentID=None, deliverySchema=None, transaction_id=None): + self.deploymentID = deploymentID + self.deliverySchema = deliverySchema + self.source = None + self.transaction_id = transaction_id + + def send_data(self, data, sleep=6): + time.sleep(sleep) + + n = 100 + groups = [data[i:i + n] for i in range(0, len(data), n)] + profile = report.start_profiling() + for group in groups: + profile2 = report.start_profiling() + length = self.send_events(group) + report.report("SendData.log[]", {"count": len(group), "length": length}, profile2) + + report.report("SendData.count", {"count": len(data)}, profile) + + def send_events(self, data): + headers = {"Content-type": "text/json"} + + payload = self.bundle_DTOs(data) + url = "/".join([self.deliverySchema.url, self.deploymentID, str(len(data)), "0"]) + "?hash=none" + requests.post(url, data=payload, headers=headers) + + return len(payload) + + def convert(self, data, timestamp): + if self.transaction_id: + data['transactionID'] = self.transaction_id + data['deploymentID'] = self.deploymentID + data['version'] = data.get('version') or self.deliverySchema.version + + separator = '^'.join(["{", CDS_API_VERSION, "event", timestamp]) + "}" + result = { + "sdkVersion": "4.3", + "osVersion": "0", + "event_name": "Deployment", + "appVersionCode": "3", + "uuid": self.deploymentID, + "packageName": "splunk_instrumentation", + "extraData": data, + "session_id": self.transaction_id, + "appVersionName": "1"} + + return json.dumps(result, default=json_serial) + separator + + def bundle_DTOs(self, dtos): + timestamp = str(int(time.time())) + + result = [self.convert(data, timestamp) for data in dtos] + return "".join(result) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/send_log.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/send_log.py new file mode 100755 index 00000000..fd141acd --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/packager/send_log.py @@ -0,0 +1,163 @@ +"""SendLog class.""" + +from datetime import datetime, timedelta +from datetime import time as dtime +import time +import logging +import json +from splunk_instrumentation.constants import AUDIT_INDEX_NAME, INST_EXECUTION_ID, AUDIT_SOURCETYPE, INST_VERSION +from splunk_instrumentation.indexing.query_runner import QueryRunner +from splunk_instrumentation.indexing.event_writer import EventWriter + +from splunk_instrumentation.datetime_util import date_to_timestamp_str, json_serial, local_date_to_utc + +METHOD = { + "AUTO": "auto", + "MANUAL": "manual" +} + + +class SendLog(object): + """SendLog class.""" + + def __init__( + self, splunkrc=None, index_name=AUDIT_INDEX_NAME, inst_key=None, + inst_host=None, inst_port=None, query_runner=None, + event_writer=None): + """ + Constructor. + This class handles sending and reading log from the index. + """ + self.query_runner = query_runner or QueryRunner(splunkrc, index_name) + self.event_writer = event_writer or EventWriter(splunkrc, index_name) + self.source = "telemetry" + self.index_name = index_name + self._status = { + "ATTEMPTED": 'attempted', + "SUCCESS": 'success', + "FAILED": 'failed' + } + + def send_attempted(self, start, end, batchNum, visibility, method=METHOD['AUTO'], time_range=None, count=None): + """send_attempted. + + Send status attempted into index_name + start = a datetime Object + end = a datetime Object + batchNum = batch number + visibility = ['license', 'anonymous', 'support'] + method = ['auto', 'manual'] + """ + logging.info( + "attempt send " + date_to_timestamp_str(start) + ' to ' + date_to_timestamp_str(end) + ' for batch ' + str(batchNum)) + self._submit_status( + self._status["ATTEMPTED"], start, end, batchNum, visibility, + source=self.source, method=method, time_range=time_range, count=count) + + def send_completed(self, start, end, batchNum, visibility, method=METHOD['AUTO'], time_range=None, count=None): + """send_completed. + + Send status completed into index_name + start = a datetime Object + end = a datetime Object + batchNum = batch number + visibility = ['license', 'anonymous', 'support'] + method = ['auto', 'manual'] + """ + logging.info( + "completed send " + date_to_timestamp_str(start) + ' to ' + date_to_timestamp_str(end) + ' for batchNum ' + str(batchNum)) + self._submit_status( + self._status["SUCCESS"], start, end, batchNum, visibility, + source=self.source, method=method, time_range=time_range, count=count) + + def send_failed(self, start, end, batchNum, visibility, method=METHOD['AUTO'], time_range=None, count=None): + """send_failed. + + Send status failed into index_name + start = a datetime Object + end = a datetime Object + batchNum = batch number + visibility = ['license', 'anonymous', 'support'] + method = ['auto', 'manual'] + """ + logging.info( + "failed send " + date_to_timestamp_str(start) + ' to ' + date_to_timestamp_str(end) + ' for batchNum ' + str(batchNum)) + self._submit_status( + self._status["FAILED"], start, end, batchNum, visibility, + source=self.source, method=method, time_range=time_range, count=None) + + def get_last_auto_send_log(self): + """Get the last event recorded to index_name with method = auto """ + search_cmd = 'search index = ' + self.index_name + ' sourcetype=' + AUDIT_SOURCETYPE + ' method = auto| head 1' + query_results = [value for value in self.query_runner._query(search_cmd)] + + if not query_results or len(query_results) == 0: + return None + + result = json.loads(query_results[0]['_raw']) + result['start'] = datetime.fromtimestamp(float(result['start'])) + result['end'] = datetime.fromtimestamp(float(result['end'])) + logging.info( + "get_last_auto_send_log " + date_to_timestamp_str(result['start']) + + ' to ' + date_to_timestamp_str(result['end'])) + return result + + def _submit_status( + self, status, start, end, batchNum, visibility, source=None, method=METHOD['AUTO'], time_range=None, count=None): + """ submit_status. + + Formatting the data and then call submit_json on the data + """ + + visibility = self.normalize_visibility(visibility) + + data = self.bundle_data(status, start, end, batchNum, visibility, source, method, time_range, count) + + self.submit_json( + data, source=self.source) + + def submit_json(self, event, host=None, source=None): + """ + Submit a new json event directly to the index. + + If the event is not a string already, it will be converted with + `json.dumps`. + """ + if not isinstance(event, str): + event = json.dumps(event) + self.event_writer.submit(event, host=host, source=source, sourcetype=AUDIT_SOURCETYPE) + + def normalize_visibility(self, visibility): + if type(visibility) == list: + visibility = ','.join([str(value) for value in visibility]) + return visibility + + def bundle_data( + self, status, start, end, batchNum, visibility, source=None, method=METHOD['AUTO'], time_range=None, count=None): + date_range = {} + + if time_range is None: + time_range = { + "start": local_date_to_utc(start, dtime.min), + "stop": local_date_to_utc(end + timedelta(days=1), dtime.max) + } + date_range['start'] = date_to_timestamp_str(time_range.get('start')) + date_range['stop'] = date_to_timestamp_str(time_range.get('stop')) + + data = { + "time": int(time.time()), + "status": status, + "start": date_range['start'], + "end": date_range['stop'], + "batchNum": batchNum, + "executionID": INST_EXECUTION_ID, + "visibility": visibility, + "method": method, + "start_date": start, + "end_date": end, + "count": count, + "version": INST_VERSION} + + data = json.dumps(data, default=json_serial) + + return data diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/report.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/report.py new file mode 100755 index 00000000..e628eff5 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/report.py @@ -0,0 +1,107 @@ +from __future__ import print_function +from __future__ import absolute_import +import json +import os +from splunk_instrumentation.constants import INST_MODE +import time +from splunk_instrumentation.datetime_util import date_to_timestamp, json_serial, utcNow + + +class Report(object): + """ + Implements logging and profiling utilites for instrumentation.py. + + Ordinarily, you will not instantiate this class, but instead use the + instance provided in the `report` field of this module. + """ + + def __init__(self): + self.log = {} + + def report(self, name, value, start=None): + """ + Append data to self.log. + + If in DEV mode (indicated by supplying --mode=DEV on the CLI), + the reported values are printed immediately to stdout, in addtion + to being sent as in production mode. + + In production (INPUT mode), the data is accumulated until + `send` is called, which dumps the whole report as json to + be indexed. + + :param name: The name of the field to store this value in on self.log + Should be a dot-separated list of symbols. If it ends in '[]', the value + will be inserted into an array which may be appended to later. + + :param value: The value to store on self.log + + :param start: If provided, should be a time object obtained + from the `start_profiling` method. Providing this value causes a + 'time' field to be added to `value` (which must be a dict), before + it is added to self.log, which indicates the total time since + start_profiling was called. + """ + arrayTest = name.split("[") + name = arrayTest[0] + arrayTest = len(arrayTest) == 2 + + def nested_set(dic, path, value): + keys = path.split(".") + for key in keys[:-1]: + dic = dic.setdefault(key, {}) + + if arrayTest: + dic.setdefault(keys[-1], []) + dic[keys[-1]].append(value) + else: + dic[keys[-1]] = value + + if start and isinstance(value, dict): + value['time'] = self.start_profiling() - start + nested_set(self.log, name, value) + if not INST_MODE == "INPUT": + print("report::" + name + '=' + json.dumps(value, default=json_serial)) + return value + + def start_profiling(self): + """ + Returns a start time that may be passed to report.report + when logging the completion of an action to have a time field + added, indicating the duraction of the action. + """ + return time.time() + + def send(self): + """ + Prints the whole of self.log to stdout as json. + This is used to log reporting information in production + runs of the instrumentation.py script. + """ + self.log.setdefault('timestamp', date_to_timestamp(utcNow())) + print(json.dumps(self.log, default=json_serial)) + + def get(self, path): + """ + Get a field from self.log by path. + + :param path: A dot-separated list of symbols. + """ + keys = path.split(".") + dic = self.log + for key in keys: + dic = dic.setdefault(key, {}) + return dic + + def write(self): + """ + Writes the data accumulated in self.log to report.json, + next to the report python module (this module) on disk. + """ + self.log.setdefault('timestamp', date_to_timestamp(utcNow())) + with open(os.path.dirname( + os.path.realpath(__file__)) + '/report.json', 'w') as target: + target.write(json.dumps(self.log, default=json_serial)) + + +report = Report() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/salt_manager.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/salt_manager.py new file mode 100755 index 00000000..3524f531 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/salt_manager.py @@ -0,0 +1,114 @@ +import uuid +import splunk_instrumentation.splunklib as splunklib +import splunk_instrumentation.constants as constants +from splunk_instrumentation.splunklib.data import Record + + +# Salt Lifecycle: +# - On Splunk start @ swa-eligible node (search head, or single instance): +# + Sync with cluster master (CM salt overwrites any existing local salt) +# + Still no salt? Generate a new one, stick it in the conf file. +# + Conf replication fairies take it from there. +# - On demand / on read (i.e. when requested to inject into swajs, etc) +# + Read from conf file +# + No salt in the conf file? Generate a new one +# + Can't guarantee write access in this context due to user permissions, +# so we can't write it back to the conf file +# + At least attempt to use the same temporary salt until the next sync +# - On scripted input run (nightly) +# + Sync with the cluster master (CM salt overwrite any existing local salt) + +# Used when a salt cannot be found, or persisted to the conf file +temporary_salt = None + + +class SaltManager(object): + + def __init__(self, services): + self.salt = None + self.services = services + + def get_salt(self): + """ + Get this deployment's salt. One will be generated if none yet exists. + If the telemetry conf service in use is writable (because this was invoked + in the context of a system-authenticated script, or by a user with the + edit_telemetry_settings capability), it will be persisted for use by the + cluster. Otherwise a temporary salt is returned. + """ + global temporary_salt + + if self.salt is not None: + return self.salt + + self.salt = self.services.telemetry_conf_service.content.get('telemetrySalt') + + # Unlike the deployment ID - which we do not bother to generate + # if we cannot write it to the conf file - there *must* be a salt + # to ensure anonymization of PII. So, even if we can't persist it, + # we'll generate a one-time-only salt. + # + # Note: We sync with the cluster master at splunk startup, + # as well as each night during the scripted input run. + if not self.salt: + self.salt = temporary_salt or self.generate_salt() + if self.services.telemetry_conf_service.is_read_only: + temporary_salt = self.salt + else: + try: + self.write_salt_to_conf_file() + except Exception: + temporary_salt = self.salt + + return self.salt + + def sync_with_cluster(self): + """ + Pulls the value of the telemetry salt from the CM if one is found. + This ensures usernames and other information are hashed consistently + for all nodes in the cluster (for event correlation on the receiving end). + """ + try: + cm_salt = None + + resp = self.services.splunkd.request( + constants.ENDPOINTS['MASTER_SETTINGS'], + method='GET', + owner='nobody', + app=constants.INST_APP_NAME) + data = splunklib.data.load(resp.get('body').read()) + entry = data['feed'].get('entry') + if entry: + if type(entry) is list: + salt_list = [value['content'].get('telemetrySalt') for value in entry] + if salt_list: + salt_list.sort() + cm_salt = salt_list[0] + elif type(entry) is Record: + cm_salt = entry['content'].get('telemetrySalt') + + if cm_salt: + self.salt = cm_salt + self.write_salt_to_conf_file() + except Exception: + # Best effort only + pass + + def generate_salt(self): + """ + Generates a new salt. Does not save it, + as this method may need to be used to generate + a temporary salt when used in the context of a + user that cannot write to the telemetry conf + endpoint. + """ + self.salt = str(uuid.uuid4()) + return self.salt + + def write_salt_to_conf_file(self): + """ + Persists the instance's salt value to telemetry.conf + """ + self.services.telemetry_conf_service.update({ + 'telemetrySalt': self.salt + }) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/schedule_manager.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/schedule_manager.py new file mode 100755 index 00000000..0ebf5a39 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/schedule_manager.py @@ -0,0 +1,89 @@ +from splunk_instrumentation.constants import INTROSPECTION_INDEX_NAME +from splunk_instrumentation.indexing.instrumentation_index import InstrumentationIndex +from splunk_instrumentation.metrics.metrics_collection_manager import MetricsCollectionManager +from splunk_instrumentation.packager import Packager +import time +from splunk_instrumentation.report import report + + +class EventIndexer(object): + ''' + a mock list to send events to be indexed through a socket + ''' + def __init__(self, index_name=INTROSPECTION_INDEX_NAME): + self.indexer = InstrumentationIndex(index_name=index_name) + self._count = 0 + + def append(self, item): + ''' + on append send the event to the index through open socket + :param item: + :return: + ''' + self._count = self._count + 1 + self.indexer.pipe_json(item) + + def close_connection(self): + self.indexer.close_connection() + + def count(self): + return self._count + + +class ScheduleManager(object): + ''' + manager for application. + + ''' + def __init__(self, schema, factory): + self.schema = schema + self.factory = factory + self.event_indexer = None + + def phase_1(self, dateRange, index_name=INTROSPECTION_INDEX_NAME): + ''' + phase 1 does not check visibility + phase 1 runs data collection for data points marked for phase 1 in schema and indexes through EventIndexer + + :param: dateRange + :param:index_name: collected data is indexed in the index_name that is provided (default _introspection) + + :return: + ''' + self.event_indexer = EventIndexer(index_name) + self._run_collection(dateRange, self.append_via_socket, 1) + report.report("events_indexed", self.event_indexer.count()) + time.sleep(2) + + def phase_2(self, dateRange=None, index_name=INTROSPECTION_INDEX_NAME): + ''' + phase 2 should check visibility + phase 2 does two things: + - runs data collection for data points marked for phase 2 in schema and indexes through EventIndexer + - package telemetry data for this run and send to splunkx + + :param: dateRange + :param:index_name: collected data is indexed in the index_name that is provided (default _introspection) + :return: + ''' + self.event_indexer = EventIndexer(index_name) + self._run_collection(dateRange, self.append_via_socket, 2) + + # sleep for 5 seconds before runing package_send() + time.sleep(5) + + p = Packager(schema=self.schema, factory=self.factory) + p.package_send(dateRange, index_name) + + def _run_collection(self, dateRange, callback=None, phase=1): + mcm = MetricsCollectionManager(self.schema, self.factory, phase=phase) + mcm.collect_data(dateRange, callback) + + def append_via_socket(self, results): + ''' + callback to process the event: + - sending the data to event_indexer (via socket) + ''' + for event in results: + self.event_indexer.append(event) + self.event_indexer.close_connection() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/schema.json b/apps/splunk_instrumentation/bin/splunk_instrumentation/schema.json new file mode 100755 index 00000000..29a5ac1a --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/schema.json @@ -0,0 +1,1340 @@ +{ + "delivery": { + "checksum": "true", + "compress": "true", + "encoding": "UTF-8", + "format": "JSON", + "frequency": "daily", + "version": "4" + }, + "classes": [ + { + "dataPoints": [ + { + "saved_search": "instrumentation.performance.indexing", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "performance.indexing", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.performance.search", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "performance.search", + "priority": "high", + "visibility": "anonymous,support", + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.concurrent", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.search.concurrent", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 0 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.users.active", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.users.active", + "priority": "high", + "visibility": "anonymous,support", + "batch": 10 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.node", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "deployment.node", + "priority": "high", + "visibility": "anonymous,support,license", + "hash_key": ["host"], + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.index", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "deployment.index", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.index.config", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "indexer" ], + "component": "deployment.index.config", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"] + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.app", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "shc_captain" ], + "component": "deployment.app", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 10 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.app", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "!cluster_master", "search_head", "!search_peer", "!in_cluster", "!cluster_slave", "!shc_member"], + "component": "deployment.app", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.app", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": ["indexer", "!search_peer", "!cluster_slave", "!shc_member"], + "component": "deployment.app", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.dscluster", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "deployment_server" ], + "component": "deployment.dscluster", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.dsclients", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "deployment_client" ], + "component": "deployment.dsclients", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.dsservers", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "deployment_server" ], + "component": "deployment.dsservers", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.dseffectiveconfig", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "deployment_server" ], + "component": "deployment.dseffectiveconfig", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.remoteupgrade", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "deployment_server" ], + "component": "deployment.remoteupgrade", + "priority": "high", + "visibility": "anonymous,support", + "batch": 3 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.type", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.search.type", + "priority": "high", + "visibility": "anonymous,support", + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.licensing.stack", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "licensing.stack", + "priority": "high", + "visibility": "anonymous,support,license", + "hash_key": ["host"], + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.forwarders", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "deployment.forwarders", + "priority": "high", + "visibility": "anonymous,support", + "batch": 0 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.indexing.sourcetype", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.indexing.sourcetype", + "priority": "high", + "visibility": "anonymous,support", + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.clustering.indexer", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "deployment.clustering.indexer", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.app.page", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.app.page", + "priority": "high", + "visibility": "anonymous,support", + "batch": 9 + }, + { + "dataPoints": [ + { + "type": "ReportDataPoint", + "mapping" : [ + { + "path" : "queries", + "report_path": "components" + }, + { + "path" : "roles", + "report_path": "profile.roles" + }, + { + "path" : "instance_type", + "report_path": "instance.type" + }, + { + "path" : "timezone", + "date_value": "%z" + } + ] + + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "instrumentation.performance", + "priority": "high", + "visibility": "anonymous,support", + "batch": "*" + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.clustering.member", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "cluster_master" ], + "component": "deployment.clustering.member", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host", "master"], + "batch": 3 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.clustering.searchhead", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "cluster_master" ], + "component": "deployment.clustering.searchhead", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host", "master"], + "batch": 10 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.shclustering.member", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "shc_captain" ], + "component": "deployment.shclustering.member", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host", "captain"], + "batch": 3 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.distsearch.peer", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "shc_captain" ], + "component": "deployment.distsearch.peer", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 4 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.distsearch.peer", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "search_head", "!shc_member"], + "component": "deployment.distsearch.peer", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.licensing.slave", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "license_master" ], + "component": "deployment.licensing.slave", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host", "master"], + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.topology.deployment.licensing.manager", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "license_master" ], + "component": "deployment.licensing.manager", + "priority": "high", + "visibility": "anonymous,support", + "hash_key": ["host"], + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.licensing.lmredundancy.errors", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "license_master" ], + "component": "licensing.lmredundancy.errors", + "priority": "high", + "visibility": "anonymous,support,license", + "hash_key": ["host"], + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.report_acceleration", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "shc_captain" ], + "component": "usage.search.report_acceleration", + "priority": "high", + "visibility": "anonymous,support", + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.report_acceleration", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "indexer", "!search_peer", "!cluster_slave", "!shc_member", "!cluster_master", "!shc_captain", "!cluster_search_head" ], + "component": "usage.search.report_acceleration", + "priority": "high", + "visibility": "anonymous,support", + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.report_acceleration", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "search_head", "!shc_member", "!shc_captain", "!search_peer" ], + "component": "usage.search.report_acceleration", + "priority": "high", + "visibility": "anonymous,support", + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.searchTelemetry", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.search.searchTelemetry", + "priority": "high", + "visibility": "anonymous,support", + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.searchtelemetry.sourcetypeUsage", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.search.searchtelemetry.sourcetypeUsage", + "priority": "high", + "visibility": "anonymous,support", + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.lookups.lookupDefinitions", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.lookups.lookupDefinitions", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.performance.bundleReplication", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "performance.bundleReplication", + "priority": "high", + "visibility": "anonymous,support", + "batch": 3 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.performance.bundleReplicationCycle", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "performance.bundleReplicationCycle", + "priority": "high", + "visibility": "anonymous,support", + "batch": 3 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.metrics", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.metrics", + "priority": "high", + "visibility": "anonymous,support", + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.rollup", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "indexer", "!search_peer", "!cluster_slave", "!shc_member", "!cluster_master", "!shc_captain", "!cluster_search_head" ], + "component": "usage.rollup", + "priority": "high", + "visibility": "anonymous,support", + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.rollup", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "shc_captain" ], + "component": "usage.rollup", + "priority": "high", + "visibility": "anonymous,support", + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.rollup", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "!cluster_master", "search_head", "!search_peer", "!in_cluster", "!cluster_slave", "!shc_member" ], + "component": "usage.rollup", + "priority": "high", + "visibility": "anonymous,support", + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.kvstore", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.kvstore", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.kvstorebackuprestore", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.kvstorebackuprestore", + "priority": "high", + "visibility": "anonymous,support", + "batch": 8 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.healthMonitor.currentState", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.healthMonitor.currentState", + "priority": "high", + "visibility": "anonymous,support", + "batch": 4 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.deployment.featureFlags", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "indexer", "search_head", "cluster_master", "license_master"], + "component": "deployment.featureFlags", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.savedSearches.alerts", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.savedSearches.alerts", + "priority": "high", + "visibility": "anonymous,support", + "batch": 9 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.streamingMetricAlerts", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.streamingMetricAlerts", + "priority": "high", + "visibility": "anonymous,support", + "batch": 9 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.durableSearch", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.durableSearch", + "priority": "high", + "visibility": "anonymous,support", + "batch": 8 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.rest", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node"], + "component": "usage.rest", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.authentication.jwt", + "type": "SPLDataPoint" + } + ], + "phase": 2, + "interval": "nightly", + "roles": [ "lead_node"], + "component": "authentication.jwt", + "priority": "high", + "visibility": "anonymous,support", + "batch": 4 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.bucketmerge.standalone", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "indexer", "!search_peer", "!cluster_slave", "!shc_member", "!cluster_master", "!shc_captain", "!cluster_search_head" ], + "component": "usage.bucketmerge.standalone", + "priority": "high", + "visibility": "anonymous,support", + "batch": 8 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.bucketmerge.clustered", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "cluster_master" ], + "component": "usage.bucketmerge.clustered", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.configtracker.info", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.configtracker.info", + "priority": "high", + "visibility": "anonymous,support", + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.configtracker.introspection", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.configtracker.introspection", + "priority": "high", + "visibility": "anonymous,support", + "batch": 9 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.smartStore.config", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.smartStore.config", + "visibility": "anonymous,support", + "batch": 10 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.configtracker.searches", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.configtracker.searches", + "priority": "high", + "visibility": "anonymous,support", + "batch": 10 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.localproxy.config", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.localproxy.config", + "priority": "high", + "visibility": "anonymous,support", + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.supervisor.stability", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.supervisor.stability", + "priority": "high", + "visibility": "anonymous,support", + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.localproxy.info", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.localproxy.info", + "priority": "high", + "visibility": "anonymous,support", + "batch": 5 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.localproxy.client", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.localproxy.client", + "priority": "high", + "visibility": "anonymous,support", + "batch": 4 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.cmredundancy", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "cluster_master" ], + "component": "usage.cmredundancy", + "priority": "high", + "visibility": "anonymous,support", + "batch": 10 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.s3tsidxcompression", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.s3tsidxcompression", + "priority": "high", + "visibility": "anonymous,support", + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.upgrade.kvstore.standalone", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "!shc_captain", "!shc_member" ], + "component": "upgrade.kvstore.standalone", + "priority": "high", + "hash_key": ["host"], + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.upgrade.kvstore.shc", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "upgrade.kvstore.shc", + "priority": "high", + "hash_key": ["host"], + "visibility": "anonymous,support", + "batch": 7 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.upgrade.kvstore.standaloneBackfill", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "!shc_captain", "!shc_member" ], + "component": "upgrade.kvstore.standalone", + "priority": "high", + "hash_key": ["host"], + "visibility": "anonymous,support", + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.upgrade.kvstore.shcBackfill", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "upgrade.kvstore.shc", + "priority": "high", + "hash_key": ["host"], + "visibility": "anonymous,support", + "batch": 11 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.tlsBestPractices", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "indexer", "search_head", "cluster_master", "license_master"], + "component": "usage.tlsBestPractices", + "priority": "high", + "visibility": "anonymous,support", + "batch": 4 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.federatedsearch.fsh", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.federatedsearch.fsh", + "priority": "high", + "visibility": "anonymous,support", + "batch": 2 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.federatedsearch.rsh", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.federatedsearch.rsh", + "priority": "high", + "visibility": "anonymous,support", + "batch": 8 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.app.splunk_monitoring_console.info", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "app.splunk_monitoring_console.info", + "priority": "high", + "visibility": "anonymous,support", + "batch": 0 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.ingestactions.rulesets", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": ["lead_node"], + "component": "usage.ingestactions.rulesets", + "priority": "high", + "visibility": "anonymous,support", + "batch": 8 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.ingestactions.destinations", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": ["lead_node"], + "component": "usage.ingestactions.destinations", + "priority": "high", + "visibility": "anonymous,support", + "batch": 6 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.ingestactions.deletions", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": ["lead_node"], + "component": "usage.ingestactions.deletions", + "priority": "high", + "visibility": "anonymous,support", + "batch": 4 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.search.fieldFilters", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.search.fieldFilters", + "priority": "high", + "visibility": "anonymous,support", + "batch": 9 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.splunkUpgrader.status", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.splunkUpgrader.status", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.splunkUpgrader.ufUpgradeStatus", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.splunkUpgrader.ufUpgradeStatus", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.splunkUpgrader.upgraderUpgradeStatus", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.splunkUpgrader.upgraderUpgradeStatus", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.splunkUpgrader.upgradeAttempts", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.splunkUpgrader.upgradeAttempts", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.edgeprocessor.datavolume", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.edgeprocessor.datavolume", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.edgeprocessor.pipelines", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.edgeprocessor.pipelines", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.edgeprocessor.instances", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.edgeprocessor.instances", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.bulkdatamove.bucketsplitcmd", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "indexer", "!search_peer", "!cluster_slave", "!shc_member", "!cluster_master", "!shc_captain", "!cluster_search_head" ], + "component": "usage.bulkdatamove.bucketsplitcmd", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.datamanagement.agents", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.datamanagement.agents", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.datamanagement.syncedSourceTypes", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node"], + "component": "usage.datamanagement.syncedSourceTypes", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + }, + { + "dataPoints": [ + { + "saved_search": "instrumentation.usage.fips.provider", + "type": "SPLDataPoint" + } + ], + "phase": 1, + "interval": "nightly", + "roles": [ "lead_node" ], + "component": "usage.fips.provider", + "priority": "high", + "visibility": "anonymous,support", + "batch": 1 + } + ] +} diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/server_info_service.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/server_info_service.py new file mode 100755 index 00000000..1cfa5a48 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/server_info_service.py @@ -0,0 +1,40 @@ +import splunk_instrumentation.splunklib as splunklib +import splunk_instrumentation.constants as constants + + +class ServerInfoService(object): + def __init__(self, service): + self.data = None # populated by `fetch` method + self.service = service + + def fetch(self): + """ + Returns the response from the server/info endpoint + parsed into a dictionary. Saves the response as self.data. + """ + resp = self.service.request( + constants.ENDPOINTS['SERVER_INFO'], + method="GET") + + self.data = (splunklib.data.load(resp.get('body').read())) + return self.data + + @property + def data(self): + if self._data is None: + raise Exception("You must call `fetch` on the service before attempting to access data") + return self._data + + @data.setter + def data(self, value): + self._data = value + + @property + def content(self): + return self.data['feed']['entry']['content'] + + def is_cloud(self): + return 'cloud' in (self.content.get('instance_type') or '').lower() + + def is_lite(self): + return 'lite' in (self.content.get('product_type') or '').lower() diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/service_bundle.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/service_bundle.py new file mode 100755 index 00000000..817764f1 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/service_bundle.py @@ -0,0 +1,38 @@ +from splunk_instrumentation.splunkd import Splunkd +from splunk_instrumentation.telemetry_conf_service import TelemetryConfService +from splunk_instrumentation.server_info_service import ServerInfoService + + +class ServiceBundle(object): + ''' + Bundles common service objects used in instrumentation. + + We often want to share service objects to reduce round trips + back to the server. This bundle shall ensure that new services + are created with existing instances of their dependencies, if + available. Else, they are created anew as needed. + ''' + + def __init__(self, + splunkd, + telemetry_conf_service=None, + server_info_service=None): + self.splunkd = Splunkd.decorate(splunkd) + self._telemetry_conf_service = telemetry_conf_service + self._server_info_service = server_info_service + + @property + def telemetry_conf_service(self): + if self._telemetry_conf_service is None: + self._telemetry_conf_service = TelemetryConfService(self.splunkd) + self._telemetry_conf_service.fetch() + + return self._telemetry_conf_service + + @property + def server_info_service(self): + if self._server_info_service is None: + self._server_info_service = ServerInfoService(self.splunkd) + self._server_info_service.fetch() + + return self._server_info_service diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__init__.py new file mode 100755 index 00000000..ac0c36f8 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__init__.py @@ -0,0 +1,2 @@ +from __future__ import absolute_import +from splunk_instrumentation.splunkd.splunkd import Splunkd # noqa diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..69980152 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..0809296b Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/splunkd.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/splunkd.cpython-39.opt-1.pyc new file mode 100755 index 00000000..97486a76 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/splunkd.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/splunkd.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/splunkd.cpython-39.pyc new file mode 100755 index 00000000..674ee2d6 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/__pycache__/splunkd.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/splunkd.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/splunkd.py new file mode 100755 index 00000000..96bf05ff --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunkd/splunkd.py @@ -0,0 +1,76 @@ +import json +import splunk_instrumentation.splunklib.client as splunklib +from future.moves.urllib import parse as urllib_parse + + +class Splunkd(object): + ''' + A decorator for a splunkd service object, providing + convenience methods implemented specifically for this + application. + ''' + + @classmethod + def decorate(klass, service): + if service.__class__ == klass: + # The service param is already wrapped + return service + else: + # Call the constructor with the pre-existing + # service handle (invoking wrapper semantics). + return klass(service=service) + + def __init__(self, **kwargs): + if kwargs.get('service'): + # Wrapper semantics + self.service = kwargs['service'] + elif kwargs.get('token'): + # Connection by token + if kwargs.get('server_uri'): + splunkd = urllib_parse.urlsplit(kwargs.get('server_uri'), allow_fragments=False) + kwargs['scheme'] = splunkd.scheme + kwargs['host'] = splunkd.hostname + kwargs['port'] = splunkd.port + self.service = splunklib.connect(**kwargs) + elif kwargs.get('service'): + self.service = kwargs['service'] + else: + # Connection by standard auth + self.service = splunklib.connect(**kwargs) + + def has_index(self, name): + return self.get_index(name) is not None + + # The normal splunkd.indexes[NAME] method of retrieving + # an index raises an exception when it does not exist. + # While a normal dictionary has a `.get` method that simply + # returns None for DNE, in splunklib this method is used to perform + # a GET request. + def get_index(self, name): + for index in self.service.indexes: + if index.name == name: + return index + return None + + def get_data(self, path_segment, **kwargs): + return splunklib.data.load( + self.get(path_segment, **kwargs) + .get('body') + .read()) + + def get_json(self, *args, **kwargs): + ''' + Performs a get request for a json response and returns the parsed body + ''' + return json.loads( + self.get(*args, output_mode='json', **kwargs).get('body').read()) + + def get_json_content(self, *args, **kwargs): + ''' + Performs a get request for a json response and returns the parsed content + from the first entry. Useful for endpoints that only ever return one entry. + ''' + return self.get_json(*args, **kwargs)['entry'][0]['content'] + + def __getattr__(self, name): + return getattr(self.service, name) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__init__.py new file mode 100755 index 00000000..db3701fc --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__init__.py @@ -0,0 +1,35 @@ +# Copyright 2011-2015 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""Python library for Splunk.""" + +from __future__ import absolute_import +from splunk_instrumentation.splunklib.six.moves import map +import logging + +DEFAULT_LOG_FORMAT = '%(asctime)s, Level=%(levelname)s, Pid=%(process)s, Logger=%(name)s, File=%(filename)s, ' \ + 'Line=%(lineno)s, %(message)s' +DEFAULT_DATE_FORMAT = '%Y-%m-%d %H:%M:%S %Z' + + +# To set the logging level of splunklib +# ex. To enable debug logs, call this method with parameter 'logging.DEBUG' +# default logging level is set to 'WARNING' +def setup_logging(level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT): + logging.basicConfig(level=level, + format=log_format, + datefmt=date_format) + +__version_info__ = (1, 7, 2) +__version__ = ".".join(map(str, __version_info__)) diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/__init__.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/__init__.cpython-39.opt-1.pyc new file mode 100755 index 00000000..be60bd35 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/__init__.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/__init__.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/__init__.cpython-39.pyc new file mode 100755 index 00000000..22795b7f Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/__init__.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/binding.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/binding.cpython-39.opt-1.pyc new file mode 100755 index 00000000..8bff6613 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/binding.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/binding.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/binding.cpython-39.pyc new file mode 100755 index 00000000..eea3afa8 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/binding.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/client.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/client.cpython-39.opt-1.pyc new file mode 100755 index 00000000..5d12ce33 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/client.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/client.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/client.cpython-39.pyc new file mode 100755 index 00000000..093ce68a Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/client.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/data.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/data.cpython-39.opt-1.pyc new file mode 100755 index 00000000..4bedf9c7 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/data.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/data.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/data.cpython-39.pyc new file mode 100755 index 00000000..74235602 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/data.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/results.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/results.cpython-39.opt-1.pyc new file mode 100755 index 00000000..46b12c82 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/results.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/results.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/results.cpython-39.pyc new file mode 100755 index 00000000..9326ef07 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/results.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/six.cpython-39.opt-1.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/six.cpython-39.opt-1.pyc new file mode 100755 index 00000000..6eb48ec8 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/six.cpython-39.opt-1.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/six.cpython-39.pyc b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/six.cpython-39.pyc new file mode 100755 index 00000000..4c62eb71 Binary files /dev/null and b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/__pycache__/six.cpython-39.pyc differ diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/binding.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/binding.py new file mode 100755 index 00000000..5285f08f --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/binding.py @@ -0,0 +1,1471 @@ +# Copyright 2011-2015 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""The **splunklib.binding** module provides a low-level binding interface to the +`Splunk REST API `_. + +This module handles the wire details of calling the REST API, such as +authentication tokens, prefix paths, URL encoding, and so on. Actual path +segments, ``GET`` and ``POST`` arguments, and the parsing of responses is left +to the user. + +If you want a friendlier interface to the Splunk REST API, use the +:mod:`splunklib.client` module. +""" + +from __future__ import absolute_import + +import io +import logging +import socket +import ssl +import sys +import time +from base64 import b64encode +from contextlib import contextmanager +from datetime import datetime +from functools import wraps +from io import BytesIO +from xml.etree.ElementTree import XML +import json + +from splunk_instrumentation.splunklib import six +from splunk_instrumentation.splunklib.six.moves import urllib + +from .data import record + +try: + from xml.etree.ElementTree import ParseError +except ImportError as e: + from xml.parsers.expat import ExpatError as ParseError + +logger = logging.getLogger(__name__) + +__all__ = [ + "AuthenticationError", + "connect", + "Context", + "handler", + "HTTPError" +] + +# If you change these, update the docstring +# on _authority as well. +DEFAULT_HOST = "localhost" +DEFAULT_PORT = "8089" +DEFAULT_SCHEME = "https" + +def _log_duration(f): + @wraps(f) + def new_f(*args, **kwargs): + start_time = datetime.now() + val = f(*args, **kwargs) + end_time = datetime.now() + logger.debug("Operation took %s", end_time-start_time) + return val + return new_f + + +def _parse_cookies(cookie_str, dictionary): + """Tries to parse any key-value pairs of cookies in a string, + then updates the the dictionary with any key-value pairs found. + + **Example**:: + + dictionary = {} + _parse_cookies('my=value', dictionary) + # Now the following is True + dictionary['my'] == 'value' + + :param cookie_str: A string containing "key=value" pairs from an HTTP "Set-Cookie" header. + :type cookie_str: ``str`` + :param dictionary: A dictionary to update with any found key-value pairs. + :type dictionary: ``dict`` + """ + parsed_cookie = six.moves.http_cookies.SimpleCookie(cookie_str) + for cookie in parsed_cookie.values(): + dictionary[cookie.key] = cookie.coded_value + + +def _make_cookie_header(cookies): + """ + Takes a list of 2-tuples of key-value pairs of + cookies, and returns a valid HTTP ``Cookie`` + header. + + **Example**:: + + header = _make_cookie_header([("key", "value"), ("key_2", "value_2")]) + # Now the following is True + header == "key=value; key_2=value_2" + + :param cookies: A list of 2-tuples of cookie key-value pairs. + :type cookies: ``list`` of 2-tuples + :return: ``str` An HTTP header cookie string. + :rtype: ``str`` + """ + return "; ".join("%s=%s" % (key, value) for key, value in cookies) + +# Singleton values to eschew None +class _NoAuthenticationToken(object): + """The value stored in a :class:`Context` or :class:`splunklib.client.Service` + class that is not logged in. + + If a ``Context`` or ``Service`` object is created without an authentication + token, and there has not yet been a call to the ``login`` method, the token + field of the ``Context`` or ``Service`` object is set to + ``_NoAuthenticationToken``. + + Likewise, after a ``Context`` or ``Service`` object has been logged out, the + token is set to this value again. + """ + pass + + +class UrlEncoded(str): + """This class marks URL-encoded strings. + It should be considered an SDK-private implementation detail. + + Manually tracking whether strings are URL encoded can be difficult. Avoid + calling ``urllib.quote`` to replace special characters with escapes. When + you receive a URL-encoded string, *do* use ``urllib.unquote`` to replace + escapes with single characters. Then, wrap any string you want to use as a + URL in ``UrlEncoded``. Note that because the ``UrlEncoded`` class is + idempotent, making multiple calls to it is OK. + + ``UrlEncoded`` objects are identical to ``str`` objects (including being + equal if their contents are equal) except when passed to ``UrlEncoded`` + again. + + ``UrlEncoded`` removes the ``str`` type support for interpolating values + with ``%`` (doing that raises a ``TypeError``). There is no reliable way to + encode values this way, so instead, interpolate into a string, quoting by + hand, and call ``UrlEncode`` with ``skip_encode=True``. + + **Example**:: + + import urllib + UrlEncoded('%s://%s' % (scheme, urllib.quote(host)), skip_encode=True) + + If you append ``str`` strings and ``UrlEncoded`` strings, the result is also + URL encoded. + + **Example**:: + + UrlEncoded('ab c') + 'de f' == UrlEncoded('ab cde f') + 'ab c' + UrlEncoded('de f') == UrlEncoded('ab cde f') + """ + def __new__(self, val='', skip_encode=False, encode_slash=False): + if isinstance(val, UrlEncoded): + # Don't urllib.quote something already URL encoded. + return val + elif skip_encode: + return str.__new__(self, val) + elif encode_slash: + return str.__new__(self, urllib.parse.quote_plus(val)) + else: + # When subclassing str, just call str's __new__ method + # with your class and the value you want to have in the + # new string. + return str.__new__(self, urllib.parse.quote(val)) + + def __add__(self, other): + """self + other + + If *other* is not a ``UrlEncoded``, URL encode it before + adding it. + """ + if isinstance(other, UrlEncoded): + return UrlEncoded(str.__add__(self, other), skip_encode=True) + else: + return UrlEncoded(str.__add__(self, urllib.parse.quote(other)), skip_encode=True) + + def __radd__(self, other): + """other + self + + If *other* is not a ``UrlEncoded``, URL _encode it before + adding it. + """ + if isinstance(other, UrlEncoded): + return UrlEncoded(str.__radd__(self, other), skip_encode=True) + else: + return UrlEncoded(str.__add__(urllib.parse.quote(other), self), skip_encode=True) + + def __mod__(self, fields): + """Interpolation into ``UrlEncoded``s is disabled. + + If you try to write ``UrlEncoded("%s") % "abc", will get a + ``TypeError``. + """ + raise TypeError("Cannot interpolate into a UrlEncoded object.") + def __repr__(self): + return "UrlEncoded(%s)" % repr(urllib.parse.unquote(str(self))) + +@contextmanager +def _handle_auth_error(msg): + """Handle reraising HTTP authentication errors as something clearer. + + If an ``HTTPError`` is raised with status 401 (access denied) in + the body of this context manager, reraise it as an + ``AuthenticationError`` instead, with *msg* as its message. + + This function adds no round trips to the server. + + :param msg: The message to be raised in ``AuthenticationError``. + :type msg: ``str`` + + **Example**:: + + with _handle_auth_error("Your login failed."): + ... # make an HTTP request + """ + try: + yield + except HTTPError as he: + if he.status == 401: + raise AuthenticationError(msg, he) + else: + raise + +def _authentication(request_fun): + """Decorator to handle autologin and authentication errors. + + *request_fun* is a function taking no arguments that needs to + be run with this ``Context`` logged into Splunk. + + ``_authentication``'s behavior depends on whether the + ``autologin`` field of ``Context`` is set to ``True`` or + ``False``. If it's ``False``, then ``_authentication`` + aborts if the ``Context`` is not logged in, and raises an + ``AuthenticationError`` if an ``HTTPError`` of status 401 is + raised in *request_fun*. If it's ``True``, then + ``_authentication`` will try at all sensible places to + log in before issuing the request. + + If ``autologin`` is ``False``, ``_authentication`` makes + one roundtrip to the server if the ``Context`` is logged in, + or zero if it is not. If ``autologin`` is ``True``, it's less + deterministic, and may make at most three roundtrips (though + that would be a truly pathological case). + + :param request_fun: A function of no arguments encapsulating + the request to make to the server. + + **Example**:: + + import splunklib.binding as binding + c = binding.connect(..., autologin=True) + c.logout() + def f(): + c.get("/services") + return 42 + print _authentication(f) + """ + @wraps(request_fun) + def wrapper(self, *args, **kwargs): + if self.token is _NoAuthenticationToken and \ + not self.has_cookies(): + # Not yet logged in. + if self.autologin and self.username and self.password: + # This will throw an uncaught + # AuthenticationError if it fails. + self.login() + else: + # Try the request anyway without authentication. + # Most requests will fail. Some will succeed, such as + # 'GET server/info'. + with _handle_auth_error("Request aborted: not logged in."): + return request_fun(self, *args, **kwargs) + try: + # Issue the request + return request_fun(self, *args, **kwargs) + except HTTPError as he: + if he.status == 401 and self.autologin: + # Authentication failed. Try logging in, and then + # rerunning the request. If either step fails, throw + # an AuthenticationError and give up. + with _handle_auth_error("Autologin failed."): + self.login() + with _handle_auth_error( + "Authentication Failed! If session token is used, it seems to have been expired."): + return request_fun(self, *args, **kwargs) + elif he.status == 401 and not self.autologin: + raise AuthenticationError( + "Request failed: Session is not logged in.", he) + else: + raise + + return wrapper + + +def _authority(scheme=DEFAULT_SCHEME, host=DEFAULT_HOST, port=DEFAULT_PORT): + """Construct a URL authority from the given *scheme*, *host*, and *port*. + + Named in accordance with RFC2396_, which defines URLs as:: + + ://? + + .. _RFC2396: http://www.ietf.org/rfc/rfc2396.txt + + So ``https://localhost:8000/a/b/b?boris=hilda`` would be parsed as:: + + scheme := https + authority := localhost:8000 + path := /a/b/c + query := boris=hilda + + :param scheme: URL scheme (the default is "https") + :type scheme: "http" or "https" + :param host: The host name (the default is "localhost") + :type host: string + :param port: The port number (the default is 8089) + :type port: integer + :return: The URL authority. + :rtype: UrlEncoded (subclass of ``str``) + + **Example**:: + + _authority() == "https://localhost:8089" + + _authority(host="splunk.utopia.net") == "https://splunk.utopia.net:8089" + + _authority(host="2001:0db8:85a3:0000:0000:8a2e:0370:7334") == \ + "https://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8089" + + _authority(scheme="http", host="splunk.utopia.net", port="471") == \ + "http://splunk.utopia.net:471" + + """ + if ':' in host: + # IPv6 addresses must be enclosed in [ ] in order to be well + # formed. + host = '[' + host + ']' + return UrlEncoded("%s://%s:%s" % (scheme, host, port), skip_encode=True) + +# kwargs: sharing, owner, app +def namespace(sharing=None, owner=None, app=None, **kwargs): + """This function constructs a Splunk namespace. + + Every Splunk resource belongs to a namespace. The namespace is specified by + the pair of values ``owner`` and ``app`` and is governed by a ``sharing`` mode. + The possible values for ``sharing`` are: "user", "app", "global" and "system", + which map to the following combinations of ``owner`` and ``app`` values: + + "user" => {owner}, {app} + + "app" => nobody, {app} + + "global" => nobody, {app} + + "system" => nobody, system + + "nobody" is a special user name that basically means no user, and "system" + is the name reserved for system resources. + + "-" is a wildcard that can be used for both ``owner`` and ``app`` values and + refers to all users and all apps, respectively. + + In general, when you specify a namespace you can specify any combination of + these three values and the library will reconcile the triple, overriding the + provided values as appropriate. + + Finally, if no namespacing is specified the library will make use of the + ``/services`` branch of the REST API, which provides a namespaced view of + Splunk resources equivelent to using ``owner={currentUser}`` and + ``app={defaultApp}``. + + The ``namespace`` function returns a representation of the namespace from + reconciling the values you provide. It ignores any keyword arguments other + than ``owner``, ``app``, and ``sharing``, so you can provide ``dicts`` of + configuration information without first having to extract individual keys. + + :param sharing: The sharing mode (the default is "user"). + :type sharing: "system", "global", "app", or "user" + :param owner: The owner context (the default is "None"). + :type owner: ``string`` + :param app: The app context (the default is "None"). + :type app: ``string`` + :returns: A :class:`splunklib.data.Record` containing the reconciled + namespace. + + **Example**:: + + import splunklib.binding as binding + n = binding.namespace(sharing="user", owner="boris", app="search") + n = binding.namespace(sharing="global", app="search") + """ + if sharing in ["system"]: + return record({'sharing': sharing, 'owner': "nobody", 'app': "system" }) + if sharing in ["global", "app"]: + return record({'sharing': sharing, 'owner': "nobody", 'app': app}) + if sharing in ["user", None]: + return record({'sharing': sharing, 'owner': owner, 'app': app}) + raise ValueError("Invalid value for argument: 'sharing'") + + +class Context(object): + """This class represents a context that encapsulates a splunkd connection. + + The ``Context`` class encapsulates the details of HTTP requests, + authentication, a default namespace, and URL prefixes to simplify access to + the REST API. + + After creating a ``Context`` object, you must call its :meth:`login` + method before you can issue requests to splunkd. Or, use the :func:`connect` + function to create an already-authenticated ``Context`` object. You can + provide a session token explicitly (the same token can be shared by multiple + ``Context`` objects) to provide authentication. + + :param host: The host name (the default is "localhost"). + :type host: ``string`` + :param port: The port number (the default is 8089). + :type port: ``integer`` + :param scheme: The scheme for accessing the service (the default is "https"). + :type scheme: "https" or "http" + :param verify: Enable (True) or disable (False) SSL verrification for https connections. + :type verify: ``Boolean`` + :param sharing: The sharing mode for the namespace (the default is "user"). + :type sharing: "global", "system", "app", or "user" + :param owner: The owner context of the namespace (optional, the default is "None"). + :type owner: ``string`` + :param app: The app context of the namespace (optional, the default is "None"). + :type app: ``string`` + :param token: A session token. When provided, you don't need to call :meth:`login`. + :type token: ``string`` + :param cookie: A session cookie. When provided, you don't need to call :meth:`login`. + This parameter is only supported for Splunk 6.2+. + :type cookie: ``string`` + :param username: The Splunk account username, which is used to + authenticate the Splunk instance. + :type username: ``string`` + :param password: The password for the Splunk account. + :type password: ``string`` + :param splunkToken: Splunk authentication token + :type splunkToken: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param retires: Number of retries for each HTTP connection (optional, the default is 0). + NOTE THAT THIS MAY INCREASE THE NUMBER OF ROUND TRIP CONNECTIONS TO THE SPLUNK SERVER AND BLOCK THE + CURRENT THREAD WHILE RETRYING. + :type retries: ``int`` + :param retryDelay: How long to wait between connection attempts if `retries` > 0 (optional, defaults to 10s). + :type retryDelay: ``int`` (in seconds) + :param handler: The HTTP request handler (optional). + :returns: A ``Context`` instance. + + **Example**:: + + import splunklib.binding as binding + c = binding.Context(username="boris", password="natasha", ...) + c.login() + # Or equivalently + c = binding.connect(username="boris", password="natasha") + # Or if you already have a session token + c = binding.Context(token="atg232342aa34324a") + # Or if you already have a valid cookie + c = binding.Context(cookie="splunkd_8089=...") + """ + def __init__(self, handler=None, **kwargs): + self.http = HttpLib(handler, kwargs.get("verify", False), key_file=kwargs.get("key_file"), + cert_file=kwargs.get("cert_file"), context=kwargs.get("context"), # Default to False for backward compat + retries=kwargs.get("retries", 0), retryDelay=kwargs.get("retryDelay", 10)) + self.token = kwargs.get("token", _NoAuthenticationToken) + if self.token is None: # In case someone explicitly passes token=None + self.token = _NoAuthenticationToken + self.scheme = kwargs.get("scheme", DEFAULT_SCHEME) + self.host = kwargs.get("host", DEFAULT_HOST) + self.port = int(kwargs.get("port", DEFAULT_PORT)) + self.authority = _authority(self.scheme, self.host, self.port) + self.namespace = namespace(**kwargs) + self.username = kwargs.get("username", "") + self.password = kwargs.get("password", "") + self.basic = kwargs.get("basic", False) + self.bearerToken = kwargs.get("splunkToken", "") + self.autologin = kwargs.get("autologin", False) + self.additional_headers = kwargs.get("headers", []) + + # Store any cookies in the self.http._cookies dict + if "cookie" in kwargs and kwargs['cookie'] not in [None, _NoAuthenticationToken]: + _parse_cookies(kwargs["cookie"], self.http._cookies) + + def get_cookies(self): + """Gets the dictionary of cookies from the ``HttpLib`` member of this instance. + + :return: Dictionary of cookies stored on the ``self.http``. + :rtype: ``dict`` + """ + return self.http._cookies + + def has_cookies(self): + """Returns true if the ``HttpLib`` member of this instance has auth token stored. + + :return: ``True`` if there is auth token present, else ``False`` + :rtype: ``bool`` + """ + auth_token_key = "splunkd_" + return any(auth_token_key in key for key in self.get_cookies().keys()) + + # Shared per-context request headers + @property + def _auth_headers(self): + """Headers required to authenticate a request. + + Assumes your ``Context`` already has a authentication token or + cookie, either provided explicitly or obtained by logging + into the Splunk instance. + + :returns: A list of 2-tuples containing key and value + """ + header = [] + if self.has_cookies(): + return [("Cookie", _make_cookie_header(list(self.get_cookies().items())))] + elif self.basic and (self.username and self.password): + token = 'Basic %s' % b64encode(("%s:%s" % (self.username, self.password)).encode('utf-8')).decode('ascii') + elif self.bearerToken: + token = 'Bearer %s' % self.bearerToken + elif self.token is _NoAuthenticationToken: + token = [] + else: + # Ensure the token is properly formatted + if self.token.startswith('Splunk '): + token = self.token + else: + token = 'Splunk %s' % self.token + if token: + header.append(("Authorization", token)) + if self.get_cookies(): + header.append(("Cookie", _make_cookie_header(list(self.get_cookies().items())))) + + return header + + def connect(self): + """Returns an open connection (socket) to the Splunk instance. + + This method is used for writing bulk events to an index or similar tasks + where the overhead of opening a connection multiple times would be + prohibitive. + + :returns: A socket. + + **Example**:: + + import splunklib.binding as binding + c = binding.connect(...) + socket = c.connect() + socket.write("POST %s HTTP/1.1\\r\\n" % "some/path/to/post/to") + socket.write("Host: %s:%s\\r\\n" % (c.host, c.port)) + socket.write("Accept-Encoding: identity\\r\\n") + socket.write("Authorization: %s\\r\\n" % c.token) + socket.write("X-Splunk-Input-Mode: Streaming\\r\\n") + socket.write("\\r\\n") + """ + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + if self.scheme == "https": + sock = ssl.wrap_socket(sock) + sock.connect((socket.gethostbyname(self.host), self.port)) + return sock + + @_authentication + @_log_duration + def delete(self, path_segment, owner=None, app=None, sharing=None, **query): + """Performs a DELETE operation at the REST path segment with the given + namespace and query. + + This method is named to match the HTTP method. ``delete`` makes at least + one round trip to the server, one additional round trip for each 303 + status returned, and at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method uses the + default :class:`Context` namespace. All other keyword arguments are + included in the URL as query parameters. + + :raises AuthenticationError: Raised when the ``Context`` object is not + logged in. + :raises HTTPError: Raised when an error occurred in a GET operation from + *path_segment*. + :param path_segment: A REST path segment. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :param query: All other keyword arguments, which are used as query + parameters. + :type query: ``string`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + c = binding.connect(...) + c.delete('saved/searches/boris') == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '1786'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 16:53:06 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'OK', + 'status': 200} + c.delete('nonexistant/path') # raises HTTPError + c.logout() + c.delete('apps/local') # raises AuthenticationError + """ + path = self.authority + self._abspath(path_segment, owner=owner, + app=app, sharing=sharing) + logger.debug("DELETE request to %s (body: %s)", path, repr(query)) + response = self.http.delete(path, self._auth_headers, **query) + return response + + @_authentication + @_log_duration + def get(self, path_segment, owner=None, app=None, headers=None, sharing=None, **query): + """Performs a GET operation from the REST path segment with the given + namespace and query. + + This method is named to match the HTTP method. ``get`` makes at least + one round trip to the server, one additional round trip for each 303 + status returned, and at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method uses the + default :class:`Context` namespace. All other keyword arguments are + included in the URL as query parameters. + + :raises AuthenticationError: Raised when the ``Context`` object is not + logged in. + :raises HTTPError: Raised when an error occurred in a GET operation from + *path_segment*. + :param path_segment: A REST path segment. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :param query: All other keyword arguments, which are used as query + parameters. + :type query: ``string`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + c = binding.connect(...) + c.get('apps/local') == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '26208'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 16:30:35 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'OK', + 'status': 200} + c.get('nonexistant/path') # raises HTTPError + c.logout() + c.get('apps/local') # raises AuthenticationError + """ + if headers is None: + headers = [] + + path = self.authority + self._abspath(path_segment, owner=owner, + app=app, sharing=sharing) + logger.debug("GET request to %s (body: %s)", path, repr(query)) + all_headers = headers + self.additional_headers + self._auth_headers + response = self.http.get(path, all_headers, **query) + return response + + @_authentication + @_log_duration + def post(self, path_segment, owner=None, app=None, sharing=None, headers=None, **query): + """Performs a POST operation from the REST path segment with the given + namespace and query. + + This method is named to match the HTTP method. ``post`` makes at least + one round trip to the server, one additional round trip for each 303 + status returned, and at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method uses the + default :class:`Context` namespace. All other keyword arguments are + included in the URL as query parameters. + + Some of Splunk's endpoints, such as ``receivers/simple`` and + ``receivers/stream``, require unstructured data in the POST body + and all metadata passed as GET-style arguments. If you provide + a ``body`` argument to ``post``, it will be used as the POST + body, and all other keyword arguments will be passed as + GET-style arguments in the URL. + + :raises AuthenticationError: Raised when the ``Context`` object is not + logged in. + :raises HTTPError: Raised when an error occurred in a GET operation from + *path_segment*. + :param path_segment: A REST path segment. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param query: All other keyword arguments, which are used as query + parameters. + :param body: Parameters to be used in the post body. If specified, + any parameters in the query will be applied to the URL instead of + the body. If a dict is supplied, the key-value pairs will be form + encoded. If a string is supplied, the body will be passed through + in the request unchanged. + :type body: ``dict`` or ``str`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + c = binding.connect(...) + c.post('saved/searches', name='boris', + search='search * earliest=-1m | head 1') == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '10455'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 16:46:06 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'Created', + 'status': 201} + c.post('nonexistant/path') # raises HTTPError + c.logout() + # raises AuthenticationError: + c.post('saved/searches', name='boris', + search='search * earliest=-1m | head 1') + """ + if headers is None: + headers = [] + + path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) + + # To avoid writing sensitive data in debug logs + endpoint_having_sensitive_data = ["/storage/passwords"] + if any(endpoint in path for endpoint in endpoint_having_sensitive_data): + logger.debug("POST request to %s ", path) + else: + logger.debug("POST request to %s (body: %s)", path, repr(query)) + all_headers = headers + self.additional_headers + self._auth_headers + response = self.http.post(path, all_headers, **query) + return response + + @_authentication + @_log_duration + def request(self, path_segment, method="GET", headers=None, body={}, + owner=None, app=None, sharing=None): + """Issues an arbitrary HTTP request to the REST path segment. + + This method is named to match ``httplib.request``. This function + makes a single round trip to the server. + + If *owner*, *app*, and *sharing* are omitted, this method uses the + default :class:`Context` namespace. All other keyword arguments are + included in the URL as query parameters. + + :raises AuthenticationError: Raised when the ``Context`` object is not + logged in. + :raises HTTPError: Raised when an error occurred in a GET operation from + *path_segment*. + :param path_segment: A REST path segment. + :type path_segment: ``string`` + :param method: The HTTP method to use (optional). + :type method: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param body: Content of the HTTP request (optional). + :type body: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + c = binding.connect(...) + c.request('saved/searches', method='GET') == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '46722'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 17:24:19 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'OK', + 'status': 200} + c.request('nonexistant/path', method='GET') # raises HTTPError + c.logout() + c.get('apps/local') # raises AuthenticationError + """ + if headers is None: + headers = [] + + path = self.authority \ + + self._abspath(path_segment, owner=owner, + app=app, sharing=sharing) + + all_headers = headers + self.additional_headers + self._auth_headers + logger.debug("%s request to %s (headers: %s, body: %s)", + method, path, str(all_headers), repr(body)) + + if body: + if method == "GET": + body = _encode(**body) + path = path + UrlEncoded('?' + body, skip_encode=True) + message = {'method': method, + 'headers': all_headers} + elif method == "POST": + if isinstance(body, dict): + body = json.dumps(body) + message = {'method': method, + 'headers': all_headers, + 'body': body} + else: + body = _encode(**body) + message = {'method': method, + 'headers': all_headers, + 'body': body} + else: + message = {'method': method, + 'headers': all_headers} + + response = self.http.request(path, message) + + return response + + def login(self): + """Logs into the Splunk instance referred to by the :class:`Context` + object. + + Unless a ``Context`` is created with an explicit authentication token + (probably obtained by logging in from a different ``Context`` object) + you must call :meth:`login` before you can issue requests. + The authentication token obtained from the server is stored in the + ``token`` field of the ``Context`` object. + + :raises AuthenticationError: Raised when login fails. + :returns: The ``Context`` object, so you can chain calls. + + **Example**:: + + import splunklib.binding as binding + c = binding.Context(...).login() + # Then issue requests... + """ + + if self.has_cookies() and \ + (not self.username and not self.password): + # If we were passed session cookie(s), but no username or + # password, then login is a nop, since we're automatically + # logged in. + return + + if self.token is not _NoAuthenticationToken and \ + (not self.username and not self.password): + # If we were passed a session token, but no username or + # password, then login is a nop, since we're automatically + # logged in. + return + + if self.basic and (self.username and self.password): + # Basic auth mode requested, so this method is a nop as long + # as credentials were passed in. + return + + if self.bearerToken: + # Bearer auth mode requested, so this method is a nop as long + # as authentication token was passed in. + return + # Only try to get a token and updated cookie if username & password are specified + try: + response = self.http.post( + self.authority + self._abspath("/services/auth/login"), + username=self.username, + password=self.password, + headers=self.additional_headers, + cookie="1") # In Splunk 6.2+, passing "cookie=1" will return the "set-cookie" header + + body = response.body.read() + session = XML(body).findtext("./sessionKey") + self.token = "Splunk %s" % session + return self + except HTTPError as he: + if he.status == 401: + raise AuthenticationError("Login failed.", he) + else: + raise + + def logout(self): + """Forgets the current session token, and cookies.""" + self.token = _NoAuthenticationToken + self.http._cookies = {} + return self + + def _abspath(self, path_segment, + owner=None, app=None, sharing=None): + """Qualifies *path_segment* into an absolute path for a URL. + + If *path_segment* is already absolute, returns it unchanged. + If *path_segment* is relative, then qualifies it with either + the provided namespace arguments or the ``Context``'s default + namespace. Any forbidden characters in *path_segment* are URL + encoded. This function has no network activity. + + Named to be consistent with RFC2396_. + + .. _RFC2396: http://www.ietf.org/rfc/rfc2396.txt + + :param path_segment: A relative or absolute URL path segment. + :type path_segment: ``string`` + :param owner, app, sharing: Components of a namespace (defaults + to the ``Context``'s namespace if all + three are omitted) + :type owner, app, sharing: ``string`` + :return: A ``UrlEncoded`` (a subclass of ``str``). + :rtype: ``string`` + + **Example**:: + + import splunklib.binding as binding + c = binding.connect(owner='boris', app='search', sharing='user') + c._abspath('/a/b/c') == '/a/b/c' + c._abspath('/a/b c/d') == '/a/b%20c/d' + c._abspath('apps/local/search') == \ + '/servicesNS/boris/search/apps/local/search' + c._abspath('apps/local/search', sharing='system') == \ + '/servicesNS/nobody/system/apps/local/search' + url = c.authority + c._abspath('apps/local/sharing') + """ + skip_encode = isinstance(path_segment, UrlEncoded) + # If path_segment is absolute, escape all forbidden characters + # in it and return it. + if path_segment.startswith('/'): + return UrlEncoded(path_segment, skip_encode=skip_encode) + + # path_segment is relative, so we need a namespace to build an + # absolute path. + if owner or app or sharing: + ns = namespace(owner=owner, app=app, sharing=sharing) + else: + ns = self.namespace + + # If no app or owner are specified, then use the /services + # endpoint. Otherwise, use /servicesNS with the specified + # namespace. If only one of app and owner is specified, use + # '-' for the other. + if ns.app is None and ns.owner is None: + return UrlEncoded("/services/%s" % path_segment, skip_encode=skip_encode) + + oname = "nobody" if ns.owner is None else ns.owner + aname = "system" if ns.app is None else ns.app + path = UrlEncoded("/servicesNS/%s/%s/%s" % (oname, aname, path_segment), + skip_encode=skip_encode) + return path + + +def connect(**kwargs): + """This function returns an authenticated :class:`Context` object. + + This function is a shorthand for calling :meth:`Context.login`. + + This function makes one round trip to the server. + + :param host: The host name (the default is "localhost"). + :type host: ``string`` + :param port: The port number (the default is 8089). + :type port: ``integer`` + :param scheme: The scheme for accessing the service (the default is "https"). + :type scheme: "https" or "http" + :param owner: The owner context of the namespace (the default is "None"). + :type owner: ``string`` + :param app: The app context of the namespace (the default is "None"). + :type app: ``string`` + :param sharing: The sharing mode for the namespace (the default is "user"). + :type sharing: "global", "system", "app", or "user" + :param token: The current session token (optional). Session tokens can be + shared across multiple service instances. + :type token: ``string`` + :param cookie: A session cookie. When provided, you don't need to call :meth:`login`. + This parameter is only supported for Splunk 6.2+. + :type cookie: ``string`` + :param username: The Splunk account username, which is used to + authenticate the Splunk instance. + :type username: ``string`` + :param password: The password for the Splunk account. + :type password: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param autologin: When ``True``, automatically tries to log in again if the + session terminates. + :type autologin: ``Boolean`` + :return: An initialized :class:`Context` instance. + + **Example**:: + + import splunklib.binding as binding + c = binding.connect(...) + response = c.get("apps/local") + """ + c = Context(**kwargs) + c.login() + return c + +# Note: the error response schema supports multiple messages but we only +# return the first, although we do return the body so that an exception +# handler that wants to read multiple messages can do so. +class HTTPError(Exception): + """This exception is raised for HTTP responses that return an error.""" + def __init__(self, response, _message=None): + status = response.status + reason = response.reason + body = response.body.read() + try: + detail = XML(body).findtext("./messages/msg") + except ParseError as err: + detail = body + message = "HTTP %d %s%s" % ( + status, reason, "" if detail is None else " -- %s" % detail) + Exception.__init__(self, _message or message) + self.status = status + self.reason = reason + self.headers = response.headers + self.body = body + self._response = response + +class AuthenticationError(HTTPError): + """Raised when a login request to Splunk fails. + + If your username was unknown or you provided an incorrect password + in a call to :meth:`Context.login` or :meth:`splunklib.client.Service.login`, + this exception is raised. + """ + def __init__(self, message, cause): + # Put the body back in the response so that HTTPError's constructor can + # read it again. + cause._response.body = BytesIO(cause.body) + + HTTPError.__init__(self, cause._response, message) + +# +# The HTTP interface used by the Splunk binding layer abstracts the underlying +# HTTP library using request & response 'messages' which are implemented as +# dictionaries with the following structure: +# +# # HTTP request message (only method required) +# request { +# method : str, +# headers? : [(str, str)*], +# body? : str, +# } +# +# # HTTP response message (all keys present) +# response { +# status : int, +# reason : str, +# headers : [(str, str)*], +# body : file, +# } +# + +# Encode the given kwargs as a query string. This wrapper will also _encode +# a list value as a sequence of assignments to the corresponding arg name, +# for example an argument such as 'foo=[1,2,3]' will be encoded as +# 'foo=1&foo=2&foo=3'. +def _encode(**kwargs): + items = [] + for key, value in six.iteritems(kwargs): + if isinstance(value, list): + items.extend([(key, item) for item in value]) + else: + items.append((key, value)) + return urllib.parse.urlencode(items) + +# Crack the given url into (scheme, host, port, path) +def _spliturl(url): + parsed_url = urllib.parse.urlparse(url) + host = parsed_url.hostname + port = parsed_url.port + path = '?'.join((parsed_url.path, parsed_url.query)) if parsed_url.query else parsed_url.path + # Strip brackets if its an IPv6 address + if host.startswith('[') and host.endswith(']'): host = host[1:-1] + if port is None: port = DEFAULT_PORT + return parsed_url.scheme, host, port, path + +# Given an HTTP request handler, this wrapper objects provides a related +# family of convenience methods built using that handler. +class HttpLib(object): + """A set of convenient methods for making HTTP calls. + + ``HttpLib`` provides a general :meth:`request` method, and :meth:`delete`, + :meth:`post`, and :meth:`get` methods for the three HTTP methods that Splunk + uses. + + By default, ``HttpLib`` uses Python's built-in ``httplib`` library, + but you can replace it by passing your own handling function to the + constructor for ``HttpLib``. + + The handling function should have the type: + + ``handler(`url`, `request_dict`) -> response_dict`` + + where `url` is the URL to make the request to (including any query and + fragment sections) as a dictionary with the following keys: + + - method: The method for the request, typically ``GET``, ``POST``, or ``DELETE``. + + - headers: A list of pairs specifying the HTTP headers (for example: ``[('key': value), ...]``). + + - body: A string containing the body to send with the request (this string + should default to ''). + + and ``response_dict`` is a dictionary with the following keys: + + - status: An integer containing the HTTP status code (such as 200 or 404). + + - reason: The reason phrase, if any, returned by the server. + + - headers: A list of pairs containing the response headers (for example, ``[('key': value), ...]``). + + - body: A stream-like object supporting ``read(size=None)`` and ``close()`` + methods to get the body of the response. + + The response dictionary is returned directly by ``HttpLib``'s methods with + no further processing. By default, ``HttpLib`` calls the :func:`handler` function + to get a handler function. + + If using the default handler, SSL verification can be disabled by passing verify=False. + """ + def __init__(self, custom_handler=None, verify=False, key_file=None, cert_file=None, context=None, retries=0, retryDelay=10): + if custom_handler is None: + self.handler = handler(verify=verify, key_file=key_file, cert_file=cert_file, context=context) + else: + self.handler = custom_handler + self._cookies = {} + self.retries = retries + self.retryDelay = retryDelay + + def delete(self, url, headers=None, **kwargs): + """Sends a DELETE request to a URL. + + :param url: The URL. + :type url: ``string`` + :param headers: A list of pairs specifying the headers for the HTTP + response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``). + :type headers: ``list`` + :param kwargs: Additional keyword arguments (optional). These arguments + are interpreted as the query part of the URL. The order of keyword + arguments is not preserved in the request, but the keywords and + their arguments will be URL encoded. + :type kwargs: ``dict`` + :returns: A dictionary describing the response (see :class:`HttpLib` for + its structure). + :rtype: ``dict`` + """ + if headers is None: headers = [] + if kwargs: + # url is already a UrlEncoded. We have to manually declare + # the query to be encoded or it will get automatically URL + # encoded by being appended to url. + url = url + UrlEncoded('?' + _encode(**kwargs), skip_encode=True) + message = { + 'method': "DELETE", + 'headers': headers, + } + return self.request(url, message) + + def get(self, url, headers=None, **kwargs): + """Sends a GET request to a URL. + + :param url: The URL. + :type url: ``string`` + :param headers: A list of pairs specifying the headers for the HTTP + response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``). + :type headers: ``list`` + :param kwargs: Additional keyword arguments (optional). These arguments + are interpreted as the query part of the URL. The order of keyword + arguments is not preserved in the request, but the keywords and + their arguments will be URL encoded. + :type kwargs: ``dict`` + :returns: A dictionary describing the response (see :class:`HttpLib` for + its structure). + :rtype: ``dict`` + """ + if headers is None: headers = [] + if kwargs: + # url is already a UrlEncoded. We have to manually declare + # the query to be encoded or it will get automatically URL + # encoded by being appended to url. + url = url + UrlEncoded('?' + _encode(**kwargs), skip_encode=True) + return self.request(url, { 'method': "GET", 'headers': headers }) + + def post(self, url, headers=None, **kwargs): + """Sends a POST request to a URL. + + :param url: The URL. + :type url: ``string`` + :param headers: A list of pairs specifying the headers for the HTTP + response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``). + :type headers: ``list`` + :param kwargs: Additional keyword arguments (optional). If the argument + is ``body``, the value is used as the body for the request, and the + keywords and their arguments will be URL encoded. If there is no + ``body`` keyword argument, all the keyword arguments are encoded + into the body of the request in the format ``x-www-form-urlencoded``. + :type kwargs: ``dict`` + :returns: A dictionary describing the response (see :class:`HttpLib` for + its structure). + :rtype: ``dict`` + """ + if headers is None: headers = [] + + # We handle GET-style arguments and an unstructured body. This is here + # to support the receivers/stream endpoint. + if 'body' in kwargs: + # We only use application/x-www-form-urlencoded if there is no other + # Content-Type header present. This can happen in cases where we + # send requests as application/json, e.g. for KV Store. + if len([x for x in headers if x[0].lower() == "content-type"]) == 0: + headers.append(("Content-Type", "application/x-www-form-urlencoded")) + + body = kwargs.pop('body') + if isinstance(body, dict): + body = _encode(**body).encode('utf-8') + if len(kwargs) > 0: + url = url + UrlEncoded('?' + _encode(**kwargs), skip_encode=True) + else: + body = _encode(**kwargs).encode('utf-8') + message = { + 'method': "POST", + 'headers': headers, + 'body': body + } + return self.request(url, message) + + def request(self, url, message, **kwargs): + """Issues an HTTP request to a URL. + + :param url: The URL. + :type url: ``string`` + :param message: A dictionary with the format as described in + :class:`HttpLib`. + :type message: ``dict`` + :param kwargs: Additional keyword arguments (optional). These arguments + are passed unchanged to the handler. + :type kwargs: ``dict`` + :returns: A dictionary describing the response (see :class:`HttpLib` for + its structure). + :rtype: ``dict`` + """ + while True: + try: + response = self.handler(url, message, **kwargs) + break + except Exception: + if self.retries <= 0: + raise + else: + time.sleep(self.retryDelay) + self.retries -= 1 + response = record(response) + if 400 <= response.status: + raise HTTPError(response) + + # Update the cookie with any HTTP request + # Initially, assume list of 2-tuples + key_value_tuples = response.headers + # If response.headers is a dict, get the key-value pairs as 2-tuples + # this is the case when using urllib2 + if isinstance(response.headers, dict): + key_value_tuples = list(response.headers.items()) + for key, value in key_value_tuples: + if key.lower() == "set-cookie": + _parse_cookies(value, self._cookies) + + return response + + +# Converts an httplib response into a file-like object. +class ResponseReader(io.RawIOBase): + """This class provides a file-like interface for :class:`httplib` responses. + + The ``ResponseReader`` class is intended to be a layer to unify the different + types of HTTP libraries used with this SDK. This class also provides a + preview of the stream and a few useful predicates. + """ + # For testing, you can use a StringIO as the argument to + # ``ResponseReader`` instead of an ``httplib.HTTPResponse``. It + # will work equally well. + def __init__(self, response, connection=None): + self._response = response + self._connection = connection + self._buffer = b'' + + def __str__(self): + if six.PY2: + return self.read() + else: + return str(self.read(), 'UTF-8') + + @property + def empty(self): + """Indicates whether there is any more data in the response.""" + return self.peek(1) == b"" + + def peek(self, size): + """Nondestructively retrieves a given number of characters. + + The next :meth:`read` operation behaves as though this method was never + called. + + :param size: The number of characters to retrieve. + :type size: ``integer`` + """ + c = self.read(size) + self._buffer = self._buffer + c + return c + + def close(self): + """Closes this response.""" + if self._connection: + self._connection.close() + self._response.close() + + def read(self, size = None): + """Reads a given number of characters from the response. + + :param size: The number of characters to read, or "None" to read the + entire response. + :type size: ``integer`` or "None" + + """ + r = self._buffer + self._buffer = b'' + if size is not None: + size -= len(r) + r = r + self._response.read(size) + return r + + def readable(self): + """ Indicates that the response reader is readable.""" + return True + + def readinto(self, byte_array): + """ Read data into a byte array, upto the size of the byte array. + + :param byte_array: A byte array/memory view to pour bytes into. + :type byte_array: ``bytearray`` or ``memoryview`` + + """ + max_size = len(byte_array) + data = self.read(max_size) + bytes_read = len(data) + byte_array[:bytes_read] = data + return bytes_read + + +def handler(key_file=None, cert_file=None, timeout=None, verify=False, context=None): + """This class returns an instance of the default HTTP request handler using + the values you provide. + + :param `key_file`: A path to a PEM (Privacy Enhanced Mail) formatted file containing your private key (optional). + :type key_file: ``string`` + :param `cert_file`: A path to a PEM (Privacy Enhanced Mail) formatted file containing a certificate chain file (optional). + :type cert_file: ``string`` + :param `timeout`: The request time-out period, in seconds (optional). + :type timeout: ``integer`` or "None" + :param `verify`: Set to False to disable SSL verification on https connections. + :type verify: ``Boolean`` + :param `context`: The SSLContext that can is used with the HTTPSConnection when verify=True is enabled and context is specified + :type context: ``SSLContext` + """ + + def connect(scheme, host, port): + kwargs = {} + if timeout is not None: kwargs['timeout'] = timeout + if scheme == "http": + return six.moves.http_client.HTTPConnection(host, port, **kwargs) + if scheme == "https": + if key_file is not None: kwargs['key_file'] = key_file + if cert_file is not None: kwargs['cert_file'] = cert_file + + if not verify: + kwargs['context'] = ssl._create_unverified_context() + elif context: + # verify is True in elif branch and context is not None + kwargs['context'] = context + + return six.moves.http_client.HTTPSConnection(host, port, **kwargs) + raise ValueError("unsupported scheme: %s" % scheme) + + def request(url, message, **kwargs): + scheme, host, port, path = _spliturl(url) + body = message.get("body", "") + head = { + "Content-Length": str(len(body)), + "Host": host, + "User-Agent": "splunk-sdk-python/1.7.2", + "Accept": "*/*", + "Connection": "Close", + } # defaults + for key, value in message["headers"]: + head[key] = value + method = message.get("method", "GET") + + connection = connect(scheme, host, port) + is_keepalive = False + try: + connection.request(method, path, body, head) + if timeout is not None: + connection.sock.settimeout(timeout) + response = connection.getresponse() + is_keepalive = "keep-alive" in response.getheader("connection", default="close").lower() + finally: + if not is_keepalive: + connection.close() + + return { + "status": response.status, + "reason": response.reason, + "headers": response.getheaders(), + "body": ResponseReader(response, connection if is_keepalive else None), + } + + return request diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/client.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/client.py new file mode 100755 index 00000000..386208a6 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/client.py @@ -0,0 +1,3876 @@ +# Copyright 2011-2015 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# The purpose of this module is to provide a friendlier domain interface to +# various Splunk endpoints. The approach here is to leverage the binding +# layer to capture endpoint context and provide objects and methods that +# offer simplified access their corresponding endpoints. The design avoids +# caching resource state. From the perspective of this module, the 'policy' +# for caching resource state belongs in the application or a higher level +# framework, and its the purpose of this module to provide simplified +# access to that resource state. +# +# A side note, the objects below that provide helper methods for updating eg: +# Entity state, are written so that they may be used in a fluent style. +# + +"""The **splunklib.client** module provides a Pythonic interface to the +`Splunk REST API `_, +allowing you programmatically access Splunk's resources. + +**splunklib.client** wraps a Pythonic layer around the wire-level +binding of the **splunklib.binding** module. The core of the library is the +:class:`Service` class, which encapsulates a connection to the server, and +provides access to the various aspects of Splunk's functionality, which are +exposed via the REST API. Typically you connect to a running Splunk instance +with the :func:`connect` function:: + + import splunklib.client as client + service = client.connect(host='localhost', port=8089, + username='admin', password='...') + assert isinstance(service, client.Service) + +:class:`Service` objects have fields for the various Splunk resources (such as apps, +jobs, saved searches, inputs, and indexes). All of these fields are +:class:`Collection` objects:: + + appcollection = service.apps + my_app = appcollection.create('my_app') + my_app = appcollection['my_app'] + appcollection.delete('my_app') + +The individual elements of the collection, in this case *applications*, +are subclasses of :class:`Entity`. An ``Entity`` object has fields for its +attributes, and methods that are specific to each kind of entity. For example:: + + print my_app['author'] # Or: print my_app.author + my_app.package() # Creates a compressed package of this application +""" + +import contextlib +import datetime +import json +import logging +import re +import socket +from datetime import datetime, timedelta +from time import sleep + +from splunk_instrumentation.splunklib import six +from splunk_instrumentation.splunklib.six.moves import urllib + +from . import data +from .binding import (AuthenticationError, Context, HTTPError, UrlEncoded, + _encode, _make_cookie_header, _NoAuthenticationToken, + namespace) +from .data import record + +logger = logging.getLogger(__name__) + +__all__ = [ + "connect", + "NotSupportedError", + "OperationError", + "IncomparableException", + "Service", + "namespace" +] + +PATH_APPS = "apps/local/" +PATH_CAPABILITIES = "authorization/capabilities/" +PATH_CONF = "configs/conf-%s/" +PATH_PROPERTIES = "properties/" +PATH_DEPLOYMENT_CLIENTS = "deployment/client/" +PATH_DEPLOYMENT_TENANTS = "deployment/tenants/" +PATH_DEPLOYMENT_SERVERS = "deployment/server/" +PATH_DEPLOYMENT_SERVERCLASSES = "deployment/serverclass/" +PATH_EVENT_TYPES = "saved/eventtypes/" +PATH_FIRED_ALERTS = "alerts/fired_alerts/" +PATH_INDEXES = "data/indexes/" +PATH_INPUTS = "data/inputs/" +PATH_JOBS = "search/jobs/" +PATH_JOBS_V2 = "search/v2/jobs/" +PATH_LOGGER = "/services/server/logger/" +PATH_MESSAGES = "messages/" +PATH_MODULAR_INPUTS = "data/modular-inputs" +PATH_ROLES = "authorization/roles/" +PATH_SAVED_SEARCHES = "saved/searches/" +PATH_STANZA = "configs/conf-%s/%s" # (file, stanza) +PATH_USERS = "authentication/users/" +PATH_RECEIVERS_STREAM = "/services/receivers/stream" +PATH_RECEIVERS_SIMPLE = "/services/receivers/simple" +PATH_STORAGE_PASSWORDS = "storage/passwords" + +XNAMEF_ATOM = "{http://www.w3.org/2005/Atom}%s" +XNAME_ENTRY = XNAMEF_ATOM % "entry" +XNAME_CONTENT = XNAMEF_ATOM % "content" + +MATCH_ENTRY_CONTENT = "%s/%s/*" % (XNAME_ENTRY, XNAME_CONTENT) + + +class IllegalOperationException(Exception): + """Thrown when an operation is not possible on the Splunk instance that a + :class:`Service` object is connected to.""" + pass + + +class IncomparableException(Exception): + """Thrown when trying to compare objects (using ``==``, ``<``, ``>``, and + so on) of a type that doesn't support it.""" + pass + + +class AmbiguousReferenceException(ValueError): + """Thrown when the name used to fetch an entity matches more than one entity.""" + pass + + +class InvalidNameException(Exception): + """Thrown when the specified name contains characters that are not allowed + in Splunk entity names.""" + pass + + +class NoSuchCapability(Exception): + """Thrown when the capability that has been referred to doesn't exist.""" + pass + + +class OperationError(Exception): + """Raised for a failed operation, such as a time out.""" + pass + + +class NotSupportedError(Exception): + """Raised for operations that are not supported on a given object.""" + pass + + +def _trailing(template, *targets): + """Substring of *template* following all *targets*. + + **Example**:: + + template = "this is a test of the bunnies." + _trailing(template, "is", "est", "the") == " bunnies" + + Each target is matched successively in the string, and the string + remaining after the last target is returned. If one of the targets + fails to match, a ValueError is raised. + + :param template: Template to extract a trailing string from. + :type template: ``string`` + :param targets: Strings to successively match in *template*. + :type targets: list of ``string``s + :return: Trailing string after all targets are matched. + :rtype: ``string`` + :raises ValueError: Raised when one of the targets does not match. + """ + s = template + for t in targets: + n = s.find(t) + if n == -1: + raise ValueError("Target " + t + " not found in template.") + s = s[n + len(t):] + return s + + +# Filter the given state content record according to the given arg list. +def _filter_content(content, *args): + if len(args) > 0: + return record((k, content[k]) for k in args) + return record((k, v) for k, v in six.iteritems(content) + if k not in ['eai:acl', 'eai:attributes', 'type']) + +# Construct a resource path from the given base path + resource name +def _path(base, name): + if not base.endswith('/'): base = base + '/' + return base + name + + +# Load an atom record from the body of the given response +# this will ultimately be sent to an xml ElementTree so we +# should use the xmlcharrefreplace option +def _load_atom(response, match=None): + return data.load(response.body.read() + .decode('utf-8', 'xmlcharrefreplace'), match) + + +# Load an array of atom entries from the body of the given response +def _load_atom_entries(response): + r = _load_atom(response) + if 'feed' in r: + # Need this to handle a random case in the REST API + if r.feed.get('totalResults') in [0, '0']: + return [] + entries = r.feed.get('entry', None) + if entries is None: return None + return entries if isinstance(entries, list) else [entries] + # Unlike most other endpoints, the jobs endpoint does not return + # its state wrapped in another element, but at the top level. + # For example, in XML, it returns ... instead of + # .... + else: + entries = r.get('entry', None) + if entries is None: return None + return entries if isinstance(entries, list) else [entries] + + +# Load the sid from the body of the given response +def _load_sid(response, output_mode): + if output_mode == "json": + json_obj = json.loads(response.body.read()) + return json_obj.get('sid') + return _load_atom(response).response.sid + + +# Parse the given atom entry record into a generic entity state record +def _parse_atom_entry(entry): + title = entry.get('title', None) + + elink = entry.get('link', []) + elink = elink if isinstance(elink, list) else [elink] + links = record((link.rel, link.href) for link in elink) + + # Retrieve entity content values + content = entry.get('content', {}) + + # Host entry metadata + metadata = _parse_atom_metadata(content) + + # Filter some of the noise out of the content record + content = record((k, v) for k, v in six.iteritems(content) + if k not in ['eai:acl', 'eai:attributes']) + + if 'type' in content: + if isinstance(content['type'], list): + content['type'] = [t for t in content['type'] if t != 'text/xml'] + # Unset type if it was only 'text/xml' + if len(content['type']) == 0: + content.pop('type', None) + # Flatten 1 element list + if len(content['type']) == 1: + content['type'] = content['type'][0] + else: + content.pop('type', None) + + return record({ + 'title': title, + 'links': links, + 'access': metadata.access, + 'fields': metadata.fields, + 'content': content, + 'updated': entry.get("updated") + }) + + +# Parse the metadata fields out of the given atom entry content record +def _parse_atom_metadata(content): + # Hoist access metadata + access = content.get('eai:acl', None) + + # Hoist content metadata (and cleanup some naming) + attributes = content.get('eai:attributes', {}) + fields = record({ + 'required': attributes.get('requiredFields', []), + 'optional': attributes.get('optionalFields', []), + 'wildcard': attributes.get('wildcardFields', [])}) + + return record({'access': access, 'fields': fields}) + +# kwargs: scheme, host, port, app, owner, username, password +def connect(**kwargs): + """This function connects and logs in to a Splunk instance. + + This function is a shorthand for :meth:`Service.login`. + The ``connect`` function makes one round trip to the server (for logging in). + + :param host: The host name (the default is "localhost"). + :type host: ``string`` + :param port: The port number (the default is 8089). + :type port: ``integer`` + :param scheme: The scheme for accessing the service (the default is "https"). + :type scheme: "https" or "http" + :param verify: Enable (True) or disable (False) SSL verification for + https connections. (optional, the default is True) + :type verify: ``Boolean`` + :param `owner`: The owner context of the namespace (optional). + :type owner: ``string`` + :param `app`: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode for the namespace (the default is "user"). + :type sharing: "global", "system", "app", or "user" + :param `token`: The current session token (optional). Session tokens can be + shared across multiple service instances. + :type token: ``string`` + :param cookie: A session cookie. When provided, you don't need to call :meth:`login`. + This parameter is only supported for Splunk 6.2+. + :type cookie: ``string`` + :param autologin: When ``True``, automatically tries to log in again if the + session terminates. + :type autologin: ``boolean`` + :param `username`: The Splunk account username, which is used to + authenticate the Splunk instance. + :type username: ``string`` + :param `password`: The password for the Splunk account. + :type password: ``string`` + :param retires: Number of retries for each HTTP connection (optional, the default is 0). + NOTE THAT THIS MAY INCREASE THE NUMBER OF ROUND TRIP CONNECTIONS TO THE SPLUNK SERVER. + :type retries: ``int`` + :param retryDelay: How long to wait between connection attempts if `retries` > 0 (optional, defaults to 10s). + :type retryDelay: ``int`` (in seconds) + :param `context`: The SSLContext that can be used when setting verify=True (optional) + :type context: ``SSLContext`` + :return: An initialized :class:`Service` connection. + + **Example**:: + + import splunklib.client as client + s = client.connect(...) + a = s.apps["my_app"] + ... + """ + s = Service(**kwargs) + s.login() + return s + + +# In preparation for adding Storm support, we added an +# intermediary class between Service and Context. Storm's +# API is not going to be the same as enterprise Splunk's +# API, so we will derive both Service (for enterprise Splunk) +# and StormService for (Splunk Storm) from _BaseService, and +# put any shared behavior on it. +class _BaseService(Context): + pass + + +class Service(_BaseService): + """A Pythonic binding to Splunk instances. + + A :class:`Service` represents a binding to a Splunk instance on an + HTTP or HTTPS port. It handles the details of authentication, wire + formats, and wraps the REST API endpoints into something more + Pythonic. All of the low-level operations on the instance from + :class:`splunklib.binding.Context` are also available in case you need + to do something beyond what is provided by this class. + + After creating a ``Service`` object, you must call its :meth:`login` + method before you can issue requests to Splunk. + Alternately, use the :func:`connect` function to create an already + authenticated :class:`Service` object, or provide a session token + when creating the :class:`Service` object explicitly (the same + token may be shared by multiple :class:`Service` objects). + + :param host: The host name (the default is "localhost"). + :type host: ``string`` + :param port: The port number (the default is 8089). + :type port: ``integer`` + :param scheme: The scheme for accessing the service (the default is "https"). + :type scheme: "https" or "http" + :param verify: Enable (True) or disable (False) SSL verification for + https connections. (optional, the default is True) + :type verify: ``Boolean`` + :param `owner`: The owner context of the namespace (optional; use "-" for wildcard). + :type owner: ``string`` + :param `app`: The app context of the namespace (optional; use "-" for wildcard). + :type app: ``string`` + :param `token`: The current session token (optional). Session tokens can be + shared across multiple service instances. + :type token: ``string`` + :param cookie: A session cookie. When provided, you don't need to call :meth:`login`. + This parameter is only supported for Splunk 6.2+. + :type cookie: ``string`` + :param `username`: The Splunk account username, which is used to + authenticate the Splunk instance. + :type username: ``string`` + :param `password`: The password, which is used to authenticate the Splunk + instance. + :type password: ``string`` + :param retires: Number of retries for each HTTP connection (optional, the default is 0). + NOTE THAT THIS MAY INCREASE THE NUMBER OF ROUND TRIP CONNECTIONS TO THE SPLUNK SERVER. + :type retries: ``int`` + :param retryDelay: How long to wait between connection attempts if `retries` > 0 (optional, defaults to 10s). + :type retryDelay: ``int`` (in seconds) + :return: A :class:`Service` instance. + + **Example**:: + + import splunklib.client as client + s = client.Service(username="boris", password="natasha", ...) + s.login() + # Or equivalently + s = client.connect(username="boris", password="natasha") + # Or if you already have a session token + s = client.Service(token="atg232342aa34324a") + # Or if you already have a valid cookie + s = client.Service(cookie="splunkd_8089=...") + """ + def __init__(self, **kwargs): + super(Service, self).__init__(**kwargs) + self._splunk_version = None + self._kvstore_owner = None + self._instance_type = None + + @property + def apps(self): + """Returns the collection of applications that are installed on this instance of Splunk. + + :return: A :class:`Collection` of :class:`Application` entities. + """ + return Collection(self, PATH_APPS, item=Application) + + @property + def confs(self): + """Returns the collection of configuration files for this Splunk instance. + + :return: A :class:`Configurations` collection of + :class:`ConfigurationFile` entities. + """ + return Configurations(self) + + @property + def capabilities(self): + """Returns the list of system capabilities. + + :return: A ``list`` of capabilities. + """ + response = self.get(PATH_CAPABILITIES) + return _load_atom(response, MATCH_ENTRY_CONTENT).capabilities + + @property + def event_types(self): + """Returns the collection of event types defined in this Splunk instance. + + :return: An :class:`Entity` containing the event types. + """ + return Collection(self, PATH_EVENT_TYPES) + + @property + def fired_alerts(self): + """Returns the collection of alerts that have been fired on the Splunk + instance, grouped by saved search. + + :return: A :class:`Collection` of :class:`AlertGroup` entities. + """ + return Collection(self, PATH_FIRED_ALERTS, item=AlertGroup) + + @property + def indexes(self): + """Returns the collection of indexes for this Splunk instance. + + :return: An :class:`Indexes` collection of :class:`Index` entities. + """ + return Indexes(self, PATH_INDEXES, item=Index) + + @property + def info(self): + """Returns the information about this instance of Splunk. + + :return: The system information, as key-value pairs. + :rtype: ``dict`` + """ + response = self.get("/services/server/info") + return _filter_content(_load_atom(response, MATCH_ENTRY_CONTENT)) + + def input(self, path, kind=None): + """Retrieves an input by path, and optionally kind. + + :return: A :class:`Input` object. + """ + return Input(self, path, kind=kind).refresh() + + @property + def inputs(self): + """Returns the collection of inputs configured on this Splunk instance. + + :return: An :class:`Inputs` collection of :class:`Input` entities. + """ + return Inputs(self) + + def job(self, sid): + """Retrieves a search job by sid. + + :return: A :class:`Job` object. + """ + return Job(self, sid).refresh() + + @property + def jobs(self): + """Returns the collection of current search jobs. + + :return: A :class:`Jobs` collection of :class:`Job` entities. + """ + return Jobs(self) + + @property + def loggers(self): + """Returns the collection of logging level categories and their status. + + :return: A :class:`Loggers` collection of logging levels. + """ + return Loggers(self) + + @property + def messages(self): + """Returns the collection of service messages. + + :return: A :class:`Collection` of :class:`Message` entities. + """ + return Collection(self, PATH_MESSAGES, item=Message) + + @property + def modular_input_kinds(self): + """Returns the collection of the modular input kinds on this Splunk instance. + + :return: A :class:`ReadOnlyCollection` of :class:`ModularInputKind` entities. + """ + if self.splunk_version >= (5,): + return ReadOnlyCollection(self, PATH_MODULAR_INPUTS, item=ModularInputKind) + else: + raise IllegalOperationException("Modular inputs are not supported before Splunk version 5.") + + @property + def storage_passwords(self): + """Returns the collection of the storage passwords on this Splunk instance. + + :return: A :class:`ReadOnlyCollection` of :class:`StoragePasswords` entities. + """ + return StoragePasswords(self) + + # kwargs: enable_lookups, reload_macros, parse_only, output_mode + def parse(self, query, **kwargs): + """Parses a search query and returns a semantic map of the search. + + :param query: The search query to parse. + :type query: ``string`` + :param kwargs: Arguments to pass to the ``search/parser`` endpoint + (optional). Valid arguments are: + + * "enable_lookups" (``boolean``): If ``True``, performs reverse lookups + to expand the search expression. + + * "output_mode" (``string``): The output format (XML or JSON). + + * "parse_only" (``boolean``): If ``True``, disables the expansion of + search due to evaluation of subsearches, time term expansion, + lookups, tags, eventtypes, and sourcetype alias. + + * "reload_macros" (``boolean``): If ``True``, reloads macro + definitions from macros.conf. + + :type kwargs: ``dict`` + :return: A semantic map of the parsed search query. + """ + if not self.disable_v2_api: + return self.post("search/v2/parser", q=query, **kwargs) + return self.get("search/parser", q=query, **kwargs) + + def restart(self, timeout=None): + """Restarts this Splunk instance. + + The service is unavailable until it has successfully restarted. + + If a *timeout* value is specified, ``restart`` blocks until the service + resumes or the timeout period has been exceeded. Otherwise, ``restart`` returns + immediately. + + :param timeout: A timeout period, in seconds. + :type timeout: ``integer`` + """ + msg = { "value": "Restart requested by " + self.username + "via the Splunk SDK for Python"} + # This message will be deleted once the server actually restarts. + self.messages.create(name="restart_required", **msg) + result = self.post("/services/server/control/restart") + if timeout is None: + return result + start = datetime.now() + diff = timedelta(seconds=timeout) + while datetime.now() - start < diff: + try: + self.login() + if not self.restart_required: + return result + except Exception as e: + sleep(1) + raise Exception("Operation time out.") + + @property + def restart_required(self): + """Indicates whether splunkd is in a state that requires a restart. + + :return: A ``boolean`` that indicates whether a restart is required. + + """ + response = self.get("messages").body.read() + messages = data.load(response)['feed'] + if 'entry' not in messages: + result = False + else: + if isinstance(messages['entry'], dict): + titles = [messages['entry']['title']] + else: + titles = [x['title'] for x in messages['entry']] + result = 'restart_required' in titles + return result + + @property + def roles(self): + """Returns the collection of user roles. + + :return: A :class:`Roles` collection of :class:`Role` entities. + """ + return Roles(self) + + def search(self, query, **kwargs): + """Runs a search using a search query and any optional arguments you + provide, and returns a `Job` object representing the search. + + :param query: A search query. + :type query: ``string`` + :param kwargs: Arguments for the search (optional): + + * "output_mode" (``string``): Specifies the output format of the + results. + + * "earliest_time" (``string``): Specifies the earliest time in the + time range to + search. The time string can be a UTC time (with fractional + seconds), a relative time specifier (to now), or a formatted + time string. + + * "latest_time" (``string``): Specifies the latest time in the time + range to + search. The time string can be a UTC time (with fractional + seconds), a relative time specifier (to now), or a formatted + time string. + + * "rf" (``string``): Specifies one or more fields to add to the + search. + + :type kwargs: ``dict`` + :rtype: class:`Job` + :returns: An object representing the created job. + """ + return self.jobs.create(query, **kwargs) + + @property + def saved_searches(self): + """Returns the collection of saved searches. + + :return: A :class:`SavedSearches` collection of :class:`SavedSearch` + entities. + """ + return SavedSearches(self) + + @property + def settings(self): + """Returns the configuration settings for this instance of Splunk. + + :return: A :class:`Settings` object containing configuration settings. + """ + return Settings(self) + + @property + def splunk_version(self): + """Returns the version of the splunkd instance this object is attached + to. + + The version is returned as a tuple of the version components as + integers (for example, `(4,3,3)` or `(5,)`). + + :return: A ``tuple`` of ``integers``. + """ + if self._splunk_version is None: + self._splunk_version = tuple([int(p) for p in self.info['version'].split('.')]) + return self._splunk_version + + @property + def splunk_instance(self): + if self._instance_type is None : + splunk_info = self.info; + if hasattr(splunk_info, 'instance_type') : + self._instance_type = splunk_info['instance_type'] + else: + self._instance_type = '' + return self._instance_type + + @property + def disable_v2_api(self): + if self.splunk_instance.lower() == 'cloud': + return self.splunk_version < (9,0,2209) + return self.splunk_version < (9,0,2) + + @property + def kvstore_owner(self): + """Returns the KVStore owner for this instance of Splunk. + + By default is the kvstore owner is not set, it will return "nobody" + :return: A string with the KVStore owner. + """ + if self._kvstore_owner is None: + self._kvstore_owner = "nobody" + return self._kvstore_owner + + @kvstore_owner.setter + def kvstore_owner(self, value): + """ + kvstore is refreshed, when the owner value is changed + """ + self._kvstore_owner = value + self.kvstore + + @property + def kvstore(self): + """Returns the collection of KV Store collections. + + sets the owner for the namespace, before retrieving the KVStore Collection + + :return: A :class:`KVStoreCollections` collection of :class:`KVStoreCollection` entities. + """ + self.namespace['owner'] = self.kvstore_owner + return KVStoreCollections(self) + + @property + def users(self): + """Returns the collection of users. + + :return: A :class:`Users` collection of :class:`User` entities. + """ + return Users(self) + + +class Endpoint(object): + """This class represents individual Splunk resources in the Splunk REST API. + + An ``Endpoint`` object represents a URI, such as ``/services/saved/searches``. + This class provides the common functionality of :class:`Collection` and + :class:`Entity` (essentially HTTP GET and POST methods). + """ + def __init__(self, service, path): + self.service = service + self.path = path + + def get_api_version(self, path): + """Return the API version of the service used in the provided path. + + Args: + path (str): A fully-qualified endpoint path (for example, "/services/search/jobs"). + + Returns: + int: Version of the API (for example, 1) + """ + # Default to v1 if undefined in the path + # For example, "/services/search/jobs" is using API v1 + api_version = 1 + + versionSearch = re.search('(?:servicesNS\/[^/]+\/[^/]+|services)\/[^/]+\/v(\d+)\/', path) + if versionSearch: + api_version = int(versionSearch.group(1)) + + return api_version + + def get(self, path_segment="", owner=None, app=None, sharing=None, **query): + """Performs a GET operation on the path segment relative to this endpoint. + + This method is named to match the HTTP method. This method makes at least + one roundtrip to the server, one additional round trip for + each 303 status returned, plus at most two additional round + trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method takes a + default namespace from the :class:`Service` object for this :class:`Endpoint`. + All other keyword arguments are included in the URL as query parameters. + + :raises AuthenticationError: Raised when the ``Service`` is not logged in. + :raises HTTPError: Raised when an error in the request occurs. + :param path_segment: A path segment relative to this endpoint. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode for the namespace (optional). + :type sharing: "global", "system", "app", or "user" + :param query: All other keyword arguments, which are used as query + parameters. + :type query: ``string`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + import splunklib.client + s = client.service(...) + apps = s.apps + apps.get() == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '26208'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 16:30:35 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'OK', + 'status': 200} + apps.get('nonexistant/path') # raises HTTPError + s.logout() + apps.get() # raises AuthenticationError + """ + # self.path to the Endpoint is relative in the SDK, so passing + # owner, app, sharing, etc. along will produce the correct + # namespace in the final request. + if path_segment.startswith('/'): + path = path_segment + else: + if not self.path.endswith('/') and path_segment != "": + self.path = self.path + '/' + path = self.service._abspath(self.path + path_segment, owner=owner, + app=app, sharing=sharing) + # ^-- This was "%s%s" % (self.path, path_segment). + # That doesn't work, because self.path may be UrlEncoded. + + # Get the API version from the path + api_version = self.get_api_version(path) + + # Search API v2+ fallback to v1: + # - In v2+, /results_preview, /events and /results do not support search params. + # - Fallback from v2+ to v1 if Splunk Version is < 9. + # if api_version >= 2 and ('search' in query and path.endswith(tuple(["results_preview", "events", "results"])) or self.service.splunk_version < (9,)): + # path = path.replace(PATH_JOBS_V2, PATH_JOBS) + + if api_version == 1: + if isinstance(path, UrlEncoded): + path = UrlEncoded(path.replace(PATH_JOBS_V2, PATH_JOBS), skip_encode=True) + else: + path = path.replace(PATH_JOBS_V2, PATH_JOBS) + + return self.service.get(path, + owner=owner, app=app, sharing=sharing, + **query) + + def post(self, path_segment="", owner=None, app=None, sharing=None, **query): + """Performs a POST operation on the path segment relative to this endpoint. + + This method is named to match the HTTP method. This method makes at least + one roundtrip to the server, one additional round trip for + each 303 status returned, plus at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method takes a + default namespace from the :class:`Service` object for this :class:`Endpoint`. + All other keyword arguments are included in the URL as query parameters. + + :raises AuthenticationError: Raised when the ``Service`` is not logged in. + :raises HTTPError: Raised when an error in the request occurs. + :param path_segment: A path segment relative to this endpoint. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :param query: All other keyword arguments, which are used as query + parameters. + :type query: ``string`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + import splunklib.client + s = client.service(...) + apps = s.apps + apps.post(name='boris') == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '2908'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 18:34:50 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'Created', + 'status': 201} + apps.get('nonexistant/path') # raises HTTPError + s.logout() + apps.get() # raises AuthenticationError + """ + if path_segment.startswith('/'): + path = path_segment + else: + if not self.path.endswith('/') and path_segment != "": + self.path = self.path + '/' + path = self.service._abspath(self.path + path_segment, owner=owner, app=app, sharing=sharing) + + # Get the API version from the path + api_version = self.get_api_version(path) + + # Search API v2+ fallback to v1: + # - In v2+, /results_preview, /events and /results do not support search params. + # - Fallback from v2+ to v1 if Splunk Version is < 9. + # if api_version >= 2 and ('search' in query and path.endswith(tuple(["results_preview", "events", "results"])) or self.service.splunk_version < (9,)): + # path = path.replace(PATH_JOBS_V2, PATH_JOBS) + + if api_version == 1: + if isinstance(path, UrlEncoded): + path = UrlEncoded(path.replace(PATH_JOBS_V2, PATH_JOBS), skip_encode=True) + else: + path = path.replace(PATH_JOBS_V2, PATH_JOBS) + + return self.service.post(path, owner=owner, app=app, sharing=sharing, **query) + + +# kwargs: path, app, owner, sharing, state +class Entity(Endpoint): + """This class is a base class for Splunk entities in the REST API, such as + saved searches, jobs, indexes, and inputs. + + ``Entity`` provides the majority of functionality required by entities. + Subclasses only implement the special cases for individual entities. + For example for saved searches, the subclass makes fields like ``action.email``, + ``alert_type``, and ``search`` available. + + An ``Entity`` is addressed like a dictionary, with a few extensions, + so the following all work, for example in saved searches:: + + ent['action.email'] + ent['alert_type'] + ent['search'] + + You can also access the fields as though they were the fields of a Python + object, as in:: + + ent.alert_type + ent.search + + However, because some of the field names are not valid Python identifiers, + the dictionary-like syntax is preferable. + + The state of an :class:`Entity` object is cached, so accessing a field + does not contact the server. If you think the values on the + server have changed, call the :meth:`Entity.refresh` method. + """ + # Not every endpoint in the API is an Entity or a Collection. For + # example, a saved search at saved/searches/{name} has an additional + # method saved/searches/{name}/scheduled_times, but this isn't an + # entity in its own right. In these cases, subclasses should + # implement a method that uses the get and post methods inherited + # from Endpoint, calls the _load_atom function (it's elsewhere in + # client.py, but not a method of any object) to read the + # information, and returns the extracted data in a Pythonesque form. + # + # The primary use of subclasses of Entity is to handle specially + # named fields in the Entity. If you only need to provide a default + # value for an optional field, subclass Entity and define a + # dictionary ``defaults``. For instance,:: + # + # class Hypothetical(Entity): + # defaults = {'anOptionalField': 'foo', + # 'anotherField': 'bar'} + # + # If you have to do more than provide a default, such as rename or + # actually process values, then define a new method with the + # ``@property`` decorator. + # + # class Hypothetical(Entity): + # @property + # def foobar(self): + # return self.content['foo'] + "-" + self.content["bar"] + + # Subclasses can override defaults the default values for + # optional fields. See above. + defaults = {} + + def __init__(self, service, path, **kwargs): + Endpoint.__init__(self, service, path) + self._state = None + if not kwargs.get('skip_refresh', False): + self.refresh(kwargs.get('state', None)) # "Prefresh" + return + + def __contains__(self, item): + try: + self[item] + return True + except (KeyError, AttributeError): + return False + + def __eq__(self, other): + """Raises IncomparableException. + + Since Entity objects are snapshots of times on the server, no + simple definition of equality will suffice beyond instance + equality, and instance equality leads to strange situations + such as:: + + import splunklib.client as client + c = client.connect(...) + saved_searches = c.saved_searches + x = saved_searches['asearch'] + + but then ``x != saved_searches['asearch']``. + + whether or not there was a change on the server. Rather than + try to do something fancy, we simple declare that equality is + undefined for Entities. + + Makes no roundtrips to the server. + """ + raise IncomparableException( + "Equality is undefined for objects of class %s" % \ + self.__class__.__name__) + + def __getattr__(self, key): + # Called when an attribute was not found by the normal method. In this + # case we try to find it in self.content and then self.defaults. + if key in self.state.content: + return self.state.content[key] + elif key in self.defaults: + return self.defaults[key] + else: + raise AttributeError(key) + + def __getitem__(self, key): + # getattr attempts to find a field on the object in the normal way, + # then calls __getattr__ if it cannot. + return getattr(self, key) + + # Load the Atom entry record from the given response - this is a method + # because the "entry" record varies slightly by entity and this allows + # for a subclass to override and handle any special cases. + def _load_atom_entry(self, response): + elem = _load_atom(response, XNAME_ENTRY) + if isinstance(elem, list): + apps = [ele.entry.content.get('eai:appName') for ele in elem] + + raise AmbiguousReferenceException( + "Fetch from server returned multiple entries for name '%s' in apps %s." % (elem[0].entry.title, apps)) + else: + return elem.entry + + # Load the entity state record from the given response + def _load_state(self, response): + entry = self._load_atom_entry(response) + return _parse_atom_entry(entry) + + def _run_action(self, path_segment, **kwargs): + """Run a method and return the content Record from the returned XML. + + A method is a relative path from an Entity that is not itself + an Entity. _run_action assumes that the returned XML is an + Atom field containing one Entry, and the contents of Entry is + what should be the return value. This is right in enough cases + to make this method useful. + """ + response = self.get(path_segment, **kwargs) + data = self._load_atom_entry(response) + rec = _parse_atom_entry(data) + return rec.content + + def _proper_namespace(self, owner=None, app=None, sharing=None): + """Produce a namespace sans wildcards for use in entity requests. + + This method tries to fill in the fields of the namespace which are `None` + or wildcard (`'-'`) from the entity's namespace. If that fails, it uses + the service's namespace. + + :param owner: + :param app: + :param sharing: + :return: + """ + if owner is None and app is None and sharing is None: # No namespace provided + if self._state is not None and 'access' in self._state: + return (self._state.access.owner, + self._state.access.app, + self._state.access.sharing) + else: + return (self.service.namespace['owner'], + self.service.namespace['app'], + self.service.namespace['sharing']) + else: + return (owner,app,sharing) + + def delete(self): + owner, app, sharing = self._proper_namespace() + return self.service.delete(self.path, owner=owner, app=app, sharing=sharing) + + def get(self, path_segment="", owner=None, app=None, sharing=None, **query): + owner, app, sharing = self._proper_namespace(owner, app, sharing) + return super(Entity, self).get(path_segment, owner=owner, app=app, sharing=sharing, **query) + + def post(self, path_segment="", owner=None, app=None, sharing=None, **query): + owner, app, sharing = self._proper_namespace(owner, app, sharing) + return super(Entity, self).post(path_segment, owner=owner, app=app, sharing=sharing, **query) + + def refresh(self, state=None): + """Refreshes the state of this entity. + + If *state* is provided, load it as the new state for this + entity. Otherwise, make a roundtrip to the server (by calling + the :meth:`read` method of ``self``) to fetch an updated state, + plus at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param state: Entity-specific arguments (optional). + :type state: ``dict`` + :raises EntityDeletedException: Raised if the entity no longer exists on + the server. + + **Example**:: + + import splunklib.client as client + s = client.connect(...) + search = s.apps['search'] + search.refresh() + """ + if state is not None: + self._state = state + else: + self._state = self.read(self.get()) + return self + + @property + def access(self): + """Returns the access metadata for this entity. + + :return: A :class:`splunklib.data.Record` object with three keys: + ``owner``, ``app``, and ``sharing``. + """ + return self.state.access + + @property + def content(self): + """Returns the contents of the entity. + + :return: A ``dict`` containing values. + """ + return self.state.content + + def disable(self): + """Disables the entity at this endpoint.""" + self.post("disable") + return self + + def enable(self): + """Enables the entity at this endpoint.""" + self.post("enable") + return self + + @property + def fields(self): + """Returns the content metadata for this entity. + + :return: A :class:`splunklib.data.Record` object with three keys: + ``required``, ``optional``, and ``wildcard``. + """ + return self.state.fields + + @property + def links(self): + """Returns a dictionary of related resources. + + :return: A ``dict`` with keys and corresponding URLs. + """ + return self.state.links + + @property + def name(self): + """Returns the entity name. + + :return: The entity name. + :rtype: ``string`` + """ + return self.state.title + + def read(self, response): + """ Reads the current state of the entity from the server. """ + results = self._load_state(response) + # In lower layers of the SDK, we end up trying to URL encode + # text to be dispatched via HTTP. However, these links are already + # URL encoded when they arrive, and we need to mark them as such. + unquoted_links = dict([(k, UrlEncoded(v, skip_encode=True)) + for k,v in six.iteritems(results['links'])]) + results['links'] = unquoted_links + return results + + def reload(self): + """Reloads the entity.""" + self.post("_reload") + return self + + @property + def state(self): + """Returns the entity's state record. + + :return: A ``dict`` containing fields and metadata for the entity. + """ + if self._state is None: self.refresh() + return self._state + + def update(self, **kwargs): + """Updates the server with any changes you've made to the current entity + along with any additional arguments you specify. + + **Note**: You cannot update the ``name`` field of an entity. + + Many of the fields in the REST API are not valid Python + identifiers, which means you cannot pass them as keyword + arguments. That is, Python will fail to parse the following:: + + # This fails + x.update(check-new=False, email.to='boris@utopia.net') + + However, you can always explicitly use a dictionary to pass + such keys:: + + # This works + x.update(**{'check-new': False, 'email.to': 'boris@utopia.net'}) + + :param kwargs: Additional entity-specific arguments (optional). + :type kwargs: ``dict`` + + :return: The entity this method is called on. + :rtype: class:`Entity` + """ + # The peculiarity in question: the REST API creates a new + # Entity if we pass name in the dictionary, instead of the + # expected behavior of updating this Entity. Therefore we + # check for 'name' in kwargs and throw an error if it is + # there. + if 'name' in kwargs: + raise IllegalOperationException('Cannot update the name of an Entity via the REST API.') + self.post(**kwargs) + return self + + +class ReadOnlyCollection(Endpoint): + """This class represents a read-only collection of entities in the Splunk + instance. + """ + def __init__(self, service, path, item=Entity): + Endpoint.__init__(self, service, path) + self.item = item # Item accessor + self.null_count = -1 + + def __contains__(self, name): + """Is there at least one entry called *name* in this collection? + + Makes a single roundtrip to the server, plus at most two more + if + the ``autologin`` field of :func:`connect` is set to ``True``. + """ + try: + self[name] + return True + except KeyError: + return False + except AmbiguousReferenceException: + return True + + def __getitem__(self, key): + """Fetch an item named *key* from this collection. + + A name is not a unique identifier in a collection. The unique + identifier is a name plus a namespace. For example, there can + be a saved search named ``'mysearch'`` with sharing ``'app'`` + in application ``'search'``, and another with sharing + ``'user'`` with owner ``'boris'`` and application + ``'search'``. If the ``Collection`` is attached to a + ``Service`` that has ``'-'`` (wildcard) as user and app in its + namespace, then both of these may be visible under the same + name. + + Where there is no conflict, ``__getitem__`` will fetch the + entity given just the name. If there is a conflict and you + pass just a name, it will raise a ``ValueError``. In that + case, add the namespace as a second argument. + + This function makes a single roundtrip to the server, plus at + most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param key: The name to fetch, or a tuple (name, namespace). + :return: An :class:`Entity` object. + :raises KeyError: Raised if *key* does not exist. + :raises ValueError: Raised if no namespace is specified and *key* + does not refer to a unique name. + + **Example**:: + + s = client.connect(...) + saved_searches = s.saved_searches + x1 = saved_searches.create( + 'mysearch', 'search * | head 1', + owner='admin', app='search', sharing='app') + x2 = saved_searches.create( + 'mysearch', 'search * | head 1', + owner='admin', app='search', sharing='user') + # Raises ValueError: + saved_searches['mysearch'] + # Fetches x1 + saved_searches[ + 'mysearch', + client.namespace(sharing='app', app='search')] + # Fetches x2 + saved_searches[ + 'mysearch', + client.namespace(sharing='user', owner='boris', app='search')] + """ + try: + if isinstance(key, tuple) and len(key) == 2: + # x[a,b] is translated to x.__getitem__( (a,b) ), so we + # have to extract values out. + key, ns = key + key = UrlEncoded(key, encode_slash=True) + response = self.get(key, owner=ns.owner, app=ns.app) + else: + key = UrlEncoded(key, encode_slash=True) + response = self.get(key) + entries = self._load_list(response) + if len(entries) > 1: + raise AmbiguousReferenceException("Found multiple entities named '%s'; please specify a namespace." % key) + elif len(entries) == 0: + raise KeyError(key) + else: + return entries[0] + except HTTPError as he: + if he.status == 404: # No entity matching key and namespace. + raise KeyError(key) + else: + raise + + def __iter__(self, **kwargs): + """Iterate over the entities in the collection. + + :param kwargs: Additional arguments. + :type kwargs: ``dict`` + :rtype: iterator over entities. + + Implemented to give Collection a listish interface. This + function always makes a roundtrip to the server, plus at most + two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + **Example**:: + + import splunklib.client as client + c = client.connect(...) + saved_searches = c.saved_searches + for entity in saved_searches: + print "Saved search named %s" % entity.name + """ + + for item in self.iter(**kwargs): + yield item + + def __len__(self): + """Enable ``len(...)`` for ``Collection`` objects. + + Implemented for consistency with a listish interface. No + further failure modes beyond those possible for any method on + an Endpoint. + + This function always makes a round trip to the server, plus at + most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + **Example**:: + + import splunklib.client as client + c = client.connect(...) + saved_searches = c.saved_searches + n = len(saved_searches) + """ + return len(self.list()) + + def _entity_path(self, state): + """Calculate the path to an entity to be returned. + + *state* should be the dictionary returned by + :func:`_parse_atom_entry`. :func:`_entity_path` extracts the + link to this entity from *state*, and strips all the namespace + prefixes from it to leave only the relative path of the entity + itself, sans namespace. + + :rtype: ``string`` + :return: an absolute path + """ + # This has been factored out so that it can be easily + # overloaded by Configurations, which has to switch its + # entities' endpoints from its own properties/ to configs/. + raw_path = urllib.parse.unquote(state.links.alternate) + if 'servicesNS/' in raw_path: + return _trailing(raw_path, 'servicesNS/', '/', '/') + elif 'services/' in raw_path: + return _trailing(raw_path, 'services/') + else: + return raw_path + + def _load_list(self, response): + """Converts *response* to a list of entities. + + *response* is assumed to be a :class:`Record` containing an + HTTP response, of the form:: + + {'status': 200, + 'headers': [('content-length', '232642'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Tue, 29 May 2012 15:27:08 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'OK', + 'body': ...a stream implementing .read()...} + + The ``'body'`` key refers to a stream containing an Atom feed, + that is, an XML document with a toplevel element ````, + and within that element one or more ```` elements. + """ + # Some subclasses of Collection have to override this because + # splunkd returns something that doesn't match + # . + entries = _load_atom_entries(response) + if entries is None: return [] + entities = [] + for entry in entries: + state = _parse_atom_entry(entry) + entity = self.item( + self.service, + self._entity_path(state), + state=state) + entities.append(entity) + + return entities + + def itemmeta(self): + """Returns metadata for members of the collection. + + Makes a single roundtrip to the server, plus two more at most if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :return: A :class:`splunklib.data.Record` object containing the metadata. + + **Example**:: + + import splunklib.client as client + import pprint + s = client.connect(...) + pprint.pprint(s.apps.itemmeta()) + {'access': {'app': 'search', + 'can_change_perms': '1', + 'can_list': '1', + 'can_share_app': '1', + 'can_share_global': '1', + 'can_share_user': '1', + 'can_write': '1', + 'modifiable': '1', + 'owner': 'admin', + 'perms': {'read': ['*'], 'write': ['admin']}, + 'removable': '0', + 'sharing': 'user'}, + 'fields': {'optional': ['author', + 'configured', + 'description', + 'label', + 'manageable', + 'template', + 'visible'], + 'required': ['name'], 'wildcard': []}} + """ + response = self.get("_new") + content = _load_atom(response, MATCH_ENTRY_CONTENT) + return _parse_atom_metadata(content) + + def iter(self, offset=0, count=None, pagesize=None, **kwargs): + """Iterates over the collection. + + This method is equivalent to the :meth:`list` method, but + it returns an iterator and can load a certain number of entities at a + time from the server. + + :param offset: The index of the first entity to return (optional). + :type offset: ``integer`` + :param count: The maximum number of entities to return (optional). + :type count: ``integer`` + :param pagesize: The number of entities to load (optional). + :type pagesize: ``integer`` + :param kwargs: Additional arguments (optional): + + - "search" (``string``): The search query to filter responses. + + - "sort_dir" (``string``): The direction to sort returned items: + "asc" or "desc". + + - "sort_key" (``string``): The field to use for sorting (optional). + + - "sort_mode" (``string``): The collating sequence for sorting + returned items: "auto", "alpha", "alpha_case", or "num". + + :type kwargs: ``dict`` + + **Example**:: + + import splunklib.client as client + s = client.connect(...) + for saved_search in s.saved_searches.iter(pagesize=10): + # Loads 10 saved searches at a time from the + # server. + ... + """ + assert pagesize is None or pagesize > 0 + if count is None: + count = self.null_count + fetched = 0 + while count == self.null_count or fetched < count: + response = self.get(count=pagesize or count, offset=offset, **kwargs) + items = self._load_list(response) + N = len(items) + fetched += N + for item in items: + yield item + if pagesize is None or N < pagesize: + break + offset += N + logger.debug("pagesize=%d, fetched=%d, offset=%d, N=%d, kwargs=%s", pagesize, fetched, offset, N, kwargs) + + # kwargs: count, offset, search, sort_dir, sort_key, sort_mode + def list(self, count=None, **kwargs): + """Retrieves a list of entities in this collection. + + The entire collection is loaded at once and is returned as a list. This + function makes a single roundtrip to the server, plus at most two more if + the ``autologin`` field of :func:`connect` is set to ``True``. + There is no caching--every call makes at least one round trip. + + :param count: The maximum number of entities to return (optional). + :type count: ``integer`` + :param kwargs: Additional arguments (optional): + + - "offset" (``integer``): The offset of the first item to return. + + - "search" (``string``): The search query to filter responses. + + - "sort_dir" (``string``): The direction to sort returned items: + "asc" or "desc". + + - "sort_key" (``string``): The field to use for sorting (optional). + + - "sort_mode" (``string``): The collating sequence for sorting + returned items: "auto", "alpha", "alpha_case", or "num". + + :type kwargs: ``dict`` + :return: A ``list`` of entities. + """ + # response = self.get(count=count, **kwargs) + # return self._load_list(response) + return list(self.iter(count=count, **kwargs)) + + + + +class Collection(ReadOnlyCollection): + """A collection of entities. + + Splunk provides a number of different collections of distinct + entity types: applications, saved searches, fired alerts, and a + number of others. Each particular type is available separately + from the Splunk instance, and the entities of that type are + returned in a :class:`Collection`. + + The interface for :class:`Collection` does not quite match either + ``list`` or ``dict`` in Python, because there are enough semantic + mismatches with either to make its behavior surprising. A unique + element in a :class:`Collection` is defined by a string giving its + name plus namespace (although the namespace is optional if the name is + unique). + + **Example**:: + + import splunklib.client as client + service = client.connect(...) + mycollection = service.saved_searches + mysearch = mycollection['my_search', client.namespace(owner='boris', app='natasha', sharing='user')] + # Or if there is only one search visible named 'my_search' + mysearch = mycollection['my_search'] + + Similarly, ``name`` in ``mycollection`` works as you might expect (though + you cannot currently pass a namespace to the ``in`` operator), as does + ``len(mycollection)``. + + However, as an aggregate, :class:`Collection` behaves more like a + list. If you iterate over a :class:`Collection`, you get an + iterator over the entities, not the names and namespaces. + + **Example**:: + + for entity in mycollection: + assert isinstance(entity, client.Entity) + + Use the :meth:`create` and :meth:`delete` methods to create and delete + entities in this collection. To view the access control list and other + metadata of the collection, use the :meth:`ReadOnlyCollection.itemmeta` method. + + :class:`Collection` does no caching. Each call makes at least one + round trip to the server to fetch data. + """ + + def create(self, name, **params): + """Creates a new entity in this collection. + + This function makes either one or two roundtrips to the + server, depending on the type of entities in this + collection, plus at most two more if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param name: The name of the entity to create. + :type name: ``string`` + :param namespace: A namespace, as created by the :func:`splunklib.binding.namespace` + function (optional). You can also set ``owner``, ``app``, and + ``sharing`` in ``params``. + :type namespace: A :class:`splunklib.data.Record` object with keys ``owner``, ``app``, + and ``sharing``. + :param params: Additional entity-specific arguments (optional). + :type params: ``dict`` + :return: The new entity. + :rtype: A subclass of :class:`Entity`, chosen by :meth:`Collection.self.item`. + + **Example**:: + + import splunklib.client as client + s = client.connect(...) + applications = s.apps + new_app = applications.create("my_fake_app") + """ + if not isinstance(name, six.string_types): + raise InvalidNameException("%s is not a valid name for an entity." % name) + if 'namespace' in params: + namespace = params.pop('namespace') + params['owner'] = namespace.owner + params['app'] = namespace.app + params['sharing'] = namespace.sharing + response = self.post(name=name, **params) + atom = _load_atom(response, XNAME_ENTRY) + if atom is None: + # This endpoint doesn't return the content of the new + # item. We have to go fetch it ourselves. + return self[name] + else: + entry = atom.entry + state = _parse_atom_entry(entry) + entity = self.item( + self.service, + self._entity_path(state), + state=state) + return entity + + def delete(self, name, **params): + """Deletes a specified entity from the collection. + + :param name: The name of the entity to delete. + :type name: ``string`` + :return: The collection. + :rtype: ``self`` + + This method is implemented for consistency with the REST API's DELETE + method. + + If there is no *name* entity on the server, a ``KeyError`` is + thrown. This function always makes a roundtrip to the server. + + **Example**:: + + import splunklib.client as client + c = client.connect(...) + saved_searches = c.saved_searches + saved_searches.create('my_saved_search', + 'search * | head 1') + assert 'my_saved_search' in saved_searches + saved_searches.delete('my_saved_search') + assert 'my_saved_search' not in saved_searches + """ + name = UrlEncoded(name, encode_slash=True) + if 'namespace' in params: + namespace = params.pop('namespace') + params['owner'] = namespace.owner + params['app'] = namespace.app + params['sharing'] = namespace.sharing + try: + self.service.delete(_path(self.path, name), **params) + except HTTPError as he: + # An HTTPError with status code 404 means that the entity + # has already been deleted, and we reraise it as a + # KeyError. + if he.status == 404: + raise KeyError("No such entity %s" % name) + else: + raise + return self + + def get(self, name="", owner=None, app=None, sharing=None, **query): + """Performs a GET request to the server on the collection. + + If *owner*, *app*, and *sharing* are omitted, this method takes a + default namespace from the :class:`Service` object for this :class:`Endpoint`. + All other keyword arguments are included in the URL as query parameters. + + :raises AuthenticationError: Raised when the ``Service`` is not logged in. + :raises HTTPError: Raised when an error in the request occurs. + :param path_segment: A path segment relative to this endpoint. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode for the namespace (optional). + :type sharing: "global", "system", "app", or "user" + :param query: All other keyword arguments, which are used as query + parameters. + :type query: ``string`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + import splunklib.client + s = client.service(...) + saved_searches = s.saved_searches + saved_searches.get("my/saved/search") == \\ + {'body': ...a response reader object..., + 'headers': [('content-length', '26208'), + ('expires', 'Fri, 30 Oct 1998 00:00:00 GMT'), + ('server', 'Splunkd'), + ('connection', 'close'), + ('cache-control', 'no-store, max-age=0, must-revalidate, no-cache'), + ('date', 'Fri, 11 May 2012 16:30:35 GMT'), + ('content-type', 'text/xml; charset=utf-8')], + 'reason': 'OK', + 'status': 200} + saved_searches.get('nonexistant/search') # raises HTTPError + s.logout() + saved_searches.get() # raises AuthenticationError + + """ + name = UrlEncoded(name, encode_slash=True) + return super(Collection, self).get(name, owner, app, sharing, **query) + + + + +class ConfigurationFile(Collection): + """This class contains all of the stanzas from one configuration file. + """ + # __init__'s arguments must match those of an Entity, not a + # Collection, since it is being created as the elements of a + # Configurations, which is a Collection subclass. + def __init__(self, service, path, **kwargs): + Collection.__init__(self, service, path, item=Stanza) + self.name = kwargs['state']['title'] + + +class Configurations(Collection): + """This class provides access to the configuration files from this Splunk + instance. Retrieve this collection using :meth:`Service.confs`. + + Splunk's configuration is divided into files, and each file into + stanzas. This collection is unusual in that the values in it are + themselves collections of :class:`ConfigurationFile` objects. + """ + def __init__(self, service): + Collection.__init__(self, service, PATH_PROPERTIES, item=ConfigurationFile) + if self.service.namespace.owner == '-' or self.service.namespace.app == '-': + raise ValueError("Configurations cannot have wildcards in namespace.") + + def __getitem__(self, key): + # The superclass implementation is designed for collections that contain + # entities. This collection (Configurations) contains collections + # (ConfigurationFile). + # + # The configurations endpoint returns multiple entities when we ask for a single file. + # This screws up the default implementation of __getitem__ from Collection, which thinks + # that multiple entities means a name collision, so we have to override it here. + try: + response = self.get(key) + return ConfigurationFile(self.service, PATH_CONF % key, state={'title': key}) + except HTTPError as he: + if he.status == 404: # No entity matching key + raise KeyError(key) + else: + raise + + def __contains__(self, key): + # configs/conf-{name} never returns a 404. We have to post to properties/{name} + # in order to find out if a configuration exists. + try: + response = self.get(key) + return True + except HTTPError as he: + if he.status == 404: # No entity matching key + return False + else: + raise + + def create(self, name): + """ Creates a configuration file named *name*. + + If there is already a configuration file with that name, + the existing file is returned. + + :param name: The name of the configuration file. + :type name: ``string`` + + :return: The :class:`ConfigurationFile` object. + """ + # This has to be overridden to handle the plumbing of creating + # a ConfigurationFile (which is a Collection) instead of some + # Entity. + if not isinstance(name, six.string_types): + raise ValueError("Invalid name: %s" % repr(name)) + response = self.post(__conf=name) + if response.status == 303: + return self[name] + elif response.status == 201: + return ConfigurationFile(self.service, PATH_CONF % name, item=Stanza, state={'title': name}) + else: + raise ValueError("Unexpected status code %s returned from creating a stanza" % response.status) + + def delete(self, key): + """Raises `IllegalOperationException`.""" + raise IllegalOperationException("Cannot delete configuration files from the REST API.") + + def _entity_path(self, state): + # Overridden to make all the ConfigurationFile objects + # returned refer to the configs/ path instead of the + # properties/ path used by Configrations. + return PATH_CONF % state['title'] + + +class Stanza(Entity): + """This class contains a single configuration stanza.""" + + def submit(self, stanza): + """Adds keys to the current configuration stanza as a + dictionary of key-value pairs. + + :param stanza: A dictionary of key-value pairs for the stanza. + :type stanza: ``dict`` + :return: The :class:`Stanza` object. + """ + body = _encode(**stanza) + self.service.post(self.path, body=body) + return self + + def __len__(self): + # The stanza endpoint returns all the keys at the same level in the XML as the eai information + # and 'disabled', so to get an accurate length, we have to filter those out and have just + # the stanza keys. + return len([x for x in self._state.content.keys() + if not x.startswith('eai') and x != 'disabled']) + + +class StoragePassword(Entity): + """This class contains a storage password. + """ + def __init__(self, service, path, **kwargs): + state = kwargs.get('state', None) + kwargs['skip_refresh'] = kwargs.get('skip_refresh', state is not None) + super(StoragePassword, self).__init__(service, path, **kwargs) + self._state = state + + @property + def clear_password(self): + return self.content.get('clear_password') + + @property + def encrypted_password(self): + return self.content.get('encr_password') + + @property + def realm(self): + return self.content.get('realm') + + @property + def username(self): + return self.content.get('username') + + +class StoragePasswords(Collection): + """This class provides access to the storage passwords from this Splunk + instance. Retrieve this collection using :meth:`Service.storage_passwords`. + """ + def __init__(self, service): + super(StoragePasswords, self).__init__(service, PATH_STORAGE_PASSWORDS, item=StoragePassword) + + def create(self, password, username, realm=None): + """ Creates a storage password. + + A `StoragePassword` can be identified by , or by : if the + optional realm parameter is also provided. + + :param password: The password for the credentials - this is the only part of the credentials that will be stored securely. + :type name: ``string`` + :param username: The username for the credentials. + :type name: ``string`` + :param realm: The credential realm. (optional) + :type name: ``string`` + + :return: The :class:`StoragePassword` object created. + """ + if self.service.namespace.owner == '-' or self.service.namespace.app == '-': + raise ValueError("While creating StoragePasswords, namespace cannot have wildcards.") + + if not isinstance(username, six.string_types): + raise ValueError("Invalid name: %s" % repr(username)) + + if realm is None: + response = self.post(password=password, name=username) + else: + response = self.post(password=password, realm=realm, name=username) + + if response.status != 201: + raise ValueError("Unexpected status code %s returned from creating a stanza" % response.status) + + entries = _load_atom_entries(response) + state = _parse_atom_entry(entries[0]) + storage_password = StoragePassword(self.service, self._entity_path(state), state=state, skip_refresh=True) + + return storage_password + + def delete(self, username, realm=None): + """Delete a storage password by username and/or realm. + + The identifier can be passed in through the username parameter as + or :, but the preferred way is by + passing in the username and realm parameters. + + :param username: The username for the credentials, or : if the realm parameter is omitted. + :type name: ``string`` + :param realm: The credential realm. (optional) + :type name: ``string`` + :return: The `StoragePassword` collection. + :rtype: ``self`` + """ + if self.service.namespace.owner == '-' or self.service.namespace.app == '-': + raise ValueError("app context must be specified when removing a password.") + + if realm is None: + # This case makes the username optional, so + # the full name can be passed in as realm. + # Assume it's already encoded. + name = username + else: + # Encode each component separately + name = UrlEncoded(realm, encode_slash=True) + ":" + UrlEncoded(username, encode_slash=True) + + # Append the : expected at the end of the name + if name[-1] != ":": + name = name + ":" + return Collection.delete(self, name) + + +class AlertGroup(Entity): + """This class represents a group of fired alerts for a saved search. Access + it using the :meth:`alerts` property.""" + def __init__(self, service, path, **kwargs): + Entity.__init__(self, service, path, **kwargs) + + def __len__(self): + return self.count + + @property + def alerts(self): + """Returns a collection of triggered alerts. + + :return: A :class:`Collection` of triggered alerts. + """ + return Collection(self.service, self.path) + + @property + def count(self): + """Returns the count of triggered alerts. + + :return: The triggered alert count. + :rtype: ``integer`` + """ + return int(self.content.get('triggered_alert_count', 0)) + + +class Indexes(Collection): + """This class contains the collection of indexes in this Splunk instance. + Retrieve this collection using :meth:`Service.indexes`. + """ + def get_default(self): + """ Returns the name of the default index. + + :return: The name of the default index. + + """ + index = self['_audit'] + return index['defaultDatabase'] + + def delete(self, name): + """ Deletes a given index. + + **Note**: This method is only supported in Splunk 5.0 and later. + + :param name: The name of the index to delete. + :type name: ``string`` + """ + if self.service.splunk_version >= (5,): + Collection.delete(self, name) + else: + raise IllegalOperationException("Deleting indexes via the REST API is " + "not supported before Splunk version 5.") + + +class Index(Entity): + """This class represents an index and provides different operations, such as + cleaning the index, writing to the index, and so forth.""" + def __init__(self, service, path, **kwargs): + Entity.__init__(self, service, path, **kwargs) + + def attach(self, host=None, source=None, sourcetype=None): + """Opens a stream (a writable socket) for writing events to the index. + + :param host: The host value for events written to the stream. + :type host: ``string`` + :param source: The source value for events written to the stream. + :type source: ``string`` + :param sourcetype: The sourcetype value for events written to the + stream. + :type sourcetype: ``string`` + + :return: A writable socket. + """ + args = { 'index': self.name } + if host is not None: args['host'] = host + if source is not None: args['source'] = source + if sourcetype is not None: args['sourcetype'] = sourcetype + path = UrlEncoded(PATH_RECEIVERS_STREAM + "?" + urllib.parse.urlencode(args), skip_encode=True) + + cookie_or_auth_header = "Authorization: Splunk %s\r\n" % \ + (self.service.token if self.service.token is _NoAuthenticationToken + else self.service.token.replace("Splunk ", "")) + + # If we have cookie(s), use them instead of "Authorization: ..." + if self.service.has_cookies(): + cookie_or_auth_header = "Cookie: %s\r\n" % _make_cookie_header(self.service.get_cookies().items()) + + # Since we need to stream to the index connection, we have to keep + # the connection open and use the Splunk extension headers to note + # the input mode + sock = self.service.connect() + headers = [("POST %s HTTP/1.1\r\n" % str(self.service._abspath(path))).encode('utf-8'), + ("Host: %s:%s\r\n" % (self.service.host, int(self.service.port))).encode('utf-8'), + b"Accept-Encoding: identity\r\n", + cookie_or_auth_header.encode('utf-8'), + b"X-Splunk-Input-Mode: Streaming\r\n", + b"\r\n"] + + for h in headers: + sock.write(h) + return sock + + @contextlib.contextmanager + def attached_socket(self, *args, **kwargs): + """Opens a raw socket in a ``with`` block to write data to Splunk. + + The arguments are identical to those for :meth:`attach`. The socket is + automatically closed at the end of the ``with`` block, even if an + exception is raised in the block. + + :param host: The host value for events written to the stream. + :type host: ``string`` + :param source: The source value for events written to the stream. + :type source: ``string`` + :param sourcetype: The sourcetype value for events written to the + stream. + :type sourcetype: ``string`` + + :returns: Nothing. + + **Example**:: + + import splunklib.client as client + s = client.connect(...) + index = s.indexes['some_index'] + with index.attached_socket(sourcetype='test') as sock: + sock.send('Test event\\r\\n') + + """ + try: + sock = self.attach(*args, **kwargs) + yield sock + finally: + sock.shutdown(socket.SHUT_RDWR) + sock.close() + + def clean(self, timeout=60): + """Deletes the contents of the index. + + This method blocks until the index is empty, because it needs to restore + values at the end of the operation. + + :param timeout: The time-out period for the operation, in seconds (the + default is 60). + :type timeout: ``integer`` + + :return: The :class:`Index`. + """ + self.refresh() + + tds = self['maxTotalDataSizeMB'] + ftp = self['frozenTimePeriodInSecs'] + was_disabled_initially = self.disabled + try: + if (not was_disabled_initially and \ + self.service.splunk_version < (5,)): + # Need to disable the index first on Splunk 4.x, + # but it doesn't work to disable it on 5.0. + self.disable() + self.update(maxTotalDataSizeMB=1, frozenTimePeriodInSecs=1) + self.roll_hot_buckets() + + # Wait until event count goes to 0. + start = datetime.now() + diff = timedelta(seconds=timeout) + while self.content.totalEventCount != '0' and datetime.now() < start+diff: + sleep(1) + self.refresh() + + if self.content.totalEventCount != '0': + raise OperationError("Cleaning index %s took longer than %s seconds; timing out." % (self.name, timeout)) + finally: + # Restore original values + self.update(maxTotalDataSizeMB=tds, frozenTimePeriodInSecs=ftp) + if (not was_disabled_initially and \ + self.service.splunk_version < (5,)): + # Re-enable the index if it was originally enabled and we messed with it. + self.enable() + + return self + + def roll_hot_buckets(self): + """Performs rolling hot buckets for this index. + + :return: The :class:`Index`. + """ + self.post("roll-hot-buckets") + return self + + def submit(self, event, host=None, source=None, sourcetype=None): + """Submits a single event to the index using ``HTTP POST``. + + :param event: The event to submit. + :type event: ``string`` + :param `host`: The host value of the event. + :type host: ``string`` + :param `source`: The source value of the event. + :type source: ``string`` + :param `sourcetype`: The sourcetype value of the event. + :type sourcetype: ``string`` + + :return: The :class:`Index`. + """ + args = { 'index': self.name } + if host is not None: args['host'] = host + if source is not None: args['source'] = source + if sourcetype is not None: args['sourcetype'] = sourcetype + + self.service.post(PATH_RECEIVERS_SIMPLE, body=event, **args) + return self + + # kwargs: host, host_regex, host_segment, rename-source, sourcetype + def upload(self, filename, **kwargs): + """Uploads a file for immediate indexing. + + **Note**: The file must be locally accessible from the server. + + :param filename: The name of the file to upload. The file can be a + plain, compressed, or archived file. + :type filename: ``string`` + :param kwargs: Additional arguments (optional). For more about the + available parameters, see `Index parameters `_ on Splunk Developer Portal. + :type kwargs: ``dict`` + + :return: The :class:`Index`. + """ + kwargs['index'] = self.name + path = 'data/inputs/oneshot' + self.service.post(path, name=filename, **kwargs) + return self + + +class Input(Entity): + """This class represents a Splunk input. This class is the base for all + typed input classes and is also used when the client does not recognize an + input kind. + """ + def __init__(self, service, path, kind=None, **kwargs): + # kind can be omitted (in which case it is inferred from the path) + # Otherwise, valid values are the paths from data/inputs ("udp", + # "monitor", "tcp/raw"), or two special cases: "tcp" (which is "tcp/raw") + # and "splunktcp" (which is "tcp/cooked"). + Entity.__init__(self, service, path, **kwargs) + if kind is None: + path_segments = path.split('/') + i = path_segments.index('inputs') + 1 + if path_segments[i] == 'tcp': + self.kind = path_segments[i] + '/' + path_segments[i+1] + else: + self.kind = path_segments[i] + else: + self.kind = kind + + # Handle old input kind names. + if self.kind == 'tcp': + self.kind = 'tcp/raw' + if self.kind == 'splunktcp': + self.kind = 'tcp/cooked' + + def update(self, **kwargs): + """Updates the server with any changes you've made to the current input + along with any additional arguments you specify. + + :param kwargs: Additional arguments (optional). For more about the + available parameters, see `Input parameters `_ on Splunk Developer Portal. + :type kwargs: ``dict`` + + :return: The input this method was called on. + :rtype: class:`Input` + """ + # UDP and TCP inputs require special handling due to their restrictToHost + # field. For all other inputs kinds, we can dispatch to the superclass method. + if self.kind not in ['tcp', 'splunktcp', 'tcp/raw', 'tcp/cooked', 'udp']: + return super(Input, self).update(**kwargs) + else: + # The behavior of restrictToHost is inconsistent across input kinds and versions of Splunk. + # In Splunk 4.x, the name of the entity is only the port, independent of the value of + # restrictToHost. In Splunk 5.0 this changed so the name will be of the form :. + # In 5.0 and 5.0.1, if you don't supply the restrictToHost value on every update, it will + # remove the host restriction from the input. As of 5.0.2 you simply can't change restrictToHost + # on an existing input. + + # The logic to handle all these cases: + # - Throw an exception if the user tries to set restrictToHost on an existing input + # for *any* version of Splunk. + # - Set the existing restrictToHost value on the update args internally so we don't + # cause it to change in Splunk 5.0 and 5.0.1. + to_update = kwargs.copy() + + if 'restrictToHost' in kwargs: + raise IllegalOperationException("Cannot set restrictToHost on an existing input with the SDK.") + elif 'restrictToHost' in self._state.content and self.kind != 'udp': + to_update['restrictToHost'] = self._state.content['restrictToHost'] + + # Do the actual update operation. + return super(Input, self).update(**to_update) + + +# Inputs is a "kinded" collection, which is a heterogenous collection where +# each item is tagged with a kind, that provides a single merged view of all +# input kinds. +class Inputs(Collection): + """This class represents a collection of inputs. The collection is + heterogeneous and each member of the collection contains a *kind* property + that indicates the specific type of input. + Retrieve this collection using :meth:`Service.inputs`.""" + + def __init__(self, service, kindmap=None): + Collection.__init__(self, service, PATH_INPUTS, item=Input) + + def __getitem__(self, key): + # The key needed to retrieve the input needs it's parenthesis to be URL encoded + # based on the REST API for input + # + if isinstance(key, tuple) and len(key) == 2: + # Fetch a single kind + key, kind = key + key = UrlEncoded(key, encode_slash=True) + try: + response = self.get(self.kindpath(kind) + "/" + key) + entries = self._load_list(response) + if len(entries) > 1: + raise AmbiguousReferenceException("Found multiple inputs of kind %s named %s." % (kind, key)) + elif len(entries) == 0: + raise KeyError((key, kind)) + else: + return entries[0] + except HTTPError as he: + if he.status == 404: # No entity matching kind and key + raise KeyError((key, kind)) + else: + raise + else: + # Iterate over all the kinds looking for matches. + kind = None + candidate = None + key = UrlEncoded(key, encode_slash=True) + for kind in self.kinds: + try: + response = self.get(kind + "/" + key) + entries = self._load_list(response) + if len(entries) > 1: + raise AmbiguousReferenceException("Found multiple inputs of kind %s named %s." % (kind, key)) + elif len(entries) == 0: + pass + else: + if candidate is not None: # Already found at least one candidate + raise AmbiguousReferenceException("Found multiple inputs named %s, please specify a kind" % key) + candidate = entries[0] + except HTTPError as he: + if he.status == 404: + pass # Just carry on to the next kind. + else: + raise + if candidate is None: + raise KeyError(key) # Never found a match. + else: + return candidate + + def __contains__(self, key): + if isinstance(key, tuple) and len(key) == 2: + # If we specify a kind, this will shortcut properly + try: + self.__getitem__(key) + return True + except KeyError: + return False + else: + # Without a kind, we want to minimize the number of round trips to the server, so we + # reimplement some of the behavior of __getitem__ in order to be able to stop searching + # on the first hit. + for kind in self.kinds: + try: + response = self.get(self.kindpath(kind) + "/" + key) + entries = self._load_list(response) + if len(entries) > 0: + return True + else: + pass + except HTTPError as he: + if he.status == 404: + pass # Just carry on to the next kind. + else: + raise + return False + + def create(self, name, kind, **kwargs): + """Creates an input of a specific kind in this collection, with any + arguments you specify. + + :param `name`: The input name. + :type name: ``string`` + :param `kind`: The kind of input: + + - "ad": Active Directory + + - "monitor": Files and directories + + - "registry": Windows Registry + + - "script": Scripts + + - "splunktcp": TCP, processed + + - "tcp": TCP, unprocessed + + - "udp": UDP + + - "win-event-log-collections": Windows event log + + - "win-perfmon": Performance monitoring + + - "win-wmi-collections": WMI + + :type kind: ``string`` + :param `kwargs`: Additional arguments (optional). For more about the + available parameters, see `Input parameters `_ on Splunk Developer Portal. + + :type kwargs: ``dict`` + + :return: The new :class:`Input`. + """ + kindpath = self.kindpath(kind) + self.post(kindpath, name=name, **kwargs) + + # If we created an input with restrictToHost set, then + # its path will be :, not just , + # and we have to adjust accordingly. + + # Url encodes the name of the entity. + name = UrlEncoded(name, encode_slash=True) + path = _path( + self.path + kindpath, + '%s:%s' % (kwargs['restrictToHost'], name) \ + if 'restrictToHost' in kwargs else name + ) + return Input(self.service, path, kind) + + def delete(self, name, kind=None): + """Removes an input from the collection. + + :param `kind`: The kind of input: + + - "ad": Active Directory + + - "monitor": Files and directories + + - "registry": Windows Registry + + - "script": Scripts + + - "splunktcp": TCP, processed + + - "tcp": TCP, unprocessed + + - "udp": UDP + + - "win-event-log-collections": Windows event log + + - "win-perfmon": Performance monitoring + + - "win-wmi-collections": WMI + + :type kind: ``string`` + :param name: The name of the input to remove. + :type name: ``string`` + + :return: The :class:`Inputs` collection. + """ + if kind is None: + self.service.delete(self[name].path) + else: + self.service.delete(self[name, kind].path) + return self + + def itemmeta(self, kind): + """Returns metadata for the members of a given kind. + + :param `kind`: The kind of input: + + - "ad": Active Directory + + - "monitor": Files and directories + + - "registry": Windows Registry + + - "script": Scripts + + - "splunktcp": TCP, processed + + - "tcp": TCP, unprocessed + + - "udp": UDP + + - "win-event-log-collections": Windows event log + + - "win-perfmon": Performance monitoring + + - "win-wmi-collections": WMI + + :type kind: ``string`` + + :return: The metadata. + :rtype: class:``splunklib.data.Record`` + """ + response = self.get("%s/_new" % self._kindmap[kind]) + content = _load_atom(response, MATCH_ENTRY_CONTENT) + return _parse_atom_metadata(content) + + def _get_kind_list(self, subpath=None): + if subpath is None: + subpath = [] + + kinds = [] + response = self.get('/'.join(subpath)) + content = _load_atom_entries(response) + for entry in content: + this_subpath = subpath + [entry.title] + # The "all" endpoint doesn't work yet. + # The "tcp/ssl" endpoint is not a real input collection. + if entry.title == 'all' or this_subpath == ['tcp','ssl']: + continue + elif 'create' in [x.rel for x in entry.link]: + path = '/'.join(subpath + [entry.title]) + kinds.append(path) + else: + subkinds = self._get_kind_list(subpath + [entry.title]) + kinds.extend(subkinds) + return kinds + + @property + def kinds(self): + """Returns the input kinds on this Splunk instance. + + :return: The list of input kinds. + :rtype: ``list`` + """ + return self._get_kind_list() + + def kindpath(self, kind): + """Returns a path to the resources for a given input kind. + + :param `kind`: The kind of input: + + - "ad": Active Directory + + - "monitor": Files and directories + + - "registry": Windows Registry + + - "script": Scripts + + - "splunktcp": TCP, processed + + - "tcp": TCP, unprocessed + + - "udp": UDP + + - "win-event-log-collections": Windows event log + + - "win-perfmon": Performance monitoring + + - "win-wmi-collections": WMI + + :type kind: ``string`` + + :return: The relative endpoint path. + :rtype: ``string`` + """ + if kind == 'tcp': + return UrlEncoded('tcp/raw', skip_encode=True) + elif kind == 'splunktcp': + return UrlEncoded('tcp/cooked', skip_encode=True) + else: + return UrlEncoded(kind, skip_encode=True) + + def list(self, *kinds, **kwargs): + """Returns a list of inputs that are in the :class:`Inputs` collection. + You can also filter by one or more input kinds. + + This function iterates over all possible inputs, regardless of any arguments you + specify. Because the :class:`Inputs` collection is the union of all the inputs of each + kind, this method implements parameters such as "count", "search", and so + on at the Python level once all the data has been fetched. The exception + is when you specify a single input kind, and then this method makes a single request + with the usual semantics for parameters. + + :param kinds: The input kinds to return (optional). + + - "ad": Active Directory + + - "monitor": Files and directories + + - "registry": Windows Registry + + - "script": Scripts + + - "splunktcp": TCP, processed + + - "tcp": TCP, unprocessed + + - "udp": UDP + + - "win-event-log-collections": Windows event log + + - "win-perfmon": Performance monitoring + + - "win-wmi-collections": WMI + + :type kinds: ``string`` + :param kwargs: Additional arguments (optional): + + - "count" (``integer``): The maximum number of items to return. + + - "offset" (``integer``): The offset of the first item to return. + + - "search" (``string``): The search query to filter responses. + + - "sort_dir" (``string``): The direction to sort returned items: + "asc" or "desc". + + - "sort_key" (``string``): The field to use for sorting (optional). + + - "sort_mode" (``string``): The collating sequence for sorting + returned items: "auto", "alpha", "alpha_case", or "num". + + :type kwargs: ``dict`` + + :return: A list of input kinds. + :rtype: ``list`` + """ + if len(kinds) == 0: + kinds = self.kinds + if len(kinds) == 1: + kind = kinds[0] + logger.debug("Inputs.list taking short circuit branch for single kind.") + path = self.kindpath(kind) + logger.debug("Path for inputs: %s", path) + try: + path = UrlEncoded(path, skip_encode=True) + response = self.get(path, **kwargs) + except HTTPError as he: + if he.status == 404: # No inputs of this kind + return [] + entities = [] + entries = _load_atom_entries(response) + if entries is None: + return [] # No inputs in a collection comes back with no feed or entry in the XML + for entry in entries: + state = _parse_atom_entry(entry) + # Unquote the URL, since all URL encoded in the SDK + # should be of type UrlEncoded, and all str should not + # be URL encoded. + path = urllib.parse.unquote(state.links.alternate) + entity = Input(self.service, path, kind, state=state) + entities.append(entity) + return entities + + search = kwargs.get('search', '*') + + entities = [] + for kind in kinds: + response = None + try: + kind = UrlEncoded(kind, skip_encode=True) + response = self.get(self.kindpath(kind), search=search) + except HTTPError as e: + if e.status == 404: + continue # No inputs of this kind + else: + raise + + entries = _load_atom_entries(response) + if entries is None: continue # No inputs to process + for entry in entries: + state = _parse_atom_entry(entry) + # Unquote the URL, since all URL encoded in the SDK + # should be of type UrlEncoded, and all str should not + # be URL encoded. + path = urllib.parse.unquote(state.links.alternate) + entity = Input(self.service, path, kind, state=state) + entities.append(entity) + if 'offset' in kwargs: + entities = entities[kwargs['offset']:] + if 'count' in kwargs: + entities = entities[:kwargs['count']] + if kwargs.get('sort_mode', None) == 'alpha': + sort_field = kwargs.get('sort_field', 'name') + if sort_field == 'name': + f = lambda x: x.name.lower() + else: + f = lambda x: x[sort_field].lower() + entities = sorted(entities, key=f) + if kwargs.get('sort_mode', None) == 'alpha_case': + sort_field = kwargs.get('sort_field', 'name') + if sort_field == 'name': + f = lambda x: x.name + else: + f = lambda x: x[sort_field] + entities = sorted(entities, key=f) + if kwargs.get('sort_dir', 'asc') == 'desc': + entities = list(reversed(entities)) + return entities + + def __iter__(self, **kwargs): + for item in self.iter(**kwargs): + yield item + + def iter(self, **kwargs): + """ Iterates over the collection of inputs. + + :param kwargs: Additional arguments (optional): + + - "count" (``integer``): The maximum number of items to return. + + - "offset" (``integer``): The offset of the first item to return. + + - "search" (``string``): The search query to filter responses. + + - "sort_dir" (``string``): The direction to sort returned items: + "asc" or "desc". + + - "sort_key" (``string``): The field to use for sorting (optional). + + - "sort_mode" (``string``): The collating sequence for sorting + returned items: "auto", "alpha", "alpha_case", or "num". + + :type kwargs: ``dict`` + """ + for item in self.list(**kwargs): + yield item + + def oneshot(self, path, **kwargs): + """ Creates a oneshot data input, which is an upload of a single file + for one-time indexing. + + :param path: The path and filename. + :type path: ``string`` + :param kwargs: Additional arguments (optional). For more about the + available parameters, see `Input parameters `_ on Splunk Developer Portal. + :type kwargs: ``dict`` + """ + self.post('oneshot', name=path, **kwargs) + + +class Job(Entity): + """This class represents a search job.""" + def __init__(self, service, sid, **kwargs): + # Default to v2 in Splunk Version 9+ + path = "{path}{sid}" + # Formatting path based on the Splunk Version + if service.disable_v2_api: + path = path.format(path=PATH_JOBS, sid=sid) + else: + path = path.format(path=PATH_JOBS_V2, sid=sid) + + Entity.__init__(self, service, path, skip_refresh=True, **kwargs) + self.sid = sid + + # The Job entry record is returned at the root of the response + def _load_atom_entry(self, response): + return _load_atom(response).entry + + def cancel(self): + """Stops the current search and deletes the results cache. + + :return: The :class:`Job`. + """ + try: + self.post("control", action="cancel") + except HTTPError as he: + if he.status == 404: + # The job has already been cancelled, so + # cancelling it twice is a nop. + pass + else: + raise + return self + + def disable_preview(self): + """Disables preview for this job. + + :return: The :class:`Job`. + """ + self.post("control", action="disablepreview") + return self + + def enable_preview(self): + """Enables preview for this job. + + **Note**: Enabling preview might slow search considerably. + + :return: The :class:`Job`. + """ + self.post("control", action="enablepreview") + return self + + def events(self, **kwargs): + """Returns a streaming handle to this job's events. + + :param kwargs: Additional parameters (optional). For a list of valid + parameters, see `GET search/jobs/{search_id}/events + `_ + in the REST API documentation. + :type kwargs: ``dict`` + + :return: The ``InputStream`` IO handle to this job's events. + """ + kwargs['segmentation'] = kwargs.get('segmentation', 'none') + + # Search API v1(GET) and v2(POST) + if self.service.disable_v2_api: + return self.get("events", **kwargs).body + return self.post("events", **kwargs).body + + def finalize(self): + """Stops the job and provides intermediate results for retrieval. + + :return: The :class:`Job`. + """ + self.post("control", action="finalize") + return self + + def is_done(self): + """Indicates whether this job finished running. + + :return: ``True`` if the job is done, ``False`` if not. + :rtype: ``boolean`` + """ + if not self.is_ready(): + return False + done = (self._state.content['isDone'] == '1') + return done + + def is_ready(self): + """Indicates whether this job is ready for querying. + + :return: ``True`` if the job is ready, ``False`` if not. + :rtype: ``boolean`` + + """ + response = self.get() + if response.status == 204: + return False + self._state = self.read(response) + ready = self._state.content['dispatchState'] not in ['QUEUED', 'PARSING'] + return ready + + @property + def name(self): + """Returns the name of the search job, which is the search ID (SID). + + :return: The search ID. + :rtype: ``string`` + """ + return self.sid + + def pause(self): + """Suspends the current search. + + :return: The :class:`Job`. + """ + self.post("control", action="pause") + return self + + def results(self, **query_params): + """Returns a streaming handle to this job's search results. To get a nice, Pythonic iterator, pass the handle + to :class:`splunklib.results.JSONResultsReader` along with the query param "output_mode='json'", as in:: + + import splunklib.client as client + import splunklib.results as results + from time import sleep + service = client.connect(...) + job = service.jobs.create("search * | head 5") + while not job.is_done(): + sleep(.2) + rr = results.JSONResultsReader(job.results(output_mode='json')) + for result in rr: + if isinstance(result, results.Message): + # Diagnostic messages may be returned in the results + print '%s: %s' % (result.type, result.message) + elif isinstance(result, dict): + # Normal events are returned as dicts + print result + assert rr.is_preview == False + + Results are not available until the job has finished. If called on + an unfinished job, the result is an empty event set. + + This method makes a single roundtrip + to the server, plus at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param query_params: Additional parameters (optional). For a list of valid + parameters, see `GET search/jobs/{search_id}/results + `_. + :type query_params: ``dict`` + + :return: The ``InputStream`` IO handle to this job's results. + """ + query_params['segmentation'] = query_params.get('segmentation', 'none') + + # Search API v1(GET) and v2(POST) + if self.service.disable_v2_api: + return self.get("results", **query_params).body + return self.post("results", **query_params).body + + def preview(self, **query_params): + """Returns a streaming handle to this job's preview search results. + + Unlike :class:`splunklib.results.JSONResultsReader`along with the query param "output_mode='json'", + which requires a job to be finished to return any results, the ``preview`` method returns any results that + have been generated so far, whether the job is running or not. The returned search results are the raw data + from the server. Pass the handle returned to :class:`splunklib.results.JSONResultsReader` to get a nice, + Pythonic iterator over objects, as in:: + + import splunklib.client as client + import splunklib.results as results + service = client.connect(...) + job = service.jobs.create("search * | head 5") + rr = results.JSONResultsReader(job.preview(output_mode='json')) + for result in rr: + if isinstance(result, results.Message): + # Diagnostic messages may be returned in the results + print '%s: %s' % (result.type, result.message) + elif isinstance(result, dict): + # Normal events are returned as dicts + print result + if rr.is_preview: + print "Preview of a running search job." + else: + print "Job is finished. Results are final." + + This method makes one roundtrip to the server, plus at most + two more if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param query_params: Additional parameters (optional). For a list of valid + parameters, see `GET search/jobs/{search_id}/results_preview + `_ + in the REST API documentation. + :type query_params: ``dict`` + + :return: The ``InputStream`` IO handle to this job's preview results. + """ + query_params['segmentation'] = query_params.get('segmentation', 'none') + + # Search API v1(GET) and v2(POST) + if self.service.disable_v2_api: + return self.get("results_preview", **query_params).body + return self.post("results_preview", **query_params).body + + def searchlog(self, **kwargs): + """Returns a streaming handle to this job's search log. + + :param `kwargs`: Additional parameters (optional). For a list of valid + parameters, see `GET search/jobs/{search_id}/search.log + `_ + in the REST API documentation. + :type kwargs: ``dict`` + + :return: The ``InputStream`` IO handle to this job's search log. + """ + return self.get("search.log", **kwargs).body + + def set_priority(self, value): + """Sets this job's search priority in the range of 0-10. + + Higher numbers indicate higher priority. Unless splunkd is + running as *root*, you can only decrease the priority of a running job. + + :param `value`: The search priority. + :type value: ``integer`` + + :return: The :class:`Job`. + """ + self.post('control', action="setpriority", priority=value) + return self + + def summary(self, **kwargs): + """Returns a streaming handle to this job's summary. + + :param `kwargs`: Additional parameters (optional). For a list of valid + parameters, see `GET search/jobs/{search_id}/summary + `_ + in the REST API documentation. + :type kwargs: ``dict`` + + :return: The ``InputStream`` IO handle to this job's summary. + """ + return self.get("summary", **kwargs).body + + def timeline(self, **kwargs): + """Returns a streaming handle to this job's timeline results. + + :param `kwargs`: Additional timeline arguments (optional). For a list of valid + parameters, see `GET search/jobs/{search_id}/timeline + `_ + in the REST API documentation. + :type kwargs: ``dict`` + + :return: The ``InputStream`` IO handle to this job's timeline. + """ + return self.get("timeline", **kwargs).body + + def touch(self): + """Extends the expiration time of the search to the current time (now) plus + the time-to-live (ttl) value. + + :return: The :class:`Job`. + """ + self.post("control", action="touch") + return self + + def set_ttl(self, value): + """Set the job's time-to-live (ttl) value, which is the time before the + search job expires and is still available. + + :param `value`: The ttl value, in seconds. + :type value: ``integer`` + + :return: The :class:`Job`. + """ + self.post("control", action="setttl", ttl=value) + return self + + def unpause(self): + """Resumes the current search, if paused. + + :return: The :class:`Job`. + """ + self.post("control", action="unpause") + return self + + +class Jobs(Collection): + """This class represents a collection of search jobs. Retrieve this + collection using :meth:`Service.jobs`.""" + def __init__(self, service): + # Splunk 9 introduces the v2 endpoint + if not service.disable_v2_api: + path = PATH_JOBS_V2 + else: + path = PATH_JOBS + Collection.__init__(self, service, path, item=Job) + # The count value to say list all the contents of this + # Collection is 0, not -1 as it is on most. + self.null_count = 0 + + def _load_list(self, response): + # Overridden because Job takes a sid instead of a path. + entries = _load_atom_entries(response) + if entries is None: return [] + entities = [] + for entry in entries: + state = _parse_atom_entry(entry) + entity = self.item( + self.service, + entry['content']['sid'], + state=state) + entities.append(entity) + return entities + + def create(self, query, **kwargs): + """ Creates a search using a search query and any additional parameters + you provide. + + :param query: The search query. + :type query: ``string`` + :param kwargs: Additiona parameters (optional). For a list of available + parameters, see `Search job parameters + `_ + on Splunk Developer Portal. + :type kwargs: ``dict`` + + :return: The :class:`Job`. + """ + if kwargs.get("exec_mode", None) == "oneshot": + raise TypeError("Cannot specify exec_mode=oneshot; use the oneshot method instead.") + response = self.post(search=query, **kwargs) + sid = _load_sid(response, kwargs.get("output_mode", None)) + return Job(self.service, sid) + + def export(self, query, **params): + """Runs a search and immediately starts streaming preview events. This method returns a streaming handle to + this job's events as an XML document from the server. To parse this stream into usable Python objects, + pass the handle to :class:`splunklib.results.JSONResultsReader` along with the query param + "output_mode='json'":: + + import splunklib.client as client + import splunklib.results as results + service = client.connect(...) + rr = results.JSONResultsReader(service.jobs.export("search * | head 5",output_mode='json')) + for result in rr: + if isinstance(result, results.Message): + # Diagnostic messages may be returned in the results + print '%s: %s' % (result.type, result.message) + elif isinstance(result, dict): + # Normal events are returned as dicts + print result + assert rr.is_preview == False + + Running an export search is more efficient as it streams the results + directly to you, rather than having to write them out to disk and make + them available later. As soon as results are ready, you will receive + them. + + The ``export`` method makes a single roundtrip to the server (as opposed + to two for :meth:`create` followed by :meth:`preview`), plus at most two + more if the ``autologin`` field of :func:`connect` is set to ``True``. + + :raises `ValueError`: Raised for invalid queries. + :param query: The search query. + :type query: ``string`` + :param params: Additional arguments (optional). For a list of valid + parameters, see `GET search/jobs/export + `_ + in the REST API documentation. + :type params: ``dict`` + + :return: The ``InputStream`` IO handle to raw XML returned from the server. + """ + if "exec_mode" in params: + raise TypeError("Cannot specify an exec_mode to export.") + params['segmentation'] = params.get('segmentation', 'none') + return self.post(path_segment="export", + search=query, + **params).body + + def itemmeta(self): + """There is no metadata available for class:``Jobs``. + + Any call to this method raises a class:``NotSupportedError``. + + :raises: class:``NotSupportedError`` + """ + raise NotSupportedError() + + def oneshot(self, query, **params): + """Run a oneshot search and returns a streaming handle to the results. + + The ``InputStream`` object streams fragments from the server. To parse this stream into usable Python + objects, pass the handle to :class:`splunklib.results.JSONResultsReader` along with the query param + "output_mode='json'" :: + + import splunklib.client as client + import splunklib.results as results + service = client.connect(...) + rr = results.JSONResultsReader(service.jobs.oneshot("search * | head 5",output_mode='json')) + for result in rr: + if isinstance(result, results.Message): + # Diagnostic messages may be returned in the results + print '%s: %s' % (result.type, result.message) + elif isinstance(result, dict): + # Normal events are returned as dicts + print result + assert rr.is_preview == False + + The ``oneshot`` method makes a single roundtrip to the server (as opposed + to two for :meth:`create` followed by :meth:`results`), plus at most two more + if the ``autologin`` field of :func:`connect` is set to ``True``. + + :raises ValueError: Raised for invalid queries. + + :param query: The search query. + :type query: ``string`` + :param params: Additional arguments (optional): + + - "output_mode": Specifies the output format of the results (XML, + JSON, or CSV). + + - "earliest_time": Specifies the earliest time in the time range to + search. The time string can be a UTC time (with fractional seconds), + a relative time specifier (to now), or a formatted time string. + + - "latest_time": Specifies the latest time in the time range to + search. The time string can be a UTC time (with fractional seconds), + a relative time specifier (to now), or a formatted time string. + + - "rf": Specifies one or more fields to add to the search. + + :type params: ``dict`` + + :return: The ``InputStream`` IO handle to raw XML returned from the server. + """ + if "exec_mode" in params: + raise TypeError("Cannot specify an exec_mode to oneshot.") + params['segmentation'] = params.get('segmentation', 'none') + return self.post(search=query, + exec_mode="oneshot", + **params).body + + +class Loggers(Collection): + """This class represents a collection of service logging categories. + Retrieve this collection using :meth:`Service.loggers`.""" + def __init__(self, service): + Collection.__init__(self, service, PATH_LOGGER) + + def itemmeta(self): + """There is no metadata available for class:``Loggers``. + + Any call to this method raises a class:``NotSupportedError``. + + :raises: class:``NotSupportedError`` + """ + raise NotSupportedError() + + +class Message(Entity): + def __init__(self, service, path, **kwargs): + Entity.__init__(self, service, path, **kwargs) + + @property + def value(self): + """Returns the message value. + + :return: The message value. + :rtype: ``string`` + """ + return self[self.name] + + +class ModularInputKind(Entity): + """This class contains the different types of modular inputs. Retrieve this + collection using :meth:`Service.modular_input_kinds`. + """ + def __contains__(self, name): + args = self.state.content['endpoints']['args'] + if name in args: + return True + else: + return Entity.__contains__(self, name) + + def __getitem__(self, name): + args = self.state.content['endpoint']['args'] + if name in args: + return args['item'] + else: + return Entity.__getitem__(self, name) + + @property + def arguments(self): + """A dictionary of all the arguments supported by this modular input kind. + + The keys in the dictionary are the names of the arguments. The values are + another dictionary giving the metadata about that argument. The possible + keys in that dictionary are ``"title"``, ``"description"``, ``"required_on_create``", + ``"required_on_edit"``, ``"data_type"``. Each value is a string. It should be one + of ``"true"`` or ``"false"`` for ``"required_on_create"`` and ``"required_on_edit"``, + and one of ``"boolean"``, ``"string"``, or ``"number``" for ``"data_type"``. + + :return: A dictionary describing the arguments this modular input kind takes. + :rtype: ``dict`` + """ + return self.state.content['endpoint']['args'] + + def update(self, **kwargs): + """Raises an error. Modular input kinds are read only.""" + raise IllegalOperationException("Modular input kinds cannot be updated via the REST API.") + + +class SavedSearch(Entity): + """This class represents a saved search.""" + def __init__(self, service, path, **kwargs): + Entity.__init__(self, service, path, **kwargs) + + def acknowledge(self): + """Acknowledges the suppression of alerts from this saved search and + resumes alerting. + + :return: The :class:`SavedSearch`. + """ + self.post("acknowledge") + return self + + @property + def alert_count(self): + """Returns the number of alerts fired by this saved search. + + :return: The number of alerts fired by this saved search. + :rtype: ``integer`` + """ + return int(self._state.content.get('triggered_alert_count', 0)) + + def dispatch(self, **kwargs): + """Runs the saved search and returns the resulting search job. + + :param `kwargs`: Additional dispatch arguments (optional). For details, + see the `POST saved/searches/{name}/dispatch + `_ + endpoint in the REST API documentation. + :type kwargs: ``dict`` + :return: The :class:`Job`. + """ + response = self.post("dispatch", **kwargs) + sid = _load_sid(response, kwargs.get("output_mode", None)) + return Job(self.service, sid) + + @property + def fired_alerts(self): + """Returns the collection of fired alerts (a fired alert group) + corresponding to this saved search's alerts. + + :raises IllegalOperationException: Raised when the search is not scheduled. + + :return: A collection of fired alerts. + :rtype: :class:`AlertGroup` + """ + if self['is_scheduled'] == '0': + raise IllegalOperationException('Unscheduled saved searches have no alerts.') + c = Collection( + self.service, + self.service._abspath(PATH_FIRED_ALERTS + self.name, + owner=self._state.access.owner, + app=self._state.access.app, + sharing=self._state.access.sharing), + item=AlertGroup) + return c + + def history(self, **kwargs): + """Returns a list of search jobs corresponding to this saved search. + + :param `kwargs`: Additional arguments (optional). + :type kwargs: ``dict`` + + :return: A list of :class:`Job` objects. + """ + response = self.get("history", **kwargs) + entries = _load_atom_entries(response) + if entries is None: return [] + jobs = [] + for entry in entries: + job = Job(self.service, entry.title) + jobs.append(job) + return jobs + + def update(self, search=None, **kwargs): + """Updates the server with any changes you've made to the current saved + search along with any additional arguments you specify. + + :param `search`: The search query (optional). + :type search: ``string`` + :param `kwargs`: Additional arguments (optional). For a list of available + parameters, see `Saved search parameters + `_ + on Splunk Developer Portal. + :type kwargs: ``dict`` + + :return: The :class:`SavedSearch`. + """ + # Updates to a saved search *require* that the search string be + # passed, so we pass the current search string if a value wasn't + # provided by the caller. + if search is None: search = self.content.search + Entity.update(self, search=search, **kwargs) + return self + + def scheduled_times(self, earliest_time='now', latest_time='+1h'): + """Returns the times when this search is scheduled to run. + + By default this method returns the times in the next hour. For different + time ranges, set *earliest_time* and *latest_time*. For example, + for all times in the last day use "earliest_time=-1d" and + "latest_time=now". + + :param earliest_time: The earliest time. + :type earliest_time: ``string`` + :param latest_time: The latest time. + :type latest_time: ``string`` + + :return: The list of search times. + """ + response = self.get("scheduled_times", + earliest_time=earliest_time, + latest_time=latest_time) + data = self._load_atom_entry(response) + rec = _parse_atom_entry(data) + times = [datetime.fromtimestamp(int(t)) + for t in rec.content.scheduled_times] + return times + + def suppress(self, expiration): + """Skips any scheduled runs of this search in the next *expiration* + number of seconds. + + :param expiration: The expiration period, in seconds. + :type expiration: ``integer`` + + :return: The :class:`SavedSearch`. + """ + self.post("suppress", expiration=expiration) + return self + + @property + def suppressed(self): + """Returns the number of seconds that this search is blocked from running + (possibly 0). + + :return: The number of seconds. + :rtype: ``integer`` + """ + r = self._run_action("suppress") + if r.suppressed == "1": + return int(r.expiration) + else: + return 0 + + def unsuppress(self): + """Cancels suppression and makes this search run as scheduled. + + :return: The :class:`SavedSearch`. + """ + self.post("suppress", expiration="0") + return self + + +class SavedSearches(Collection): + """This class represents a collection of saved searches. Retrieve this + collection using :meth:`Service.saved_searches`.""" + def __init__(self, service): + Collection.__init__( + self, service, PATH_SAVED_SEARCHES, item=SavedSearch) + + def create(self, name, search, **kwargs): + """ Creates a saved search. + + :param name: The name for the saved search. + :type name: ``string`` + :param search: The search query. + :type search: ``string`` + :param kwargs: Additional arguments (optional). For a list of available + parameters, see `Saved search parameters + `_ + on Splunk Developer Portal. + :type kwargs: ``dict`` + :return: The :class:`SavedSearches` collection. + """ + return Collection.create(self, name, search=search, **kwargs) + + +class Settings(Entity): + """This class represents configuration settings for a Splunk service. + Retrieve this collection using :meth:`Service.settings`.""" + def __init__(self, service, **kwargs): + Entity.__init__(self, service, "/services/server/settings", **kwargs) + + # Updates on the settings endpoint are POSTed to server/settings/settings. + def update(self, **kwargs): + """Updates the settings on the server using the arguments you provide. + + :param kwargs: Additional arguments. For a list of valid arguments, see + `POST server/settings/{name} + `_ + in the REST API documentation. + :type kwargs: ``dict`` + :return: The :class:`Settings` collection. + """ + self.service.post("/services/server/settings/settings", **kwargs) + return self + + +class User(Entity): + """This class represents a Splunk user. + """ + @property + def role_entities(self): + """Returns a list of roles assigned to this user. + + :return: The list of roles. + :rtype: ``list`` + """ + return [self.service.roles[name] for name in self.content.roles] + + +# Splunk automatically lowercases new user names so we need to match that +# behavior here to ensure that the subsequent member lookup works correctly. +class Users(Collection): + """This class represents the collection of Splunk users for this instance of + Splunk. Retrieve this collection using :meth:`Service.users`. + """ + def __init__(self, service): + Collection.__init__(self, service, PATH_USERS, item=User) + + def __getitem__(self, key): + return Collection.__getitem__(self, key.lower()) + + def __contains__(self, name): + return Collection.__contains__(self, name.lower()) + + def create(self, username, password, roles, **params): + """Creates a new user. + + This function makes two roundtrips to the server, plus at most + two more if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param username: The username. + :type username: ``string`` + :param password: The password. + :type password: ``string`` + :param roles: A single role or list of roles for the user. + :type roles: ``string`` or ``list`` + :param params: Additional arguments (optional). For a list of available + parameters, see `User authentication parameters + `_ + on Splunk Developer Portal. + :type params: ``dict`` + + :return: The new user. + :rtype: :class:`User` + + **Example**:: + + import splunklib.client as client + c = client.connect(...) + users = c.users + boris = users.create("boris", "securepassword", roles="user") + hilda = users.create("hilda", "anotherpassword", roles=["user","power"]) + """ + if not isinstance(username, six.string_types): + raise ValueError("Invalid username: %s" % str(username)) + username = username.lower() + self.post(name=username, password=password, roles=roles, **params) + # splunkd doesn't return the user in the POST response body, + # so we have to make a second round trip to fetch it. + response = self.get(username) + entry = _load_atom(response, XNAME_ENTRY).entry + state = _parse_atom_entry(entry) + entity = self.item( + self.service, + urllib.parse.unquote(state.links.alternate), + state=state) + return entity + + def delete(self, name): + """ Deletes the user and returns the resulting collection of users. + + :param name: The name of the user to delete. + :type name: ``string`` + + :return: + :rtype: :class:`Users` + """ + return Collection.delete(self, name.lower()) + + +class Role(Entity): + """This class represents a user role. + """ + def grant(self, *capabilities_to_grant): + """Grants additional capabilities to this role. + + :param capabilities_to_grant: Zero or more capabilities to grant this + role. For a list of capabilities, see + `Capabilities `_ + on Splunk Developer Portal. + :type capabilities_to_grant: ``string`` or ``list`` + :return: The :class:`Role`. + + **Example**:: + + service = client.connect(...) + role = service.roles['somerole'] + role.grant('change_own_password', 'search') + """ + possible_capabilities = self.service.capabilities + for capability in capabilities_to_grant: + if capability not in possible_capabilities: + raise NoSuchCapability(capability) + new_capabilities = self['capabilities'] + list(capabilities_to_grant) + self.post(capabilities=new_capabilities) + return self + + def revoke(self, *capabilities_to_revoke): + """Revokes zero or more capabilities from this role. + + :param capabilities_to_revoke: Zero or more capabilities to grant this + role. For a list of capabilities, see + `Capabilities `_ + on Splunk Developer Portal. + :type capabilities_to_revoke: ``string`` or ``list`` + + :return: The :class:`Role`. + + **Example**:: + + service = client.connect(...) + role = service.roles['somerole'] + role.revoke('change_own_password', 'search') + """ + possible_capabilities = self.service.capabilities + for capability in capabilities_to_revoke: + if capability not in possible_capabilities: + raise NoSuchCapability(capability) + old_capabilities = self['capabilities'] + new_capabilities = [] + for c in old_capabilities: + if c not in capabilities_to_revoke: + new_capabilities.append(c) + if new_capabilities == []: + new_capabilities = '' # Empty lists don't get passed in the body, so we have to force an empty argument. + self.post(capabilities=new_capabilities) + return self + + +class Roles(Collection): + """This class represents the collection of roles in the Splunk instance. + Retrieve this collection using :meth:`Service.roles`.""" + def __init__(self, service): + return Collection.__init__(self, service, PATH_ROLES, item=Role) + + def __getitem__(self, key): + return Collection.__getitem__(self, key.lower()) + + def __contains__(self, name): + return Collection.__contains__(self, name.lower()) + + def create(self, name, **params): + """Creates a new role. + + This function makes two roundtrips to the server, plus at most + two more if + the ``autologin`` field of :func:`connect` is set to ``True``. + + :param name: Name for the role. + :type name: ``string`` + :param params: Additional arguments (optional). For a list of available + parameters, see `Roles parameters + `_ + on Splunk Developer Portal. + :type params: ``dict`` + + :return: The new role. + :rtype: :class:`Role` + + **Example**:: + + import splunklib.client as client + c = client.connect(...) + roles = c.roles + paltry = roles.create("paltry", imported_roles="user", defaultApp="search") + """ + if not isinstance(name, six.string_types): + raise ValueError("Invalid role name: %s" % str(name)) + name = name.lower() + self.post(name=name, **params) + # splunkd doesn't return the user in the POST response body, + # so we have to make a second round trip to fetch it. + response = self.get(name) + entry = _load_atom(response, XNAME_ENTRY).entry + state = _parse_atom_entry(entry) + entity = self.item( + self.service, + urllib.parse.unquote(state.links.alternate), + state=state) + return entity + + def delete(self, name): + """ Deletes the role and returns the resulting collection of roles. + + :param name: The name of the role to delete. + :type name: ``string`` + + :rtype: The :class:`Roles` + """ + return Collection.delete(self, name.lower()) + + +class Application(Entity): + """Represents a locally-installed Splunk app.""" + @property + def setupInfo(self): + """Returns the setup information for the app. + + :return: The setup information. + """ + return self.content.get('eai:setup', None) + + def package(self): + """ Creates a compressed package of the app for archiving.""" + return self._run_action("package") + + def updateInfo(self): + """Returns any update information that is available for the app.""" + return self._run_action("update") + +class KVStoreCollections(Collection): + def __init__(self, service): + Collection.__init__(self, service, 'storage/collections/config', item=KVStoreCollection) + + def create(self, name, indexes = {}, fields = {}, **kwargs): + """Creates a KV Store Collection. + + :param name: name of collection to create + :type name: ``string`` + :param indexes: dictionary of index definitions + :type indexes: ``dict`` + :param fields: dictionary of field definitions + :type fields: ``dict`` + :param kwargs: a dictionary of additional parameters specifying indexes and field definitions + :type kwargs: ``dict`` + + :return: Result of POST request + """ + for k, v in six.iteritems(indexes): + if isinstance(v, dict): + v = json.dumps(v) + kwargs['index.' + k] = v + for k, v in six.iteritems(fields): + kwargs['field.' + k] = v + return self.post(name=name, **kwargs) + +class KVStoreCollection(Entity): + @property + def data(self): + """Returns data object for this Collection. + + :rtype: :class:`KVStoreCollectionData` + """ + return KVStoreCollectionData(self) + + def update_index(self, name, value): + """Changes the definition of a KV Store index. + + :param name: name of index to change + :type name: ``string`` + :param value: new index definition + :type value: ``dict`` or ``string`` + + :return: Result of POST request + """ + kwargs = {} + kwargs['index.' + name] = value if isinstance(value, six.string_types) else json.dumps(value) + return self.post(**kwargs) + + def update_field(self, name, value): + """Changes the definition of a KV Store field. + + :param name: name of field to change + :type name: ``string`` + :param value: new field definition + :type value: ``string`` + + :return: Result of POST request + """ + kwargs = {} + kwargs['field.' + name] = value + return self.post(**kwargs) + +class KVStoreCollectionData(object): + """This class represents the data endpoint for a KVStoreCollection. + + Retrieve using :meth:`KVStoreCollection.data` + """ + JSON_HEADER = [('Content-Type', 'application/json')] + + def __init__(self, collection): + self.service = collection.service + self.collection = collection + self.owner, self.app, self.sharing = collection._proper_namespace() + self.path = 'storage/collections/data/' + UrlEncoded(self.collection.name, encode_slash=True) + '/' + + def _get(self, url, **kwargs): + return self.service.get(self.path + url, owner=self.owner, app=self.app, sharing=self.sharing, **kwargs) + + def _post(self, url, **kwargs): + return self.service.post(self.path + url, owner=self.owner, app=self.app, sharing=self.sharing, **kwargs) + + def _delete(self, url, **kwargs): + return self.service.delete(self.path + url, owner=self.owner, app=self.app, sharing=self.sharing, **kwargs) + + def query(self, **query): + """ + Gets the results of query, with optional parameters sort, limit, skip, and fields. + + :param query: Optional parameters. Valid options are sort, limit, skip, and fields + :type query: ``dict`` + + :return: Array of documents retrieved by query. + :rtype: ``array`` + """ + + for key, value in query.items(): + if isinstance(query[key], dict): + query[key] = json.dumps(value) + + return json.loads(self._get('', **query).body.read().decode('utf-8')) + + def query_by_id(self, id): + """ + Returns object with _id = id. + + :param id: Value for ID. If not a string will be coerced to string. + :type id: ``string`` + + :return: Document with id + :rtype: ``dict`` + """ + return json.loads(self._get(UrlEncoded(str(id), encode_slash=True)).body.read().decode('utf-8')) + + def insert(self, data): + """ + Inserts item into this collection. An _id field will be generated if not assigned in the data. + + :param data: Document to insert + :type data: ``string`` + + :return: _id of inserted object + :rtype: ``dict`` + """ + if isinstance(data, dict): + data = json.dumps(data) + return json.loads(self._post('', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8')) + + def delete(self, query=None): + """ + Deletes all data in collection if query is absent. Otherwise, deletes all data matched by query. + + :param query: Query to select documents to delete + :type query: ``string`` + + :return: Result of DELETE request + """ + return self._delete('', **({'query': query}) if query else {}) + + def delete_by_id(self, id): + """ + Deletes document that has _id = id. + + :param id: id of document to delete + :type id: ``string`` + + :return: Result of DELETE request + """ + return self._delete(UrlEncoded(str(id), encode_slash=True)) + + def update(self, id, data): + """ + Replaces document with _id = id with data. + + :param id: _id of document to update + :type id: ``string`` + :param data: the new document to insert + :type data: ``string`` + + :return: id of replaced document + :rtype: ``dict`` + """ + if isinstance(data, dict): + data = json.dumps(data) + return json.loads(self._post(UrlEncoded(str(id), encode_slash=True), headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8')) + + def batch_find(self, *dbqueries): + """ + Returns array of results from queries dbqueries. + + :param dbqueries: Array of individual queries as dictionaries + :type dbqueries: ``array`` of ``dict`` + + :return: Results of each query + :rtype: ``array`` of ``array`` + """ + if len(dbqueries) < 1: + raise Exception('Must have at least one query.') + + data = json.dumps(dbqueries) + + return json.loads(self._post('batch_find', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8')) + + def batch_save(self, *documents): + """ + Inserts or updates every document specified in documents. + + :param documents: Array of documents to save as dictionaries + :type documents: ``array`` of ``dict`` + + :return: Results of update operation as overall stats + :rtype: ``dict`` + """ + if len(documents) < 1: + raise Exception('Must have at least one document.') + + data = json.dumps(documents) + + return json.loads(self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8')) \ No newline at end of file diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/data.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/data.py new file mode 100755 index 00000000..10931fed --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/data.py @@ -0,0 +1,266 @@ +# Copyright 2011-2015 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""The **splunklib.data** module reads the responses from splunkd in Atom Feed +format, which is the format used by most of the REST API. +""" + +from __future__ import absolute_import +import sys +from xml.etree.ElementTree import XML +from splunk_instrumentation.splunklib import six + +__all__ = ["load"] + +# LNAME refers to element names without namespaces; XNAME is the same +# name, but with an XML namespace. +LNAME_DICT = "dict" +LNAME_ITEM = "item" +LNAME_KEY = "key" +LNAME_LIST = "list" + +XNAMEF_REST = "{http://dev.splunk.com/ns/rest}%s" +XNAME_DICT = XNAMEF_REST % LNAME_DICT +XNAME_ITEM = XNAMEF_REST % LNAME_ITEM +XNAME_KEY = XNAMEF_REST % LNAME_KEY +XNAME_LIST = XNAMEF_REST % LNAME_LIST + +# Some responses don't use namespaces (eg: search/parse) so we look for +# both the extended and local versions of the following names. + +def isdict(name): + return name == XNAME_DICT or name == LNAME_DICT + +def isitem(name): + return name == XNAME_ITEM or name == LNAME_ITEM + +def iskey(name): + return name == XNAME_KEY or name == LNAME_KEY + +def islist(name): + return name == XNAME_LIST or name == LNAME_LIST + +def hasattrs(element): + return len(element.attrib) > 0 + +def localname(xname): + rcurly = xname.find('}') + return xname if rcurly == -1 else xname[rcurly+1:] + +def load(text, match=None): + """This function reads a string that contains the XML of an Atom Feed, then + returns the + data in a native Python structure (a ``dict`` or ``list``). If you also + provide a tag name or path to match, only the matching sub-elements are + loaded. + + :param text: The XML text to load. + :type text: ``string`` + :param match: A tag name or path to match (optional). + :type match: ``string`` + """ + if text is None: return None + text = text.strip() + if len(text) == 0: return None + nametable = { + 'namespaces': [], + 'names': {} + } + + # Convert to unicode encoding in only python 2 for xml parser + if(sys.version_info < (3, 0, 0) and isinstance(text, unicode)): + text = text.encode('utf-8') + + root = XML(text) + items = [root] if match is None else root.findall(match) + count = len(items) + if count == 0: + return None + elif count == 1: + return load_root(items[0], nametable) + else: + return [load_root(item, nametable) for item in items] + +# Load the attributes of the given element. +def load_attrs(element): + if not hasattrs(element): return None + attrs = record() + for key, value in six.iteritems(element.attrib): + attrs[key] = value + return attrs + +# Parse a element and return a Python dict +def load_dict(element, nametable = None): + value = record() + children = list(element) + for child in children: + assert iskey(child.tag) + name = child.attrib["name"] + value[name] = load_value(child, nametable) + return value + +# Loads the given elements attrs & value into single merged dict. +def load_elem(element, nametable=None): + name = localname(element.tag) + attrs = load_attrs(element) + value = load_value(element, nametable) + if attrs is None: return name, value + if value is None: return name, attrs + # If value is simple, merge into attrs dict using special key + if isinstance(value, six.string_types): + attrs["$text"] = value + return name, attrs + # Both attrs & value are complex, so merge the two dicts, resolving collisions. + collision_keys = [] + for key, val in six.iteritems(attrs): + if key in value and key in collision_keys: + value[key].append(val) + elif key in value and key not in collision_keys: + value[key] = [value[key], val] + collision_keys.append(key) + else: + value[key] = val + return name, value + +# Parse a element and return a Python list +def load_list(element, nametable=None): + assert islist(element.tag) + value = [] + children = list(element) + for child in children: + assert isitem(child.tag) + value.append(load_value(child, nametable)) + return value + +# Load the given root element. +def load_root(element, nametable=None): + tag = element.tag + if isdict(tag): return load_dict(element, nametable) + if islist(tag): return load_list(element, nametable) + k, v = load_elem(element, nametable) + return Record.fromkv(k, v) + +# Load the children of the given element. +def load_value(element, nametable=None): + children = list(element) + count = len(children) + + # No children, assume a simple text value + if count == 0: + text = element.text + if text is None: + return None + + if len(text.strip()) == 0: + return None + return text + + # Look for the special case of a single well-known structure + if count == 1: + child = children[0] + tag = child.tag + if isdict(tag): return load_dict(child, nametable) + if islist(tag): return load_list(child, nametable) + + value = record() + for child in children: + name, item = load_elem(child, nametable) + # If we have seen this name before, promote the value to a list + if name in value: + current = value[name] + if not isinstance(current, list): + value[name] = [current] + value[name].append(item) + else: + value[name] = item + + return value + +# A generic utility that enables "dot" access to dicts +class Record(dict): + """This generic utility class enables dot access to members of a Python + dictionary. + + Any key that is also a valid Python identifier can be retrieved as a field. + So, for an instance of ``Record`` called ``r``, ``r.key`` is equivalent to + ``r['key']``. A key such as ``invalid-key`` or ``invalid.key`` cannot be + retrieved as a field, because ``-`` and ``.`` are not allowed in + identifiers. + + Keys of the form ``a.b.c`` are very natural to write in Python as fields. If + a group of keys shares a prefix ending in ``.``, you can retrieve keys as a + nested dictionary by calling only the prefix. For example, if ``r`` contains + keys ``'foo'``, ``'bar.baz'``, and ``'bar.qux'``, ``r.bar`` returns a record + with the keys ``baz`` and ``qux``. If a key contains multiple ``.``, each + one is placed into a nested dictionary, so you can write ``r.bar.qux`` or + ``r['bar.qux']`` interchangeably. + """ + sep = '.' + + def __call__(self, *args): + if len(args) == 0: return self + return Record((key, self[key]) for key in args) + + def __getattr__(self, name): + try: + return self[name] + except KeyError: + raise AttributeError(name) + + def __delattr__(self, name): + del self[name] + + def __setattr__(self, name, value): + self[name] = value + + @staticmethod + def fromkv(k, v): + result = record() + result[k] = v + return result + + def __getitem__(self, key): + if key in self: + return dict.__getitem__(self, key) + key += self.sep + result = record() + for k,v in six.iteritems(self): + if not k.startswith(key): + continue + suffix = k[len(key):] + if '.' in suffix: + ks = suffix.split(self.sep) + z = result + for x in ks[:-1]: + if x not in z: + z[x] = record() + z = z[x] + z[ks[-1]] = v + else: + result[suffix] = v + if len(result) == 0: + raise KeyError("No key or prefix: %s" % key) + return result + + +def record(value=None): + """This function returns a :class:`Record` instance constructed with an + initial value that you provide. + + :param `value`: An initial record value. + :type `value`: ``dict`` + """ + if value is None: value = {} + return Record(value) + diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/__init__.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/__init__.py new file mode 100755 index 00000000..ace954a0 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/__init__.py @@ -0,0 +1,12 @@ +"""The following imports allow these classes to be imported via +the splunklib.modularinput package like so: + +from splunklib.modularinput import * +""" +from .argument import Argument +from .event import Event +from .event_writer import EventWriter +from .input_definition import InputDefinition +from .scheme import Scheme +from .script import Script +from .validation_definition import ValidationDefinition diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/argument.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/argument.py new file mode 100755 index 00000000..04214d16 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/argument.py @@ -0,0 +1,103 @@ +# Copyright 2011-2015 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from __future__ import absolute_import +try: + import xml.etree.ElementTree as ET +except ImportError: + import xml.etree.cElementTree as ET + +class Argument(object): + """Class representing an argument to a modular input kind. + + ``Argument`` is meant to be used with ``Scheme`` to generate an XML + definition of the modular input kind that Splunk understands. + + ``name`` is the only required parameter for the constructor. + + **Example with least parameters**:: + + arg1 = Argument(name="arg1") + + **Example with all parameters**:: + + arg2 = Argument( + name="arg2", + description="This is an argument with lots of parameters", + validation="is_pos_int('some_name')", + data_type=Argument.data_type_number, + required_on_edit=True, + required_on_create=True + ) + """ + + # Constant values, do not change. + # These should be used for setting the value of an Argument object's data_type field. + data_type_boolean = "BOOLEAN" + data_type_number = "NUMBER" + data_type_string = "STRING" + + def __init__(self, name, description=None, validation=None, + data_type=data_type_string, required_on_edit=False, required_on_create=False, title=None): + """ + :param name: ``string``, identifier for this argument in Splunk. + :param description: ``string``, human-readable description of the argument. + :param validation: ``string`` specifying how the argument should be validated, if using internal validation. + If using external validation, this will be ignored. + :param data_type: ``string``, data type of this field; use the class constants. + "data_type_boolean", "data_type_number", or "data_type_string". + :param required_on_edit: ``Boolean``, whether this arg is required when editing an existing modular input of this kind. + :param required_on_create: ``Boolean``, whether this arg is required when creating a modular input of this kind. + :param title: ``String``, a human-readable title for the argument. + """ + self.name = name + self.description = description + self.validation = validation + self.data_type = data_type + self.required_on_edit = required_on_edit + self.required_on_create = required_on_create + self.title = title + + def add_to_document(self, parent): + """Adds an ``Argument`` object to this ElementTree document. + + Adds an subelement to the parent element, typically + and sets up its subelements with their respective text. + + :param parent: An ``ET.Element`` to be the parent of a new subelement + :returns: An ``ET.Element`` object representing this argument. + """ + arg = ET.SubElement(parent, "arg") + arg.set("name", self.name) + + if self.title is not None: + ET.SubElement(arg, "title").text = self.title + + if self.description is not None: + ET.SubElement(arg, "description").text = self.description + + if self.validation is not None: + ET.SubElement(arg, "validation").text = self.validation + + # add all other subelements to this Argument, represented by (tag, text) + subelements = [ + ("data_type", self.data_type), + ("required_on_edit", self.required_on_edit), + ("required_on_create", self.required_on_create) + ] + + for name, value in subelements: + ET.SubElement(arg, name).text = str(value).lower() + + return arg \ No newline at end of file diff --git a/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/event.py b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/event.py new file mode 100755 index 00000000..b20d7eb9 --- /dev/null +++ b/apps/splunk_instrumentation/bin/splunk_instrumentation/splunklib/modularinput/event.py @@ -0,0 +1,114 @@ +# Copyright 2011-2015 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from __future__ import absolute_import +from io import TextIOBase +from splunk_instrumentation.splunklib.six import ensure_text + +try: + import xml.etree.cElementTree as ET +except ImportError as ie: + import xml.etree.ElementTree as ET + +class Event(object): + """Represents an event or fragment of an event to be written by this modular input to Splunk. + + To write an input to a stream, call the ``write_to`` function, passing in a stream. + """ + def __init__(self, data=None, stanza=None, time=None, host=None, index=None, source=None, + sourcetype=None, done=True, unbroken=True): + """There are no required parameters for constructing an Event + + **Example with minimal configuration**:: + + my_event = Event( + data="This is a test of my new event.", + stanza="myStanzaName", + time="%.3f" % 1372187084.000 + ) + + **Example with full configuration**:: + + excellent_event = Event( + data="This is a test of my excellent event.", + stanza="excellenceOnly", + time="%.3f" % 1372274622.493, + host="localhost", + index="main", + source="Splunk", + sourcetype="misc", + done=True, + unbroken=True + ) + + :param data: ``string``, the event's text. + :param stanza: ``string``, name of the input this event should be sent to. + :param time: ``float``, time in seconds, including up to 3 decimal places to represent milliseconds. + :param host: ``string``, the event's host, ex: localhost. + :param index: ``string``, the index this event is specified to write to, or None if default index. + :param source: ``string``, the source of this event, or None to have Splunk guess. + :param sourcetype: ``string``, source type currently set on this event, or None to have Splunk guess. + :param done: ``boolean``, is this a complete ``Event``? False if an ``Event`` fragment. + :param unbroken: ``boolean``, Is this event completely encapsulated in this ``Event`` object? + """ + self.data = data + self.done = done + self.host = host + self.index = index + self.source = source + self.sourceType = sourcetype + self.stanza = stanza + self.time = time + self.unbroken = unbroken + + def write_to(self, stream): + """Write an XML representation of self, an ``Event`` object, to the given stream. + + The ``Event`` object will only be written if its data field is defined, + otherwise a ``ValueError`` is raised. + + :param stream: stream to write XML to. + """ + if self.data is None: + raise ValueError("Events must have at least the data field set to be written to XML.") + + event = ET.Element("event") + if self.stanza is not None: + event.set("stanza", self.stanza) + event.set("unbroken", str(int(self.unbroken))) + + # if a time isn't set, let Splunk guess by not creating a