/*! 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.securitySolution_bundle_jsonpfunction=window.securitySolution_bundle_jsonpfunction||[]).push([[1],{1035:function(e,t,a){"use strict";let n;a.d(t,"a",(function(){return n})),function(e){e.endpoints="endpoints",e.policies="policy",e.trustedApps="trusted_apps",e.eventFilters="event_filters",e.hostIsolationExceptions="host_isolation_exceptions",e.blocklist="blocklist",e.responseActionsHistory="response_actions_history"}(n||(n={}))},1036:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(2),s=a.n(n),o=a(40),i=a(41);const l=a.n(i)()(o.EuiFlexGroup).withConfig({displayName:"StyledEuiFlexGroup",componentId:"sc-osvxz7-0"})(["min-height:calc(100vh - 140px);"]),r=Object(n.memo)((({children:e,"data-test-subj":t})=>s.a.createElement(l,{direction:"column",alignItems:"center","data-test-subj":t},s.a.createElement(o.EuiPageTemplate_Deprecated,{template:"centeredContent"},e))));r.displayName="ManagementEmptyStateWrapper"},1065:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(2),s=a.n(n),o=a(40),i=a(44),l=a(5),r=a(693),u=a(102);const c=Object(n.memo)((()=>{const{data:e}=Object(r.a)(),[t,a]=Object(n.useState)(!1),{docLinks:c}=Object(u.j)().services,d=Object(n.useCallback)((()=>a(!0)),[]);return e?t||!0===e.data.canEncrypt?null:s.a.createElement(s.a.Fragment,null,s.a.createElement(o.EuiCallOut,{color:"warning",iconType:"iInCircle","data-test-subj":"missingEncryptionKeyCallout",title:l.i18n.translate("xpack.securitySolution.responder.missingEncryptionKey.callout.title",{defaultMessage:"Set up encryption key"})},s.a.createElement("div",null,s.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.responder.missingEncryptionKey.callout.body",defaultMessage:"We recommend encryption keys be configured to protect sensitive information and make your environment more secure. Without encryption keys configured, some features may not perform as intended. {viewMore}.",values:{viewMore:s.a.createElement(o.EuiLink,{href:c.links.kibana.secureSavedObject,target:"_blank"},s.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.responder.missingEncryptionKey.docsLink",defaultMessage:"View more information"}))}})),s.a.createElement(o.EuiButtonEmpty,{onClick:d,color:"warning","data-test-subj":"dismissEncryptionKeyCallout"},s.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.responder.missingEncryptionKey.callout.dismissButton.label",defaultMessage:"Dismiss"}))),s.a.createElement(o.EuiSpacer,{size:"m"})):null}));c.displayName="MissingEncryptionKeyCallout"},1384:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(102),s=a(215);const o=e=>n.b.get().http.get(s.e,{version:"2023-10-31",query:{agent_ids:e}})},1406:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var n=a(2),s=a.n(n),o=a(40),i=a(61),l=a(8),r=a(1543),u=a(126),c=a(793),d=a(702),p=a(107),m=a(1497),g=a(1539),M=a(117);const j=Object(M.e)(),y=i.css` &.euiDescriptionList { > .euiDescriptionList__title { color: ${e=>e.theme.eui.euiColorDarkShade}; font-size: ${e=>e.theme.eui.euiFontSizeXS}; } > .euiDescriptionList__title, > .euiDescriptionList__description { font-weight: ${e=>e.theme.eui.euiFontWeightRegular}; margin-top: ${e=>e.theme.eui.euiSizeS}; } } `,b=i.css` ${e=>`${e.theme.eui.euiSize} 0`} `,f=i.css` ${e=>`1px dashed ${e.theme.eui.euiColorDisabled}`}; `,E=Object(i.euiStyled)(o.EuiDescriptionList).attrs({compressed:!0})` ${y} dd { margin: ${b}; padding: ${b}; border-top: ${f}; border-bottom: ${f}; } `,S=Object(i.euiStyled)(o.EuiDescriptionList).attrs({compressed:!0,type:"column"})` ${y} `,x=Object(i.euiStyled)(o.EuiCodeBlock).attrs({transparentBackground:!0,paddingSize:"none"})` code { color: ${e=>e.theme.eui.euiColorDarkShade} !important; } `,h=Object(i.euiStyled)(o.EuiFlexGroup).attrs({direction:"column",className:"eui-yScrollWithShadows",gutterSize:"s"})` max-height: 270px; overflow-y: auto; `,N=Object(n.memo)((({action:e,"data-test-subj":t})=>{const a=Object(p.a)(t),{canWriteFileOperations:n,canReadActionsLogManagement:i,canAccessEndpointActionsLogManagement:l}=Object(u.a)().endpointPrivileges,{command:d,isCompleted:M,isExpired:j,wasSuccessful:y,errors:b}=e;return null!=b&&b.length?s.a.createElement(s.a.Fragment,null,b.map((e=>s.a.createElement(o.EuiFlexItem,null,e)))):j?s.a.createElement(s.a.Fragment,null,c.e.hasExpired(d)):M?y?"get-file"===d?s.a.createElement(s.a.Fragment,null,c.e.wasSuccessful(d),s.a.createElement(m.a,{action:e,canAccessFileDownloadLink:n,textSize:"xs","data-test-subj":a("getFileDownloadLink")})):"execute"===d?s.a.createElement(o.EuiFlexGroup,{direction:"column","data-test-subj":a("executeDetails")},e.agents.map((t=>s.a.createElement("div",{key:t},c.e.wasSuccessful(d),s.a.createElement(g.a,{action:e,agentId:t,canAccessFileDownloadLink:l||i,textSize:"xs","data-test-subj":a("actionsLogTray")}))))):(e=>"upload"===e.command)(e)?s.a.createElement(o.EuiFlexGroup,{direction:"column","data-test-subj":a("uploadDetails")},s.a.createElement("p",null,c.e.wasSuccessful(d)),s.a.createElement(r.a,{action:e,"data-test-subj":a("uploadOutput"),textSize:"xs"})):s.a.createElement(s.a.Fragment,null,c.e.wasSuccessful(d)):s.a.createElement(s.a.Fragment,null,c.e.hasFailed(d)):s.a.createElement(s.a.Fragment,null,c.e.isPending(d))}));N.displayName="OutputContent";const O=Object(n.memo)((({action:e,"data-test-subj":t})=>{const a=Object(p.a)(t),{hosts:i,startedAt:r,completedAt:u,command:m,comment:g,parameters:M}=e,y=Object(n.useMemo)((()=>M?Object.entries(M).map((([e,t])=>`${e}: ${t}`)):void 0),[M]),b=Object(d.d)(m),f=Object(n.useMemo)((()=>[{title:c.e.expandSection.placedAt,description:`${r}`},{title:c.e.expandSection.startedAt,description:`${r}`},{title:c.e.expandSection.completedAt,description:`${null!=u?u:j}`},{title:c.e.expandSection.input,description:`${b}`},{title:c.e.expandSection.parameters,description:y?y.join(", "):j},{title:c.e.expandSection.comment,description:g||j},{title:c.e.expandSection.hostname,description:Object(l.map)(i,(e=>e.name)).join(", ")||j}].map((({title:e,description:t})=>({title:s.a.createElement(x,null,e),description:s.a.createElement(x,null,t)})))),[b,g,u,i,y,r]),O=Object(n.useMemo)((()=>[{title:s.a.createElement(x,null,`${c.e.expandSection.output}:`),description:s.a.createElement(x,{"data-test-subj":a("details-tray-output")},s.a.createElement(N,{action:e,"data-test-subj":t}))}]),[e,t,a]);return s.a.createElement(s.a.Fragment,null,s.a.createElement(h,{"data-test-subj":a("details-tray")},s.a.createElement(o.EuiFlexItem,{grow:!1},s.a.createElement(S,{listItems:f})),s.a.createElement(o.EuiFlexItem,null,s.a.createElement(E,{listItems:O}))))}));O.displayName="ActionsLogExpandedTray"},1440:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"c",(function(){return i})),a.d(t,"b",(function(){return l})),a.d(t,"d",(function(){return r}));var n=a(5),s=a(185);const o=Object.freeze({[s.c.HEALTHY]:"success",[s.c.UNHEALTHY]:"warning",[s.c.UPDATING]:"primary",[s.c.OFFLINE]:"default",[s.c.INACTIVE]:"default",[s.c.UNENROLLED]:"default"}),i=Object.freeze({success:"success",warning:"warning",failure:"danger",unsupported:"default"}),l=Object.freeze({success:"success",warning:"warning",failure:"danger",unsupported:"default"}),r=Object.freeze({success:n.i18n.translate("xpack.securitySolution.policyStatusText.success",{defaultMessage:"Success"}),warning:n.i18n.translate("xpack.securitySolution.policyStatusText.warning",{defaultMessage:"Warning"}),failure:n.i18n.translate("xpack.securitySolution.policyStatusText.failure",{defaultMessage:"Failure"}),unsupported:n.i18n.translate("xpack.securitySolution.policyStatusText.unsupported",{defaultMessage:"Unsupported"})})},1446:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(2),s=a.n(n),o=a(40);const i=Object(n.memo)((({data:e})=>s.a.createElement(o.EuiText,{size:"s"},Object.entries(e).map((([e,t])=>s.a.createElement("div",{key:e,className:"eui-textBreakAll"},s.a.createElement("strong",null,e),": ",t))))));i.displayName="ObjectContent";const l=Object(n.memo)((({error:e,"data-test-subj":t})=>Object(n.useMemo)((()=>{let a=s.a.createElement(s.a.Fragment,null,e.message);var n,l;return function(e){return e instanceof Error&&"request"in e&&"name"in e}(e)&&(a=s.a.createElement(s.a.Fragment,null,s.a.createElement("div",null,`${null===(n=e.response)||void 0===n?void 0:n.status}: ${null===(l=e.response)||void 0===l?void 0:l.statusText}`),e.body&&s.a.createElement(i,{data:e.body}))),s.a.createElement(o.EuiText,{"data-test-subj":t},a)}),[t,e])));l.displayName="FormattedError"},1477:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(46),s=a(1384);const o=(e,t={})=>Object(n.useQuery)({queryKey:["fetch-endpoint-pending-actions-summary",...e],...t,queryFn:()=>Object(s.a)(e)})},1478:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(2),s=a(45),o=a(493),i=a(290),l=a(702);const r=e=>{const t={commands:[],hosts:[],statuses:[],startDate:l.a.startDate,endDate:l.a.endDate,users:[],withOutputs:[],types:[]},a=e.commands?String(e.commands).split(",").reduce(((e,t)=>((o.b.includes(t)||"release"===t||"processes"===t)&&e.push(t),e.sort())),[]):[],n=e.hosts?String(e.hosts).split(",").sort():[],s=e.types?String(e.types).split(",").sort():[],i=e.withOutputs?String(e.withOutputs).split(",").sort():[],r=e.statuses?String(e.statuses).split(",").reduce(((e,t)=>(o.d.includes(t)&&e.push(t),e.sort())),[]):[],u=e.users?String(e.users).split(",").sort():[];return t.commands=a.length?a:void 0,t.hosts=n.length?n:void 0,t.statuses=r.length?r:void 0,t.startDate=e.startDate?String(e.startDate):void 0,t.endDate=e.endDate?String(e.endDate):void 0,t.users=u.length?u:void 0,t.withOutputs=i.length?i:void 0,t.types=s.length?s:void 0,t},u=()=>{const e=Object(s.useLocation)(),t=Object(s.useHistory)(),{urlParams:a,toUrlParams:o}=Object(i.a)(),l=Object(n.useMemo)((()=>r(a)),[a]),[u,c]=Object(n.useState)(l),d=Object(n.useCallback)((n=>{t.push({...e,search:o({...a,commands:n.length?n:void 0})})}),[t,e,o,a]),p=Object(n.useCallback)((n=>{t.push({...e,search:o({...a,hosts:n.length?n:void 0})})}),[t,e,o,a]),m=Object(n.useCallback)((n=>{t.push({...e,search:o({...a,withOutputs:n.length?n:void 0})})}),[t,e,o,a]),g=Object(n.useCallback)((n=>{t.push({...e,search:o({...a,statuses:n.length?n:void 0})})}),[t,e,o,a]),M=Object(n.useCallback)((n=>{t.push({...e,search:o({...a,types:n.length?n:void 0})})}),[t,e,o,a]),j=Object(n.useCallback)((n=>{t.push({...e,search:o({...a,users:n.length?n:void 0})})}),[t,e,o,a]),y=Object(n.useCallback)((({startDate:n,endDate:s})=>{t.push({...e,search:o({...a,startDate:n.length?n:void 0,endDate:s.length?s:void 0})})}),[t,e,o,a]);return Object(n.useEffect)((()=>{c((e=>({...e,...r(a)})))}),[c,a]),{...u,setUrlActionsFilters:d,setUrlDateRangeFilters:y,setUrlHostsFilters:p,setUrlWithOutputs:m,setUrlStatusesFilters:g,setUrlUsersFilters:j,setUrlTypeFilters:M}}},1494:function(e,t,a){"use strict";a.d(t,"a",(function(){return $}));var n=a(40),s=a(2),o=a.n(s),i=a(44),l=a(1036),r=a(693),u=a(793),c=a(107),d=a(124),p=a(61),m=a(58),g=a(51);const M=p.euiStyled.div` padding-bottom: ${e=>`${e.theme.eui.euiSizeL}`}; `,j=Object(s.memo)((({dateRangePickerState:e,isDataLoading:t,onRefresh:a,onRefreshChange:i,onTimeChange:l,"data-test-subj":r})=>{const u=Object(c.a)(r),d=Object(m.useKibana)(),{uiSettings:p}=d.services,[j]=Object(s.useState)((()=>{var e,t;return null!==(e=null==p||null===(t=p.get(g.UI_SETTINGS.TIMEPICKER_QUICK_RANGES))||void 0===t?void 0:t.map((({from:e,to:t,display:a})=>({start:e,end:t,label:a}))))&&void 0!==e?e:[]}));return o.a.createElement(M,{"data-test-subj":u("super-date-picker")},o.a.createElement(n.EuiFlexGroup,{alignItems:"center",direction:"row",responsive:!1,gutterSize:"s"},o.a.createElement(n.EuiFlexItem,null,o.a.createElement(n.EuiSuperDatePicker,{isLoading:t,dateFormat:p.get("dateFormat"),commonlyUsedRanges:j,end:e.endDate,isPaused:!e.autoRefreshOptions.enabled,onTimeChange:l,onRefreshChange:i,refreshInterval:e.autoRefreshOptions.duration,onRefresh:a,recentlyUsedRanges:e.recentlyUsedDateRanges,start:e.startDate,showUpdateButton:!1,updateButtonProps:{iconOnly:!0,fill:!1},width:"auto"}))))}));j.displayName="ActionLogDateRangePicker";var y=a(42);const b=Object(s.memo)((({children:e,closePopover:t,filterName:a,hasActiveFilters:i,isPopoverOpen:l,numActiveFilters:r,numFilters:d,onButtonClick:p,"data-test-subj":m})=>{const g=Object(c.a)(m),M=Object(n.useGeneratedHtmlId)({prefix:"filterGroupPopover"}),j=Object(s.useMemo)((()=>o.a.createElement(n.EuiFilterButton,{"data-test-subj":g(`${a}-filter-popoverButton`),iconType:"arrowDown",onClick:p,isSelected:l,numFilters:d,hasActiveFilters:i,numActiveFilters:r},u.c[a])),[a,g,i,l,r,d,p]);return o.a.createElement(n.EuiPopover,{button:j,closePopover:t,id:M,isOpen:l,panelPaddingSize:"none"},e)}));b.displayName="ActionsLogFilterPopover";var f=a(702);const E=Object(p.euiStyled)(n.EuiButtonEmpty).attrs({iconType:"cross",color:"danger"})` border-top: ${e=>`${e.theme.eui.euiBorderThin}`}; border-radius : 0; `,S=Object(s.memo)((({"data-test-subj":e,isDisabled:t,onClick:a})=>o.a.createElement(E,{"data-test-subj":e,isDisabled:t,onClick:a},u.g.filterClearAll)));S.displayName="ClearAllButton";const x=Object(s.memo)((({filterName:e,isFlyout:t,onChangeFilterOptions:a,"data-test-subj":i})=>{const l=Object(c.a)(i),[r,d]=Object(s.useState)(!1),p=Object(s.useCallback)((()=>{d(!r)}),[d,r]),m=Object(s.useCallback)((()=>{d(!1)}),[d]),[g,M]=Object(s.useState)(""),{areHostsSelectedOnMount:j,isLoading:E,items:x,setItems:h,hasActiveFilters:N,numActiveFilters:O,numFilters:v,setAreHostsSelectedOnMount:I,setUrlActionsFilters:T,setUrlHostsFilters:A,setUrlStatusesFilters:L,setUrlTypeFilters:D}=Object(f.e)({filterName:e,isFlyout:t,isPopoverOpen:r,searchString:g}),C=Object(s.useRef)(r);Object(s.useEffect)((()=>()=>{C.current=r}),[r,C]);const k=Object(s.useCallback)(((t=!0)=>t&&C.current&&r&&"hosts"===e),[e,r]),w=Object(s.useMemo)((()=>k()||j?Object(y.orderBy)("checked","asc",x):x),[j,k,x]),z=Object(s.useMemo)((()=>"statuses"!==e&&"type"!==e),[e]),F=Object(s.useCallback)((n=>{h(n.map((e=>e)));const s=n.reduce(((e,t)=>("on"===t.checked&&e.push(t.key),e)),[]);t||("actions"===e?T(s.map((e=>Object(f.d)(e))).join()):"hosts"===e?A(s.join()):"statuses"===e?L(s.join()):"type"===e&&D(s.join()),k(!1),I(!1)),a(s)}),[h,t,a,e,k,I,T,A,L,D]),R=Object(s.useCallback)((()=>{h(x.map((e=>(e.checked=void 0,e)))),t||("actions"===e?T(""):"hosts"===e?A(""):"statuses"===e?L(""):"type"===e&&D("")),a([])}),[h,x,t,a,e,T,A,L,D]);return o.a.createElement(b,{closePopover:m,filterName:e,hasActiveFilters:N,isPopoverOpen:r,numActiveFilters:O,numFilters:v,onButtonClick:p,"data-test-subj":i},o.a.createElement(n.EuiSelectable,{"aria-label":`${e}`,emptyMessage:u.g.filterEmptyMessage(e),isLoading:E,onChange:F,options:w,searchable:!!z||void 0,searchProps:{placeholder:u.g.filterSearchPlaceholder(e),compressed:!0,onChange:e=>M(e.trim())}},((t,a)=>o.a.createElement("div",{style:{width:300},"data-test-subj":l(`${e}-filter-popoverList`)},z&&o.a.createElement(n.EuiPopoverTitle,{"data-test-subj":l(`${e}-filter-search`),paddingSize:"s"},a),t,o.a.createElement(n.EuiFlexGroup,null,o.a.createElement(n.EuiFlexItem,null,o.a.createElement(S,{"data-test-subj":l(`${e}-filter-clearAllButton`),isDisabled:!N,onClick:R})))))))}));x.displayName="ActionsLogFilter";var h=a(1478);const N=Object(s.memo)((({isFlyout:e,onChangeUsersFilter:t,"data-test-subj":a})=>{const i=Object(c.a)(a),{users:l,setUrlUsersFilters:r}=Object(h.a)(),[d,p]=Object(s.useState)(""),m=Object(s.useCallback)((e=>{p(e.target.value)}),[p]),g=Object(s.useCallback)((()=>{const a=d.split(",").reduce(((e,t)=>(""!==t.trim()&&e.push(t.trim()),e)),[]);t(a),e||r(a.join(","))}),[e,t,d,r]),M=Object(s.useCallback)((()=>{p(""),t([]),e||r("")}),[e,t,r,p]);return Object(s.useEffect)((()=>{l&&l.length>0&&p(l.join(","))}),[]),o.a.createElement(n.EuiFormControlLayout,{clear:{onClick:M},fullWidth:!0},o.a.createElement(n.EuiFieldSearch,{"data-test-subj":i("users-filter-search"),isClearable:!0,fullWidth:!0,placeholder:u.c.users,onChange:m,onSearch:g,value:d}))}));N.displayName="ActionsLogUsersFilter";const O=Object(s.memo)((({dateRangePickerState:e,isDataLoading:t,isFlyout:a,onClick:i,onChangeHostsFilter:l,onChangeCommandsFilter:r,onChangeStatusesFilter:u,onChangeUsersFilter:p,onChangeTypeFilter:m,onRefresh:g,onRefreshChange:M,onTimeChange:y,showHostsFilter:b,"data-test-subj":f})=>{const E=Object(c.a)(f),S=Object(d.a)("endpointResponseActionsEnabled"),h=Object(s.useMemo)((()=>o.a.createElement(o.a.Fragment,null,b&&o.a.createElement(x,{filterName:"hosts",isFlyout:a,onChangeFilterOptions:l,"data-test-subj":f}),o.a.createElement(x,{filterName:"actions",isFlyout:a,onChangeFilterOptions:r,"data-test-subj":f}),o.a.createElement(x,{filterName:"statuses",isFlyout:a,onChangeFilterOptions:u,"data-test-subj":f}),S&&o.a.createElement(x,{filterName:"type",isFlyout:a,onChangeFilterOptions:m,"data-test-subj":f}))),[f,a,r,l,m,u,S,b]),O=Object(s.useCallback)((()=>i()),[i]);return o.a.createElement(n.EuiFlexGroup,{responsive:!0,gutterSize:"s"},o.a.createElement(n.EuiFlexItem,{grow:a?1:2},o.a.createElement(N,{isFlyout:a,onChangeUsersFilter:p,"data-test-subj":f})),o.a.createElement(n.EuiFlexItem,{grow:1},o.a.createElement(n.EuiFilterGroup,null,h)),o.a.createElement(n.EuiFlexItem,{grow:a?1:2},o.a.createElement(j,{dateRangePickerState:e,isDataLoading:t,onRefresh:g,onRefreshChange:M,onTimeChange:y,"data-test-subj":f})),o.a.createElement(n.EuiFlexItem,{grow:!1},o.a.createElement(n.EuiSuperUpdateButton,{iconOnly:!0,"data-test-subj":E("super-refresh-button"),fill:!1,isLoading:t,onClick:O})))}));O.displayName="ActionsLogFilters";var v=a(720),I=a(794),T=a(41),A=a.n(T),L=a(5);const D=A()(n.EuiEmptyPrompt).withConfig({displayName:"EmptyPrompt",componentId:"sc-9irxg1-0"})(["max-width:100%;"]),C=Object(s.memo)((({"data-test-subj":e})=>{const{docLinks:t}=Object(m.useKibana)().services;return o.a.createElement(l.a,{"data-test-subj":e},o.a.createElement(D,{iconType:"editorUnorderedList",title:o.a.createElement("h2",null,L.i18n.translate("xpack.securitySolution.responseActionsHistory.empty.title",{defaultMessage:"Response actions history is empty"})),body:o.a.createElement("div",null,L.i18n.translate("xpack.securitySolution.responseActionsHistory.empty.content",{defaultMessage:"No response actions performed"})),actions:[o.a.createElement(n.EuiLink,{external:!0,href:null==t?void 0:t.links.securitySolution.responseActions,target:"_blank"},L.i18n.translate("xpack.securitySolution.responseActionsHistory.empty.link",{defaultMessage:"Read more about response actions"}))]}))}));C.displayName="ActionsLogEmptyState";var k=a(4),w=a(169),z=a(123),F=a(132),R=a(117),U=a(1533),_=a(1406),P=a(173);const Q=Object(R.e)(),Y=Object(p.euiStyled)(n.EuiFacetButton)` .euiText { margin-top: 0.38rem; overflow-y: visible !important; } `,H=Object(s.memo)((({"data-test-subj":e,error:t,items:a,isFlyout:l,loading:r,onChange:d,onShowActionDetails:p,queryParams:m,showHostNames:g,totalItemCount:M})=>{const j=Object(c.a)(e),{pagination:y}=Object(v.b)(),[b,E]=Object(s.useState)({}),S=Object(s.useMemo)((()=>m.withOutputs?"string"==typeof m.withOutputs?[m.withOutputs]:m.withOutputs:[]),[m.withOutputs]),x=Object(s.useCallback)((()=>{if(S.length&&a.length){const t=S.reduce(((t,s)=>{const i=a.find((e=>e.id===s));return t[s]=i?o.a.createElement(_.a,{action:i,"data-test-subj":e}):o.a.createElement(n.EuiSkeletonText,{size:"relative",lines:8}),t}),{});E(t)}}),[S,e,a]);Object(s.useEffect)((()=>{x()}),[x]);const h=Object(s.useCallback)((t=>{const a={...b};a[t.id]?delete a[t.id]:a[t.id]=o.a.createElement(_.a,{action:t,"data-test-subj":e}),p(Object.keys(a)),E(a)}),[b,p,e]),N=Object(s.useCallback)((e=>()=>h(e)),[h]),O=Object(s.useMemo)((()=>({pageIndex:l?(m.page||1)-1:y.page-1,pageSize:l?m.pageSize||10:y.pageSize,totalItemCount:M,pageSizeOptions:P.f})),[l,y.page,y.pageSize,m.page,m.pageSize,M]),I=Object(s.useMemo)((()=>{var e,t;const a=null!==(e=m.page)&&void 0!==e?e:1,n=null!==(t=null==m?void 0:m.pageSize)&&void 0!==t?t:10,s=Math.ceil(M/n),o=n*a-n+1;return{fromCount:o,toCount:a===s||1===s?M:o+n-1}}),[m.page,m.pageSize,M]),T=Object(s.useMemo)((()=>o.a.createElement(n.EuiText,{color:"default",size:"xs","data-test-subj":j("endpointListTableTotal")},o.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.responseActionsList.list.recordRange",defaultMessage:"Showing {range} of {total} {recordsLabel}",values:{range:o.a.createElement("strong",null,o.a.createElement(n.EuiI18nNumber,{value:I.fromCount}),"-",o.a.createElement(n.EuiI18nNumber,{value:I.toCount})),total:o.a.createElement(n.EuiI18nNumber,{value:M}),recordsLabel:o.a.createElement("strong",null,u.g.recordsLabel(M))}}))),[j,I.fromCount,I.toCount,M]),A=Object(s.useMemo)((()=>(({getTestId:e,expandedRowMap:t,showHostNames:a,onClickCallback:s})=>{const i=[{field:"startedAt",name:u.f.time,width:a?"15%":"21%",truncateText:!0,render:e=>o.a.createElement(F.a,{fieldName:u.f.time,value:e,className:"eui-textTruncate"})},{field:"command",name:u.f.command,width:a?"10%":"21%",truncateText:!0,render:t=>{const a=Object(f.d)(t);return o.a.createElement(n.EuiToolTip,{content:a,anchorClassName:"eui-textTruncate"},o.a.createElement(n.EuiText,{size:"s",className:"eui-textTruncate eui-fullWidth","data-test-subj":e("column-command")},a))}},{name:u.f.user,width:a?"14%":"21%",truncateText:!0,render:({createdBy:t,ruleId:a})=>"unknown"===t&&a?o.a.createElement(n.EuiToolTip,{content:u.g.triggeredByRule,anchorClassName:"eui-textTruncate"},o.a.createElement(z.k,{"data-test-subj":"ruleName",deepLinkId:k.wc.rules,path:Object(w.i)(a)},o.a.createElement(n.EuiText,{size:"s",className:"eui-textTruncate eui-fullWidth","data-test-subj":e("column-user-name")},u.g.triggeredByRule))):o.a.createElement(Y,{icon:o.a.createElement(n.EuiAvatar,{name:t,"data-test-subj":e("column-user-avatar"),size:"s"})},o.a.createElement(n.EuiToolTip,{content:t,anchorClassName:"eui-textTruncate"},o.a.createElement(n.EuiText,{size:"s",className:"eui-textTruncate eui-fullWidth","data-test-subj":e("column-user-name")},t)))},{field:"hosts",name:u.f.hosts,width:"20%",truncateText:!0,render:t=>{const a=t&&Object.values(t),s=a.reduce(((e,t)=>(t.name.trim()&&e.push(t.name),e)),[]).join(", ");let i=s;return s||(a.length>1?i=u.g.unenrolled.hosts:1===a.length&&(i=u.g.unenrolled.host)),o.a.createElement(n.EuiToolTip,{content:i,anchorClassName:"eui-textTruncate"},o.a.createElement(n.EuiText,{size:"s",className:"eui-textTruncate eui-fullWidth","data-test-subj":e("column-hostname")},i))}},{field:"comment",name:u.f.comments,width:a?"30%":"21%",truncateText:!0,render:t=>o.a.createElement(n.EuiToolTip,{content:t,anchorClassName:"eui-textTruncate"},o.a.createElement(n.EuiText,{size:"s",className:"eui-textTruncate eui-fullWidth","data-test-subj":e("column-comments")},null!=t?t:Q))},{field:"status",name:u.f.status,width:a?"10%":"15%",render:t=>{const a=Object(f.b)(t);return o.a.createElement(n.EuiToolTip,{content:a,anchorClassName:"eui-textTruncate"},o.a.createElement(U.a,{color:"failed"===t?"danger":"successful"===t?"success":"warning","data-test-subj":e("column-status"),status:a}))}},{field:"",align:n.RIGHT_ALIGNMENT,width:"40px",isExpander:!0,name:o.a.createElement(n.EuiScreenReaderOnly,null,o.a.createElement("span",null,u.g.screenReaderExpand)),render:a=>{const i=a.id;return o.a.createElement(n.EuiButtonIcon,{"data-test-subj":e("expand-button"),onClick:s(a),"aria-label":t[i]?u.a.collapse:u.a.expand,iconType:t[i]?"arrowUp":"arrowDown"})}}];return a?i:i.filter((e=>"hosts"!==e.field))})({getTestId:j,expandedRowMap:b,onClickCallback:N,showHostNames:g})),[b,j,N,g]);return o.a.createElement(o.a.Fragment,null,T,o.a.createElement(n.EuiHorizontalRule,{margin:"xs"}),o.a.createElement(n.EuiBasicTable,{"data-test-subj":e,items:a,columns:A,itemId:"id",itemIdToExpandedRowMap:b,isExpandable:!0,pagination:O,onChange:d,loading:r,error:t}))}));H.displayName="ActionsLogTable";const $=Object(s.memo)((({agentIds:e,showHostNames:t=!1,isFlyout:a=!0,setIsDataInResponse:d,"data-test-subj":p="response-actions-list"})=>{var m,g;const{pagination:M,setPagination:j}=Object(v.b)(),{commands:y,hosts:b,statuses:E,users:S,types:x,withOutputs:N,setUrlWithOutputs:T}=Object(h.a)(),A=Object(c.a)(p),[L,D]=Object(s.useState)(!0),[k,w]=Object(s.useState)({page:a?1:M.page,pageSize:a?10:M.pageSize,agentIds:a?e:null!=b&&b.length?b:e,commands:[],statuses:[],userIds:[],withOutputs:[],types:[]});Object(s.useEffect)((()=>{a||w((e=>({...e,commands:null!=y&&y.length?y.map((e=>Object(f.c)(e))):e.commands,hosts:null!=b&&b.length?b:e.agentIds,statuses:null!=E&&E.length?E:e.statuses,userIds:null!=S&&S.length?S:e.userIds,withOutputs:null!=N&&N.length?N:e.withOutputs,types:null!=x&&x.length?x:e.types})))}),[y,b,a,E,w,S,N,x]);const{dateRangePickerState:z,onRefreshChange:F,onTimeChange:R}=Object(f.f)(a),{error:U,data:_,isFetching:P,isFetched:Q,refetch:Y}=Object(r.b)({...k,startDate:z.startDate,endDate:z.endDate},{retry:!1}),$=Object(s.useMemo)((()=>{var e;return null!==(e=null==_?void 0:_.total)&&void 0!==e?e:0}),[_]),B=Object(s.useMemo)((()=>{var e;return null!==(e=null==_?void 0:_.data)&&void 0!==e?e:[]}),[null==_?void 0:_.data]);Object(s.useEffect)((()=>{var e,t;P||404!==(null==U||null===(e=U.body)||void 0===e?void 0:e.statusCode)||"index_not_found_exception"!==(null==U||null===(t=U.body)||void 0===t?void 0:t.message)?!P&&_&&(D(!1),d&&d(!0)):d&&d(!1)}),[_,U,P,d]);const G=Object(s.useCallback)((()=>{z.autoRefreshOptions.enabled&&Y()}),[z.autoRefreshOptions.enabled,Y]),q=Object(s.useCallback)((e=>{w((t=>({...t,commands:e})))}),[w]),W=Object(s.useCallback)((e=>{w((t=>({...t,statuses:e})))}),[w]),Z=Object(s.useCallback)((e=>{w((t=>({...t,types:e})))}),[w]),V=Object(s.useCallback)((e=>{w((t=>({...t,agentIds:e})))}),[w]),K=Object(s.useCallback)((e=>{w((t=>({...t,userIds:e})))}),[w]),X=Object(s.useCallback)((({page:e})=>{const{index:t,size:n}=e,s={page:t+1,pageSize:n};w((e=>({...e,...s}))),a||j({...s}),Y()}),[a,Y,w,j]),J=Object(s.useCallback)((e=>{w((t=>({...t,withOutputs:e}))),a||T(e.join())}),[a,T,w]);return 404===(null==U||null===(m=U.body)||void 0===m?void 0:m.statusCode)&&"index_not_found_exception"===(null==U||null===(g=U.body)||void 0===g?void 0:g.message)?o.a.createElement(C,{"data-test-subj":A("empty-state")}):P&&L?o.a.createElement(I.a,{"data-test-subj":A("global-loader")}):o.a.createElement(o.a.Fragment,null,o.a.createElement(O,{isFlyout:a,dateRangePickerState:z,isDataLoading:P,onClick:Y,onChangeHostsFilter:V,onChangeCommandsFilter:q,onChangeStatusesFilter:W,onChangeUsersFilter:K,onChangeTypeFilter:Z,onRefresh:G,onRefreshChange:F,onTimeChange:R,showHostsFilter:t,"data-test-subj":p}),Q&&!$?o.a.createElement(l.a,null,o.a.createElement(n.EuiFlexItem,{"data-test-subj":A("empty-prompt")},o.a.createElement(n.EuiEmptyPrompt,{iconType:"editorUnorderedList",titleSize:"s",title:o.a.createElement("h2",null,o.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.responseActionsList.empty.title",defaultMessage:"No results match your search criteria"})),body:o.a.createElement("p",null,o.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.responseActionsList.empty.body",defaultMessage:"Try modifying your search or filter set"})),"data-test-subj":"responseActions-empty"}))):o.a.createElement(H,{"data-test-subj":p,error:null!==U?u.g.fetchError:void 0,items:B,isFlyout:a,loading:P,onChange:X,onShowActionDetails:J,queryParams:k,showHostNames:t,totalItemCount:$}))}));$.displayName="ResponseActionsLog"},1497:function(e,t,a){"use strict";a.d(t,"a",(function(){return N}));var n=a(2),s=a.n(n),o=a(40),i=a(5),l=a(41),r=a.n(l);const u=(e,t)=>{const{id:a,agents:n}=e;if(t&&!n.includes(t))throw new Error(`Action [${a}] was not sent to agent id [${t}]`);return`${a}.${null!=t?t:n[0]}`};var c=a(706),d=a(1446),p=a(46),m=a(323),g=a(215),M=a(107);const j=Object.freeze({fontFamily:"inherit"}),y=i.i18n.translate("xpack.securitySolution.responseActionFileDownloadLink.downloadButtonLabel",{defaultMessage:"Click here to download"}),b=i.i18n.translate("xpack.securitySolution.responseActionFileDownloadLink.fileNoLongerAvailable",{defaultMessage:"File has expired and is no longer available for download."}),f=i.i18n.translate("xpack.securitySolution.responseActionFileDownloadLink.deleteNotice",{defaultMessage:"Files are periodically deleted to clear storage space. Download and save file locally if needed."}),E=i.i18n.translate("xpack.securitySolution.responseActionFileDownloadLink.passcodeInfo",{defaultMessage:"(ZIP file passcode: {passcode}).",values:{passcode:"elastic"}}),S=i.i18n.translate("xpack.securitySolution.responseActionFileDownloadLink.fileTruncated",{defaultMessage:"Output data in the provided zip file is truncated due to file size limitations."}),x=r.a.div.withConfig({displayName:"FileDownloadLinkContainer",componentId:"sc-1ipaklk-0"})(["& > *{vertical-align:middle;}"]),h=Object(n.memo)((({textSize:e,"data-test-subj":t})=>{const a=Object(n.useMemo)((()=>"xs"===e?"s":"m"),[e]);return s.a.createElement(s.a.Fragment,null,s.a.createElement(o.EuiSpacer,{size:"m"}),s.a.createElement(o.EuiFlexGroup,{gutterSize:"s",justifyContent:"flexStart",alignItems:"center"},s.a.createElement(o.EuiFlexItem,{grow:!1},s.a.createElement(o.EuiIcon,{size:a,type:"warning",color:"warning"})),s.a.createElement(o.EuiFlexItem,null,s.a.createElement(o.EuiText,{size:e,color:"warning","data-test-subj":t},S))))}));h.displayName="TruncatedTextInfo";const N=Object(n.memo)((({action:e,agentId:t,buttonTitle:a=y,canAccessFileDownloadLink:i,isTruncatedFile:l=!1,textSize:r="s","data-test-subj":S})=>{var N;const O=e,v=Object(M.a)(S),I=Object(n.useMemo)((()=>O.isCompleted&&O.wasSuccessful),[O.isCompleted,O.wasSuccessful]),T=Object(n.useMemo)((()=>`${Object(c.a)(g.a,{action_id:O.id,file_id:u(O,t)})}?apiVersion=2023-10-31`),[O,t]),{isFetching:A,data:L,error:D}=((e,t,a={})=>{const n=Object(m.g)();return Object(p.useQuery)({queryKey:["get-action-file-info",e.id,null!=t?t:e.agents[0]],...a,queryFn:()=>{const a=Object(c.a)(g.b,{action_id:e.id,file_id:u(e,t)});return n.get(a,{version:"2023-10-31"})}})})(O,void 0,{enabled:i&&I});return i&&O.isCompleted&&O.wasSuccessful?A?s.a.createElement(o.EuiSkeletonText,{lines:1,"data-test-subj":v("loading")}):D&&404===(null==D||null===(N=D.response)||void 0===N?void 0:N.status)||"DELETED"===(null==L?void 0:L.data.status)?s.a.createElement(o.EuiText,{size:r,color:"warning","data-test-subj":v("fileNoLongerAvailable")},b):D?s.a.createElement(d.a,{error:D,"data-test-subj":v("apiError")}):s.a.createElement(x,{"data-test-subj":S},s.a.createElement(o.EuiButtonEmpty,{href:T,iconType:"download","data-test-subj":v("downloadButton"),flush:"left",style:j,iconSize:"s",download:!0},s.a.createElement(o.EuiText,{size:r},a)),s.a.createElement(o.EuiText,{size:r,"data-test-subj":v("passcodeMessage"),className:"eui-displayInline"},E),s.a.createElement(o.EuiText,{size:r,color:"warning","data-test-subj":v("fileDeleteMessage")},f),l&&s.a.createElement(h,{textSize:r,"data-test-subj":v("fileTruncatedMessage")})):null}));N.displayName="ResponseActionFileDownloadLink"},1531:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(5);const s=Object.freeze({"ra_get-file_error_not-found":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.notFound",{defaultMessage:"The file specified was not found"}),"ra_get-file_error_is-directory":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.isDirectory",{defaultMessage:"The path defined is not a file"}),"ra_get-file_error_invalid-input":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.invalidPath",{defaultMessage:"The path defined is not valid"}),"ra_get-file_error_not-permitted":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.notPermitted",{defaultMessage:"Endpoint unable to read file requested (not permitted)"}),"ra_get-file_error_too-big":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.tooBig",{defaultMessage:"The file requested is too large and can not be retrieved"}),"ra_get-file_error_disk-quota":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.diskQuota",{defaultMessage:"Endpoint ran out of disk quota while attempting to retrieve file"}),"ra_get-file_error_processing":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.errorProcessing",{defaultMessage:"File retrieval was interrupted"}),"ra_get-file_error_upload-api-unreachable":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.uploadApiUnreachable",{defaultMessage:"File upload api (fleet-server) is unreachable"}),"ra_get-file_error_upload-timeout":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.uploadTimeout",{defaultMessage:"File upload timed out"}),"ra_get-file_error_queue-timeout":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.getFile.queueTimeout",{defaultMessage:"Endpoint timed out while attempting to connect to upload API"}),"ra_suspend-process_error_not-found":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.suspendProcess.notFoundError",{defaultMessage:"The provided process was not found"}),"ra_suspend-process_error_not-permitted":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.suspendProcess.notPermittedSuccess",{defaultMessage:"The provided process cannot be suspended"}),"ra_kill-process_error_not-found":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.killProcess.notFoundError",{defaultMessage:"The provided process was not found"}),"ra_kill-process_success_no-action":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.killProcess.noActionSuccess",{defaultMessage:"Action completed. The provided process was not found or already killed"}),"ra_kill-process_error_not-permitted":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.killProcess.notPermittedSuccess",{defaultMessage:"The provided process cannot be killed"}),ra_execute_error_processing:n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.processingError",{defaultMessage:"Unable to create execution output zip file."}),"ra_execute_error_processing-timeout":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.processingTimeout",{defaultMessage:"Command execution was terminated. It exceeded the provided timeout."}),"ra_execute_error_processing-interrupted":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.processingInterrupted",{defaultMessage:"Command execution was absolutely interrupted."}),"ra_execute_error_to-many-requests":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.toManyRequests",{defaultMessage:"Too many concurrent command execution actions."}),ra_execute_error_failure:n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.failure",{defaultMessage:"Unknown failure while executing command."}),"ra_execute_error_disk-quota":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.diskQuotaError",{defaultMessage:"Too many pending command execution output zip files."}),"ra_execute_error_upload-api-unreachable":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.uploadApiUnreachable",{defaultMessage:"Failed to upload command execution output zip file. Unable to reach Fleet Server upload API."}),"ra_execute_error_upload-timeout":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.outputUploadTimeout",{defaultMessage:"Failed to upload command execution output zip file. Upload timed out"}),"ra_execute_error_queue-timeout":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.execute.queueTimeout",{defaultMessage:"Failed to upload command execution output zip file. Timed out while queued waiting for Fleet Server"}),ra_upload_error_failure:n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.failure",{defaultMessage:"Upload failed"}),"ra_upload_already-exists":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.fileAlreadyExists",{defaultMessage:'File with this name already exists. Use "--overwrite" argument if wanting to overwrite it'}),"ra_upload_error_not-found":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.fileNotFound",{defaultMessage:"Failed to retrieve file. File was not found (404)"}),"ra_upload_error_not-permitted":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.fileAccessForbidden",{defaultMessage:"Failed to retrieve file. Access is forbidden (403) or unauthorized (401)"}),"ra_upload_error_too-big":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.fileTooLarge",{defaultMessage:"Failed to save file. Size exceeds max allowed"}),"ra_upload_error_queue-timeout":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.timeout",{defaultMessage:"Attempts to retrieve file failed due to timeout"}),"ra_upload_error_download-failed":n.i18n.translate("xpack.securitySolution.endpointActionResponseCodes.upload.fileCorruption",{defaultMessage:"Failed to save file to disk or validate its integrity"})})},1532:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(5);const s=e=>n.i18n.translate("xpack.securitySolution.endpoint.list.hostStatusValue",{defaultMessage:"{hostStatus, select, healthy {Healthy} unhealthy {Unhealthy} updating {Updating} offline {Offline} inactive {Inactive} unenrolled {Unenrolled} other {Unhealthy}}",values:{hostStatus:e}})},1533:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(2),s=a.n(n),o=a(40);const i=Object(n.memo)((({color:e,status:t,"data-test-subj":a})=>s.a.createElement(o.EuiBadge,{"data-test-subj":a,color:e},t)));i.displayName="StatusBadge"},1539:function(e,t,a){"use strict";a.d(t,"a",(function(){return E}));var n=a(40),s=a(2),o=a.n(s),i=a(793),l=a(1497),r=a(5),u=a(61),c=a(107),d=a(117);const p=Object(d.e)(),m=Object.freeze({context:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.executionContext",{defaultMessage:"Execution context"}),output:{regular:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.outputButtonTextRegular",{defaultMessage:"Execution output"}),truncated:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.outputButtonTextTruncated",{defaultMessage:"Execution output (truncated)"})},error:{regular:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.errorButtonTextRegular",{defaultMessage:"Execution error"}),truncated:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.errorButtonTextTruncated",{defaultMessage:"Execution error (truncated)"})}}),g=Object.freeze({shell:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.shellInformation",{defaultMessage:"Shell"}),returnCode:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.shellReturnCode",{defaultMessage:"Return code"}),currentDir:r.i18n.translate("xpack.securitySolution.responseActionExecuteAccordion.currentWorkingDirectory",{defaultMessage:"Executed from"})}),M=r.i18n.translate("xpack.securitySolution.responseActionFileDownloadLink.fileTruncated",{defaultMessage:"Output data in the provided zip file is truncated due to file size limitations."}),j=Object(u.euiStyled)(n.EuiText)` white-space: pre-wrap; line-break: anywhere; `,y=Object(s.memo)((({content:e,textSize:t,title:a})=>o.a.createElement(j,{size:t},o.a.createElement("strong",null,a,": "),e)));y.displayName="ShellInfoContent";const b=Object(s.memo)((({content:e=p,initialIsOpen:t=!1,isTruncated:a=!1,isFileTruncated:i=!1,textSize:l,type:r,"data-test-subj":u})=>{const d=Object(c.a)(u),g=Object(n.useGeneratedHtmlId)({prefix:"executeActionOutputAccordions",suffix:r}),y=Object(s.useMemo)((()=>o.a.createElement(n.EuiText,{size:l,"data-test-subj":d("title")},"context"!==r?a?m[r].truncated:m[r].regular:m[r])),[d,a,l,r]);return o.a.createElement(n.EuiAccordion,{id:g,initialIsOpen:t,buttonContent:y,paddingSize:"s","data-test-subj":u},o.a.createElement(j,{size:l},i&&o.a.createElement(o.a.Fragment,null,o.a.createElement(n.EuiTextColor,{color:"warning","data-test-subj":d("fileTruncatedMsg")},M),o.a.createElement(n.EuiSpacer,{size:"m"})),"string"==typeof e?o.a.createElement("p",null,e):e))}));b.displayName="ExecutionActionOutputAccordion";const f=Object(s.memo)((({outputContent:e,"data-test-subj":t,textSize:a="xs"})=>{const i=Object(s.useMemo)((()=>o.a.createElement(o.a.Fragment,null,o.a.createElement(n.EuiFlexGroup,{gutterSize:"m","data-test-subj":`${t}-shell`},o.a.createElement(n.EuiFlexItem,{grow:!1},o.a.createElement(y,{title:g.shell,content:e.shell,textSize:a})),o.a.createElement(n.EuiFlexItem,{grow:!1},o.a.createElement(y,{title:g.returnCode,content:e.shell_code,textSize:a}))),o.a.createElement("div",{"data-test-subj":`${t}-cwd`},o.a.createElement(n.EuiSpacer,{size:"m"}),o.a.createElement(y,{title:g.currentDir,content:e.cwd,textSize:a})))),[t,e.cwd,e.shell,e.shell_code,a]);return o.a.createElement(o.a.Fragment,null,o.a.createElement(n.EuiFlexItem,null,o.a.createElement(b,{content:i,"data-test-subj":`${t}-context`,textSize:a,type:"context"})),o.a.createElement(n.EuiFlexItem,null,e.stderr.length>0&&o.a.createElement(o.a.Fragment,null,o.a.createElement(n.EuiSpacer,{size:"m"}),o.a.createElement(b,{content:e.stderr.length?e.stderr:void 0,"data-test-subj":`${t}-error`,isTruncated:e.stderr_truncated,isFileTruncated:e.output_file_stderr_truncated,textSize:a,initialIsOpen:!0,type:"error"})),o.a.createElement(n.EuiSpacer,{size:"m"}),o.a.createElement(b,{content:e.stdout.length?e.stdout:void 0,"data-test-subj":`${t}-output`,isTruncated:e.stdout_truncated,isFileTruncated:e.output_file_stdout_truncated,initialIsOpen:!0,textSize:a,type:"output"})))}));f.displayName="ExecuteActionHostResponseOutput";const E=Object(s.memo)((({action:e,agentId:t=e.agents[0],canAccessFileDownloadLink:a,textSize:r="s","data-test-subj":u})=>{const c=Object(s.useMemo)((()=>e.outputs&&e.outputs[t]&&e.outputs[t].content),[e.outputs,t]);return o.a.createElement(o.a.Fragment,null,o.a.createElement(n.EuiFlexItem,null,o.a.createElement(l.a,{action:e,buttonTitle:i.b,canAccessFileDownloadLink:a,"data-test-subj":`${u}-getExecuteLink`,textSize:r}),o.a.createElement(n.EuiSpacer,{size:"xxl"})),c&&o.a.createElement(f,{outputContent:c,"data-test-subj":`${u}-executeResponseOutput`,textSize:r}))}));E.displayName="ExecuteActionHostResponse"},1543:function(e,t,a){"use strict";a.d(t,"a",(function(){return M}));var n=a(41),s=a.n(n),o=a(44),i=a(2),l=a.n(i),r=a(40),u=a(5),c=a(55),d=a.n(c),p=(a(21),a(1544)),m=a(107);const g=Object.freeze({path:u.i18n.translate("xpack.securitySolution.endpointUploadActionResult.savedTo",{defaultMessage:"File saved to"}),disk_free_space:u.i18n.translate("xpack.securitySolution.endpointUploadActionResult.freeDiskSpace",{defaultMessage:"Free disk space on drive"}),noAgentResponse:u.i18n.translate("xpack.securitySolution.endpointUploadActionResult.missingAgentResult",{defaultMessage:"Error: Agent result missing"}),host:u.i18n.translate("xpack.securitySolution.endpointUploadActionResult.host",{defaultMessage:"Host"})}),M=Object(i.memo)((({action:e,agentId:t,textSize:a="s","data-test-subj":n})=>{const s=e,u=Object(m.a)(n),c=Object(i.useMemo)((()=>{const e=[],a=t?[t]:s.agents;for(const t of a){var n;e.push({name:s.hosts[t].name,state:s.agentState[t],result:null===(n=s.outputs)||void 0===n?void 0:n[t]})}return e}),[s.agentState,s.agents,s.hosts,s.outputs,t]),M=c.length>1;return"upload"!==s.command?(window.console.warn("EndpointUploadActionResult: called with a non-upload action"),l.a.createElement(l.a.Fragment,null)):0===c.length?(window.console.warn(`EndpointUploadActionResult: Agent id [${t}] not in list of agents for action`),l.a.createElement(l.a.Fragment,null)):l.a.createElement(r.EuiText,{"data-test-subj":u(),size:a},c.map((({name:e,state:t,result:a})=>t.isCompleted?a?t.wasSuccessful?l.a.createElement(y,{name:M?e:void 0,"data-test-subj":u("success"),key:e},l.a.createElement(j,{name:g.path,value:a.content.path}),l.a.createElement(j,{name:g.disk_free_space,value:d()(a.content.disk_free_space).format("0.00b")})):l.a.createElement(y,{name:M?e:void 0,"data-test-subj":u("actionFailure"),key:e},l.a.createElement(p.a,{action:s})):l.a.createElement(y,{name:M?e:void 0,"data-test-subj":u("noResultError"),key:e},g.noAgentResponse):l.a.createElement(y,{name:M?e:void 0,"data-test-subj":u("pending"),key:e},l.a.createElement(o.FormattedMessage,{id:"xpack.securitySolution.endpointUploadActionResult.pendingMessage",defaultMessage:"Action pending."})))))}));M.displayName="EndpointUploadActionResult";const j=Object(i.memo)((({name:e,value:t})=>l.a.createElement(b,{className:"eui-textBreakWord"},l.a.createElement("strong",null,e,": "),t)));j.displayName="KeyValueDisplay";const y=Object(i.memo)((({name:e,children:t,"data-test-subj":a})=>l.a.createElement("div",{"data-test-subj":a},e&&l.a.createElement(j,{name:g.host,value:e}),t,e&&l.a.createElement(r.EuiSpacer,null))));y.displayName="HostUploadResult";var b=s()("div").withConfig({displayName:"_StyledDiv",componentId:"sc-f4sf5g-0"})(["white-space:pre-wrap;"])},1544:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(2),s=a.n(n),o=a(40),i=a(44),l=a(5),r=a(1531);const u=Object(n.memo)((({action:e,"data-test-subj":t})=>Object(n.useMemo)((()=>{if(!e.isCompleted||e.wasSuccessful)return null;const a=[];if(e.outputs)for(const t of e.agents){const n=e.outputs[t];n&&"json"===n.type&&n.content.code&&r.a[n.content.code]&&a.push(r.a[n.content.code])}return a.length||(e.errors?a.push(...e.errors):a.push(l.i18n.translate("xpack.securitySolution.endpointActionFailureMessage.unknownFailure",{defaultMessage:"Action failed"}))),s.a.createElement("div",{"data-test-subj":t},s.a.createElement(i.FormattedMessage,{id:"xpack.securitySolution.endpointResponseActions.actionError.errorMessage",defaultMessage:"The following { errorCount, plural, =1 {error was} other {errors were}} encountered:",values:{errorCount:a.length}}),s.a.createElement(o.EuiSpacer,{size:"s"}),s.a.createElement("div",null,a.join(" | ")))}),[e.agents,e.errors,e.isCompleted,e.outputs,e.wasSuccessful,t])));u.displayName="EndpointActionFailureMessage"},1606:function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDMwNC45OTggMzA0Ljk5OCI+PHBhdGggZD0iTTI3NC42NTkgMjQ0Ljg4OGMtOC45NDQtMy42NjMtMTIuNzctOC41MjQtMTIuNC0xNS43NzcuMzgxLTguNDY2LTQuNDIyLTE0LjY2Ny02LjcwMy0xNy4xMTcgMS4zNzgtNS4yNjQgNS40MDUtMjMuNDc0LjAwNC0zOS4yOTEtNS44MDQtMTYuOTMtMjMuNTI0LTQyLjc4Ny00MS44MDgtNjguMjA0LTcuNDg1LTEwLjQzOC03LjgzOS0yMS43ODQtOC4yNDgtMzQuOTIyLS4zOTItMTIuNTMxLS44MzQtMjYuNzM1LTcuODIyLTQyLjUyNUMxOTAuMDg0IDkuODU5IDE3NC44MzggMCAxNTUuODUxIDB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UgNjYuMDg0LTExOS45MDcgNjkuMDcyLTEyMS44MzItMzcuNTk1LTU0Ljk5My05Ni4xNjctNjIuNTUyLTExNy4wMzctNjMuNDAyLTQ5Ljg0My01LjAzMi05Ny4yNDIgMjkuMzYyLTEyMi41NjUgMjkuMzYyLTI1LjI1MyAwLTY0LjI3Ny0yOC42MDctMTA1LjYwNC0yNy44NS01NC4zMi44MDMtMTA0LjQgMzEuNTk0LTEzMi40MDMgODAuMjQ1QzI5LjgxIDMzNC40NTcgNzEuODEgNDc5LjU4IDEyNi44MTYgNTU4Ljk3NmMyNi44NyAzOC44ODIgNTguOTE0IDgyLjU2IDEwMC45OTcgODEgNDAuNTEyLTEuNTk0IDU1Ljg0My0yNi4yNDQgMTA0Ljg0OC0yNi4yNDQgNDguOTkzIDAgNjIuNzUzIDI2LjI0NSAxMDUuNjQgMjUuNDA2IDQzLjYwNi0uODAzIDcxLjIzMi0zOS42MzggOTcuOTI1LTc4LjY1IDMwLjg4Ny00NS4xMiA0My41NDgtODguNzUgNDQuMzE2LTkwLjk5NC0uOTY5LS40MzctODUuMDI5LTMyLjYzNC04NS44NzktMTI5LjQzOWwuMTE4LS4wMzV6TTQxNC4yMyAxMDIuMTc4QzQzNi41NTMgNzUuMDk1IDQ1MS42MzYgMzcuNSA0NDcuNTE0LS4wMjRjLTMyLjE2MiAxLjMxMS03MS4xNjMgMjEuNDM3LTk0LjI1MyA0OC40ODUtMjAuNzI5IDI0LjAxMi0zOC44MzYgNjIuMjgtMzMuOTkzIDk5LjAzNiAzNS45MTggMi44IDcyLjU5MS0xOC4yNDggOTQuOTI2LTQ1LjI3MmwuMDM2LS4wNDd6Ii8+PC9zdmc+Cg=="},173:function(e,t,a){"use strict";a.d(t,"h",(function(){return o})),a.d(t,"k",(function(){return i})),a.d(t,"n",(function(){return l})),a.d(t,"q",(function(){return r})),a.d(t,"m",(function(){return u})),a.d(t,"o",(function(){return c})),a.d(t,"l",(function(){return d})),a.d(t,"p",(function(){return p})),a.d(t,"s",(function(){return m})),a.d(t,"i",(function(){return g})),a.d(t,"j",(function(){return M})),a.d(t,"g",(function(){return j})),a.d(t,"r",(function(){return y})),a.d(t,"u",(function(){return b})),a.d(t,"v",(function(){return f})),a.d(t,"t",(function(){return E})),a.d(t,"f",(function(){return S})),a.d(t,"b",(function(){return x})),a.d(t,"c",(function(){return h})),a.d(t,"e",(function(){return N})),a.d(t,"d",(function(){return O})),a.d(t,"a",(function(){return v}));var n=a(4),s=a(1035);const o=`${n.Ib}/:tabName(${s.a.endpoints})`,i=`${n.Ib}/:tabName(${s.a.policies})`,l=`${n.Ib}/:tabName(${s.a.policies})/:policyId/settings`,r=`${n.Ib}/:tabName(${s.a.policies})/:policyId/trustedApps`,u=`${n.Ib}/:tabName(${s.a.policies})/:policyId/eventFilters`,c=`${n.Ib}/:tabName(${s.a.policies})/:policyId/hostIsolationExceptions`,d=`${n.Ib}/:tabName(${s.a.policies})/:policyId/blocklists`,p=`${n.Ib}/:tabName(${s.a.policies})/:policyId`,m=`${n.Ib}/:tabName(${s.a.trustedApps})`,g=`${n.Ib}/:tabName(${s.a.eventFilters})`,M=`${n.Ib}/:tabName(${s.a.hostIsolationExceptions})`,j=`${n.Ib}/:tabName(${s.a.blocklist})`,y=`${n.Ib}/:tabName(${s.a.responseActionsHistory})`,b="management",f="policyDetails",E="endpoints",S=[10,20,50],x=0,h=10,N="desc",O="created_at",v=1e4},290:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(2),s=a(478),o=a(45);function i(){const{search:e}=Object(o.useLocation)();return Object(n.useMemo)((()=>{const t=Object(s.parse)(e);return{urlParams:t,toUrlParams:(e=t)=>Object(s.stringify)(e)}}),[e])}},693:function(e,t,a){"use strict";a.d(t,"c",(function(){return l})),a.d(t,"d",(function(){return z})),a.d(t,"b",(function(){return F})),a.d(t,"a",(function(){return R}));var n=a(46),s=a(706),o=a(102),i=a(215);const l=(e,t={})=>{const a=Object(o.i)();return Object(n.useQuery)({queryKey:["get-endpoint-host-info",e],...t,queryFn:()=>a.get(Object(s.a)(i.p,{id:e.trim()||"undefined"}),{version:"2023-10-31"})})};var r=a(2),u=a.n(r),c=a(5),d=a(126),p=a(938),m=a(40),g=a(44),M=a(1494),j=a(793);const y=Object(r.memo)((e=>{const[t,a]=Object(r.useState)(!1),n=Object(r.useCallback)((()=>{a((e=>!e))}),[]);return u.a.createElement(u.a.Fragment,null,u.a.createElement(m.EuiButton,{onClick:n,disabled:t,iconType:"list","data-test-subj":"responderShowActionLogButton"},u.a.createElement(g.FormattedMessage,{id:"xpack.securitySolution.responseActionsHistoryButton.label",defaultMessage:"Response actions history"})),t&&u.a.createElement(m.EuiFlyout,{onClose:n,size:"m",paddingSize:"l","data-test-subj":"responderActionLogFlyout"},u.a.createElement(m.EuiFlyoutHeader,{hasBorder:!0},u.a.createElement(m.EuiTitle,{size:"m"},u.a.createElement("h1",null,j.g.flyoutTitle(e.meta.endpoint.host.hostname)))),u.a.createElement(m.EuiFlyoutBody,null,u.a.createElement(M.a,{agentIds:e.meta.endpoint.agent.id}))))}));y.displayName="ActionLogButton";var b=a(61),f=a(889),E=a(1477),S=a(1606),x=a.n(S),h=a(1607),N=a.n(h),O=a(1608),v=a.n(O);const I=Object(r.memo)((({platform:e,size:t="xl","data-test-subj":a})=>{const n=Object(r.useMemo)((()=>(e=>{switch(e){case"macos":return v.a;case"linux":return x.a;case"windows":return N.a;default:return null}})(e)),[e]);return u.a.createElement(m.EuiIcon,{type:n||"empty",title:e,size:t,"data-test-subj":a})}));I.displayName="PlatformIcon";const T=b.euiStyled.div` height: 100%; display: flex; align-items: center; justify-content: center; `,A=Object(r.memo)((({endpointId:e})=>{const{data:t,isFetching:a}=l(e,{refetchInterval:1e4}),{data:n}=Object(E.a)([e],{refetchInterval:1e4});return a&&void 0===n?u.a.createElement(m.EuiSkeletonText,{lines:2}):t?u.a.createElement(m.EuiFlexGroup,{gutterSize:"s"},u.a.createElement(m.EuiFlexItem,{grow:!1},u.a.createElement(T,null,u.a.createElement(I,{"data-test-subj":"responderHeaderEndpointPlatformIcon",platform:t.metadata.host.os.name.toLowerCase()}))),u.a.createElement(m.EuiFlexItem,{grow:!1},u.a.createElement(m.EuiFlexGroup,{direction:"column",gutterSize:"none"},u.a.createElement(m.EuiFlexItem,{grow:!1},u.a.createElement(m.EuiFlexGroup,{alignItems:"center",gutterSize:"xs"},u.a.createElement(m.EuiFlexItem,{grow:!1,className:"eui-textTruncate"},u.a.createElement(m.EuiToolTip,{content:t.metadata.host.name,anchorClassName:"eui-textTruncate"},u.a.createElement(m.EuiText,{size:"s","data-test-subj":"responderHeaderEndpointName"},u.a.createElement("h6",{className:"eui-textTruncate"},t.metadata.host.name)))),u.a.createElement(m.EuiFlexItem,{grow:!1},u.a.createElement(f.a,{endpointHostInfo:t,"data-test-subj":"responderHeaderEndpointAgentIsolationStatus"})))),u.a.createElement(m.EuiFlexItem,{grow:!1},u.a.createElement(m.EuiSpacer,{size:"xs"}),u.a.createElement(m.EuiText,{color:"subdued",size:"s","data-test-subj":"responderHeaderLastSeen"},u.a.createElement(g.FormattedMessage,{id:"xpack.securitySolution.responder.header.lastSeen",defaultMessage:"Last seen {date}",values:{date:u.a.createElement(g.FormattedRelative,{value:t.last_checkin})}})))))):null}));A.displayName="HeaderEndpointInfo";var L=a(185);const D=Object(r.memo)((({endpointId:e})=>{const{data:t}=l(e,{refetchInterval:1e4});return t&&t.host_status===L.c.OFFLINE?u.a.createElement(u.a.Fragment,null,u.a.createElement(m.EuiCallOut,{iconType:"offline",color:"warning","data-test-subj":"offlineCallout",title:c.i18n.translate("xpack.securitySolution.responder.hostOffline.callout.title",{defaultMessage:"Host Offline"})},u.a.createElement("p",null,u.a.createElement(g.FormattedMessage,{id:"xpack.securitySolution.responder.hostOffline.callout.body",defaultMessage:"The host {name} is offline, so its responses may be delayed. Pending commands will execute when the host reconnects.",values:{name:u.a.createElement("strong",null,t.metadata.host.name)}}))),u.a.createElement(m.EuiSpacer,{size:"m"})):null}));D.displayName="OfflineCallout",a(865);var C=a(1076),k=a(1065);const w=c.i18n.translate("xpack.securitySolution.responder_overlay.pageTitle",{defaultMessage:"Response console"}),z=()=>{const e=Object(C.b)(),t=Object(d.a)().endpointPrivileges;return Object(r.useCallback)((a=>{if(!t.canAccessResponseConsole)return void window.console.error(new Error("Access denied to endpoint response actions console"));const n=a.agent.id,s=e.getOne(n);var o;s?s.show():e.register({id:n,meta:{endpoint:a},consoleProps:{commands:Object(p.a)({endpointAgentId:n,endpointCapabilities:null!==(o=a.Endpoint.capabilities)&&void 0!==o?o:[],endpointPrivileges:t}),"data-test-subj":"endpointResponseActionsConsole",storagePrefix:"xpack.securitySolution.Responder",TitleComponent:()=>u.a.createElement(A,{endpointId:n})},PageTitleComponent:()=>u.a.createElement(u.a.Fragment,null,w),PageBodyComponent:()=>u.a.createElement(u.a.Fragment,null,u.a.createElement(D,{endpointId:n}),u.a.createElement(k.a,null)),ActionComponents:t.canReadActionsLogManagement?[y]:void 0}).show()}),[t,e])},F=(e,t={})=>{const a=Object(o.i)();let s=e.userIds;return"string"==typeof e.userIds?s=`*${e.userIds}*`:Array.isArray(e.userIds)&&(s=e.userIds.map((e=>`*${e}*`))),Object(n.useQuery)({queryKey:["get-action-list",e],...t,keepPreviousData:!0,queryFn:async()=>a.get(i.f,{version:"2023-10-31",query:{agentIds:e.agentIds,commands:e.commands,endDate:e.endDate,page:e.page,pageSize:e.pageSize,startDate:e.startDate,statuses:e.statuses,userIds:s,withOutputs:e.withOutputs,types:e.types}})})},R=()=>{const e=Object(o.i)();return Object(n.useQuery)({queryKey:["get-action-state"],queryFn:()=>e.get(i.d,{version:"2023-10-31"})})}},702:function(e,t,a){"use strict";a.d(t,"a",(function(){return g})),a.d(t,"f",(function(){return M})),a.d(t,"b",(function(){return j})),a.d(t,"d",(function(){return y})),a.d(t,"c",(function(){return b})),a.d(t,"e",(function(){return f}));var n=a(2),s=a.n(n),o=a(29),i=a(493),l=a(793),r=a(1533),u=a(1478),c=a(46),d=a(102),p=a(215);const m=Object.freeze({default:50,all:1e4}),g=Object.freeze({autoRefreshOptions:{enabled:!1,duration:1e4},startDate:"now-24h/h",endDate:"now",recentlyUsedDateRanges:[]}),M=e=>{const{setUrlDateRangeFilters:t,startDate:a,endDate:s}=Object(u.a)(),[o,i]=Object(n.useState)({...g,startDate:e?g.startDate:null!=a?a:g.startDate,endDate:e?g.endDate:null!=s?s:g.endDate}),l=Object(n.useCallback)((({start:e,end:t})=>{i((a=>({...a,startDate:e,endDate:t})))}),[i]),r=Object(n.useCallback)((e=>{i((t=>({...t,recentlyUsedDateRanges:e})))}),[i]),c=Object(n.useCallback)((e=>{i((t=>({...t,autoRefreshOptions:{enabled:!e.isPaused,duration:e.refreshInterval}})))}),[i]),d=Object(n.useCallback)((({start:a,end:n})=>{l({start:a,end:n});const s=[{start:a,end:n},...o.recentlyUsedDateRanges.filter((e=>!(e.start===a&&e.end===n))).slice(0,9)];r(s),e||t({startDate:a,endDate:n})}),[o.recentlyUsedDateRanges,e,t,l,r]);return{dateRangePickerState:o,onRefreshChange:c,onTimeChange:d}},j=e=>"failed"===e?l.g.badge.failed:"successful"===e?l.g.badge.successful:"pending"===e?l.g.badge.pending:"",y=e=>"unisolate"===e?"release":"running-processes"===e?"processes":e,b=e=>"release"===e?"unisolate":"processes"===e?"running-processes":e,f=({filterName:e,isFlyout:t,isPopoverOpen:a,searchString:l})=>{const{commands:g,statuses:M,hosts:f,types:S=[],setUrlActionsFilters:x,setUrlHostsFilters:h,setUrlStatusesFilters:N,setUrlTypeFilters:O}=Object(u.a)(),v="statuses"===e,I="hosts"===e,T="type"===e,{data:A,isFetching:L}=(({searchString:e,selectedAgentIds:t,options:a={}})=>{const n=Object(d.i)(),s=`united.endpoint.host.hostname:${e.length?`*${e}`:""}*`;let o=[];return t&&(o=t.map((e=>`united.endpoint.agent.id:"${e}"`))),Object(c.useQuery)({queryKey:["get-endpoints-list",s],...a,queryFn:async()=>{const e=(await n.get(p.q,{version:"2023-10-31",query:{page:0,pageSize:t&&t.length>0?m.all:m.default,kuery:[...o,s].join(" or ")}})).data.reduce(((e,a)=>{const n={id:a.metadata.agent.id,name:a.metadata.host.hostname};return null!=t&&t.includes(a.metadata.agent.id)?e.selected.push({...n,selected:!0}):e.rest.push({...n,selected:!1}),e}),{selected:[],rest:[]});let a=0;return t&&(a=t.length),[...e.selected,...e.rest].slice(0,a>=m.default?a+10:m.default)}})})({searchString:l,selectedAgentIds:f}),[D,C]=Object(n.useState)(!1);Object(n.useEffect)((()=>{f&&f.length>0&&C(!0)}),[]);const[k,w]=Object(n.useState)(T?i.e.map((a=>({key:a,label:E(a),checked:!t&&null!=S&&S.includes(a)?"on":void 0,"data-test-subj":`${e}-filter-option`}))):v?i.d.map((a=>({key:a,label:s.a.createElement(r.a,{color:"successful"===a?"success":"failed"===a?"danger":"warning",status:j(a)}),checked:!t&&null!=M&&M.includes(a)?"on":void 0,"data-test-subj":`${e}-filter-option`}))):I?[]:i.b.filter((e=>{const t=o.a.get();return!("upload"===e&&!t.responseActionUploadEnabled)})).map((a=>({key:a,label:y(a),checked:!t&&null!=g&&g.map((e=>b(e))).includes(a)?"on":void 0,"data-test-subj":`${e}-filter-option`}))));Object(n.useEffect)((()=>{I&&A&&w(null==A?void 0:A.map((a=>({key:a.id,label:a.name,checked:!t&&a.selected?"on":void 0,"data-test-subj":`${e}-filter-option`}))))}),[A,e,t,I,w]);const z=Object(n.useMemo)((()=>!!k.find((e=>"on"===e.checked))),[k]),F=Object(n.useMemo)((()=>k.filter((e=>"on"===e.checked)).length),[k]),R=Object(n.useMemo)((()=>k.filter((e=>"on"!==e.checked)).length),[k]);return{areHostsSelectedOnMount:D,isLoading:I&&L,items:k,setItems:w,hasActiveFilters:z,numActiveFilters:F,numFilters:R,setAreHostsSelectedOnMount:C,setUrlActionsFilters:x,setUrlHostsFilters:h,setUrlStatusesFilters:N,setUrlTypeFilters:O}},E=e=>"automated"===e?l.d.automated:l.d.manual},720:function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),a.d(t,"b",(function(){return r}));var n=a(2),s=a(45),o=a(173),i=a(290);const l=e=>{var t,a,n;const s={pageSize:o.c,page:1};return s.page=Number(null!==(t=Array.isArray(e.page)?e.page[e.page.length-1]:e.page)&&void 0!==t?t:s.page),s.pageSize=null!==(a=Number(null!==(n=Array.isArray(e.pageSize)?e.pageSize[e.pageSize.length-1]:e.pageSize)&&void 0!==n?n:s.pageSize))&&void 0!==a?a:s.pageSize,(!Number.isFinite(s.page)||s.page<1)&&(s.page=1),o.f.includes(s.pageSize)||(s.pageSize=o.c),s},r=()=>{const e=Object(s.useLocation)(),t=Object(s.useHistory)(),{urlParams:a,toUrlParams:r}=Object(i.a)(),u=Object(n.useMemo)((()=>l(a)),[a]),[c,d]=Object(n.useState)(u),p=Object(n.useCallback)((({pageSize:n,page:s})=>{t.push({...e,search:r({...a,page:s,pageSize:n})})}),[t,e,r,a]);return Object(n.useEffect)((()=>{d((e=>({...e,...l(a)})))}),[d,a]),{pagination:c,setPagination:p,pageSizeOptions:[...o.f]}}},793:function(e,t,a){"use strict";a.d(t,"e",(function(){return s})),a.d(t,"f",(function(){return o})),a.d(t,"g",(function(){return i})),a.d(t,"c",(function(){return l})),a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return u})),a.d(t,"d",(function(){return c}));var n=a(5);const s=Object.freeze({hasExpired:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.hasExpired",{defaultMessage:"{command} failed: action expired",values:{command:e}}),wasSuccessful:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.wasSuccessful",{defaultMessage:"{command} completed successfully",values:{command:e}}),isPending:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.isPending",{defaultMessage:"{command} is pending",values:{command:e}}),hasFailed:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.hasFailed",{defaultMessage:"{command} failed",values:{command:e}}),expandSection:{placedAt:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.placedAt",{defaultMessage:"Command placed"}),input:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.input",{defaultMessage:"Input"}),output:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.output",{defaultMessage:"Output"}),startedAt:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.startedAt",{defaultMessage:"Execution started on"}),parameters:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.parameters",{defaultMessage:"Parameters"}),completedAt:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.completedAt",{defaultMessage:"Execution completed"}),comment:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.comment",{defaultMessage:"Comment"}),hostname:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.expandSection.hostname",{defaultMessage:"Hostname"})}}),o=Object.freeze({time:n.i18n.translate("xpack.securitySolution.responseActionsList.list.time",{defaultMessage:"Time"}),command:n.i18n.translate("xpack.securitySolution.responseActionsList.list.command",{defaultMessage:"Command"}),user:n.i18n.translate("xpack.securitySolution.responseActionsList.list.user",{defaultMessage:"User"}),hosts:n.i18n.translate("xpack.securitySolution.responseActionsList.list.hosts",{defaultMessage:"Hosts"}),comments:n.i18n.translate("xpack.securitySolution.responseActionsList.list.comments",{defaultMessage:"Comments"}),status:n.i18n.translate("xpack.securitySolution.responseActionsList.list.status",{defaultMessage:"Status"}),rule:n.i18n.translate("xpack.securitySolution.responseActionsList.list.rule",{defaultMessage:"Rule"})}),i=Object.freeze({flyoutTitle:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.flyout.title",{defaultMessage:"Response actions history : {hostname}",values:{hostname:e}}),pageSubTitle:n.i18n.translate("xpack.securitySolution.responseActionsList.list.pageSubTitle",{defaultMessage:"View the history of response actions performed on hosts."}),fetchError:n.i18n.translate("xpack.securitySolution.responseActionsList.list.errorMessage",{defaultMessage:"Error while retrieving response actions"}),filterClearAll:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.clearAll",{defaultMessage:"Clear all"}),filterSearchPlaceholder:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.searchPlaceholder",{defaultMessage:"Search {filterName}",values:{filterName:e}}),filterEmptyMessage:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.emptyMessage",{defaultMessage:"No {filterName} available",values:{filterName:e}}),badge:{successful:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.badge.successful",{defaultMessage:"Successful"}),failed:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.badge.failed",{defaultMessage:"Failed"}),pending:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.badge.pending",{defaultMessage:"Pending"})},unenrolled:{hosts:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.hosts.unenrolled.hosts",{defaultMessage:"Hosts unenrolled"}),host:n.i18n.translate("xpack.securitySolution.responseActionsList.list.item.hosts.unenrolled.host",{defaultMessage:"Host unenrolled"})},screenReaderExpand:n.i18n.translate("xpack.securitySolution.responseActionsList.list.screenReader.expand",{defaultMessage:"Expand rows"}),recordsLabel:e=>n.i18n.translate("xpack.securitySolution.responseActionsList.list.recordRangeLabel",{defaultMessage:"{records, plural, one {response action} other {response actions}}",values:{records:e}}),triggeredByRule:n.i18n.translate("xpack.securitySolution.responseActionsList.list.rule.triggeredByRule",{defaultMessage:"Triggered by rule"})}),l=Object.freeze({actions:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.actions",{defaultMessage:"Actions"}),hosts:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.Hosts",{defaultMessage:"Hosts"}),statuses:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.statuses",{defaultMessage:"Statuses"}),users:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.users",{defaultMessage:"Filter by username"}),type:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.type",{defaultMessage:"Type"})}),r=Object.freeze({collapse:n.i18n.translate("xpack.securitySolution.responseActionsList.list.expandButton.collapse",{defaultMessage:"Collapse"}),expand:n.i18n.translate("xpack.securitySolution.responseActionsList.list.expandButton.expand",{defaultMessage:"Expand"})}),u=n.i18n.translate("xpack.securitySolution.responseActionExecuteDownloadLink.downloadButtonLabel",{defaultMessage:"Click here to download full output"}),c=Object.freeze({manual:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.manual",{defaultMessage:"Triggered manually"}),automated:n.i18n.translate("xpack.securitySolution.responseActionsList.list.filter.automated",{defaultMessage:"Triggered by rule"})})},794:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(2),s=a.n(n),o=a(40),i=a(1036);const l=Object(n.memo)((({"data-test-subj":e})=>s.a.createElement(i.a,null,s.a.createElement(o.EuiLoadingSpinner,{"data-test-subj":e,size:"l"}))));l.displayName="ManagementPageLoader"},889:function(e,t,a){"use strict";a.d(t,"a",(function(){return h})),a.d(t,"b",(function(){return N}));var n=a(2),s=a.n(n),o=a(40),i=a(41),l=a.n(i),r=a(44),u=a(5),c=a(173),d=a(1440),p=a(117),m=a(493),g=a(1477),M=a(107),j=a(693),y=a(1532);const b=Object.freeze({width:150}),f=u.i18n.translate("xpack.securitySolution.endpoint.agentAndActionsStatus.isIsolating",{defaultMessage:"Isolating"}),E=u.i18n.translate("xpack.securitySolution.endpoint.agentAndActionsStatus.isUnIsolating",{defaultMessage:"Releasing"}),S=u.i18n.translate("xpack.securitySolution.endpoint.agentAndActionsStatus.isolated",{defaultMessage:"Isolated"}),x=l()(o.EuiFlexGroup).withConfig({displayName:"EuiFlexGroupStyled",componentId:"sc-16zb648-0"})([".isolation-status{margin-left:",";}"],(({theme:e})=>e.eui.euiSizeS)),h=Object(n.memo)((({endpointHostInfo:e,autoRefresh:t=!0,pendingActions:a,"data-test-subj":i})=>{var l;const r=Object(M.a)(i),{data:u}=Object(g.a)([e.metadata.agent.id],{refetchInterval:!!t&&c.a,enabled:!a}),[p,m]=Object(n.useMemo)((()=>{var e;if(!u&&!a)return[!1,{}];const t=a||(null!==(e=null==u?void 0:u.data[0].pending_actions)&&void 0!==e?e:{});return[Object.keys(t).length>0,t]}),[u,a]),j=e.host_status,b=Boolean(null===(l=e.metadata.Endpoint.state)||void 0===l?void 0:l.isolation);return s.a.createElement(x,{gutterSize:"none",responsive:!1,className:"eui-textTruncate","data-test-subj":i},s.a.createElement(o.EuiFlexItem,{grow:!1},s.a.createElement(o.EuiBadge,{color:null!=j?d.a[j]:"warning","data-test-subj":r("agentStatus"),className:"eui-textTruncate"},Object(y.a)(j))),(b||p)&&s.a.createElement(o.EuiFlexItem,{grow:!1,className:"eui-textTruncate isolation-status"},s.a.createElement(O,{"data-test-subj":r("actionStatuses"),isIsolated:b,pendingActions:m})))}));h.displayName="EndpointAgentStatus";const N=Object(n.memo)((({endpointAgentId:e,autoRefresh:t,"data-test-subj":a})=>{const{data:n}=Object(j.c)(e,{refetchInterval:!!t&&c.a}),i=s.a.createElement(o.EuiText,{size:"xs","data-test-subj":a},s.a.createElement("p",null,Object(p.e)()));return n?s.a.createElement(h,{endpointHostInfo:n,"data-test-subj":a,autoRefresh:t}):i}));N.displayName="EndpointAgentStatusById";const O=Object(n.memo)((({pendingActions:e,isIsolated:t,"data-test-subj":a})=>{const i=Object(M.a)(a),{totalPending:l,actionList:u,wasReleasing:c,wasIsolating:d,hasMultipleActionTypesPending:p,hasPendingIsolate:g,hasPendingUnIsolate:j}=Object(n.useMemo)((()=>{var t,a;const n=[];let s=0,o=0;Object.entries(e).sort().forEach((([e,t])=>{var a;s+=t,o+=1,n.push({count:t,label:null!==(a=m.c[e])&&void 0!==a?a:e})}));const i=null!==(t=e.isolate)&&void 0!==t?t:0,l=null!==(a=e.unisolate)&&void 0!==a?a:0;return{actionList:n,totalPending:s,wasReleasing:0===i&&l>0,wasIsolating:i>0&&0===l,hasMultipleActionTypesPending:o>1,hasPendingIsolate:i>0,hasPendingUnIsolate:l>0}}),[e]),y=Object(n.useMemo)((()=>g?f:j?E:t?S:s.a.createElement(r.FormattedMessage,{id:"xpack.securitySolution.endpoint.agentAndActionsStatus.multiplePendingActions",defaultMessage:"{count} {count, plural, one {action} other {actions}} pending",values:{count:l}})),[g,j,t,l]),x=Object(n.useMemo)((()=>s.a.createElement(o.EuiBadge,{color:"hollow","data-test-subj":a},S)),[a]);if(0===l){if(!d&&c||!t)return null;if(!t&&d&&!c||t)return x}return p||!g&&!j?s.a.createElement(o.EuiBadge,{color:"hollow","data-test-subj":a,iconType:"plus",iconSide:"right"},s.a.createElement(o.EuiToolTip,{display:"block",anchorClassName:"eui-textTruncate",anchorProps:{"data-test-subj":i("tooltipTrigger")},content:s.a.createElement("div",{style:b,"data-test-subj":`${a}-tooltipContent`},s.a.createElement("div",null,s.a.createElement(r.FormattedMessage,{id:"xpack.securitySolution.endpoint.agentAndActionsStatus.tooltipPendingActions",defaultMessage:"Pending actions:"})),u.map((({count:e,label:t})=>s.a.createElement(o.EuiFlexGroup,{gutterSize:"none",key:t},s.a.createElement(o.EuiFlexItem,null,t),s.a.createElement(o.EuiFlexItem,{grow:!1},e)))))},s.a.createElement(o.EuiTextColor,{color:"subdued","data-test-subj":`${a}-pending`},y))):s.a.createElement(o.EuiBadge,{color:"hollow","data-test-subj":a},s.a.createElement(o.EuiTextColor,{color:"subdued","data-test-subj":i("pending")},y))}));O.displayName="EndpointHostResponseActionsStatus"},938:function(e,t,a){"use strict";a.d(t,"b",(function(){return ue})),a.d(t,"a",(function(){return Me}));var n=a(5),s=a(2),o=a.n(s),i=a(1543),l=a(44),r=a(141),u=a(107),c=a(104),d=a.n(c),p=a(1531);const m=Object(s.memo)((({action:e,ResultComponent:t,title:a,...n})=>{const i=Object(s.useMemo)((()=>{var t,n,s;if(a)return a;const o=e.agents[0],i=null===(t=e.outputs)||void 0===t||null===(n=t[o])||void 0===n||null===(s=n.content)||void 0===s?void 0:s.code;return i?p.a[i]:void 0}),[a,e.agents,e.outputs]);return o.a.createElement(t,d()({},n,{title:i}))}));m.displayName="ActionSuccess";var g=a(1544);const M=Object(s.memo)((({title:e,dataTestSubj:t,action:a,ResultComponent:n})=>o.a.createElement(n,{showAs:"failure",title:e,"data-test-subj":t},o.a.createElement(g.a,{action:a}))));M.displayName="ActionError";var j=a(1446),y=a(46),b=a(102),f=a(706),E=a(215);const S=({actionCreator:e,actionRequestBody:t,setStatus:a,status:n,setStore:i,store:c,ResultComponent:d,dataTestSubj:p,pendingMessage:g,successMessage:S})=>{const x=Object(r.b)(),h=Object(u.a)(p),N="pending"===n,O=Object(s.useMemo)((()=>{var e;return null!==(e=c.actionApiState)&&void 0!==e?e:{request:{sent:!1,error:void 0,actionId:void 0},actionDetails:void 0,actionDetailsError:void 0}}),[c.actionApiState]),{actionDetails:v,actionDetailsError:I}=O,{actionId:T,sent:A,error:L}=O.request,{data:D,error:C}=((e,t={})=>{const a=Object(b.i)();return Object(y.useQuery)({queryKey:["get-action-details",e],...t,queryFn:()=>a.get(Object(f.a)(E.c,{action_id:e.trim()||"undefined"}),{version:"2023-10-31"})})})(null!=T?T:"-",{enabled:Boolean(T)&&N,refetchInterval:!!N&&3e3});return Object(s.useEffect)((()=>{if(!A&&t&&x()){const a={...O.request,sent:!0};e.mutateAsync(t).then((e=>{a.actionId=e.data.id})).catch((e=>{a.error=e})).finally((()=>{x()&&i((e=>{var t;return{...e,actionApiState:{...null!==(t=e.actionApiState)&&void 0!==t?t:O,request:{...a}}}}))})),i((e=>{var t;return{...e,actionApiState:{...null!==(t=e.actionApiState)&&void 0!==t?t:O,request:a}}}))}}),[e,t,A,O,x,i]),Object(s.useEffect)((()=>{L&&N&&a("error")}),[L,N,a]),Object(s.useEffect)((()=>{C&&N&&(a("error"),i((e=>{var t;return{...e,actionApiState:{...null!==(t=e.actionApiState)&&void 0!==t?t:O,actionDetails:void 0,actionDetailsError:C}}})))}),[C,O,N,a,i]),Object(s.useEffect)((()=>{null!=D&&D.data.isCompleted&&N&&(a(null!=D&&D.data.wasSuccessful?"success":"error"),i((e=>{var t;return{...e,actionApiState:{...null!==(t=e.actionApiState)&&void 0!==t?t:O,actionDetails:D.data}}})))}),[D,O,N,a,i]),{result:Object(s.useMemo)((()=>{if(N)return o.a.createElement(d,{showAs:"pending","data-test-subj":h("pending")},g);const e=L||I;return e?o.a.createElement(d,{showAs:"failure","data-test-subj":h("apiFailure")},o.a.createElement(l.FormattedMessage,{id:"xpack.securitySolution.endpointResponseActions.actionSubmitter.apiErrorDetails",defaultMessage:"The following error was encountered:"}),o.a.createElement(j.a,{error:e,"data-test-subj":h("apiErrorDetails")})):v?v.errors?o.a.createElement(M,{ResultComponent:d,action:v,dataTestSubj:h("actionFailure")}):o.a.createElement(m,{ResultComponent:d,action:v,"data-test-subj":h("success"),title:S}):o.a.createElement(o.a.Fragment,null)}),[N,L,I,v,d,h,g,S]),actionDetails:O.actionDetails}},x=Object(s.memo)((({command:e,setStore:t,store:a,status:n,setStatus:l,ResultComponent:r})=>{var u,c;const d=(e=>{const t=Object(b.i)();return Object(y.useMutation)((({file:e,...a})=>{const n=new FormData;n.append("file",e,e.name);for(const[e,t]of Object.entries(a))n.append(e,"string"!=typeof t?JSON.stringify(t):t);return t.post(E.y,{body:n,version:"2023-10-31",headers:{"Content-Type":void 0}})}),void 0)})(),p=Object(s.useMemo)((()=>{var t,a;const n=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId,{comment:s,overwrite:o,file:i}=e.args.args;if(n)return{endpoint_ids:[n],...null!=s&&s[0]?{comment:null==s?void 0:s[0]}:{},parameters:void 0!==o?{overwrite:null==o?void 0:o[0]}:{},file:i[0]}}),[e.args.args,null===(u=e.commandDefinition)||void 0===u||null===(c=u.meta)||void 0===c?void 0:c.endpointId]),{result:m,actionDetails:g}=S({ResultComponent:r,setStore:t,store:a,status:n,setStatus:l,actionCreator:d,actionRequestBody:p,dataTestSubj:"upload"});return null!=g&&g.isCompleted&&g.wasSuccessful?o.a.createElement(r,null,o.a.createElement(i.a,{action:g})):m}));x.displayName="UploadActionResult";var h=a(40);const N=n.i18n.translate("xpack.securitySolution.consoleArgumentSelectors.fileSelector.initialDisplayLabel",{defaultMessage:"Click to select file"}),O=n.i18n.translate("xpack.securitySolution.consoleArgumentSelectors.fileSelector.filePickerButtonLabel",{defaultMessage:"Open file picker"}),v=n.i18n.translate("xpack.securitySolution.consoleArgumentSelectors.fileSelector.noFileSelected",{defaultMessage:"No file selected"}),I=Object(s.memo)((({value:e,valueText:t,onChange:a,store:n})=>{const i=Object(s.useMemo)((()=>null!=n?n:{isPopoverOpen:!0}),[n]),l=Object(s.useCallback)((n=>{a({value:e,valueText:t,store:{...i,isPopoverOpen:n}})}),[a,i,e,t]),r=Object(s.useMemo)((()=>Object(h.htmlIdGenerator)("console")()),[]),u=Object(s.useCallback)((()=>{l(!0)}),[l]),c=Object(s.useCallback)((()=>{l(!1)}),[l]),d=Object(s.useCallback)((e=>{const t=null==e?void 0:e.item(0);a({value:null!=t?t:void 0,valueText:t?t.name:"",store:{...i,isPopoverOpen:!1}})}),[a,i]);return o.a.createElement("div",null,o.a.createElement(h.EuiPopover,{isOpen:i.isPopoverOpen,closePopover:c,anchorPosition:"upCenter",initialFocus:`#${r}`,anchorClassName:"popoverAnchor",button:o.a.createElement(h.EuiFlexGroup,{responsive:!1,alignItems:"center",gutterSize:"none"},o.a.createElement(h.EuiFlexItem,{grow:!1,className:"eui-textTruncate",onClick:u},o.a.createElement("div",{className:"eui-textTruncate",title:t||v},t||N)),o.a.createElement(h.EuiFlexItem,{grow:!1},o.a.createElement(h.EuiButtonIcon,{iconType:"folderOpen",size:"xs",onClick:u,"aria-label":O})))},i.isPopoverOpen&&o.a.createElement(h.EuiFilePicker,{id:r,onChange:d,fullWidth:!0,display:"large","data-test-subj":"console-arg-file-picker"})))}));I.displayName="ArgumentFileSelector";var T=a(29),A=a(126),L=a(1497);const D=Object(s.memo)((({command:e,setStore:t,store:a,status:i,setStatus:l,ResultComponent:r})=>{var u,c;const{canWriteFileOperations:d}=Object(A.a)().endpointPrivileges,p=Object(y.useMutation)((e=>b.b.get().http.post(E.n,{body:JSON.stringify(e),version:"2023-10-31"})),undefined);const m=Object(s.useMemo)((()=>{var t,a;const n=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId,{path:s,comment:o}=e.args.args;return n?{endpoint_ids:[n],comment:null==o?void 0:o[0],parameters:{path:s[0]}}:void 0}),[e.args.args,null===(u=e.commandDefinition)||void 0===u||null===(c=u.meta)||void 0===c?void 0:c.endpointId]),{result:g,actionDetails:M}=S({ResultComponent:r,setStore:t,store:a,status:i,setStatus:l,actionCreator:p,actionRequestBody:m,dataTestSubj:"getFile",pendingMessage:n.i18n.translate("xpack.securitySolution.getFileAction.pendingMessage",{defaultMessage:"Retrieving the file from host."})});return null!=M&&M.isCompleted&&M.wasSuccessful?o.a.createElement(r,{showAs:"success","data-test-subj":"getFileSuccess",title:n.i18n.translate("xpack.securitySolution.endpointResponseActions.getFileAction.successTitle",{defaultMessage:"File retrieved from the host."})},o.a.createElement(L.a,{action:M,canAccessFileDownloadLink:d})):g}));D.displayName="GetFileActionResult";var C=a(759);const k=Object(s.memo)((({command:e,setStore:t,store:a,status:n,setStatus:o,ResultComponent:i})=>{var l,r,u;const c=Object(y.useMutation)((e=>Object(C.a)(e)),undefined);const d=Object(s.useMemo)((()=>{var t,a,n,s;const o=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId,i=null===(n=e.args.args)||void 0===n||null===(s=n.comment)||void 0===s?void 0:s[0];return o?{endpoint_ids:[o],comment:i}:void 0}),[null===(l=e.args.args)||void 0===l?void 0:l.comment,null===(r=e.commandDefinition)||void 0===r||null===(u=r.meta)||void 0===u?void 0:u.endpointId]);return S({ResultComponent:i,setStore:t,store:a,status:n,setStatus:o,actionCreator:c,actionRequestBody:d,dataTestSubj:"isolate"}).result}));k.displayName="IsolateActionResult";const w=Object(s.memo)((({command:e,setStore:t,store:a,status:n,setStatus:o,ResultComponent:i})=>{var l,r,u;const c=Object(y.useMutation)((e=>Object(C.b)(e)),undefined);const d=Object(s.useMemo)((()=>{var t,a,n,s;const o=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId,i=null===(n=e.args.args)||void 0===n||null===(s=n.comment)||void 0===s?void 0:s[0];return o?{endpoint_ids:[o],comment:i}:void 0}),[null===(l=e.args.args)||void 0===l?void 0:l.comment,null===(r=e.commandDefinition)||void 0===r||null===(u=r.meta)||void 0===u?void 0:u.endpointId]);return S({ResultComponent:i,setStore:t,store:a,status:n,setStatus:o,actionCreator:c,actionRequestBody:d,dataTestSubj:"release"}).result}));w.displayName="ReleaseActionResult";const z=e=>{var t,a;return e.pid?{pid:Number(e.pid[0])}:{entity_id:null!==(t=null==e||null===(a=e.entityId)||void 0===a?void 0:a[0])&&void 0!==t?t:""}},F=/^\d+(?=(h|m|s){1}$)/,R=e=>{const t=null==e?void 0:e.trim().match(F);var a,n;if(t)return a=Number(t[0]),n=t[1],(e=>({h:()=>60*e*60,m:()=>60*e,s:()=>e}))(a)[n]()},U=Object(s.memo)((({command:e,setStore:t,store:a,status:n,setStatus:o,ResultComponent:i})=>{var l,r;const u=Object(y.useMutation)((e=>{return t=e,b.b.get().http.post(E.s,{body:JSON.stringify(t),version:"2023-10-31"});var t}),d),c=Object(s.useMemo)((()=>{var t,a,n,s;const o=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId,i=z(e.args.args);return o?{endpoint_ids:[o],comment:null===(n=e.args.args)||void 0===n||null===(s=n.comment)||void 0===s?void 0:s[0],parameters:i}:void 0}),[e.args.args,null===(l=e.commandDefinition)||void 0===l||null===(r=l.meta)||void 0===r?void 0:r.endpointId]);var d;return S({ResultComponent:i,setStore:t,store:a,status:n,setStatus:o,actionCreator:u,actionRequestBody:c,dataTestSubj:"killProcess"}).result}));U.displayName="KillProcessActionResult";const _=Object(s.memo)((({command:e,setStore:t,store:a,status:n,setStatus:o,ResultComponent:i})=>{var l,r;const u=Object(y.useMutation)((e=>{return t=e,b.b.get().http.post(E.w,{body:JSON.stringify(t),version:"2023-10-31"});var t}),d),c=Object(s.useMemo)((()=>{var t,a,n,s;const o=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId,i=z(e.args.args);return o?{endpoint_ids:[o],comment:null===(n=e.args.args)||void 0===n||null===(s=n.comment)||void 0===s?void 0:s[0],parameters:i}:void 0}),[e.args.args,null===(l=e.commandDefinition)||void 0===l||null===(r=l.meta)||void 0===r?void 0:r.endpointId]);var d;return S({ResultComponent:i,setStore:t,store:a,status:n,setStatus:o,actionCreator:u,actionRequestBody:c,dataTestSubj:"suspendProcess"}).result}));_.displayName="SuspendProcessActionResult";var P=a(47),Q=a(1477),Y=a(132),H=a(693),$=a(229),B=a(1440),G=a(1532);const q=Object(s.memo)((({command:e,status:t,setStatus:a,store:i,setStore:l,ResultComponent:r})=>{var u,c;const d=null===(u=e.commandDefinition)||void 0===u||null===(c=u.meta)||void 0===c?void 0:c.endpointId,{endpointPendingActions:p,endpointDetails:m,detailsFetchError:g,apiCalled:M}=i,y="pending"===t,b=Object(s.useMemo)((()=>Object(P.v4)()),[]),{data:f,error:E,isFetching:S,isFetched:x}=Object(H.c)(d,{enabled:y,queryKey:[b]}),{data:N}=Object(Q.a)([d],{enabled:y,queryKey:[b,d]}),O=Object(s.useMemo)((()=>{if(null!=p&&p.data.length){var e,t;const a=p.data[0].pending_actions;return{pendingIsolate:null!==(e=a.isolate)&&void 0!==e?e:0,pendingUnIsolate:null!==(t=a.unisolate)&&void 0!==t?t:0}}return{pendingIsolate:0,pendingUnIsolate:0}}),[null==p?void 0:p.data]);Object(s.useEffect)((()=>{M||l((e=>({...e,apiCalled:!0})))}),[M,l]),Object(s.useEffect)((()=>{x&&y&&(a(g?"error":"success"),l((e=>({...e,endpointDetails:f,detailsFetchError:null!=E?E:void 0}))))}),[g,x,a,y,l,f,E]),Object(s.useEffect)((()=>{N&&!p&&l((e=>({...e,endpointPendingActions:N})))}),[N,l,p]);const v=Object(s.useCallback)((()=>{if(!m)return;const e=[{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.agentStatus",{defaultMessage:"Agent status"})),description:o.a.createElement($.a,null,(()=>{var e;let t="";return O.pendingIsolate>0?t=n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.isolating",{defaultMessage:"Isolating"}):O.pendingUnIsolate>0?t=n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.releasing",{defaultMessage:"Releasing"}):null!=m&&null!==(e=m.metadata.Endpoint.state)&&void 0!==e&&e.isolation&&(t=n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.isolated",{defaultMessage:"Isolated"})),`${Object(G.a)(m.host_status)}${t.length>0?` - ${t}`:""}`})())},{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.platform",{defaultMessage:"Platform"})),description:o.a.createElement($.a,null,m.metadata.host.os.full)},{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.version",{defaultMessage:"Version"})),description:m.metadata.agent.version},{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.policyStatus",{defaultMessage:"Policy status"})),description:o.a.createElement($.a,null,B.d[m.metadata.Endpoint.policy.applied.status])},{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.appliedPolicyVersion",{defaultMessage:"Policy version"})),description:o.a.createElement($.a,null,`v${m.metadata.Endpoint.policy.applied.endpoint_policy_version}`)},{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.policyName",{defaultMessage:"Policy name"})),description:o.a.createElement($.a,null,m.metadata.Endpoint.policy.applied.name)},{title:o.a.createElement($.a,null,n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.lastActive",{defaultMessage:"Last active"})),description:o.a.createElement($.a,null,o.a.createElement(Y.a,{fieldName:n.i18n.translate("xpack.securitySolution.endpointResponseActions.status.lastActive",{defaultMessage:"Last active"}),value:m.last_checkin}))}];return o.a.createElement(h.EuiDescriptionList,{compressed:!0,type:"column",className:"descriptionList-20_80",listItems:e,"data-test-subj":"agent-status-console-output"})}),[O.pendingIsolate,O.pendingUnIsolate,m]);return g?o.a.createElement(r,{showAs:"failure"},o.a.createElement(j.a,{error:g})):S||!m?o.a.createElement(r,{showAs:"pending"}):o.a.createElement(r,{showTitle:!1},v())}));q.displayName="EndpointStatusActionResult";var W=a(41);const Z=a.n(W)()(h.EuiBasicTable).withConfig({displayName:"StyledEuiBasicTable",componentId:"sc-10fx62u-0"})(["table{background-color:transparent;}.euiTableHeaderCell{border-bottom:",";.euiTableCellContent__text{font-weight:",";}}.euiTableRow{&:hover{background-color:"," !important;}.euiTableRowCell{border-top:none !important;border-bottom:none !important;}}"],(e=>e.theme.eui.euiBorderThin),(e=>e.theme.eui.euiFontWeightRegular),(({theme:{eui:e}})=>e.euiColorEmptyShade)),V=Object(s.memo)((({command:e,setStore:t,store:a,status:i,setStatus:l,ResultComponent:r})=>{var u,c,d;const p=null===(u=e.commandDefinition)||void 0===u||null===(c=u.meta)||void 0===c?void 0:c.endpointId,m=Object(y.useMutation)((e=>b.b.get().http.post(E.o,{body:JSON.stringify(e),version:"2023-10-31"})),undefined);const g=Object(s.useMemo)((()=>{var t,a;return p?{endpoint_ids:[p],comment:null===(t=e.args.args)||void 0===t||null===(a=t.comment)||void 0===a?void 0:a[0]}:void 0}),[null===(d=e.args.args)||void 0===d?void 0:d.comment,p]),{result:M,actionDetails:j}=S({ResultComponent:r,setStore:t,store:a,status:i,setStatus:l,actionCreator:m,actionRequestBody:g,dataTestSubj:"getProcesses"}),f=Object(s.useMemo)((()=>[{field:"user",name:n.i18n.translate("xpack.securitySolution.endpointResponseActions.getProcesses.table.header.user",{defaultMessage:"USER"}),width:"10%"},{field:"pid",name:n.i18n.translate("xpack.securitySolution.endpointResponseActions.getProcesses.table.header.pid",{defaultMessage:"PID"}),width:"5%"},{field:"entity_id",name:n.i18n.translate("xpack.securitySolution.endpointResponseActions.getProcesses.table.header.enityId",{defaultMessage:"ENTITY ID"}),width:"30%"},{field:"command",name:n.i18n.translate("xpack.securitySolution.endpointResponseActions.getProcesses.table.header.command",{defaultMessage:"COMMAND"}),width:"55%"}]),[]),x=Object(s.useMemo)((()=>{var e,t,a;return p&&null!==(e=null==j||null===(t=j.outputs)||void 0===t||null===(a=t[p])||void 0===a?void 0:a.content.entries)&&void 0!==e?e:[]}),[null==j?void 0:j.outputs,p]);return j&&j.wasSuccessful?o.a.createElement(r,{"data-test-subj":"getProcessesSuccessCallout",showTitle:!1},o.a.createElement(Z,{items:[...x],columns:f})):M}));V.displayName="GetProcessesActionResult";var K=a(1539);const X=Object(s.memo)((({command:e,setStore:t,store:a,status:i,setStatus:l,ResultComponent:r})=>{var u,c,d,p,m;const g=Object(y.useMutation)((e=>b.b.get().http.post(E.m,{body:JSON.stringify(e),version:"2023-10-31"})),undefined);const M=Object(s.useMemo)((()=>{var t,a,n,s,o;const i=null===(t=e.commandDefinition)||void 0===t||null===(a=t.meta)||void 0===a?void 0:a.endpointId;if(i)return{endpoint_ids:[i],parameters:{command:e.args.args.command[0],timeout:R(null===(n=e.args.args.timeout)||void 0===n?void 0:n[0])},comment:null===(s=e.args.args)||void 0===s||null===(o=s.comment)||void 0===o?void 0:o[0]}}),[null===(u=e.commandDefinition)||void 0===u||null===(c=u.meta)||void 0===c?void 0:c.endpointId,e.args.args.command,e.args.args.timeout,null===(d=e.args.args)||void 0===d?void 0:d.comment]),{result:j,actionDetails:f}=S({ResultComponent:r,setStore:t,store:a,status:i,setStatus:l,actionCreator:g,actionRequestBody:M,dataTestSubj:"execute"});return f&&f.wasSuccessful?o.a.createElement(r,{"data-test-subj":"executeSuccess",showAs:"success",title:n.i18n.translate("xpack.securitySolution.endpointResponseActions.executeAction.successTitle",{defaultMessage:"Command execution was successful."})},o.a.createElement(K.a,{action:f,canAccessFileDownloadLink:!0,agentId:null===(p=e.commandDefinition)||void 0===p||null===(m=p.meta)||void 0===m?void 0:m.endpointId,textSize:"s","data-test-subj":"console"})):j}));X.displayName="ExecuteActionResult";const J=n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.execute.args.command.aboutConsecutiveDashes",{defaultMessage:"Multiple consecutive dashes in the value provided must be escaped. Ex:"}),ee=n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.execute.args.command.aboutQuotes",{defaultMessage:"Quotes provided in the value can be used without escaping. Ex:"});var te=a(19);const ae=n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.suspendProcess.unsupportedCommandInfo",{defaultMessage:"This version of the Endpoint does not support this command. Upgrade your Agent in Fleet to use the latest response actions."}),ne=o.a.memo((()=>o.a.createElement(h.EuiIconTip,{content:ae,type:"warning",color:"danger"})));ne.displayName="DisabledTooltip";const se=({aboutInfo:e,isSupported:t})=>t?e:o.a.createElement(o.a.Fragment,null,e," ",o.a.createElement(ne,null));var oe=a(493);const ie=e=>{var t;return(null==e?void 0:e.length)>0&&"string"==typeof e[0]&&(null===(t=e[0])||void 0===t?void 0:t.trim().length)>0||n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.emptyArgumentMessage",{defaultMessage:"Argument cannot be empty"})},le=e=>{const t=ie(e);return!0!==t?t:!!(Number.isSafeInteger(Number(e))&&Number(e)>0)||n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.invalidPidMessage",{defaultMessage:"Argument must be a positive number representing the PID of a process"})},re=e=>{return!(!String(e).trim().length||(t=String(e).trim(),!F.test(t)))||n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.invalidExecuteTimeout",{defaultMessage:"Argument must be a string with a positive integer value followed by a unit of time (h for hours, m for minutes, s for seconds). Example: 37m."});var t},ue=({commandName:e,privileges:t})=>Boolean(t[oe.g[e]]),ce=e=>{const t=e.commandDefinition.meta.privileges,a=e.commandDefinition.meta.capabilities,n=e.commandDefinition.name,s=oe.f[n];let o="";return s||(o=o.concat(te.h)),s&&(a.includes(s)||(o=o.concat(te.h))),!0!==ue({commandName:n,privileges:t})&&(o=o.concat(te.b)),!o.length||o},de=Object.freeze({responseActions:{position:0,label:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.groups.responseActions",{defaultMessage:"Response actions"})}}),pe=n.i18n.translate("xpack.securitySolution.endpointResponseActionsConsoleCommands.enterPidOrEntityId",{defaultMessage:"Enter a pid or an entity id to execute"}),me=n.i18n.translate("xpack.securitySolution.endpointResponseActionsConsoleCommands.enterOrAddOptionalComment",{defaultMessage:"Hit enter to execute or add an optional comment"}),ge=n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.suspendProcess.commandArgAbout",{defaultMessage:"A comment to go along with the action"}),Me=({endpointAgentId:e,endpointCapabilities:t,endpointPrivileges:a})=>{const s=T.a.get().responseActionUploadEnabled,i=e=>{const a=oe.f[e];return!!a&&t.includes(a)},r=[{name:"isolate",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.isolate.about",{defaultMessage:"Isolate the host"}),isSupported:i("isolate")}),RenderComponent:k,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'isolate --comment "isolate this host"',exampleInstruction:me,validate:ce,args:{comment:{required:!1,allowMultiples:!1,about:ge}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:0,helpDisabled:!1===i("isolate"),helpHidden:!ue({commandName:"isolate",privileges:a})},{name:"release",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.release.about",{defaultMessage:"Release the host"}),isSupported:i("release")}),RenderComponent:w,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'release --comment "release this host"',exampleInstruction:me,validate:ce,args:{comment:{required:!1,allowMultiples:!1,about:ge}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:1,helpDisabled:!1===i("release"),helpHidden:!ue({commandName:"release",privileges:a})},{name:"kill-process",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.killProcess.about",{defaultMessage:"Kill/terminate a process"}),isSupported:i("kill-process")}),RenderComponent:U,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'kill-process --pid 123 --comment "kill this process"',exampleInstruction:pe,validate:ce,mustHaveArgs:!0,args:{comment:{required:!1,allowMultiples:!1,about:ge},pid:{required:!1,allowMultiples:!1,exclusiveOr:!0,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.pid.arg.comment",{defaultMessage:"A PID representing the process to kill"}),validate:le},entityId:{required:!1,allowMultiples:!1,exclusiveOr:!0,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.entityId.arg.comment",{defaultMessage:"An entity id representing the process to kill"}),validate:ie}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:4,helpDisabled:!1===i("kill-process"),helpHidden:!ue({commandName:"kill-process",privileges:a})},{name:"suspend-process",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.suspendProcess.about",{defaultMessage:"Temporarily suspend a process"}),isSupported:i("suspend-process")}),RenderComponent:_,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'suspend-process --pid 123 --comment "suspend this process"',exampleInstruction:pe,validate:ce,mustHaveArgs:!0,args:{comment:{required:!1,allowMultiples:!1,about:ge},pid:{required:!1,allowMultiples:!1,exclusiveOr:!0,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.suspendProcess.pid.arg.comment",{defaultMessage:"A PID representing the process to suspend"}),validate:le},entityId:{required:!1,allowMultiples:!1,exclusiveOr:!0,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.suspendProcess.entityId.arg.comment",{defaultMessage:"An entity id representing the process to suspend"}),validate:ie}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:5,helpDisabled:!1===i("suspend-process"),helpHidden:!ue({commandName:"suspend-process",privileges:a})},{name:"status",about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.status.about",{defaultMessage:"Show host status information"}),RenderComponent:q,meta:{endpointId:e},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:2},{name:"processes",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.processes.about",{defaultMessage:"Show all running processes"}),isSupported:i("processes")}),RenderComponent:V,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'processes --comment "get the processes"',exampleInstruction:me,validate:ce,args:{comment:{required:!1,allowMultiples:!1,about:ge}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:3,helpDisabled:!1===i("processes"),helpHidden:!ue({commandName:"processes",privileges:a})},{name:"get-file",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.getFile.about",{defaultMessage:"Retrieve a file from the host"}),isSupported:i("processes")}),RenderComponent:D,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'get-file --path "/full/path/to/file.txt" --comment "Possible malware"',exampleInstruction:me,validate:ce,mustHaveArgs:!0,args:{path:{required:!0,allowMultiples:!1,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.getFile.pathArgAbout",{defaultMessage:"The full file path to be retrieved"}),validate:e=>ie(e)},comment:{required:!1,allowMultiples:!1,about:ge}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:6,helpDisabled:!i("get-file"),helpHidden:!ue({commandName:"get-file",privileges:a})},{name:"execute",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.execute.about",{defaultMessage:"Execute a command on the host"}),isSupported:i("execute")}),RenderComponent:X,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'execute --command "ls -al" --timeout 2s --comment "Get list of all files"',exampleInstruction:me,validate:ce,mustHaveArgs:!0,args:{command:{required:!0,allowMultiples:!1,about:o.a.createElement(o.a.Fragment,null,o.a.createElement(l.FormattedMessage,{id:"xpack.securitySolution.endpointConsoleCommands.execute.args.command.about",defaultMessage:"The command to execute."}),o.a.createElement("br",null),`${J} execute --command "/opt/directory\\-\\-\\-directory/myBinary \\-\\-version"`,o.a.createElement("br",null),`${ee} execute --command "cd "C:\\Program Files\\directory""`),mustHaveValue:"non-empty-string"},timeout:{required:!1,allowMultiples:!1,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.execute.args.timeout.about",{defaultMessage:"The timeout in units of time (h for hours, m for minutes, s for seconds) for the endpoint to wait for the script to complete. Example: 37m. If not given, it defaults to 4 hours."}),mustHaveValue:"non-empty-string",validate:re},comment:{required:!1,allowMultiples:!1,about:ge}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:6,helpDisabled:!i("execute"),helpHidden:!ue({commandName:"execute",privileges:a})}];return s&&r.push({name:"upload",about:se({aboutInfo:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.upload.about",{defaultMessage:"Upload a file to the host"}),isSupported:i("upload")}),RenderComponent:x,meta:{endpointId:e,capabilities:t,privileges:a},exampleUsage:'upload --file --overwrite --comment "script to fix registry"',exampleInstruction:me,validate:ce,mustHaveArgs:!0,args:{file:{required:!0,allowMultiples:!1,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.upload.args.file.about",{defaultMessage:"The file that will be sent to the host"}),mustHaveValue:"truthy",SelectorComponent:I},overwrite:{required:!1,allowMultiples:!1,about:n.i18n.translate("xpack.securitySolution.endpointConsoleCommands.upload.args.overwrite.about",{defaultMessage:"Overwrite the file on the host if it already exists"}),mustHaveValue:!1},comment:{required:!1,allowMultiples:!1,mustHaveValue:"non-empty-string",about:ge}},helpGroupLabel:de.responseActions.label,helpGroupPosition:de.responseActions.position,helpCommandPosition:7,helpDisabled:!i("upload"),helpHidden:!ue({commandName:"upload",privileges:a})}),r}}}]);