@burdenoff/microfe-botmanor 2026.1124.1 → 2026.1127.2

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