@hiver/connector-admin 4.26.0 → 4.26.1-slackAuthTab-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.es.js CHANGED
@@ -37929,7 +37929,7 @@ const ub = O(le)`
37929
37929
  e !== "connector" || !r || n(ii());
37930
37930
  }, [r, e, n]), ve(() => {
37931
37931
  e !== "connector" || !r || !u || n(Ka(r));
37932
- }, [r, e, u, n]), e === "template" ? s != null && s.apiList ? hl(s.type) ? /* @__PURE__ */ l.jsx(Dh, { mode: "template", id: r, headerSource: s }) : /* @__PURE__ */ l.jsx(XA, { to: `${Me.BASEPATH}${Me.API_VIEW}/${r}`, replace: !0 }) : A === be.FAILED ? /* @__PURE__ */ l.jsxs(ao, { children: [
37932
+ }, [r, e, u, n]), e === "template" ? s != null && s.apiList ? hl(s.type) ? /* @__PURE__ */ l.jsx(Dh, { mode: "template", id: r, headerSource: s }, r) : /* @__PURE__ */ l.jsx(XA, { to: `${Me.BASEPATH}${Me.API_VIEW}/${r}`, replace: !0 }) : A === be.FAILED ? /* @__PURE__ */ l.jsxs(ao, { children: [
37933
37933
  /* @__PURE__ */ l.jsxs(ra, { onClick: () => t(`${Me.BASEPATH}${Me.DASHBOARD}`), children: [
37934
37934
  /* @__PURE__ */ l.jsx(na, { "aria-hidden": !0, width: 20, height: 20 }),
37935
37935
  "Apps Marketplace"
@@ -37940,7 +37940,7 @@ const ub = O(le)`
37940
37940
  r,
37941
37941
  "” couldn’t be fetched. Try refreshing."
37942
37942
  ] })
37943
- ] }) : /* @__PURE__ */ l.jsx(ao, { children: /* @__PURE__ */ l.jsx(Sl, {}) }) : c != null && c.apiList ? hl(c.type) ? /* @__PURE__ */ l.jsx(Dh, { mode: "connector", id: r, headerSource: c }) : /* @__PURE__ */ l.jsx(XA, { to: `${Me.BASEPATH}${Me.API_VIEW}/${r}?isEdit=true`, replace: !0 }) : a === be.FAILED ? /* @__PURE__ */ l.jsxs(ao, { children: [
37943
+ ] }) : /* @__PURE__ */ l.jsx(ao, { children: /* @__PURE__ */ l.jsx(Sl, {}) }) : c != null && c.apiList ? hl(c.type) ? /* @__PURE__ */ l.jsx(Dh, { mode: "connector", id: r, headerSource: c }, r) : /* @__PURE__ */ l.jsx(XA, { to: `${Me.BASEPATH}${Me.API_VIEW}/${r}?isEdit=true`, replace: !0 }) : a === be.FAILED ? /* @__PURE__ */ l.jsxs(ao, { children: [
37944
37944
  /* @__PURE__ */ l.jsxs(ra, { onClick: () => t(`${Me.BASEPATH}${Me.DASHBOARD}`), children: [
37945
37945
  /* @__PURE__ */ l.jsx(na, { "aria-hidden": !0, width: 20, height: 20 }),
37946
37946
  "Apps Marketplace"
@@ -37958,7 +37958,7 @@ const ub = O(le)`
37958
37958
  typography: LC("'Hanken Grotesk', system-ui, sans-serif").typography
37959
37959
  }),
37960
37960
  [o]
37961
- ), c = Av(n.type)({ mode: e, id: t }), u = n.logo, g = !(e === "template" && qa(n.type)), p = e === "connector" || qa(n.type), B = ["overview", "authentication", "visibility"].filter(
37961
+ ), c = Av(n.type)({ mode: e, id: t }), u = n.logo, g = !(e === "template" && qa(n.type)), p = qa(n.type), B = ["overview", "authentication", "visibility"].filter(
37962
37962
  (w) => (w !== "authentication" || p) && (w !== "visibility" || g)
37963
37963
  ), f = i.get("tab"), C = e === "template" ? "overview" : n.isAuthenticated ? "visibility" : "authentication", [d, h] = q(
37964
37964
  f && B.includes(f) ? f : B.includes(C) ? C : "overview"
package/index.umd.js CHANGED
@@ -2571,7 +2571,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStat
2571
2571
  gap: 24px;
2572
2572
  margin-top: 16px;
2573
2573
  align-items: start;
2574
- `,_W=({carouselImages:e,illustrationUrl:t,overviewHelpHeading:n,showScheduleCall:r,templateDescription:o,features:A,supportLinks:a,appName:i})=>{const s=(e??[]).map(({url:c})=>({src:c}));return l.jsxs(MW,{children:[l.jsxs("div",{children:[t?l.jsx(Hb,{children:l.jsx("img",{src:t,alt:`${i??"App"} overview`})}):s.length>0&&l.jsx(LC,{previewList:s}),o&&l.jsx(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-heading)",marginTop:2},children:l.jsx("span",{dangerouslySetInnerHTML:{__html:o}})}),A&&A.length>0&&l.jsxs(Wb,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"24px",letterSpacing:"0.042px",color:"var(--connector-admin-text-primary)",marginBottom:"8px"},children:"Features"}),A.map((c,u)=>l.jsxs(g.Typography,{sx:{fontSize:`${g.theme.typography.body2.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:[u+1,". ",c]},u))]})]}),l.jsxs(g.Stack,{gap:"12px",children:[l.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:n??Td}),r!==!1&&l.jsx(Wi,{isSettingsPage:!0}),l.jsx(WC,{connectorName:i,supportLinks:a})]})]})},qb=e=>yd(e,!1),Ub=["Overview","Visibility"],LW={title:"Configuration",visibility:!0},Kb={textTransform:"none",fontSize:`${g.theme.typography.body1.fontSize}px`,fontWeight:g.theme.typography.fontWeightMedium,letterSpacing:"0.25px",minHeight:"auto",padding:"0",color:"var(--connector-admin-text-tertiary)","&.Mui-selected":{color:"var(--connector-admin-accent)"}},PW=({mode:e})=>{const t=Jt(),n=cn(),{id:r=""}=ko(),o=xe(CA),A=xe(Nn),a=xe(sc),i=xe(so),s=e==="template"?(o==null?void 0:o[r])??null:null,c=e==="connector"?(A==null?void 0:A[r])??null:null;return b.useEffect(()=>{var u,d;r&&(e==="template"?(u=o==null?void 0:o[r])!=null&&u.apiList||n(EA(r)):(d=A==null?void 0:A[r])!=null&&d.apiList||n(pA(r)))},[r,e,o,A,n]),e==="template"?s!=null&&s.apiList?qb(s.type)?l.jsx($b,{mode:"template",id:r,headerSource:s}):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}`,replace:!0}):a===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Template ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})}):c!=null&&c.apiList?qb(c.type)?l.jsx($b,{mode:"connector",id:r,headerSource:c}):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}?isEdit=true`,replace:!0}):i===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Connector ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})})},$b=({mode:e,id:t,headerSource:n})=>{const r=Jt(),o=g.useTheme(),[A,a]=Ro(),i=b.useMemo(()=>g.createTheme(o,{typography:Vg("'Hanken Grotesk', system-ui, sans-serif").typography}),[o]),c=vQ(n.type)({mode:e,id:t}),u=n.logo,d=A.get("tab"),Q=d==="overview"?0:d==="visibility"?1:e==="connector"?1:0,[I,E]=b.useState(Q),C=(B,f)=>{E(f);const m=new URLSearchParams(A);m.set("tab",f===1?"visibility":"overview"),a(m,{replace:!0})},h=()=>C({},1);return l.jsx(g.HiverProvider,{theme:i,children:l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>r(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsxs(XC,{children:[l.jsxs(ZC,{children:[u&&l.jsx(_b,{children:l.jsx(Lb,{children:l.jsx("img",{src:u,alt:n.name})})}),l.jsxs(OW,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.h1.fontSize}px`,lineHeight:"32px",letterSpacing:"0.2px",color:"var(--connector-admin-app-title)"},children:n.name}),l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightRegular,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:n.description})]})]}),e==="template"&&I===0&&l.jsx(FW,{variant:"contained",disableElevation:!0,onClick:h,children:"Start setup"}),e==="connector"&&l.jsx(DW,{connectorId:t,isEnabled:!!n.isEnabled,isAuthenticated:!!n.isAuthenticated,connectorType:n.type,connectorName:n.name})]}),l.jsxs(g.Tabs,{value:I,onChange:C,TabIndicatorProps:{sx:{backgroundColor:"var(--connector-admin-accent)",height:"2px"}},sx:{marginTop:4,minHeight:"auto",width:"100%",borderBottom:"1px solid var(--connector-admin-border-strong)"},children:[l.jsx(g.Tab,{label:Ub[0],sx:Kb}),l.jsx(g.Tab,{label:Ub[1],sx:Kb})]}),l.jsx("div",{hidden:I!==0,style:{paddingTop:24},children:l.jsx(_W,{carouselImages:n.carouselImages,illustrationUrl:n.illustrationUrl,overviewHelpHeading:n.overviewHelpHeading,showScheduleCall:n.showScheduleCall,templateDescription:n.templateDescription,features:n.features,supportLinks:n.supportLinks,appName:n.name})}),l.jsx("div",{hidden:I!==1,style:{paddingTop:24},children:l.jsx(Zb,{schema:n.configuration??LW,controller:c})})]})})},kW=({carouselImages:e,illustrationUrl:t,overviewHelpHeading:n,showScheduleCall:r,templateDescription:o,features:A,apiList:a,appType:i,supportLinks:s,appName:c})=>{const u=(e??[]).map(({url:p})=>({src:p})),d=(a??[]).filter(({keyName:p,name:Q})=>!/webhook/i.test(`${p??""} ${Q??""}`));return l.jsxs(Gb,{children:[l.jsxs("div",{children:[t?l.jsx(Hb,{children:l.jsx("img",{src:t,alt:`${c??"App"} overview`})}):u.length>0&&l.jsx(LC,{previewList:u}),o&&l.jsx(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-heading)",marginTop:2},children:l.jsx("span",{dangerouslySetInnerHTML:{__html:o}})}),A&&A.length>0&&l.jsxs(Wb,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"24px",letterSpacing:"0.042px",color:"var(--connector-admin-text-primary)",marginBottom:"8px"},children:"Features"}),A.map((p,Q)=>l.jsxs(g.Typography,{sx:{fontSize:`${g.theme.typography.body2.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:[Q+1,". ",p]},Q))]}),!(A!=null&&A.length)&&d.length>0&&l.jsx(FQ,{apiList:d,connectorName:c,connectorType:i})]}),l.jsxs(gW,{children:[l.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:n??Td}),r!==!1&&l.jsx(Wi,{isSettingsPage:!0}),l.jsx(WC,{connectorName:c,supportLinks:s})]})]})},NW=[{label:"Active",enabled:!0},{label:"Inactive",enabled:!1}],RW=({connectorId:e,isEnabled:t,isAuthenticated:n,connectorType:r,connectorName:o})=>{const A=cn(),{sendTrackingEvent:a}=b.useContext($e),i=xe(Ca),s=xe(so),c=xe(ul),[u,d]=b.useState(null),p=(c==null?void 0:c[e])===pe.LOADING,I=[i,s].includes(pe.LOADING)||!n||p,E=C=>{d(null),C!==t&&A(IA({id:e,enabled:C})).unwrap().then(()=>{r==="slack"&&a(C?ze.SLACK_INTEGRATION_ENABLED:ze.SLACK_INTEGRATION_DISABLED,{connector_name:o}),C||tt({message:gc,type:hi})}).catch(()=>{tt({message:uc,type:Lt})})};return l.jsxs(l.Fragment,{children:[l.jsx(cW,{"aria-haspopup":"menu","aria-expanded":u?"true":void 0,disabled:I,onClick:C=>d(C.currentTarget),endIcon:p?l.jsx(g.CircularProgress,{size:16}):l.jsx(UC,{size:16}),children:t?"Active":"Inactive"}),l.jsx(g.Menu,{anchorEl:u,open:!!u,onClose:()=>d(null),sx:lW,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:NW.map(C=>l.jsx(g.MenuItem,{selected:C.enabled===t,onClick:()=>E(C.enabled),children:C.label},C.label))})]})},jW={overview:"Overview",authentication:"Authentication",visibility:"Visibility"},VW={title:"Configuration",visibility:!0},GW={textTransform:"none",fontSize:`${g.theme.typography.body1.fontSize}px`,fontWeight:g.theme.typography.fontWeightMedium,letterSpacing:"0.25px",minHeight:"auto",padding:"0",color:"var(--connector-admin-text-tertiary)","&.Mui-selected":{color:"var(--connector-admin-accent)"}},ey=({mode:e})=>{const{availableFeatures:t}=b.useContext($e);return Nt(t,xo)?l.jsx(HW,{mode:e}):l.jsx(PW,{mode:e})},HW=({mode:e})=>{const t=Jt(),n=cn(),{id:r=""}=ko(),o=xe(CA),A=xe(Nn),a=xe(sc),i=xe(so),s=e==="template"?(o==null?void 0:o[r])??null:null,c=e==="connector"?(A==null?void 0:A[r])??null:null;b.useEffect(()=>{var d,p;r&&(e==="template"?(d=o==null?void 0:o[r])!=null&&d.apiList||n(EA(r)):(p=A==null?void 0:A[r])!=null&&p.apiList||n(pA(r)))},[r,e,o,A,n]);const u=!!c;return b.useEffect(()=>{e!=="connector"||!r||n(Do())},[r,e,n]),b.useEffect(()=>{e!=="connector"||!r||!u||n(Qi(r))},[r,e,u,n]),e==="template"?s!=null&&s.apiList?Cl(s.type)?l.jsx(ty,{mode:"template",id:r,headerSource:s}):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}`,replace:!0}):a===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Template ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})}):c!=null&&c.apiList?Cl(c.type)?l.jsx(ty,{mode:"connector",id:r,headerSource:c}):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}?isEdit=true`,replace:!0}):i===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Connector ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})})},ty=({mode:e,id:t,headerSource:n})=>{const r=Jt(),o=g.useTheme(),[A,a]=Ro(),i=b.useMemo(()=>g.createTheme(o,{typography:Vg("'Hanken Grotesk', system-ui, sans-serif").typography}),[o]),c=vQ(n.type)({mode:e,id:t}),u=n.logo,d=!(e==="template"&&Gi(n.type)),p=e==="connector"||Gi(n.type),Q=["overview","authentication","visibility"].filter(T=>(T!=="authentication"||p)&&(T!=="visibility"||d)),I=A.get("tab"),E=e==="template"?"overview":n.isAuthenticated?"visibility":"authentication",[C,h]=b.useState(I&&Q.includes(I)?I:Q.includes(E)?E:"overview"),B=T=>{h(T);const O=new URLSearchParams(A);O.set("tab",T),a(O,{replace:!0})},{availableFeatures:f,connectorFunctions:m}=b.useContext($e),v=()=>d?B("visibility"):r(`${Se.BASEPATH}${Se.CONNECTOR_SETTINGS}/${t}`),w=t_(n.type)&&Nt(f,xo)&&typeof(m==null?void 0:m.openCopilot)=="function",x=e!=="connector"?null:n.isAuthenticated?{status:"connected",label:"Connected"}:n.authPending?null:{status:"failed",label:"Authentication failed"},y=()=>{var T;(T=m==null?void 0:m.openCopilot)==null||T.call(m,{app:n.type,connectorId:t,name:n.name})};return l.jsx(g.HiverProvider,{theme:i,children:l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>r(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsxs(XC,{children:[l.jsxs(ZC,{children:[u&&l.jsx(_b,{children:l.jsx(Lb,{children:l.jsx("img",{src:u,alt:n.name})})}),l.jsxs(ZH,{children:[l.jsxs(qH,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.h1.fontSize}px`,lineHeight:"32px",letterSpacing:"0.2px",color:"var(--connector-admin-app-title)"},children:n.name}),x&&l.jsx(sW,{"data-status":x.status,children:x.label})]}),l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightRegular,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:n.description})]})]}),e==="template"&&(w||C==="overview")&&l.jsx(Vb,{children:w?l.jsx(jb,{variant:"contained",disableElevation:!0,onClick:y,children:"Setup with AI"}):l.jsx(UH,{variant:"contained",disableElevation:!0,onClick:v,children:"Start setup"})}),e==="connector"&&l.jsxs(Vb,{children:[l.jsx(RW,{connectorId:t,isEnabled:!!n.isEnabled,isAuthenticated:!!n.isAuthenticated,connectorType:n.type,connectorName:n.name}),w&&l.jsxs(l.Fragment,{children:[l.jsx(uW,{role:"separator","aria-orientation":"vertical"}),l.jsx(jb,{variant:"contained",disableElevation:!0,onClick:y,children:"Setup with AI"})]})]})]}),l.jsx(g.Tabs,{value:C,onChange:(T,O)=>B(O),TabIndicatorProps:{sx:{backgroundColor:"var(--connector-admin-accent)",height:"2px"}},sx:{marginTop:4,minHeight:"auto",width:"100%",boxShadow:"inset 0 -2px 0 var(--connector-admin-border-strong)"},children:Q.map(T=>l.jsx(g.Tab,{value:T,label:jW[T],sx:GW,className:"border-b-0!"},T))}),l.jsx("div",{hidden:C!=="overview",style:{paddingTop:24},children:l.jsx(kW,{carouselImages:n.carouselImages,illustrationUrl:n.illustrationUrl,overviewHelpHeading:n.overviewHelpHeading,showScheduleCall:n.showScheduleCall,templateDescription:n.templateDescription,features:n.features,apiList:n.apiList,appType:n.type,supportLinks:n.supportLinks,appName:n.name})}),p&&l.jsx(dW,{hidden:C!=="authentication",style:{paddingTop:24},children:l.jsx(YC,{connectorData:n,isEdit:e==="connector",hideAuthFailedAlert:!0})}),l.jsx("div",{hidden:C!=="visibility",style:{paddingTop:24},children:e==="connector"&&Gi(n.type)?l.jsx(Tb,{connectorData:n}):l.jsx(Zb,{schema:n.configuration??VW,controller:c})})]})})},ny={not_admin:{title:"Ask a Hiver admin to finish this",body:"Only a Hiver admin can connect GoHighLevel. Ask an admin to sign in and open the link from the GoHighLevel install page again."},not_enabled:{title:"GoHighLevel isn't available on this workspace",body:"Contact support@hiverhq.com to enable the GoHighLevel integration for your Hiver workspace."},plan:{title:"Your Hiver plan doesn't include GoHighLevel",body:"Upgrade your plan, then install the app again from the GoHighLevel Marketplace."},expired:{title:"This install link has expired",body:"Install links work for 2 hours and only once. Install the app again from the GoHighLevel Marketplace."},agency_taken:{title:"This agency is connected to another Hiver workspace",body:"A GoHighLevel agency can be connected to one Hiver workspace. Contact support@hiverhq.com if this is unexpected."},other_agency:{title:"This workspace is connected to a different agency",body:"Your Hiver workspace is already connected to another GoHighLevel agency, and a workspace can connect one agency. Contact support@hiverhq.com to switch agencies."},failed:{title:"We couldn't finish connecting GoHighLevel",body:"Reload this page to try again. If it keeps failing, contact support@hiverhq.com."}},WW=new Set(Object.keys(ny)),zW=e=>{var r;const t=e==null?void 0:e.response;if((t==null?void 0:t.status)===402)return"plan";const n=(r=t==null?void 0:t.data)==null?void 0:r.reason;return typeof n=="string"&&WW.has(n)?n:"failed"},YW=()=>{const[e]=Ro(),t=Jt(),n=fl(),r=e.get("install")??"",[o,A]=b.useState(r?{status:"claiming"}:{status:"failed",reason:"expired"}),a=b.useRef(!1);if(b.useEffect(()=>{!r||a.current||(a.current=!0,Xe({url:W4,method:nt.POST,data:{install:r}}).then(s=>{const{connectorId:c,templateId:u,created:d}=(s==null?void 0:s.data)??{};if(!c){A({status:"failed",reason:"failed"});return}const p=d&&u?`${Se.BASEPATH}${Se.CONNECTOR_INITIAL_SETUP}/${u}?connectorId=${c}`:n({id:c,type:"gohighlevel",tabIndex:0});t(p,{replace:!0})}).catch(s=>A({status:"failed",reason:zW(s)})))},[r,t,n]),o.status==="claiming")return l.jsxs(g.Stack,{alignItems:"center",gap:2,sx:{padding:6},children:[l.jsx(g.CircularProgress,{size:28}),l.jsx(g.Typography,{variant:"h6",children:"Connecting GoHighLevel to Hiver…"}),l.jsx(g.Typography,{variant:"body2",children:"This takes a few seconds. Don't close this tab."})]});const i=ny[o.reason];return l.jsxs(g.Stack,{alignItems:"center",gap:2,sx:{padding:6,maxWidth:520,margin:"0 auto",textAlign:"center"},children:[l.jsx(g.Typography,{variant:"h6",children:i.title}),l.jsx(g.Typography,{variant:"body2",children:i.body}),l.jsx(g.Button,{size:"small",onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:"Go to Apps"})]})},ry=()=>{const e=Jt();return l.jsxs(g.Stack,{alignItems:"center",gap:2,sx:{padding:6},children:[l.jsx(g.Typography,{variant:"h6",children:"Page not found"}),l.jsx(g.Button,{size:"small",onClick:()=>e(`${Se.BASEPATH}${Se.DASHBOARD}`),children:"Go to Apps"})]})},oy=[{errorElement:l.jsx(ry,{}),children:[{path:Se.BASEPATH,element:l.jsx(DQ,{})},{path:Se.DASHBOARD,element:l.jsx(DQ,{})},{path:Se.AUTH_SUCCESS,element:l.jsx(WH,{})},{path:`${Se.API_VIEW}/:id`,element:l.jsx(uV,{})},{path:`${Se.CONNECTOR_SETTINGS}/:id`,element:l.jsx(jH,{})},{path:`${Se.NATIVE_INTEGRATION}/:id`,element:l.jsx(zH,{})},{path:`${Se.CONNECTOR_INITIAL_SETUP}/:id`,element:l.jsx(XH,{})},{path:`${Se.APP_DETAIL}/:id`,element:l.jsx(ey,{mode:"connector"})},{path:`${Se.TEMPLATE_APP}/:id`,element:l.jsx(ey,{mode:"template"})},{path:Se.GOHIGHLEVEL_CLAIM,element:l.jsx(YW,{})},{path:"*",element:l.jsx(ry,{})}]}],JW=oy[0].children.filter(e=>e.path!=="*"),XW=(e,t)=>CF(t?oy:JW,{basename:e}),ZW=({basename:e="/",metaData:t,userId:n})=>{var a;const{availableFeatures:r}=b.useContext($e),o=Nt(r,xo),A=b.useMemo(()=>XW(e,o),[e,o]);return(a=t==null?void 0:t.templateUpdates)!=null&&a.version&&n&&(Bk(t.templateUpdates.version),bk(n)),l.jsx(BF,{router:A})},qW="internal-chat",UW=g.styled(g.Box)`
2574
+ `,_W=({carouselImages:e,illustrationUrl:t,overviewHelpHeading:n,showScheduleCall:r,templateDescription:o,features:A,supportLinks:a,appName:i})=>{const s=(e??[]).map(({url:c})=>({src:c}));return l.jsxs(MW,{children:[l.jsxs("div",{children:[t?l.jsx(Hb,{children:l.jsx("img",{src:t,alt:`${i??"App"} overview`})}):s.length>0&&l.jsx(LC,{previewList:s}),o&&l.jsx(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-heading)",marginTop:2},children:l.jsx("span",{dangerouslySetInnerHTML:{__html:o}})}),A&&A.length>0&&l.jsxs(Wb,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"24px",letterSpacing:"0.042px",color:"var(--connector-admin-text-primary)",marginBottom:"8px"},children:"Features"}),A.map((c,u)=>l.jsxs(g.Typography,{sx:{fontSize:`${g.theme.typography.body2.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:[u+1,". ",c]},u))]})]}),l.jsxs(g.Stack,{gap:"12px",children:[l.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:n??Td}),r!==!1&&l.jsx(Wi,{isSettingsPage:!0}),l.jsx(WC,{connectorName:i,supportLinks:a})]})]})},qb=e=>yd(e,!1),Ub=["Overview","Visibility"],LW={title:"Configuration",visibility:!0},Kb={textTransform:"none",fontSize:`${g.theme.typography.body1.fontSize}px`,fontWeight:g.theme.typography.fontWeightMedium,letterSpacing:"0.25px",minHeight:"auto",padding:"0",color:"var(--connector-admin-text-tertiary)","&.Mui-selected":{color:"var(--connector-admin-accent)"}},PW=({mode:e})=>{const t=Jt(),n=cn(),{id:r=""}=ko(),o=xe(CA),A=xe(Nn),a=xe(sc),i=xe(so),s=e==="template"?(o==null?void 0:o[r])??null:null,c=e==="connector"?(A==null?void 0:A[r])??null:null;return b.useEffect(()=>{var u,d;r&&(e==="template"?(u=o==null?void 0:o[r])!=null&&u.apiList||n(EA(r)):(d=A==null?void 0:A[r])!=null&&d.apiList||n(pA(r)))},[r,e,o,A,n]),e==="template"?s!=null&&s.apiList?qb(s.type)?l.jsx($b,{mode:"template",id:r,headerSource:s}):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}`,replace:!0}):a===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Template ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})}):c!=null&&c.apiList?qb(c.type)?l.jsx($b,{mode:"connector",id:r,headerSource:c}):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}?isEdit=true`,replace:!0}):i===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Connector ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})})},$b=({mode:e,id:t,headerSource:n})=>{const r=Jt(),o=g.useTheme(),[A,a]=Ro(),i=b.useMemo(()=>g.createTheme(o,{typography:Vg("'Hanken Grotesk', system-ui, sans-serif").typography}),[o]),c=vQ(n.type)({mode:e,id:t}),u=n.logo,d=A.get("tab"),Q=d==="overview"?0:d==="visibility"?1:e==="connector"?1:0,[I,E]=b.useState(Q),C=(B,f)=>{E(f);const m=new URLSearchParams(A);m.set("tab",f===1?"visibility":"overview"),a(m,{replace:!0})},h=()=>C({},1);return l.jsx(g.HiverProvider,{theme:i,children:l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>r(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsxs(XC,{children:[l.jsxs(ZC,{children:[u&&l.jsx(_b,{children:l.jsx(Lb,{children:l.jsx("img",{src:u,alt:n.name})})}),l.jsxs(OW,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.h1.fontSize}px`,lineHeight:"32px",letterSpacing:"0.2px",color:"var(--connector-admin-app-title)"},children:n.name}),l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightRegular,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:n.description})]})]}),e==="template"&&I===0&&l.jsx(FW,{variant:"contained",disableElevation:!0,onClick:h,children:"Start setup"}),e==="connector"&&l.jsx(DW,{connectorId:t,isEnabled:!!n.isEnabled,isAuthenticated:!!n.isAuthenticated,connectorType:n.type,connectorName:n.name})]}),l.jsxs(g.Tabs,{value:I,onChange:C,TabIndicatorProps:{sx:{backgroundColor:"var(--connector-admin-accent)",height:"2px"}},sx:{marginTop:4,minHeight:"auto",width:"100%",borderBottom:"1px solid var(--connector-admin-border-strong)"},children:[l.jsx(g.Tab,{label:Ub[0],sx:Kb}),l.jsx(g.Tab,{label:Ub[1],sx:Kb})]}),l.jsx("div",{hidden:I!==0,style:{paddingTop:24},children:l.jsx(_W,{carouselImages:n.carouselImages,illustrationUrl:n.illustrationUrl,overviewHelpHeading:n.overviewHelpHeading,showScheduleCall:n.showScheduleCall,templateDescription:n.templateDescription,features:n.features,supportLinks:n.supportLinks,appName:n.name})}),l.jsx("div",{hidden:I!==1,style:{paddingTop:24},children:l.jsx(Zb,{schema:n.configuration??LW,controller:c})})]})})},kW=({carouselImages:e,illustrationUrl:t,overviewHelpHeading:n,showScheduleCall:r,templateDescription:o,features:A,apiList:a,appType:i,supportLinks:s,appName:c})=>{const u=(e??[]).map(({url:p})=>({src:p})),d=(a??[]).filter(({keyName:p,name:Q})=>!/webhook/i.test(`${p??""} ${Q??""}`));return l.jsxs(Gb,{children:[l.jsxs("div",{children:[t?l.jsx(Hb,{children:l.jsx("img",{src:t,alt:`${c??"App"} overview`})}):u.length>0&&l.jsx(LC,{previewList:u}),o&&l.jsx(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-heading)",marginTop:2},children:l.jsx("span",{dangerouslySetInnerHTML:{__html:o}})}),A&&A.length>0&&l.jsxs(Wb,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"24px",letterSpacing:"0.042px",color:"var(--connector-admin-text-primary)",marginBottom:"8px"},children:"Features"}),A.map((p,Q)=>l.jsxs(g.Typography,{sx:{fontSize:`${g.theme.typography.body2.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:[Q+1,". ",p]},Q))]}),!(A!=null&&A.length)&&d.length>0&&l.jsx(FQ,{apiList:d,connectorName:c,connectorType:i})]}),l.jsxs(gW,{children:[l.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:n??Td}),r!==!1&&l.jsx(Wi,{isSettingsPage:!0}),l.jsx(WC,{connectorName:c,supportLinks:s})]})]})},NW=[{label:"Active",enabled:!0},{label:"Inactive",enabled:!1}],RW=({connectorId:e,isEnabled:t,isAuthenticated:n,connectorType:r,connectorName:o})=>{const A=cn(),{sendTrackingEvent:a}=b.useContext($e),i=xe(Ca),s=xe(so),c=xe(ul),[u,d]=b.useState(null),p=(c==null?void 0:c[e])===pe.LOADING,I=[i,s].includes(pe.LOADING)||!n||p,E=C=>{d(null),C!==t&&A(IA({id:e,enabled:C})).unwrap().then(()=>{r==="slack"&&a(C?ze.SLACK_INTEGRATION_ENABLED:ze.SLACK_INTEGRATION_DISABLED,{connector_name:o}),C||tt({message:gc,type:hi})}).catch(()=>{tt({message:uc,type:Lt})})};return l.jsxs(l.Fragment,{children:[l.jsx(cW,{"aria-haspopup":"menu","aria-expanded":u?"true":void 0,disabled:I,onClick:C=>d(C.currentTarget),endIcon:p?l.jsx(g.CircularProgress,{size:16}):l.jsx(UC,{size:16}),children:t?"Active":"Inactive"}),l.jsx(g.Menu,{anchorEl:u,open:!!u,onClose:()=>d(null),sx:lW,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:NW.map(C=>l.jsx(g.MenuItem,{selected:C.enabled===t,onClick:()=>E(C.enabled),children:C.label},C.label))})]})},jW={overview:"Overview",authentication:"Authentication",visibility:"Visibility"},VW={title:"Configuration",visibility:!0},GW={textTransform:"none",fontSize:`${g.theme.typography.body1.fontSize}px`,fontWeight:g.theme.typography.fontWeightMedium,letterSpacing:"0.25px",minHeight:"auto",padding:"0",color:"var(--connector-admin-text-tertiary)","&.Mui-selected":{color:"var(--connector-admin-accent)"}},ey=({mode:e})=>{const{availableFeatures:t}=b.useContext($e);return Nt(t,xo)?l.jsx(HW,{mode:e}):l.jsx(PW,{mode:e})},HW=({mode:e})=>{const t=Jt(),n=cn(),{id:r=""}=ko(),o=xe(CA),A=xe(Nn),a=xe(sc),i=xe(so),s=e==="template"?(o==null?void 0:o[r])??null:null,c=e==="connector"?(A==null?void 0:A[r])??null:null;b.useEffect(()=>{var d,p;r&&(e==="template"?(d=o==null?void 0:o[r])!=null&&d.apiList||n(EA(r)):(p=A==null?void 0:A[r])!=null&&p.apiList||n(pA(r)))},[r,e,o,A,n]);const u=!!c;return b.useEffect(()=>{e!=="connector"||!r||n(Do())},[r,e,n]),b.useEffect(()=>{e!=="connector"||!r||!u||n(Qi(r))},[r,e,u,n]),e==="template"?s!=null&&s.apiList?Cl(s.type)?l.jsx(ty,{mode:"template",id:r,headerSource:s},r):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}`,replace:!0}):a===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Template ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})}):c!=null&&c.apiList?Cl(c.type)?l.jsx(ty,{mode:"connector",id:r,headerSource:c},r):l.jsx(da,{to:`${Se.BASEPATH}${Se.API_VIEW}/${r}?isEdit=true`,replace:!0}):i===pe.FAILED?l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsx(g.Typography,{variant:"h6",sx:{marginTop:2,fontWeight:g.theme.typography.fontWeightSemiBold},children:"Couldn’t load app"}),l.jsxs(g.Typography,{variant:"body2",sx:{color:"var(--connector-admin-text-tertiary)"},children:["Connector ID “",r,"” couldn’t be fetched. Try refreshing."]})]}):l.jsx(Kr,{children:l.jsx(Yl,{})})},ty=({mode:e,id:t,headerSource:n})=>{const r=Jt(),o=g.useTheme(),[A,a]=Ro(),i=b.useMemo(()=>g.createTheme(o,{typography:Vg("'Hanken Grotesk', system-ui, sans-serif").typography}),[o]),c=vQ(n.type)({mode:e,id:t}),u=n.logo,d=!(e==="template"&&Gi(n.type)),p=Gi(n.type),Q=["overview","authentication","visibility"].filter(T=>(T!=="authentication"||p)&&(T!=="visibility"||d)),I=A.get("tab"),E=e==="template"?"overview":n.isAuthenticated?"visibility":"authentication",[C,h]=b.useState(I&&Q.includes(I)?I:Q.includes(E)?E:"overview"),B=T=>{h(T);const O=new URLSearchParams(A);O.set("tab",T),a(O,{replace:!0})},{availableFeatures:f,connectorFunctions:m}=b.useContext($e),v=()=>d?B("visibility"):r(`${Se.BASEPATH}${Se.CONNECTOR_SETTINGS}/${t}`),w=t_(n.type)&&Nt(f,xo)&&typeof(m==null?void 0:m.openCopilot)=="function",x=e!=="connector"?null:n.isAuthenticated?{status:"connected",label:"Connected"}:n.authPending?null:{status:"failed",label:"Authentication failed"},y=()=>{var T;(T=m==null?void 0:m.openCopilot)==null||T.call(m,{app:n.type,connectorId:t,name:n.name})};return l.jsx(g.HiverProvider,{theme:i,children:l.jsxs(Kr,{children:[l.jsxs(Ra,{onClick:()=>r(`${Se.BASEPATH}${Se.DASHBOARD}`),children:[l.jsx(Na,{"aria-hidden":!0,width:20,height:20}),"Apps Marketplace"]}),l.jsxs(XC,{children:[l.jsxs(ZC,{children:[u&&l.jsx(_b,{children:l.jsx(Lb,{children:l.jsx("img",{src:u,alt:n.name})})}),l.jsxs(ZH,{children:[l.jsxs(qH,{children:[l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightMedium,fontSize:`${g.theme.typography.h1.fontSize}px`,lineHeight:"32px",letterSpacing:"0.2px",color:"var(--connector-admin-app-title)"},children:n.name}),x&&l.jsx(sW,{"data-status":x.status,children:x.label})]}),l.jsx(g.Typography,{sx:{fontWeight:g.theme.typography.fontWeightRegular,fontSize:`${g.theme.typography.body1.fontSize}px`,lineHeight:"20px",color:"var(--connector-admin-text-secondary)"},children:n.description})]})]}),e==="template"&&(w||C==="overview")&&l.jsx(Vb,{children:w?l.jsx(jb,{variant:"contained",disableElevation:!0,onClick:y,children:"Setup with AI"}):l.jsx(UH,{variant:"contained",disableElevation:!0,onClick:v,children:"Start setup"})}),e==="connector"&&l.jsxs(Vb,{children:[l.jsx(RW,{connectorId:t,isEnabled:!!n.isEnabled,isAuthenticated:!!n.isAuthenticated,connectorType:n.type,connectorName:n.name}),w&&l.jsxs(l.Fragment,{children:[l.jsx(uW,{role:"separator","aria-orientation":"vertical"}),l.jsx(jb,{variant:"contained",disableElevation:!0,onClick:y,children:"Setup with AI"})]})]})]}),l.jsx(g.Tabs,{value:C,onChange:(T,O)=>B(O),TabIndicatorProps:{sx:{backgroundColor:"var(--connector-admin-accent)",height:"2px"}},sx:{marginTop:4,minHeight:"auto",width:"100%",boxShadow:"inset 0 -2px 0 var(--connector-admin-border-strong)"},children:Q.map(T=>l.jsx(g.Tab,{value:T,label:jW[T],sx:GW,className:"border-b-0!"},T))}),l.jsx("div",{hidden:C!=="overview",style:{paddingTop:24},children:l.jsx(kW,{carouselImages:n.carouselImages,illustrationUrl:n.illustrationUrl,overviewHelpHeading:n.overviewHelpHeading,showScheduleCall:n.showScheduleCall,templateDescription:n.templateDescription,features:n.features,apiList:n.apiList,appType:n.type,supportLinks:n.supportLinks,appName:n.name})}),p&&l.jsx(dW,{hidden:C!=="authentication",style:{paddingTop:24},children:l.jsx(YC,{connectorData:n,isEdit:e==="connector",hideAuthFailedAlert:!0})}),l.jsx("div",{hidden:C!=="visibility",style:{paddingTop:24},children:e==="connector"&&Gi(n.type)?l.jsx(Tb,{connectorData:n}):l.jsx(Zb,{schema:n.configuration??VW,controller:c})})]})})},ny={not_admin:{title:"Ask a Hiver admin to finish this",body:"Only a Hiver admin can connect GoHighLevel. Ask an admin to sign in and open the link from the GoHighLevel install page again."},not_enabled:{title:"GoHighLevel isn't available on this workspace",body:"Contact support@hiverhq.com to enable the GoHighLevel integration for your Hiver workspace."},plan:{title:"Your Hiver plan doesn't include GoHighLevel",body:"Upgrade your plan, then install the app again from the GoHighLevel Marketplace."},expired:{title:"This install link has expired",body:"Install links work for 2 hours and only once. Install the app again from the GoHighLevel Marketplace."},agency_taken:{title:"This agency is connected to another Hiver workspace",body:"A GoHighLevel agency can be connected to one Hiver workspace. Contact support@hiverhq.com if this is unexpected."},other_agency:{title:"This workspace is connected to a different agency",body:"Your Hiver workspace is already connected to another GoHighLevel agency, and a workspace can connect one agency. Contact support@hiverhq.com to switch agencies."},failed:{title:"We couldn't finish connecting GoHighLevel",body:"Reload this page to try again. If it keeps failing, contact support@hiverhq.com."}},WW=new Set(Object.keys(ny)),zW=e=>{var r;const t=e==null?void 0:e.response;if((t==null?void 0:t.status)===402)return"plan";const n=(r=t==null?void 0:t.data)==null?void 0:r.reason;return typeof n=="string"&&WW.has(n)?n:"failed"},YW=()=>{const[e]=Ro(),t=Jt(),n=fl(),r=e.get("install")??"",[o,A]=b.useState(r?{status:"claiming"}:{status:"failed",reason:"expired"}),a=b.useRef(!1);if(b.useEffect(()=>{!r||a.current||(a.current=!0,Xe({url:W4,method:nt.POST,data:{install:r}}).then(s=>{const{connectorId:c,templateId:u,created:d}=(s==null?void 0:s.data)??{};if(!c){A({status:"failed",reason:"failed"});return}const p=d&&u?`${Se.BASEPATH}${Se.CONNECTOR_INITIAL_SETUP}/${u}?connectorId=${c}`:n({id:c,type:"gohighlevel",tabIndex:0});t(p,{replace:!0})}).catch(s=>A({status:"failed",reason:zW(s)})))},[r,t,n]),o.status==="claiming")return l.jsxs(g.Stack,{alignItems:"center",gap:2,sx:{padding:6},children:[l.jsx(g.CircularProgress,{size:28}),l.jsx(g.Typography,{variant:"h6",children:"Connecting GoHighLevel to Hiver…"}),l.jsx(g.Typography,{variant:"body2",children:"This takes a few seconds. Don't close this tab."})]});const i=ny[o.reason];return l.jsxs(g.Stack,{alignItems:"center",gap:2,sx:{padding:6,maxWidth:520,margin:"0 auto",textAlign:"center"},children:[l.jsx(g.Typography,{variant:"h6",children:i.title}),l.jsx(g.Typography,{variant:"body2",children:i.body}),l.jsx(g.Button,{size:"small",onClick:()=>t(`${Se.BASEPATH}${Se.DASHBOARD}`),children:"Go to Apps"})]})},ry=()=>{const e=Jt();return l.jsxs(g.Stack,{alignItems:"center",gap:2,sx:{padding:6},children:[l.jsx(g.Typography,{variant:"h6",children:"Page not found"}),l.jsx(g.Button,{size:"small",onClick:()=>e(`${Se.BASEPATH}${Se.DASHBOARD}`),children:"Go to Apps"})]})},oy=[{errorElement:l.jsx(ry,{}),children:[{path:Se.BASEPATH,element:l.jsx(DQ,{})},{path:Se.DASHBOARD,element:l.jsx(DQ,{})},{path:Se.AUTH_SUCCESS,element:l.jsx(WH,{})},{path:`${Se.API_VIEW}/:id`,element:l.jsx(uV,{})},{path:`${Se.CONNECTOR_SETTINGS}/:id`,element:l.jsx(jH,{})},{path:`${Se.NATIVE_INTEGRATION}/:id`,element:l.jsx(zH,{})},{path:`${Se.CONNECTOR_INITIAL_SETUP}/:id`,element:l.jsx(XH,{})},{path:`${Se.APP_DETAIL}/:id`,element:l.jsx(ey,{mode:"connector"})},{path:`${Se.TEMPLATE_APP}/:id`,element:l.jsx(ey,{mode:"template"})},{path:Se.GOHIGHLEVEL_CLAIM,element:l.jsx(YW,{})},{path:"*",element:l.jsx(ry,{})}]}],JW=oy[0].children.filter(e=>e.path!=="*"),XW=(e,t)=>CF(t?oy:JW,{basename:e}),ZW=({basename:e="/",metaData:t,userId:n})=>{var a;const{availableFeatures:r}=b.useContext($e),o=Nt(r,xo),A=b.useMemo(()=>XW(e,o),[e,o]);return(a=t==null?void 0:t.templateUpdates)!=null&&a.version&&n&&(Bk(t.templateUpdates.version),bk(n)),l.jsx(BF,{router:A})},qW="internal-chat",UW=g.styled(g.Box)`
2575
2575
  padding: 43px 0px 0 35px;
2576
2576
  box-sizing: border-box;
2577
2577
  width: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-admin",
3
- "version": "4.26.0",
3
+ "version": "4.26.1-slackAuthTab-beta.0",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",
@@ -19,6 +19,7 @@ interface ExtendedRenderOptions extends Omit<RenderOptions, 'queries'> {
19
19
  }
20
20
  export declare const waitForLoadingToFinish: () => Promise<void>;
21
21
  export declare const renderApp: (ui: React.ReactElement, { url, path, preloadedState, store, availableFeatures, connectorFunctions, ...renderOptions }?: ExtendedRenderOptions) => Promise<{
22
+ router: import('@remix-run/router').Router;
22
23
  container: HTMLElement;
23
24
  baseElement: HTMLElement;
24
25
  debug: (baseElement?: import('react-dom/client').Container | (Element | Document) | Array<import('react-dom/client').Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: import('pretty-format').OptionsReceived | undefined) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../src/testing/test-utils.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAqC,MAAM,wBAAwB,CAAC;AAChG,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,UAAU,qBAAsB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,sBAAsB,qBAG/B,CAAC;AAEL,eAAO,MAAM,SAAS,OAChB,KAAK,CAAC,YAAY,kGASnB,qBAAqB;;;uBAtBH,CAAC,yJAEA,CAAC,6BAEP,CAAC;yBAGmB,SACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDD,CAAC;AAGF,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../src/testing/test-utils.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAqC,MAAM,wBAAwB,CAAC;AAChG,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,UAAU,qBAAsB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,sBAAsB,qBAG/B,CAAC;AAEL,eAAO,MAAM,SAAS,OAChB,KAAK,CAAC,YAAY,kGASnB,qBAAqB;;;;uBAtBH,CAAC,yJAEA,CAAC,6BAEP,CAAC;yBAGmB,SACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDD,CAAC;AAGF,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}