1import{bL as A,cl as S,r as s,bQ as W,ab as F,de as R,ao as U,an as H,j as e,dj as C,d7 as L}from"./vendor-ct_YKIP6_bundle.js";import{ac as M,ad as D,C as B,a3 as h,ab as V,ae as G}from"./slackIntegration-mZcBTumD_bundle.js";import{F as c,d as _,ae as z,ab as K,ac as Q,ad as J,et as Y,rM as $,T as o,df as q,H as X,ec as Z,a8 as ee,rJ as n,A as u,l as te,rN as se,a as ae,an as oe,G as ne,am as re,a4 as j,z as ie}from"./registration-BfOA5mCx_bundle.js";import"./moment-DyvZl3Ud_bundle.js";import{S as le}from"./light-hint-1wBrNS3a_bundle.js";import{W as ce}from"./constants-CpLtZ4ZH_bundle.js";import"./datadog-DxmyjtSX_bundle.js";import"./sentry-DLDmuXKN_bundle.js";const ue=A(c)` 2 padding: 0px 0px 0px 8px; 3`,de={targetURL:{...$,presence:{allowEmpty:!1}}},pe=a=>{const{t}=S(),r=s.useContext(W),i=_(),{config:l,enabledEvents:m}=s.useMemo(()=>F(a.initialValues)?{config:{url:""},enabledEvents:[]}:{...a.initialValues},[a.initialValues]),b=s.useMemo(()=>l?.url,[l]),x=s.useMemo(()=>z(m),[m]),{updateTeamsOrWebhooks:g}=K(),{featureFlags:E}=Q(),y=s.useMemo(()=>J(!!E?.enablePoJobAlertTriggers),[E?.enablePoJobAlertTriggers]),d=s.useMemo(()=>({targetURL:b,...x}),[b,x]),f=R({mode:"onChange",criteriaMode:"all",defaultValues:d,resolver:p=>Y(p,de)}),{handleSubmit:N,register:k,getFieldState:I,formState:{isDirty:O,errors:w},reset:T}=f,P=U(H(w))>0;s.useEffect(()=>{T(d)},[T,d]);const v=p=>{i({type:u.UPDATE_TEAMS_OR_WEBHOOKS_REQUEST,payload:{integrationName:n,values:p}})};return e.jsx(M,{"data-testid":"webhooks",children:e.jsx(C,{...f,children:e.jsxs("form",{onSubmit:N(v),children:[e.jsxs(c,{children:[e.jsx(o,{block:!0,neutral700:!0,size:"20px",children:t("webhooks.add_url")}),e.jsx(ue,{center:!0,children:e.jsx(q,{content:e.jsx(o,{white:!0,lineHeight:"20px",size:"12px",children:t("webhooks.url_tooltip")}),iconHoverColor:r.text.neutral700,icon:e.jsx(c,{children:e.jsx(le,{})})})})]}),e.jsx(X,{bottom:16,top:24,children:e.jsx(Z,{"data-testid":"webhooks-target-url",type:"text",...k("targetURL"),label:t("webhooks.target_url"),...I("targetURL"),placeholder:t("webhooks.target_url_label")})}),e.jsxs(c,{column:!0,children:[e.jsx(o,{block:!0,neutral700:!0,offsets:{mb:12},size:"20px",children:t("webhooks.select_events")}),e.jsx(o,{block:!0,neutral500:!0,size:"12px",children:t("webhooks.description")})]}),e.jsx(D,{parents:y}),e.jsx(ee,{"data-testid":"submit-button",disabled:!O||P||g,disableStyleType:"transparent",offsetType:"clear",showSpinner:g,styleType:"brandCTA",type:"submit",children:t("common.save_changes")})]})})})},je=()=>{const{t:a}=S(),t=_(),r=te(se),{planFeatures:i,mark:{base:l}}=ae();return oe({enterEvent:()=>ne.viewIntegrationPage({integration:n})}),L(()=>{i.webhooksIntegrationEnabled?t({type:u.GET_INTEGRATION_DATA_REQUEST,payload:{integrationName:n}}):t({type:u.SHOW_POPUP,popupType:re.WEBHOOKS_INTEGRATION,meta:{plan:l,when:"after",featureInfo:ce}})}),e.jsxs(B,{$greyBg:!0,children:[e.jsx(h.DefaultHeader,{innerDelimiter:!0,offsets:{pt:32},children:e.jsxs(h.HeaderContent,{left:0,maxWidth:800,right:0,children:[e.jsx(V,{}),e.jsx(o,{as:"h1",children:a("settings.webhooks")})]})}),e.jsx(h.Body,{left:0,maxWidth:800,right:0,children:e.jsxs(j,{when:i.webhooksIntegrationEnabled,children:[e.jsx(pe,{initialValues:r}),e.jsx(j,{when:ie(r?.config?.url),children:e.jsx(G,{integrationName:n,title:a("webhooks.headline"),onSubmit:()=>t({type:u.DISCONNECT_INTEGRATION_REQUEST,payload:{integrationName:n,data:{config:{url:""},enabledEvents:[]}}})})})]})})]})};export{je as default}; 4//# sourceMappingURL=webhooks-BEBRlziT_bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.