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