import{eT as R,f7 as E,f8 as $,fp as O,ed as t,eg as T,fr as z,ct as x,cp as N,c8 as b,eF as U,aO as K,co as W,eH as G,eY as _,dP as a,ap as I,a4 as w,bT as S,X as A,r as H,y as J,Z as k,cF as F,d5 as Q,B}from"./index-BJCd-jqX.js";import{S as X}from"./googlesecops-BvzlhYc1.js";const y={revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshWhenOffline:!1,refreshWhenHidden:!1,refreshInterval:0},M=1,D=e=>{try{const s=JSON.parse(e);return Array.isArray(s)?s:[]}catch{return[]}},Y=(e,s)=>{const n={},r=e.end||s,o=e.start||b(r,M*-1);return n.end=r.toISOString(),n.start=o.toISOString(),e.actors&&e.actors.length>0&&(n.actors=JSON.stringify(e.actors)),e.events&&e.events.length>0&&(n.events=JSON.stringify(e.events)),e.actorSearch&&e.actorSearch!==""&&(n.actorSearch=e.actorSearch),e.targetSearch&&e.targetSearch!==""&&(n.targetSearch=e.targetSearch),n},q=(e,s)=>{const n=new URLSearchParams,r=e.end||s,o=e.start||b(r,M*-1);return n.set("end",r.toISOString()),n.set("start",o.toISOString()),e.actors?.forEach(i=>{n.append("actor",i)}),e.actorSearch&&e.actorSearch!==""&&n.append("actor","~"+e.actorSearch),e.events?.forEach(i=>{n.append("event",i)}),e.targetSearch&&e.targetSearch!==""&&n.set("target",e.targetSearch),n},P=(e,s)=>{const n=Number.isNaN(Date.parse(e.end))?s:new Date(e.end);return{start:Number.isNaN(Date.parse(e.start))?b(n,M*-1):new Date(e.start),end:n,events:D(e.events),actors:D(e.actors),actorSearch:e.actorSearch||"",targetSearch:e.targetSearch||""}};function f1(){const{data:e,error:s}=E("/public/tailnet/-/logging/configuration/types",y);return{loaded:e!==void 0&&!s,error:s,allTypes:(r=>{for(const o in r)r[o].sortKey=o;return r})(e||{})}}function p1(){const{data:e,error:s}=E("/public/tailnet/-/logging/configuration/users",y);return{loaded:e!==void 0&&!s,error:s,allUsers:(r=>{for(const o in r)r[o].sortKey=o;return r})(e||{})}}function S1(){const e=t.useMemo(()=>T(),[]),[s,n]=z(),[r,o]=t.useState(!0),[i,l]=t.useState([]),[g,c]=t.useState(""),[h,f]=t.useState(P(s,e)),C=t.useCallback(d=>{const u={...h,...d};n(Y(u,e)),f(u)},[h,e,n]);return t.useEffect(()=>{const d=new AbortController,u=d.signal;return c(""),o(!0),x.get("/public/tailnet/-/logging/configuration",{params:q(h,e),signal:u}).then(m=>{const p=m.data;p?.status==="success"&&(p.data.logs?(p.data.logs.sort((L,v)=>new Date(v.eventTime).getTime()-new Date(L.eventTime).getTime()),l(p.data.logs)):l([])),o(!1)}).catch(m=>{m.message==="canceled"||(c("Error encountered loading audit logs. See console for more information."),console.error(m),o(!1))}),()=>{d.abort(),o(!1)}},[h,e]),{logs:i,updateLogSearchParams:C,isLoadingLogs:r,logError:g,currentParams:h}}const v1=["s3","axiom","azureblob","cribl","datadog","elastic","gcs","googlesecops","panther","splunk"];function e1(e){const s=`/public/tailnet/-/logging/${e}/stream`,{data:n}=R(),{data:r,error:o}=E(n.logStreaming?s:null,y),{mutate:i}=$(),l=O(),[g,c]=t.useState(!1);return{data:r,error:o,deleteEndpoint:()=>{c(!0),x.delete(`${s}`).then(()=>{i(s,null),l.show({message:`${N(e)} logstream endpoint deleted.`})}).catch(()=>{l.show({message:`Error encountered deleting ${e} logstream endpoint.`})}).finally(()=>c(!1))},isLoading:r===void 0,updateStreamSettings:(C,d,u,m)=>{c(!0),(C.destinationType==="s3"&&C.s3AuthenticationType==="rolearn"?()=>x.post(`/public/tailnet/-/aws-external-id/${C.s3ExternalId}/validate-aws-trust-policy`,{roleArn:C.s3RoleArn}):()=>Promise.resolve())().then(()=>x.put(s,C)).then(()=>{i(s),C.mayShareNode&&i("/machines"),C.mayUpdateACL&&i("/acls"),l.show({message:`${N(C.logType)} logstream endpoint ${d?"added":"updated"}.`}),m&&m()}).catch(L=>{if(u!==void 0){const V=L?.response?.status,j=L?.response?.data?.data?.notShared,Z=L?.response?.data?.data?.notAccessible;if(V===403&&(j||Z)){C.mayShareNode=j,C.mayUpdateACL=Z,u(C);return}}const v=L?.response?.data?.error;l.show({message:`Error encountered ${d?"adding":"updating"} ${C.logType} logstream endpoint${typeof v=="string"?": "+v:"."}`,variant:"danger"})}).finally(()=>c(!1))},logstreamChangeInProgress:g}}function t1(e){return E(`/public/tailnet/-/logging/${e}/stream/status`,{refreshInterval:3e4})}const n1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 -3.5 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M5.07258 3.90819C5.06659 4.0877 5.09054 4.26722 5.13843 4.44076C5.19231 4.59036 5.25816 4.73397 5.33 4.87161C5.35395 4.91349 5.37191 4.96137 5.37191 5.00924C5.36592 5.08105 5.32402 5.15285 5.25816 5.18876L4.88101 5.44008C4.83311 5.47001 4.77923 5.49394 4.72535 5.49394C4.6595 5.48796 4.59365 5.45804 4.54576 5.41016C4.46793 5.32639 4.3901 5.23065 4.33024 5.12892C4.27037 5.02719 4.21051 4.91349 4.14465 4.77586C3.6777 5.32639 3.09101 5.60165 2.38459 5.60165C1.88172 5.60165 1.48061 5.45804 1.18727 5.17081C0.893928 4.88357 0.744263 4.5006 0.744263 4.02188C0.744263 3.51324 0.923861 3.10035 1.28904 2.78918C1.65423 2.47801 2.13914 2.32243 2.75576 2.32243C2.96529 2.32243 3.18081 2.34038 3.39034 2.3703C3.61185 2.40022 3.83934 2.44809 4.0788 2.50195V2.06512C4.0788 1.61033 3.98302 1.29318 3.79743 1.10768C3.61185 0.922177 3.28258 0.832417 2.82161 0.832417C2.6061 0.832417 2.38459 0.856353 2.17506 0.910209C1.95356 0.964065 1.73804 1.02989 1.52851 1.11366C1.46266 1.14358 1.39082 1.16752 1.31898 1.19146C1.28904 1.20342 1.25312 1.20941 1.22319 1.20941C1.13938 1.20941 1.09747 1.14957 1.09747 1.0239V0.730689C1.09149 0.658882 1.10945 0.587074 1.13938 0.52125C1.18727 0.467394 1.24115 0.425506 1.307 0.395586C1.54647 0.275907 1.79791 0.186147 2.06132 0.126307C2.36663 0.0485152 2.68392 0.0126113 2.99523 0.0126113C3.70763 0.0126113 4.22847 0.174179 4.56372 0.497314C4.89897 0.820449 5.0606 1.31114 5.0606 1.96937V3.90819H5.07258ZM2.64202 4.81775C2.85155 4.81775 3.06108 4.78185 3.25864 4.71004C3.48014 4.63225 3.67171 4.5006 3.82736 4.32706C3.92315 4.21935 3.99499 4.0877 4.03091 3.94409C4.07281 3.77654 4.09077 3.59702 4.09077 3.42348V3.17215C3.91118 3.13027 3.72559 3.09436 3.54001 3.07043C3.35442 3.04649 3.16285 3.03452 2.97727 3.03452C2.57616 3.03452 2.28282 3.11231 2.08526 3.27388C1.8877 3.43545 1.79192 3.66284 1.79192 3.96204C1.79192 4.24329 1.86376 4.45273 2.01342 4.59634C2.16309 4.73996 2.36663 4.81775 2.64202 4.81775ZM7.44926 5.46402C7.37143 5.47001 7.28762 5.45205 7.22177 5.40418C7.1619 5.33836 7.11401 5.26057 7.09605 5.17081L5.6892 0.545186C5.65926 0.467394 5.6413 0.389602 5.63532 0.305827C5.62933 0.234019 5.67722 0.168195 5.74906 0.156227H6.37167C6.48542 0.156227 6.56324 0.174179 6.60515 0.216067C6.64705 0.257955 6.68896 0.335746 6.72488 0.449442L7.72464 4.41084L8.65855 0.449442C8.68849 0.329762 8.72441 0.251971 8.7723 0.216067C8.84414 0.174179 8.92795 0.150243 9.01176 0.156227H9.49069C9.60444 0.156227 9.68226 0.174179 9.73016 0.216067C9.79002 0.281891 9.83193 0.359682 9.8439 0.449442L10.7898 4.45871L11.8255 0.449442C11.8434 0.359682 11.8853 0.281891 11.9452 0.216067C12.017 0.174179 12.0949 0.150243 12.1787 0.156227H12.7354C12.8073 0.144259 12.8731 0.198115 12.8851 0.269923V0.305827C12.8851 0.335746 12.8791 0.37165 12.8731 0.40157C12.8611 0.455426 12.8492 0.503298 12.8312 0.55117L11.3884 5.17679C11.3525 5.29647 11.3106 5.37426 11.2627 5.41016C11.1969 5.45205 11.1131 5.47599 11.0352 5.47001H10.5204C10.4066 5.47001 10.3288 5.45205 10.2809 5.41016C10.2211 5.34434 10.1792 5.26057 10.1672 5.17081L9.23925 1.31114L8.31732 5.16482C8.30534 5.25458 8.26344 5.33836 8.20357 5.40418C8.13173 5.45205 8.04792 5.47001 7.96411 5.46402H7.44926ZM15.142 5.62559C14.8307 5.62559 14.5194 5.58968 14.2201 5.51788C13.9208 5.44607 13.6873 5.36828 13.5316 5.27852C13.4538 5.24261 13.388 5.18277 13.3461 5.11097C13.3221 5.05711 13.3101 5.00325 13.3101 4.94341V4.63823C13.3101 4.51257 13.358 4.45273 13.4478 4.45273C13.4838 4.45273 13.5197 4.45871 13.5556 4.47068C13.5915 4.48265 13.6454 4.50658 13.7053 4.53052C13.9148 4.62626 14.1363 4.69209 14.3638 4.73996C14.5973 4.78783 14.8367 4.81177 15.0762 4.81177C15.4533 4.81177 15.7467 4.74594 15.9502 4.6143C16.1478 4.49462 16.2675 4.27919 16.2615 4.04582C16.2675 3.89023 16.2077 3.74063 16.0999 3.62694C15.9921 3.51324 15.7886 3.41151 15.4953 3.31577L14.6272 3.04649C14.1902 2.90886 13.8669 2.7054 13.6693 2.43612C13.4778 2.1848 13.37 1.8856 13.37 1.56845C13.364 1.33507 13.4179 1.10768 13.5316 0.904225C13.6394 0.712737 13.7831 0.545186 13.9627 0.413538C14.1483 0.269923 14.3578 0.168195 14.5853 0.102371C14.8307 0.0305633 15.0822 -0.00534065 15.3396 0.000643339C15.4713 0.000643339 15.609 0.00662732 15.7407 0.0245793C15.8784 0.0425312 16.0041 0.0664672 16.1298 0.0904031C16.2556 0.114339 16.3633 0.150243 16.4711 0.186147C16.5609 0.216067 16.6447 0.251971 16.7225 0.293859C16.7943 0.329762 16.8542 0.377634 16.9021 0.443458C16.944 0.503298 16.962 0.569122 16.956 0.64093V0.922177C16.956 1.04784 16.9081 1.11366 16.8183 1.11366C16.7405 1.1017 16.6626 1.07776 16.5908 1.04186C16.2316 0.880289 15.8365 0.802497 15.4414 0.808481C15.1001 0.808481 14.8307 0.862337 14.6452 0.976033C14.4596 1.08973 14.3638 1.26326 14.3638 1.50861C14.3578 1.67017 14.4237 1.82576 14.5434 1.93347C14.6631 2.04717 14.8846 2.16086 15.2019 2.26259L16.052 2.53187C16.483 2.6695 16.7943 2.86099 16.9799 3.10633C17.1655 3.34569 17.2613 3.64489 17.2553 3.94409C17.2613 4.18345 17.2074 4.42281 17.0997 4.63823C16.9919 4.84169 16.8422 5.02121 16.6626 5.16482C16.4651 5.32041 16.2376 5.4341 15.9981 5.49992C15.7227 5.5837 15.4354 5.62559 15.142 5.62559Z",fill:"var(--icon-color, #252F3E)"}),t.createElement("path",{d:"M16.2735 8.53394C14.3039 9.98805 11.4423 10.76 8.98182 10.76C5.53354 10.76 2.42649 9.4854 0.0797426 7.36707C-0.105842 7.19951 0.0617828 6.97212 0.283287 7.10377C2.82161 8.57583 5.9526 9.46744 9.19135 9.46744C11.5261 9.45548 13.837 8.98274 15.9862 8.07916C16.3154 7.92956 16.5968 8.29458 16.2735 8.53394Z",fill:"#FF9900"}),t.createElement("path",{d:"M17.0937 7.60057C16.8422 7.27744 15.4294 7.44499 14.7888 7.52278C14.5973 7.54672 14.5673 7.37917 14.7409 7.2535C15.8664 6.46362 17.7163 6.69101 17.9318 6.9543C18.1473 7.2176 17.8719 9.07263 16.8183 9.95826C16.6567 10.0959 16.501 10.0241 16.5729 9.84457C16.8123 9.25215 17.3451 7.91773 17.0937 7.60057Z",fill:"#FF9900"})),a1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("g",{clipPath:"url(#clip0_18007_2680)"},t.createElement("path",{d:"M17.8684 12.0778L14.0233 5.64256C13.847 5.34679 13.4125 5.10482 13.0577 5.10482H10.6572C10.0993 5.10482 9.87055 4.72465 10.1488 4.26001L11.4653 2.06257C11.5697 1.88818 11.5695 1.67348 11.4647 1.49927C11.3599 1.32506 11.1663 1.21777 10.9569 1.21777H7.60813C7.25333 1.21777 6.81794 1.45922 6.64044 1.75432L0.133221 12.5734C-0.0443274 12.8685 -0.0443956 13.3514 0.132948 13.6466L1.80731 16.4332C2.08632 16.8975 2.54382 16.898 2.82399 16.4344L4.13228 14.2695C4.41252 13.8059 4.86995 13.8064 5.14896 14.2707L6.33505 16.2447C6.5124 16.5399 6.94774 16.7814 7.30249 16.7814H15.0408C15.3954 16.7814 15.8309 16.5399 16.0082 16.2447L17.8664 13.1522C18.0438 12.8571 18.0446 12.3736 17.8684 12.0778ZM12.6755 11.7681C12.9528 12.2333 12.7231 12.6139 12.1652 12.6139H6.14607C5.58813 12.6139 5.35986 12.2341 5.63885 11.7698L8.65071 6.7572C8.92971 6.2929 9.3862 6.29295 9.6652 6.75725L12.6755 11.7681Z",fill:"var(--icon-color, black)"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_18007_2680"},t.createElement("rect",{width:18,height:15.564,fill:"white",transform:"translate(0 1.21777)"})))),s1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M8.32722 15.2264C9.74226 14.9768 11.1571 14.7264 12.5719 14.4752L12.6117 14.4666L10.4284 11.8696C9.22758 10.4413 8.2451 9.26714 8.2451 9.26047C8.2451 9.24766 10.4995 3.03933 10.5122 3.0172C10.5164 3.00988 12.0507 5.65865 14.2313 9.43816C16.2728 12.9765 17.9559 15.8939 17.9716 15.9212L18 15.9709L11.0613 15.97L4.12255 15.969L8.32722 15.2264ZM0 14.4344C0 14.4307 1.02876 12.6449 2.28616 10.4658L4.57232 6.50387L7.23654 4.2681C8.70182 3.03842 9.90471 2.03069 9.90955 2.02886C9.91431 2.02703 9.8951 2.0755 9.86666 2.13659C9.83831 2.19777 8.53647 4.99004 6.97371 8.34172L4.13224 14.4357L2.06612 14.4384C0.92981 14.4399 0 14.438 0 14.4344Z",fill:"#0089D6"})),r1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M8.37639 3.80309C8.47916 3.86234 8.4724 3.94446 8.36105 3.98571L1.84949 6.39813C1.78012 6.43258 1.69611 6.4045 1.66161 6.33508C1.64961 6.31109 1.64474 6.28451 1.64774 6.25786V0.132932C1.64774 0.0144298 1.73174 -0.0339423 1.83449 0.0253109L8.37639 3.80309ZM9.92555 4.69672C9.80517 4.63597 9.66607 4.62397 9.53704 4.66372L1.84837 7.51224C1.73099 7.56248 1.65262 7.675 1.64624 7.80246V8.26189C1.64662 8.38077 1.74299 8.47678 1.86149 8.47711H16.2556C16.3741 8.47711 16.3872 8.42874 16.2845 8.37024L9.92555 4.69672Z",fill:"#00CCCC"}),t.createElement("path",{d:"M1.8341 17.975C1.73135 18.0342 1.64735 17.9854 1.64735 17.8673V11.7424C1.64435 11.7158 1.64922 11.6888 1.66122 11.6652C1.69572 11.5957 1.7801 11.5677 1.8491 11.6021L8.36064 14.0145C8.47205 14.0558 8.47875 14.1375 8.37605 14.1972L1.8341 17.975Z",fill:"#00CCCC"}),t.createElement("path",{d:"M16.2844 9.62939C16.3871 9.57121 16.374 9.52246 16.2555 9.52246H1.86173C1.74286 9.52285 1.64686 9.61925 1.64648 9.73774V10.1971C1.65286 10.3246 1.73123 10.4371 1.84861 10.4874L9.5373 13.3359C9.66633 13.3756 9.80543 13.3637 9.92581 13.3029L16.2844 9.62939Z",fill:"#00CCCC"})),o1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.6785 12.7798L13.1804 11.7923L11.931 13.8792L10.4781 13.4547L9.19846 15.4075L9.26417 16.022L16.2202 14.7406L15.8161 10.3945L14.6785 12.7798ZM8.19142 10.9069L9.30769 10.7533C9.48796 10.8341 9.61406 10.8652 9.83074 10.9202C10.1682 11.0081 10.558 11.0925 11.1362 10.8012C11.2703 10.7346 11.5509 10.478 11.6637 10.3323L16.2362 9.50291L16.7024 15.1482L8.86899 16.5602L8.19142 10.9069ZM16.6846 8.8724L16.2335 8.95854L15.3668 0L0.592468 1.71303L2.41295 16.4838L4.14196 16.2325C4.00432 16.0353 3.78852 15.7964 3.42176 15.491C2.91203 15.0682 3.0923 14.3489 3.39334 13.8952C3.7903 13.1288 5.839 12.1537 5.72267 10.9282C5.68093 10.4824 5.60989 9.90253 5.19606 9.50468C5.18097 9.66986 5.2085 9.82882 5.2085 9.82882C5.2085 9.82882 5.03888 9.61214 4.95363 9.31642C4.86927 9.20275 4.80355 9.16723 4.71386 9.01537C4.64992 9.19032 4.6588 9.39368 4.6588 9.39368C4.6588 9.39368 4.52027 9.0651 4.49718 8.78804C4.41459 8.91236 4.39416 9.14769 4.39416 9.14769C4.39416 9.14769 4.21389 8.62997 4.25474 8.35112C4.17215 8.10869 3.92794 7.62737 3.99721 6.5333C4.44833 6.84945 5.44116 6.77396 5.82746 6.20384C5.95623 6.01469 6.04414 5.49963 5.76352 4.4846C5.58325 3.83367 5.13745 2.86393 4.9634 2.49539L4.94297 2.51049C5.03444 2.80709 5.22359 3.42783 5.29641 3.72976C5.51576 4.64356 5.57437 4.96148 5.47136 5.38241C5.38344 5.74828 5.17386 5.98805 4.64104 6.25624C4.10822 6.52531 3.40134 5.87083 3.35605 5.83531C2.83832 5.42326 2.43781 4.75012 2.39341 4.42332C2.34723 4.06544 2.59944 3.85054 2.72731 3.55837C2.54527 3.61077 2.34191 3.70312 2.34191 3.70312C2.34191 3.70312 2.58434 3.45181 2.88361 3.23513C3.00794 3.15343 3.07987 3.10103 3.21041 2.99269C3.02126 2.99003 2.86762 2.99447 2.86762 2.99447C2.86762 2.99447 3.18288 2.82396 3.50968 2.70053C3.27079 2.68987 3.04168 2.69875 3.04168 2.69875C3.04168 2.69875 3.74501 2.38439 4.30003 2.1535C4.68189 1.9972 5.05487 2.04338 5.26444 2.3462C5.53974 2.74315 5.82835 2.95895 6.4411 3.09304C6.81762 2.92609 6.93129 2.84084 7.40373 2.71207C7.81933 2.25473 8.14613 2.19523 8.14613 2.19523C8.14613 2.19523 7.98451 2.34354 7.94099 2.57709C8.17721 2.39149 8.43563 2.23608 8.43563 2.23608C8.43563 2.23608 8.33528 2.35952 8.24204 2.55578L8.26335 2.58775C8.53864 2.42257 8.86189 2.29292 8.86189 2.29292C8.86189 2.29292 8.76953 2.41014 8.66119 2.56111C8.86899 2.55933 9.28992 2.56999 9.45244 2.58863C10.4168 2.60995 10.6167 1.55851 10.987 1.42708C11.4505 1.2619 11.6574 1.16156 12.4469 1.93681C13.1245 2.60284 13.6538 3.7937 13.3909 4.061C13.1707 4.28212 12.7355 3.97486 12.2542 3.37366C11.9993 3.05574 11.8075 2.6801 11.7169 2.20234C11.6406 1.79917 11.3448 1.56561 11.3448 1.56561C11.3448 1.56561 11.5162 1.94836 11.5162 2.28581C11.5162 2.47053 11.5393 3.15964 11.835 3.54594C11.8057 3.60278 11.7924 3.82567 11.7596 3.8683C11.4159 3.4527 10.677 3.1552 10.5572 3.06729C10.9648 3.40119 11.9016 4.16846 12.2613 4.90375C12.6014 5.59909 12.4007 6.2367 12.573 6.40187C12.6218 6.44894 13.3048 7.29968 13.4362 7.72772C13.6653 8.47278 13.4495 9.25603 13.1502 9.74179L12.3128 9.87233C12.1903 9.83859 12.1077 9.82083 11.9976 9.75778C12.0579 9.65032 12.1787 9.38302 12.1796 9.32796L12.1325 9.24538C11.8715 9.6148 11.4354 9.97357 11.0722 10.1796C10.5971 10.4487 10.0501 10.4069 9.69398 10.2968C8.68251 9.98511 7.72609 9.30132 7.49609 9.12194C7.49609 9.12194 7.48898 9.26491 7.5325 9.29777C7.78736 9.58549 8.37169 10.1059 8.93649 10.4682L7.73319 10.6005L8.30243 15.031C8.05022 15.0674 8.01115 15.0851 7.73497 15.1242C7.49165 14.2646 7.02631 13.7024 6.51747 13.3756C6.06901 13.087 5.45004 13.0222 4.85683 13.1394L4.81865 13.1838C5.2307 13.1412 5.71734 13.2007 6.21642 13.5168C6.70662 13.8268 7.1018 14.6278 7.24744 15.11C7.43392 15.7263 7.56269 16.3852 7.06095 17.0841C6.70395 17.5805 5.66317 17.8549 4.82131 17.2617C5.04599 17.6231 5.34969 17.9189 5.75819 17.9739C6.36561 18.0565 6.94195 17.9508 7.33802 17.5441C7.67636 17.196 7.85663 16.4678 7.80868 15.7014L8.34416 15.6242L8.53776 16.9997L17.4075 15.9314L16.6846 8.8724ZM11.288 5.13553C11.2631 5.19237 11.2241 5.22878 11.2827 5.4126L11.2862 5.42326L11.2951 5.44723L11.3191 5.50229C11.4248 5.7172 11.5402 5.92056 11.7329 6.02446C11.7827 6.01647 11.835 6.01025 11.8883 6.00759C12.0695 5.99959 12.184 6.02801 12.2569 6.06797C12.2631 6.03156 12.2649 5.97917 12.2604 5.90102C12.2462 5.62839 12.3146 5.16484 11.7906 4.92063C11.5926 4.82916 11.3155 4.85669 11.2232 4.97213C11.2401 4.97391 11.2552 4.97746 11.2667 4.9819C11.4079 5.02985 11.3138 5.07781 11.288 5.13553ZM12.7568 7.67976C12.6885 7.64158 12.367 7.65667 12.1414 7.68332C11.7116 7.73393 11.2472 7.88312 11.145 7.96216C10.9603 8.10513 11.0438 8.35467 11.1806 8.4568C11.5642 8.74275 11.8999 8.93545 12.2542 8.88838C12.4718 8.85997 12.6636 8.51541 12.7995 8.20193C12.8936 7.98703 12.8936 7.75525 12.7568 7.67976ZM8.94981 5.47299C9.07147 5.35754 8.34594 5.20657 7.78292 5.59021C7.36821 5.87349 7.35489 6.48091 7.75184 6.82458C7.7918 6.85833 7.82466 6.88319 7.85485 6.90273C7.97119 6.84767 8.10351 6.79261 8.25536 6.74377C8.51289 6.66029 8.72602 6.61678 8.90185 6.59458C8.98622 6.50045 9.0839 6.33527 9.05903 6.036C9.02618 5.62839 8.71803 5.69322 8.94981 5.47299Z",fill:"var(--icon-color, black)"})),i1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M13.1401 6.2998H8.43762C8.46012 6.41231 8.50512 6.52481 8.52762 6.61481C8.68512 7.15481 8.77512 7.71731 8.82012 8.30231C8.84262 8.52731 8.84262 8.77481 8.84262 8.99981C8.84262 9.22481 8.84262 9.47232 8.82012 9.69732C8.77512 10.2823 8.68512 10.8448 8.52762 11.3848C8.50512 11.4973 8.46012 11.6098 8.43762 11.6998H13.1401C14.6251 11.6998 15.8176 10.4848 15.8176 8.99981C15.8176 7.51481 14.6251 6.2998 13.1401 6.2998Z",fill:"#00A9E5"}),t.createElement("path",{d:"M8.81979 9.69732C8.84229 9.47232 8.84229 9.22481 8.84229 8.99981C8.84229 8.77481 8.84229 8.52731 8.81979 8.30231C8.77479 7.71731 8.68479 7.15481 8.52729 6.61481C8.50479 6.50231 8.45979 6.3898 8.43729 6.2998H1.16977C0.89977 7.15481 0.764771 8.05481 0.764771 8.99981C0.764771 9.94482 0.89977 10.8448 1.16977 11.6998H8.43729C8.45979 11.5873 8.50479 11.4748 8.52729 11.3848C8.68479 10.8448 8.77479 10.2823 8.81979 9.69732Z",fill:"#353535"}),t.createElement("path",{d:"M13.95 12.6001H8.09999C7.91999 13.0051 7.71749 13.3876 7.49249 13.7476C7.15499 14.3101 6.74999 14.8051 6.29999 15.2776C6.14249 15.4351 5.98499 15.5701 5.82748 15.7276C5.51248 16.0201 5.15248 16.2676 4.79248 16.5151C6.20998 17.4601 7.91999 18.0001 9.7425 18.0001C12.87 18.0001 15.615 16.4026 17.235 13.9951C16.4025 13.1401 15.2325 12.6001 13.95 12.6001Z",fill:"#00BFB3"}),t.createElement("path",{d:"M7.49283 13.7476C7.71783 13.3876 7.92033 13.0051 8.10033 12.6001H1.50781C2.20531 14.1976 3.35282 15.5701 4.81532 16.5151C5.17532 16.2676 5.51283 16.0201 5.85033 15.7276C6.00783 15.5926 6.16533 15.4351 6.32283 15.2776C6.75033 14.8276 7.15533 14.3101 7.49283 13.7476Z",fill:"#019B8F"}),t.createElement("path",{d:"M6.29988 2.72237C6.14238 2.56487 5.98488 2.42987 5.82738 2.27237C5.51238 1.97986 5.15237 1.73236 4.79237 1.48486C3.35237 2.42987 2.20487 3.80237 1.48486 5.39988H8.07738C7.89738 4.99487 7.69488 4.61237 7.46988 4.25237C7.15488 3.68987 6.74988 3.17237 6.29988 2.72237Z",fill:"#F9B110"}),t.createElement("path",{d:"M9.7425 0C7.91999 0 6.20998 0.540001 4.79248 1.485C5.15248 1.7325 5.48998 1.98001 5.82748 2.27251C5.98499 2.40751 6.14249 2.56501 6.29999 2.72251C6.74999 3.19501 7.15499 3.69001 7.49249 4.25251C7.71749 4.61251 7.91999 4.99502 8.09999 5.40002H13.95C15.2325 5.40002 16.4025 4.86002 17.235 4.00501C15.615 1.59751 12.87 0 9.7425 0Z",fill:"#FED10A"})),C1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 -1 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M11.6416 5.3127L13.0324 3.92196L13.1251 3.33636C10.5908 1.03191 6.56215 1.29321 4.27758 3.88159C3.64298 4.60049 3.17219 5.49676 2.92114 6.42227L3.41924 6.35209L6.20067 5.89342L6.41541 5.67381C7.65266 4.315 9.74462 4.1322 11.1732 5.28833L11.6416 5.3127Z",fill:"#EA4335"}),t.createElement("path",{d:"M15.0129 6.38091C14.6932 5.20372 14.0369 4.14546 13.1244 3.33594L11.1725 5.28784C11.9967 5.96131 12.4662 6.97588 12.4461 8.04002V8.3865C13.4055 8.3865 14.1833 9.16428 14.1833 10.1237C14.1833 11.0831 13.4055 11.8414 12.4461 11.8414H8.96685L8.62524 12.2123V14.2959L8.96685 14.6228H12.4461C14.9416 14.6423 16.9804 12.6545 16.9998 10.159C17.0116 8.64643 16.2658 7.22837 15.0129 6.38091Z",fill:"#4285F4"}),t.createElement("path",{d:"M5.49294 14.6173H8.96733V11.8358H5.49294C5.24539 11.8357 5.00565 11.7826 4.78054 11.6797L4.28762 11.8309L2.88713 13.2217L2.76514 13.695C3.55054 14.2881 4.5088 14.6215 5.49294 14.6173Z",fill:"#34A853"}),t.createElement("path",{d:"M5.49167 5.60159C2.99611 5.61647 0.985208 7.65162 1.00008 10.1471C1.00839 11.5407 1.65924 12.8525 2.76387 13.702L4.77927 11.6867C3.90488 11.2916 3.51633 10.2626 3.91138 9.38828C4.30636 8.51395 5.33543 8.1254 6.2097 8.52039C6.595 8.69444 6.90354 9.00305 7.0776 9.38828L9.093 7.37294C8.23548 6.25193 6.90304 5.59653 5.49167 5.60159Z",fill:"#FBBC05"})),l1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M17.9291 3.44745L16.4709 6.14612C16.4398 6.20251 16.4282 6.26665 16.4379 6.33083L16.9687 10.3011C16.9939 10.4877 16.9123 10.6744 16.7567 10.7813L13.7353 12.8928C13.6886 12.9259 13.6536 12.9686 13.6303 13.0211L12.1468 16.4567C12.0632 16.6492 11.8863 16.7853 11.6782 16.8164L9.11955 17.1897C9.04177 17.2014 8.964 17.2014 8.88622 17.1897L6.32754 16.8164C6.11951 16.7853 5.94258 16.6492 5.85895 16.4567L4.37548 13.0211C4.35409 12.9686 4.31715 12.9259 4.27049 12.8928L1.24906 10.7832C1.09351 10.6744 1.01186 10.4897 1.03713 10.303L1.56792 6.33277C1.5757 6.26863 1.56403 6.20445 1.53487 6.14805L0.0727621 3.44745C0.0202664 3.34829 -0.00500939 3.23552 0.00082348 3.12275L0.0708182 1.94062C0.0844278 1.72286 0.210807 1.53038 0.40718 1.43317L1.23934 1.02097C1.4746 0.904317 1.75458 0.917927 1.97817 1.05792L3.84663 2.22643C3.92051 2.2731 4.01189 2.28477 4.0955 2.25949L8.76569 0.836267C8.91931 0.789604 9.08259 0.789604 9.23621 0.836267L13.9064 2.25949C13.99 2.28477 14.0814 2.2731 14.1553 2.22643L16.0237 1.05792C16.2473 0.917927 16.5273 0.904317 16.7626 1.02097L17.5927 1.43317C17.7872 1.53038 17.9155 1.72286 17.9291 1.94062L17.9991 3.12275C18.0049 3.23552 17.9816 3.34829 17.9272 3.44745H17.9291Z",fill:"var(--icon-color, black)"})),c1=e=>t.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.599976 18L0.599976 14.4L15 9.6L0.599976 3.3552L0.599976 0L17.4 7.2V12L0.599976 18Z",fill:"#77B539"})),d1={s3:{name:"AWS S3",Icon:n1},axiom:{name:"Axiom",Icon:a1},azureblob:{name:"Azure",Icon:s1},cribl:{name:"Cribl",Icon:r1},datadog:{name:"Datadog",Icon:o1},elastic:{name:"Elasticsearch",Icon:i1},gcs:{name:"Google Cloud",Icon:C1},googlesecops:{name:"Google SecOps",Icon:X},panther:{name:"Panther",Icon:l1},splunk:{name:"Splunk",Icon:c1}},g1="border-border-base py-3 px-4 max-w-lg items-center gap-2 flex";function w1({className:e,streamType:s}){const{data:n,isLoading:r,error:o,deleteEndpoint:i}=e1(s),{access:l}=U(K.LogStreaming),g=!W(l),c=G(!1),[,h]=_(),f=t.useMemo(()=>s==="network"?"/admin/logs/network/setup":"/admin/logs/configuration/setup",[s]),C=()=>{i(),c.setFalse()};let d=n?.url;return n&&n.destinationType==="s3"&&!d&&(d=`https://${n.s3Bucket}.s3.${n.s3Region}.amazonaws.com`),a.jsx("div",{className:F(g1,e),children:r&&!o?a.jsx(I,{}):a.jsxs(a.Fragment,{children:[n?a.jsx(u1,{endpoint:n}):a.jsx("span",{className:"text-lg font-medium",children:"Not streaming"}),n?a.jsxs("div",{className:"ml-auto flex items-center gap-6",children:[a.jsx("div",{className:"flex",children:d1[n.destinationType]?.Icon({className:"h-[18px] w-[18px] dark:[--icon-color:#fff]"})}),a.jsxs(w,{asChild:!0,onCloseAutoFocus:u=>u.preventDefault(),trigger:a.jsx("div",{className:"ml-auto",children:a.jsx(S,{content:g?A:void 0,children:a.jsx(H,{className:"font-normal",sizeVariant:"medium",suffixIcon:a.jsx(J,{}),disabled:g,children:"Actions"})})}),children:[a.jsx(w.Item,{className:"w-40",onSelect:()=>h(f),disabled:g,children:"Edit…"}),a.jsx(w.Separator,{}),a.jsx(w.Item,{intent:"danger",className:"w-40",onSelect:c.setTrue,disabled:g,children:"Delete…"})]}),a.jsx(k,{open:c.value,onOpenChange:c.toggle,title:`Delete ${s} endpoint?`,children:a.jsxs(k.Form,{destructive:!0,submitButton:"Delete",cancelButton:"Cancel",onSubmit:C,children:[a.jsx("p",{className:"mb-2",children:"Are you sure you want to delete the endpoint at:"}),a.jsx("pre",{className:"break-all whitespace-normal",children:d})]})})]}):a.jsx("div",{className:"ml-auto",children:a.jsx(S,{content:g?A:void 0,children:a.jsx(H,{className:"font-normal",sizeVariant:"medium",onClick:()=>h(f),disabled:g,children:"Start streaming…"})})})]})})}const h1="0001-01-01T00:00:00Z";function u1({endpoint:e}){const{data:s,error:n,isLoading:r}=t1(e.logType),o=t.useMemo(()=>{let l=s?.lastActivity;return l===h1&&(l=void 0),l?new Date(l):void 0},[s?.lastActivity]),i=t.useMemo(()=>n?"unknown":s?.lastError?"unhealthy":"healthy",[n,s]);return r?a.jsx(I,{}):a.jsxs("div",{className:"flex items-center",children:[a.jsx(S,{content:i==="healthy"&&o?`Last successful activity ${Q(o)}`:void 0,children:a.jsx("span",{className:F("block w-2 h-2 rounded-full ml-1",{"bg-green-300 dark:bg-green-500":i==="healthy","bg-red-400 dark:bg-red-500":i==="unhealthy","bg-orange-200 dark:bg-orange-300":i==="unknown"})})}),a.jsx("span",{className:"text-lg font-medium mx-3",children:"Streaming"}),i==="unhealthy"?a.jsx(S,{content:a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"font-medium mb-2",children:"Last error received from publisher:"}),a.jsx("code",{className:"break-words",children:s?.lastError||"Unknown"})]}),children:a.jsx(B,{variant:"status",color:"red",className:"text-sm",children:"Failed"})}):i==="unknown"&&a.jsx(S,{content:"Unable to retrieve status from publisher. Please try again later.",children:a.jsx(B,{variant:"status",color:"orange",className:"text-sm",children:"Unknown"})})]})}export{w1 as L,d1 as a,v1 as b,p1 as c,S1 as d,e1 as e,g1 as l,f1 as u};