/*! 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.stackConnectors_bundle_jsonpfunction=window.stackConnectors_bundle_jsonpfunction||[]).push([[1,0],{123:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return V}));var s=n(1),a=n.n(s),o=n(25),c=n(26),i=n(27),r=n(2),l=n(41),d=n(61),u=n(10),p=n(46),E=n(39),f=n(0),b=n(9);const j=e=>`https://store.servicenow.com/sn_appstore_store.do#!/store/application/${e}`,m=({color:e,appId:t=""})=>Object(b.jsx)(o.EuiButton,{href:j(t),color:e,iconSide:"right",iconType:"popout",target:"_blank"},E.VISIT_SN_STORE),x=Object(s.memo)(m),O=({appId:e=""})=>Object(b.jsx)(o.EuiLink,{href:j(e),target:"_blank"},E.VISIT_SN_STORE),g=Object(s.memo)(O),I=f.i18n.translate("xpack.stackConnectors.components.serviceNow.applicationRequiredCallout.content",{defaultMessage:"Please go to the ServiceNow app store and install the application"}),T=f.i18n.translate("xpack.stackConnectors.components.serviceNow.applicationRequiredCallout.errorMessage",{defaultMessage:"Error message"}),v=({appId:e,message:t})=>Object(b.jsx)(a.a.Fragment,null,Object(b.jsx)(o.EuiSpacer,{size:"s"}),Object(b.jsx)(o.EuiCallOut,{size:"m",iconType:"warning","data-test-subj":"snApplicationCallout",color:"danger",title:f.i18n.translate("xpack.stackConnectors.components.serviceNow.applicationRequiredCallout",{defaultMessage:"Elastic ServiceNow App not installed"})},Object(b.jsx)("p",null,I),t&&Object(b.jsx)("p",null,T,": ",t),Object(b.jsx)(x,{color:"danger",appId:e})),Object(b.jsx)(o.EuiSpacer,{size:"m"})),C=Object(s.memo)(v);var k=n(4);const _=({appId:e})=>Object(b.jsx)(a.a.Fragment,null,Object(b.jsx)(o.EuiSpacer,{size:"s"}),Object(b.jsx)(o.EuiCallOut,{size:"m",iconType:"warning",color:"warning","data-test-subj":"snInstallationCallout",title:E.INSTALLATION_CALLOUT_TITLE},Object(b.jsx)(x,{color:"warning",appId:e})),Object(b.jsx)(o.EuiSpacer,{size:"m"})),L=Object(s.memo)(_);var w=n(29),N=n(55),S=n(58);const A=f.i18n.translate("xpack.stackConnectors.components.serviceNow.updateFormTitle",{defaultMessage:"Update ServiceNow connector"}),R=f.i18n.translate("xpack.stackConnectors.components.serviceNow.updateFormInstallTitle",{defaultMessage:"Install the Elastic ServiceNow app"}),y=f.i18n.translate("xpack.stackConnectors.components.serviceNow.updateFormUrlTitle",{defaultMessage:"Enter your ServiceNow instance URL"}),F=f.i18n.translate("xpack.stackConnectors.components.serviceNow.updateFormCredentialsTitle",{defaultMessage:"Provide authentication credentials"}),h=f.i18n.translate("xpack.stackConnectors.components.serviceNow.cancelButtonText",{defaultMessage:"Cancel"}),M=f.i18n.translate("xpack.stackConnectors.components.serviceNow.confirmButtonText",{defaultMessage:"Update"}),U=f.i18n.translate("xpack.stackConnectors.components.serviceNow.warningMessage",{defaultMessage:"This updates all instances of this connector and cannot be reversed."}),P="updatedConnector.",D=({actionTypeId:e,isOAuth:t,isLoading:n,readOnly:a,onCancel:i,onConfirm:r,updateErrorMessage:d})=>{var u,p;const{form:E}=Object(c.useForm)(),{submit:f,isValid:j}=E,m=Object(s.useCallback)((async()=>{const{data:e,isValid:t}=await f();if(!t)return;const{updatedConnector:n}=e;r(n)}),[r,f]);return Object(b.jsx)(c.Form,{form:E},Object(b.jsx)(o.EuiFlyout,{ownFocus:!0,onClose:i,"data-test-subj":"updateConnectorForm"},Object(b.jsx)(o.EuiFlyoutHeader,{hasBorder:!0},Object(b.jsx)(o.EuiTitle,{size:"m"},Object(b.jsx)("h1",null,A))),Object(b.jsx)(o.EuiFlyoutBody,{banner:Object(b.jsx)(o.EuiCallOut,{size:"m",color:"danger",iconType:"warning","data-test-subj":"snUpdateInstallationCallout",title:U})},Object(b.jsx)(o.EuiFlexGroup,null,Object(b.jsx)(o.EuiSteps,{steps:[{title:R,children:Object(b.jsx)(w.FormattedMessage,{id:"xpack.stackConnectors.components.serviceNow.appRunning",defaultMessage:"The Elastic App from the ServiceNow app store must be installed prior to running the update. {visitLink} to install the app",values:{visitLink:Object(b.jsx)(g,{appId:null!==(u=l.a[e].appId)&&void 0!==u?u:""})}})},{title:y,children:Object(b.jsx)(N.a,{readOnly:a,isLoading:n,pathPrefix:P})},{title:F,children:t?Object(b.jsx)(S.b,{readOnly:a,isLoading:n,pathPrefix:P}):Object(b.jsx)(S.a,{readOnly:a,isLoading:n,pathPrefix:P})}]})),Object(b.jsx)(o.EuiFlexGroup,null,Object(b.jsx)(o.EuiFlexItem,null,null!=d?Object(b.jsx)(C,{message:d,appId:null!==(p=l.a[e].appId)&&void 0!==p?p:""}):null))),Object(b.jsx)(o.EuiFlyoutFooter,null,Object(b.jsx)(o.EuiFlexGroup,{justifyContent:"flexEnd"},Object(b.jsx)(o.EuiFlexItem,{grow:!1},Object(b.jsx)(o.EuiButtonEmpty,{"data-test-subj":"snUpdateInstallationCancel",onClick:i},h)),Object(b.jsx)(o.EuiFlexItem,{grow:!1},Object(b.jsx)(o.EuiButton,{"data-test-subj":"snUpdateInstallationSubmit",onClick:m,color:"danger",fill:!0,disabled:!j,isLoading:n},M))))))},B=Object(s.memo)(D);var K=n(60);const V=({readOnly:e,registerPreSubmitValidator:t,isEdit:n})=>{var o,d;const{http:f,notifications:{toasts:j}}=Object(r.useKibana)().services,{updateFieldValues:m}=Object(c.useFormContext)(),[{id:x,isDeprecated:O,actionTypeId:g,name:I,config:T,secrets:v}]=Object(c.useFormData)({watch:["id","isDeprecated","actionTypeId","name","config.apiUrl","config.isOAuth","secrets.username","secrets.password"]}),_=null==O||!O,{isOAuth:w=!1}=null!=T?T:{},N=Object(s.useMemo)((()=>({name:I,actionTypeId:g,config:T,secrets:v})),[I,g,T,v]),[S,A]=Object(s.useState)(!1),[R,y]=Object(s.useState)(null),{fetchAppInfo:F,isLoading:h}=(({actionTypeId:e,http:t})=>{const[n,a]=Object(s.useState)(!1),o=Object(s.useRef)(!1),c=Object(s.useRef)(new AbortController),i=Object(s.useCallback)((async n=>{try{if(!e||Object(u.isEmpty)(e))return;o.current=!1,c.current.abort(),c.current=new AbortController,a(!0);const s=await Object(p.a)({signal:c.current.signal,connector:n,actionTypeId:e,http:t});return o.current||a(!1),s}catch(e){if(o.current||a(!1),"TypeError"===e.name)throw new Error(E.FETCH_ERROR);throw e}}),[e,t]);return Object(s.useEffect)((()=>()=>{o.current=!0,c.current.abort(),a(!1)}),[]),{fetchAppInfo:i,isLoading:n}})({actionTypeId:g,http:f}),M=Object(s.useCallback)((async e=>{try{const s=await F(e);var t,n;if(Object(k.f)(s))throw new Error(null!==(t=null===(n=s.error)||void 0===n?void 0:n.message)&&void 0!==t?t:E.UNKNOWN);return s}catch(e){throw e}}),[F]),U=Object(s.useCallback)((async()=>{if(_)try{await M(N)}catch(t){var e;return{message:Object(b.jsx)(C,{appId:null!=g?null===(e=l.a[g])||void 0===e?void 0:e.appId:"",message:t.message})}}}),[N,g,M,_]);Object(s.useEffect)((()=>t(U)),[U,t]);const P=Object(s.useCallback)((()=>A(!0)),[]),D=Object(s.useCallback)((()=>A(!1)),[]),V=Object(s.useCallback)((async e=>{const t={name:null!=I?I:"",config:{...e.config,usesTableApi:!1},secrets:{...e.secrets},id:null!=x?x:""};try{await M({...t,isDeprecated:O,isPreconfigured:!1,isSystemAction:!1,actionTypeId:g});const n=await Object(r.updateActionConnector)({http:f,connector:t,id:null!=x?x:""});j.addSuccess({title:E.UPDATE_SUCCESS_TOAST_TITLE(null!=I?I:""),text:E.UPDATE_SUCCESS_TOAST_TEXT}),A(!1),m({isDeprecated:n.isDeprecated,config:e.config})}catch(e){y(e.message)}}),[I,x,M,O,g,f,m,j]);return Object(b.jsx)(a.a.Fragment,null,g&&S&&Object(b.jsx)(B,{actionTypeId:g,readOnly:e,isLoading:h,updateErrorMessage:R,onConfirm:V,onCancel:D,isOAuth:w}),_&&Object(b.jsx)(L,{appId:null!==(o=null===(d=l.a[N.actionTypeId])||void 0===d?void 0:d.appId)&&void 0!==o?o:""}),!_&&Object(b.jsx)(q,{onMigrate:P}),Object(b.jsx)(c.UseField,{path:"config.usesTableApi",component:i.HiddenField,config:{defaultValue:!1}}),Object(b.jsx)(K.a,{readOnly:e,isLoading:h,isOAuth:w}))},q=({onMigrate:e})=>Object(b.jsx)(a.a.Fragment,null,Object(b.jsx)(o.EuiSpacer,{size:"s"}),Object(b.jsx)(d.a,{onMigrate:e}))},39:function(e,t,n){"use strict";n.r(t),n.d(t,"API_URL_LABEL",(function(){return a})),n.d(t,"API_URL_INVALID",(function(){return o})),n.d(t,"AUTHENTICATION_LABEL",(function(){return c})),n.d(t,"USERNAME_LABEL",(function(){return i})),n.d(t,"USERNAME_REQUIRED",(function(){return r})),n.d(t,"PASSWORD_LABEL",(function(){return l})),n.d(t,"TITLE_REQUIRED",(function(){return d})),n.d(t,"INCIDENT",(function(){return u})),n.d(t,"SECURITY_INCIDENT",(function(){return p})),n.d(t,"SHORT_DESCRIPTION_LABEL",(function(){return E})),n.d(t,"DESCRIPTION_LABEL",(function(){return f})),n.d(t,"COMMENTS_LABEL",(function(){return b})),n.d(t,"CHOICES_API_ERROR",(function(){return j})),n.d(t,"CATEGORY_LABEL",(function(){return m})),n.d(t,"SUBCATEGORY_LABEL",(function(){return x})),n.d(t,"URGENCY_LABEL",(function(){return O})),n.d(t,"SEVERITY_LABEL",(function(){return g})),n.d(t,"IMPACT_LABEL",(function(){return I})),n.d(t,"PRIORITY_LABEL",(function(){return T})),n.d(t,"API_INFO_ERROR",(function(){return v})),n.d(t,"FETCH_ERROR",(function(){return C})),n.d(t,"INSTALLATION_CALLOUT_TITLE",(function(){return k})),n.d(t,"UPDATE_SUCCESS_TOAST_TITLE",(function(){return _})),n.d(t,"UPDATE_SUCCESS_TOAST_TEXT",(function(){return L})),n.d(t,"VISIT_SN_STORE",(function(){return w})),n.d(t,"SETUP_DEV_INSTANCE",(function(){return N})),n.d(t,"SN_INSTANCE_LABEL",(function(){return S})),n.d(t,"UNKNOWN",(function(){return A})),n.d(t,"CORRELATION_ID",(function(){return R})),n.d(t,"CORRELATION_DISPLAY",(function(){return y})),n.d(t,"EVENT",(function(){return F})),n.d(t,"SOURCE",(function(){return h})),n.d(t,"EVENT_CLASS",(function(){return M})),n.d(t,"RESOURCE",(function(){return U})),n.d(t,"NODE",(function(){return P})),n.d(t,"METRIC_NAME",(function(){return D})),n.d(t,"TYPE",(function(){return B})),n.d(t,"MESSAGE_KEY",(function(){return K})),n.d(t,"SEVERITY_REQUIRED",(function(){return V})),n.d(t,"SEVERITY_REQUIRED_LABEL",(function(){return q})),n.d(t,"CLIENTID_LABEL",(function(){return Y})),n.d(t,"CLIENTSECRET_LABEL",(function(){return z})),n.d(t,"KEY_ID_LABEL",(function(){return Q})),n.d(t,"USER_IDENTIFIER_LABEL",(function(){return H})),n.d(t,"PRIVATE_KEY_LABEL",(function(){return W})),n.d(t,"PRIVATE_KEY_PASSWORD_LABEL",(function(){return $})),n.d(t,"PRIVATE_KEY_PASSWORD_HELPER_TEXT",(function(){return G})),n.d(t,"CLIENTID_REQUIRED",(function(){return J})),n.d(t,"PRIVATE_KEY_REQUIRED",(function(){return X})),n.d(t,"KEYID_REQUIRED",(function(){return Z})),n.d(t,"USER_IDENTIFIER_REQUIRED",(function(){return ee})),n.d(t,"PASSWORD_REQUIRED",(function(){return te})),n.d(t,"CLIENTSECRET_REQUIRED",(function(){return ne})),n.d(t,"IS_OAUTH",(function(){return se}));var s=n(0);const a=s.i18n.translate("xpack.stackConnectors.components.serviceNow.apiUrlTextFieldLabel",{defaultMessage:"ServiceNow instance URL"}),o=s.i18n.translate("xpack.stackConnectors.components.serviceNow.invalidApiUrlTextField",{defaultMessage:"URL is invalid."}),c=s.i18n.translate("xpack.stackConnectors.components.serviceNow.authenticationLabel",{defaultMessage:"Authentication"}),i=s.i18n.translate("xpack.stackConnectors.components.serviceNow.usernameTextFieldLabel",{defaultMessage:"Username"}),r=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredUsernameTextField",{defaultMessage:"Username is required."}),l=s.i18n.translate("xpack.stackConnectors.components.serviceNow.passwordTextFieldLabel",{defaultMessage:"Password"}),d=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredShortDescTextField",{defaultMessage:"Short description is required."}),u=s.i18n.translate("xpack.stackConnectors.components.serviceNow.title",{defaultMessage:"Incident"}),p=s.i18n.translate("xpack.stackConnectors.components.serviceNowSIR.title",{defaultMessage:"Security Incident"}),E=s.i18n.translate("xpack.stackConnectors.components.serviceNow.titleFieldLabel",{defaultMessage:"Short description (required)"}),f=s.i18n.translate("xpack.stackConnectors.components.serviceNow.descriptionTextAreaFieldLabel",{defaultMessage:"Description"}),b=s.i18n.translate("xpack.stackConnectors.components.serviceNow.commentsTextAreaFieldLabel",{defaultMessage:"Additional comments"}),j=s.i18n.translate("xpack.stackConnectors.components.serviceNow.unableToGetChoicesMessage",{defaultMessage:"Unable to get choices"}),m=s.i18n.translate("xpack.stackConnectors.components.serviceNow.categoryTitle",{defaultMessage:"Category"}),x=s.i18n.translate("xpack.stackConnectors.components.serviceNow.subcategoryTitle",{defaultMessage:"Subcategory"}),O=s.i18n.translate("xpack.stackConnectors.components.serviceNow.urgencySelectFieldLabel",{defaultMessage:"Urgency"}),g=s.i18n.translate("xpack.stackConnectors.components.serviceNow.severitySelectFieldLabel",{defaultMessage:"Severity"}),I=s.i18n.translate("xpack.stackConnectors.components.serviceNow.impactSelectFieldLabel",{defaultMessage:"Impact"}),T=s.i18n.translate("xpack.stackConnectors.components.serviceNow.prioritySelectFieldLabel",{defaultMessage:"Priority"}),v=e=>s.i18n.translate("xpack.stackConnectors.components.serviceNow.apiInfoError",{values:{status:e},defaultMessage:"Received status: {status} when attempting to get application information"}),C=s.i18n.translate("xpack.stackConnectors.components.serviceNow.fetchErrorMsg",{defaultMessage:"Failed to fetch. Check the URL or the CORS configuration of your ServiceNow instance."}),k=s.i18n.translate("xpack.stackConnectors.components.serviceNow.installationCalloutTitle",{defaultMessage:"To use this connector, first install the Elastic app from the ServiceNow app store."}),_=e=>s.i18n.translate("xpack.stackConnectors.components.serviceNow.updateSuccessToastTitle",{defaultMessage:"{connectorName} connector updated",values:{connectorName:e}}),L=s.i18n.translate("xpack.stackConnectors.components.serviceNow.updateCalloutText",{defaultMessage:"Connector has been updated."}),w=s.i18n.translate("xpack.stackConnectors.components.serviceNow.visitSNStore",{defaultMessage:"Visit ServiceNow app store"}),N=s.i18n.translate("xpack.stackConnectors.components.serviceNow.setupDevInstance",{defaultMessage:"setup a developer instance"}),S=s.i18n.translate("xpack.stackConnectors.components.serviceNow.snInstanceLabel",{defaultMessage:"ServiceNow instance"}),A=s.i18n.translate("xpack.stackConnectors.components.serviceNow.unknown",{defaultMessage:"UNKNOWN"}),R=s.i18n.translate("xpack.stackConnectors.components.serviceNow.correlationID",{defaultMessage:"Correlation ID (optional)"}),y=s.i18n.translate("xpack.stackConnectors.components.serviceNow.correlationDisplay",{defaultMessage:"Correlation display (optional)"}),F=s.i18n.translate("xpack.stackConnectors.components.serviceNowITOM.event",{defaultMessage:"Event"}),h=s.i18n.translate("xpack.stackConnectors.components.serviceNow.sourceTextAreaFieldLabel",{defaultMessage:"Source"}),M=s.i18n.translate("xpack.stackConnectors.components.serviceNow.eventClassTextAreaFieldLabel",{defaultMessage:"Source instance"}),U=s.i18n.translate("xpack.stackConnectors.components.serviceNow.resourceTextAreaFieldLabel",{defaultMessage:"Resource"}),P=s.i18n.translate("xpack.stackConnectors.components.serviceNow.nodeTextAreaFieldLabel",{defaultMessage:"Node"}),D=s.i18n.translate("xpack.stackConnectors.components.serviceNow.metricNameTextAreaFieldLabel",{defaultMessage:"Metric name"}),B=s.i18n.translate("xpack.stackConnectors.components.serviceNow.typeTextAreaFieldLabel",{defaultMessage:"Type"}),K=s.i18n.translate("xpack.stackConnectors.components.serviceNow.messageKeyTextAreaFieldLabel",{defaultMessage:"Message key"}),V=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredSeverityTextField",{defaultMessage:"Severity is required."}),q=s.i18n.translate("xpack.stackConnectors.components.serviceNow.severityRequiredSelectFieldLabel",{defaultMessage:"Severity (required)"}),Y=s.i18n.translate("xpack.stackConnectors.components.serviceNow.clientIdTextFieldLabel",{defaultMessage:"Client ID"}),z=s.i18n.translate("xpack.stackConnectors.components.serviceNow.clientSecretTextFieldLabel",{defaultMessage:"Client Secret"}),Q=s.i18n.translate("xpack.stackConnectors.components.serviceNow.keyIdTextFieldLabel",{defaultMessage:"JWT Verifier Key ID"}),H=s.i18n.translate("xpack.stackConnectors.components.serviceNow.userEmailTextFieldLabel",{defaultMessage:"User Identifier"}),W=s.i18n.translate("xpack.stackConnectors.components.serviceNow.privateKeyTextFieldLabel",{defaultMessage:"Private Key"}),$=s.i18n.translate("xpack.stackConnectors.components.serviceNow.privateKeyPassTextFieldLabel",{defaultMessage:"Private Key Password"}),G=s.i18n.translate("xpack.stackConnectors.components.serviceNow.privateKeyPassLabelHelpText",{defaultMessage:"This is only required if you have set a password on your private key"}),J=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredClientIdTextField",{defaultMessage:"Client ID is required."}),X=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredPrivateKeyTextField",{defaultMessage:"Private Key is required."}),Z=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredKeyIdTextField",{defaultMessage:"JWT Verifier Key ID is required."}),ee=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredUserIdentifierTextField",{defaultMessage:"User Identifier is required."}),te=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredPasswordTextField",{defaultMessage:"Password is required."}),ne=s.i18n.translate("xpack.stackConnectors.components.serviceNow.requiredClientSecretTextField",{defaultMessage:"Client Secret is required."}),se=s.i18n.translate("xpack.stackConnectors.components.serviceNow.useOAuth",{defaultMessage:"Use OAuth authentication"})},40:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));const s=({connector_id:e,service_message:t,...n})=>({...n,actionId:e,...t&&{serviceMessage:t}})},41:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));const s={".servicenow":{importSetTable:"x_elas2_inc_int_elastic_incident",appScope:"x_elas2_inc_int",table:"incident",useImportAPI:!0,commentFieldKey:"work_notes",appId:"7148dbc91bf1f450ced060a7234bcb88"},".servicenow-sir":{importSetTable:"x_elas2_sir_int_elastic_si_incident",appScope:"x_elas2_sir_int",table:"sn_si_incident",useImportAPI:!0,commentFieldKey:"work_notes",appId:"2f0746801baeb01019ae54e4604bcb0f"},".servicenow-itom":{importSetTable:"x_elas2_inc_int_elastic_incident",appScope:"x_elas2_inc_int",table:"em_event",useImportAPI:!1,commentFieldKey:"work_notes"}}},46:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return l}));var s=n(16),a=n(41),o=n(39),c=n(40);async function i({http:e,signal:t,connectorId:n,fields:a}){const o=await e.post(`${s.BASE_ACTION_API_PATH}/connector/${encodeURIComponent(n)}/_execute`,{body:JSON.stringify({params:{subAction:"getChoices",subActionParams:{fields:a}}}),signal:t});return Object(c.a)(o)}const r=(e,t)=>`${e}/api/${t}/elastic_api/health`;async function l({http:e,signal:t,connector:n,actionTypeId:c}){var i;const{secrets:{username:l,password:d,clientSecret:u,privateKey:p,privateKeyPassword:E},config:{isOAuth:f,apiUrl:b,clientId:j,userIdentifierValue:m,jwtKeyId:x}}=n,O=b.endsWith("/")?b.slice(0,-1):b;let g="Basic "+btoa(l+":"+d);if(f){const t=await e.post(`${s.INTERNAL_BASE_ACTION_API_PATH}/connector/_oauth_access_token`,{body:JSON.stringify({type:"jwt",options:{tokenUrl:`${O}/oauth_token.do`,config:{clientId:j,userIdentifierValue:m,jwtKeyId:x},secrets:{clientSecret:u,privateKey:p,...E&&{privateKeyPassword:E}}}})}),{accessToken:n}=t;g=n}const I=a.a[c],T=await fetch(r(O,null!==(i=I.appScope)&&void 0!==i?i:""),{method:"GET",signal:t,headers:{Authorization:g}});if(!T.ok)throw new Error(Object(o.API_INFO_ERROR)(T.status));return{...(await T.json()).result}}},55:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var s=n(1),a=n.n(s),o=n(29),c=n(25),i=n(26),r=n(28),l=n(27),d=n(2),u=n(39),p=n(9);const{urlField:E}=r.fieldValidators,f=({isLoading:e,readOnly:t,pathPrefix:n=""})=>{const{docLinks:s}=Object(d.useKibana)().services;return Object(p.jsx)(a.a.Fragment,null,Object(p.jsx)(c.EuiFormRow,{fullWidth:!0},Object(p.jsx)("p",null,Object(p.jsx)(o.FormattedMessage,{id:"xpack.stackConnectors.components.serviceNow.apiUrlHelpLabel",defaultMessage:"Provide the full URL to the desired ServiceNow instance. If you don't have one, {instance}.",values:{instance:Object(p.jsx)(c.EuiLink,{href:s.links.alerting.serviceNowAction,target:"_blank"},u.SETUP_DEV_INSTANCE)}}))),Object(p.jsx)(c.EuiSpacer,{size:"l"}),Object(p.jsx)(i.UseField,{path:`${n}config.apiUrl`,component:l.TextField,config:{label:u.API_URL_LABEL,validations:[{validator:E(u.API_URL_INVALID)}]},componentProps:{euiFieldProps:{"data-test-subj":"credentialsApiUrlFromInput",isLoading:e,readOnly:t,disabled:t||e}}}))},b=Object(s.memo)(f)},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var s=n(1),a=n.n(s),o=n(26),c=n(28),i=n(27),r=n(39),l=n(9);const{emptyField:d}=c.fieldValidators,u=({isLoading:e,readOnly:t,pathPrefix:n=""})=>Object(l.jsx)(a.a.Fragment,null,Object(l.jsx)(o.UseField,{path:`${n}secrets.username`,component:i.TextField,config:{label:r.USERNAME_LABEL,validations:[{validator:d(r.USERNAME_REQUIRED)}]},componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-username-form-input",isLoading:e,readOnly:t,disabled:t||e}}}),Object(l.jsx)(o.UseField,{path:`${n}secrets.password`,config:{label:r.PASSWORD_LABEL,validations:[{validator:d(r.PASSWORD_REQUIRED)}]},component:i.PasswordField,componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-password-form-input",isLoading:e,readOnly:t,disabled:t||e}}})),p=Object(s.memo)(u),{emptyField:E}=c.fieldValidators,f=({isLoading:e,readOnly:t,pathPrefix:n=""})=>Object(l.jsx)(a.a.Fragment,null,Object(l.jsx)(o.UseField,{path:`${n}config.clientId`,component:i.TextField,config:{label:r.CLIENTID_LABEL,validations:[{validator:E(r.CLIENTID_REQUIRED)}]},componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-client-id-form-input",readOnly:t,isLoading:e,disabled:t||e}}}),Object(l.jsx)(o.UseField,{path:`${n}config.userIdentifierValue`,component:i.TextField,config:{label:r.USER_IDENTIFIER_LABEL,validations:[{validator:E(r.USER_IDENTIFIER_REQUIRED)}]},componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-user-identifier-form-input",readOnly:t,disabled:t||e,isLoading:e}}}),Object(l.jsx)(o.UseField,{path:`${n}config.jwtKeyId`,component:i.TextField,config:{label:r.KEY_ID_LABEL,validations:[{validator:E(r.KEYID_REQUIRED)}]},componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-jwt-key-id-form-input",readOnly:t,disabled:t||e,isLoading:e}}}),Object(l.jsx)(o.UseField,{path:`${n}secrets.clientSecret`,config:{label:r.CLIENTSECRET_LABEL,validations:[{validator:E(r.CLIENTSECRET_REQUIRED)}]},component:i.PasswordField,componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-client-secret-form-input",isLoading:e,readOnly:t,disabled:t||e}}}),Object(l.jsx)(o.UseField,{path:"secrets.privateKey",component:i.TextAreaField,config:{label:r.PRIVATE_KEY_LABEL,validations:[{validator:E(r.PRIVATE_KEY_REQUIRED)}]},componentProps:{euiFieldProps:{readOnly:t,"data-test-subj":"connector-servicenow-private-key-form-input",disabled:t||e}}}),Object(l.jsx)(o.UseField,{path:`${n}secrets.privateKeyPassword`,config:{label:r.PRIVATE_KEY_PASSWORD_LABEL,validations:[],helpText:r.PRIVATE_KEY_PASSWORD_HELPER_TEXT},component:i.PasswordField,componentProps:{euiFieldProps:{"data-test-subj":"connector-servicenow-private-key-password-form-input",isLoading:e,readOnly:t,disabled:t||e}}})),b=Object(s.memo)(f)},60:function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var s=n(1),a=n.n(s),o=n(25),c=n(27),i=n(26),r=n(39),l=n(55),d=n(58),u=n(9);const p=({readOnly:e,isLoading:t,isOAuth:n})=>Object(u.jsx)(a.a.Fragment,null,Object(u.jsx)(o.EuiFlexGroup,{direction:"column"},Object(u.jsx)(o.EuiFlexItem,null,Object(u.jsx)(o.EuiTitle,{size:"xxs"},Object(u.jsx)("h4",null,r.SN_INSTANCE_LABEL)),Object(u.jsx)(l.a,{readOnly:e,isLoading:t}))),Object(u.jsx)(o.EuiSpacer,{size:"m"}),Object(u.jsx)(o.EuiFlexGroup,null,Object(u.jsx)(o.EuiFlexItem,null,Object(u.jsx)(o.EuiTitle,{size:"xxs"},Object(u.jsx)("h4",null,r.AUTHENTICATION_LABEL)))),Object(u.jsx)(o.EuiSpacer,{size:"s"}),Object(u.jsx)(i.UseField,{path:"config.isOAuth",component:c.ToggleField,config:{defaultValue:!1},componentProps:{hasEmptyLabelSpace:!0,euiFieldProps:{label:r.IS_OAUTH,disabled:e}}}),Object(u.jsx)(o.EuiSpacer,{size:"l"}),Object(u.jsx)(o.EuiFlexItem,null,n?Object(u.jsx)(d.b,{readOnly:e,isLoading:t}):Object(u.jsx)(d.a,{readOnly:e,isLoading:t}))),E=Object(s.memo)(p)},61:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var s=n(1),a=n.n(s),o=n(25),c=n(0),i=n(29),r=n(9);const l=({onMigrate:e})=>{const t=null!=e?Object(r.jsx)(o.EuiLink,{onClick:e,"data-test-subj":"update-connector-btn"},u):Object(r.jsx)("span",null,u);return Object(r.jsx)(a.a.Fragment,null,Object(r.jsx)(o.EuiCallOut,{size:"m",iconType:"warning","data-test-subj":"snDeprecatedCallout",color:"warning",title:c.i18n.translate("xpack.stackConnectors.components.serviceNow.deprecatedCalloutTitle",{defaultMessage:"This connector type is deprecated"})},Object(r.jsx)(i.FormattedMessage,{defaultMessage:"{update} {create} ",id:"xpack.stackConnectors.components.serviceNow.appInstallationInfo",values:{update:t,create:Object(r.jsx)("span",null,c.i18n.translate("xpack.stackConnectors.components.serviceNow.deprecatedCalloutCreate",{defaultMessage:"or create a new one."}))}})),Object(r.jsx)(o.EuiSpacer,{size:"m"}))},d=Object(s.memo)(l),u=c.i18n.translate("xpack.stackConnectors.components.serviceNow.deprecatedCalloutMigrate",{defaultMessage:"Update this connector,"})}}]);