/*!
 * 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={1027:(e,t,o)=>{o.d(t,{getOptions:()=>r});o(6195),o(4793);require("@splunk/visualizations-shared/schemaUtils");const r=(e,t)=>{if(Array.isArray(t))return t;if(e&&Array.isArray(e.enum))return e.enum.map((e=>({value:e})));throw Error(`No valid values provided to editor: ${JSON.stringify(e)}`)}},2166:(e,t,o)=>{o.d(t,{hasTokens:()=>n});const r=new RegExp(/\$/.source+/(\w+:)?/.source+/([^$|:]+?)(\|[|\w]+)?/.source+/\$/.source),n=e=>"string"==typeof e&&r.test(e)},4008:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const i=a(o(9497)),s=a(o(23)),u=l(o(232)),d=o(6649),c=l(o(6643)),p=o(3563),f=l(o(6379)),b=l(o(7020)),m=l(o(9250)),v=(0,u.default)(m.default)`
    margin-top: 0;
    padding: 0;
    // adjust bottom margin according to theme
    margin-bottom: ${p.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;
    }
`,g=(0,u.default)(f.default)`
    display: flex;
    > span {
        display: flex;
        width: 35px;
    }
`,h=(0,u.default)(b.default)`
    color: ${p.variables.contentColorActive} !important;
    &:hover {
        background-color: ${p.variables.interactiveColorOverlayDrag} !important;
    }
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>i.default.createElement(g,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,d._)("Advanced configurations")},i.default.createElement(h,{"data-test":`${e}-advanced-config-button`,icon:i.default.createElement(c.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const y=({"data-test":e,children:o,isAdvanced:r=!1,label:n,hideLabel:a,labelPosition:l,labelWidth:s,tooltip:u,help:d,style:c,error:p,controlsLayout:f,onClick:b,onAdvancedConfigButtonClick:m})=>i.default.createElement(v,{"data-test":null!=e?e:"control-group",label:n,hideLabel:a,labelPosition:l,labelWidth:s,tooltip:u,help:d,error:p,style:c,onClick:b,controlsLayout:f},r?i.Children.toArray(o).filter(Boolean).map((e=>(0,i.cloneElement)(e,{style:{flex:1}}))):o,r?i.default.createElement(t.AdvancedConfigButton,{label:n,onClick:m}):null);y.propTypes={style:s.object,isAdvanced:s.bool,onClick:s.func,onAdvancedConfigButtonClick:s.func},t.default=y},5862:(e,t)=>{t.editorStyle=void 0,t.editorStyle={width:"100%"}},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")},9250:e=>{e.exports=require("@splunk/react-ui/ControlGroup")},5411:e=>{e.exports=require("@splunk/react-ui/RadioBar")},6379:e=>{e.exports=require("@splunk/react-ui/Tooltip")},3563:e=>{e.exports=require("@splunk/themes")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},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 o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{o.r(r),o.d(r,{default:()=>h});var e=o(2649),t=o.n(e),n=o(9497),a=o.n(n),l=o(23),i=o.n(l),s=o(5411),u=o.n(s),d=o(6379),c=o.n(d),p=o(2166),f=o(1027),b=o(5862),m=o(4008),v=o.n(m);const g=({onChange:e,name:o,itemSchema:r,values:l,value:i,labelPosition:s="top",labelWidth:d,label:m,isDisabled:g=!1})=>{const h=(0,f.getOptions)(r,l),y=(0,p.hasTokens)(i)||g,x=(0,n.useCallback)(((t,{value:r})=>e(t,o,r)),[e,o]),O=m&&""!==m?void 0:{marginTop:"-8px"};return a().createElement(v(),{label:m,labelPosition:s,labelWidth:d,style:O},a().createElement(u(),{"data-test":o,onChange:x,value:i,style:b.editorStyle,disabled:y},h.map((e=>{const o=e.label||e.value,r={};return e.icon?r.startAdornment=a().createElement(c(),{content:o},a().createElement(e.icon,{hideDefaultTooltip:!0})):r.label=o,a().createElement(u().Option,t()({key:e.value,value:e.value,disabled:y},r))}))))};g.propTypes={onChange:i().func.isRequired,name:i().string.isRequired,itemSchema:i().object,values:i().arrayOf(i().shape({label:i().string,value:i().oneOfType([i().string,i().bool]).isRequired})),value:i().oneOfType([i().string,i().bool]),label:i().string.isRequired,labelPosition:i().oneOf(["left","top"]),labelWidth:i().number,isDisabled:i().bool};const h=g})(),module.exports=r})();
//# sourceMappingURL=RadioBarEditor.js.map