@burdenoff/microfe-integrations 2026.715.2 → 2026.724.2

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.
Files changed (25) hide show
  1. package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
  2. package/dist/integrations/components/AddConnectionDialog.js +331 -241
  3. package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
  4. package/dist/integrations/components/ProviderIcon.d.ts.map +1 -1
  5. package/dist/integrations/components/ProviderIcon.js +3 -0
  6. package/dist/integrations/components/ProviderIcon.js.map +1 -1
  7. package/dist/integrations/hooks/useConnections.d.ts +12 -0
  8. package/dist/integrations/hooks/useConnections.d.ts.map +1 -1
  9. package/dist/integrations/hooks/useConnections.js +22 -4
  10. package/dist/integrations/hooks/useConnections.js.map +1 -1
  11. package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -1
  12. package/dist/integrations/pages/AddConnectionWizard.js +308 -220
  13. package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
  14. package/dist/integrations/types/index.d.ts +1 -1
  15. package/dist/integrations/types/index.d.ts.map +1 -1
  16. package/dist/integrations/utils/constants.d.ts.map +1 -1
  17. package/dist/integrations/utils/constants.js +7 -0
  18. package/dist/integrations/utils/constants.js.map +1 -1
  19. package/dist/integrations/utils/integrationsHelpers.d.ts +17 -0
  20. package/dist/integrations/utils/integrationsHelpers.d.ts.map +1 -1
  21. package/dist/integrations/utils/integrationsHelpers.js +10 -1
  22. package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
  23. package/dist/integrations/utils/mappers.js +1 -1
  24. package/dist/integrations/utils/mappers.js.map +1 -1
  25. package/package.json +1 -1
@@ -1,153 +1,171 @@
1
1
  import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { INTEGRATION_PERMISSIONS as n } from "../constants/permissions.js";
4
- import { getAuthTypeLabel as r, getCategoryLabel as i } from "../utils/integrationsHelpers.js";
4
+ import { getAuthTypeLabel as r, getCategoryLabel as i, parseConfigSchema as a } from "../utils/integrationsHelpers.js";
5
5
  import { useGetConnectionLazyQuery as ee } from "../../generated/wspace-operations.js";
6
6
  import { useProvider as te, useProviders as ne } from "../hooks/useProviders.js";
7
- import { useAuthenticateWithApiKey as re, useAuthenticateWithBasicAuth as ie, useAuthenticateWithBearerToken as ae, useAuthenticateWithServiceAccount as oe, useCreateConnection as se, useInitiateOAuth as ce } from "../hooks/useConnections.js";
8
- import { waitForOAuthPopupCompletion as le } from "../utils/oauthPopup.js";
9
- import { CredentialStorageSelector as ue } from "./CredentialStorageSelector.js";
10
- import { ProviderIcon as a } from "./ProviderIcon.js";
11
- import { useCallback as de, useEffect as o, useId as fe, useMemo as s, useRef as c, useState as l } from "react";
12
- import { AlertCircle as pe, Check as me, CheckCircle2 as he, ExternalLink as ge, Info as _e, Key as u, Link2 as ve, Loader2 as d, Lock as ye, Search as be, Shield as xe, X as Se } from "lucide-react";
13
- import { usePermissions as Ce } from "@burdenoff/fe-libs/shared/providers/shell";
14
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
15
- import { IllustratedEmptyState as we } from "@burdenoff/fe-libs/ui";
7
+ import { useAuthenticateWithApiKey as re, useAuthenticateWithBasicAuth as ie, useAuthenticateWithBearerToken as ae, useAuthenticateWithCustomConfig as oe, useAuthenticateWithServiceAccount as se, useCreateConnection as ce, useInitiateOAuth as le } from "../hooks/useConnections.js";
8
+ import { waitForOAuthPopupCompletion as ue } from "../utils/oauthPopup.js";
9
+ import { CredentialStorageSelector as de } from "./CredentialStorageSelector.js";
10
+ import { ProviderIcon as o } from "./ProviderIcon.js";
11
+ import { useCallback as fe, useEffect as s, useId as pe, useMemo as c, useRef as l, useState as u } from "react";
12
+ import { AlertCircle as d, Check as me, CheckCircle2 as he, ExternalLink as ge, Info as _e, Key as f, Link2 as ve, Loader2 as p, Lock as m, Search as ye, Shield as be, X as xe } from "lucide-react";
13
+ import { usePermissions as Se } from "@burdenoff/fe-libs/shared/providers/shell";
14
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
15
+ import { IllustratedEmptyState as Ce } from "@burdenoff/fe-libs/ui";
16
16
  //#region src/integrations/components/AddConnectionDialog.tsx
17
- function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated: v }) {
18
- let { apiGatewayUrl: y } = e(), { providers: b, loading: x } = ne(), Te = s(() => _ ? (b ?? []).find((e) => e.id === _) ?? null : null, [b, _]), { provider: Ee, loading: De } = te(!x && _ && !Te ? _ : ""), S = Te ?? Ee, C = !!_ && !S && (x || De), { hasPermission: Oe, isLoading: w } = Ce(), ke = !w && Oe(n.CONNECTION_CREATE), { createConnection: T, loading: Ae } = se(), { initiateOAuth: E, loading: je } = ce(), { authenticateWithApiKey: Me, loading: Ne } = re(), { authenticateWithBasicAuth: Pe, loading: Fe } = ie(), { authenticateWithBearerToken: Ie, loading: Le } = ae(), { authenticateWithServiceAccount: Re, loading: ze } = oe(), [Be] = ee({ fetchPolicy: "network-only" }), [D, O] = l(null), [k, A] = l(!_), [j, Ve] = l("connection"), [M, He] = l(""), [N, P] = l(""), [F, Ue] = l(""), [I, We] = l(""), [L, Ge] = l(""), [R, Ke] = l(""), [z, qe] = l(""), [B, Je] = l({
17
+ function v({ open: v, onClose: y, preselectedProviderId: b, onConnectionCreated: x }) {
18
+ let { apiGatewayUrl: S } = e(), { providers: C, loading: w } = ne(), we = c(() => b ? (C ?? []).find((e) => e.id === b) ?? null : null, [C, b]), { provider: Te, loading: Ee } = te(!w && b && !we ? b : ""), T = we ?? Te, De = !!b && !T && (w || Ee), { hasPermission: Oe, isLoading: ke } = Se(), Ae = !ke && Oe(n.CONNECTION_CREATE), { createConnection: je, loading: Me } = ce(), { initiateOAuth: Ne, loading: Pe } = le(), { authenticateWithApiKey: Fe, loading: Ie } = re(), { authenticateWithBasicAuth: Le, loading: Re } = ie(), { authenticateWithBearerToken: ze, loading: Be } = ae(), { authenticateWithServiceAccount: Ve, loading: He } = se(), { authenticateWithCustomConfig: Ue, loading: We } = oe(), [E] = ee({ fetchPolicy: "network-only" }), [D, O] = u(null), [k, A] = u(!b), [j, Ge] = u("connection"), [M, Ke] = u(""), [N, P] = u(""), [F, qe] = u(""), [I, Je] = u(""), [L, Ye] = u(""), [R, Xe] = u(""), [z, Ze] = u(""), [B, V] = u({}), [H, Qe] = u({
19
19
  mode: "managed",
20
20
  vaultId: "",
21
21
  secretId: "",
22
22
  managedSecretName: ""
23
- }), [V, Ye] = l(!1), [Xe, H] = l(""), [U, W] = l(!1), [G, K] = l(!1), [, q] = l(null), J = c(null), Y = c(null), Ze = c(null), Qe = fe(), X = (e) => `${Qe}-${e}`;
24
- o(() => {
25
- if (!h) return;
23
+ }), [U, $e] = u(!1), [et, W] = u(""), [G, K] = u(!1), [q, J] = u(!1), [, tt] = u(null), Y = l(null), X = l(null), nt = l(null), rt = pe(), Z = (e) => `${rt}-${e}`;
24
+ s(() => {
25
+ if (!v) return;
26
26
  let e = (e) => {
27
- e.key === "Escape" && g();
27
+ e.key === "Escape" && y();
28
28
  };
29
29
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
30
- }, [h, g]), o(() => () => {
31
- Y.current?.(), J.current && !J.current.closed && J.current.close();
32
- }, []), o(() => {
33
- h && (Ve("connection"), He(""), P(""), Ue(""), We(""), Ge(""), Ke(""), qe(""), Je({
30
+ }, [v, y]), s(() => () => {
31
+ X.current?.(), Y.current && !Y.current.closed && Y.current.close();
32
+ }, []), s(() => {
33
+ v && (Ge("connection"), Ke(""), P(""), qe(""), Je(""), Ye(""), Xe(""), Ze(""), V({}), Qe({
34
34
  mode: "managed",
35
35
  vaultId: "",
36
36
  secretId: "",
37
37
  managedSecretName: ""
38
- }), Ye(!1), H(""), W(!1), K(!1), q(null), _ ? (A(!1), O(null)) : (A(!0), O(null)));
39
- }, [h, _]), o(() => {
40
- h && _ && S && !D && (O(S), P(`${S.name} Connection`), A(!1));
38
+ }), $e(!1), W(""), K(!1), J(!1), tt(null), b ? (A(!1), O(null)) : (A(!0), O(null)));
39
+ }, [v, b]), s(() => {
40
+ v && b && T && !D && (O(T), P(`${T.name} Connection`), A(!1));
41
41
  }, [
42
- h,
43
- _,
44
- S,
42
+ v,
43
+ b,
44
+ T,
45
45
  D
46
- ]), o(() => {
47
- if (h && k) {
48
- let e = setTimeout(() => Ze.current?.focus(), 100);
46
+ ]), s(() => {
47
+ if (v && k) {
48
+ let e = setTimeout(() => nt.current?.focus(), 100);
49
49
  return () => clearTimeout(e);
50
50
  }
51
- }, [h, k]);
52
- let Z = s(() => {
53
- let e = (b ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
51
+ }, [v, k]);
52
+ let Q = c(() => {
53
+ let e = (C ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
54
54
  if (!M.trim()) return e;
55
55
  let t = M.toLowerCase();
56
56
  return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
57
- }, [b, M]), $e = s(() => {
57
+ }, [C, M]), it = c(() => {
58
58
  let e = {};
59
- return Z.forEach((t) => {
59
+ return Q.forEach((t) => {
60
60
  let n = t.category;
61
61
  e[n] || (e[n] = []), e[n].push(t);
62
62
  }), e;
63
- }, [Z]), et = de((e) => {
64
- O(e), P(`${e.name} Connection`), A(!1), H("");
65
- }, []), Q = Ae || je || G || Ne || Fe || Le || ze, $ = de(async () => {
63
+ }, [Q]), at = fe((e) => {
64
+ O(e), P(`${e.name} Connection`), A(!1), W("");
65
+ }, []), $ = Me || Pe || q || Ie || Re || Be || He || We, ot = fe(async () => {
66
66
  if (!D || !N.trim()) return;
67
67
  let e = D.authType === "service_account";
68
68
  if (!e) {
69
- if (!B.vaultId) {
70
- H("Please select a vault for this connection");
69
+ if (!H.vaultId) {
70
+ W("Please select a vault for this connection");
71
71
  return;
72
72
  }
73
- if (B.mode === "existing" && !B.secretId) {
74
- H("Please select an existing vault secret");
73
+ if (H.mode === "existing" && !H.secretId) {
74
+ W("Please select an existing vault secret");
75
75
  return;
76
76
  }
77
77
  }
78
78
  try {
79
- H("");
80
- let t = await T({
79
+ W("");
80
+ let t = await je({
81
81
  name: N.trim(),
82
82
  description: F.trim() || void 0,
83
83
  providerId: D.id,
84
84
  ...e ? {} : {
85
- vaultId: B.vaultId,
86
- credentialSecretId: B.mode === "existing" ? B.secretId : void 0,
87
- managedSecretName: B.mode === "managed" && B.managedSecretName.trim() || void 0
85
+ vaultId: H.vaultId,
86
+ credentialSecretId: H.mode === "existing" ? H.secretId : void 0,
87
+ managedSecretName: H.mode === "managed" && H.managedSecretName.trim() || void 0
88
88
  }
89
89
  });
90
90
  if (!t) {
91
- H("Failed to create connection");
91
+ W("Failed to create connection");
92
92
  return;
93
93
  }
94
- switch (q(t), D.authType) {
94
+ switch (tt(t), D.authType) {
95
95
  case "oauth2": {
96
- let e = await E(t, y ? `${y}/integrations/oauth/callback` : "/integrations/oauth/callback", D.key);
96
+ let e = await Ne(t, S ? `${S}/integrations/oauth/callback` : "/integrations/oauth/callback", D.key);
97
97
  if (e?.redirectUrl) {
98
98
  let n = window.screenX + (window.innerWidth - 600) / 2, r = window.screenY + (window.innerHeight - 700) / 2, i = window.open(e.redirectUrl, "oauth_popup", `width=600,height=700,left=${n},top=${r},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
99
99
  if (!i) {
100
- H("Popup was blocked. Please allow popups for this site and try again.");
100
+ W("Popup was blocked. Please allow popups for this site and try again.");
101
101
  return;
102
102
  }
103
- J.current = i, K(!0), Y.current?.(), Y.current = le({
103
+ Y.current = i, J(!0), X.current?.(), X.current = ue({
104
104
  connectionId: t,
105
105
  popup: i,
106
106
  fetchConnectionStatus: async () => {
107
- let { data: e } = await Be({ variables: { id: t } });
107
+ let { data: e } = await E({ variables: { id: t } });
108
108
  return e?.getConnection ?? null;
109
109
  },
110
110
  onSuccess: () => {
111
- W(!0), v?.(t);
111
+ K(!0), x?.(t);
112
112
  },
113
- onError: H,
113
+ onError: W,
114
114
  onSettled: () => {
115
- Y.current = null, J.current = null, K(!1);
115
+ X.current = null, Y.current = null, J(!1);
116
116
  }
117
117
  });
118
118
  return;
119
119
  }
120
- W(!0), v?.(t);
120
+ K(!0), x?.(t);
121
121
  break;
122
122
  }
123
123
  case "api_key":
124
124
  if (!I.trim()) {
125
- H("API key is required");
125
+ W("API key is required");
126
126
  return;
127
127
  }
128
- await Me(t, I.trim()), W(!0), v?.(t);
128
+ await Fe(t, I.trim()), K(!0), x?.(t);
129
129
  break;
130
130
  case "basic_auth":
131
131
  if (!L.trim() || !R.trim()) {
132
- H("Username and password are required");
132
+ W("Username and password are required");
133
133
  return;
134
134
  }
135
- await Pe(t, L.trim(), R.trim()), W(!0), v?.(t);
135
+ await Le(t, L.trim(), R.trim()), K(!0), x?.(t);
136
136
  break;
137
137
  case "bearer_token":
138
138
  if (!z.trim()) {
139
- H("Bearer token is required");
139
+ W("Bearer token is required");
140
140
  return;
141
141
  }
142
- await Ie(t, z.trim()), W(!0), v?.(t);
142
+ await ze(t, z.trim()), K(!0), x?.(t);
143
143
  break;
144
144
  case "service_account":
145
- await Re(t, D.defaultScopes && D.defaultScopes.length > 0 ? D.defaultScopes : void 0), W(!0), v?.(t);
145
+ await Ve(t, D.defaultScopes && D.defaultScopes.length > 0 ? D.defaultScopes : void 0), K(!0), x?.(t);
146
+ break;
147
+ case "custom": {
148
+ let e = a(D.configSchema);
149
+ if (!e) {
150
+ W("This provider does not declare a configuration form");
151
+ return;
152
+ }
153
+ for (let t of e.required) if (!B[t]?.trim()) {
154
+ W(`${e.properties[t]?.title ?? t} is required`);
155
+ return;
156
+ }
157
+ let n = {};
158
+ for (let t of Object.keys(e.properties)) {
159
+ let e = B[t]?.trim();
160
+ e && (n[t] = e);
161
+ }
162
+ await Ue(t, n), K(!0), x?.(t);
146
163
  break;
147
- default: W(!0), v?.(t);
164
+ }
165
+ default: K(!0), x?.(t);
148
166
  }
149
167
  } catch (e) {
150
- H(e instanceof Error ? e.message : "Connection failed");
168
+ W(e instanceof Error ? e.message : "Connection failed");
151
169
  }
152
170
  }, [
153
171
  D,
@@ -157,17 +175,19 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
157
175
  L,
158
176
  R,
159
177
  z,
160
- T,
178
+ B,
179
+ je,
180
+ Ne,
161
181
  E,
162
- Be,
163
- Me,
164
- Pe,
165
- Ie,
166
- Re,
167
- y,
168
- v,
169
- B
170
- ]), tt = [{
182
+ Fe,
183
+ Le,
184
+ ze,
185
+ Ve,
186
+ Ue,
187
+ S,
188
+ x,
189
+ H
190
+ ]), st = [{
171
191
  key: "connection",
172
192
  label: "Connection",
173
193
  icon: ve
@@ -176,137 +196,137 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
176
196
  label: "Details",
177
197
  icon: _e
178
198
  }];
179
- return h ? !ke && !w ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
199
+ return v ? !Ae && !ke ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
180
200
  className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
181
- onClick: g
182
- }), /* @__PURE__ */ m("div", {
201
+ onClick: y
202
+ }), /* @__PURE__ */ _("div", {
183
203
  role: "dialog",
184
204
  "aria-modal": "true",
185
205
  "aria-labelledby": "add-connection-denied-title",
186
206
  className: "fixed inset-x-4 top-1/2 z-50 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl border border-border-subtle bg-bg-surface p-8 shadow-2xl text-center",
187
207
  children: [
188
- /* @__PURE__ */ p(xe, {
208
+ /* @__PURE__ */ g(be, {
189
209
  size: 40,
190
210
  className: "text-text-secondary"
191
211
  }),
192
- /* @__PURE__ */ p("h2", {
212
+ /* @__PURE__ */ g("h2", {
193
213
  id: "add-connection-denied-title",
194
214
  className: "text-lg font-semibold text-text-primary",
195
215
  children: "Access Denied"
196
216
  }),
197
- /* @__PURE__ */ p("p", {
217
+ /* @__PURE__ */ g("p", {
198
218
  className: "text-sm text-text-secondary",
199
219
  children: "You don't have permission to create connections."
200
220
  }),
201
- /* @__PURE__ */ p("button", {
221
+ /* @__PURE__ */ g("button", {
202
222
  type: "button",
203
- onClick: g,
223
+ onClick: y,
204
224
  className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors",
205
225
  children: "Close"
206
226
  })
207
227
  ]
208
- })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
228
+ })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
209
229
  className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
210
- onClick: g
211
- }), /* @__PURE__ */ m("div", {
230
+ onClick: y
231
+ }), /* @__PURE__ */ _("div", {
212
232
  role: "dialog",
213
233
  "aria-modal": "true",
214
234
  "aria-labelledby": "add-connection-dialog-title",
215
235
  className: "fixed inset-x-4 top-4 bottom-4 z-50 mx-auto flex w-auto max-w-2xl flex-col overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:w-full sm:-translate-y-1/2",
216
- children: [/* @__PURE__ */ m("div", {
236
+ children: [/* @__PURE__ */ _("div", {
217
237
  className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
218
- children: [/* @__PURE__ */ p("div", {
238
+ children: [/* @__PURE__ */ g("div", {
219
239
  className: "flex items-center gap-3",
220
- children: D && !k ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(a, {
240
+ children: D && !k ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, {
221
241
  provider: D,
222
242
  size: 32
223
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("h2", {
243
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("h2", {
224
244
  id: "add-connection-dialog-title",
225
245
  className: "text-base font-semibold text-text-primary",
226
246
  children: [D.name, " account"]
227
- }), /* @__PURE__ */ p("p", {
247
+ }), /* @__PURE__ */ g("p", {
228
248
  className: "text-xs text-text-secondary",
229
249
  children: r(D.authType)
230
- })] })] }) : /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
250
+ })] })] }) : /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
231
251
  id: "add-connection-dialog-title",
232
252
  className: "text-base font-semibold text-text-primary",
233
253
  children: "Add new credential"
234
- }), /* @__PURE__ */ p("p", {
254
+ }), /* @__PURE__ */ g("p", {
235
255
  className: "text-xs text-text-secondary",
236
256
  children: "Select an app or service to connect to"
237
257
  })] })
238
- }), /* @__PURE__ */ m("div", {
258
+ }), /* @__PURE__ */ _("div", {
239
259
  className: "flex items-center gap-2",
240
- children: [D && !k && !U && /* @__PURE__ */ m("button", {
260
+ children: [D && !k && !G && /* @__PURE__ */ _("button", {
241
261
  type: "button",
242
- onClick: $,
243
- disabled: Q || !N.trim(),
262
+ onClick: ot,
263
+ disabled: $ || !N.trim(),
244
264
  className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
245
- children: [Q ? /* @__PURE__ */ p(d, {
265
+ children: [$ ? /* @__PURE__ */ g(p, {
246
266
  size: 14,
247
267
  className: "animate-spin"
248
- }) : /* @__PURE__ */ p(me, { size: 14 }), G ? "Waiting..." : "Save"]
249
- }), /* @__PURE__ */ p("button", {
268
+ }) : /* @__PURE__ */ g(me, { size: 14 }), q ? "Waiting..." : "Save"]
269
+ }), /* @__PURE__ */ g("button", {
250
270
  type: "button",
251
- onClick: g,
271
+ onClick: y,
252
272
  className: "p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
253
273
  "aria-label": "Close",
254
- children: /* @__PURE__ */ p(Se, { size: 20 })
274
+ children: /* @__PURE__ */ g(xe, { size: 20 })
255
275
  })]
256
276
  })]
257
- }), /* @__PURE__ */ m("div", {
277
+ }), /* @__PURE__ */ _("div", {
258
278
  className: "flex flex-1 min-h-0 overflow-hidden",
259
279
  children: [
260
- k && !D && /* @__PURE__ */ m("div", {
280
+ k && !D && /* @__PURE__ */ _("div", {
261
281
  className: "flex-1 p-5 overflow-y-auto",
262
282
  children: [
263
- /* @__PURE__ */ p("p", {
283
+ /* @__PURE__ */ g("p", {
264
284
  className: "text-sm text-text-secondary mb-3",
265
285
  children: "Select an app or service to connect to"
266
286
  }),
267
- /* @__PURE__ */ m("div", {
287
+ /* @__PURE__ */ _("div", {
268
288
  className: "relative mb-4",
269
- children: [/* @__PURE__ */ p(be, {
289
+ children: [/* @__PURE__ */ g(ye, {
270
290
  size: 16,
271
291
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
272
- }), /* @__PURE__ */ p("input", {
273
- ref: Ze,
292
+ }), /* @__PURE__ */ g("input", {
293
+ ref: nt,
274
294
  type: "text",
275
295
  value: M,
276
- onChange: (e) => He(e.target.value),
296
+ onChange: (e) => Ke(e.target.value),
277
297
  placeholder: "Search providers...",
278
298
  "aria-label": "Search providers",
279
299
  className: "w-full pl-9 pr-3 py-2.5 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
280
300
  })]
281
301
  }),
282
- x ? /* @__PURE__ */ p("div", {
302
+ w ? /* @__PURE__ */ g("div", {
283
303
  className: "flex items-center justify-center py-8",
284
- children: /* @__PURE__ */ p(d, {
304
+ children: /* @__PURE__ */ g(p, {
285
305
  size: 24,
286
306
  className: "animate-spin text-text-secondary"
287
307
  })
288
- }) : Z.length === 0 ? /* @__PURE__ */ p(we, {
308
+ }) : Q.length === 0 ? /* @__PURE__ */ g(Ce, {
289
309
  illustration: M ? "empty-search" : "empty-data",
290
310
  title: M ? "No matching providers" : "No providers available",
291
311
  description: M ? `No installed provider matches “${M}”. Try a different term.` : "Install and enable a provider from the catalog to create a connection."
292
- }) : /* @__PURE__ */ p("div", {
312
+ }) : /* @__PURE__ */ g("div", {
293
313
  className: "max-h-[400px] overflow-y-auto space-y-1",
294
- children: Object.entries($e).map(([e, t]) => /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
314
+ children: Object.entries(it).map(([e, t]) => /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
295
315
  className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
296
316
  children: i(e)
297
- }), t.map((e) => /* @__PURE__ */ m("button", {
317
+ }), t.map((e) => /* @__PURE__ */ _("button", {
298
318
  type: "button",
299
- onClick: () => et(e),
319
+ onClick: () => at(e),
300
320
  className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
301
- children: [/* @__PURE__ */ p(a, {
321
+ children: [/* @__PURE__ */ g(o, {
302
322
  provider: e,
303
323
  size: 32
304
- }), /* @__PURE__ */ m("div", {
324
+ }), /* @__PURE__ */ _("div", {
305
325
  className: "flex-1 min-w-0",
306
- children: [/* @__PURE__ */ p("div", {
326
+ children: [/* @__PURE__ */ g("div", {
307
327
  className: "text-sm font-medium text-text-primary",
308
328
  children: e.name
309
- }), /* @__PURE__ */ p("div", {
329
+ }), /* @__PURE__ */ g("div", {
310
330
  className: "text-xs text-text-secondary",
311
331
  children: r(e.authType)
312
332
  })]
@@ -315,38 +335,38 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
315
335
  })
316
336
  ]
317
337
  }),
318
- !k && !D && C && /* @__PURE__ */ p("div", {
338
+ !k && !D && De && /* @__PURE__ */ g("div", {
319
339
  className: "flex-1 flex items-center justify-center",
320
- children: /* @__PURE__ */ p(d, {
340
+ children: /* @__PURE__ */ g(p, {
321
341
  size: 32,
322
342
  className: "animate-spin text-text-secondary"
323
343
  })
324
344
  }),
325
- !k && !D && !C && _ && /* @__PURE__ */ m("div", {
345
+ !k && !D && !De && b && /* @__PURE__ */ _("div", {
326
346
  className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
327
- children: [/* @__PURE__ */ p(pe, {
347
+ children: [/* @__PURE__ */ g(d, {
328
348
  size: 32,
329
349
  className: "text-text-secondary mb-3"
330
- }), /* @__PURE__ */ p("p", {
350
+ }), /* @__PURE__ */ g("p", {
331
351
  className: "text-sm text-text-secondary",
332
352
  children: "This provider isn't available."
333
353
  })]
334
354
  }),
335
- U && D && /* @__PURE__ */ m("div", {
355
+ G && D && /* @__PURE__ */ _("div", {
336
356
  className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
337
357
  children: [
338
- /* @__PURE__ */ p("div", {
358
+ /* @__PURE__ */ g("div", {
339
359
  className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
340
- children: /* @__PURE__ */ p(he, {
360
+ children: /* @__PURE__ */ g(he, {
341
361
  size: 48,
342
362
  className: "text-status-success-text"
343
363
  })
344
364
  }),
345
- /* @__PURE__ */ p("h3", {
365
+ /* @__PURE__ */ g("h3", {
346
366
  className: "text-lg font-semibold text-text-primary mb-1",
347
367
  children: "Connection Created!"
348
368
  }),
349
- /* @__PURE__ */ m("p", {
369
+ /* @__PURE__ */ _("p", {
350
370
  className: "text-sm text-text-secondary mb-6",
351
371
  children: [
352
372
  "Your ",
@@ -354,83 +374,83 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
354
374
  " connection has been set up successfully."
355
375
  ]
356
376
  }),
357
- /* @__PURE__ */ p("button", {
377
+ /* @__PURE__ */ g("button", {
358
378
  type: "button",
359
- onClick: g,
379
+ onClick: y,
360
380
  className: "px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
361
381
  children: "Close dialog"
362
382
  })
363
383
  ]
364
384
  }),
365
- D && !k && !U && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
385
+ D && !k && !G && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
366
386
  className: "w-full border-b border-border-subtle sm:w-40 sm:border-b-0 sm:border-r flex-shrink-0 py-3 overflow-x-auto",
367
- children: tt.map((e) => {
387
+ children: st.map((e) => {
368
388
  let n = e.icon;
369
- return /* @__PURE__ */ m("button", {
389
+ return /* @__PURE__ */ _("button", {
370
390
  type: "button",
371
- onClick: () => Ve(e.key),
391
+ onClick: () => Ge(e.key),
372
392
  className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", j === e.key ? "text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
373
- children: [/* @__PURE__ */ p(n, { size: 16 }), e.label]
393
+ children: [/* @__PURE__ */ g(n, { size: 16 }), e.label]
374
394
  }, e.key);
375
395
  })
376
- }), /* @__PURE__ */ m("div", {
396
+ }), /* @__PURE__ */ _("div", {
377
397
  className: "flex-1 p-5 overflow-y-auto",
378
- children: [j === "connection" && /* @__PURE__ */ m("div", {
398
+ children: [j === "connection" && /* @__PURE__ */ _("div", {
379
399
  className: "space-y-5",
380
400
  children: [
381
- Xe && /* @__PURE__ */ m("div", {
401
+ et && /* @__PURE__ */ _("div", {
382
402
  className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
383
- children: [/* @__PURE__ */ p(pe, {
403
+ children: [/* @__PURE__ */ g(d, {
384
404
  size: 16,
385
405
  className: "text-status-error-text flex-shrink-0"
386
- }), /* @__PURE__ */ p("span", {
406
+ }), /* @__PURE__ */ g("span", {
387
407
  className: "text-sm text-status-error-text",
388
- children: Xe
408
+ children: et
389
409
  })]
390
410
  }),
391
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
392
- htmlFor: X("conn-name"),
411
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
412
+ htmlFor: Z("conn-name"),
393
413
  className: "block text-sm font-medium text-text-primary mb-1.5",
394
- children: ["Connection Name ", /* @__PURE__ */ p("span", {
414
+ children: ["Connection Name ", /* @__PURE__ */ g("span", {
395
415
  className: "text-status-error-text",
396
416
  children: "*"
397
417
  })]
398
- }), /* @__PURE__ */ p("input", {
399
- id: X("conn-name"),
418
+ }), /* @__PURE__ */ g("input", {
419
+ id: Z("conn-name"),
400
420
  "aria-label": "Connection Name",
401
421
  type: "text",
402
422
  value: N,
403
423
  onChange: (e) => P(e.target.value),
404
424
  placeholder: `My ${D.name} Connection`,
405
- disabled: Q,
425
+ disabled: $,
406
426
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
407
427
  })] }),
408
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
409
- htmlFor: X("conn-desc"),
428
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
429
+ htmlFor: Z("conn-desc"),
410
430
  className: "block text-sm font-medium text-text-primary mb-1.5",
411
431
  children: "Description"
412
- }), /* @__PURE__ */ p("input", {
413
- id: X("conn-desc"),
432
+ }), /* @__PURE__ */ g("input", {
433
+ id: Z("conn-desc"),
414
434
  "aria-label": "Description",
415
435
  type: "text",
416
436
  value: F,
417
- onChange: (e) => Ue(e.target.value),
437
+ onChange: (e) => qe(e.target.value),
418
438
  placeholder: "Optional description",
419
- disabled: Q,
439
+ disabled: $,
420
440
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
421
441
  })] }),
422
- D.authType !== "service_account" && /* @__PURE__ */ p(ue, {
423
- value: B,
424
- onChange: Je,
442
+ D.authType !== "service_account" && /* @__PURE__ */ g(de, {
443
+ value: H,
444
+ onChange: Qe,
425
445
  providerAuthType: D.authType
426
446
  }),
427
- /* @__PURE__ */ m("div", {
447
+ /* @__PURE__ */ _("div", {
428
448
  className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4",
429
449
  children: [
430
- /* @__PURE__ */ m("h3", {
450
+ /* @__PURE__ */ _("h3", {
431
451
  className: "font-medium text-text-primary flex items-center gap-2 mb-3 text-sm",
432
452
  children: [
433
- /* @__PURE__ */ p(xe, {
453
+ /* @__PURE__ */ g(be, {
434
454
  size: 16,
435
455
  className: "text-primary"
436
456
  }),
@@ -438,16 +458,16 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
438
458
  r(D.authType)
439
459
  ]
440
460
  }),
441
- D.authType === "oauth2" && /* @__PURE__ */ p("div", {
461
+ D.authType === "oauth2" && /* @__PURE__ */ g("div", {
442
462
  className: "space-y-3",
443
- children: G ? /* @__PURE__ */ m("div", {
463
+ children: q ? /* @__PURE__ */ _("div", {
444
464
  className: "flex flex-col items-center gap-3 py-4",
445
465
  children: [
446
- /* @__PURE__ */ p(d, {
466
+ /* @__PURE__ */ g(p, {
447
467
  size: 28,
448
468
  className: "animate-spin text-primary"
449
469
  }),
450
- /* @__PURE__ */ m("p", {
470
+ /* @__PURE__ */ _("p", {
451
471
  className: "text-sm font-medium text-text-primary",
452
472
  children: [
453
473
  "Waiting for ",
@@ -455,33 +475,33 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
455
475
  " authorization…"
456
476
  ]
457
477
  }),
458
- /* @__PURE__ */ p("p", {
478
+ /* @__PURE__ */ g("p", {
459
479
  className: "text-xs text-text-secondary",
460
480
  children: "Complete the sign-in in the popup window"
461
481
  }),
462
- /* @__PURE__ */ m("div", {
482
+ /* @__PURE__ */ _("div", {
463
483
  className: "p-2 rounded-md bg-status-warning-bg-subtle border border-border-default text-xs text-status-warning-text flex items-center gap-1.5",
464
- children: [/* @__PURE__ */ p(ge, { size: 12 }), "Don't see the popup? Check if it was blocked"]
484
+ children: [/* @__PURE__ */ g(ge, { size: 12 }), "Don't see the popup? Check if it was blocked"]
465
485
  })
466
486
  ]
467
- }) : /* @__PURE__ */ m("div", {
487
+ }) : /* @__PURE__ */ _("div", {
468
488
  className: "space-y-3",
469
- children: [/* @__PURE__ */ m("div", {
489
+ children: [/* @__PURE__ */ _("div", {
470
490
  className: "p-2.5 rounded-md bg-status-info-bg-subtle border border-border-default text-sm text-status-info-text flex items-center gap-2",
471
491
  children: [
472
- /* @__PURE__ */ p(ge, { size: 14 }),
492
+ /* @__PURE__ */ g(ge, { size: 14 }),
473
493
  "A popup window will open for",
474
494
  " ",
475
495
  D.name,
476
496
  " sign-in"
477
497
  ]
478
- }), /* @__PURE__ */ m("button", {
498
+ }), /* @__PURE__ */ _("button", {
479
499
  type: "button",
480
- onClick: $,
481
- disabled: Q || !N.trim(),
500
+ onClick: ot,
501
+ disabled: $ || !N.trim(),
482
502
  className: "w-full inline-flex items-center justify-center gap-2.5 rounded-md border border-primary bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
483
503
  children: [
484
- /* @__PURE__ */ p(a, {
504
+ /* @__PURE__ */ g(o, {
485
505
  provider: D,
486
506
  size: 20
487
507
  }),
@@ -492,53 +512,53 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
492
512
  })]
493
513
  })
494
514
  }),
495
- D.authType === "api_key" && /* @__PURE__ */ m("div", {
515
+ D.authType === "api_key" && /* @__PURE__ */ _("div", {
496
516
  className: "space-y-3",
497
- children: [/* @__PURE__ */ m("p", {
517
+ children: [/* @__PURE__ */ _("p", {
498
518
  className: "text-xs text-text-secondary",
499
519
  children: [
500
520
  "Enter your ",
501
521
  D.name,
502
522
  " API key."
503
523
  ]
504
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
505
- htmlFor: X("api-key"),
524
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
525
+ htmlFor: Z("api-key"),
506
526
  className: "block text-sm font-medium text-text-primary mb-1.5",
507
- children: ["API Key ", /* @__PURE__ */ p("span", {
527
+ children: ["API Key ", /* @__PURE__ */ g("span", {
508
528
  className: "text-status-error-text",
509
529
  children: "*"
510
530
  })]
511
- }), /* @__PURE__ */ m("div", {
531
+ }), /* @__PURE__ */ _("div", {
512
532
  className: "relative",
513
533
  children: [
514
- /* @__PURE__ */ p(u, {
534
+ /* @__PURE__ */ g(f, {
515
535
  size: 14,
516
536
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
517
537
  }),
518
- /* @__PURE__ */ p("input", {
519
- id: X("api-key"),
538
+ /* @__PURE__ */ g("input", {
539
+ id: Z("api-key"),
520
540
  "aria-label": "API Key",
521
- type: V ? "text" : "password",
541
+ type: U ? "text" : "password",
522
542
  value: I,
523
- onChange: (e) => We(e.target.value),
543
+ onChange: (e) => Je(e.target.value),
524
544
  placeholder: "Enter your API key",
525
- disabled: Q,
545
+ disabled: $,
526
546
  className: "w-full pl-9 pr-10 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
527
547
  }),
528
- /* @__PURE__ */ p("button", {
548
+ /* @__PURE__ */ g("button", {
529
549
  type: "button",
530
- onClick: () => Ye(!V),
531
- "aria-label": V ? "Hide secret" : "Show secret",
550
+ onClick: () => $e(!U),
551
+ "aria-label": U ? "Hide secret" : "Show secret",
532
552
  className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
533
- children: p(V ? ye : u, { size: 14 })
553
+ children: g(U ? m : f, { size: 14 })
534
554
  })
535
555
  ]
536
556
  })] })]
537
557
  }),
538
- D.authType === "basic_auth" && /* @__PURE__ */ m("div", {
558
+ D.authType === "basic_auth" && /* @__PURE__ */ _("div", {
539
559
  className: "space-y-3",
540
560
  children: [
541
- /* @__PURE__ */ m("p", {
561
+ /* @__PURE__ */ _("p", {
542
562
  className: "text-xs text-text-secondary",
543
563
  children: [
544
564
  "Enter your ",
@@ -546,91 +566,91 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
546
566
  " credentials."
547
567
  ]
548
568
  }),
549
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
550
- htmlFor: X("username"),
569
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
570
+ htmlFor: Z("username"),
551
571
  className: "block text-sm font-medium text-text-primary mb-1.5",
552
- children: ["Username ", /* @__PURE__ */ p("span", {
572
+ children: ["Username ", /* @__PURE__ */ g("span", {
553
573
  className: "text-status-error-text",
554
574
  children: "*"
555
575
  })]
556
- }), /* @__PURE__ */ p("input", {
557
- id: X("username"),
576
+ }), /* @__PURE__ */ g("input", {
577
+ id: Z("username"),
558
578
  "aria-label": "Username",
559
579
  type: "text",
560
580
  value: L,
561
- onChange: (e) => Ge(e.target.value),
581
+ onChange: (e) => Ye(e.target.value),
562
582
  placeholder: "Username or email",
563
- disabled: Q,
583
+ disabled: $,
564
584
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
565
585
  })] }),
566
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
567
- htmlFor: X("password"),
586
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
587
+ htmlFor: Z("password"),
568
588
  className: "block text-sm font-medium text-text-primary mb-1.5",
569
- children: ["Password ", /* @__PURE__ */ p("span", {
589
+ children: ["Password ", /* @__PURE__ */ g("span", {
570
590
  className: "text-status-error-text",
571
591
  children: "*"
572
592
  })]
573
- }), /* @__PURE__ */ m("div", {
593
+ }), /* @__PURE__ */ _("div", {
574
594
  className: "relative",
575
- children: [/* @__PURE__ */ p(ye, {
595
+ children: [/* @__PURE__ */ g(m, {
576
596
  size: 14,
577
597
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
578
- }), /* @__PURE__ */ p("input", {
579
- id: X("password"),
598
+ }), /* @__PURE__ */ g("input", {
599
+ id: Z("password"),
580
600
  "aria-label": "Password",
581
601
  type: "password",
582
602
  value: R,
583
- onChange: (e) => Ke(e.target.value),
603
+ onChange: (e) => Xe(e.target.value),
584
604
  placeholder: "Password",
585
- disabled: Q,
605
+ disabled: $,
586
606
  className: "w-full pl-9 pr-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
587
607
  })]
588
608
  })] })
589
609
  ]
590
610
  }),
591
- D.authType === "bearer_token" && /* @__PURE__ */ m("div", {
611
+ D.authType === "bearer_token" && /* @__PURE__ */ _("div", {
592
612
  className: "space-y-3",
593
- children: [/* @__PURE__ */ m("p", {
613
+ children: [/* @__PURE__ */ _("p", {
594
614
  className: "text-xs text-text-secondary",
595
615
  children: [
596
616
  "Enter your ",
597
617
  D.name,
598
618
  " bearer token."
599
619
  ]
600
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
601
- htmlFor: X("bearer-token"),
620
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
621
+ htmlFor: Z("bearer-token"),
602
622
  className: "block text-sm font-medium text-text-primary mb-1.5",
603
- children: ["Bearer Token ", /* @__PURE__ */ p("span", {
623
+ children: ["Bearer Token ", /* @__PURE__ */ g("span", {
604
624
  className: "text-status-error-text",
605
625
  children: "*"
606
626
  })]
607
- }), /* @__PURE__ */ m("div", {
627
+ }), /* @__PURE__ */ _("div", {
608
628
  className: "relative",
609
- children: [/* @__PURE__ */ p(u, {
629
+ children: [/* @__PURE__ */ g(f, {
610
630
  size: 14,
611
631
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
612
- }), /* @__PURE__ */ p("input", {
613
- id: X("bearer-token"),
632
+ }), /* @__PURE__ */ g("input", {
633
+ id: Z("bearer-token"),
614
634
  "aria-label": "Bearer Token",
615
635
  type: "password",
616
636
  value: z,
617
- onChange: (e) => qe(e.target.value),
637
+ onChange: (e) => Ze(e.target.value),
618
638
  placeholder: "Enter your token",
619
- disabled: Q,
639
+ disabled: $,
620
640
  className: "w-full pl-9 pr-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
621
641
  })]
622
642
  })] })]
623
643
  }),
624
- D.authType === "service_account" && /* @__PURE__ */ p("div", {
644
+ D.authType === "service_account" && /* @__PURE__ */ g("div", {
625
645
  className: "space-y-3",
626
- children: /* @__PURE__ */ m("div", {
646
+ children: /* @__PURE__ */ _("div", {
627
647
  className: "rounded-md border border-border bg-status-success-bg-subtle p-3",
628
648
  children: [
629
- /* @__PURE__ */ p("p", {
649
+ /* @__PURE__ */ g("p", {
630
650
  className: "text-sm font-medium text-foreground",
631
651
  children: "No credentials needed"
632
652
  }),
633
- /* @__PURE__ */ m("p", {
653
+ /* @__PURE__ */ _("p", {
634
654
  className: "text-xs text-muted-foreground mt-1",
635
655
  children: [
636
656
  D.name,
@@ -639,33 +659,103 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
639
659
  " permission to act on your behalf; access tokens are issued securely per use — there are no keys or secrets to manage."
640
660
  ]
641
661
  }),
642
- D.defaultScopes && D.defaultScopes.length > 0 && /* @__PURE__ */ m("p", {
662
+ D.defaultScopes && D.defaultScopes.length > 0 && /* @__PURE__ */ _("p", {
643
663
  className: "text-xs text-muted-foreground mt-2",
644
664
  children: ["Scopes: ", D.defaultScopes.join(", ")]
645
665
  })
646
666
  ]
647
667
  })
648
- })
668
+ }),
669
+ D.authType === "custom" && (() => {
670
+ let e = a(D.configSchema);
671
+ if (!e) return /* @__PURE__ */ _("div", {
672
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
673
+ children: [/* @__PURE__ */ g(d, {
674
+ size: 16,
675
+ className: "text-status-error-text flex-shrink-0"
676
+ }), /* @__PURE__ */ g("span", {
677
+ className: "text-sm text-status-error-text",
678
+ children: "This provider does not declare a configuration form."
679
+ })]
680
+ });
681
+ let t = new Set(e.required);
682
+ return /* @__PURE__ */ _("div", {
683
+ className: "space-y-3",
684
+ children: [/* @__PURE__ */ _("p", {
685
+ className: "text-xs text-text-secondary",
686
+ children: [
687
+ "Enter your ",
688
+ D.name,
689
+ " configuration. Secret fields are stored encrypted and never shown again."
690
+ ]
691
+ }), Object.entries(e.properties).map(([e, n]) => /* @__PURE__ */ _("div", { children: [
692
+ /* @__PURE__ */ _("label", {
693
+ htmlFor: Z(`custom-${e}`),
694
+ className: "block text-sm font-medium text-text-primary mb-1.5",
695
+ children: [
696
+ n?.title ?? e,
697
+ " ",
698
+ t.has(e) && /* @__PURE__ */ g("span", {
699
+ className: "text-status-error-text",
700
+ children: "*"
701
+ })
702
+ ]
703
+ }),
704
+ n?.secret ? /* @__PURE__ */ g("textarea", {
705
+ id: Z(`custom-${e}`),
706
+ "aria-label": n?.title ?? e,
707
+ value: B[e] ?? "",
708
+ onChange: (t) => V((n) => ({
709
+ ...n,
710
+ [e]: t.target.value
711
+ })),
712
+ placeholder: n?.description,
713
+ disabled: $,
714
+ rows: 4,
715
+ autoComplete: "off",
716
+ spellCheck: !1,
717
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
718
+ }) : /* @__PURE__ */ g("input", {
719
+ id: Z(`custom-${e}`),
720
+ "aria-label": n?.title ?? e,
721
+ type: "text",
722
+ value: B[e] ?? "",
723
+ onChange: (t) => V((n) => ({
724
+ ...n,
725
+ [e]: t.target.value
726
+ })),
727
+ placeholder: n?.description,
728
+ disabled: $,
729
+ autoComplete: "off",
730
+ className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
731
+ }),
732
+ n?.description && /* @__PURE__ */ g("p", {
733
+ className: "mt-1 text-xs text-text-secondary",
734
+ children: n.description
735
+ })
736
+ ] }, e))]
737
+ });
738
+ })()
649
739
  ]
650
740
  })
651
741
  ]
652
- }), j === "details" && /* @__PURE__ */ m("div", {
742
+ }), j === "details" && /* @__PURE__ */ _("div", {
653
743
  className: "space-y-4",
654
- children: [/* @__PURE__ */ p("h3", {
744
+ children: [/* @__PURE__ */ g("h3", {
655
745
  className: "text-sm font-semibold text-text-primary",
656
746
  children: "Details"
657
- }), /* @__PURE__ */ m("div", {
747
+ }), /* @__PURE__ */ _("div", {
658
748
  className: "space-y-3",
659
749
  children: [
660
- /* @__PURE__ */ m("div", {
750
+ /* @__PURE__ */ _("div", {
661
751
  className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
662
- children: [/* @__PURE__ */ p(a, {
752
+ children: [/* @__PURE__ */ g(o, {
663
753
  provider: D,
664
754
  size: 40
665
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
755
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
666
756
  className: "text-sm font-medium text-text-primary",
667
757
  children: D.name
668
- }), /* @__PURE__ */ m("p", {
758
+ }), /* @__PURE__ */ _("p", {
669
759
  className: "text-xs text-text-secondary",
670
760
  children: [
671
761
  r(D.authType),
@@ -675,27 +765,27 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
675
765
  ]
676
766
  })] })]
677
767
  }),
678
- D.description && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
768
+ D.description && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
679
769
  className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
680
770
  children: "Description"
681
- }), /* @__PURE__ */ p("p", {
771
+ }), /* @__PURE__ */ g("p", {
682
772
  className: "text-sm text-text-primary mt-1",
683
773
  children: D.description
684
774
  })] }),
685
- D.website && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
775
+ D.website && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
686
776
  className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
687
777
  children: "Website"
688
- }), /* @__PURE__ */ p("a", {
778
+ }), /* @__PURE__ */ g("a", {
689
779
  href: D.website,
690
780
  target: "_blank",
691
781
  rel: "noopener noreferrer",
692
782
  className: "block text-sm text-primary hover:underline mt-1",
693
783
  children: D.website
694
784
  })] }),
695
- D.docsUrl && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
785
+ D.docsUrl && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
696
786
  className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
697
787
  children: "Documentation"
698
- }), /* @__PURE__ */ p("a", {
788
+ }), /* @__PURE__ */ g("a", {
699
789
  href: D.docsUrl,
700
790
  target: "_blank",
701
791
  rel: "noopener noreferrer",
@@ -711,6 +801,6 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
711
801
  })] }) : null;
712
802
  }
713
803
  //#endregion
714
- export { h as AddConnectionDialog };
804
+ export { v as AddConnectionDialog };
715
805
 
716
806
  //# sourceMappingURL=AddConnectionDialog.js.map