import{r as p,j as e}from"./@radix-B1sy0Lhr.js";import{S as j}from"./chevron-down-Bl7WwQAL.js";import{D as i}from"./DisplayDate-57lUNS79.js";import{aZ as l,d as c,C as h,o as f,p as g,q as y,T as u,a2 as v}from"./index-CO6UN3UX.js";import{K as o,a as b,V as N,N as C}from"./NestedCollapsible-0yviIfaA.js";import{a as d,e as E,R as T,E as w}from"./service-connectors-nF4-OXB9.js";import{R}from"./resource-tyes-list-CugyWUAE.js";import{b as m}from"./@tanstack-Dwlisomv.js";import{a as x}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./eye-BXcQevds.js";import"./CollapsibleCard-DSZzbjx5.js";import"./check-circle-CG6XAdk-.js";import"./CodeSnippet-B7Wd4R8u.js";function P(){const[a,r]=p.useState(!0),{connectorId:s}=x(),n=m({...l.serviceConnectorDetail(s),throwOnError:!0});if(n.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(n.isError)return e.jsx("div",{children:"Error"});const t=n.data;return e.jsxs(h,{open:a,onOpenChange:r,children:[e.jsx(f,{className:"flex items-center gap-[10px]",children:e.jsxs(g,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(j,{className:` ${a?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),"Basic Parameters"]})}),e.jsx(y,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary p-5",children:e.jsxs("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:gap-y-4 lg:grid-cols-3",children:[e.jsx(o,{label:"Name",value:t.name}),e.jsx(_,{connector:t}),e.jsx(A,{connector:t}),e.jsx(D,{connector:t}),e.jsx(S,{connector:t}),e.jsx(O,{connector:t}),e.jsx(I,{connector:t}),e.jsx(Q,{connector:t}),e.jsx(K,{connector:t})]})})]})}function _({connector:a}){var s;const r=(s=a.body)==null?void 0:s.connector_type;return!r||typeof r=="string"?null:e.jsx(o,{label:"Type",value:e.jsxs(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit gap-0.5 text-theme-text-primary",color:"grey",children:[e.jsx("img",{src:r.logo_url??"",className:"h-4 w-4 shrink-0",alt:r.name}),e.jsx("span",{children:r.name})]})})}function A({connector:a}){var s;const r=d(a);return e.jsx(o,{label:"Auth Method",value:r===void 0?null:e.jsx(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit text-theme-text-primary",color:"grey",children:e.jsx("span",{children:r.name||((s=a.body)==null?void 0:s.auth_method)})})})}function D({connector:a}){const r=E(a);return e.jsxs(e.Fragment,{children:[e.jsx(b,{children:"Resrouce Types"}),e.jsx(N,{className:"h-auto",children:e.jsx(R,{resourceTypes:r})})]})}function S({connector:a}){return e.jsx(o,{label:"Resource Name",value:e.jsx(T,{connector:a})})}function O({connector:a}){var s,n,t;const r=(s=a.resources)==null?void 0:s.user;return e.jsx(o,{label:"Author",value:r?e.jsx(v,{avatarUrl:((n=r.body)==null?void 0:n.avatar_url)??void 0,username:r.name,isServiceAccount:!!((t=r.body)!=null&&t.is_service_account)}):null})}function I({connector:a}){var s;const r=(s=a.body)==null?void 0:s.expires_at;return e.jsx(o,{label:"Expires in",value:r?e.jsx(w,{expires:r}):"Never"})}function Q({connector:a}){var s;const r=(s=a.body)==null?void 0:s.created;return e.jsx(o,{label:"Created",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function K({connector:a}){var s;const r=(s=a.body)==null?void 0:s.updated;return e.jsx(o,{label:"Updated",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function M(){var t;const{connectorId:a}=x(),r=m({...l.serviceConnectorDetail(a),throwOnError:!0});if(r.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(r.isError)return e.jsx("div",{children:"Error"});const s=r.data,n=d(s);return e.jsx(C,{schema:n==null?void 0:n.config_schema,title:e.jsx("p",{className:"text-text-xl",children:"Configuration"}),data:(t=s.metadata)==null?void 0:t.configuration,isInitialOpen:!0})}function X(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5",children:[e.jsx("div",{children:e.jsx(P,{})}),e.jsx("div",{className:"space-y-5",children:e.jsx(M,{})})]})}export{X as default};
