/*!
 * Copyright © 2018 Splunk Inc.
 * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
 * in part without a valid written license from Splunk Inc. is PROHIBITED.
 */(()=>{"use strict";var e={5456:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var a=r(6195),l=r.n(a),n=r(9497),i=r.n(n),o=r(23),s=r.n(o),u=r(232),d=r.n(u),c=r(4793),f=r(6649),p=r(8965),b=r.n(p),m=r(9967),g=r(4008),v=r.n(g);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const _=d().div`
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    [data-test='control-group'] {
        margin: 0;
    }
`,O=i().createElement(_,null,i().createElement("span",{"data-test":"form-row-header-label"},(0,f._)("Label")),i().createElement("span",{"data-test":"form-row-header-value"},(0,f._)("Value"))),P=(e,t)=>e.filter(((e,r)=>r!==t)),S=(e,t,r)=>"string"!=typeof e||""===e.trim()||t.filter((t=>t[r]===e)).length>1,C=(e,t)=>S(e,t,"label"),D=(e,t)=>S(e,t,"value"),j=d().div`
    width: 100%;
`,E=[],M=({onChange:e,name:t,value:r=E,labelPosition:a="top",label:l="",validate:o})=>{const[s,u]=(0,n.useState)(r),[d,p]=(0,n.useState)(r.length);(0,n.useEffect)((()=>{u(r),r.length>d&&p(r.length)}),[r,d]);const g=(0,n.useCallback)((a=>{var l;(0,c.isEqual)(a,r)||((l=a).some((({label:e,value:t})=>"string"!=typeof e||""===e.trim()||"string"!=typeof t||""===t.trim()))||(0,c.uniqBy)(l,(e=>e.value)).length!==l.length||(0,c.uniqBy)(l,(e=>e.label)).length!==l.length)?u(a):e(null,t,a)}),[r,t,e]),y=(0,n.useCallback)(((e,{index:t})=>{const r=P(s,t);g(r)}),[s,g]),S=(0,n.useCallback)((({fromIndex:e,toIndex:t})=>{const r=s[e],a=P(s,e);a.splice(t,0,r),g(a)}),[s,g]),M=(0,n.useCallback)(((e,t)=>(r,a,l="")=>{const n=s[e],i=[...s];i.splice(e,1,h(h({},n),{},{[t]:l.trim()})),g(i)}),[s,g]),x=(0,n.useCallback)((()=>{const e=s.concat({label:`Label ${d}`,value:`menu_v${d}`});p(d+1),g(e)}),[s,d,g]),F=s.map(((e,t)=>{const{label:r,value:a}=e;return i().createElement(b().Row,{index:t,key:`${r}_${a}_${t}`,onRequestRemove:y},i().createElement(_,null,i().createElement(m.default,{label:(0,f._)("Label"),hideLabel:!0,value:r,onChange:M(t,"label"),name:"item-label-editor",error:C(r,s),validate:o}),i().createElement(m.default,{label:(0,f._)("Value"),hideLabel:!0,value:a,onChange:M(t,"value"),name:"item-value-editor",error:D(a,s),validate:o})))}));return i().createElement(v(),{label:l,labelPosition:a},i().createElement(j,null,i().createElement(b(),{addLabel:(0,f._)("Add new"),header:O,onRequestAdd:x,onRequestMove:S},F)))};M.propTypes={onChange:s().func.isRequired,name:s().string.isRequired,label:s().string,value:s().arrayOf(s().exact({label:s().string,value:s().string})),labelPosition:s().oneOf(["top","left"]),validate:s().func};const x=M},9967:(e,t,r)=>{r.d(t,{default:()=>S});var a=r(2649),l=r.n(a),n=r(6195),i=r.n(n);const o=require("@babel/runtime/helpers/objectWithoutProperties");var s=r.n(o),u=r(9497),d=r.n(u),c=r(23),f=r.n(c),p=r(4793),b=r(4082),m=r.n(b),g=r(4008),v=r.n(g),y=r(5862);const h=["onChange","name","value","label","labelPosition","labelWidth","labelStyle","hideLabel","isAdvanced","isDisabled","help","tooltip","validate","error"];function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}const O={},P=e=>{let{onChange:t,name:r,value:a="",label:n,labelPosition:o="top",labelWidth:c,labelStyle:f=O,hideLabel:b=!1,isAdvanced:g,isDisabled:P=!1,help:S,tooltip:C,validate:D,error:j}=e,E=s()(e,h);const[M,x]=(0,u.useState)(a),F=(0,u.useCallback)((e=>"function"==typeof D?D({value:e}):null),[D]),[k,w]=(0,u.useState)(F(a)),A=(0,u.useMemo)((()=>(0,p.debounce)((e=>{w(F(e))}),250)),[F]);(0,u.useEffect)((()=>()=>{A.cancel()}),[A]),(0,u.useEffect)((()=>{x(a),w(F(a))}),[F,a]);const q=(0,u.useCallback)(((e,{value:t})=>{x(t),A(t)}),[A]),L=(0,u.useCallback)((e=>{const l=M.trim();if(l===a)return;const n=F(l);w(n),n||t(e,r,l)}),[M,a,F,t,r]),T=(0,u.useCallback)((e=>{"Enter"===e.key&&L(e)}),[L]),B=(0,u.useMemo)((()=>n&&""!==n?f:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},f)),[n,f]);return d().createElement(v(),{label:n,labelPosition:o,labelWidth:c,style:B,hideLabel:b,help:S,tooltip:C,error:(null==k?void 0:k.message)||j,isAdvanced:g},d().createElement(m(),l()({key:a,"data-test":r,style:y.editorStyle,onChange:q,onKeyDown:T,onBlur:L,value:M,disabled:P,canClear:!0},E,{error:!!k||j})))};P.propTypes={onChange:f().func.isRequired,name:f().string.isRequired,label:f().string.isRequired,value:f().string,labelPosition:f().oneOf(["top","left"]),labelWidth:f().number,labelStyle:f().object,hideLabel:f().bool,isAdvanced:f().bool,isDisabled:f().bool,validate:f().func,error:f().bool,help:f().string,tooltip:f().string};const S=P},5731:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectionEditor=void 0;const o=n(r(9497)),s=i(r(2373)),u=r(1413),d=r(9033),c=r(1385),f=r(1256),p=i(r(4008)),b=r(5862),m=r(8999);t.ColumnSelectionEditor=({name:e,value:t,label:r="",labelPosition:a="top",dataSourceKey:l="primary",dataSourceBindings:n,prepareValue:i=(e=>e),onChange:g,isAdvanced:v,isDisabled:y,filterByTypes:h,tooltip:_,hideEditorWhenLoading:O=!1})=>{const P=(0,c.useDataSource)({dataSourceBindings:n,dataSourceKey:l}),{columns:S,fields:C}=(null==P?void 0:P.data)||{columns:[],fields:[]},D=(0,f.getAvailableFieldsWithTypes)(S,C),j=null==t?t:(0,u.getFieldsFromDSL)(t,{[l]:P})[0]||"",[E,M]=(0,o.useState)(j);o.default.useEffect((()=>{M(j)}),[j]);const[x,F]=(0,o.useState)(""),k=D.filter((e=>-1!==e.name.indexOf(x))),w=(0,m.useColumnSelectorFooterMessage)({availableFields:D,selectedFields:[E],filteredFields:k,filter:x}),A=(0,o.useCallback)(((t,{value:r})=>{M(r);const a=i({options:{[e]:`> ${l} | seriesByName('${r}')`}});g(t,a)}),[l,e,g,i]),q=(0,o.useCallback)(((e,{keyword:t})=>{F(t)}),[]),{hasError:L,isMissing:T,isLoading:B}=(0,d.getDataSourceStateInfo)(P),R=T||L||y,N=(0,f.getPlaceholderMessage)({isMissing:T,isLoading:B,hasError:L});return(!O||!!E)&&o.default.createElement(p.default,{label:r,labelPosition:a,tooltip:_,isAdvanced:v},o.default.createElement(s.default,{"data-test":"ColumnSelectionEditor",value:E,onFilterChange:q,onChange:A,footerMessage:w,disabled:R,placeholder:N,isLoadingOptions:B,error:L,style:b.editorStyle,filter:!0},k.map((e=>o.default.createElement(s.default.Option,{key:e.name,label:`${e.name} (${e.type})`,value:e.name,disabled:!!(null==h?void 0:h.length)&&!h.find((t=>t===e.type))})))))},t.default=t.ColumnSelectionEditor},7585:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(9497)),s=n(r(23)),u=r(4793),d=i(r(4082)),c=i(r(9250)),f=i(r(7143)),p=r(6649),b=i(r(5731)),m=i(r(5456)),g=r(4381),v=r(5862),y=(0,p._)("Advanced configuration options are being used by this input. Please edit in source mode."),h=({name:e,context:t,value:r="",label:a,onChange:l,dataSourceBindings:n,labelPosition:i="top",labelWidth:s,help:h=y,validate:_})=>{const[O,P]=o.useState([]),[S,C]=o.useState(""),[D,j]=o.useState("");o.useEffect((()=>{const{staticOptions:e,dynamicOptionsLabel:a,dynamicOptionsValue:l}=(0,g.getDynamicOptionsFromConfig)({items:r,context:t});P(e),C(a),j(l)}),[r,t]),o.useEffect((()=>{void 0!==n.primary||Array.isArray(r)||l(null,{context:{formattedConfig:void 0,formattedStatics:void 0,statics:void 0,label:void 0,value:void 0},options:{[e]:O}})}),[n,e,r,l,O]);const E=o.useCallback(((t,a,n)=>{if(Array.isArray(r)&&(!a||!n))l(null,{options:{[e]:t}});else{const r=(0,u.unzip)(t.map((({label:e,value:t})=>[e,t])));l(null,{context:{formattedConfig:{number:{prefix:""}},formattedStatics:">statics | formatByType(formattedConfig)",statics:r,label:`>primary | seriesByName("${a}") | renameSeries("label") | formatByType(formattedConfig)`,value:`>primary | seriesByName("${n}") | renameSeries("value") | formatByType(formattedConfig)`},options:{[e]:">frame(label, value) | prepend(formattedStatics) | objects()"}})}}),[e,r,l]),M=o.useCallback(((e,t,r)=>{E(r,S,D)}),[E,S,D]),x=o.useCallback(((e,{value:t})=>{""===D?C(t):E(O,t,D)}),[E,O,D]),F=o.useCallback(((e,{value:t})=>{""===S?j(t):E(O,S,t)}),[E,O,S]),k=e=>t=>{var r;const a=null===(r=null==t?void 0:t.options)||void 0===r?void 0:r[e];return"string"==typeof a?{value:(0,g.getFieldFromFieldNameDsl)(a)}:{value:""}};if(o.useMemo((()=>(0,g.isConfigAdvanced)({items:r,context:t})),[r,t]))return o.createElement(c.default,{label:(0,p._)(a),labelPosition:i,labelWidth:s,help:h},o.createElement(d.default,{key:r.toString(),"data-test":e,disabled:!0,defaultValue:r.toString()}));const w=!!n.primary;return o.createElement(o.Fragment,null,o.createElement(m.default,{name:"",label:(0,p._)("Static menu configuration"),labelPosition:i,value:O,onChange:M,validate:_}),w&&o.createElement(f.default,{key:"dynamic-item-editor-label-value-layout",gutter:v.VERTICAL_EDITOR_SPACING},o.createElement(f.default.Row,{key:"dynamic-item-editor-label-row"},o.createElement(b.default,{name:"label",label:(0,p._)("Dynamic menu label field"),dataSourceKey:"primary",dataSourceBindings:n,value:`>primary | seriesByName("${S}")`,context:t,onChange:x,prepareValue:k("label")})),o.createElement(f.default.Row,{key:"dynamic-item-editor-value-row"},o.createElement(b.default,{name:"value",label:(0,p._)("Dynamic menu value field"),dataSourceKey:"primary",dataSourceBindings:n,value:`>primary | seriesByName("${D}")`,context:t,onChange:F,prepareValue:k("value")}))))};h.propTypes={onChange:s.func.isRequired,name:s.string.isRequired,label:s.string.isRequired,value:s.oneOfType([s.arrayOf(s.shape({label:s.string.isRequired,value:s.string.isRequired}).isRequired),s.string]),labelPosition:s.oneOf(["top","left"]),labelWidth:s.number,context:s.shape({label:s.string,value:s.string,statics:s.arrayOf(s.arrayOf(s.string.isRequired).isRequired)}).isRequired,dataSourceBindings:s.shape({primary:s.any}).isRequired,help:s.string},t.default=h},8999:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useColumnSelectorFooterMessage=void 0;const i=n(r(9497)),o=r(3620);t.useColumnSelectorFooterMessage=({filter:e,availableFields:t,selectedFields:r,filteredFields:a,noSelectedFieldsInfo:l=!1})=>{const n=(0,i.useMemo)((()=>{if(!r||!a)return[];const e=new Set(r.filter((e=>""!==e&&void 0!==e)));return a.filter((t=>e.has(t.name)))}),[r,a]);return e&&!a.length?null:i.default.createElement(o.ColumnSelectorFooterMessage,{noSelectedFieldsInfo:l,numSelected:null==n?void 0:n.length,numFiltered:a.length,numAvailable:t.length,filter:e})}},1385:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDataSource=void 0;const l=r(9497),n=a(r(4853)),i=r(4793);t.useDataSource=({dataSourceBindings:e,dataSourceKey:t})=>{const r=(0,l.useContext)(n.default),[a,o]=(0,l.useState)();return(0,l.useEffect)((()=>{if(!(0,i.get)(e,t))return o(null),()=>{};const a=(0,i.isFunction)(r.subscribe)&&r.subscribe(t,(e=>o(e)));return()=>{a&&a()}}),[e]),a}},4008:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const o=n(r(9497)),s=n(r(23)),u=i(r(232)),d=r(6649),c=i(r(6643)),f=r(3563),p=i(r(6379)),b=i(r(7020)),m=i(r(9250)),g=(0,u.default)(m.default)`
    margin-top: 0;
    padding: 0;
    // adjust bottom margin according to theme
    margin-bottom: ${f.variables.spacingMedium};
    width: 100%;

    // remove top margin of the first component in control group
    &:first-child {
        margin-top: 0;
    }

    // remove bottom margin of the last component in control group
    &:last-child {
        margin-bottom: 0;
    }
    // remove top padding on label of the first control group
    [data-test='label']:first-of-type {
        padding-top: 0;
    }
`,v=(0,u.default)(p.default)`
    display: flex;
    > span {
        display: flex;
        width: 35px;
    }
`,y=(0,u.default)(b.default)`
    color: ${f.variables.contentColorActive} !important;
    &:hover {
        background-color: ${f.variables.interactiveColorOverlayDrag} !important;
    }
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>o.default.createElement(v,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,d._)("Advanced configurations")},o.default.createElement(y,{"data-test":`${e}-advanced-config-button`,icon:o.default.createElement(c.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const h=({"data-test":e,children:r,isAdvanced:a=!1,label:l,hideLabel:n,labelPosition:i,labelWidth:s,tooltip:u,help:d,style:c,error:f,controlsLayout:p,onClick:b,onAdvancedConfigButtonClick:m})=>o.default.createElement(g,{"data-test":null!=e?e:"control-group",label:l,hideLabel:n,labelPosition:i,labelWidth:s,tooltip:u,help:d,error:f,style:c,onClick:b,controlsLayout:p},a?o.Children.toArray(r).filter(Boolean).map((e=>(0,o.cloneElement)(e,{style:{flex:1}}))):r,a?o.default.createElement(t.AdvancedConfigButton,{label:l,onClick:m}):null);h.propTypes={style:s.object,isAdvanced:s.bool,onClick:s.func,onAdvancedConfigButtonClick:s.func},t.default=h},3620:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,l)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return l(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectorFooterMessage=void 0;const i=n(r(9497)),o=r(3773),s=r(6649),u=r(9497);t.ColumnSelectorFooterMessage=({numSelected:e,numFiltered:t,numAvailable:r,filter:a,noSelectedFieldsInfo:l})=>{const n=(0,u.useMemo)((()=>a?l?(0,o.sprintf)((0,s._)("%(filtered)d filtered from %(available)d fields"),{filtered:t,available:r}):(0,o.sprintf)((0,s._)("%(selected)d selected from %(filtered)d filtered"),{selected:e,filtered:t}):l?(0,o.sprintf)((0,s._)("%(shown)d of %(available)d fields"),{shown:t,available:r}):(0,o.sprintf)((0,s._)("%(selected)d selected from %(available)d"),{selected:e,available:r})),[a,l,t,r,e]);return i.createElement("span",{"data-test":"footer-message","aria-live":"polite","aria-atomic":"true"},n)}},5862:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.editorStyle=t.DROPDOWN_MENU_WIDTH=t.VERTICAL_EDITOR_SPACING=t.FLYOUT_WIDTH=t.COLUMN_FLYOUT_PADDING=t.FLYOUT_PADDING=void 0,t.FLYOUT_PADDING=21,t.COLUMN_FLYOUT_PADDING=16,t.FLYOUT_WIDTH=344,t.VERTICAL_EDITOR_SPACING=16,t.DROPDOWN_MENU_WIDTH=327,t.editorStyle={width:"100%"}},1256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPlaceholderMessage=t.sanitizeFieldNames=t.getFilteredFields=t.getAvailableFieldsWithTypes=void 0;const a=r(6649),l=r(2588);t.getAvailableFieldsWithTypes=(e,t)=>t.map(((t,r)=>{const{name:a}=t;return{name:a,type:(0,l.canInferTypeFromMeta)(t)?(0,l.getDataTypeForMeta)(t):(0,l.inferDataTypeFromData)(e[r])}}));t.getFilteredFields=(e,t)=>e.filter((e=>-1!==e.name.indexOf(t)));t.sanitizeFieldNames=(e,t)=>"string"==typeof e&&t.includes(e)?[e]:Array.isArray(e)?e.filter((e=>t.includes(e))):[];t.getPlaceholderMessage=({hasError:e,isLoading:t,isMissing:r,defaultMessage:l="Select a field from data source"})=>r?(0,a._)("Set up data source to select"):e?(0,a._)("Please set up valid data source to select"):t?(0,a._)("Loading data source..."):(0,a._)(l)},4381:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicOptionsFromConfig=t.isConfigAdvanced=t.getFieldFromFieldNameDsl=void 0;const l=r(4793),n=r(2918),i=a(r(3453));t.getFieldFromFieldNameDsl=e=>{try{const t=n.DslParser.parse(i.default.withoutArrow(e)),r=(0,l.find)(t,{type:"method",name:"seriesByName"});return(0,l.get)(r,["args","0","v"],"")}catch(e){return""}};const o=e=>{try{const t=n.DslParser.parse(i.default.withoutArrow(e)),r=(0,l.findLastIndex)(t,{type:"method",name:"seriesByName"}),a=(0,l.findLastIndex)(t,{type:"method",name:"renameSeries"});return-1!==r&&-1!==a&&r<a}catch(e){return!1}};t.isConfigAdvanced=({items:e,context:t})=>{if("string"!=typeof e)return!1;const{label:r,value:a}=t;return"string"!=typeof r||"string"!=typeof a||(!(e=>{try{const t=n.DslParser.parse(i.default.withoutArrow(e));return 3===t.length&&(0,l.isMatch)(t[0],{type:"method",name:"frame"})&&(0,l.isMatch)(t[1],{type:"method",name:"prepend"})&&(0,l.isMatch)(t[2],{type:"method",name:"objects"})}catch(e){return!1}})(e)||!o(r)||!o(a))};t.getDynamicOptionsFromConfig=({items:e,context:r})=>{if(Array.isArray(e))return{staticOptions:e,dynamicOptionsLabel:"",dynamicOptionsValue:""};const a=r.statics||[],n=(0,l.zipWith)(...a,((e,t)=>({label:e,value:t}))),{label:i,value:o}=r;return{staticOptions:n,dynamicOptionsLabel:i?(0,t.getFieldFromFieldNameDsl)(i):"",dynamicOptionsValue:o?(0,t.getFieldFromFieldNameDsl)(o):""}}},6195:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2649:e=>{e.exports=require("@babel/runtime/helpers/extends")},6643:e=>{e.exports=require("@splunk/react-icons/SlidersDoubleHorizontal")},7020:e=>{e.exports=require("@splunk/react-ui/Button")},7143:e=>{e.exports=require("@splunk/react-ui/ColumnLayout")},9250:e=>{e.exports=require("@splunk/react-ui/ControlGroup")},8965:e=>{e.exports=require("@splunk/react-ui/FormRows")},2373:e=>{e.exports=require("@splunk/react-ui/Select")},4082:e=>{e.exports=require("@splunk/react-ui/Text")},6379:e=>{e.exports=require("@splunk/react-ui/Tooltip")},3563:e=>{e.exports=require("@splunk/themes")},3773:e=>{e.exports=require("@splunk/ui-utils/format")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},4853:e=>{e.exports=require("@splunk/visualization-context/DataSourceContext")},2918:e=>{e.exports=require("@splunk/visualization-encoding/DslParser")},3453:e=>{e.exports=require("@splunk/visualization-encoding/EncodingParser")},1413:e=>{e.exports=require("@splunk/visualization-encoding/utils/dsl")},2588:e=>{e.exports=require("@splunk/visualization-encoding/utils/types")},9033:e=>{e.exports=require("@splunk/visualizations-shared/dataSourceUtils")},4793:e=>{e.exports=require("lodash")},23:e=>{e.exports=require("prop-types")},9497:e=>{e.exports=require("react")},232:e=>{e.exports=require("styled-components")}},t={};function r(a){var l=t[a];if(void 0!==l)return l.exports;var n=t[a]={exports:{}};return e[a].call(n.exports,n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=r(7585);module.exports=a})();
//# sourceMappingURL=DynamicItemEditor.js.map