@burdenoff/microfe-botmanor 2026.1127.3 → 2026.1127.4
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/dist/botlit/pages/AgentTestChatPage.js +95 -94
- package/dist/botlit/pages/AgentTestChatPage.js.map +1 -1
- package/dist/botlit/pages/BotChannelsTab.js +327 -328
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
- package/dist/botlit/pages/MCPServerDetailPage.js +285 -289
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
- package/dist/botlit/pages/PolicyDetailPage.js +457 -453
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +229 -228
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
- package/dist/botlit/pages/SkillDetailPage.js +324 -323
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
- package/dist/shared/hooks/useTr.js +1 -1
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,16 +14,16 @@ import { useBotlit as C } from "../providers/BotlitProvider.js";
|
|
|
14
14
|
import { PLATFORM_CREDENTIALS as w, connectorPlatform as T, useInboundChannel as E } from "../hooks/useChannelSetup.js";
|
|
15
15
|
import { isNative as D, nativeCopyText as O, nativeNotify as k, nativeOpenUrl as A, nativeToast as j } from "../../utils/nativeBridge.js";
|
|
16
16
|
import "../hooks/index.js";
|
|
17
|
-
import { useGlobalChannels as M, useLinkIntegrationConnection as N, useMyUserPlatformConnection as P, useRevokeSlackConnection as F, useToggleSlackNotifications as
|
|
18
|
-
import { ensureActiveConnector as
|
|
19
|
-
import { confirmAction as
|
|
20
|
-
import { useTr as
|
|
17
|
+
import { useGlobalChannels as M, useLinkIntegrationConnection as N, useMyUserPlatformConnection as P, useRevokeSlackConnection as F, useToggleSlackNotifications as ee } from "../hooks/useUserPlatformConnection.js";
|
|
18
|
+
import { ensureActiveConnector as I } from "../utils/channelConnectors.js";
|
|
19
|
+
import { confirmAction as L } from "../utils/confirmAction.js";
|
|
20
|
+
import { useTr as R } from "../../shared/hooks/useTr.js";
|
|
21
21
|
import "../permissions/index.js";
|
|
22
|
-
import { ChannelType as
|
|
23
|
-
import { useCallback as
|
|
24
|
-
import { ThemedSelect as
|
|
25
|
-
import { Fragment as
|
|
26
|
-
import { Bell as
|
|
22
|
+
import { ChannelType as z } from "../../generated/global-types.js";
|
|
23
|
+
import { useCallback as B, useMemo as V, useState as H } from "react";
|
|
24
|
+
import { ThemedSelect as te } from "@burdenoff/fe-libs/ui";
|
|
25
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
26
|
+
import { Bell as ne, BellOff as re, CheckCircle2 as K, Code as q, ExternalLink as J, Globe as Y, Loader2 as ie, Mail as X, MessageCircle as ae, MessageSquare as Z, Plus as oe, Radio as se, Slack as ce, Trash2 as le, Unlink as ue, Users as de, Webhook as fe } from "lucide-react";
|
|
27
27
|
import { toast as Q } from "sonner";
|
|
28
28
|
// src/botlit/pages/BotChannelsTab.tsx
|
|
29
29
|
var pe = {
|
|
@@ -67,329 +67,313 @@ function $(e) {
|
|
|
67
67
|
case "SLACK": return {
|
|
68
68
|
label: "Slack",
|
|
69
69
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
70
|
-
icon: /* @__PURE__ */
|
|
70
|
+
icon: /* @__PURE__ */ W(ce, { size: 18 }),
|
|
71
71
|
accentBg: "bg-accent",
|
|
72
72
|
accentText: "text-text-primary"
|
|
73
73
|
};
|
|
74
74
|
case "TEAMS": return {
|
|
75
75
|
label: "Teams",
|
|
76
76
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
77
|
-
icon: /* @__PURE__ */
|
|
77
|
+
icon: /* @__PURE__ */ W(de, { size: 18 }),
|
|
78
78
|
accentBg: "bg-accent",
|
|
79
79
|
accentText: "text-text-primary"
|
|
80
80
|
};
|
|
81
81
|
case "DISCORD": return {
|
|
82
82
|
label: "Discord",
|
|
83
83
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
84
|
-
icon: /* @__PURE__ */
|
|
84
|
+
icon: /* @__PURE__ */ W(ae, { size: 18 }),
|
|
85
85
|
accentBg: "bg-accent",
|
|
86
86
|
accentText: "text-text-primary"
|
|
87
87
|
};
|
|
88
88
|
case "WHATSAPP": return {
|
|
89
89
|
label: "WhatsApp",
|
|
90
90
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
91
|
-
icon: /* @__PURE__ */
|
|
91
|
+
icon: /* @__PURE__ */ W(Z, { size: 18 }),
|
|
92
92
|
accentBg: "bg-accent",
|
|
93
93
|
accentText: "text-text-primary"
|
|
94
94
|
};
|
|
95
95
|
case "EMAIL": return {
|
|
96
96
|
label: "Email",
|
|
97
97
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
98
|
-
icon: /* @__PURE__ */
|
|
98
|
+
icon: /* @__PURE__ */ W(X, { size: 18 }),
|
|
99
99
|
accentBg: "bg-accent",
|
|
100
100
|
accentText: "text-text-primary"
|
|
101
101
|
};
|
|
102
102
|
case "SMS": return {
|
|
103
103
|
label: "SMS",
|
|
104
104
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
105
|
-
icon: /* @__PURE__ */
|
|
105
|
+
icon: /* @__PURE__ */ W(Z, { size: 18 }),
|
|
106
106
|
accentBg: "bg-accent",
|
|
107
107
|
accentText: "text-text-primary"
|
|
108
108
|
};
|
|
109
109
|
case "WEBHOOK": return {
|
|
110
110
|
label: "Webhook",
|
|
111
111
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
112
|
-
icon: /* @__PURE__ */
|
|
112
|
+
icon: /* @__PURE__ */ W(fe, { size: 18 }),
|
|
113
113
|
accentBg: "bg-accent",
|
|
114
114
|
accentText: "text-text-primary"
|
|
115
115
|
};
|
|
116
116
|
case "WEB_WIDGET": return {
|
|
117
117
|
label: "Web Widget",
|
|
118
118
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
119
|
-
icon: /* @__PURE__ */
|
|
119
|
+
icon: /* @__PURE__ */ W(Y, { size: 18 }),
|
|
120
120
|
accentBg: "bg-accent",
|
|
121
121
|
accentText: "text-text-primary"
|
|
122
122
|
};
|
|
123
123
|
case "CUSTOM": return {
|
|
124
124
|
label: "Custom",
|
|
125
125
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
126
|
-
icon: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ W(q, { size: 18 }),
|
|
127
127
|
accentBg: "bg-accent",
|
|
128
128
|
accentText: "text-text-primary"
|
|
129
129
|
};
|
|
130
130
|
default: return {
|
|
131
131
|
label: e,
|
|
132
132
|
badgeClass: "bg-bg-sunken text-text-secondary",
|
|
133
|
-
icon: /* @__PURE__ */
|
|
133
|
+
icon: /* @__PURE__ */ W(se, { size: 18 }),
|
|
134
134
|
accentBg: "bg-accent",
|
|
135
135
|
accentText: "text-text-primary"
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
var ve = ({ routeId: e, connectorId: t, channelId: n, platform: r, onRemoved: s, onReconnect: l }) => {
|
|
140
|
-
let d =
|
|
141
|
-
return p ? /* @__PURE__ */
|
|
140
|
+
let d = R(), { data: f, loading: p } = m(t), h = f?.credentialsRefId ?? n, { data: g, loading: v, refetch: y } = P(h), { toggle: S, loading: C } = ee(), { revoke: w, loading: T } = F(), { link: E } = N(), [A] = _(), [M, I] = H(""), [z, B] = H(!1), U = $(r), q = !v && !g?.dmAllowed, J = b(q), Y = V(() => x(J.data, r), [J.data, r]), X = Y.some((e) => e.id === M) ? M : Y[0]?.id ?? "";
|
|
141
|
+
return p ? /* @__PURE__ */ W("div", { className: "h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }) : /* @__PURE__ */ G("div", {
|
|
142
142
|
className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4 space-y-3",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ G("div", {
|
|
144
144
|
className: "flex items-center justify-between",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ W("span", {
|
|
146
146
|
className: "text-xs text-text-secondary font-medium uppercase tracking-wide",
|
|
147
|
-
children: "Connected workspace"
|
|
148
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: d("botlit.botChannels.connectedWorkspace", "Connected workspace")
|
|
148
|
+
}), /* @__PURE__ */ W(o, {
|
|
149
149
|
permission: a.CHANNEL_DELETE,
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ W(i, {
|
|
151
151
|
variant: "ghost",
|
|
152
152
|
size: "icon",
|
|
153
153
|
onClick: async () => {
|
|
154
|
-
if (await
|
|
155
|
-
title:
|
|
154
|
+
if (await L({
|
|
155
|
+
title: d("botlit.botChannels.removeThisPlatformChannelFrom", "Remove this {{platform}} channel from the bot?", { platform: U.label }),
|
|
156
156
|
confirmLabel: d("botlit.channels.actions.remove", "Remove"),
|
|
157
157
|
cancelLabel: d("botlit.common.cancel", "Cancel"),
|
|
158
158
|
tone: "danger"
|
|
159
159
|
})) try {
|
|
160
|
-
await A(e), s(), Q.success(
|
|
160
|
+
await A(e), s(), Q.success(d("botlit.botChannels.platformChannelRemoved", "{{platform}} channel removed", { platform: U.label })), D() && k("success");
|
|
161
161
|
} catch (e) {
|
|
162
|
-
Q.error(e instanceof Error ? e.message : "Failed to remove"), D() && k("error");
|
|
162
|
+
Q.error(e instanceof Error ? e.message : d("botlit.botChannels.failedToRemove", "Failed to remove")), D() && k("error");
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
className: "h-7 w-7 text-text-secondary hover:text-status-error-text",
|
|
166
|
-
title: "Remove channel",
|
|
167
|
-
children: /* @__PURE__ */
|
|
166
|
+
title: d("botlit.botChannels.removeChannel", "Remove channel"),
|
|
167
|
+
children: /* @__PURE__ */ W(le, { size: 13 })
|
|
168
168
|
})
|
|
169
169
|
})]
|
|
170
|
-
}), v ? /* @__PURE__ */
|
|
170
|
+
}), v ? /* @__PURE__ */ G("div", {
|
|
171
171
|
className: "flex items-center gap-2 py-2 text-text-secondary",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ W(ie, {
|
|
173
173
|
size: 14,
|
|
174
174
|
className: "animate-spin"
|
|
175
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ W("span", {
|
|
176
176
|
className: "text-xs",
|
|
177
|
-
children:
|
|
178
|
-
"Checking ",
|
|
179
|
-
W.label,
|
|
180
|
-
" connection…"
|
|
181
|
-
]
|
|
177
|
+
children: d("botlit.botChannels.checkingConnection", "Checking {{platform}} connection…", { platform: U.label })
|
|
182
178
|
})]
|
|
183
|
-
}) : g?.dmAllowed ? /* @__PURE__ */
|
|
179
|
+
}) : g?.dmAllowed ? /* @__PURE__ */ G("div", {
|
|
184
180
|
className: "space-y-2",
|
|
185
181
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ G("div", {
|
|
187
183
|
className: "flex items-center gap-3 p-3 rounded-lg bg-bg-surface border border-border-subtle",
|
|
188
184
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ W(K, {
|
|
190
186
|
size: 16,
|
|
191
187
|
className: "text-status-success-text shrink-0"
|
|
192
188
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ G("div", {
|
|
194
190
|
className: "min-w-0 flex-1",
|
|
195
191
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ W("p", {
|
|
197
193
|
className: "font-medium text-sm",
|
|
198
194
|
children: g.externalDisplayName || g.externalUsername || g.externalUserId
|
|
199
195
|
}),
|
|
200
|
-
g.externalUsername && /* @__PURE__ */
|
|
196
|
+
g.externalUsername && /* @__PURE__ */ G("p", {
|
|
201
197
|
className: "text-xs text-text-secondary",
|
|
202
198
|
children: ["@", g.externalUsername]
|
|
203
199
|
}),
|
|
204
|
-
g.connectedAt && /* @__PURE__ */
|
|
200
|
+
g.connectedAt && /* @__PURE__ */ W("p", {
|
|
205
201
|
className: "text-xs text-text-secondary",
|
|
206
|
-
children:
|
|
202
|
+
children: d("botlit.botChannels.connectedOn", "Connected {{date}}", { date: new Date(g.connectedAt).toLocaleDateString() })
|
|
207
203
|
})
|
|
208
204
|
]
|
|
209
205
|
}),
|
|
210
|
-
g.isTokenExpired && /* @__PURE__ */
|
|
206
|
+
g.isTokenExpired && /* @__PURE__ */ W(c, {
|
|
211
207
|
variant: "outline",
|
|
212
208
|
className: "text-xs text-status-warning-text border-status-warning-border",
|
|
213
|
-
children: "Token expired"
|
|
209
|
+
children: d("botlit.botChannels.tokenExpired", "Token expired")
|
|
214
210
|
})
|
|
215
211
|
]
|
|
216
212
|
}),
|
|
217
|
-
g.integrationConnectionId && /* @__PURE__ */
|
|
213
|
+
g.integrationConnectionId && /* @__PURE__ */ G("div", {
|
|
218
214
|
className: "space-y-1.5",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ W("label", {
|
|
220
216
|
className: "text-xs font-medium text-text-secondary",
|
|
221
|
-
children: "Integration Connection ID"
|
|
222
|
-
}), /* @__PURE__ */
|
|
217
|
+
children: d("botlit.botChannels.integrationConnectionId", "Integration Connection ID")
|
|
218
|
+
}), /* @__PURE__ */ W(u, {
|
|
223
219
|
value: g.integrationConnectionId,
|
|
224
220
|
readOnly: !0,
|
|
225
221
|
className: "text-xs font-mono bg-bg-sunken/50 cursor-default",
|
|
226
222
|
onClick: (e) => {
|
|
227
|
-
e.currentTarget.select(), O(g.integrationConnectionId), Q.success("Connection ID copied to clipboard"), D() && j("Copied");
|
|
223
|
+
e.currentTarget.select(), O(g.integrationConnectionId), Q.success(d("botlit.botChannels.connectionIdCopiedToClipboard", "Connection ID copied to clipboard")), D() && j(d("botlit.botChannels.copied", "Copied"));
|
|
228
224
|
},
|
|
229
|
-
title: "Click to copy"
|
|
225
|
+
title: d("botlit.botChannels.clickToCopy", "Click to copy")
|
|
230
226
|
})]
|
|
231
227
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ G("div", {
|
|
233
229
|
className: "flex items-center justify-between p-3 border border-border-subtle rounded-lg bg-bg-surface",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ G("div", {
|
|
235
231
|
className: "flex items-center gap-2",
|
|
236
|
-
children: [g.notificationsEnabled ? /* @__PURE__ */
|
|
232
|
+
children: [g.notificationsEnabled ? /* @__PURE__ */ W(ne, {
|
|
237
233
|
size: 14,
|
|
238
234
|
className: "text-primary"
|
|
239
|
-
}) : /* @__PURE__ */
|
|
235
|
+
}) : /* @__PURE__ */ W(re, {
|
|
240
236
|
size: 14,
|
|
241
237
|
className: "text-text-secondary"
|
|
242
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
|
|
243
239
|
className: "text-sm font-medium",
|
|
244
|
-
children: "DM Notifications"
|
|
245
|
-
}), /* @__PURE__ */
|
|
240
|
+
children: d("botlit.botChannels.dmNotifications", "DM Notifications")
|
|
241
|
+
}), /* @__PURE__ */ W("p", {
|
|
246
242
|
className: "text-xs text-text-secondary",
|
|
247
|
-
children: g.notificationsEnabled ?
|
|
243
|
+
children: g.notificationsEnabled ? d("botlit.botChannels.botWillDmYouOn", "Bot will DM you on {{platform}}", { platform: U.label }) : d("botlit.botChannels.dmNotificationsPaused", "DM notifications paused")
|
|
248
244
|
})] })]
|
|
249
|
-
}), /* @__PURE__ */
|
|
245
|
+
}), /* @__PURE__ */ W(i, {
|
|
250
246
|
variant: "outline",
|
|
251
247
|
size: "sm",
|
|
252
248
|
isLoading: C,
|
|
253
249
|
onClick: async () => {
|
|
254
250
|
await S(g.id, !g.notificationsEnabled) && await y();
|
|
255
251
|
},
|
|
256
|
-
children: g.notificationsEnabled ? "Disable" : "Enable"
|
|
252
|
+
children: g.notificationsEnabled ? d("botlit.botChannels.disable", "Disable") : d("botlit.botChannels.enable", "Enable")
|
|
257
253
|
})]
|
|
258
254
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ G("div", {
|
|
260
256
|
className: "flex gap-2 justify-end pt-1",
|
|
261
|
-
children: [g.isTokenExpired && /* @__PURE__ */
|
|
257
|
+
children: [g.isTokenExpired && /* @__PURE__ */ W(i, {
|
|
262
258
|
variant: "outline",
|
|
263
259
|
size: "sm",
|
|
264
|
-
leftIcon:
|
|
260
|
+
leftIcon: U.icon,
|
|
265
261
|
onClick: l,
|
|
266
|
-
children: "Reconnect"
|
|
267
|
-
}), /* @__PURE__ */
|
|
262
|
+
children: d("botlit.botChannels.reconnect", "Reconnect")
|
|
263
|
+
}), /* @__PURE__ */ W(i, {
|
|
268
264
|
variant: "destructive",
|
|
269
265
|
size: "sm",
|
|
270
|
-
leftIcon: /* @__PURE__ */
|
|
266
|
+
leftIcon: /* @__PURE__ */ W(ue, { size: 13 }),
|
|
271
267
|
isLoading: T,
|
|
272
268
|
onClick: async () => {
|
|
273
269
|
await w(g.id) && await y();
|
|
274
270
|
},
|
|
275
|
-
children: "Disconnect"
|
|
271
|
+
children: d("botlit.botChannels.disconnect", "Disconnect")
|
|
276
272
|
})]
|
|
277
273
|
})
|
|
278
274
|
]
|
|
279
|
-
}) : /* @__PURE__ */
|
|
275
|
+
}) : /* @__PURE__ */ G("div", {
|
|
280
276
|
className: "space-y-3 py-2",
|
|
281
277
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ G("div", {
|
|
283
279
|
className: "flex items-center gap-2 p-3 rounded-lg bg-bg-surface border border-border-subtle",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ W("div", {
|
|
285
281
|
className: "p-2 rounded-full bg-bg-sunken shrink-0",
|
|
286
|
-
children: /* @__PURE__ */
|
|
282
|
+
children: /* @__PURE__ */ W("span", {
|
|
287
283
|
className: "text-text-secondary",
|
|
288
|
-
children:
|
|
284
|
+
children: U.icon
|
|
289
285
|
})
|
|
290
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ G("div", {
|
|
291
287
|
className: "flex-1 min-w-0",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ W("p", {
|
|
293
289
|
className: "font-medium text-sm",
|
|
294
|
-
children: "No personal account connected"
|
|
295
|
-
}), /* @__PURE__ */
|
|
290
|
+
children: d("botlit.botChannels.noPersonalAccountConnected", "No personal account connected")
|
|
291
|
+
}), /* @__PURE__ */ W("p", {
|
|
296
292
|
className: "text-xs text-text-secondary mt-0.5",
|
|
297
|
-
children:
|
|
298
|
-
"Connect your ",
|
|
299
|
-
W.label,
|
|
300
|
-
" account to receive bot DMs"
|
|
301
|
-
]
|
|
293
|
+
children: d("botlit.botChannels.connectForDirectMessages", "Connect your {{platform}} account to receive bot DMs", { platform: U.label })
|
|
302
294
|
})]
|
|
303
295
|
})]
|
|
304
296
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ G("div", {
|
|
306
298
|
className: "p-3 rounded-lg bg-bg-sunken/50 space-y-2",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ W("p", {
|
|
308
300
|
className: "text-xs font-medium text-text-secondary",
|
|
309
|
-
children: "Connect your account:"
|
|
310
|
-
}), /* @__PURE__ */
|
|
301
|
+
children: d("botlit.botChannels.connectYourAccount", "Connect your account:")
|
|
302
|
+
}), /* @__PURE__ */ G("ol", {
|
|
311
303
|
className: "list-decimal list-inside space-y-1 text-xs text-text-secondary",
|
|
312
304
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
|
|
316
|
-
W.label,
|
|
317
|
-
" account via OAuth"
|
|
318
|
-
] }),
|
|
319
|
-
/* @__PURE__ */ G("li", { children: "Come back, choose the account below and click \"Link account\"" })
|
|
305
|
+
/* @__PURE__ */ W("li", { children: d("botlit.botChannels.clickOpenIntegrationsBelowOpens", "Click \"Open Integrations\" below (opens in new tab)") }),
|
|
306
|
+
/* @__PURE__ */ W("li", { children: d("botlit.botChannels.connectViaOAuth", "Connect your {{platform}} account via OAuth", { platform: U.label }) }),
|
|
307
|
+
/* @__PURE__ */ W("li", { children: d("botlit.botChannels.comeBackChooseTheAccount", "Come back, choose the account below and click \"Link account\"") })
|
|
320
308
|
]
|
|
321
309
|
})]
|
|
322
310
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ W(i, {
|
|
324
312
|
variant: "outline",
|
|
325
313
|
size: "sm",
|
|
326
|
-
leftIcon:
|
|
314
|
+
leftIcon: U.icon,
|
|
327
315
|
onClick: l,
|
|
328
316
|
className: "w-full",
|
|
329
|
-
children: "Open Integrations →"
|
|
317
|
+
children: d("botlit.botChannels.openIntegrations", "Open Integrations →")
|
|
330
318
|
}),
|
|
331
|
-
|
|
319
|
+
J.loading ? /* @__PURE__ */ W("p", {
|
|
332
320
|
role: "status",
|
|
333
321
|
className: "text-xs text-text-secondary",
|
|
334
|
-
children: "Loading your connected accounts…"
|
|
335
|
-
}) :
|
|
322
|
+
children: d("botlit.botChannels.loadingYourConnectedAccounts", "Loading your connected accounts…")
|
|
323
|
+
}) : J.error ? /* @__PURE__ */ G("div", {
|
|
336
324
|
role: "alert",
|
|
337
325
|
className: "flex flex-wrap items-center gap-2 text-xs text-status-error-text",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ W("span", { children: J.error.message }), /* @__PURE__ */ W(i, {
|
|
339
327
|
size: "sm",
|
|
340
328
|
variant: "outline",
|
|
341
|
-
onClick: () => void
|
|
342
|
-
children: "Try again"
|
|
329
|
+
onClick: () => void J.refetch(),
|
|
330
|
+
children: d("botlit.botChannels.tryAgain", "Try again")
|
|
343
331
|
})]
|
|
344
|
-
}) :
|
|
332
|
+
}) : Y.length === 0 ? /* @__PURE__ */ G("div", {
|
|
345
333
|
className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
347
|
-
"No connected ",
|
|
348
|
-
W.label,
|
|
349
|
-
" account yet. Connect one in Integrations, then refresh."
|
|
350
|
-
] }), /* @__PURE__ */ G(i, {
|
|
334
|
+
children: [/* @__PURE__ */ W("span", { children: d("botlit.botChannels.noConnectedAccount", "No connected {{platform}} account yet. Connect one in Integrations, then refresh.", { platform: U.label }) }), /* @__PURE__ */ W(i, {
|
|
351
335
|
size: "sm",
|
|
352
336
|
variant: "outline",
|
|
353
|
-
onClick: () => void
|
|
354
|
-
children: "Refresh"
|
|
337
|
+
onClick: () => void J.refetch(),
|
|
338
|
+
children: d("botlit.botChannels.refresh", "Refresh")
|
|
355
339
|
})]
|
|
356
|
-
}) : /* @__PURE__ */
|
|
340
|
+
}) : /* @__PURE__ */ G("div", {
|
|
357
341
|
className: "flex gap-2",
|
|
358
342
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ W("label", {
|
|
360
344
|
className: "sr-only",
|
|
361
345
|
htmlFor: `link-connection-${e}`,
|
|
362
|
-
children:
|
|
346
|
+
children: d("botlit.botChannels.yourPlatformAccount", "Your {{platform}} account", { platform: U.label })
|
|
363
347
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ W(te, {
|
|
365
349
|
id: `link-connection-${e}`,
|
|
366
350
|
className: "h-9 flex-1 rounded-md border border-border-default bg-bg-surface px-3 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
367
|
-
value:
|
|
368
|
-
onChange: (e) =>
|
|
369
|
-
children:
|
|
351
|
+
value: X,
|
|
352
|
+
onChange: (e) => I(e.target.value),
|
|
353
|
+
children: Y.map((e) => /* @__PURE__ */ W("option", {
|
|
370
354
|
value: e.id,
|
|
371
355
|
children: e.externalAccountName ?? e.externalAccountEmail ?? e.name
|
|
372
356
|
}, e.id))
|
|
373
357
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ W(i, {
|
|
375
359
|
size: "sm",
|
|
376
360
|
onClick: async () => {
|
|
377
|
-
if (!
|
|
361
|
+
if (!X) Q.error(d("botlit.botChannels.chooseAConnectedPlatformAccount", "Choose a connected {{platform}} account first", { platform: U.label }));
|
|
378
362
|
else {
|
|
379
|
-
|
|
363
|
+
B(!0);
|
|
380
364
|
try {
|
|
381
|
-
let e = await E(
|
|
382
|
-
e ? (Q.success(
|
|
365
|
+
let e = await E(X, h);
|
|
366
|
+
e ? (Q.success(d("botlit.botChannels.accountConnectedTheBotCan", "{{account}} connected! The bot can now send you direct messages.", { account: e.externalDisplayName ?? e.externalUsername ?? d("botlit.botChannels.account", "Account") })), await y(), I("")) : Q.error(d("botlit.botChannels.failedToLinkTheAccount", "Failed to link the account. Reconnect it in Integrations and try again."));
|
|
383
367
|
} catch (e) {
|
|
384
|
-
Q.error(e instanceof Error ? e.message : "Failed to link connection");
|
|
368
|
+
Q.error(e instanceof Error ? e.message : d("botlit.botChannels.failedToLinkConnection", "Failed to link connection"));
|
|
385
369
|
} finally {
|
|
386
|
-
|
|
370
|
+
B(!1);
|
|
387
371
|
}
|
|
388
372
|
}
|
|
389
373
|
},
|
|
390
|
-
isLoading:
|
|
391
|
-
disabled: !
|
|
392
|
-
children: "Link account"
|
|
374
|
+
isLoading: z,
|
|
375
|
+
disabled: !X || z,
|
|
376
|
+
children: d("botlit.botChannels.linkAccount", "Link account")
|
|
393
377
|
})
|
|
394
378
|
]
|
|
395
379
|
})
|
|
@@ -397,26 +381,26 @@ var ve = ({ routeId: e, connectorId: t, channelId: n, platform: r, onRemoved: s,
|
|
|
397
381
|
})]
|
|
398
382
|
});
|
|
399
383
|
}, ye = ({ channel: s, routes: l, botId: u, botName: d, onRoutesChanged: f }) => {
|
|
400
|
-
let { basePath:
|
|
401
|
-
let t = pe[
|
|
384
|
+
let p = R(), { basePath: m } = C(), [_] = g(), [b] = h(), [x] = y(), S = v(), [w, T] = H(!1), E = s.platform, O = $(E), k = _e(s.adapterType), j = w, M = B((e) => {
|
|
385
|
+
let t = pe[E];
|
|
402
386
|
if (!t) return;
|
|
403
|
-
let n = window.location.origin + window.location.pathname + window.location.search, r = `${
|
|
387
|
+
let n = window.location.origin + window.location.pathname + window.location.search, r = `${m ? m.replace(/\/(botmanor|botlit)(\/.*)?$/, "/integrations") : "/integrations"}/connections/add?${new URLSearchParams({
|
|
404
388
|
providerKey: t,
|
|
405
389
|
returnTo: n,
|
|
406
390
|
channelId: e
|
|
407
391
|
}).toString()}`;
|
|
408
392
|
D() && /^https?:\/\//.test(r) ? A(r) : window.open(r, "_blank");
|
|
409
|
-
}, [
|
|
410
|
-
|
|
393
|
+
}, [E, m]), N = B(async () => {
|
|
394
|
+
T(!0);
|
|
411
395
|
try {
|
|
412
|
-
let e = await
|
|
413
|
-
create:
|
|
414
|
-
activate: (e) =>
|
|
396
|
+
let e = await S(s.id), t = await I(s, e, {
|
|
397
|
+
create: b,
|
|
398
|
+
activate: (e) => x({
|
|
415
399
|
connectorId: e,
|
|
416
400
|
input: { status: "ACTIVE" }
|
|
417
401
|
})
|
|
418
402
|
});
|
|
419
|
-
await
|
|
403
|
+
await _({
|
|
420
404
|
connectorId: t.id,
|
|
421
405
|
appId: u,
|
|
422
406
|
locationId: "*",
|
|
@@ -424,105 +408,98 @@ var ve = ({ routeId: e, connectorId: t, channelId: n, platform: r, onRemoved: s,
|
|
|
424
408
|
locationName: "All channels & DMs",
|
|
425
409
|
appName: d
|
|
426
410
|
}
|
|
427
|
-
}), await f(),
|
|
411
|
+
}), await f(), M(s.id);
|
|
428
412
|
} catch (e) {
|
|
429
|
-
Q.error(e instanceof Error ? e.message :
|
|
413
|
+
Q.error(e instanceof Error ? e.message : p("botlit.botChannels.failedToConnectPlatform", "Failed to connect {{platform}}", { platform: O.label })), T(!1);
|
|
430
414
|
}
|
|
431
415
|
}, [
|
|
432
416
|
u,
|
|
433
417
|
d,
|
|
434
418
|
s,
|
|
419
|
+
S,
|
|
420
|
+
b,
|
|
435
421
|
x,
|
|
436
422
|
_,
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
return /* @__PURE__ */ K(e, { children: [/* @__PURE__ */ K(n, {
|
|
423
|
+
O.label,
|
|
424
|
+
M,
|
|
425
|
+
f,
|
|
426
|
+
p
|
|
427
|
+
]), P = B(() => {
|
|
428
|
+
M(s.id);
|
|
429
|
+
}, [s.id, M]);
|
|
430
|
+
return /* @__PURE__ */ G(e, { children: [/* @__PURE__ */ G(n, {
|
|
446
431
|
className: "flex flex-row items-center justify-between pb-3",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ G("div", {
|
|
448
433
|
className: "flex items-center gap-2.5",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
450
|
-
className: `p-1.5 rounded-md ${
|
|
451
|
-
children: /* @__PURE__ */
|
|
452
|
-
className:
|
|
453
|
-
children:
|
|
434
|
+
children: [/* @__PURE__ */ W("div", {
|
|
435
|
+
className: `p-1.5 rounded-md ${O.accentBg}`,
|
|
436
|
+
children: /* @__PURE__ */ W("span", {
|
|
437
|
+
className: O.accentText,
|
|
438
|
+
children: O.icon
|
|
454
439
|
})
|
|
455
|
-
}), /* @__PURE__ */
|
|
440
|
+
}), /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(r, {
|
|
456
441
|
className: "text-base",
|
|
457
442
|
children: s.name
|
|
458
|
-
}),
|
|
443
|
+
}), k && /* @__PURE__ */ W("p", {
|
|
459
444
|
className: "text-xs text-text-secondary mt-0.5",
|
|
460
|
-
children:
|
|
445
|
+
children: k
|
|
461
446
|
})] })]
|
|
462
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ G("div", {
|
|
463
448
|
className: "flex items-center gap-1.5",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
465
|
-
className: `px-2 py-0.5 text-xs font-semibold rounded-full ${
|
|
466
|
-
children:
|
|
467
|
-
}), l.some((e) => e.isActive) ? /* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ W("span", {
|
|
450
|
+
className: `px-2 py-0.5 text-xs font-semibold rounded-full ${O.badgeClass}`,
|
|
451
|
+
children: O.label
|
|
452
|
+
}), l.some((e) => e.isActive) ? /* @__PURE__ */ W(c, {
|
|
468
453
|
variant: "outline",
|
|
469
454
|
className: "text-xs text-status-success-text border-status-success-border bg-status-success-bg-subtle",
|
|
470
|
-
children: "Active"
|
|
471
|
-
}) : l.length > 0 && /* @__PURE__ */
|
|
455
|
+
children: p("botlit.botChannels.active", "Active")
|
|
456
|
+
}) : l.length > 0 && /* @__PURE__ */ W(c, {
|
|
472
457
|
variant: "outline",
|
|
473
458
|
className: "text-xs",
|
|
474
|
-
title: "Turn the route on in Channels",
|
|
475
|
-
children: "Off"
|
|
459
|
+
title: p("botlit.botChannels.turnTheRouteOnIn", "Turn the route on in Channels"),
|
|
460
|
+
children: p("botlit.botChannels.off", "Off")
|
|
476
461
|
})]
|
|
477
462
|
})]
|
|
478
|
-
}), /* @__PURE__ */
|
|
463
|
+
}), /* @__PURE__ */ W(t, { children: l.length > 0 ? /* @__PURE__ */ W("div", {
|
|
479
464
|
className: "space-y-3",
|
|
480
|
-
children: l.map((e) => /* @__PURE__ */
|
|
465
|
+
children: l.map((e) => /* @__PURE__ */ W(ve, {
|
|
481
466
|
routeId: e.id,
|
|
482
467
|
connectorId: e.connectorId,
|
|
483
468
|
channelId: s.id,
|
|
484
|
-
platform:
|
|
469
|
+
platform: E,
|
|
485
470
|
onRemoved: f,
|
|
486
|
-
onReconnect:
|
|
471
|
+
onReconnect: P
|
|
487
472
|
}, e.id))
|
|
488
|
-
}) : /* @__PURE__ */
|
|
473
|
+
}) : /* @__PURE__ */ G("div", {
|
|
489
474
|
className: "flex flex-col items-center gap-4 py-8 text-center",
|
|
490
475
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ W("div", {
|
|
492
477
|
className: "p-4 rounded-full bg-bg-sunken",
|
|
493
|
-
children: /* @__PURE__ */
|
|
478
|
+
children: /* @__PURE__ */ W("span", {
|
|
494
479
|
className: "text-text-secondary",
|
|
495
|
-
children:
|
|
480
|
+
children: O.icon
|
|
496
481
|
})
|
|
497
482
|
}),
|
|
498
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
|
|
499
484
|
className: "font-medium text-sm",
|
|
500
|
-
children: "Not connected to this bot"
|
|
501
|
-
}), /* @__PURE__ */
|
|
485
|
+
children: p("botlit.botChannels.notConnectedToThisBot", "Not connected to this bot")
|
|
486
|
+
}), /* @__PURE__ */ W("p", {
|
|
502
487
|
className: "text-xs text-text-secondary mt-1",
|
|
503
|
-
children:
|
|
504
|
-
"Enable ",
|
|
505
|
-
E.label,
|
|
506
|
-
" for this bot. Users will connect their personal accounts separately."
|
|
507
|
-
]
|
|
488
|
+
children: p("botlit.botChannels.enableExplanation", "Enable {{platform}} for this bot. Users will connect their personal accounts separately.", { platform: O.label })
|
|
508
489
|
})] }),
|
|
509
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ W(o, {
|
|
510
491
|
permission: a.CHANNEL_CREATE,
|
|
511
|
-
children: /* @__PURE__ */
|
|
512
|
-
leftIcon:
|
|
513
|
-
onClick:
|
|
514
|
-
isLoading:
|
|
515
|
-
children:
|
|
516
|
-
"Set up ",
|
|
517
|
-
E.label,
|
|
518
|
-
" channel"
|
|
519
|
-
]
|
|
492
|
+
children: /* @__PURE__ */ W(i, {
|
|
493
|
+
leftIcon: O.icon,
|
|
494
|
+
onClick: N,
|
|
495
|
+
isLoading: j,
|
|
496
|
+
children: p("botlit.botChannels.setUpChannel", "Set up {{platform}} channel", { platform: O.label })
|
|
520
497
|
})
|
|
521
498
|
})
|
|
522
499
|
]
|
|
523
500
|
}) })] });
|
|
524
501
|
}, be = ({ connector: s, routes: l, botId: u, botName: d, onRoutesChanged: f }) => {
|
|
525
|
-
let p =
|
|
502
|
+
let p = R(), { navigateTo: m, workspaceId: h } = C(), [v] = g(), [b] = _(), [x] = y(), [O, A] = H(!1), j = $(s.type), M = s.status === "ACTIVE", N = T(s.type) ? s.credentialsRefId : null, { data: P, loading: F, error: ee, refetch: I } = E(N), z = B(async () => {
|
|
526
503
|
A(!0);
|
|
527
504
|
try {
|
|
528
505
|
let e = await v({
|
|
@@ -542,9 +519,12 @@ var ve = ({ routeId: e, connectorId: t, channelId: n, platform: r, onRemoved: s,
|
|
|
542
519
|
} catch (t) {
|
|
543
520
|
throw await b(e.id).catch(() => void 0), await f(), t;
|
|
544
521
|
}
|
|
545
|
-
await f(), N && await
|
|
522
|
+
await f(), N && await I(), Q.success(p("botlit.botChannels.channelNowAnswersWithBot", "{{channel}} now answers with {{bot}}", {
|
|
523
|
+
channel: s.name,
|
|
524
|
+
bot: d
|
|
525
|
+
})), D() && k("success");
|
|
546
526
|
} catch (e) {
|
|
547
|
-
Q.error(e instanceof Error ? e.message :
|
|
527
|
+
Q.error(e instanceof Error ? e.message : p("botlit.botChannels.failedToRouteChannel", "Failed to route {{channel}}", { channel: s.name })), D() && k("error");
|
|
548
528
|
} finally {
|
|
549
529
|
A(!1);
|
|
550
530
|
}
|
|
@@ -558,18 +538,19 @@ var ve = ({ routeId: e, connectorId: t, channelId: n, platform: r, onRemoved: s,
|
|
|
558
538
|
b,
|
|
559
539
|
N,
|
|
560
540
|
f,
|
|
561
|
-
|
|
541
|
+
I,
|
|
542
|
+
p,
|
|
562
543
|
x
|
|
563
|
-
]),
|
|
564
|
-
if (await
|
|
565
|
-
title:
|
|
544
|
+
]), V = B(async (e) => {
|
|
545
|
+
if (await L({
|
|
546
|
+
title: p("botlit.botChannels.removeChannelFromThisBot", "Remove {{channel}} from this bot?", { channel: s.name }),
|
|
566
547
|
confirmLabel: p("botlit.channels.actions.remove", "Remove"),
|
|
567
548
|
cancelLabel: p("botlit.common.cancel", "Cancel"),
|
|
568
549
|
tone: "danger"
|
|
569
550
|
})) try {
|
|
570
|
-
await b(e), await f(), Q.success(
|
|
551
|
+
await b(e), await f(), Q.success(p("botlit.botChannels.channelRemovedFromTheBot", "{{channel}} removed from the bot", { channel: s.name })), D() && k("success");
|
|
571
552
|
} catch (e) {
|
|
572
|
-
Q.error(e instanceof Error ? e.message : "Failed to remove"), D() && k("error");
|
|
553
|
+
Q.error(e instanceof Error ? e.message : p("botlit.botChannels.failedToRemove", "Failed to remove")), D() && k("error");
|
|
573
554
|
}
|
|
574
555
|
}, [
|
|
575
556
|
s.name,
|
|
@@ -577,259 +558,277 @@ var ve = ({ routeId: e, connectorId: t, channelId: n, platform: r, onRemoved: s,
|
|
|
577
558
|
f,
|
|
578
559
|
p
|
|
579
560
|
]);
|
|
580
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ G(e, { children: [/* @__PURE__ */ G(n, {
|
|
581
562
|
className: "flex flex-row items-center justify-between pb-3",
|
|
582
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ G("div", {
|
|
583
564
|
className: "flex items-center gap-2.5",
|
|
584
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ W("div", {
|
|
585
566
|
className: `p-1.5 rounded-md ${j.accentBg}`,
|
|
586
|
-
children: /* @__PURE__ */
|
|
567
|
+
children: /* @__PURE__ */ W("span", {
|
|
587
568
|
className: j.accentText,
|
|
588
569
|
children: j.icon
|
|
589
570
|
})
|
|
590
|
-
}), /* @__PURE__ */
|
|
571
|
+
}), /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(r, {
|
|
591
572
|
className: "text-base",
|
|
592
573
|
children: s.name
|
|
593
|
-
}), s.description && /* @__PURE__ */
|
|
574
|
+
}), s.description && /* @__PURE__ */ W("p", {
|
|
594
575
|
className: "text-xs text-text-secondary mt-0.5",
|
|
595
576
|
children: s.description
|
|
596
577
|
})] })]
|
|
597
|
-
}), /* @__PURE__ */
|
|
578
|
+
}), /* @__PURE__ */ G("div", {
|
|
598
579
|
className: "flex items-center gap-1.5",
|
|
599
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ W("span", {
|
|
600
581
|
className: `px-2 py-0.5 text-xs font-semibold rounded-full ${j.badgeClass}`,
|
|
601
582
|
children: j.label
|
|
602
|
-
}), /* @__PURE__ */
|
|
583
|
+
}), /* @__PURE__ */ W(c, {
|
|
603
584
|
variant: "outline",
|
|
604
585
|
className: "text-xs",
|
|
605
|
-
children: M ? "Active" : "Draft"
|
|
586
|
+
children: M ? p("botlit.botChannels.active", "Active") : p("botlit.botChannels.draft", "Draft")
|
|
606
587
|
})]
|
|
607
588
|
})]
|
|
608
|
-
}), /* @__PURE__ */
|
|
589
|
+
}), /* @__PURE__ */ G(t, {
|
|
609
590
|
className: "space-y-4",
|
|
610
591
|
children: [
|
|
611
|
-
l.length > 0 ? /* @__PURE__ */
|
|
592
|
+
l.length > 0 ? /* @__PURE__ */ W("div", {
|
|
612
593
|
className: "space-y-2",
|
|
613
|
-
children: l.map((e) => /* @__PURE__ */
|
|
594
|
+
children: l.map((e) => /* @__PURE__ */ G("div", {
|
|
614
595
|
className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-sunken/30 px-3 py-2",
|
|
615
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ G("span", {
|
|
616
597
|
className: "text-sm",
|
|
617
598
|
children: [
|
|
618
|
-
e.isActive ? "Answers" : "Turned off for",
|
|
599
|
+
e.isActive ? p("botlit.botChannels.answers", "Answers") : p("botlit.botChannels.turnedOffFor", "Turned off for"),
|
|
619
600
|
" ",
|
|
620
|
-
e.locationId === "*" ? "every location" : /* @__PURE__ */
|
|
621
|
-
!e.isActive && /* @__PURE__ */
|
|
601
|
+
e.locationId === "*" ? p("botlit.botChannels.everyLocation", "every location") : /* @__PURE__ */ W("code", { children: e.locationId }),
|
|
602
|
+
!e.isActive && /* @__PURE__ */ W("span", {
|
|
622
603
|
className: "ml-2 text-xs text-text-secondary",
|
|
623
|
-
children: "(turn it on in Channels to answer here)"
|
|
604
|
+
children: p("botlit.botChannels.turnItOnInChannels", "(turn it on in Channels to answer here)")
|
|
624
605
|
})
|
|
625
606
|
]
|
|
626
|
-
}), /* @__PURE__ */
|
|
607
|
+
}), /* @__PURE__ */ W(o, {
|
|
627
608
|
permission: a.CHANNEL_DELETE,
|
|
628
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ W(i, {
|
|
629
610
|
variant: "ghost",
|
|
630
611
|
size: "icon",
|
|
631
|
-
onClick: () => void
|
|
612
|
+
onClick: () => void V(e.id),
|
|
632
613
|
className: "h-7 w-7 text-text-secondary hover:text-status-error-text",
|
|
633
|
-
title: "Remove channel",
|
|
634
|
-
"aria-label":
|
|
635
|
-
children: /* @__PURE__ */
|
|
614
|
+
title: p("botlit.botChannels.removeChannel", "Remove channel"),
|
|
615
|
+
"aria-label": p("botlit.botChannels.removeChannelFromTheBot", "Remove {{channel}} from the bot", { channel: s.name }),
|
|
616
|
+
children: /* @__PURE__ */ W(le, { size: 14 })
|
|
636
617
|
})
|
|
637
618
|
})]
|
|
638
619
|
}, e.id))
|
|
639
|
-
}) : /* @__PURE__ */
|
|
620
|
+
}) : /* @__PURE__ */ G("div", {
|
|
640
621
|
className: "flex flex-col items-center gap-3 py-6 text-center",
|
|
641
|
-
children: [/* @__PURE__ */
|
|
622
|
+
children: [/* @__PURE__ */ W("p", {
|
|
642
623
|
className: "text-sm text-text-secondary",
|
|
643
|
-
children: M ?
|
|
644
|
-
}), /* @__PURE__ */
|
|
624
|
+
children: M ? p("botlit.botChannels.routeEveryMessageOfThis", "Route every message of this channel to {{bot}}.", { bot: d }) : p("botlit.botChannels.activateThisConnectorAndRoute", "Activate this connector and route every message of it to {{bot}}.", { bot: d })
|
|
625
|
+
}), /* @__PURE__ */ W(o, {
|
|
645
626
|
permission: a.CHANNEL_CREATE,
|
|
646
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ W(o, {
|
|
647
628
|
permission: M ? a.CHANNEL_CREATE : a.CHANNEL_UPDATE,
|
|
648
|
-
children: /* @__PURE__ */
|
|
629
|
+
children: /* @__PURE__ */ W(i, {
|
|
649
630
|
leftIcon: j.icon,
|
|
650
|
-
onClick: () => void
|
|
631
|
+
onClick: () => void z(),
|
|
651
632
|
isLoading: O,
|
|
652
|
-
children: "Route to this bot"
|
|
633
|
+
children: p("botlit.botChannels.routeToThisBot", "Route to this bot")
|
|
653
634
|
})
|
|
654
635
|
})
|
|
655
636
|
})]
|
|
656
637
|
}),
|
|
657
|
-
N && l.length > 0 && /* @__PURE__ */
|
|
638
|
+
N && l.length > 0 && /* @__PURE__ */ W(S, {
|
|
658
639
|
channel: P,
|
|
659
640
|
loading: F,
|
|
660
|
-
error:
|
|
641
|
+
error: ee,
|
|
661
642
|
connectorActive: M,
|
|
662
643
|
workspaceId: h,
|
|
663
644
|
hint: w[s.type]?.inboundHint,
|
|
664
645
|
usesInboundUrl: w[s.type]?.usesInboundUrl ?? !0,
|
|
665
|
-
onRefresh: () => void
|
|
646
|
+
onRefresh: () => void I()
|
|
666
647
|
}),
|
|
667
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ W(i, {
|
|
668
649
|
variant: "ghost",
|
|
669
650
|
size: "sm",
|
|
670
|
-
leftIcon: /* @__PURE__ */
|
|
651
|
+
leftIcon: /* @__PURE__ */ W(J, { size: 14 }),
|
|
671
652
|
onClick: () => m(`channels/${s.id}`),
|
|
672
|
-
children: "Open connector"
|
|
653
|
+
children: p("botlit.botChannels.openConnector", "Open connector")
|
|
673
654
|
})
|
|
674
655
|
]
|
|
675
656
|
})] });
|
|
676
657
|
}, xe = ({ route: e, oauthChannels: t, botId: n, botName: r, onRoutesChanged: i }) => {
|
|
677
658
|
let { data: a } = m(e.connectorId), o = t.find((e) => e.id === a?.credentialsRefId);
|
|
678
|
-
return a ? !o || !me.has(o.platform) ? /* @__PURE__ */
|
|
659
|
+
return a ? !o || !me.has(o.platform) ? /* @__PURE__ */ W(be, {
|
|
679
660
|
connector: a,
|
|
680
661
|
routes: [e],
|
|
681
662
|
botId: n,
|
|
682
663
|
botName: r,
|
|
683
664
|
onRoutesChanged: i
|
|
684
|
-
}) : /* @__PURE__ */
|
|
665
|
+
}) : /* @__PURE__ */ W(ye, {
|
|
685
666
|
channel: o,
|
|
686
667
|
routes: [e],
|
|
687
668
|
botId: n,
|
|
688
669
|
botName: r,
|
|
689
670
|
onRoutesChanged: i
|
|
690
671
|
}) : null;
|
|
691
|
-
}, Se = ({
|
|
692
|
-
let
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
672
|
+
}, Se = ({ channels: e, routes: t, connectors: n }) => {
|
|
673
|
+
let r = R(), a = [
|
|
674
|
+
{
|
|
675
|
+
id: "channels",
|
|
676
|
+
label: r("botlit.botChannels.failedToLoadChannels", "Failed to load channels:"),
|
|
677
|
+
...e
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
id: "routes",
|
|
681
|
+
label: r("botlit.botChannels.failedToLoadThisBot", "Failed to load this bot's channel routes:"),
|
|
682
|
+
...t
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
id: "connectors",
|
|
686
|
+
label: r("botlit.botChannels.failedToLoadChannelConnectors", "Failed to load channel connectors:"),
|
|
687
|
+
...n
|
|
688
|
+
}
|
|
689
|
+
];
|
|
690
|
+
return /* @__PURE__ */ W(U, { children: a.map(({ id: e, label: t, error: n, retry: a }) => n ? /* @__PURE__ */ G("div", {
|
|
691
|
+
className: "flex items-center justify-between gap-2 rounded-lg border border-status-error-border/40 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
692
|
+
children: [/* @__PURE__ */ G("span", { children: [
|
|
693
|
+
t,
|
|
694
|
+
" ",
|
|
695
|
+
n.message
|
|
696
|
+
] }), /* @__PURE__ */ W(i, {
|
|
697
|
+
variant: "ghost",
|
|
698
|
+
size: "sm",
|
|
699
|
+
onClick: () => void a(),
|
|
700
|
+
children: r("botlit.botChannels.retry", "Retry")
|
|
701
|
+
})]
|
|
702
|
+
}, e) : null) });
|
|
703
|
+
}, Ce = ({ botId: n, botName: r }) => {
|
|
704
|
+
let c = R(), { organizationId: u } = C(), m = V(() => ({
|
|
705
|
+
channelType: z.Communication,
|
|
706
|
+
organizationId: u || void 0
|
|
707
|
+
}), [u]), { data: h, loading: g, error: _, refetch: v } = M(m), { data: y, loading: b, error: x, refetch: S } = p(n), [w, T] = H(!1), [E, D] = H(null), { data: O, loading: k, error: A, refetch: j } = f(), N = B(async () => {
|
|
708
|
+
await Promise.all([S(), j()]);
|
|
709
|
+
}, [S, j]), P = h.filter((e) => me.has(e.platform)), F = P.filter((e) => e.status === "ACTIVE" && (!u || e.organizationId === u)), ee = new Set(y.map((e) => O.find((t) => t.id === e.connectorId)).map((e) => e?.credentialsRefId).filter((e) => !!e)), I = !g && !b && !k && !_ && !x && !A, L = F.filter((e) => I && !ee.has(e.id)), te = new Set(P.map((e) => e.id)), ne = new Set(y.map((e) => e.connectorId)), re = s(a.CHANNEL_UPDATE), K = O.filter((e) => I && he.has(e.status) && (e.status === "ACTIVE" || re) && !ne.has(e.id) && !(e.credentialsRefId && te.has(e.credentialsRefId))), q = [...K.map((e) => ({
|
|
698
710
|
id: `${ge}${e.id}`,
|
|
699
711
|
name: e.name,
|
|
700
712
|
platform: e.type,
|
|
701
713
|
description: e.description ?? void 0
|
|
702
|
-
})), ...L],
|
|
714
|
+
})), ...L], J = {}, Y = {};
|
|
703
715
|
q.forEach((e) => {
|
|
704
716
|
let t = e.platform, n = $(t);
|
|
705
|
-
|
|
717
|
+
Y[t] = n, J[t] = n.icon;
|
|
706
718
|
});
|
|
707
|
-
let
|
|
708
|
-
|
|
709
|
-
}, []), X =
|
|
710
|
-
if (
|
|
719
|
+
let ie = B((e, t) => {
|
|
720
|
+
D(e);
|
|
721
|
+
}, []), X = E?.startsWith(ge) ? O.find((e) => `${ge}${e.id}` === E) : void 0, ae = P.length > 0 || K.length > 0;
|
|
722
|
+
if (g && h.length === 0 || b && y.length === 0 || k && O.length === 0) return /* @__PURE__ */ G("div", {
|
|
711
723
|
className: "space-y-4",
|
|
712
724
|
children: [
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ W("div", { className: "h-10 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg w-52" }),
|
|
726
|
+
/* @__PURE__ */ W("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }),
|
|
727
|
+
/* @__PURE__ */ W("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
|
|
716
728
|
]
|
|
717
729
|
});
|
|
718
|
-
let Z =
|
|
719
|
-
return /* @__PURE__ */
|
|
730
|
+
let Z = y.length > 0;
|
|
731
|
+
return /* @__PURE__ */ G("div", {
|
|
720
732
|
className: "space-y-4",
|
|
721
733
|
children: [
|
|
722
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ G("div", {
|
|
723
735
|
className: "flex items-start justify-between gap-3",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
736
|
+
children: [/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h3", {
|
|
725
737
|
className: "font-semibold text-base",
|
|
726
|
-
children: "Channel Connections"
|
|
727
|
-
}), /* @__PURE__ */
|
|
738
|
+
children: c("botlit.botChannels.channelConnections", "Channel Connections")
|
|
739
|
+
}), /* @__PURE__ */ W("p", {
|
|
728
740
|
className: "text-sm text-text-secondary mt-0.5",
|
|
729
|
-
children: "Communication platforms available for this bot"
|
|
730
|
-
})] }), Z && q.length > 0 && /* @__PURE__ */
|
|
741
|
+
children: c("botlit.botChannels.communicationPlatformsAvailableForThis", "Communication platforms available for this bot")
|
|
742
|
+
})] }), Z && q.length > 0 && /* @__PURE__ */ W(o, {
|
|
731
743
|
permission: a.CHANNEL_CREATE,
|
|
732
|
-
children: /* @__PURE__ */
|
|
744
|
+
children: /* @__PURE__ */ W(i, {
|
|
733
745
|
variant: "outline",
|
|
734
746
|
size: "sm",
|
|
735
|
-
leftIcon: /* @__PURE__ */
|
|
736
|
-
onClick: () =>
|
|
737
|
-
children: "Connect Channel"
|
|
747
|
+
leftIcon: /* @__PURE__ */ W(oe, { size: 14 }),
|
|
748
|
+
onClick: () => T(!0),
|
|
749
|
+
children: c("botlit.botChannels.connectChannel", "Connect Channel")
|
|
738
750
|
})
|
|
739
751
|
})]
|
|
740
752
|
}),
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
size: "sm",
|
|
755
|
-
onClick: () => void x(),
|
|
756
|
-
children: "Retry"
|
|
757
|
-
})]
|
|
758
|
-
}),
|
|
759
|
-
k && /* @__PURE__ */ K("div", {
|
|
760
|
-
className: "flex items-center justify-between gap-2 rounded-lg border border-status-error-border/40 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
761
|
-
children: [/* @__PURE__ */ K("span", { children: ["Failed to load channel connectors: ", k.message] }), /* @__PURE__ */ G(i, {
|
|
762
|
-
variant: "ghost",
|
|
763
|
-
size: "sm",
|
|
764
|
-
onClick: () => void A(),
|
|
765
|
-
children: "Retry"
|
|
766
|
-
})]
|
|
753
|
+
/* @__PURE__ */ W(Se, {
|
|
754
|
+
channels: {
|
|
755
|
+
error: _,
|
|
756
|
+
retry: v
|
|
757
|
+
},
|
|
758
|
+
routes: {
|
|
759
|
+
error: x,
|
|
760
|
+
retry: S
|
|
761
|
+
},
|
|
762
|
+
connectors: {
|
|
763
|
+
error: A,
|
|
764
|
+
retry: j
|
|
765
|
+
}
|
|
767
766
|
}),
|
|
768
|
-
I && !
|
|
767
|
+
I && !ae && !Z && /* @__PURE__ */ W(e, { children: /* @__PURE__ */ W(t, {
|
|
769
768
|
className: "py-12",
|
|
770
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ W(l, {
|
|
771
770
|
illustration: "empty-notifications",
|
|
772
|
-
title: "No channels available",
|
|
773
|
-
description: "No channel connectors exist in this workspace yet. Create one under Channels, then route it to this bot here."
|
|
771
|
+
title: c("botlit.botChannels.noChannelsAvailable", "No channels available"),
|
|
772
|
+
description: c("botlit.botChannels.noChannelConnectorsExistIn", "No channel connectors exist in this workspace yet. Create one under Channels, then route it to this bot here.")
|
|
774
773
|
})
|
|
775
774
|
}) }),
|
|
776
|
-
I &&
|
|
775
|
+
I && ae && !Z && !E && /* @__PURE__ */ W(e, { children: /* @__PURE__ */ W(t, {
|
|
777
776
|
className: "py-12",
|
|
778
|
-
children: /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ W(l, {
|
|
779
778
|
illustration: "empty-notifications",
|
|
780
|
-
title: "No channels connected",
|
|
781
|
-
description: "Connect a channel — Slack, Teams, Discord, WhatsApp, a web widget or a webhook — to let people talk to this bot there.",
|
|
782
|
-
action: /* @__PURE__ */
|
|
779
|
+
title: c("botlit.botChannels.noChannelsConnected", "No channels connected"),
|
|
780
|
+
description: c("botlit.botChannels.connectAChannelSlackTeams", "Connect a channel — Slack, Teams, Discord, WhatsApp, a web widget or a webhook — to let people talk to this bot there."),
|
|
781
|
+
action: /* @__PURE__ */ W(o, {
|
|
783
782
|
permission: a.CHANNEL_CREATE,
|
|
784
|
-
children: /* @__PURE__ */
|
|
785
|
-
leftIcon: /* @__PURE__ */
|
|
786
|
-
onClick: () =>
|
|
787
|
-
children: "Connect Channel"
|
|
783
|
+
children: /* @__PURE__ */ W(i, {
|
|
784
|
+
leftIcon: /* @__PURE__ */ W(oe, { size: 16 }),
|
|
785
|
+
onClick: () => T(!0),
|
|
786
|
+
children: c("botlit.botChannels.connectChannel", "Connect Channel")
|
|
788
787
|
})
|
|
789
788
|
})
|
|
790
789
|
})
|
|
791
790
|
}) }),
|
|
792
|
-
(Z ||
|
|
791
|
+
(Z || E) && /* @__PURE__ */ G("div", {
|
|
793
792
|
className: "space-y-4",
|
|
794
793
|
children: [
|
|
795
|
-
|
|
794
|
+
y.map((e) => /* @__PURE__ */ W(xe, {
|
|
796
795
|
route: e,
|
|
797
|
-
oauthChannels:
|
|
796
|
+
oauthChannels: P,
|
|
798
797
|
botId: n,
|
|
799
798
|
botName: r,
|
|
800
|
-
onRoutesChanged:
|
|
799
|
+
onRoutesChanged: N
|
|
801
800
|
}, e.id)),
|
|
802
|
-
X && /* @__PURE__ */
|
|
801
|
+
X && /* @__PURE__ */ W(be, {
|
|
803
802
|
connector: X,
|
|
804
803
|
routes: [],
|
|
805
804
|
botId: n,
|
|
806
805
|
botName: r,
|
|
807
806
|
onRoutesChanged: async () => {
|
|
808
|
-
await
|
|
807
|
+
await N(), D(null);
|
|
809
808
|
}
|
|
810
809
|
}, X.id),
|
|
811
|
-
|
|
810
|
+
E && !X && /* @__PURE__ */ W(U, { children: P.filter((e) => e.id === E).map((e) => /* @__PURE__ */ W(ye, {
|
|
812
811
|
channel: e,
|
|
813
|
-
routes:
|
|
812
|
+
routes: y.filter((e) => !1),
|
|
814
813
|
botId: n,
|
|
815
814
|
botName: r,
|
|
816
815
|
onRoutesChanged: async () => {
|
|
817
|
-
await
|
|
816
|
+
await N(), D(null);
|
|
818
817
|
}
|
|
819
818
|
}, e.id)) })
|
|
820
819
|
]
|
|
821
820
|
}),
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
open:
|
|
824
|
-
onClose: () =>
|
|
825
|
-
onSelectChannel:
|
|
821
|
+
/* @__PURE__ */ W(d, {
|
|
822
|
+
open: w,
|
|
823
|
+
onClose: () => T(!1),
|
|
824
|
+
onSelectChannel: ie,
|
|
826
825
|
availableChannels: q,
|
|
827
|
-
platformIcons:
|
|
828
|
-
platformMeta:
|
|
826
|
+
platformIcons: J,
|
|
827
|
+
platformMeta: Y
|
|
829
828
|
})
|
|
830
829
|
]
|
|
831
830
|
});
|
|
832
831
|
};
|
|
833
|
-
export {
|
|
832
|
+
export { Ce as BotChannelsTab };
|
|
834
833
|
|
|
835
834
|
//# sourceMappingURL=BotChannelsTab.js.map
|