1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{78935:(e,l,n)=>{n.d(l,{A:()=>x,S:()=>m});var t=n(95155),r=n(49395),s=n(12115);function i(e,l){if("function"==typeof e)return e(l);null!=e&&(e.current=l)}var a=s.forwardRef((e,l)=>{let{children:n,...r}=e,i=s.Children.toArray(n),a=i.find(o);if(a){let e=a.props.children,n=i.map(l=>l===a?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:l);return(0,t.jsx)(d,{...r,ref:l,children:s.isValidElement(e)?s.cloneElement(e,void 0,n):null})}return(0,t.jsx)(d,{...r,ref:l,children:n})});a.displayName="Slot";var d=s.forwardRef((e,l)=>{let{children:n,...t}=e;if(s.isValidElement(n)){let e=function(e){var l,n;let t=null==(l=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}(n);return s.cloneElement(n,{...function(e,l){let n={...l};for(let t in l){let r=e[t],s=l[t];/^on[A-Z]/.test(t)?r&&s?n[t]=(...e)=>{s(...e),r(...e)}:r&&(n[t]=r):"style"===t?n[t]={...r,...s}:"className"===t&&(n[t]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}(t,n.props),ref:l?function(...e){return l=>{let n=!1,t=e.map(e=>{let t=i(e,l);return n||"function"!=typeof t||(n=!0),t});if(n)return()=>{for(let l=0;l<t.length;l++){let n=t[l];"function"==typeof n?n():i(e[l],null)}}}}(l,e):e})}return s.Children.count(n)>1?s.Children.only(null):null});d.displayName="SlotClone";var c=({children:e})=>(0,t.jsx)(t.Fragment,{children:e});function o(e){return s.isValidElement(e)&&e.type===c}let u=({children:e,ref:l,as:n})=>(0,t.jsx)(n?a:"h2",{ref:l,className:"text-emphasis text-base font-semibold leading-none",children:e}),p=({children:e,ref:l,as:n})=>(0,t.jsx)(n?a:"h3",{ref:l,className:"text-subtle line-clamp-1 text-sm",children:e}),f=({ref:e,name:l,size:n="md",iconSlot:s})=>(0,t.jsx)("div",{ref:e,className:(0,r.M)("bg-default border-subtle border-subtle flex items-center justify-center border","sm"===n&&"rounded-md p-1","md"===n&&"rounded-[10px] p-1.5"),children:s||(0,t.jsx)(r.N,{name:l,className:(0,r.M)("sm"===n&&"h-4 w-4","md"===n&&"h-6 w-6")})}),m=Object.assign(({children:e,ref:l,className:n})=>{let[s]=(0,r.ag)();return(0,t.jsx)("div",{ref:s,className:(0,r.M)("bg-muted flex flex-col gap-4 roun
1ded-2xl p-4",n),children:e})},{Header:({children:e,ref:l,icon:n,title:r,description:s,iconSlot:i,rawHeading:a})=>(0,t.jsxs)("div",{ref:l,className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[n&&!i&&(0,t.jsx)(f,{name:n}),i&&(0,t.jsx)(f,{iconSlot:i}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r&&(0,t.jsx)(u,{children:r}),s&&(0,t.jsx)(p,{children:s}),a&&a]})]}),e]}),Content:({children:e,ref:l})=>(0,t.jsx)("div",{ref:l,className:"flex flex-col gap-4",children:e}),Title:u,Description:p,SubSection:({children:e,ref:l})=>{let[n]=(0,r.ag)();return(0,t.jsx)("div",{ref:n,className:"border-muted bg-default flex flex-col gap-4 rounded-xl border p-3",children:e})},SubSectionHeader:({children:e,ref:l,icon:n,title:s,classNames:i,justify:a="between",labelFor:d})=>(0,t.jsxs)("div",{ref:l,className:(0,r.M)("flex items-center gap-2","between"===a?"justify-between":"justify-start",null==i?void 0:i.container),children:[(0,t.jsxs)("div",{className:(0,r.M)("flex items-center gap-2",null==i?void 0:i.title),children:[n&&(0,t.jsx)(f,{name:n,size:"sm"}),(0,t.jsx)("div",{className:(0,r.M)("flex",null==i?void 0:i.title),children:(0,t.jsx)("h4",{className:"text-default text-sm font-medium leading-none",id:d,children:s})})]}),e]}),SubSectionContent:({children:e,ref:l,invert:n,classNames:s})=>(0,t.jsx)("div",{ref:l,className:(0,r.M)("bg-muted flex flex-col rounded-lg px-[6px] py-1",n&&"bg-default border-subtle border",null==s?void 0:s.container),children:e}),SubSectionNested:({children:e,ref:l})=>(0,t.jsx)("div",{ref:l,className:"bg-default border-subtle flex flex-col gap-2 rounded-xl border p-2",children:e})});function h({appId:e,className:l,returnTo:n,teamId:s}){let{t:i}=(0,r.q)(),{data:a}=function(e){let{status:l}=r.ah.useSession();return r.y.viewer.apps.appById.useQuery({appId:e},{enabled:"authenticated"===l})}(e),d=r.y.useUtils(),c=(0,r.u)(null,{returnTo:n,onSuccess:l=>{d.viewer.apps.appById.invalidate({appId:e}),d.viewer.apps.integrations.invalidate({extendsFeature:"EventType",...s&&{teamId:s}}),null!=l&&l.setupPending||(0,r._)(i("app_successfully_installed"),"success")},onError:e=>{e instanceof Error&&(0,r._)(e.message||i("app_could_not_be_installed"),"error")}});return a?(0,t.jsx)(r.ai,{type:a.type,teamsPlanRequired:a.teamsPlanRequired,wrapperClassName:(0,r.M)("[@media(max-width:260px)]:w-full",l),render:({useDefaultComponent:e,...l})=>(e&&(l={...l,onClick:()=>{c.mutate({type:a.type,variant:a.variant,slug:a.slug,...s&&{teamId:s}})}}),(0,t.jsx)(r.r,{loading:c.isPending,color:"secondary",className:"[@media(max-width:260px)]:w-full [@media(max-width:260px)]:justify-center",StartIcon:"plus",...l,children:i("add")}))}):null}function x({app:e,description:l,switchOnClick:n,switchChecked:s,children:i,returnTo:a,teamId:d,disableSwitch:c,switchTooltip:o,hideSettingsIcon:u=!1,hideAppCardOptions:p=!1}){let{t:f}=(0,r.aj)(),[x]=(0,r.ag)(),{setAppData:g,LockedIcon:j,disabled:v}=(0,r.t)(),b=(0,r.ae)();return(0,t.jsxs)(m,{className:(0,r.M)(!(null!=e&&e.isInstalled)&&"rounded-xl"),children:[(0,t.jsx)(m.Header,{rawHeading:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex w-full items-center gap-1",children:[(0,t.jsx)(m.Title,{children:null==e?void 0:e.name}),!(null!=e&&e.isInstalled)&&(0,t.jsx)("span",{className:"bg-emphasis ml-1 rounded px-1 py-0.5 text-xs font-medium leading-3 tracking-[0.01em]",children:(null==e?void 0:e.categories[0].charAt(0).toUpperCase())+(null==e?void 0:e.categories[0].slice(1))})]}),(0,t.jsx)(m.Description,{children:null==e?void 0:e.description})]}),iconSlot:(0,t.jsx)(r.ak,{href:`/apps/${e.slug}`,className:"flex h-8 w-8 items-center justify-center",children:(0,t.jsx)("img",{className:(0,r.M)((null==e?void 0:e.logo.includes("-dark"))&&"dark:invert","max-h-full max-w-full object-contain"),src:null==e?void 0:e.logo,alt:null==e?void 0:e.name})}),children:(0,t.jsx)("div",{children:(0,t.jsx)("div",{children:null!=e&&e.isInstalled||e.credentialOwner?(0,t.jsx)("div",{className:"ml-auto flex items-center",children:(0,t.jsx)(r.p,{size:"sm",disabled:!e.enabled||v||c,onCheckedChange:e=>{n&&n(e),g("enabled",e)},checked:s,LockedIcon:j,"data-testid":`${e.slug}-app-switch`,tooltip:o})}):(0,t.jsx)(h,{className:"ml-auto flex items-center",appId:e.slug,returnTo:a,teamId:d})})})}),p?null:(null==e?void 0:e.isInstalled)&&s&&(0,t.jsx)("div",{ref:x,children:void 0===e.isSetupAlready||e.isSetupAlready?(0,t.jsxs)("div",{className:"relative text-sm [&_input]:mb-0 [&_input]:leading-4",children:[!u&&!b&&(0,t.jsx)(r.ak,{href:`/apps/${e.slug}/setup`,className:"absolute right-4 top-4",children:(0,t.jsx)(r.N,{name:"settings",className:"text-default h-4 w-4","aria-hidden":"true"})}),i]}):(0,t.jsxs)("div",{className:"flex h-64 w-full flex-col items-center justify-center gap-4 ",children:[(0,t.jsx)("p",{children:f("this_app_is_not_setup_already")}),(0,t.jsx)(r.ak,{href:`/apps/${e.slug}/setup`,children:(0,t.jsx)(r.r,{StartIcon:"settings",children:f("setup")})})]})})]})}},83129:(e,l,n)=>{n.d(l,{u:()=>s});var t=n(12115),r=n(49395);function s(e){let{getAppData:l,setAppData:n}=(0,r.t)(),[s,i]=(0,t.useState)(()=>{let n=l("enabled");if(!e.credentialOwner)return n??!1;let t=l("credentialId");return(n&&(e.userCredentialIds.some(e=>e===t)||e.credentialOwner.credentialId===t))??!1});return{enabled:s,updateEnabled:l=>{var t,r,s;l||n("credentialId",void 0),l&&(null!=(t=e.userCredentialIds)&&t.length||null!=(r=e.credentialOwner)&&r.credentialId)&&n("credentialId",(null==(s=e.credentialOwner)?void 0:s.credentialId)||e.userCredentialIds[0]),i(l)}}}},97955:(e,l,n)=>{n.r(l),n.d(l,{default:()=>a});var t=n(95155),r=n(49395),s=n(78935),i=n(83129);let a=function({app:e,eventType:l}){var n;let a=r.s.usePathname(),{enabled:d,updateEnabled:c}=(0,i.u)(e);return(0,t.jsx)(s.A,{returnTo:`${r.W}${a}?tabName=apps`,app:e,teamId:(null==(n=l.team)?void 0:n.id)||void 0,switchOnClick:e=>{c(e)},switchChecked:d,hideAppCardOptions:!0})}}}]);
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.