/*! 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([[9,17],{113:function(e,t,s){"use strict";s.d(t,"f",(function(){return n})),s.d(t,"e",(function(){return i})),s.d(t,"c",(function(){return o})),s.d(t,"b",(function(){return c})),s.d(t,"a",(function(){return r})),s.d(t,"d",(function(){return a}));const n=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},o=e=>{var t;return null==e||null===(t=e.actions)||void 0===t?void 0:t.execute},c=e=>{var t;return null==e||null===(t=e.actions)||void 0===t?void 0:t.delete};function r(e,t){var s,n;return null!==(s=null==t||null===(n=t.authorizedConsumers[e])||void 0===n?void 0:n.all)&&void 0!==s&&s}const a=e=>{var t,s;return null==e||null===(t=e.management)||void 0===t||null===(s=t.security)||void 0===s?void 0:s.api_keys}},121:function(e,t,s){"use strict";s.d(t,"a",(function(){return i}));var n=s(3);const i={label:n.i18n.translate("xpack.triggersActionsUI.technicalPreviewBadgeLabel",{defaultMessage:"Technical preview"}),tooltipContent:n.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."})}},152:function(e,t,s){"use strict";s.d(t,"a",(function(){return S}));var n=s(1),i=s.n(n),o=s(9),c=s(15),r=s(2),a=s(25),l=s(52),u=s(113),d=s(29),j=s(62),b=s(37),g=s(3),x=s(0);const{emptyField:m}=j.fieldValidators,p={label:"Connector name",validations:[{validator:m(g.i18n.translate("xpack.triggersActionsUI.sections.actionConnectorForm.error.requiredNameText",{defaultMessage:"Name is required."}))}]},f=({canSave:e})=>Object(x.jsx)(i.a.Fragment,null,Object(x.jsx)(c.UseField,{path:"id",component:b.HiddenField}),Object(x.jsx)(c.UseField,{path:"actionTypeId",component:b.HiddenField}),Object(x.jsx)(c.UseField,{path:"isDeprecated",component:b.HiddenField}),Object(x.jsx)(c.UseField,{path:"name",config:p,component:b.Field,componentProps:{euiFieldProps:{readOnly:!e,"data-test-subj":"nameInput",fullWidth:!0}}})),O=Object(n.memo)(f),F=({actionTypeModel:e,isEdit:t,registerPreSubmitValidator:s})=>{var o;const{application:{capabilities:c}}=Object(d.b)().services,j=Object(u.e)(c),b=null!==(o=null==e?void 0:e.actionConnectorFields)&&void 0!==o?o:null;return Object(x.jsx)(i.a.Fragment,null,Object(x.jsx)(O,{canSave:j}),Object(x.jsx)(r.EuiSpacer,{size:"m"}),null!==b?Object(x.jsx)(i.a.Fragment,null,Object(x.jsx)(r.EuiTitle,{size:"xxs","data-test-subj":"connector-settings-label"},Object(x.jsx)("h4",null,Object(x.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionConnectorForm.connectorSettingsLabel",defaultMessage:"Connector settings"}))),Object(x.jsx)(r.EuiSpacer,{size:"s"}),Object(x.jsx)(r.EuiErrorBoundary,null,Object(x.jsx)(n.Suspense,{fallback:Object(x.jsx)(l.a,null,Object(x.jsx)(a.FormattedMessage,{id:"xpack.triggersActionsUI.sections.actionConnectorForm.loadingConnectorSettingsDescription",defaultMessage:"Loading connector settings…"}))},Object(x.jsx)(b,{readOnly:!j,isEdit:t,registerPreSubmitValidator:s})))):null)},C=Object(n.memo)(F),y=({title:e,dataTestSubj:t})=>Object(x.jsx)(i.a.Fragment,null,Object(x.jsx)(r.EuiSpacer,{size:"s"}),Object(x.jsx)(r.EuiCallOut,{size:"s",iconType:"iInCircle","data-test-subj":t,title:e}),Object(x.jsx)(r.EuiSpacer,{size:"m"})),h=e=>null!=e||!h(e),E=({isEdit:e,isMissingSecrets:t})=>{const[s]=Object(c.useFormData)(),{getFields:n}=Object(c.useFormContext)(),i=n(),o=(r=i,Object.keys(r).filter((e=>e.includes("secrets"))).reduce(((e,t)=>({...e,[t]:r[t]})),{}));var r;const a=Object.keys(o).length,l=(e=>{if(0===e.length)return"";if(1===e.length)return`${e[0]}`;if(2===e.length)return e.join(" and ");const t=e[e.length-1];return`${e.slice(0,-1).join(", ")}, and ${t}`})((e=>Object.keys(e).map((t=>e[t].label)).filter(h))(o));return 0===Object.keys(o).length?null:t?Object(x.jsx)(y,{title:g.i18n.translate("xpack.triggersActionsUI.components.builtinActionTypes.missingSecretsValuesLabel",{values:{secretFieldsLabel:l,encryptedFieldsLength:a},defaultMessage:"Sensitive information is not imported. Please enter value{encryptedFieldsLength, plural, one {} other {s}} for the following field{encryptedFieldsLength, plural, one {} other {s}} {secretFieldsLabel}."}),dataTestSubj:"missing-secrets-callout"}):e?e?Object(x.jsx)(y,{title:g.i18n.translate("xpack.triggersActionsUI.components.simpleConnectorForm.secrets.reenterValuesMessage",{values:{secretFieldsLabel:l,encryptedFieldsLength:a},defaultMessage:"Value{encryptedFieldsLength, plural, one {} other {s}} {secretFieldsLabel} {encryptedFieldsLength, plural, one {is} other {are}} encrypted. Please reenter value{encryptedFieldsLength, plural, one {} other {s}} for {encryptedFieldsLength, plural, one {this} other {these}} field{encryptedFieldsLength, plural, one {} other {s}}."}),dataTestSubj:"edit-connector-secrets-callout"}):null:Object(x.jsx)(y,{title:g.i18n.translate("xpack.triggersActionsUI.components.simpleConnectorForm.secrets.reenterValuesLabel",{values:{secretFieldsLabel:l,encryptedFieldsLength:a},defaultMessage:"Remember your {secretFieldsLabel} {encryptedFieldsLength, plural, one {value} other {values}}. You must reenter {encryptedFieldsLength, plural, one {it} other {them}} each time you edit the connector."}),dataTestSubj:"create-connector-secrets-callout"})},v=Object(n.memo)(E),T=e=>{var t,s;if(".webhook"!==e.actionTypeId&&".cases-webhook"!==e.actionTypeId)return e;const n=e,i=Object.entries(null!==(t=null==n||null===(s=n.config)||void 0===s?void 0:s.headers)&&void 0!==t?t:{}).map((([e,t])=>({key:e,value:t})));return{...e,config:{...e.config,headers:Object(o.isEmpty)(i)?void 0:i}}},k=e=>{var t,s;if(".webhook"!==e.actionTypeId&&".cases-webhook"!==e.actionTypeId)return e;const n=(null!==(t=null==e||null===(s=e.config)||void 0===s?void 0:s.headers)&&void 0!==t?t:[]).reduce(((e,t)=>({...e,[t.key]:t.value})),{});return{...e,config:{...e.config,headers:Object(o.isEmpty)(n)?null:n}}},M=({actionTypeModel:e,connector:t,isEdit:s,onChange:i,onFormModifiedChange:o,setResetForm:a})=>{const{form:l}=Object(c.useForm)({defaultValue:t,serializer:k,deserializer:T}),{submit:u,isValid:d,isSubmitted:j,isSubmitting:b,reset:g}=l,[m,p]=Object(n.useState)(null),f=Object(n.useCallback)((e=>{p((()=>e))}),[]),O=Object(c.useFormIsModified)({form:l,discard:["__internal__"]});return Object(n.useEffect)((()=>{i&&i({isValid:d,isSubmitted:j,isSubmitting:b,submit:u,preSubmitValidator:m})}),[i,d,j,b,u,m]),Object(n.useEffect)((()=>{o&&o(O)}),[O,o]),Object(n.useEffect)((()=>{a&&a(g)}),[g]),Object(x.jsx)(c.Form,{form:l},Object(x.jsx)(C,{actionTypeModel:e,isEdit:s,registerPreSubmitValidator:f}),Object(x.jsx)(r.EuiSpacer,{size:"m"}),Object(x.jsx)(v,{isEdit:s,isMissingSecrets:t.isMissingSecrets}))},S=i.a.memo(M)},72:function(e,t,s){"use strict";s.r(t),s.d(t,"EditConnectorFlyout",(function(){return S})),s.d(t,"default",(function(){return S}));var n=s(1),i=s.n(n),o=s(2),c=s(25),r=s(3),a=s(23),l=s(120),u=s(17),d=s(152),j=s(22),b=s(29),g=s(113),x=s(115),m=s(0);const p=({connector:e,executeEnabled:t,executionResult:s,actionParams:a,setActionParams:d,onExecutionAction:j,isExecutingAction:b,actionTypeRegistry:g})=>{const[p,C]=Object(n.useState)({}),[y,h]=Object(n.useState)(!1),E=g.get(e.actionTypeId),v=E.actionParamsFields;Object(n.useEffect)((()=>{(async()=>{const e=(await(null==E?void 0:E.validateParams(a))).errors;C({...e}),h(!!Object.values(e).find((e=>e.length>0)))})()}),[E,a]);const T=[{title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.createActionHeader",{defaultMessage:"Create an action"}),children:v?Object(m.jsx)(o.EuiErrorBoundary,null,Object(m.jsx)(n.Suspense,{fallback:Object(m.jsx)(o.EuiFlexGroup,{justifyContent:"center"},Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)(o.EuiLoadingSpinner,{size:"m"})))},Object(m.jsx)(v,{actionParams:a,index:0,errors:p,editAction:(e,t)=>d({...a,[e]:t}),messageVariables:[],actionConnector:e,executionMode:u.b.Test}))):Object(m.jsx)(o.EuiText,null,Object(m.jsx)("p",null,Object(m.jsx)(c.FormattedMessage,{id:"xpack.triggersActionsUI.sections.testConnectorForm.noActionParametersRequiredText",defaultMessage:"This Connector does not require any Action Parameter."})))},{title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.runTestHeader",{defaultMessage:"Run the test"}),children:Object(m.jsx)(i.a.Fragment,null,t?null:Object(m.jsx)(i.a.Fragment,null,Object(m.jsx)(o.EuiCallOut,{iconType:"warning",color:"warning"},Object(m.jsx)("p",null,Object(m.jsx)(c.FormattedMessage,{defaultMessage:"Save your changes before testing the connector.",id:"xpack.triggersActionsUI.sections.testConnectorForm.executeTestDisabled"}))),Object(m.jsx)(o.EuiSpacer,{size:"s"})),Object(m.jsx)(o.EuiText,null,Object(m.jsx)(o.EuiButton,{iconType:"play",isLoading:b,isDisabled:!t||y||b,"data-test-subj":"executeActionButton",onClick:j},Object(m.jsx)(c.FormattedMessage,{defaultMessage:"Run",id:"xpack.triggersActionsUI.sections.testConnectorForm.executeTestButton"}))))},{title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.testResultsHeader",{defaultMessage:"Results"}),children:Object(x.pipe)(s,Object(l.map)((e=>"ok"===(null==e?void 0:e.status)?Object(m.jsx)(O,null):Object(m.jsx)(F,{executionResult:e}))),Object(l.getOrElse)((()=>Object(m.jsx)(f,null))))}];return Object(m.jsx)(o.EuiSteps,{steps:T,"data-test-subj":"test-connector-form"})},f=()=>Object(m.jsx)(o.EuiCallOut,{"data-test-subj":"executionAwaiting"},Object(m.jsx)("p",null,Object(m.jsx)(c.FormattedMessage,{defaultMessage:"When you run the test, the results will show up here.",id:"xpack.triggersActionsUI.sections.testConnectorForm.awaitingExecutionDescription"}))),O=()=>Object(m.jsx)(o.EuiCallOut,{title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.executionSuccessfulTitle",{defaultMessage:"Test was successful",values:{}}),color:"success","data-test-subj":"executionSuccessfulResult",iconType:"check"},Object(m.jsx)("p",null,Object(m.jsx)(c.FormattedMessage,{defaultMessage:"Ensure the results are what you expect.",id:"xpack.triggersActionsUI.sections.testConnectorForm.executionSuccessfulDescription"}))),F=({executionResult:e})=>{var t;const s=[{title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.executionFailureDescription",{defaultMessage:"The following error was found:"}),description:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.executionFailureUnknownReason",{defaultMessage:"Unknown reason"})}];return null!=e&&e.serviceMessage&&s.push({title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.executionFailureAdditionalDetails",{defaultMessage:"Details:"}),description:e.serviceMessage}),Object(m.jsx)(o.EuiCallOut,{title:r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.executionFailureTitle",{defaultMessage:"Test failed to run"}),"data-test-subj":"executionFailureResult",color:"danger",iconType:"warning"},Object(m.jsx)(o.EuiDescriptionList,{textStyle:"reverse",listItems:s}))};var C=s(121);const y=({icon:e,isExperimental:t=!1,isPreconfigured:s,connectorName:n,connectorTypeDesc:a,selectedTab:l,setTab:d})=>{const{euiTheme:j}=Object(o.useEuiTheme)();return Object(m.jsx)(o.EuiFlyoutHeader,{hasBorder:!0,"data-test-subj":"edit-connector-flyout-header"},Object(m.jsx)(o.EuiFlexGroup,{gutterSize:"s",alignItems:"center"},e?Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)(o.EuiIcon,{type:e,size:"m","data-test-subj":"edit-connector-flyout-header-icon"})):null,Object(m.jsx)(o.EuiFlexItem,{grow:!1},s?Object(m.jsx)(i.a.Fragment,null,Object(m.jsx)(o.EuiFlexGroup,{gutterSize:"s",justifyContent:"center",alignItems:"center"},Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)(o.EuiTitle,{size:"s"},Object(m.jsx)("h3",{id:"flyoutTitle"},Object(m.jsx)(c.FormattedMessage,{defaultMessage:"{connectorName}",id:"xpack.triggersActionsUI.sections.preconfiguredConnectorForm.flyoutTitle",values:{connectorName:n}})))),Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)(o.EuiBetaBadge,{label:"Preconfigured","data-test-subj":"preconfiguredBadge",tooltipContent:r.i18n.translate("xpack.triggersActionsUI.sections.preconfiguredConnectorForm.tooltipContent",{defaultMessage:"This connector is preconfigured and cannot be edited"})})),Object(m.jsx)(o.EuiFlexItem,{grow:!1},t&&Object(m.jsx)(o.EuiBetaBadge,{label:C.a.label,tooltipContent:C.a.tooltipContent}))),Object(m.jsx)(o.EuiText,{size:"s"},Object(m.jsx)(c.FormattedMessage,{defaultMessage:"{connectorTypeDesc}",id:"xpack.triggersActionsUI.sections.editConnectorForm.actionTypeDescription",values:{connectorTypeDesc:a}}))):Object(m.jsx)(o.EuiFlexGroup,{gutterSize:"s",justifyContent:"center",alignItems:"center"},Object(m.jsx)(o.EuiFlexItem,null,Object(m.jsx)(o.EuiTitle,{size:"s"},Object(m.jsx)("h3",{id:"flyoutTitle"},Object(m.jsx)(c.FormattedMessage,{defaultMessage:"Edit connector",id:"xpack.triggersActionsUI.sections.editConnectorForm.flyoutPreconfiguredTitle"})))),t&&Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)(o.EuiBetaBadge,{label:C.a.label,tooltipContent:C.a.tooltipContent}))))),Object(m.jsx)(o.EuiTabs,{className:"connectorEditFlyoutTabs",bottomBorder:!1,css:Object(m.css)("margin-bottom:-",j.size.l,";","")},Object(m.jsx)(o.EuiTab,{onClick:d,"data-test-subj":"configureConnectorTab",isSelected:u.i.Configuration===l},r.i18n.translate("xpack.triggersActionsUI.sections.editConnectorForm.tabText",{defaultMessage:"Configuration"})),Object(m.jsx)(o.EuiTab,{onClick:d,"data-test-subj":"testConnectorTab",isSelected:u.i.Test===l},r.i18n.translate("xpack.triggersActionsUI.sections.testConnectorForm.tabText",{defaultMessage:"Test"}))))},h=Object(n.memo)(y),E=({onClose:e})=>Object(m.jsx)(o.EuiFlyoutFooter,{"data-test-subj":"edit-connector-flyout-footer"},Object(m.jsx)(o.EuiFlexGroup,{justifyContent:"spaceBetween"},Object(m.jsx)(o.EuiFlexItem,{grow:!1},Object(m.jsx)(o.EuiButtonEmpty,{onClick:e,"data-test-subj":"edit-connector-flyout-close-btn"},r.i18n.translate("xpack.triggersActionsUI.sections.editConnectorForm.closeButtonLabel",{defaultMessage:"Close"}))),Object(m.jsx)(o.EuiFlexItem,{grow:!1}))),v=Object(n.memo)(E),T=e=>{var t;return{...e,isMissingSecrets:null!==(t=e.isMissingSecrets)&&void 0!==t&&t,secrets:{}}},k=({href:e})=>Object(m.jsx)(i.a.Fragment,null,Object(m.jsx)(o.EuiText,null,r.i18n.translate("xpack.triggersActionsUI.sections.editConnectorForm.descriptionText",{defaultMessage:"This connector is readonly."})),Object(m.jsx)(o.EuiLink,{href:e,target:"_blank"},Object(m.jsx)(c.FormattedMessage,{id:"xpack.triggersActionsUI.sections.editConnectorForm.preconfiguredHelpLabel",defaultMessage:"Learn more about preconfigured connectors."}))),M=({actionTypeRegistry:e,connector:t,onClose:s,tab:x=u.i.Configuration,onConnectorUpdated:f})=>{const{docLinks:O,application:{capabilities:F}}=Object(b.b)().services,C=Object(n.useRef)(!1),y=Object(g.e)(F),{isLoading:E,updateConnector:M}=(()=>{const{http:e,notifications:{toasts:t}}=Object(b.b)().services,[s,i]=Object(n.useState)(!1),o=Object(n.useRef)(new AbortController),c=Object(n.useRef)(!1);return Object(n.useEffect)((()=>(c.current=!0,()=>{c.current=!1,o.current.abort()})),[]),{isLoading:s,updateConnector:async function(s){i(!0),c.current=!0,o.current.abort(),o.current=new AbortController;try{const n=await Object(j.f)({http:e,connector:s,id:s.id});return c.current&&(i(!1),t.addSuccess(r.i18n.translate("xpack.triggersActionsUI.sections.editConnectorForm.updateSuccessNotificationText",{defaultMessage:"Updated '{connectorName}'",values:{connectorName:n.name}}))),n}catch(e){var n,a;c.current&&(i(!1),"AbortError"!==e.name&&t.addDanger(null!==(n=null===(a=e.body)||void 0===a?void 0:a.message)&&void 0!==n?n:r.i18n.translate("xpack.triggersActionsUI.sections.editConnectorForm.updateErrorNotificationText",{defaultMessage:"Cannot update a connector."})))}}}})(),{isLoading:S,executeConnector:I}=(()=>{const{http:e}=Object(b.b)().services,[t,s]=Object(n.useState)(!1),i=Object(n.useRef)(new AbortController),o=Object(n.useRef)(!1);return Object(n.useEffect)((()=>(o.current=!0,()=>{o.current=!1,i.current.abort()})),[]),{isLoading:t,executeConnector:async function({connectorId:t,params:n}){s(!0),o.current=!0,i.current.abort(),i.current=new AbortController;try{const i=await Object(j.c)({http:e,id:t,params:n});return o.current&&s(!1),i}catch(e){if(o.current&&(s(!1),"AbortError"!==e.name))throw e}}}})(),[A,w]=Object(n.useState)(null),[U,L]=Object(n.useState)({isSubmitted:!1,isSubmitting:!1,isValid:void 0,submit:async()=>({isValid:!1,data:{}}),preSubmitValidator:null}),[B,P]=Object(n.useState)(x),[R,z]=Object(n.useState)({}),[D,V]=Object(n.useState)(l.none),N=Object(n.useCallback)((()=>P((e=>e===u.i.Configuration?u.i.Test:(D!==l.none&&V(l.none),u.i.Configuration)))),[D]),[_,H]=Object(n.useState)(!1),[G,q]=Object(n.useState)(!1),[$,W]=Object(n.useState)(!0),[Y,J]=Object(n.useState)(!1),{preSubmitValidator:K,submit:Q,isValid:X,isSubmitting:Z}=U,ee=!1===X,te=E||Z||S,se=e.get(t.actionTypeId),ne=y&&se&&!t.isPreconfigured,ie=Object(n.useCallback)((async()=>{try{const e=await I({connectorId:t.id,params:R});V(Object(l.some)(e))}catch(e){const s=Object(a.isActionTypeExecutorResult)(e)?e:{actionId:t.id,status:"error",message:e.message};V(Object(l.some)(s))}}),[t.id,I,R]),oe=Object(n.useCallback)((e=>{e&&J(!1),H(e),V(l.none)}),[H]),ce=Object(n.useCallback)((()=>{_?q(!0):s()}),[s,_,q]),re=Object(n.useCallback)((async()=>{w(null);const{isValid:e,data:s}=await Q();if(C.current&&e){if(K){const e=await K();if(e)return void w(e.message)}const{name:e,config:n,secrets:i}=s,o={id:t.id,name:null!=e?e:"",config:null!=n?n:{},secrets:null!=i?i:{}},c=await M(o);return c&&(oe(!1),f&&f(c),J(!0),W(!1),W(!0)),c}}),[f,Q,K,t.id,M,oe]);return Object(n.useEffect)((()=>(C.current=!0,()=>{C.current=!1})),[]),Object(m.jsx)(i.a.Fragment,null,Object(m.jsx)(o.EuiFlyout,{onClose:ce,"aria-labelledby":"flyoutActionEditTitle",size:"m","data-test-subj":"edit-connector-flyout"},Object(m.jsx)(h,{isPreconfigured:t.isPreconfigured,connectorName:t.name,connectorTypeDesc:null==se?void 0:se.selectMessage,setTab:N,selectedTab:B,icon:null==se?void 0:se.iconClass,isExperimental:null==se?void 0:se.isExperimental}),Object(m.jsx)(o.EuiFlyoutBody,null,B===u.i.Configuration?t.isPreconfigured||t.isSystemAction?Object(m.jsx)(k,{href:O.links.alerting.preconfiguredConnectors}):Object(m.jsx)(i.a.Fragment,null,$&&Object(m.jsx)(i.a.Fragment,null,Object(m.jsx)(d.a,{actionTypeModel:se,connector:T(t),isEdit:$,onChange:L,onFormModifiedChange:oe}),!!A&&Object(m.jsx)("p",null,A),ne&&Object(m.jsx)(o.EuiButton,{fill:!0,iconType:Y?"check":void 0,color:"success","data-test-subj":"edit-connector-flyout-save-btn",isLoading:te,onClick:re,disabled:!_||ee||te},Y?Object(m.jsx)(c.FormattedMessage,{id:"xpack.triggersActionsUI.sections.editConnectorForm.saveButtonSavedLabel",defaultMessage:"Changes Saved"}):Object(m.jsx)(c.FormattedMessage,{id:"xpack.triggersActionsUI.sections.editConnectorForm.saveButtonLabel",defaultMessage:"Save"})))):Object(m.jsx)(p,{connector:t,executeEnabled:!_,actionParams:R,setActionParams:z,onExecutionAction:ie,isExecutingAction:S,executionResult:D,actionTypeRegistry:e})),Object(m.jsx)(v,{onClose:ce})),G&&Object(m.jsx)(o.EuiConfirmModal,{buttonColor:"danger","data-test-subj":"closeConnectorEditConfirm",title:r.i18n.translate("xpack.triggersActionsUI.sections.confirmConnectorEditClose.title",{defaultMessage:"Discard unsaved changes to connector?"}),onCancel:()=>{q(!1)},onConfirm:s,cancelButtonText:r.i18n.translate("xpack.triggersActionsUI.sections.confirmConnectorEditClose.cancelButtonLabel",{defaultMessage:"Cancel"}),confirmButtonText:r.i18n.translate("xpack.triggersActionsUI.sections.confirmConnectorEditClose.discardButtonLabel",{defaultMessage:"Discard Changes"})},Object(m.jsx)(c.FormattedMessage,{id:"xpack.triggersActionsUI.sections.confirmConnectorEditClose.confirmConnectorCloseMessage",defaultMessage:"You can't recover unsaved changes."})))},S=Object(n.memo)(M)}}]);