/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.triggersActionsUi_bundle_jsonpfunction=window.triggersActionsUi_bundle_jsonpfunction||[]).push([[13,33,34],{113:function(e,t,n){"use strict";n.d(t,"f",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"d",(function(){return s}));const o=e=>{var t;return null==e||null===(t=e.actions)||void 0===t?void 0:t.show},i=e=>{var t;return null==e||null===(t=e.actions)||void 0===t?void 0:t.save},r=e=>{var t;return null==e||null===(t=e.actions)||void 0===t?void 0:t.execute},a=e=>{var t;return null==e||null===(t=e.actions)||void 0===t?void 0:t.delete};function c(e,t){var n,o;return null!==(n=null==t||null===(o=t.authorizedConsumers[e])||void 0===o?void 0:o.all)&&void 0!==n&&n}const s=e=>{var t,n;return null==e||null===(t=e.management)||void 0===t||null===(n=t.security)||void 0===n?void 0:n.api_keys}},115:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeable=t.pipe=void 0;var o=n(112);t.pipe=o.pipe;t.pipeable=function(e){var t={};return function(e){return"function"==typeof e.map}(e)&&(t.map=function(t){return function(n){return e.map(n,t)}}),function(e){return"function"==typeof e.contramap}(e)&&(t.contramap=function(t){return function(n){return e.contramap(n,t)}}),function(e){return"function"==typeof e.mapWithIndex}(e)&&(t.mapWithIndex=function(t){return function(n){return e.mapWithIndex(n,t)}}),function(e){return"function"==typeof e.ap}(e)&&(t.ap=function(t){return function(n){return e.ap(n,t)}},t.apFirst=function(t){return function(n){return e.ap(e.map(n,(function(e){return function(){return e}})),t)}},t.apSecond=function(t){return function(n){return e.ap(e.map(n,(function(){return function(e){return e}})),t)}}),function(e){return"function"==typeof e.chain}(e)&&(t.chain=function(t){return function(n){return e.chain(n,t)}},t.chainFirst=function(t){return function(n){return e.chain(n,(function(n){return e.map(t(n),(function(){return n}))}))}},t.flatten=function(t){return e.chain(t,o.identity)}),function(e){return"function"==typeof e.bimap}(e)&&(t.bimap=function(t,n){return function(o){return e.bimap(o,t,n)}},t.mapLeft=function(t){return function(n){return e.mapLeft(n,t)}}),function(e){return"function"==typeof e.extend}(e)&&(t.extend=function(t){return function(n){return e.extend(n,t)}},t.duplicate=function(t){return e.extend(t,o.identity)}),function(e){return"function"==typeof e.reduce}(e)&&(t.reduce=function(t,n){return function(o){return e.reduce(o,t,n)}},t.foldMap=function(t){var n=e.foldMap(t);return function(e){return function(t){return n(t,e)}}},t.reduceRight=function(t,n){return function(o){return e.reduceRight(o,t,n)}}),function(e){return"function"==typeof e.reduceWithIndex}(e)&&(t.reduceWithIndex=function(t,n){return function(o){return e.reduceWithIndex(o,t,n)}},t.foldMapWithIndex=function(t){var n=e.foldMapWithIndex(t);return function(e){return function(t){return n(t,e)}}},t.reduceRightWithIndex=function(t,n){return function(o){return e.reduceRightWithIndex(o,t,n)}}),function(e){return"function"==typeof e.alt}(e)&&(t.alt=function(t){return function(n){return e.alt(n,t)}}),function(e){return"function"==typeof e.compact}(e)&&(t.compact=e.compact,t.separate=e.separate),function(e){return"function"==typeof e.filter}(e)&&(t.filter=function(t){return function(n){return e.filter(n,t)}},t.filterMap=function(t){return function(n){return e.filterMap(n,t)}},t.partition=function(t){return function(n){return e.partition(n,t)}},t.partitionMap=function(t){return function(n){return e.partitionMap(n,t)}}),function(e){return"function"==typeof e.filterWithIndex}(e)&&(t.filterWithIndex=function(t){return function(n){return e.filterWithIndex(n,t)}},t.filterMapWithIndex=function(t){return function(n){return e.filterMapWithIndex(n,t)}},t.partitionWithIndex=function(t){return function(n){return e.partitionWithIndex(n,t)}},t.partitionMapWithIndex=function(t){return function(n){return e.partitionMapWithIndex(n,t)}}),function(e){return"function"==typeof e.promap}(e)&&(t.promap=function(t,n){return function(o){return e.promap(o,t,n)}}),function(e){return"function"==typeof e.compose}(e)&&(t.compose=function(t){return function(n){return e.compose(n,t)}}),function(e){return"function"==typeof e.throwError}(e)&&(t.fromOption=function(t){return function(n){return"None"===n._tag?e.throwError(t()):e.of(n.value)}},t.fromEither=function(t){return"Left"===t._tag?e.throwError(t.left):e.of(t.right)},t.fromPredicate=function(t,n){return function(o){return t(o)?e.of(o):e.throwError(n(o))}},t.filterOrElse=function(t,n){return function(o){return e.chain(o,(function(o){return t(o)?e.of(o):e.throwError(n(o))}))}}),t}},120:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.apS=t.bind=t.bindTo=t.getRefinement=t.exists=t.elem=t.option=t.MonadThrow=t.Witherable=t.Traversable=t.Filterable=t.Compactable=t.Extend=t.Alternative=t.Alt=t.Foldable=t.Monad=t.Applicative=t.Functor=t.getMonoid=t.getLastMonoid=t.getFirstMonoid=t.getApplyMonoid=t.getApplySemigroup=t.getOrd=t.getEq=t.getShow=t.URI=t.wilt=t.wither=t.sequence=t.traverse=t.partitionMap=t.partition=t.filterMap=t.filter=t.separate=t.compact=t.reduceRight=t.foldMap=t.reduce=t.duplicate=t.extend=t.throwError=t.zero=t.alt=t.flatten=t.chainFirst=t.chain=t.of=t.apSecond=t.apFirst=t.ap=t.map=t.mapNullable=t.getOrElse=t.getOrElseW=t.toUndefined=t.toNullable=t.fold=t.fromEither=t.getRight=t.getLeft=t.tryCatch=t.fromPredicate=t.fromNullable=t.some=t.none=t.isNone=t.isSome=void 0;var o=n(112);function i(e){return null==e?t.none:t.some(e)}function r(e){return"Right"===e._tag?t.none:t.some(e.left)}function a(e){return"Left"===e._tag?t.none:t.some(e.right)}t.isSome=function(e){return"Some"===e._tag},t.isNone=function(e){return"None"===e._tag},t.none={_tag:"None"},t.some=function(e){return{_tag:"Some",value:e}},t.fromNullable=i,t.fromPredicate=function(e){return function(n){return e(n)?t.some(n):t.none}},t.tryCatch=function(e){try{return t.some(e())}catch(e){return t.none}},t.getLeft=r,t.getRight=a,t.fromEither=function(e){return"Left"===e._tag?t.none:t.some(e.right)},t.fold=function(e,n){return function(o){return t.isNone(o)?e():n(o.value)}},t.toNullable=function(e){return t.isNone(e)?null:e.value},t.toUndefined=function(e){return t.isNone(e)?void 0:e.value},t.getOrElseW=function(e){return function(n){return t.isNone(n)?e():n.value}},t.getOrElse=t.getOrElseW,t.mapNullable=function(e){return function(n){return t.isNone(n)?t.none:i(e(n.value))}};var c=function(e,n){return o.pipe(e,t.map(n))},s=function(e,n){return o.pipe(e,t.ap(n))},u=function(e,n){return o.pipe(e,t.chain(n))},l=function(e,n,i){return o.pipe(e,t.reduce(n,i))},d=function(e){var n=t.foldMap(e);return function(e,t){return o.pipe(e,n(t))}},p=function(e,n,i){return o.pipe(e,t.reduceRight(n,i))},f=function(e){var n=t.traverse(e);return function(e,t){return o.pipe(e,n(t))}},m=function(e,n){return o.pipe(e,t.alt(n))},g=function(e,n){return o.pipe(e,t.filter(n))},b=function(e,n){return o.pipe(e,t.filterMap(n))},j=function(e,n){return o.pipe(e,t.extend(n))},h=function(e,n){return o.pipe(e,t.partition(n))},y=function(e,n){return o.pipe(e,t.partitionMap(n))},x=function(e){var n=t.wither(e);return function(e,t){return o.pipe(e,n(t))}},O=function(e){var n=t.wilt(e);return function(e,t){return o.pipe(e,n(t))}};t.map=function(e){return function(n){return t.isNone(n)?t.none:t.some(e(n.value))}},t.ap=function(e){return function(n){return t.isNone(n)||t.isNone(e)?t.none:t.some(n.value(e.value))}},t.apFirst=function(e){return o.flow(t.map((function(e){return function(){return e}})),t.ap(e))},t.apSecond=function(e){return o.flow(t.map((function(){return function(e){return e}})),t.ap(e))},t.of=t.some,t.chain=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)}},t.chainFirst=function(e){return t.chain((function(n){return o.pipe(e(n),t.map((function(){return n})))}))},t.flatten=t.chain(o.identity),t.alt=function(e){return function(n){return t.isNone(n)?e():n}},t.zero=function(){return t.none},t.throwError=function(){return t.none},t.extend=function(e){return function(n){return t.isNone(n)?t.none:t.some(e(n))}},t.duplicate=t.extend(o.identity),t.reduce=function(e,n){return function(o){return t.isNone(o)?e:n(e,o.value)}},t.foldMap=function(e){return function(n){return function(o){return t.isNone(o)?e.empty:n(o.value)}}},t.reduceRight=function(e,n){return function(o){return t.isNone(o)?e:n(o.value,e)}},t.compact=t.flatten;var v={left:t.none,right:t.none};function I(e){return{equals:function(n,o){return n===o||(t.isNone(n)?t.isNone(o):!t.isNone(o)&&e.equals(n.value,o.value))}}}function A(e){return{concat:function(n,o){return t.isSome(n)&&t.isSome(o)?t.some(e.concat(n.value,o.value)):t.none}}}t.separate=function(e){var n=o.pipe(e,t.map((function(e){return{left:r(e),right:a(e)}})));return t.isNone(n)?v:n.value},t.filter=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)?n:t.none}},t.filterMap=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)}},t.partition=function(e){return function(n){return{left:o.pipe(n,t.filter((function(t){return!e(t)}))),right:o.pipe(n,t.filter(e))}}},t.partitionMap=function(e){return function(n){return t.separate(o.pipe(n,t.map(e)))}},t.traverse=function(e){return function(n){return function(o){return t.isNone(o)?e.of(t.none):e.map(n(o.value),t.some)}}},t.sequence=function(e){return function(n){return t.isNone(n)?e.of(t.none):e.map(n.value,t.some)}},t.wither=function(e){return function(n){return function(o){return t.isNone(o)?e.of(t.none):n(o.value)}}},t.wilt=function(e){return function(n){return function(i){var c=o.pipe(i,t.map((function(t){return e.map(n(t),(function(e){return{left:r(e),right:a(e)}}))})));return t.isNone(c)?e.of({left:t.none,right:t.none}):c.value}}},t.URI="Option",t.getShow=function(e){return{show:function(n){return t.isNone(n)?"none":"some("+e.show(n.value)+")"}}},t.getEq=I,t.getOrd=function(e){return{equals:I(e).equals,compare:function(n,o){return n===o?0:t.isSome(n)?t.isSome(o)?e.compare(n.value,o.value):1:-1}}},t.getApplySemigroup=A,t.getApplyMonoid=function(e){return{concat:A(e).concat,empty:t.some(e.empty)}},t.getFirstMonoid=function(){return{concat:function(e,n){return t.isNone(e)?n:e},empty:t.none}},t.getLastMonoid=function(){return{concat:function(e,n){return t.isNone(n)?e:n},empty:t.none}},t.getMonoid=function(e){return{concat:function(n,o){return t.isNone(n)?o:t.isNone(o)?n:t.some(e.concat(n.value,o.value))},empty:t.none}},t.Functor={URI:t.URI,map:c},t.Applicative={URI:t.URI,map:c,ap:s,of:t.of},t.Monad={URI:t.URI,map:c,ap:s,of:t.of,chain:u},t.Foldable={URI:t.URI,reduce:l,foldMap:d,reduceRight:p},t.Alt={URI:t.URI,map:c,alt:m},t.Alternative={URI:t.URI,map:c,ap:s,of:t.of,alt:m,zero:t.zero},t.Extend={URI:t.URI,map:c,extend:j},t.Compactable={URI:t.URI,compact:t.compact,separate:t.separate},t.Filterable={URI:t.URI,map:c,compact:t.compact,separate:t.separate,filter:g,filterMap:b,partition:h,partitionMap:y},t.Traversable={URI:t.URI,map:c,reduce:l,foldMap:d,reduceRight:p,traverse:f,sequence:t.sequence},t.Witherable={URI:t.URI,map:c,reduce:l,foldMap:d,reduceRight:p,traverse:f,sequence:t.sequence,compact:t.compact,separate:t.separate,filter:g,filterMap:b,partition:h,partitionMap:y,wither:x,wilt:O},t.MonadThrow={URI:t.URI,map:c,ap:s,of:t.of,chain:u,throwError:t.throwError},t.option={URI:t.URI,map:c,of:t.of,ap:s,chain:u,reduce:l,foldMap:d,reduceRight:p,traverse:f,sequence:t.sequence,zero:t.zero,alt:m,extend:j,compact:t.compact,separate:t.separate,filter:g,filterMap:b,partition:h,partitionMap:y,wither:x,wilt:O,throwError:t.throwError},t.elem=function(e){return function(n,o){return!t.isNone(o)&&e.equals(n,o.value)}},t.exists=function(e){return function(n){return!t.isNone(n)&&e(n.value)}},t.getRefinement=function(e){return function(n){return t.isSome(e(n))}},t.bindTo=function(e){return t.map(o.bindTo_(e))},t.bind=function(e,n){return t.chain((function(i){return o.pipe(n(i),t.map((function(t){return o.bind_(i,e,t)})))}))},t.apS=function(e,n){return o.flow(t.map((function(t){return function(n){return o.bind_(t,e,n)}})),t.ap(n))}},121:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(3);const i={label:o.i18n.translate("xpack.triggersActionsUI.technicalPreviewBadgeLabel",{defaultMessage:"Technical preview"}),tooltipContent:o.i18n.translate("xpack.triggersActionsUI.technicalPreviewBadgeDescription",{defaultMessage:"This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features."})}},132:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(84),i=n(1),r=o.__importDefault(n(145));t.default=function(e,t){void 0===t&&(t=[]);var n=r.default(e,t,{loading:!0}),o=n[0],a=n[1];return i.useEffect((function(){a()}),[a]),o}},142:function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return p})),n(1);var o=n(9),i=n(3),r=n(25),a=n(2),c=n(12),s=(n(171),n(0));const u=e=>({isEnabled:!1,message:i.i18n.translate("xpack.triggersActionsUI.checkActionTypeEnabled.actionTypeDisabledByLicenseMessage",{defaultMessage:"This connector requires a {minimumLicenseRequired} license.",values:{minimumLicenseRequired:Object(o.upperFirst)(e.minimumLicenseRequired)}}),messageCard:Object(s.jsx)(a.EuiCard,{titleSize:"xs",title:i.i18n.translate("xpack.triggersActionsUI.licenseCheck.actionTypeDisabledByLicenseMessageTitle",{defaultMessage:"This feature requires a {minimumLicenseRequired} license.",values:{minimumLicenseRequired:Object(o.upperFirst)(e.minimumLicenseRequired)}}),description:i.i18n.translate("xpack.triggersActionsUI.licenseCheck.actionTypeDisabledByLicenseMessageDescription",{defaultMessage:"To re-enable this action, please upgrade your license."}),className:"actCheckActionTypeEnabled__disabledActionWarningCard",children:Object(s.jsx)(a.EuiLink,{href:c.VIEW_LICENSE_OPTIONS_LINK,target:"_blank"},Object(s.jsx)(r.FormattedMessage,{defaultMessage:"View license options",id:"xpack.triggersActionsUI.licenseCheck.actionTypeDisabledByLicenseLinkTitle"}))})}),l={isEnabled:!1,message:i.i18n.translate("xpack.triggersActionsUI.checkActionTypeEnabled.actionTypeDisabledByConfigMessage",{defaultMessage:"This connector is disabled by the Kibana configuration."}),messageCard:Object(s.jsx)(a.EuiCard,{title:i.i18n.translate("xpack.triggersActionsUI.licenseCheck.actionTypeDisabledByConfigMessageTitle",{defaultMessage:"This feature is disabled by the Kibana configuration."}),description:"",className:"actCheckActionTypeEnabled__disabledActionWarningCard"})};function d(e){return!1===(null==e?void 0:e.enabledInLicense)?u(e):!1===(null==e?void 0:e.enabledInConfig)?l:{isEnabled:!0}}function p(e,t){return!1===(null==e?void 0:e.enabledInLicense)?u(e):!1!==(null==e?void 0:e.enabledInConfig)||t.find((t=>t.actionTypeId===e.id))?{isEnabled:!0}:l}},143:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o=(e,t,n,o=[])=>{const i=n[t.actionTypeId];return e.filter((e=>(o.includes(e.actionTypeId)||e.actionTypeId===t.actionTypeId)&&((null==i?void 0:i.enabledInConfig)||e.isPreconfigured)))}},144:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o=[]},145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(84),i=n(1),r=o.__importDefault(n(146));t.default=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={loading:!1});var a=i.useRef(0),c=r.default(),s=i.useState(n),u=s[0],l=s[1],d=i.useCallback((function(){for(var t=[],n=0;nObject(c.a)(u,t,r,e)),[t,r,e,u]),b=Object(i.useMemo)((()=>d(t.id,m,a,e)),[t.id,m,a,e]),j=Object(i.useMemo)((()=>p(m,a)),[m,a]),[h,y]=Object(i.useState)(b.length>0?b[0]:void 0),x=Object(i.useCallback)((e=>{var t,n;y(e[0]),l(null!==(t=null===(n=e[0].value)||void 0===n?void 0:n.id)&&void 0!==t?t:"")}),[l]);return Object(s.jsx)(o.EuiComboBox,{"aria-label":g,"data-test-subj":`selectActionConnector-${t.actionTypeId}-${n}`,fullWidth:!0,singleSelection:{asPlainText:!0},id:`selectActionConnector-${t.id}`,isClearable:!1,onChange:x,options:j,selectedOptions:b,prepend:null==h||null===(f=h.value)||void 0===f?void 0:f.prependComponent})}const d=(e,t,n,o=[])=>{let i=t.find((t=>t.id===e));return o.length>0&&!i&&(i=t.find((e=>o.includes(e.actionTypeId)))),i?[f(i,n)]:[]},p=(e,t)=>e.map((e=>f(e,t))),f=(e,t)=>{const n=m(e,t);let o;if(null!=t.customConnectorSelectItem){const n=t.customConnectorSelectItem.getComponent(e);n&&(o=Object(s.jsx)(n,{actionConnector:e}))}return{label:n,value:{title:n,id:e.id,prependComponent:o},key:e.id,"data-test-subj":`dropdown-connector-${e.id}`}},m=(e,t)=>null!=t.customConnectorSelectItem?t.customConnectorSelectItem.getText(e):e.name,g=a.i18n.translate("xpack.triggersActionsUI.sections.actionForm.incidentManagementSystemLabel",{defaultMessage:"Incident management system"})},170:function(e,t,n){"use strict";function o(e,t,n){const o=i(e,n),r=i(t,n);return!0===o&&!1===r?-1:!1===o&&!0===r?1:e.name.localeCompare(t.name)}n.d(t,"a",(function(){return o}));const i=(e,t)=>{let n=e.enabled;return!e.enabledInConfig&&t&&t.length>0&&(n=void 0!==t.find((t=>t.actionTypeId===e.id))),n}},171:function(e,t,n){switch(window.__kbnThemeTag__){case"v8dark":return n(172);case"v8light":return n(174)}},172:function(e,t,n){var o=n(48),i=n(173);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);o(i,{insert:"head",singleton:!1}),e.exports=i.locals||{}},173:function(e,t,n){(t=n(49)(!1)).push([e.i,".actAccordionActionForm,.actCheckActionTypeEnabled__disabledActionWarningCard{background-color:#25262e}.actAccordionActionForm .euiCard{box-shadow:none}.actAccordionActionForm__button{padding:12px 12px 12px 24px}.actAccordionActionForm .euiAccordion__iconButton{transform:translateX(12px) rotate(0deg)!important}.actAccordionActionForm .euiAccordion__iconButton.euiAccordion__iconButton-isOpen{transform:translateX(12px) rotate(90deg)!important}",""]),e.exports=t},174:function(e,t,n){var o=n(48),i=n(175);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);o(i,{insert:"head",singleton:!1}),e.exports=i.locals||{}},175:function(e,t,n){(t=n(49)(!1)).push([e.i,".actAccordionActionForm,.actCheckActionTypeEnabled__disabledActionWarningCard{background-color:#f5f7fa}.actAccordionActionForm .euiCard{box-shadow:none}.actAccordionActionForm__button{padding:12px 12px 12px 24px}.actAccordionActionForm .euiAccordion__iconButton{transform:translateX(12px) rotate(0deg)!important}.actAccordionActionForm .euiAccordion__iconButton.euiAccordion__iconButton-isOpen{transform:translateX(12px) rotate(90deg)!important}",""]),e.exports=t},189:function(e,t,n){"use strict";n.r(t),n.d(t,"AlertsSearchBar",(function(){return p})),n.d(t,"default",(function(){return p}));var o=n(1),i=n(21),r=n(144);const a=n(3).i18n.translate("xpack.triggersActionsUI.alertsSearchBar.placeholder",{defaultMessage:"Search alerts (e.g. kibana.alert.evaluation.threshold > 75)"});var c=n(149),s=n(132),u=n.n(s),l=n(0);const d={type:"alerts",fields:{}};function p({appName:e,disableQueryLanguageSwitcher:t=!1,featureIds:n,ruleTypeId:s,query:p,filters:f,onQueryChange:m,onQuerySubmit:g,onFiltersUpdated:b,rangeFrom:j,rangeTo:h,showFilterBar:y=!1,showDatePicker:x=!0,showSubmitButton:O=!0,placeholder:v=a,submitOnBlur:I=!1}){const{unifiedSearch:{ui:{SearchBar:A}}}=Object(i.useKibana)().services,[T,E]=Object(o.useState)("kuery"),{value:F,loading:C,error:M}=function(e){const{http:t}=Object(i.useKibana)().services,n=e.sort().join(","),r=u()((async()=>{const{index_name:e}=await t.get(`${c.a}/index`,{query:{features:n}});return e}),[n]),a=u()((async()=>{const{fields:n}=await t.get(`${c.a}/browser_fields`,{query:{featureIds:e}});return n}),[n]);return{value:Object(o.useMemo)((()=>{var e,t,n;return a.loading||r.loading||void 0!==a.error||void 0!==r.error?void 0:[{title:(null!==(e=r.value)&&void 0!==e?e:[]).join(","),fieldFormatMap:{},fields:null===(t=null!==(n=a.value)&&void 0!==n?n:[])||void 0===t?void 0:t.map((e=>({...e,...e.esTypes&&e.esTypes.includes("flattened")?{type:"string"}:{}})))}]}),[a,r]),loading:a.loading||r.loading,error:a.error?a.error:r.error}}(n),{value:w,loading:S,error:k}=function(e){const{http:t}=Object(i.useKibana)().services;return u()((async()=>e?await t.get(`${c.a}/aad_fields`,{query:{ruleTypeId:e}}):[]))}(s),U=s&&null!=w&&w.length?[{title:s,fields:w}]:F,N=Object(o.useCallback)((({dateRange:e,query:t})=>{var n;g({dateRange:e,query:"string"==typeof(null==t?void 0:t.query)?t.query:void 0}),E(null!==(n=null==t?void 0:t.language)&&void 0!==n?n:"kuery")}),[g,E]),_=Object(o.useCallback)((({dateRange:e,query:t})=>{var n;null==m||m({dateRange:e,query:"string"==typeof(null==t?void 0:t.query)?t.query:void 0}),E(null!==(n=null==t?void 0:t.language)&&void 0!==n?n:"kuery")}),[m,E]);return Object(l.jsx)(A,{appName:e,disableQueryLanguageSwitcher:t,indexPatterns:C||M||S||k?r.a:U,placeholder:v,query:{query:null!=p?p:"",language:T},filters:f,dateRangeFrom:j,dateRangeTo:h,displayStyle:"inPage",showFilterBar:y,onQuerySubmit:N,onFiltersUpdated:b,onRefresh:({dateRange:e})=>{g({dateRange:e})},showDatePicker:x,showQueryInput:!0,showSaveQuery:!0,showSubmitButton:O,submitOnBlur:I,onQueryChange:_,suggestionsAbstraction:d})}},206:function(e,t,n){var o,i,r,a; /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */a=function(e){var t=Object.prototype.toString,n=Array.isArray||function(e){return"[object Array]"===t.call(e)};function o(e){return"function"==typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function r(e,t){return null!=e&&"object"==typeof e&&t in e}var a=RegExp.prototype.test,c=/\S/;var s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},u=/\s*/,l=/\s+/,d=/\s*=/,p=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function m(e){this.string=e,this.tail=e,this.pos=0}function g(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function b(){this.cache={}}m.prototype.eos=function(){return""===this.tail},m.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},m.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},g.prototype.push=function(e){return new g(e,this)},g.prototype.lookup=function(e){var t,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var i,a,c=this,s=!1;c;){if(e.indexOf(".")>0)for(t=c.view,i=e.split("."),a=0;null!=t&&a0?i[i.length-1][4]:n;break;default:o.push(t)}return n}(function(e){for(var t,n,o=[],i=0,r=e.length;i"===r?a=this.renderPartial(i,t,n,o):"&"===r?a=this.unescapedValue(i,t):"name"===r?a=this.escapedValue(i,t):"text"===r&&(a=this.rawValue(i)),void 0!==a&&(c+=a);return c},b.prototype.renderSection=function(e,t,i,r){var a=this,c="",s=t.lookup(e[1]);if(s){if(n(s))for(var u=0,l=s.length;u"'`=\/]/g,(function(e){return s[e]}))},e.Scanner=m,e.Context=g,e.Writer=b,e},t&&"string"!=typeof t.nodeName?a(t):(i=[t],void 0===(r="function"==typeof(o=a)?o.apply(t,i):o)||(e.exports=r))},76:function(e,t,n){"use strict";n.r(t),n.d(t,"ActionForm",(function(){return ee})),n.d(t,"default",(function(){return ee}));var o=n(1),i=n.n(o),r=n(3),a=n(25),c=n(2),s=n(99),u=n(121),l=n(22),d=n(52),p=n(20),f=n(9),m=n(90),g=n(17),b=n(142),j=n(113),h=n(64),y=n(29),x=n(154),O=n(11),v=n(86),I=n(120),A=n(115),T=n(42),E=n(12),F=n(0);const C=[{isSummaryOption:!1,isForEachAlertOption:!0,value:{value:"onActionGroupChange",inputDisplay:r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.display",{defaultMessage:"On status changes"}),"data-test-subj":"onActionGroupChange",dropdownDisplay:Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)("strong",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"On status changes",id:"xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.label"})),Object(F.jsx)(c.EuiText,{size:"s",color:"subdued"},Object(F.jsx)("p",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Actions run if the alert status changes.",id:"xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.description"}))))}},{isSummaryOption:!0,isForEachAlertOption:!0,value:{value:"onActiveAlert",inputDisplay:r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.display",{defaultMessage:"On check intervals"}),"data-test-subj":"onActiveAlert",dropdownDisplay:Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)("strong",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"On check intervals",id:"xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.label"})),Object(F.jsx)(c.EuiText,{size:"s",color:"subdued"},Object(F.jsx)("p",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Actions run if rule conditions are met.",id:"xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.description"}))))}},{isSummaryOption:!0,isForEachAlertOption:!0,value:{value:"onThrottleInterval",inputDisplay:r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.display",{defaultMessage:"On custom action intervals"}),"data-test-subj":"onThrottleInterval",dropdownDisplay:Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)("strong",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"On custom action intervals",id:"xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.label"})),Object(F.jsx)(c.EuiText,{size:"s",color:"subdued"},Object(F.jsx)("p",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Actions run if rule conditions are met.",id:"xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.description"}))))}}],M=({hasAlertsMappings:e,frequency:t=E.DEFAULT_FREQUENCY,throttle:n,throttleUnit:a,onNotifyWhenChange:s,onThrottleChange:u,onSummaryChange:l,showMinimumThrottleWarning:d,showMinimumThrottleUnitWarning:p,notifyWhenSelectOptions:f=C,defaultNotifyWhenValue:m=E.DEFAULT_FREQUENCY.notifyWhen})=>{const[g,b]=Object(o.useState)(!1),[j,h]=Object(o.useState)(m),[y,x]=Object(o.useState)(!1);Object(o.useEffect)((()=>{t.notifyWhen?h(t.notifyWhen):h(t.throttle?O.RuleNotifyWhen.THROTTLE:O.RuleNotifyWhen.ACTIVE)}),[t]),Object(o.useEffect)((()=>{b(j===O.RuleNotifyWhen.THROTTLE)}),[j]);const v=Object(o.useCallback)((e=>{s(e),h(e),setTimeout((()=>u(e===O.RuleNotifyWhen.THROTTLE?null!=n?n:1:null,a)),100)}),[s,u,n,a]),M=Object(o.useMemo)((()=>f.filter((e=>e.isSummaryOption)).map((e=>e.value))),[f]),U=Object(o.useMemo)((()=>f.filter((e=>e.isForEachAlertOption)).map((e=>e.value))),[f]),N=Object(o.useMemo)((()=>t.summary?M:U),[U,t.summary,M]),_=Object(o.useCallback)((e=>e&&!M.filter((e=>e.value===t.notifyWhen)).length||!e&&!U.filter((e=>e.value===t.notifyWhen)).length),[U,t.notifyWhen,M]),W=Object(o.useCallback)((e=>e?M.length?M[0].value:O.RuleNotifyWhen.ACTIVE:U.length?U[0].value:O.RuleNotifyWhen.ACTIVE),[U,M]),R=Object(o.useCallback)((e=>{l(e),x(!1),_(e)&&s(W(e))}),[l,_,s,W]),B=Object(o.useMemo)((()=>[Object(F.jsx)(k,{className:"euiSuperSelect__item",key:"summary",onClick:()=>R(!0),icon:t.summary?"check":"empty",id:"actionNotifyWhen-option-summary","data-test-subj":"actionNotifyWhen-option-summary"},S),Object(F.jsx)(k,{className:"euiSuperSelect__item",key:"for_each",onClick:()=>R(!1),icon:t.summary?"empty":"check",id:"actionNotifyWhen-option-for_each","data-test-subj":"actionNotifyWhen-option-for_each"},w)]),[t.summary,R]),P=Object(F.jsx)(c.EuiPopover,{"data-test-subj":"summaryOrPerRuleSelect",initialFocus:"#actionNotifyWhen-option-"+(t.summary?"summary":"for_each"),isOpen:y,closePopover:Object(o.useCallback)((()=>x(!1)),[x]),panelPaddingSize:"none",anchorPosition:"downLeft","aria-label":t.summary?S:w,"aria-roledescription":r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.actionNotifyWhen.summaryOrRulePerSelectRoleDescription",{defaultMessage:"Action frequency type select"}),button:Object(F.jsx)(c.EuiButtonEmpty,{size:"xs",iconType:"arrowDown",iconSide:"right",onClick:Object(o.useCallback)((()=>x(!y)),[y])},t.summary?S:w)},Object(F.jsx)(c.EuiContextMenuPanel,{items:B}));return Object(F.jsx)(c.EuiFormRow,{fullWidth:!0,label:r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.actionNotifyWhen.actionFrequencyLabel",{defaultMessage:"Action frequency"})},Object(F.jsx)(c.EuiFlexGroup,{gutterSize:"s"},Object(F.jsx)(c.EuiFlexItem,null,Object(F.jsx)(c.EuiSuperSelect,{fullWidth:!0,prepend:e?P:Object(F.jsx)(i.a.Fragment,null),"data-test-subj":"notifyWhenSelect",options:N,valueOfSelected:j,onChange:v}),g&&Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)(c.EuiFormRow,{fullWidth:!0},Object(F.jsx)(c.EuiFlexGroup,{gutterSize:"s"},Object(F.jsx)(c.EuiFlexItem,{style:{flexGrow:.1}}),Object(F.jsx)(c.EuiFlexItem,{grow:2},Object(F.jsx)(c.EuiFieldNumber,{isInvalid:d,min:1,value:null!=n?n:1,name:"throttle","data-test-subj":"throttleInput",prepend:r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.frequencyNotifyWhen.label",{defaultMessage:"Run every"}),onChange:e=>{Object(A.pipe)(Object(I.some)(e.target.value.trim()),Object(I.filter)((e=>""!==e)),Object(I.map)((e=>parseInt(e,10))),Object(I.filter)((e=>!isNaN(e))),Object(I.map)((e=>{u(e,a)})))}})),Object(F.jsx)(c.EuiFlexItem,{grow:3},Object(F.jsx)(c.EuiSelect,{isInvalid:p,"data-test-subj":"throttleUnitInput",value:a,options:Object(T.b)(null!=n?n:1),onChange:e=>{u(n,e.target.value)}})))),(d||p)&&Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSpacer,{size:"xs"}),Object(F.jsx)(c.EuiText,{size:"xs",color:"danger"},r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.notifyWhenThrottleWarning",{defaultMessage:"Custom action intervals cannot be shorter than the rule's check interval"})))))))},w=r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.actionNotifyWhen.forEachOption",{defaultMessage:"For each alert"}),S=r.i18n.translate("xpack.triggersActionsUI.sections.ruleForm.actionNotifyWhen.summaryOption",{defaultMessage:"Summary of alerts"}),k=Object(v.euiStyled)(c.EuiContextMenuItem)` min-width: 300px; `;var U=n(206),N=n.n(U);const _=r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.warning.publicBaseUrl",{defaultMessage:"server.publicBaseUrl is not set. Generated URLs will be either relative or empty."});var W,R,B=n(31),P=n.n(B),D=n(21),q=n(58),L=n.n(q);const z=null!==(W=null===(R=P.a.tz)||void 0===R?void 0:R.names().map((e=>({label:e}))))&&void 0!==W?W:[{label:"UTC"}],G=({state:e,onChange:t})=>{const n=(()=>{var e,t;const n=null!==(e=Object(D.useUiSetting)("dateFormat:scaled"))&&void 0!==e?e:[["PT1M","HH:mm"]],[,o]=null!==(t=n.find((([e])=>"PT1M"===e)))&&void 0!==t?t:["","HH:mm"];return o})(),[a,s]=(e=>{const t={days:[],timezone:(()=>{var e,t;const n=Object(D.useUiSetting)("dateFormat:tz");return n&&"Browser"!==n?n:null!==(e=null===(t=P.a.tz)||void 0===t?void 0:t.guess())&&void 0!==e?e:"UTC"})(),hours:{start:"00:00",end:"00:00"}};return Object(o.useState)(e||t)})(e),[u,l]=Object(o.useState)([{label:a.timezone}]),d=Object(o.useMemo)((()=>Boolean(e)),[e]),p=(()=>{const e=Object(D.useUiSetting)("dateFormat:dow"),t=null!=e?e:"Sunday",n=E.I18N_WEEKDAY_OPTIONS_DDD.findIndex((e=>e.label.startsWith(t)));return[...E.I18N_WEEKDAY_OPTIONS_DDD.slice(n),...E.I18N_WEEKDAY_OPTIONS_DDD.slice(0,n)]})();Object(o.useEffect)((()=>{const n=d?a:void 0;L()(e,n)||t(n)}),[d,a,e,t]);const f=Object(o.useCallback)((()=>t(e?void 0:a)),[e,a,t]),m=Object(o.useCallback)((e=>{s({...a,...e})}),[a,s]),g=Object(o.useCallback)((e=>t=>{m({hours:{...a.hours,[e]:t.format("HH:mm")}})}),[m,a]),b=Object(o.useCallback)((e=>{if(!a)return;const t=Number(e),n=a.days.includes(t)?a.days.filter((e=>e!==t)):[...a.days,t];0!==n.length&&m({days:n})}),[a,m]),j=Object(o.useMemo)((()=>O.ISO_WEEKDAYS.reduce(((e,t)=>({...e,[t]:a.days.includes(t)})),{})),[a]),h=Object(o.useCallback)((e=>{l(e),e[0].label&&m({timezone:e[0].label})}),[m,l]),[y,x]=Object(o.useMemo)((()=>a.hours.start.split(":").map(Number)),[a]),[v,I]=Object(o.useMemo)((()=>a.hours.end.split(":").map(Number)),[a]);return Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSwitch,{label:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterTimeframeToggleLabel",{defaultMessage:"If alert is generated during timeframe"}),checked:d,onChange:f,"data-test-subj":"alertsFilterTimeframeToggle"}),d&&Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)(c.EuiFlexItem,null,Object(F.jsx)(c.EuiButtonGroup,{isFullWidth:!0,legend:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterTimeframeWeekdays",{defaultMessage:"Days of week"}),options:p,idToSelectedMap:j,type:"multi",onChange:b,"data-test-subj":"alertsFilterTimeframeWeekdayButtons"})),Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)(c.EuiFlexGroup,{alignItems:"center"},Object(F.jsx)(c.EuiFlexItem,{grow:2},Object(F.jsx)(c.EuiDatePickerRange,{fullWidth:!0,startDateControl:Object(F.jsx)(c.EuiDatePicker,{showTimeSelect:!0,showTimeSelectOnly:!0,dateFormat:n,timeFormat:n,selected:P()().set("hour",y).set("minute",x),onChange:g("start"),"data-test-subj":"alertsFilterTimeframeStart"}),endDateControl:Object(F.jsx)(c.EuiDatePicker,{showTimeSelect:!0,showTimeSelectOnly:!0,dateFormat:n,timeFormat:n,selected:P()().set("hour",v).set("minute",I),onChange:g("end"),"data-test-subj":"alertsFilterTimeframeEnd"})})),Object(F.jsx)(c.EuiFlexItem,{grow:1},Object(F.jsx)(c.EuiComboBox,{prepend:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterTimeframeTimezoneLabel",{defaultMessage:"Timezone"}),singleSelection:{asPlainText:!0},options:z,selectedOptions:u,onChange:h,isClearable:!1,"data-test-subj":"alertsFilterTimeframeTimezone"})))))};var $=n(189);const V=({state:e,onChange:t,appName:n,featureIds:a,ruleTypeId:s})=>{var u;const[l,d]=Object(o.useState)(null!=e?e:{kql:"",filters:[]}),p=Object(o.useMemo)((()=>Boolean(e)),[e]);Object(o.useEffect)((()=>{const n=p?l:void 0;L()(e,n)||t(n)}),[p,l,e,t]);const f=Object(o.useCallback)((()=>t(e?void 0:l)),[e,l,t]),m=Object(o.useCallback)((e=>{d({...l,...e})}),[l,d]),g=Object(o.useCallback)((({query:e})=>m({kql:e})),[m]),b=Object(o.useCallback)((e=>m({filters:e})),[m]);return Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSwitch,{label:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterQueryToggleLabel",{defaultMessage:"If alert matches a query"}),checked:p,onChange:f,"data-test-subj":"alertsFilterQueryToggle"}),p&&Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)($.AlertsSearchBar,{appName:n,featureIds:a,ruleTypeId:s,disableQueryLanguageSwitcher:!0,query:l.kql,filters:null!==(u=l.filters)&&void 0!==u?u:[],onQueryChange:g,onQuerySubmit:g,onFiltersUpdated:b,showFilterBar:!0,submitOnBlur:!0,showDatePicker:!1,showSubmitButton:!1,placeholder:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.ActionAlertsFilterQueryPlaceholder",{defaultMessage:"Filter alerts using KQL syntax"})})))};var Q=n(54);const H=r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.preconfiguredTitleMessage",{defaultMessage:"(preconfigured)"}),K=({actionItem:e,actionConnector:t,index:n,onAddConnector:s,onConnectorSelected:l,onDeleteAction:d,setActionParamsProperty:O,setActionFrequencyProperty:v,setActionAlertsFilterProperty:I,actionTypesIndex:A,connectors:T,defaultActionGroupId:E,defaultActionMessage:C,messageVariables:w,summaryMessageVariables:S,actionGroups:k,setActionGroupIdByIndex:U,actionTypeRegistry:W,isActionGroupDisabledForActionType:R,recoveryActionGroup:B,hideNotifyWhen:P=!1,defaultSummaryMessage:D,hasAlertsMappings:q,minimumThrottleInterval:L,notifyWhenSelectOptions:z,defaultNotifyWhenValue:$,producerId:K,featureId:Y,ruleTypeId:X,hasFieldsForAAD:J,disableErrorMessages:Z})=>{var ee,te,ne,oe,ie,re,ae,ce,se,ue,le,de,pe;const{application:{capabilities:fe},http:{basePath:me}}=Object(y.b)().services,{euiTheme:ge}=Object(c.useEuiTheme)(),[be,je]=Object(o.useState)(!0),[he,ye]=Object(o.useState)([]),xe=null==k?void 0:k.find((({id:e})=>e===E)),Oe=null!==(ee=null==k?void 0:k.find((({id:t})=>t===e.group)))&&void 0!==ee?ee:xe,[ve,Ie]=Object(o.useState)(),[Ae,Te]=Object(o.useState)({errors:{}}),[Ee,Fe]=Object(o.useState)(null!==(te=e.frequency)&&void 0!==te&&te.throttle?Object(m.getDurationNumberInItsUnit)(e.frequency.throttle):null),[Ce,Me]=Object(o.useState)(null!==(ne=e.frequency)&&void 0!==ne&&ne.throttle?Object(m.getDurationUnitValue)(null===(oe=e.frequency)||void 0===oe?void 0:oe.throttle):"h"),[we=-1,Se]=null!=L?L:[-1,"s"],[ke,Ue]=Object(o.useState)(null),[Ne,_e]=Object(o.useState)(!1),We=null===(ie=e.frequency)||void 0===ie?void 0:ie.summary,Re=async()=>{const t=await W.get(e.actionTypeId);let n;return e.group===B&&(n=t.defaultRecoveredActionParams),n||(n=t.defaultActionParams),n},[Be,Pe]=Object(o.useMemo)((()=>{try{if(!Ee)return[!1,!1];const e=Object(m.parseDuration)(`1${Ce}`),t=Object(m.parseDuration)(`1${Se}`),n=e>t?Ee:Math.max(Ee,we),o=Object(m.parseDuration)(`${Ee}${Ce}`)>=t?Ce:Se;return[n!==Ee,o!==Ce]}catch(e){return[!1,!1]}}),[we,Se,Ee,Ce]);Object(o.useEffect)((()=>{(async()=>{ye(w?function(e,t,n,o){const i=Object(h.b)(e,t,null==n?void 0:n.omitMessageVariables,o);return Object(f.partition)(i,(e=>!0!==e.deprecated)).reduce(((e,t)=>[...e,...t.sort(((e,t)=>e.name.toUpperCase().localeCompare(t.name.toUpperCase())))]),[])}(w,S,Oe,We):[]);const t=await Re();if(t)for(const[o,i]of Object.entries(t))void 0!==e.params[o]&&null!==e.params[o]||O(o,i,n)})()}),[e.group,null===(re=e.frequency)||void 0===re?void 0:re.summary]),Object(o.useEffect)((()=>{(async()=>{const e=await Re();if(e&&ve)for(const[t,o]of Object.entries(e))O(t,o,n)})()}),[ve]),Object(o.useEffect)((()=>{(async()=>{var t;if(Z)return void Te({errors:{}});const n=await(null===(t=W.get(e.actionTypeId))||void 0===t?void 0:t.validateParams(e.params));Te(n)})()}),[e,Z]);const[De,qe]=Object(o.useState)(null);Object(o.useEffect)((()=>{(async()=>{qe(Z?null:Object(Q.d)(e))})()}),[e,Z]);const Le=Object(j.e)(fe),ze=(e,t)=>!!R&&R(e,t),Ge=Object(F.jsx)(M,{frequency:e.frequency,throttle:Ee,throttleUnit:Ce,hasAlertsMappings:q,onNotifyWhenChange:Object(o.useCallback)((e=>{v("notifyWhen",e,n)}),[v,n]),onThrottleChange:Object(o.useCallback)(((e,t)=>{e&&(Fe(e),Me(t)),v("throttle",e?`${e}${t}`:null,n)}),[v,n]),onSummaryChange:Object(o.useCallback)((e=>{_e(!0),v("summary",e,n)}),[v,n]),showMinimumThrottleWarning:Be,showMinimumThrottleUnitWarning:Pe,notifyWhenSelectOptions:z,defaultNotifyWhenValue:$}),$e=W.get(t.actionTypeId);if(!$e)return null;const Ve=(null!==(ae=null==$e?void 0:$e.subtype)&&void 0!==ae?ae:[]).map((e=>e.id)),Qe=$e.actionParamsFields,He=Object(b.a)(A[t.actionTypeId],T.filter((e=>e.isPreconfigured))),Ke=k&&Oe&&U&&!(null!==(ce=e.frequency)&&void 0!==ce&&ce.summary),Ye=J||K===p.ib.SIEM,Xe=He.isEnabled?Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSplitPanel.Inner,{color:"subdued",style:{borderBottom:`1px solid ${ge.colors.lightShade}`}},Object(F.jsx)(c.EuiFormRow,{fullWidth:!0,label:Object(F.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionTypeForm.actionIdLabel",defaultMessage:"{connectorInstance} connector",values:{connectorInstance:A?A[t.actionTypeId].name:t.actionTypeId}}),labelAppend:Le&&A&&A[t.actionTypeId].enabledInConfig?Object(F.jsx)(c.EuiButtonEmpty,{size:"xs","data-test-subj":`addNewActionConnectorButton-${e.actionTypeId}`,onClick:s},Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Add connector",id:"xpack.triggersActionsUI.sections.actionTypeForm.addNewConnectorEmptyButton"})):null},Object(F.jsx)(x.a,{allowGroupConnector:Ve,actionItem:e,accordionIndex:n,actionTypesIndex:A,actionTypeRegistered:$e,connectors:T,onConnectorSelected:l})),Object(F.jsx)(c.EuiSpacer,{size:"xl"}),!P&&Ge,Ke&&Object(F.jsx)(i.a.Fragment,null,!P&&Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)(c.EuiSuperSelect,{prepend:Object(F.jsx)(c.EuiFormLabel,{htmlFor:`addNewActionConnectorActionGroup-${e.actionTypeId}`},Object(F.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionTypeForm.actionRunWhenInActionGroup",defaultMessage:"Run when"})),fullWidth:!0,id:`addNewActionConnectorActionGroup-${e.actionTypeId}`,"data-test-subj":`addNewActionConnectorActionGroup-${n}`,options:k.map((({id:t,name:o})=>{return{value:t,inputDisplay:(i=t,a=o,c=e.actionTypeId,R&&R(i,c)?r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.addNewActionConnectorActionGroup.display",{defaultMessage:"{actionGroupName} (Not Currently Supported)",values:{actionGroupName:a}}):a),disabled:ze(t,e.actionTypeId),"data-test-subj":`addNewActionConnectorActionGroup-${n}-option-${t}`};var i,a,c})),valueOfSelected:Oe.id,onChange:e=>{U(e,n),Ie(e)}})),Ye&&Object(F.jsx)(i.a.Fragment,null,!P&&Object(F.jsx)(c.EuiSpacer,{size:"xl"}),Object(F.jsx)(c.EuiFormRow,{error:De,isInvalid:!!De,fullWidth:!0},Object(F.jsx)(V,{state:null===(se=e.alertsFilter)||void 0===se?void 0:se.query,onChange:e=>I("query",e,n),featureIds:[K],appName:Y,ruleTypeId:X})),Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)(G,{state:null===(ue=e.alertsFilter)||void 0===ue?void 0:ue.timeframe,onChange:e=>I("timeframe",e,n)}))),Object(F.jsx)(c.EuiSplitPanel.Inner,{color:"plain"},Qe?Object(F.jsx)(c.EuiErrorBoundary,null,Object(F.jsx)(o.Suspense,{fallback:null},Object(F.jsx)(Qe,{actionParams:e.params,index:n,errors:Ae.errors,editAction:(e,t,n)=>{Ue(function(e,t,n){if(!t&&e&&"string"==typeof e){const t=(n||[]).reduce(((e,t)=>(t.usesPublicBaseUrl&&(e.push(t.name.replace(/^(params\.|context\.|state\.)/,"")),e.push(t.name)),e)),new Array);try{const n=new Set(N.a.parse(e).filter((([e])=>"name"===e)).map((([,e])=>e)));if(Object(f.some)(t,(e=>n.has(e))))return _}catch(e){}}return null}(t,me.publicBaseUrl,he)),O(e,t,n)},messageVariables:he,defaultMessage:We?D:null!==(le=null==Oe?void 0:Oe.defaultActionMessage)&&void 0!==le?le:C,useDefaultMessage:Ne,actionConnector:t,executionMode:g.b.ActionForm}),ke?Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSpacer,{size:"s"}),Object(F.jsx)(c.EuiCallOut,{size:"s",color:"warning",title:ke})):null)):null)):He.messageCard;return Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiSplitPanel.Outer,{hasShadow:be},Object(F.jsx)(c.EuiAccordion,{initialIsOpen:!0,key:n,id:n.toString(),onToggle:je,paddingSize:"none",className:"actAccordionActionForm",buttonContentClassName:"actAccordionActionForm__button","data-test-subj":`alertActionAccordion-${n}`,buttonContent:Object(F.jsx)(c.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},!be&&Object(f.some)(Ae.errors,(e=>!Object(f.isEmpty)(e)))?Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiToolTip,{content:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.actionErrorToolTip",{defaultMessage:"Action contains errors."})},Object(F.jsx)(c.EuiIcon,{"data-test-subj":"action-group-error-icon",type:"warning",color:"danger",size:"m"}))):Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiIcon,{type:$e.iconClass,size:"m"})),Object(F.jsx)(c.EuiFlexItem,null,Object(F.jsx)(c.EuiText,null,Object(F.jsx)("div",null,Object(F.jsx)(c.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(a.FormattedMessage,{defaultMessage:"{actionConnectorName}",id:"xpack.triggersActionsUI.sections.actionTypeForm.existingAlertActionTypeEditTitle",values:{actionConnectorName:`${t.name} ${t.isPreconfigured?H:""}`}})),(Oe||(null===(de=e.frequency)||void 0===de?void 0:de.summary))&&!be&&Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiBadge,{iconType:"clock"},null!==(pe=e.frequency)&&void 0!==pe&&pe.summary?r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.summaryGroupTitle",{defaultMessage:"Summary of alerts"}):r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.runWhenGroupTitle",{defaultMessage:"Run when {groupName}",values:{groupName:Oe.name.toLocaleLowerCase()}}))),ke&&!be&&Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiBadge,{"data-test-subj":"warning-badge",iconType:"warning",color:"warning"},r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.actionWarningsTitle",{defaultMessage:"1 warning"}))),Object(F.jsx)(c.EuiFlexItem,{grow:!1},!1===He.isEnabled&&Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiIconTip,{type:"warning",color:"danger",content:r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.actionDisabledTitle",{defaultMessage:"This action is disabled"}),position:"right"}))))))),$e&&$e.isExperimental&&Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiBetaBadge,{"data-test-subj":"action-type-form-beta-badge",label:u.a.label,tooltipContent:u.a.tooltipContent}))),extraAction:Object(F.jsx)(c.EuiButtonIcon,{iconType:"minusInCircle",color:"danger",className:"actAccordionActionForm__extraAction","aria-label":r.i18n.translate("xpack.triggersActionsUI.sections.actionTypeForm.accordion.deleteIconAriaLabel",{defaultMessage:"Delete"}),onClick:d})},Xe)),Object(F.jsx)(c.EuiSpacer,{size:"l"}))};var Y=n(91),X=n(170),J=n(18),Z=n(4);const ee=({actions:e,defaultActionGroupId:t,setActionIdByIndex:n,setActionGroupIdByIndex:p,setActions:f,setActionParamsProperty:m,setActionFrequencyProperty:g,setActionAlertsFilterProperty:j,featureId:h,messageVariables:x,summaryMessageVariables:O,actionGroups:v,defaultActionMessage:I,setHasActionsDisabled:A,setHasActionsWithBrokenConnector:T,actionTypeRegistry:C,recoveryActionGroup:M,isActionGroupDisabledForActionType:w,hideActionHeader:S,hideNotifyWhen:k,defaultSummaryMessage:U,hasAlertsMappings:N,minimumThrottleInterval:_,notifyWhenSelectOptions:W,defaultRuleFrequency:R=E.DEFAULT_FREQUENCY,ruleTypeId:B,producerId:P,hasFieldsForAAD:D,disableErrorMessages:q})=>{const{http:L,notifications:{toasts:z}}=Object(y.b)().services,[G,$]=Object(o.useState)(!1),[V,Q]=Object(o.useState)(void 0),[H,ee]=Object(o.useState)(!0),[te,ne]=Object(o.useState)([]),[oe,ie]=Object(o.useState)(!1),[re,ae]=Object(o.useState)(!1),[ce,se]=Object(o.useState)(void 0),[ue,le]=Object(o.useState)([]),de=Object(o.useCallback)((()=>$(!1)),[$]);Object(o.useEffect)((()=>{(async()=>{try{ae(!0);const e=(await Object(l.d)({http:L,featureId:h})).sort(((e,t)=>e.name.localeCompare(t.name))),t={};for(const n of e)t[n.id]=n;se(t)}catch(e){z.addDanger({title:r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.unableToLoadConnectorTypesMessage",{defaultMessage:"Unable to load connector types"})})}finally{ae(!1)}})()}),[]),Object(o.useEffect)((()=>{(async()=>{try{ie(!0);const e=await Object(l.e)({http:L});ne(e.filter((e=>!e.isMissingSecrets)))}catch(e){z.addDanger({title:r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.unableToLoadActionsMessage",{defaultMessage:"Unable to load connectors"})})}finally{ie(!1)}})()}),[]),Object(o.useEffect)((()=>{te.length>0&&ce&&(()=>{const t=te.filter((e=>e.isPreconfigured)),n=e.some((e=>ce&&!ce[e.actionTypeId].enabled&&!Object(b.a)(ce[e.actionTypeId],t).isEnabled));A&&A(n)})()}),[te,ce]),Object(o.useEffect)((()=>{const t=e.some((e=>!te.find((t=>t.id===e.id))));T&&T(t)}),[e,te]);let pe=null,fe=!1;if(ce){const o=te.filter((e=>e.isPreconfigured));pe=C.list().filter((e=>ce[e.id]&&!e.hideInUi)).filter((e=>!!e.actionParamsFields)).sort(((e,t)=>Object(X.a)(ce[e.id],ce[t.id],o))).map((function(i,a){const l=ce[i.id],d=Object(b.a)(ce[i.id],o);if(!l.enabledInConfig&&!d.isEnabled)return null;l.enabledInLicense||(fe=!0);const p=Object(F.jsx)(c.EuiKeyPadMenuItem,{key:a,isDisabled:!d.isEnabled,"data-test-subj":`${i.id}-${h}-ActionTypeSelectOption`,label:ce[i.id].name,betaBadgeLabel:i.isExperimental?u.a.label:void 0,betaBadgeTooltipContent:i.isExperimental?u.a.tooltipContent:void 0,onClick:()=>function(o){var i;if(!t)return void z.addDanger({title:r.i18n.translate("xpack.triggersActionsUI.sections.actionForm.unableToAddAction",{defaultMessage:"Unable to add action, because default action group is not defined"})});ee(!1);const a=(null!==(i=null==o?void 0:o.subtype)&&void 0!==i?i:[]).map((e=>e.id));let c=te.filter((e=>e.actionTypeId===o.id));c.length>0?(e.push({id:"",actionTypeId:o.id,group:t,params:{},frequency:R,uuid:Object(s.v4)()}),n(c[0].id,e.length-1)):(c=te.filter((e=>a.includes(e.actionTypeId))),c.length>0&&(e.push({id:"",actionTypeId:c[0].actionTypeId,group:t,params:{},frequency:E.DEFAULT_FREQUENCY,uuid:Object(s.v4)()}),n(c[0].id,e.length-1))),0===c.length&&(e.push({id:"",actionTypeId:o.id,group:t,params:{},frequency:R}),n(e.length.toString(),e.length-1),le([...ue,e.length.toString()]))}(i)},Object(F.jsx)(c.EuiIcon,{size:"xl",type:"string"==typeof i.iconClass?i.iconClass:Object(Z.a)(i.iconClass)}));return Object(F.jsx)(c.EuiFlexItem,{grow:!1,key:`keypad-${i.id}`},d.isEnabled&&p,!1===d.isEnabled&&Object(F.jsx)(c.EuiToolTip,{position:"top",content:d.message},p))}))}return oe?Object(F.jsx)(d.a,null,Object(F.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionForm.loadingConnectorsDescription",defaultMessage:"Loading connectors…"})):Object(F.jsx)(i.a.Fragment,null,!S&&Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiTitle,{size:"s"},Object(F.jsx)("h4",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Actions",id:"xpack.triggersActionsUI.sections.actionForm.actionSectionsTitle"}))),Object(F.jsx)(c.EuiSpacer,{size:"m"})),ce&&e.map(((o,i)=>{const r=te.find((e=>e.id===o.id));return r?Object(F.jsx)(K,{actionItem:o,actionConnector:r,index:i,key:`action-form-action-at-${o.uuid}`,setActionParamsProperty:m,setActionFrequencyProperty:g,setActionAlertsFilterProperty:j,actionTypesIndex:ce,connectors:te,defaultActionGroupId:t,messageVariables:x,summaryMessageVariables:O,actionGroups:v,defaultActionMessage:I,recoveryActionGroup:M,isActionGroupDisabledForActionType:w,setActionGroupIdByIndex:p,onAddConnector:()=>{Q({actionTypeId:o.actionTypeId,indices:[i]}),$(!0)},onConnectorSelected:t=>{n(t,i);const o=te.find((e=>e.id===t));if(o&&r&&o.actionTypeId!==r.actionTypeId){const n=C.get(o.actionTypeId);if(n.convertParamsBetweenGroups){const r=e.map(((e,r)=>r===i?{...e,actionTypeId:o.actionTypeId,id:t,params:null!=n.convertParamsBetweenGroups?n.convertParamsBetweenGroups(e.params):{}}:e));f(r)}}},actionTypeRegistry:C,onDeleteAction:()=>{const t=e.filter(((e,t)=>t!==i));f(t),ee(0===t.length),Q(void 0)},hideNotifyWhen:k,defaultSummaryMessage:U,hasAlertsMappings:N,minimumThrottleInterval:_,notifyWhenSelectOptions:W,defaultNotifyWhenValue:R.notifyWhen,featureId:h,producerId:P,ruleTypeId:B,hasFieldsForAAD:D,disableErrorMessages:q}):Object(F.jsx)(Y.AddConnectorInline,{actionTypesIndex:ce,actionItem:o,index:i,key:`action-form-action-at-${i}`,actionTypeRegistry:C,emptyActionsIds:ue,connectors:te,onDeleteConnector:()=>{const t=e.filter(((e,t)=>t!==i));f(t),ee(0===t.filter((e=>e.id!==o.id)).length),Q(void 0)},onAddConnector:()=>{Q({actionTypeId:o.actionTypeId,indices:e.map(((e,t)=>e.id===o.id?t:-1)).filter((e=>e>=0))}),$(!0)},onSelectConnector:t=>{n(t,i);const o=te.find((e=>e.id===t));if(o&&o.actionTypeId){const n=C.get(o.actionTypeId);if(n.convertParamsBetweenGroups){const r=e.map(((e,r)=>r===i?{...e,actionTypeId:o.actionTypeId,id:t,params:null!=n.convertParamsBetweenGroups?n.convertParamsBetweenGroups(e.params):{}}:e));f(r)}}}})})),H?Object(F.jsx)(i.a.Fragment,null,Object(F.jsx)(c.EuiFlexGroup,{id:"alertActionTypeTitle",justifyContent:"spaceBetween"},Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiTitle,{size:"xs"},Object(F.jsx)("h5",null,Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Select a connector type",id:"xpack.triggersActionsUI.sections.actionForm.selectConnectorTypeTitle"})))),fe&&Object(F.jsx)(c.EuiFlexItem,{grow:!1},Object(F.jsx)(c.EuiTitle,{size:"xs"},Object(F.jsx)("h5",null,Object(F.jsx)(c.EuiLink,{href:E.VIEW_LICENSE_OPTIONS_LINK,target:"_blank",external:!0,className:"actActionForm__getMoreActionsLink"},Object(F.jsx)(a.FormattedMessage,{defaultMessage:"Get more connectors",id:"xpack.triggersActionsUI.sections.actionForm.getMoreConnectorsTitle"})))))),Object(F.jsx)(c.EuiSpacer,null),Object(F.jsx)(c.EuiFlexGroup,{gutterSize:"m",wrap:!0},re?Object(F.jsx)(d.a,null,Object(F.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionForm.loadingConnectorTypesDescription",defaultMessage:"Loading connector types…"})):pe)):Object(F.jsx)(c.EuiFlexGroup,null,Object(F.jsx)(c.EuiFlexItem,{grow:!0},Object(F.jsx)(c.EuiButton,{size:"m",fullWidth:!0,iconType:"plusInCircle","data-test-subj":"addAlertActionButton",onClick:()=>ee(!0)},Object(F.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionForm.addActionButtonLabel",defaultMessage:"Add action"})))),ce&&V&&G?Object(F.jsx)(J.b,{actionType:ce[V.actionTypeId],onClose:de,postSaveEventHandler:t=>{e[0].actionTypeId=t.actionTypeId,te.push(t),(V.indices||[]).forEach((e=>n(t.id,e)))},actionTypeRegistry:C}):null)}},91:function(e,t,n){"use strict";n.r(t),n.d(t,"AddConnectorInline",(function(){return m})),n.d(t,"default",(function(){return m}));var o=n(1),i=n.n(o),r=n(3),a=n(25),c=n(2),s=n(121),u=n(113),l=n(29),d=n(143),p=n(154),f=n(0);const m=({actionTypesIndex:e,actionItem:t,index:n,connectors:m,onAddConnector:g,onDeleteConnector:b,onSelectConnector:j,actionTypeRegistry:h,emptyActionsIds:y})=>{var x;const{application:{capabilities:O}}=Object(l.b)().services,v=Object(u.e)(O),[I,A]=Object(o.useState)(!1),[T,E]=Object(o.useState)(!1),F=e?e[t.actionTypeId].name:t.actionTypeId,C=h.get(t.actionTypeId),M=(null!==(x=null==C?void 0:C.subtype)&&void 0!==x?x:[]).map((e=>e.id)),w=Object(o.useMemo)((()=>[`Unable to load ${C.actionTypeTitle} connector`]),[C.actionTypeTitle]),S=Object(f.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.connectorAddInline.emptyConnectorsLabel",defaultMessage:"No {actionTypeName} connectors",values:{actionTypeName:F}}),k=Object(f.jsx)(c.EuiText,{color:"danger"},Object(f.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.connectorAddInline.unableToLoadConnectorTitle",defaultMessage:"Unable to load connector"}));Object(o.useEffect)((()=>{Object(d.a)(m,t,e,M).length>0&&A(!0),E(!!y.find((e=>t.id===e)))}),[]);const U=Object(f.jsx)(c.EuiFormRow,{fullWidth:!0,label:Object(f.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.connectorAddInline.connectorAddInline.actionIdLabel",defaultMessage:"Use another {connectorInstance} connector",values:{connectorInstance:F}}),labelAppend:Object(f.jsx)(c.EuiButtonEmpty,{size:"xs","data-test-subj":`addNewActionConnectorButton-${t.actionTypeId}`,onClick:g},Object(f.jsx)(a.FormattedMessage,{defaultMessage:"Add connector",id:"xpack.triggersActionsUI.sections.connectorAddInline.connectorAddInline.addNewConnectorEmptyButton"})),error:w,isInvalid:!0},Object(f.jsx)(p.a,{actionItem:t,accordionIndex:n,actionTypesIndex:e,actionTypeRegistered:C,connectors:m,onConnectorSelected:j,allowGroupConnector:M}));return Object(f.jsx)(i.a.Fragment,null,Object(f.jsx)(c.EuiAccordion,{key:n,initialIsOpen:!0,id:n.toString(),className:"actAccordionActionForm",buttonContentClassName:"actAccordionActionForm__button","data-test-subj":`alertActionAccordion-${n}`,buttonContent:Object(f.jsx)(c.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},Object(f.jsx)(c.EuiFlexItem,{grow:!1},Object(f.jsx)(c.EuiIcon,{type:C.iconClass,size:"m"})),Object(f.jsx)(c.EuiFlexItem,null,Object(f.jsx)(c.EuiText,null,Object(f.jsx)("div",null,Object(f.jsx)(a.FormattedMessage,{defaultMessage:"{actionConnectorName}",id:"xpack.triggersActionsUI.sections.connectorAddInline.newRuleActionTypeEditTitle",values:{actionConnectorName:C.actionTypeTitle}})))),!T&&Object(f.jsx)(c.EuiFlexItem,{grow:!1},Object(f.jsx)(c.EuiIconTip,{type:"warning",size:"m",color:"danger","data-test-subj":"alertActionAccordionErrorTooltip",content:Object(f.jsx)(a.FormattedMessage,{defaultMessage:"Unable to load connector",id:"xpack.triggersActionsUI.sections.connectorAddInline.unableToLoadConnectorTitle'"})})),C&&C.isExperimental&&Object(f.jsx)(c.EuiFlexItem,{grow:!1},Object(f.jsx)(c.EuiBetaBadge,{label:s.a.label,tooltipContent:s.a.tooltipContent}))),extraAction:Object(f.jsx)(c.EuiButtonIcon,{iconType:"minusInCircle",color:"danger",className:"actAccordionActionForm__extraAction","aria-label":r.i18n.translate("xpack.triggersActionsUI.sections.connectorAddInline.accordion.deleteIconAriaLabel",{defaultMessage:"Delete"}),onClick:b}),paddingSize:"l"},v?I?U:Object(f.jsx)(c.EuiEmptyPrompt,{title:T?S:k,actions:Object(f.jsx)(c.EuiButton,{color:"primary",fill:!0,size:"s","data-test-subj":`createActionConnectorButton-${n}`,onClick:g},Object(f.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.connectorAddInline.addConnectorButtonLabel",defaultMessage:"Create a connector"}))}):Object(f.jsx)(c.EuiCallOut,{title:S},Object(f.jsx)("p",null,Object(f.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.connectorAddInline.unauthorizedToCreateForEmptyConnectors",defaultMessage:"Only authorized users can configure a connector. Contact your administrator."})))),Object(f.jsx)(c.EuiSpacer,{size:"xs"}))}}}]);