@wealthx/shadcn 1.5.28 → 1.5.29
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/.turbo/turbo-build.log +104 -104
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-CE2WONIY.mjs → chunk-AE4JKISB.mjs} +27 -31
- package/dist/chunk-BZWQU52U.mjs +1025 -0
- package/dist/components/ui/ai-builder/index.js +993 -12
- package/dist/components/ui/ai-builder/index.mjs +27 -3
- package/dist/components/ui/ai-conversations/index.js +27 -31
- package/dist/components/ui/ai-conversations/index.mjs +1 -1
- package/dist/index.js +4976 -4972
- package/dist/index.mjs +2 -2
- package/dist/styles.css +1 -1
- package/package.json +4 -1
- package/src/components/index.tsx +0 -2
- package/src/components/ui/ai-builder/agent-card.tsx +7 -5
- package/src/components/ui/ai-builder/agent-settings.tsx +709 -0
- package/src/components/ui/ai-builder/index.tsx +27 -2
- package/src/components/ui/ai-builder/service-config-modal.tsx +11 -11
- package/src/components/ui/ai-builder/types.ts +27 -15
- package/src/components/ui/ai-conversations/thread.tsx +9 -11
- package/src/styles/styles-css.ts +1 -1
- package/dist/chunk-T5PGVLMR.mjs +0 -479
|
@@ -79,11 +79,19 @@ var __async = (__this, __arguments, generator) => {
|
|
|
79
79
|
// src/components/ui/ai-builder/index.tsx
|
|
80
80
|
var ai_builder_exports = {};
|
|
81
81
|
__export(ai_builder_exports, {
|
|
82
|
+
AddEditRuleModal: () => AddEditRuleModal,
|
|
82
83
|
AgentCard: () => AgentCard,
|
|
84
|
+
AgentConfigForm: () => AgentConfigForm,
|
|
83
85
|
AgentMenuModal: () => AgentMenuModal,
|
|
84
86
|
IntegrationInstructionCard: () => IntegrationInstructionCard,
|
|
85
87
|
IntegrationServiceCard: () => IntegrationServiceCard,
|
|
86
|
-
|
|
88
|
+
ResponseTemplateEditModal: () => ResponseTemplateEditModal,
|
|
89
|
+
RuleOrderBadge: () => RuleOrderBadge,
|
|
90
|
+
RuleSetSection: () => RuleSetSection,
|
|
91
|
+
SectionHeader: () => SectionHeader,
|
|
92
|
+
ServiceConfigurationModal: () => ServiceConfigurationModal,
|
|
93
|
+
SettingCard: () => SettingCard,
|
|
94
|
+
SettingRow: () => SettingRow
|
|
87
95
|
});
|
|
88
96
|
module.exports = __toCommonJS(ai_builder_exports);
|
|
89
97
|
|
|
@@ -608,7 +616,7 @@ function AgentCard({
|
|
|
608
616
|
)
|
|
609
617
|
}
|
|
610
618
|
),
|
|
611
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "truncate text-
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "truncate text-label-medium leading-tight", children: title }),
|
|
612
620
|
isComingSoon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { variant: "outline", className: "shrink-0 text-xs", children: "Coming Soon" })
|
|
613
621
|
] }),
|
|
614
622
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
@@ -634,9 +642,9 @@ function AgentCard({
|
|
|
634
642
|
)
|
|
635
643
|
] })
|
|
636
644
|
] }),
|
|
637
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-
|
|
645
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-body-small text-muted-foreground flex-1", children: description }),
|
|
638
646
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
639
|
-
infoBadge && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "bg-info/10 text-info px-2 py-1 text-
|
|
647
|
+
infoBadge && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "bg-info/10 text-info px-2 py-1 text-caption", children: infoBadge }),
|
|
640
648
|
tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex flex-wrap gap-1", children: tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { variant: "secondary", className: "text-xs", children: tag }, tag)) })
|
|
641
649
|
] })
|
|
642
650
|
]
|
|
@@ -665,8 +673,8 @@ function AgentMenuModal({
|
|
|
665
673
|
}
|
|
666
674
|
),
|
|
667
675
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
|
|
668
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-
|
|
669
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-
|
|
676
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-label-medium", children: feature.title }),
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-body-small text-muted-foreground", children: feature.description })
|
|
670
678
|
] })
|
|
671
679
|
] }, feature.title)) })
|
|
672
680
|
] }) });
|
|
@@ -880,12 +888,12 @@ function ServiceConfigurationModal({
|
|
|
880
888
|
onDisconnect,
|
|
881
889
|
onReconnect
|
|
882
890
|
}) {
|
|
883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogContent, { className: "max-w-md", children: isConnected ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogContent, { className: "flex max-h-[90vh] flex-col max-w-md", children: isConnected ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
884
892
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogHeader, { children: [
|
|
885
893
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogTitle, { children: serviceTitle }),
|
|
886
894
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogDescription, { children: "Manage your integration settings." })
|
|
887
895
|
] }),
|
|
888
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-4 py-2", children: [
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto py-2", children: [
|
|
889
897
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2 px-3 py-2 text-xs font-medium bg-success/10 text-success", children: [
|
|
890
898
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.CheckCircle2, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
891
899
|
"Active \u2014 integration is running"
|
|
@@ -950,11 +958,11 @@ function ServiceConfigurationModal({
|
|
|
950
958
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-overline text-muted-foreground", children: "Email Filters" }),
|
|
951
959
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-muted-foreground text-sm mt-0.5", children: "Choose which inbox categories to sync into WealthX." })
|
|
952
960
|
] }),
|
|
953
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Card, { className: "py-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CardContent, { className: "flex flex-col gap-3 p-3
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Card, { className: "py-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CardContent, { className: "flex flex-col gap-3 p-3", children: serviceData.emailCategories.available.map(
|
|
954
962
|
(category) => {
|
|
955
|
-
const checked = serviceData.emailCategories.selected.
|
|
963
|
+
const checked = serviceData.emailCategories.selected.includes(
|
|
956
964
|
category
|
|
957
|
-
)
|
|
965
|
+
);
|
|
958
966
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
959
967
|
"div",
|
|
960
968
|
{
|
|
@@ -1087,11 +1095,984 @@ function ServiceConfigurationModal({
|
|
|
1087
1095
|
] })
|
|
1088
1096
|
] }) }) });
|
|
1089
1097
|
}
|
|
1098
|
+
|
|
1099
|
+
// src/components/ui/ai-builder/agent-settings.tsx
|
|
1100
|
+
var import_react6 = __toESM(require("react"));
|
|
1101
|
+
var import_core = require("@dnd-kit/core");
|
|
1102
|
+
var import_sortable = require("@dnd-kit/sortable");
|
|
1103
|
+
var import_utilities = require("@dnd-kit/utilities");
|
|
1104
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1105
|
+
|
|
1106
|
+
// src/components/ui/input.tsx
|
|
1107
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1108
|
+
function Input(_a) {
|
|
1109
|
+
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
1110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1111
|
+
"input",
|
|
1112
|
+
__spreadValues({
|
|
1113
|
+
className: cn(
|
|
1114
|
+
"h-9 w-full min-w-0 border border-input bg-transparent px-3 py-1 text-body-medium font-sans shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-label-medium file:text-foreground placeholder:font-normal placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
|
|
1115
|
+
"focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20",
|
|
1116
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
1117
|
+
className
|
|
1118
|
+
),
|
|
1119
|
+
"data-slot": "input",
|
|
1120
|
+
type
|
|
1121
|
+
}, props)
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// src/components/ui/label.tsx
|
|
1126
|
+
var import_jsx_runtime13 = (
|
|
1127
|
+
// eslint-disable-next-line jsx-a11y/label-has-associated-control -- htmlFor is passed by the consumer
|
|
1128
|
+
require("react/jsx-runtime")
|
|
1129
|
+
);
|
|
1130
|
+
function Label(_a) {
|
|
1131
|
+
var _b = _a, {
|
|
1132
|
+
className,
|
|
1133
|
+
required,
|
|
1134
|
+
children
|
|
1135
|
+
} = _b, props = __objRest(_b, [
|
|
1136
|
+
"className",
|
|
1137
|
+
"required",
|
|
1138
|
+
"children"
|
|
1139
|
+
]);
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1141
|
+
"label",
|
|
1142
|
+
__spreadProps(__spreadValues({
|
|
1143
|
+
className: cn(
|
|
1144
|
+
"flex items-center gap-2 text-label-medium leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
1145
|
+
className
|
|
1146
|
+
),
|
|
1147
|
+
"data-slot": "label"
|
|
1148
|
+
}, props), {
|
|
1149
|
+
children: [
|
|
1150
|
+
children,
|
|
1151
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": "true", className: "text-destructive", children: "*" })
|
|
1152
|
+
]
|
|
1153
|
+
})
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
// src/components/ui/select.tsx
|
|
1158
|
+
var React4 = __toESM(require("react"));
|
|
1159
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1160
|
+
var import_select = require("@base-ui/react/select");
|
|
1161
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1162
|
+
var SelectPortalContext = React4.createContext(
|
|
1163
|
+
void 0
|
|
1164
|
+
);
|
|
1165
|
+
function Select(_a) {
|
|
1166
|
+
var props = __objRest(_a, []);
|
|
1167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_select.Select.Root, __spreadValues({ "data-slot": "select" }, props));
|
|
1168
|
+
}
|
|
1169
|
+
function SelectValue(_a) {
|
|
1170
|
+
var props = __objRest(_a, []);
|
|
1171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_select.Select.Value, __spreadValues({ "data-slot": "select-value" }, props));
|
|
1172
|
+
}
|
|
1173
|
+
function SelectTrigger(_a) {
|
|
1174
|
+
var _b = _a, {
|
|
1175
|
+
className,
|
|
1176
|
+
size = "default",
|
|
1177
|
+
children
|
|
1178
|
+
} = _b, props = __objRest(_b, [
|
|
1179
|
+
"className",
|
|
1180
|
+
"size",
|
|
1181
|
+
"children"
|
|
1182
|
+
]);
|
|
1183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1184
|
+
import_select.Select.Trigger,
|
|
1185
|
+
__spreadProps(__spreadValues({
|
|
1186
|
+
className: cn(
|
|
1187
|
+
"flex w-fit items-center justify-between gap-2 border border-input bg-transparent px-3 py-2 text-body-medium whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 data-popup-open:border-primary data-popup-open:ring-[3px] data-popup-open:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:font-normal data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
1188
|
+
className
|
|
1189
|
+
),
|
|
1190
|
+
"data-size": size,
|
|
1191
|
+
"data-slot": "select-trigger"
|
|
1192
|
+
}, props), {
|
|
1193
|
+
children: [
|
|
1194
|
+
children,
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_select.Select.Icon, { className: "transition-transform duration-200 data-popup-open:rotate-180", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
1196
|
+
]
|
|
1197
|
+
})
|
|
1198
|
+
);
|
|
1199
|
+
}
|
|
1200
|
+
function SelectContent(_a) {
|
|
1201
|
+
var _b = _a, {
|
|
1202
|
+
className,
|
|
1203
|
+
children,
|
|
1204
|
+
style
|
|
1205
|
+
} = _b, props = __objRest(_b, [
|
|
1206
|
+
"className",
|
|
1207
|
+
"children",
|
|
1208
|
+
"style"
|
|
1209
|
+
]);
|
|
1210
|
+
const themeVars = useThemeVars();
|
|
1211
|
+
const portalContainer = React4.useContext(SelectPortalContext);
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_select.Select.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1213
|
+
import_select.Select.Positioner,
|
|
1214
|
+
{
|
|
1215
|
+
className: "z-[200]",
|
|
1216
|
+
align: "start",
|
|
1217
|
+
alignItemWithTrigger: false,
|
|
1218
|
+
sideOffset: 4,
|
|
1219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1220
|
+
import_select.Select.Popup,
|
|
1221
|
+
__spreadProps(__spreadValues({
|
|
1222
|
+
className: cn(
|
|
1223
|
+
"relative max-h-[var(--available-height)] min-w-[var(--anchor-width,8rem)] overflow-x-hidden overflow-y-auto border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1224
|
+
className
|
|
1225
|
+
),
|
|
1226
|
+
"data-slot": "select-content",
|
|
1227
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1228
|
+
}, props), {
|
|
1229
|
+
children: [
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectScrollUpButton, {}),
|
|
1231
|
+
children,
|
|
1232
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectScrollDownButton, {})
|
|
1233
|
+
]
|
|
1234
|
+
})
|
|
1235
|
+
)
|
|
1236
|
+
}
|
|
1237
|
+
) });
|
|
1238
|
+
}
|
|
1239
|
+
function SelectItem(_a) {
|
|
1240
|
+
var _b = _a, {
|
|
1241
|
+
className,
|
|
1242
|
+
children
|
|
1243
|
+
} = _b, props = __objRest(_b, [
|
|
1244
|
+
"className",
|
|
1245
|
+
"children"
|
|
1246
|
+
]);
|
|
1247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1248
|
+
import_select.Select.Item,
|
|
1249
|
+
__spreadProps(__spreadValues({
|
|
1250
|
+
className: cn(
|
|
1251
|
+
"relative flex w-full cursor-default items-center gap-2 py-1.5 pr-8 pl-2 text-body-small outline-hidden select-none data-highlighted:bg-primary/5 data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1252
|
+
className
|
|
1253
|
+
),
|
|
1254
|
+
"data-slot": "select-item"
|
|
1255
|
+
}, props), {
|
|
1256
|
+
children: [
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1258
|
+
"span",
|
|
1259
|
+
{
|
|
1260
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
1261
|
+
"data-slot": "select-item-indicator",
|
|
1262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_select.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.CheckIcon, { className: "size-4" }) })
|
|
1263
|
+
}
|
|
1264
|
+
),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_select.Select.ItemText, { children })
|
|
1266
|
+
]
|
|
1267
|
+
})
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1270
|
+
function SelectScrollUpButton(_a) {
|
|
1271
|
+
var _b = _a, {
|
|
1272
|
+
className
|
|
1273
|
+
} = _b, props = __objRest(_b, [
|
|
1274
|
+
"className"
|
|
1275
|
+
]);
|
|
1276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1277
|
+
import_select.Select.ScrollUpArrow,
|
|
1278
|
+
__spreadProps(__spreadValues({
|
|
1279
|
+
className: cn(
|
|
1280
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1281
|
+
className
|
|
1282
|
+
),
|
|
1283
|
+
"data-slot": "select-scroll-up-button"
|
|
1284
|
+
}, props), {
|
|
1285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.ChevronUpIcon, { className: "size-4" })
|
|
1286
|
+
})
|
|
1287
|
+
);
|
|
1288
|
+
}
|
|
1289
|
+
function SelectScrollDownButton(_a) {
|
|
1290
|
+
var _b = _a, {
|
|
1291
|
+
className
|
|
1292
|
+
} = _b, props = __objRest(_b, [
|
|
1293
|
+
"className"
|
|
1294
|
+
]);
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1296
|
+
import_select.Select.ScrollDownArrow,
|
|
1297
|
+
__spreadProps(__spreadValues({
|
|
1298
|
+
className: cn(
|
|
1299
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1300
|
+
className
|
|
1301
|
+
),
|
|
1302
|
+
"data-slot": "select-scroll-down-button"
|
|
1303
|
+
}, props), {
|
|
1304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react7.ChevronDownIcon, { className: "size-4" })
|
|
1305
|
+
})
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
// src/components/ui/separator.tsx
|
|
1310
|
+
var import_separator = require("@base-ui/react/separator");
|
|
1311
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1312
|
+
function Separator(_a) {
|
|
1313
|
+
var _b = _a, {
|
|
1314
|
+
className,
|
|
1315
|
+
orientation = "horizontal"
|
|
1316
|
+
} = _b, props = __objRest(_b, [
|
|
1317
|
+
"className",
|
|
1318
|
+
"orientation"
|
|
1319
|
+
]);
|
|
1320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1321
|
+
import_separator.Separator,
|
|
1322
|
+
__spreadValues({
|
|
1323
|
+
className: cn(
|
|
1324
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
1325
|
+
className
|
|
1326
|
+
),
|
|
1327
|
+
"data-orientation": orientation,
|
|
1328
|
+
"data-slot": "separator"
|
|
1329
|
+
}, props)
|
|
1330
|
+
);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
// src/components/ui/table.tsx
|
|
1334
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1335
|
+
function Table(_a) {
|
|
1336
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1338
|
+
"div",
|
|
1339
|
+
{
|
|
1340
|
+
className: "relative w-full overflow-x-auto",
|
|
1341
|
+
"data-slot": "table-container",
|
|
1342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1343
|
+
"table",
|
|
1344
|
+
__spreadValues({
|
|
1345
|
+
className: cn("w-full caption-bottom text-body-small", className),
|
|
1346
|
+
"data-slot": "table"
|
|
1347
|
+
}, props)
|
|
1348
|
+
)
|
|
1349
|
+
}
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
function TableHeader(_a) {
|
|
1353
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1355
|
+
"thead",
|
|
1356
|
+
__spreadValues({
|
|
1357
|
+
className: cn("[&_tr]:border-b", className),
|
|
1358
|
+
"data-slot": "table-header"
|
|
1359
|
+
}, props)
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
function TableBody(_a) {
|
|
1363
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1365
|
+
"tbody",
|
|
1366
|
+
__spreadValues({
|
|
1367
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
1368
|
+
"data-slot": "table-body"
|
|
1369
|
+
}, props)
|
|
1370
|
+
);
|
|
1371
|
+
}
|
|
1372
|
+
function TableRow(_a) {
|
|
1373
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1375
|
+
"tr",
|
|
1376
|
+
__spreadValues({
|
|
1377
|
+
className: cn(
|
|
1378
|
+
"border-b transition-[background-color,opacity] hover:bg-muted/50 data-[state=selected]:bg-primary/10",
|
|
1379
|
+
className
|
|
1380
|
+
),
|
|
1381
|
+
"data-slot": "table-row"
|
|
1382
|
+
}, props)
|
|
1383
|
+
);
|
|
1384
|
+
}
|
|
1385
|
+
function TableHead(_a) {
|
|
1386
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1388
|
+
"th",
|
|
1389
|
+
__spreadValues({
|
|
1390
|
+
className: cn(
|
|
1391
|
+
"h-10 px-4 text-left align-middle text-label-medium whitespace-nowrap text-muted-foreground",
|
|
1392
|
+
"[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
1393
|
+
className
|
|
1394
|
+
),
|
|
1395
|
+
"data-slot": "table-head"
|
|
1396
|
+
}, props)
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
function TableCell(_a) {
|
|
1400
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1402
|
+
"td",
|
|
1403
|
+
__spreadValues({
|
|
1404
|
+
className: cn(
|
|
1405
|
+
"px-4 py-3 align-middle whitespace-nowrap",
|
|
1406
|
+
"[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
1407
|
+
className
|
|
1408
|
+
),
|
|
1409
|
+
"data-slot": "table-cell"
|
|
1410
|
+
}, props)
|
|
1411
|
+
);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
// src/components/ui/tabs.tsx
|
|
1415
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1416
|
+
var import_tabs = require("@base-ui/react/tabs");
|
|
1417
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1418
|
+
function Tabs(_a) {
|
|
1419
|
+
var _b = _a, {
|
|
1420
|
+
className,
|
|
1421
|
+
orientation = "horizontal"
|
|
1422
|
+
} = _b, props = __objRest(_b, [
|
|
1423
|
+
"className",
|
|
1424
|
+
"orientation"
|
|
1425
|
+
]);
|
|
1426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1427
|
+
import_tabs.Tabs.Root,
|
|
1428
|
+
__spreadValues({
|
|
1429
|
+
className: cn(
|
|
1430
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
1431
|
+
className
|
|
1432
|
+
),
|
|
1433
|
+
"data-orientation": orientation,
|
|
1434
|
+
"data-slot": "tabs"
|
|
1435
|
+
}, props)
|
|
1436
|
+
);
|
|
1437
|
+
}
|
|
1438
|
+
var tabsListVariants = (0, import_class_variance_authority3.cva)(
|
|
1439
|
+
"group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
1440
|
+
{
|
|
1441
|
+
variants: {
|
|
1442
|
+
variant: {
|
|
1443
|
+
default: "bg-muted",
|
|
1444
|
+
line: "bg-transparent p-0"
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
defaultVariants: {
|
|
1448
|
+
variant: "default"
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
);
|
|
1452
|
+
function TabsList(_a) {
|
|
1453
|
+
var _b = _a, {
|
|
1454
|
+
className,
|
|
1455
|
+
variant = "default"
|
|
1456
|
+
} = _b, props = __objRest(_b, [
|
|
1457
|
+
"className",
|
|
1458
|
+
"variant"
|
|
1459
|
+
]);
|
|
1460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1461
|
+
import_tabs.Tabs.List,
|
|
1462
|
+
__spreadValues({
|
|
1463
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
1464
|
+
"data-slot": "tabs-list",
|
|
1465
|
+
"data-variant": variant
|
|
1466
|
+
}, props)
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
function TabsTrigger(_a) {
|
|
1470
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1472
|
+
import_tabs.Tabs.Tab,
|
|
1473
|
+
__spreadValues({
|
|
1474
|
+
className: cn(
|
|
1475
|
+
// Base layout & typography
|
|
1476
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
|
|
1477
|
+
"rounded-none border border-transparent px-1.5 py-1 text-label-medium",
|
|
1478
|
+
"text-muted-foreground transition-all",
|
|
1479
|
+
// Vertical orientation
|
|
1480
|
+
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
1481
|
+
// Hover & focus
|
|
1482
|
+
"hover:text-foreground",
|
|
1483
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
|
|
1484
|
+
// Disabled
|
|
1485
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1486
|
+
// Active state — Default variant: primary/10 bg + subtle shadow
|
|
1487
|
+
// Base UI uses data-active attribute for the active/selected tab
|
|
1488
|
+
"data-active:bg-primary/10 data-active:text-foreground",
|
|
1489
|
+
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
1490
|
+
// Active state — Line variant: suppress bg & shadow
|
|
1491
|
+
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
1492
|
+
"group-data-[variant=line]/tabs-list:data-active:shadow-none",
|
|
1493
|
+
// Indicator pseudo-element (visible only for Line variant, active state)
|
|
1494
|
+
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
|
|
1495
|
+
"group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
1496
|
+
"group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
1497
|
+
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
1498
|
+
// SVG icons
|
|
1499
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1500
|
+
className
|
|
1501
|
+
),
|
|
1502
|
+
"data-slot": "tabs-trigger"
|
|
1503
|
+
}, props)
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
function TabsContent(_a) {
|
|
1507
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1509
|
+
import_tabs.Tabs.Panel,
|
|
1510
|
+
__spreadValues({
|
|
1511
|
+
className: cn("flex-1 outline-none", className),
|
|
1512
|
+
"data-slot": "tabs-content"
|
|
1513
|
+
}, props)
|
|
1514
|
+
);
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
// src/components/ui/textarea.tsx
|
|
1518
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1519
|
+
function Textarea(_a) {
|
|
1520
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1522
|
+
"textarea",
|
|
1523
|
+
__spreadValues({
|
|
1524
|
+
className: cn(
|
|
1525
|
+
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
1526
|
+
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
1527
|
+
className
|
|
1528
|
+
),
|
|
1529
|
+
"data-slot": "textarea"
|
|
1530
|
+
}, props)
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
// src/components/ui/tooltip.tsx
|
|
1535
|
+
var import_tooltip = require("@base-ui/react/tooltip");
|
|
1536
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1537
|
+
function TooltipProvider(_a) {
|
|
1538
|
+
var _b = _a, {
|
|
1539
|
+
delay = 0
|
|
1540
|
+
} = _b, props = __objRest(_b, [
|
|
1541
|
+
"delay"
|
|
1542
|
+
]);
|
|
1543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1544
|
+
import_tooltip.Tooltip.Provider,
|
|
1545
|
+
__spreadValues({
|
|
1546
|
+
"data-slot": "tooltip-provider",
|
|
1547
|
+
delay
|
|
1548
|
+
}, props)
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
function Tooltip(_a) {
|
|
1552
|
+
var props = __objRest(_a, []);
|
|
1553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
|
|
1554
|
+
}
|
|
1555
|
+
function TooltipTrigger(_a) {
|
|
1556
|
+
var props = __objRest(_a, []);
|
|
1557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
1558
|
+
}
|
|
1559
|
+
function TooltipContent(_a) {
|
|
1560
|
+
var _b = _a, {
|
|
1561
|
+
className,
|
|
1562
|
+
sideOffset = 8,
|
|
1563
|
+
side,
|
|
1564
|
+
children,
|
|
1565
|
+
style
|
|
1566
|
+
} = _b, props = __objRest(_b, [
|
|
1567
|
+
"className",
|
|
1568
|
+
"sideOffset",
|
|
1569
|
+
"side",
|
|
1570
|
+
"children",
|
|
1571
|
+
"style"
|
|
1572
|
+
]);
|
|
1573
|
+
const themeVars = useThemeVars();
|
|
1574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_tooltip.Tooltip.Positioner, { sideOffset, side, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1575
|
+
import_tooltip.Tooltip.Popup,
|
|
1576
|
+
__spreadProps(__spreadValues({
|
|
1577
|
+
className: cn(
|
|
1578
|
+
"relative z-50 w-fit animate-in overflow-visible bg-brand-secondary px-3 py-1.5 text-caption text-balance text-brand-secondary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
|
|
1579
|
+
className
|
|
1580
|
+
),
|
|
1581
|
+
"data-slot": "tooltip-content",
|
|
1582
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1583
|
+
}, props), {
|
|
1584
|
+
children: [
|
|
1585
|
+
children,
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_tooltip.Tooltip.Arrow, { className: "z-50 size-2.5 rotate-45 bg-brand-secondary data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1" })
|
|
1587
|
+
]
|
|
1588
|
+
})
|
|
1589
|
+
) }) });
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
// src/components/ui/ai-builder/agent-settings.tsx
|
|
1593
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1594
|
+
function SectionHeader({
|
|
1595
|
+
title,
|
|
1596
|
+
description,
|
|
1597
|
+
className
|
|
1598
|
+
}) {
|
|
1599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex flex-col gap-0.5", className), children: [
|
|
1600
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "text-h5", children: title }),
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-body-small text-muted-foreground", children: description })
|
|
1602
|
+
] });
|
|
1603
|
+
}
|
|
1604
|
+
function SettingRow({
|
|
1605
|
+
icon,
|
|
1606
|
+
label,
|
|
1607
|
+
description,
|
|
1608
|
+
control,
|
|
1609
|
+
className
|
|
1610
|
+
}) {
|
|
1611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex items-center gap-4 py-4", className), children: [
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground", children: icon }),
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-1 flex-col gap-0.5", children: [
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm font-semibold", children: label }),
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-caption text-muted-foreground", children: description })
|
|
1616
|
+
] }),
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "shrink-0", children: control })
|
|
1618
|
+
] });
|
|
1619
|
+
}
|
|
1620
|
+
function SettingCard({ rows, className }) {
|
|
1621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("rounded-none border px-4", className), children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react6.default.Fragment, { children: [
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SettingRow, __spreadValues({}, row)),
|
|
1623
|
+
i < rows.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Separator, {})
|
|
1624
|
+
] }, row.label)) });
|
|
1625
|
+
}
|
|
1626
|
+
function AgentConfigForm({
|
|
1627
|
+
config,
|
|
1628
|
+
onChange,
|
|
1629
|
+
className
|
|
1630
|
+
}) {
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1632
|
+
"div",
|
|
1633
|
+
{
|
|
1634
|
+
className: cn("flex flex-col gap-4 rounded-none border p-6", className),
|
|
1635
|
+
children: [
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Label, { htmlFor: "agent-name", children: "Agent Name" }),
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1639
|
+
Input,
|
|
1640
|
+
{
|
|
1641
|
+
id: "agent-name",
|
|
1642
|
+
value: config.name,
|
|
1643
|
+
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { name: e.target.value }))
|
|
1644
|
+
}
|
|
1645
|
+
)
|
|
1646
|
+
] }),
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
1648
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Label, { htmlFor: "agent-desc", children: "Business Description" }),
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1650
|
+
Textarea,
|
|
1651
|
+
{
|
|
1652
|
+
id: "agent-desc",
|
|
1653
|
+
rows: 4,
|
|
1654
|
+
placeholder: "What business is this agent for? What industry?",
|
|
1655
|
+
value: config.businessDescription,
|
|
1656
|
+
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { businessDescription: e.target.value }))
|
|
1657
|
+
}
|
|
1658
|
+
)
|
|
1659
|
+
] })
|
|
1660
|
+
]
|
|
1661
|
+
}
|
|
1662
|
+
);
|
|
1663
|
+
}
|
|
1664
|
+
function ResponseTemplateEditModal({
|
|
1665
|
+
open,
|
|
1666
|
+
onOpenChange,
|
|
1667
|
+
channel,
|
|
1668
|
+
content,
|
|
1669
|
+
onConfirm
|
|
1670
|
+
}) {
|
|
1671
|
+
const [draft, setDraft] = import_react6.default.useState(content);
|
|
1672
|
+
import_react6.default.useEffect(() => {
|
|
1673
|
+
if (open) setDraft(content);
|
|
1674
|
+
}, [open, content]);
|
|
1675
|
+
const isEmail = channel === "email";
|
|
1676
|
+
const channelLabel = isEmail ? "Email" : "Chat";
|
|
1677
|
+
const helperText = isEmail ? "Use {customer} to insert the customer name and {answer} to insert the response" : "Use {answer} to insert the response";
|
|
1678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogContent, { className: "max-w-lg", children: [
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogTitle, { children: [
|
|
1680
|
+
"Edit ",
|
|
1681
|
+
channelLabel,
|
|
1682
|
+
" response template"
|
|
1683
|
+
] }) }),
|
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5 py-2", children: [
|
|
1685
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Label, { htmlFor: "template-content", children: [
|
|
1686
|
+
channelLabel,
|
|
1687
|
+
" template content",
|
|
1688
|
+
" ",
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-destructive", children: "*" })
|
|
1690
|
+
] }),
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1692
|
+
Textarea,
|
|
1693
|
+
{
|
|
1694
|
+
id: "template-content",
|
|
1695
|
+
rows: 6,
|
|
1696
|
+
placeholder: `Enter content for ${channelLabel} template`,
|
|
1697
|
+
value: draft,
|
|
1698
|
+
onChange: (e) => setDraft(e.target.value)
|
|
1699
|
+
}
|
|
1700
|
+
),
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-caption text-muted-foreground", children: helperText })
|
|
1702
|
+
] }),
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogFooter, { children: [
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
1705
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1706
|
+
Button,
|
|
1707
|
+
{
|
|
1708
|
+
onClick: () => {
|
|
1709
|
+
onConfirm(draft);
|
|
1710
|
+
onOpenChange(false);
|
|
1711
|
+
},
|
|
1712
|
+
children: "Confirm"
|
|
1713
|
+
}
|
|
1714
|
+
)
|
|
1715
|
+
] })
|
|
1716
|
+
] }) });
|
|
1717
|
+
}
|
|
1718
|
+
function RuleOrderBadge({ order, className }) {
|
|
1719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Badge, { variant: "secondary", className, children: [
|
|
1720
|
+
"#",
|
|
1721
|
+
order
|
|
1722
|
+
] });
|
|
1723
|
+
}
|
|
1724
|
+
function SortableRuleRow({
|
|
1725
|
+
rule,
|
|
1726
|
+
index,
|
|
1727
|
+
onEdit,
|
|
1728
|
+
onDelete,
|
|
1729
|
+
onToggle
|
|
1730
|
+
}) {
|
|
1731
|
+
const {
|
|
1732
|
+
attributes,
|
|
1733
|
+
listeners,
|
|
1734
|
+
setNodeRef,
|
|
1735
|
+
transform,
|
|
1736
|
+
transition,
|
|
1737
|
+
isDragging
|
|
1738
|
+
} = (0, import_sortable.useSortable)({ id: rule.id });
|
|
1739
|
+
const style = {
|
|
1740
|
+
transform: import_utilities.CSS.Transform.toString(transform),
|
|
1741
|
+
transition
|
|
1742
|
+
};
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1744
|
+
TableRow,
|
|
1745
|
+
{
|
|
1746
|
+
ref: setNodeRef,
|
|
1747
|
+
style,
|
|
1748
|
+
className: cn(isDragging && "opacity-50 bg-muted/40"),
|
|
1749
|
+
children: [
|
|
1750
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1752
|
+
"button",
|
|
1753
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
1754
|
+
type: "button",
|
|
1755
|
+
className: "cursor-grab touch-none text-muted-foreground hover:text-foreground active:cursor-grabbing",
|
|
1756
|
+
"aria-label": `Drag to reorder rule ${index + 1}`
|
|
1757
|
+
}, attributes), listeners), {
|
|
1758
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.GripVertical, { className: "h-4 w-4" })
|
|
1759
|
+
})
|
|
1760
|
+
),
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RuleOrderBadge, { order: index + 1 })
|
|
1762
|
+
] }) }),
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableCell, { className: "text-body-small overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "break-words whitespace-normal", children: rule.text }) }),
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-end gap-1", children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1766
|
+
Switch,
|
|
1767
|
+
{
|
|
1768
|
+
checked: rule.isEnabled,
|
|
1769
|
+
onCheckedChange: (checked) => onToggle(rule.id, checked),
|
|
1770
|
+
"aria-label": `Toggle rule ${index + 1}`
|
|
1771
|
+
}
|
|
1772
|
+
),
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1774
|
+
Button,
|
|
1775
|
+
{
|
|
1776
|
+
variant: "ghost",
|
|
1777
|
+
size: "icon",
|
|
1778
|
+
className: "h-8 w-8",
|
|
1779
|
+
onClick: () => onEdit(rule.id),
|
|
1780
|
+
"aria-label": `Edit rule ${index + 1}`,
|
|
1781
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Pencil, { className: "h-3.5 w-3.5" })
|
|
1782
|
+
}
|
|
1783
|
+
),
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1785
|
+
Button,
|
|
1786
|
+
{
|
|
1787
|
+
variant: "ghost",
|
|
1788
|
+
size: "icon",
|
|
1789
|
+
className: "h-8 w-8 text-destructive hover:text-destructive",
|
|
1790
|
+
onClick: () => onDelete(rule.id),
|
|
1791
|
+
"aria-label": `Delete rule ${index + 1}`,
|
|
1792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Trash2, { className: "h-3.5 w-3.5" })
|
|
1793
|
+
}
|
|
1794
|
+
)
|
|
1795
|
+
] }) })
|
|
1796
|
+
]
|
|
1797
|
+
}
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
function RuleTable({
|
|
1801
|
+
rules,
|
|
1802
|
+
onEdit,
|
|
1803
|
+
onDelete,
|
|
1804
|
+
onToggle,
|
|
1805
|
+
onReorder
|
|
1806
|
+
}) {
|
|
1807
|
+
const sensors = (0, import_core.useSensors)(
|
|
1808
|
+
(0, import_core.useSensor)(import_core.PointerSensor),
|
|
1809
|
+
(0, import_core.useSensor)(import_core.KeyboardSensor, {
|
|
1810
|
+
coordinateGetter: import_sortable.sortableKeyboardCoordinates
|
|
1811
|
+
})
|
|
1812
|
+
);
|
|
1813
|
+
function handleDragEnd(event) {
|
|
1814
|
+
const { active, over } = event;
|
|
1815
|
+
if (over && active.id !== over.id && onReorder) {
|
|
1816
|
+
onReorder(String(active.id), String(over.id));
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
if (rules.length === 0) {
|
|
1820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex h-24 items-center justify-center text-body-small text-muted-foreground", children: "No rules added yet." });
|
|
1821
|
+
}
|
|
1822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1823
|
+
import_core.DndContext,
|
|
1824
|
+
{
|
|
1825
|
+
sensors,
|
|
1826
|
+
collisionDetection: import_core.closestCenter,
|
|
1827
|
+
onDragEnd: handleDragEnd,
|
|
1828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1829
|
+
import_sortable.SortableContext,
|
|
1830
|
+
{
|
|
1831
|
+
items: rules.map((r) => r.id),
|
|
1832
|
+
strategy: import_sortable.verticalListSortingStrategy,
|
|
1833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Table, { className: "table-fixed", children: [
|
|
1834
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(TableRow, { children: [
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableHead, { className: "w-28", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
1836
|
+
"Order",
|
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
|
|
1838
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Info, { className: "h-3.5 w-3.5 text-muted-foreground cursor-default" }) }),
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: "Drag rows to reorder rules" })
|
|
1840
|
+
] }) })
|
|
1841
|
+
] }) }),
|
|
1842
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableHead, { children: "Rule Set" }),
|
|
1843
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableHead, { className: "w-36 text-right", children: "Actions" })
|
|
1844
|
+
] }) }),
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableBody, { children: rules.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1846
|
+
SortableRuleRow,
|
|
1847
|
+
{
|
|
1848
|
+
rule,
|
|
1849
|
+
index,
|
|
1850
|
+
onEdit,
|
|
1851
|
+
onDelete,
|
|
1852
|
+
onToggle
|
|
1853
|
+
},
|
|
1854
|
+
rule.id
|
|
1855
|
+
)) })
|
|
1856
|
+
] })
|
|
1857
|
+
}
|
|
1858
|
+
)
|
|
1859
|
+
}
|
|
1860
|
+
);
|
|
1861
|
+
}
|
|
1862
|
+
function RuleTabContent({
|
|
1863
|
+
rules,
|
|
1864
|
+
description,
|
|
1865
|
+
onEditRule,
|
|
1866
|
+
onDeleteRule,
|
|
1867
|
+
onToggleRule,
|
|
1868
|
+
onReorderRules,
|
|
1869
|
+
rowsPerPage
|
|
1870
|
+
}) {
|
|
1871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mt-4 flex flex-col gap-3", children: [
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start gap-2 rounded-none border border-blue-200 bg-blue-50 p-3", children: [
|
|
1873
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Info, { className: "mt-0.5 h-4 w-4 shrink-0 text-blue-600" }),
|
|
1874
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-caption text-blue-700", children: description })
|
|
1875
|
+
] }),
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1877
|
+
RuleTable,
|
|
1878
|
+
{
|
|
1879
|
+
rules,
|
|
1880
|
+
onEdit: onEditRule,
|
|
1881
|
+
onDelete: onDeleteRule,
|
|
1882
|
+
onToggle: onToggleRule,
|
|
1883
|
+
onReorder: onReorderRules
|
|
1884
|
+
}
|
|
1885
|
+
),
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-end gap-2 pt-2 text-body-small text-muted-foreground", children: [
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Rows per page:" }),
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Select, { defaultValue: String(rowsPerPage), children: [
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectTrigger, { className: "h-8 w-20", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectValue, {}) }),
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(SelectContent, { children: [
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: "5", children: "5" }),
|
|
1892
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: "10", children: "10" }),
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: "20", children: "20" }),
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: "50", children: "50" })
|
|
1895
|
+
] })
|
|
1896
|
+
] })
|
|
1897
|
+
] })
|
|
1898
|
+
] });
|
|
1899
|
+
}
|
|
1900
|
+
function RuleSetSection({
|
|
1901
|
+
standardRules,
|
|
1902
|
+
handoffRules,
|
|
1903
|
+
onAddRule,
|
|
1904
|
+
onEditRule,
|
|
1905
|
+
onDeleteRule,
|
|
1906
|
+
onToggleRule,
|
|
1907
|
+
onReorderRules,
|
|
1908
|
+
onExport,
|
|
1909
|
+
onImport,
|
|
1910
|
+
rowsPerPage = 10,
|
|
1911
|
+
className
|
|
1912
|
+
}) {
|
|
1913
|
+
const [activeTab, setActiveTab] = import_react6.default.useState(
|
|
1914
|
+
"standard"
|
|
1915
|
+
);
|
|
1916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex flex-col gap-4", className), children: [
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1919
|
+
SectionHeader,
|
|
1920
|
+
{
|
|
1921
|
+
title: "Rule Set",
|
|
1922
|
+
description: "You can adjust the behavior and response method of the Agent through rules."
|
|
1923
|
+
}
|
|
1924
|
+
),
|
|
1925
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
1926
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Button, { variant: "outline", size: "sm", onClick: onExport, children: [
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Download, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
1928
|
+
"Export"
|
|
1929
|
+
] }),
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Button, { variant: "outline", size: "sm", onClick: onImport, children: [
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Upload, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
1932
|
+
"Import"
|
|
1933
|
+
] }),
|
|
1934
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Button, { size: "sm", onClick: () => onAddRule(activeTab), children: [
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Plus, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
1936
|
+
"Add rule"
|
|
1937
|
+
] })
|
|
1938
|
+
] })
|
|
1939
|
+
] }),
|
|
1940
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1941
|
+
Tabs,
|
|
1942
|
+
{
|
|
1943
|
+
defaultValue: "standard",
|
|
1944
|
+
onValueChange: (v) => setActiveTab(v),
|
|
1945
|
+
children: [
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(TabsList, { className: "w-full", children: [
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsTrigger, { value: "standard", className: "flex-1", children: "Standard Rules" }),
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsTrigger, { value: "handoff", className: "flex-1", children: "Hand-off Rules" })
|
|
1949
|
+
] }),
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsContent, { value: "standard", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1951
|
+
RuleTabContent,
|
|
1952
|
+
{
|
|
1953
|
+
rules: standardRules,
|
|
1954
|
+
description: "Standard rules guide AI behavior during response generation. These rules help the AI understand how to respond appropriately.",
|
|
1955
|
+
onEditRule,
|
|
1956
|
+
onDeleteRule,
|
|
1957
|
+
onToggleRule,
|
|
1958
|
+
onReorderRules,
|
|
1959
|
+
rowsPerPage
|
|
1960
|
+
}
|
|
1961
|
+
) }),
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsContent, { value: "handoff", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1963
|
+
RuleTabContent,
|
|
1964
|
+
{
|
|
1965
|
+
rules: handoffRules,
|
|
1966
|
+
description: "Hand-off rules define when the AI should transfer a conversation to a human agent.",
|
|
1967
|
+
onEditRule,
|
|
1968
|
+
onDeleteRule,
|
|
1969
|
+
onToggleRule,
|
|
1970
|
+
onReorderRules,
|
|
1971
|
+
rowsPerPage
|
|
1972
|
+
}
|
|
1973
|
+
) })
|
|
1974
|
+
]
|
|
1975
|
+
}
|
|
1976
|
+
)
|
|
1977
|
+
] });
|
|
1978
|
+
}
|
|
1979
|
+
function AddEditRuleModal({
|
|
1980
|
+
open,
|
|
1981
|
+
onOpenChange,
|
|
1982
|
+
rule,
|
|
1983
|
+
defaultType = "standard",
|
|
1984
|
+
onConfirm
|
|
1985
|
+
}) {
|
|
1986
|
+
var _a;
|
|
1987
|
+
const RULE_TYPE_LABELS = {
|
|
1988
|
+
standard: "Standard Rule",
|
|
1989
|
+
handoff: "Hand-off Rule"
|
|
1990
|
+
};
|
|
1991
|
+
const LABEL_TO_TYPE = {
|
|
1992
|
+
"Standard Rule": "standard",
|
|
1993
|
+
"Hand-off Rule": "handoff"
|
|
1994
|
+
};
|
|
1995
|
+
const isEdit = !!rule;
|
|
1996
|
+
const [draft, setDraft] = import_react6.default.useState((_a = rule == null ? void 0 : rule.text) != null ? _a : "");
|
|
1997
|
+
const [ruleType, setRuleType] = import_react6.default.useState(
|
|
1998
|
+
defaultType
|
|
1999
|
+
);
|
|
2000
|
+
import_react6.default.useEffect(() => {
|
|
2001
|
+
var _a2;
|
|
2002
|
+
if (open) {
|
|
2003
|
+
setDraft((_a2 = rule == null ? void 0 : rule.text) != null ? _a2 : "");
|
|
2004
|
+
setRuleType(defaultType);
|
|
2005
|
+
}
|
|
2006
|
+
}, [open, rule, defaultType]);
|
|
2007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogContent, { className: "max-w-lg", children: [
|
|
2008
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogTitle, { children: isEdit ? "Edit Rule" : "Add Rule" }) }),
|
|
2009
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-3 py-2", children: [
|
|
2010
|
+
!isEdit && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
2011
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Label, { htmlFor: "rule-type", children: [
|
|
2012
|
+
"Rule Type ",
|
|
2013
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-destructive", children: "*" })
|
|
2014
|
+
] }),
|
|
2015
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2016
|
+
Select,
|
|
2017
|
+
{
|
|
2018
|
+
value: RULE_TYPE_LABELS[ruleType],
|
|
2019
|
+
onValueChange: (v) => setRuleType(LABEL_TO_TYPE[v]),
|
|
2020
|
+
children: [
|
|
2021
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectTrigger, { id: "rule-type", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectValue, {}) }),
|
|
2022
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(SelectContent, { children: [
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: "Standard Rule", children: "Standard Rule" }),
|
|
2024
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectItem, { value: "Hand-off Rule", children: "Hand-off Rule" })
|
|
2025
|
+
] })
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
)
|
|
2029
|
+
] }),
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
2031
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Label, { htmlFor: "rule-draft", children: [
|
|
2032
|
+
"Rule ",
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-destructive", children: "*" })
|
|
2034
|
+
] }),
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2036
|
+
Textarea,
|
|
2037
|
+
{
|
|
2038
|
+
id: "rule-draft",
|
|
2039
|
+
rows: 4,
|
|
2040
|
+
placeholder: "Describe the rule the agent should follow\u2026",
|
|
2041
|
+
value: draft,
|
|
2042
|
+
onChange: (e) => setDraft(e.target.value)
|
|
2043
|
+
}
|
|
2044
|
+
)
|
|
2045
|
+
] })
|
|
2046
|
+
] }),
|
|
2047
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogFooter, { children: [
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2050
|
+
Button,
|
|
2051
|
+
{
|
|
2052
|
+
disabled: !draft.trim(),
|
|
2053
|
+
onClick: () => {
|
|
2054
|
+
onConfirm(draft.trim(), ruleType);
|
|
2055
|
+
onOpenChange(false);
|
|
2056
|
+
},
|
|
2057
|
+
children: isEdit ? "Save" : "Add"
|
|
2058
|
+
}
|
|
2059
|
+
)
|
|
2060
|
+
] })
|
|
2061
|
+
] }) });
|
|
2062
|
+
}
|
|
1090
2063
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1091
2064
|
0 && (module.exports = {
|
|
2065
|
+
AddEditRuleModal,
|
|
1092
2066
|
AgentCard,
|
|
2067
|
+
AgentConfigForm,
|
|
1093
2068
|
AgentMenuModal,
|
|
1094
2069
|
IntegrationInstructionCard,
|
|
1095
2070
|
IntegrationServiceCard,
|
|
1096
|
-
|
|
2071
|
+
ResponseTemplateEditModal,
|
|
2072
|
+
RuleOrderBadge,
|
|
2073
|
+
RuleSetSection,
|
|
2074
|
+
SectionHeader,
|
|
2075
|
+
ServiceConfigurationModal,
|
|
2076
|
+
SettingCard,
|
|
2077
|
+
SettingRow
|
|
1097
2078
|
});
|