1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6976],{17075:function(e,l,s){s.d(l,{A:function(){return u},S:function(){return r}});var n=s(57437),t=s(47051);let a=({children:e,ref:l,as:s})=>(0,n.jsx)(s?t.ai:"h2",{ref:l,className:"text-emphasis text-base font-semibold leading-none",children:e}),i=({children:e,ref:l,as:s})=>(0,n.jsx)(s?t.ai:"h3",{ref:l,className:"text-subtle line-clamp-1 text-sm",children:e}),d=({ref:e,name:l,size:s="md",iconSlot:a})=>(0,n.jsx)("div",{ref:e,className:(0,t.r)("bg-default border-subtle border-subtle flex items-center justify-center border","sm"===s&&"rounded-md p-1","md"===s&&"rounded-[10px] p-1.5"),children:a||(0,n.jsx)(t.R,{name:l,className:(0,t.r)("sm"===s&&"h-4 w-4","md"===s&&"h-6 w-6")})}),r=Object.assign(({children:e,ref:l,className:s})=>{let[a]=(0,t.ah)();return(0,n.jsx)("div",{ref:a,className:(0,t.r)("bg-muted flex flex-col gap-4 rounded-2xl p-4",s),children:e})},{Header:({children:e,ref:l,icon:s,title:t,description:r,iconSlot:c,rawHeading:u})=>(0,n.jsxs)("div",{ref:l,className:"flex items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[s&&!c&&(0,n.jsx)(d,{name:s}),c&&(0,n.jsx)(d,{iconSlot:c}),(0,n.jsxs)("div",{className:"flex flex-col gap-0.5",children:[t&&(0,n.jsx)(a,{children:t}),r&&(0,n.jsx)(i,{children:r}),u&&u]})]}),e]}),Content:({children:e,ref:l})=>(0,n.jsx)("div",{ref:l,className:"flex flex-col gap-4",children:e}),Title:a,Description:i,SubSection:({children:e,ref:l})=>{let[s]=(0,t.ah)();return(0,n.jsx)("div",{ref:s,className:"border-muted bg-default flex flex-col gap-4 roun
1ded-xl border p-3",children:e})},SubSectionHeader:({children:e,ref:l,icon:s,title:a,classNames:i,justify:r="between",labelFor:c})=>(0,n.jsxs)("div",{ref:l,className:(0,t.r)("flex items-center gap-2","between"===r?"justify-between":"justify-start",null==i?void 0:i.container),children:[(0,n.jsxs)("div",{className:(0,t.r)("flex items-center gap-2",null==i?void 0:i.title),children:[s&&(0,n.jsx)(d,{name:s,size:"sm"}),(0,n.jsx)("div",{className:(0,t.r)("flex",null==i?void 0:i.title),children:(0,n.jsx)("h4",{className:"text-default text-sm font-medium leading-none",id:c,children:a})})]}),e]}),SubSectionContent:({children:e,ref:l,invert:s,classNames:a})=>(0,n.jsx)("div",{ref:l,className:(0,t.r)("bg-muted flex flex-col rounded-lg px-[6px] py-1",s&&"bg-default border-subtle border",null==a?void 0:a.container),children:e}),SubSectionNested:({children:e,ref:l})=>(0,n.jsx)("div",{ref:l,className:"bg-default border-subtle flex flex-col gap-2 rounded-xl border p-2",children:e})});function c({appId:e,className:l,returnTo:s,teamId:a,onAppInstallSuccess:i}){let{t:d}=(0,t.w)(),{data:r}=function(e){let{status:l}=t.aj.useSession();return t.ak.viewer.apps.appById.useQuery({appId:e},{enabled:"authenticated"===l})}(e),c=(0,t.v)(null,{returnTo:s,onSuccess:e=>{i(),null!=e&&e.setupPending||(0,t.a3)(d("app_successfully_installed"),"success")},onError:e=>{e instanceof Error&&(0,t.a3)(e.message||d("app_could_not_be_installed"),"error")}});return r?(0,n.jsx)(t.al,{type:r.type,teamsPlanRequired:r.teamsPlanRequired,wrapperClassName:(0,t.r)("[@media(max-width:260px)]:w-full",l),render:({useDefaultComponent:e,...l})=>(e&&(l={...l,onClick:()=>{c.mutate({type:r.type,variant:r.variant,slug:r.slug,...a&&{teamId:a}})}}),(0,n.jsx)(t.B,{loading:c.isPending,color:"secondary",className:"[@media(max-width:260px)]:w-full [@media(max-width:260px)]:justify-center",StartIcon:"plus",...l,children:d("add")}))}):null}function u({app:e,description:l,switchOnClick:s,switchChecked:a,children:i,returnTo:d,teamId:u,disableSwitch:o,switchTooltip:p,hideSettingsIcon:m=!1,hideAppCardOptions:x=!1,onAppInstallSuccess:h}){let{t:f}=(0,t.w)(),[j]=(0,t.ah)(),{setAppData:g,LockedIcon:v,disabled:b}=(0,t.y)(),I=(0,t.am)();return(0,n.jsxs)(r,{className:(0,t.r)(!(null!=e&&e.isInstalled)&&"rounded-xl"),children:[(0,n.jsx)(r.Header,{rawHeading:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex w-full items-center gap-1",children:[(0,n.jsx)(r.Title,{children:null==e?void 0:e.name}),!(null!=e&&e.isInstalled)&&(0,n.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,n.jsx)(r.Description,{children:null==e?void 0:e.description})]}),iconSlot:(0,n.jsx)(t.an,{href:`/apps/${e.slug}`,className:"flex h-8 w-8 items-center justify-center",children:(0,n.jsx)("img",{className:(0,t.r)((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,n.jsx)("div",{children:(0,n.jsx)("div",{children:null!=e&&e.isInstalled||e.credentialOwner?(0,n.jsx)("div",{className:"ml-auto flex items-center",children:(0,n.jsx)(t.p,{size:"sm",disabled:!e.enabled||b||o,onCheckedChange:e=>{s&&s(e),g("enabled",e)},checked:a,LockedIcon:v,"data-testid":`${e.slug}-app-switch`,tooltip:p})}):(0,n.jsx)(c,{className:"ml-auto flex items-center",appId:e.slug,returnTo:d,teamId:u,onAppInstallSuccess:h})})})}),x?null:(null==e?void 0:e.isInstalled)&&a&&(0,n.jsx)("div",{ref:j,children:void 0===e.isSetupAlready||e.isSetupAlready?(0,n.jsxs)("div",{className:"relative text-sm [&_input]:mb-0 [&_input]:leading-4",children:[!m&&!I&&(0,n.jsx)(t.an,{href:`/apps/${e.slug}/setup`,className:"absolute right-4 top-4",children:(0,n.jsx)(t.R,{name:"settings",className:"text-default h-4 w-4","aria-hidden":"true"})}),i]}):(0,n.jsxs)("div",{className:"flex h-64 w-full flex-col items-center justify-center gap-4 ",children:[(0,n.jsx)("p",{children:f("this_app_is_not_setup_already")}),(0,n.jsx)(t.an,{href:`/apps/${e.slug}/setup`,children:(0,n.jsx)(t.B,{StartIcon:"settings",children:f("setup")})})]})})]})}}
1,60855:function(e,l,s){s.r(l),s.d(l,{default:function(){return d}});var n=s(57437),t=s(47051),a=s(17075),i=s(17548);let d=function({app:e,eventType:l,onAppInstallSuccess:s}){var d;let{getAppData:r,setAppData:c,disabled:u}=(0,t.y)(),o=r("MATOMO_URL"),p=r("SITE_ID"),{enabled:m,updateEnabled:x}=(0,i.u)(e);return(0,n.jsx)(a.A,{onAppInstallSuccess:s,hideSettingsIcon:!0,app:e,switchOnClick:e=>{x(e)},switchChecked:m,teamId:(null==(d=l.team)?void 0:d.id)||void 0,children:(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(t.f,{dataTestid:`${e.slug}-url`,name:"Matomo URL",placeholder:"Enter your Matomo URL here",value:o,disabled:u,onChange:e=>{c("MATOMO_URL",e.target.value)}}),(0,n.jsx)(t.f,{dataTestid:`${e.slug}-site-id`,disabled:u,name:"Site ID",placeholder:"Enter your Site ID",value:p,onChange:e=>{c("SITE_ID",e.target.value)}})]})})}},17548:function(e,l,s){s.d(l,{u:function(){return a}});var n=s(2265),t=s(47051);function a(e){let{getAppData:l,setAppData:s}=(0,t.y)(),[a,i]=(0,n.useState)(()=>{let s=l("enabled");if(!e.credentialOwner)return s??!1;let n=l("credentialId");return(s&&(e.userCredentialIds.some(e=>e===n)||e.credentialOwner.credentialId===n))??!1});return{enabled:a,updateEnabled:l=>{var n,t,a;l||s("credentialId",void 0),l&&(null!=(n=e.userCredentialIds)&&n.length||null!=(t=e.credentialOwner)&&t.credentialId)&&s("credentialId",(null==(a=e.credentialOwner)?void 0:a.credentialId)||e.userCredentialIds[0]),i(l)}}}}}]);
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.