saasco-sdk 0.2.4 → 0.2.5
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/README.md +974 -0
- package/dist/index.cjs +168 -117
- package/dist/index.d.cts +21 -42
- package/dist/index.d.ts +21 -42
- package/dist/index.js +168 -117
- package/dist/support.cjs +1411 -829
- package/dist/support.d.cts +20 -9
- package/dist/support.d.ts +20 -9
- package/dist/support.js +1439 -857
- package/package.json +21 -1
package/dist/support.cjs
CHANGED
|
@@ -76,12 +76,17 @@ __export(support_exports, {
|
|
|
76
76
|
});
|
|
77
77
|
module.exports = __toCommonJS(support_exports);
|
|
78
78
|
|
|
79
|
-
// ../../support/shared/src/lib/
|
|
79
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridge.ts
|
|
80
80
|
var BRIDGE_SOURCE = "saasco-support";
|
|
81
81
|
var BRIDGE_PROTOCOL_VERSION = 1;
|
|
82
82
|
var BRIDGE_REQUEST_TIMEOUT_MS = 15e3;
|
|
83
83
|
|
|
84
|
-
// ../../
|
|
84
|
+
// ../../utils/shared/src/lib/isRecord.ts
|
|
85
|
+
function isRecord(value) {
|
|
86
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridgeParse.ts
|
|
85
90
|
function createEnvelope(message) {
|
|
86
91
|
return {
|
|
87
92
|
source: BRIDGE_SOURCE,
|
|
@@ -188,9 +193,6 @@ function matchesOriginPattern(origin, pattern) {
|
|
|
188
193
|
function isOriginAllowed(origin, patterns) {
|
|
189
194
|
return patterns.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
190
195
|
}
|
|
191
|
-
function isRecord(value) {
|
|
192
|
-
return typeof value === "object" && value !== null;
|
|
193
|
-
}
|
|
194
196
|
function readEnvelope(data) {
|
|
195
197
|
if (!isRecord(data)) {
|
|
196
198
|
return null;
|
|
@@ -229,7 +231,12 @@ function parseIdentityBearingMessage(msg) {
|
|
|
229
231
|
if (msg.identity !== null && !isRecord(msg.identity)) {
|
|
230
232
|
return null;
|
|
231
233
|
}
|
|
232
|
-
|
|
234
|
+
const identity2 = sanitizeBridgeIdentity(msg.identity);
|
|
235
|
+
if (msg.type === "identify") {
|
|
236
|
+
return { ...msg, identity: identity2 };
|
|
237
|
+
}
|
|
238
|
+
const hostLauncher = msg.hostLauncher === true ? true : msg.hostLauncher === false ? false : void 0;
|
|
239
|
+
return { ...msg, hostLauncher, identity: identity2 };
|
|
233
240
|
}
|
|
234
241
|
function isValidPageContextMessage(msg) {
|
|
235
242
|
return typeof msg.requestId === "string" && isRecord(msg.context) && typeof msg.context.url === "string";
|
|
@@ -240,7 +247,10 @@ var stateSnapshot;
|
|
|
240
247
|
var identity = null;
|
|
241
248
|
var userJwt = null;
|
|
242
249
|
var hostViewport = null;
|
|
250
|
+
var hostOwnsLauncher = false;
|
|
251
|
+
var previewShell = null;
|
|
243
252
|
var openControls = null;
|
|
253
|
+
var pendingOpenCommand = null;
|
|
244
254
|
var subscribers = /* @__PURE__ */ new Set();
|
|
245
255
|
function notify() {
|
|
246
256
|
for (const cb of subscribers) {
|
|
@@ -281,6 +291,19 @@ function setHostViewport(next) {
|
|
|
281
291
|
function getHostViewport() {
|
|
282
292
|
return hostViewport;
|
|
283
293
|
}
|
|
294
|
+
function setHostOwnsLauncher(next) {
|
|
295
|
+
if (hostOwnsLauncher === next) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
hostOwnsLauncher = next;
|
|
299
|
+
notify();
|
|
300
|
+
}
|
|
301
|
+
function getHostOwnsLauncher() {
|
|
302
|
+
return hostOwnsLauncher;
|
|
303
|
+
}
|
|
304
|
+
function getPreviewShell() {
|
|
305
|
+
return previewShell;
|
|
306
|
+
}
|
|
284
307
|
function resetSession() {
|
|
285
308
|
identity = null;
|
|
286
309
|
userJwt = null;
|
|
@@ -298,12 +321,32 @@ function subscribeToRegistry(cb) {
|
|
|
298
321
|
}
|
|
299
322
|
function setOpenControls(controls) {
|
|
300
323
|
openControls = controls;
|
|
324
|
+
if (!controls || pendingOpenCommand === null) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const shouldOpen = pendingOpenCommand;
|
|
328
|
+
pendingOpenCommand = null;
|
|
329
|
+
if (shouldOpen) {
|
|
330
|
+
controls.open();
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
controls.close();
|
|
301
334
|
}
|
|
302
335
|
function openWidget() {
|
|
303
|
-
openControls
|
|
336
|
+
if (openControls) {
|
|
337
|
+
pendingOpenCommand = null;
|
|
338
|
+
openControls.open();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
pendingOpenCommand = true;
|
|
304
342
|
}
|
|
305
343
|
function closeWidget() {
|
|
306
|
-
openControls
|
|
344
|
+
if (openControls) {
|
|
345
|
+
pendingOpenCommand = null;
|
|
346
|
+
openControls.close();
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
pendingOpenCommand = false;
|
|
307
350
|
}
|
|
308
351
|
|
|
309
352
|
// src/lib/support/embedBridge.ts
|
|
@@ -324,7 +367,7 @@ function post(message) {
|
|
|
324
367
|
if (!parent || parent === window) {
|
|
325
368
|
return;
|
|
326
369
|
}
|
|
327
|
-
const targetOrigin = message.type === "resize" ? "*" : parentOrigin ?? "*";
|
|
370
|
+
const targetOrigin = message.type === "resize" || message.type === "openState" ? "*" : parentOrigin ?? "*";
|
|
328
371
|
parent.postMessage(createEnvelope(message), targetOrigin);
|
|
329
372
|
}
|
|
330
373
|
function handleHostMessage(message) {
|
|
@@ -336,6 +379,7 @@ function handleHostMessage(message) {
|
|
|
336
379
|
if (message.viewport) {
|
|
337
380
|
setHostViewport(message.viewport);
|
|
338
381
|
}
|
|
382
|
+
setHostOwnsLauncher(message.hostLauncher === true);
|
|
339
383
|
break;
|
|
340
384
|
}
|
|
341
385
|
case "shutdown": {
|
|
@@ -429,6 +473,9 @@ function initEmbedBridge(options) {
|
|
|
429
473
|
function postResize(width, height, fullscreen = false) {
|
|
430
474
|
post({ fullscreen, height, type: "resize", width });
|
|
431
475
|
}
|
|
476
|
+
function postOpenState(open, fullscreen = false) {
|
|
477
|
+
post({ fullscreen, open, type: "openState" });
|
|
478
|
+
}
|
|
432
479
|
function postLauncherState(scale2, hovered) {
|
|
433
480
|
post({ hovered, scale: scale2, type: "launcherState" });
|
|
434
481
|
}
|
|
@@ -483,7 +530,7 @@ function executeHostTool(name, args, request) {
|
|
|
483
530
|
}
|
|
484
531
|
|
|
485
532
|
// src/lib/support/Widget.tsx
|
|
486
|
-
var
|
|
533
|
+
var import_react43 = require("@ai-sdk/react");
|
|
487
534
|
|
|
488
535
|
// ../../chat/client/src/lib/core/chatSessionStorage.ts
|
|
489
536
|
var MAX_SESSION_HISTORY = 50;
|
|
@@ -795,42 +842,7 @@ function useToolApprovals({
|
|
|
795
842
|
return { approve, clearPending, onToolCall, pending, reject };
|
|
796
843
|
}
|
|
797
844
|
|
|
798
|
-
// ../../support/shared/src/lib/
|
|
799
|
-
function buildMergedStateSnapshot(layers) {
|
|
800
|
-
const merged = {};
|
|
801
|
-
const ordered = [
|
|
802
|
-
layers.browserContext,
|
|
803
|
-
layers.identifyTraits,
|
|
804
|
-
layers.envelope,
|
|
805
|
-
toRecord(layers.hostSnapshot)
|
|
806
|
-
];
|
|
807
|
-
for (const layer of ordered) {
|
|
808
|
-
if (!layer) {
|
|
809
|
-
continue;
|
|
810
|
-
}
|
|
811
|
-
for (const [key, value] of Object.entries(layer)) {
|
|
812
|
-
const scalar = coerceScalar(value);
|
|
813
|
-
if (scalar !== void 0) {
|
|
814
|
-
merged[key] = scalar;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
return merged;
|
|
819
|
-
}
|
|
820
|
-
function coerceScalar(value) {
|
|
821
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
822
|
-
return value;
|
|
823
|
-
}
|
|
824
|
-
return void 0;
|
|
825
|
-
}
|
|
826
|
-
function toRecord(value) {
|
|
827
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
828
|
-
return value;
|
|
829
|
-
}
|
|
830
|
-
return void 0;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
// ../../support/shared/src/lib/types/kbCitations.ts
|
|
845
|
+
// ../../support/shared/src/lib/message/kbCitations.ts
|
|
834
846
|
var import_zod = require("zod");
|
|
835
847
|
var KB_CITATION_MARKER_PATTERN = /\[\[kb:([^\]]+)\]\]/gu;
|
|
836
848
|
var KbCitationSchema = import_zod.z.object({
|
|
@@ -838,8 +850,6 @@ var KbCitationSchema = import_zod.z.object({
|
|
|
838
850
|
title: import_zod.z.string(),
|
|
839
851
|
url: import_zod.z.string()
|
|
840
852
|
});
|
|
841
|
-
|
|
842
|
-
// ../../support/shared/src/lib/kbCitations.ts
|
|
843
853
|
function stripKbCitationMarkers(text) {
|
|
844
854
|
return text.replaceAll(KB_CITATION_MARKER_PATTERN, "");
|
|
845
855
|
}
|
|
@@ -868,8 +878,9 @@ function buildKbCitationNumberMap(text) {
|
|
|
868
878
|
return map;
|
|
869
879
|
}
|
|
870
880
|
|
|
871
|
-
// ../../support/shared/src/lib/normalizeToolName.ts
|
|
881
|
+
// ../../support/shared/src/lib/tools/normalizeToolName.ts
|
|
872
882
|
var CLOSE_CONVERSATION_TOOL_NAME = "close_conversation";
|
|
883
|
+
var REPORT_KNOWLEDGE_GAP_TOOL_NAME = "report_knowledge_gap";
|
|
873
884
|
var REQUEST_HUMAN_HANDOFF_TOOL_NAME = "request_human_handoff";
|
|
874
885
|
function normalizeToolName(displayName) {
|
|
875
886
|
return displayName.trim().toLowerCase().replaceAll(/[^a-z0-9]+/gu, "_").replaceAll(/_+/gu, "_").replaceAll(/^_+|_+$/gu, "").slice(0, 64);
|
|
@@ -886,6 +897,33 @@ function buildToolDisplayLabelMap(tools) {
|
|
|
886
897
|
return labels;
|
|
887
898
|
}
|
|
888
899
|
|
|
900
|
+
// ../../support/shared/src/lib/tools/toolContext.ts
|
|
901
|
+
function pickScalarRecord(value) {
|
|
902
|
+
if (!isRecord(value)) {
|
|
903
|
+
return {};
|
|
904
|
+
}
|
|
905
|
+
const scalars = {};
|
|
906
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
907
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean") {
|
|
908
|
+
scalars[key] = entry;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return scalars;
|
|
912
|
+
}
|
|
913
|
+
function buildToolContext({
|
|
914
|
+
identity: identity2,
|
|
915
|
+
stateSnapshot: stateSnapshot2
|
|
916
|
+
}) {
|
|
917
|
+
const context = pickScalarRecord(stateSnapshot2);
|
|
918
|
+
if (identity2?.distinctId) {
|
|
919
|
+
context.distinctId = identity2.distinctId;
|
|
920
|
+
}
|
|
921
|
+
if (identity2?.email) {
|
|
922
|
+
context.email = identity2.email;
|
|
923
|
+
}
|
|
924
|
+
return context;
|
|
925
|
+
}
|
|
926
|
+
|
|
889
927
|
// src/lib/support/Widget.tsx
|
|
890
928
|
var import_ai7 = require("ai");
|
|
891
929
|
|
|
@@ -9430,7 +9468,7 @@ function useReducedMotion() {
|
|
|
9430
9468
|
}
|
|
9431
9469
|
|
|
9432
9470
|
// src/lib/support/Widget.tsx
|
|
9433
|
-
var
|
|
9471
|
+
var import_react44 = require("react");
|
|
9434
9472
|
|
|
9435
9473
|
// src/lib/support/buildWidgetTypingLabel.ts
|
|
9436
9474
|
function buildWidgetTypingLabel(actors) {
|
|
@@ -9456,7 +9494,7 @@ function SaascoLogo() {
|
|
|
9456
9494
|
viewBox: "0 0 438 83",
|
|
9457
9495
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9458
9496
|
children: [
|
|
9459
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#
|
|
9497
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#0B0B0B" }),
|
|
9460
9498
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9461
9499
|
"path",
|
|
9462
9500
|
{
|
|
@@ -9491,42 +9529,42 @@ function SaascoLogo() {
|
|
|
9491
9529
|
"path",
|
|
9492
9530
|
{
|
|
9493
9531
|
d: "M408.943 73.5C392.079 73.5 380.697 61.1648 380.697 41.5C380.697 21.7756 392.139 9.5 408.943 9.5C425.807 9.5 437.189 21.7756 437.189 41.5C437.189 61.1648 425.807 73.5 408.943 73.5ZM408.943 66.5279C421.1 66.5279 429.204 57.2318 429.204 41.5C429.204 25.7682 421.1 16.4721 408.943 16.4721C396.787 16.4721 388.742 25.7682 388.742 41.5C388.742 57.2318 396.787 66.5279 408.943 66.5279Z",
|
|
9494
|
-
fill: "#
|
|
9532
|
+
fill: "#0B0B0B"
|
|
9495
9533
|
}
|
|
9496
9534
|
),
|
|
9497
9535
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9498
9536
|
"path",
|
|
9499
9537
|
{
|
|
9500
9538
|
d: "M377.565 30.1182H369.818C368.15 22.4907 361.893 16.4721 352.12 16.4721C340.023 16.4721 332.097 26.1853 332.097 41.5C332.097 57.0531 340.083 66.5279 352.179 66.5279C361.535 66.5279 368.03 61.3436 369.818 53.2989H377.624C375.896 65.1574 365.826 73.5 352.12 73.5C335.196 73.5 324.053 61.3436 324.053 41.5C324.053 21.9544 335.196 9.5 352.06 9.5C366.66 9.5 376.016 19.0344 377.565 30.1182Z",
|
|
9501
|
-
fill: "#
|
|
9539
|
+
fill: "#0B0B0B"
|
|
9502
9540
|
}
|
|
9503
9541
|
),
|
|
9504
9542
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9505
9543
|
"path",
|
|
9506
9544
|
{
|
|
9507
9545
|
d: "M274.262 27.0791C274.262 16.8296 283.379 9.5 296.31 9.5C309.539 9.5 318.359 17.1872 319.074 28.4497H311.506C310.493 20.703 304.891 15.9953 296.31 15.9953C287.848 15.9953 282.068 20.4646 282.068 26.662C282.068 31.7272 285.584 34.8855 293.807 36.852L303.163 39.0568C315.558 42.0363 320.206 46.8035 320.206 55.5633C320.206 66.0512 310.374 73.5 296.847 73.5C282.843 73.5 273.547 66.0512 272.474 54.729H280.34C281.532 62.5354 287.55 67.0047 296.847 67.0047C306.143 67.0047 312.28 62.6546 312.28 56.1592C312.28 50.7961 309.241 47.8166 300.899 45.7905L291.603 43.5857C279.804 40.8445 274.262 35.6601 274.262 27.0791Z",
|
|
9508
|
-
fill: "#
|
|
9546
|
+
fill: "#0B0B0B"
|
|
9509
9547
|
}
|
|
9510
9548
|
),
|
|
9511
9549
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9512
9550
|
"path",
|
|
9513
9551
|
{
|
|
9514
9552
|
d: "M238.713 66.7067C249.558 66.7067 258.079 59.0196 258.079 49.1871V42.3343L239.726 43.5857C229.953 44.2412 224.53 48.4721 224.53 55.325C224.53 62.0587 230.31 66.7067 238.713 66.7067ZM237.104 73.5C224.888 73.5 216.545 66.1704 216.545 55.325C216.545 44.7179 224.47 38.2821 238.772 37.3287L258.079 36.1369V30.7737C258.079 21.8352 252.418 16.4721 242.765 16.4721C233.647 16.4721 227.807 20.9413 226.437 28.4497H218.809C219.703 17.3659 228.821 9.5 242.943 9.5C257.066 9.5 265.945 17.4255 265.945 30.0587V72.487H258.437V60.6881H258.258C254.802 68.3752 246.34 73.5 237.104 73.5Z",
|
|
9515
|
-
fill: "#
|
|
9553
|
+
fill: "#0B0B0B"
|
|
9516
9554
|
}
|
|
9517
9555
|
),
|
|
9518
9556
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9519
9557
|
"path",
|
|
9520
9558
|
{
|
|
9521
9559
|
d: "M181.949 66.7067C192.794 66.7067 201.316 59.0196 201.316 49.1871V42.3343L182.962 43.5857C173.189 44.2412 167.766 48.4721 167.766 55.325C167.766 62.0587 173.547 66.7067 181.949 66.7067ZM180.34 73.5C168.124 73.5 159.781 66.1704 159.781 55.325C159.781 44.7179 167.707 38.2821 182.008 37.3287L201.316 36.1369V30.7737C201.316 21.8352 195.655 16.4721 186.001 16.4721C176.884 16.4721 171.044 20.9413 169.673 28.4497H162.046C162.94 17.3659 172.057 9.5 186.18 9.5C200.303 9.5 209.182 17.4255 209.182 30.0587V72.487H201.673V60.6881H201.494C198.038 68.3752 189.576 73.5 180.34 73.5Z",
|
|
9522
|
-
fill: "#
|
|
9560
|
+
fill: "#0B0B0B"
|
|
9523
9561
|
}
|
|
9524
9562
|
),
|
|
9525
9563
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9526
9564
|
"path",
|
|
9527
9565
|
{
|
|
9528
9566
|
d: "M109.096 27.0791C109.096 16.8296 118.214 9.5 131.145 9.5C144.374 9.5 153.193 17.1872 153.908 28.4497H146.34C145.327 20.703 139.726 15.9953 131.145 15.9953C122.683 15.9953 116.903 20.4646 116.903 26.662C116.903 31.7272 120.418 34.8855 128.642 36.852L137.998 39.0568C150.392 42.0363 155.04 46.8035 155.04 55.5633C155.04 66.0512 145.208 73.5 131.681 73.5C117.677 73.5 108.381 66.0512 107.309 54.729H115.175C116.366 62.5354 122.385 67.0047 131.681 67.0047C140.977 67.0047 147.115 62.6546 147.115 56.1592C147.115 50.7961 144.076 47.8166 135.733 45.7905L126.437 43.5857C114.638 40.8445 109.096 35.6601 109.096 27.0791Z",
|
|
9529
|
-
fill: "#
|
|
9567
|
+
fill: "#0B0B0B"
|
|
9530
9568
|
}
|
|
9531
9569
|
)
|
|
9532
9570
|
]
|
|
@@ -9826,6 +9864,204 @@ function ImageIcon() {
|
|
|
9826
9864
|
);
|
|
9827
9865
|
}
|
|
9828
9866
|
|
|
9867
|
+
// src/lib/widget-scale.ts
|
|
9868
|
+
var WIDGET_MOBILE_BREAKPOINT_PX = 640;
|
|
9869
|
+
var LAUNCHER_BUTTON_BASE_PX = 60;
|
|
9870
|
+
var SCALE_BASELINE_PX = 360;
|
|
9871
|
+
var MAX_VIEWPORT_SCALE = 1.25;
|
|
9872
|
+
var MAX_ZOOM_SCALE = 3;
|
|
9873
|
+
var ZOOM_TOLERANCE = 1.05;
|
|
9874
|
+
function widgetScaleMetrics(viewport, device) {
|
|
9875
|
+
const width = Number.isFinite(viewport.width) ? viewport.width : 0;
|
|
9876
|
+
if (width <= 0) {
|
|
9877
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9878
|
+
}
|
|
9879
|
+
const zoom = zoomOutFactor(viewport, device);
|
|
9880
|
+
const effectiveWidth = width / zoom;
|
|
9881
|
+
const isMobile = effectiveWidth <= WIDGET_MOBILE_BREAKPOINT_PX;
|
|
9882
|
+
const viewportScale = isMobile ? clamp2(effectiveWidth / SCALE_BASELINE_PX, 1, MAX_VIEWPORT_SCALE) : 1;
|
|
9883
|
+
return { effectiveWidth, isMobile, scale: viewportScale * zoom };
|
|
9884
|
+
}
|
|
9885
|
+
function readWidgetScaleMetrics(viewport) {
|
|
9886
|
+
if (typeof window === "undefined") {
|
|
9887
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9888
|
+
}
|
|
9889
|
+
return widgetScaleMetrics(viewport ?? hostLayoutViewport(), readDevice());
|
|
9890
|
+
}
|
|
9891
|
+
function hostLayoutViewport() {
|
|
9892
|
+
const root = document.documentElement;
|
|
9893
|
+
return {
|
|
9894
|
+
height: root?.clientHeight || window.innerHeight,
|
|
9895
|
+
width: root?.clientWidth || window.innerWidth
|
|
9896
|
+
};
|
|
9897
|
+
}
|
|
9898
|
+
function scaledPx(basePx, scale2) {
|
|
9899
|
+
return Math.round(basePx * scale2);
|
|
9900
|
+
}
|
|
9901
|
+
function launcherButtonPx(scale2) {
|
|
9902
|
+
return scaledPx(LAUNCHER_BUTTON_BASE_PX, scale2);
|
|
9903
|
+
}
|
|
9904
|
+
function zoomOutFactor(viewport, device) {
|
|
9905
|
+
if (!device.touch) {
|
|
9906
|
+
return 1;
|
|
9907
|
+
}
|
|
9908
|
+
const deviceWidth = orientedDeviceWidth(viewport, device);
|
|
9909
|
+
if (deviceWidth <= 0 || viewport.width <= deviceWidth * ZOOM_TOLERANCE) {
|
|
9910
|
+
return 1;
|
|
9911
|
+
}
|
|
9912
|
+
return Math.min(viewport.width / deviceWidth, MAX_ZOOM_SCALE);
|
|
9913
|
+
}
|
|
9914
|
+
function orientedDeviceWidth(viewport, device) {
|
|
9915
|
+
const shortSide = Math.min(device.screenWidth, device.screenHeight);
|
|
9916
|
+
const longSide = Math.max(device.screenWidth, device.screenHeight);
|
|
9917
|
+
const portrait = viewport.height > 0 && viewport.height >= viewport.width;
|
|
9918
|
+
return portrait ? shortSide : longSide;
|
|
9919
|
+
}
|
|
9920
|
+
function readDevice() {
|
|
9921
|
+
return {
|
|
9922
|
+
screenHeight: window.screen?.height ?? 0,
|
|
9923
|
+
screenWidth: window.screen?.width ?? 0,
|
|
9924
|
+
touch: window.matchMedia?.("(pointer: coarse)").matches === true
|
|
9925
|
+
};
|
|
9926
|
+
}
|
|
9927
|
+
function clamp2(value, min, max) {
|
|
9928
|
+
return Math.min(Math.max(value, min), max);
|
|
9929
|
+
}
|
|
9930
|
+
|
|
9931
|
+
// src/lib/support/widget-constants.ts
|
|
9932
|
+
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
9933
|
+
var POLL_INTERVAL_MS = 5e3;
|
|
9934
|
+
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
9935
|
+
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
9936
|
+
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
9937
|
+
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
9938
|
+
var BOUNCE_SETTLE_MS = 400;
|
|
9939
|
+
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
9940
|
+
var PANEL_WIDTH_PX = 384;
|
|
9941
|
+
var PANEL_MAX_HEIGHT_PX = 680;
|
|
9942
|
+
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
9943
|
+
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
9944
|
+
var ROOT_PADDING_PX = 16;
|
|
9945
|
+
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9946
|
+
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9947
|
+
function closedFrameSizePx(scale2) {
|
|
9948
|
+
return launcherButtonPx(scale2) + ROOT_HORIZONTAL_PADDING_PX;
|
|
9949
|
+
}
|
|
9950
|
+
var LAUNCHER_ICON_BASE_PX = 25;
|
|
9951
|
+
var ROOT_STACK_GAP_PX = 12;
|
|
9952
|
+
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
9953
|
+
var DEFAULT_BRANDING = {
|
|
9954
|
+
agentLabel: "AI Agent",
|
|
9955
|
+
greeting: "Ask us anything, or share your feedback.",
|
|
9956
|
+
replyTime: "a few hours",
|
|
9957
|
+
teamDescription: "The team can also help",
|
|
9958
|
+
workspaceName: "Support"
|
|
9959
|
+
};
|
|
9960
|
+
var DEFAULT_SUGGESTIONS = [];
|
|
9961
|
+
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
9962
|
+
var SLIDE_TRANSITION = {
|
|
9963
|
+
duration: 0.28,
|
|
9964
|
+
ease: [0.32, 0.72, 0, 1]
|
|
9965
|
+
};
|
|
9966
|
+
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
9967
|
+
var LAUNCHER_ICON_TRANSITION = {
|
|
9968
|
+
type: "spring",
|
|
9969
|
+
stiffness: 420,
|
|
9970
|
+
damping: 30,
|
|
9971
|
+
mass: 0.85
|
|
9972
|
+
};
|
|
9973
|
+
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
9974
|
+
var LAUNCHER_BUTTON_TRANSITION = {
|
|
9975
|
+
type: "spring",
|
|
9976
|
+
stiffness: 520,
|
|
9977
|
+
damping: 28,
|
|
9978
|
+
mass: 0.7
|
|
9979
|
+
};
|
|
9980
|
+
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
9981
|
+
var LAUNCHER_TAP_SCALE = 0.9;
|
|
9982
|
+
var PANEL_SPRING = {
|
|
9983
|
+
type: "spring",
|
|
9984
|
+
stiffness: 380,
|
|
9985
|
+
damping: 32,
|
|
9986
|
+
mass: 0.85,
|
|
9987
|
+
opacity: { duration: 0.22, ease: "easeOut" }
|
|
9988
|
+
};
|
|
9989
|
+
var SCROLL_BOTTOM_TRANSITION = {
|
|
9990
|
+
duration: 0.38,
|
|
9991
|
+
ease: [0.32, 0.72, 0, 1],
|
|
9992
|
+
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
9993
|
+
};
|
|
9994
|
+
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
9995
|
+
var PANEL_CLOSED_SCALE = 0.94;
|
|
9996
|
+
var viewVariants = {
|
|
9997
|
+
center: (t) => ({
|
|
9998
|
+
opacity: 1,
|
|
9999
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
10000
|
+
x: 0
|
|
10001
|
+
}),
|
|
10002
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
10003
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10004
|
+
opacity: 1,
|
|
10005
|
+
transition: SLIDE_TRANSITION,
|
|
10006
|
+
x: t.direction > 0 ? "-100%" : "100%"
|
|
10007
|
+
}
|
|
10008
|
+
};
|
|
10009
|
+
var COMPOSER_FADE_TRANSITION = {
|
|
10010
|
+
duration: 0.2,
|
|
10011
|
+
ease: "easeOut"
|
|
10012
|
+
};
|
|
10013
|
+
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
10014
|
+
duration: 0.22,
|
|
10015
|
+
ease: "easeOut"
|
|
10016
|
+
};
|
|
10017
|
+
var composerVariants = {
|
|
10018
|
+
center: (t) => ({
|
|
10019
|
+
opacity: 1,
|
|
10020
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
10021
|
+
x: 0
|
|
10022
|
+
}),
|
|
10023
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
10024
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10025
|
+
opacity: 0,
|
|
10026
|
+
transition: {
|
|
10027
|
+
...SLIDE_TRANSITION,
|
|
10028
|
+
opacity: COMPOSER_FADE_TRANSITION
|
|
10029
|
+
},
|
|
10030
|
+
x: t.direction > 0 ? "100%" : "-100%"
|
|
10031
|
+
}
|
|
10032
|
+
};
|
|
10033
|
+
|
|
10034
|
+
// src/lib/support/resolveSubmitEmailGate.ts
|
|
10035
|
+
var EMAIL_GATE_ERROR = "Enter a valid email so we can reply to you.";
|
|
10036
|
+
function resolveEmailDraftError(emailDraft) {
|
|
10037
|
+
return EMAIL_PATTERN.test(emailDraft.trim()) ? null : EMAIL_GATE_ERROR;
|
|
10038
|
+
}
|
|
10039
|
+
function resolveSubmitEmailGate({
|
|
10040
|
+
emailDraft,
|
|
10041
|
+
isNewConversation,
|
|
10042
|
+
knownEmail
|
|
10043
|
+
}) {
|
|
10044
|
+
if (!isNewConversation || knownEmail) {
|
|
10045
|
+
return {
|
|
10046
|
+
emailForSend: knownEmail ?? void 0,
|
|
10047
|
+
ok: true,
|
|
10048
|
+
optimisticallyCapturedEmail: null
|
|
10049
|
+
};
|
|
10050
|
+
}
|
|
10051
|
+
const candidate = emailDraft.trim();
|
|
10052
|
+
if (!EMAIL_PATTERN.test(candidate)) {
|
|
10053
|
+
return {
|
|
10054
|
+
error: EMAIL_GATE_ERROR,
|
|
10055
|
+
ok: false
|
|
10056
|
+
};
|
|
10057
|
+
}
|
|
10058
|
+
return {
|
|
10059
|
+
emailForSend: candidate,
|
|
10060
|
+
ok: true,
|
|
10061
|
+
optimisticallyCapturedEmail: candidate
|
|
10062
|
+
};
|
|
10063
|
+
}
|
|
10064
|
+
|
|
9829
10065
|
// src/lib/support/types.ts
|
|
9830
10066
|
var MAX_MESSAGE_LENGTH = 5e3;
|
|
9831
10067
|
var MAX_CONVERSATION_IMAGE_ATTACHMENTS = 5;
|
|
@@ -13194,10 +13430,12 @@ var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
|
13194
13430
|
function Composer({
|
|
13195
13431
|
draft,
|
|
13196
13432
|
emailDraft,
|
|
13433
|
+
emailError,
|
|
13197
13434
|
imageInputRef,
|
|
13198
13435
|
isLoading,
|
|
13199
13436
|
needsEmail,
|
|
13200
13437
|
onDraftChange,
|
|
13438
|
+
onEmailBlur,
|
|
13201
13439
|
onEmailChange,
|
|
13202
13440
|
onImageSelection,
|
|
13203
13441
|
onRemovePendingImage,
|
|
@@ -13208,7 +13446,8 @@ function Composer({
|
|
|
13208
13446
|
sendError,
|
|
13209
13447
|
textareaRef
|
|
13210
13448
|
}) {
|
|
13211
|
-
const
|
|
13449
|
+
const emailReady = !needsEmail || resolveEmailDraftError(emailDraft) === null;
|
|
13450
|
+
const canSend = (draft.trim().length > 0 || pendingImages.length > 0) && emailReady;
|
|
13212
13451
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13213
13452
|
"form",
|
|
13214
13453
|
{
|
|
@@ -13216,21 +13455,29 @@ function Composer({
|
|
|
13216
13455
|
onSubmit,
|
|
13217
13456
|
children: [
|
|
13218
13457
|
sendError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mb-2 text-xs text-red-600", children: sendError }),
|
|
13219
|
-
needsEmail && /* @__PURE__ */ (0, import_jsx_runtime9.
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13458
|
+
needsEmail && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2", children: [
|
|
13459
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13460
|
+
"input",
|
|
13461
|
+
{
|
|
13462
|
+
"aria-invalid": emailError ? true : void 0,
|
|
13463
|
+
"aria-label": "Your email",
|
|
13464
|
+
className: cn(
|
|
13465
|
+
"w-full rounded-[var(--scw-composer-radius,24px)] border border-solid bg-white px-[11px] py-[9px] font-[inherit] text-sm text-neutral-950 placeholder:text-neutral-400 focus:outline-none",
|
|
13466
|
+
emailError ? "border-red-400 focus:border-red-500" : "border-border focus:border-[color:var(--scw-hairline-strong)]"
|
|
13467
|
+
),
|
|
13468
|
+
onBlur: onEmailBlur,
|
|
13469
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
13470
|
+
placeholder: "Your email address",
|
|
13471
|
+
type: "email",
|
|
13472
|
+
value: emailDraft
|
|
13473
|
+
}
|
|
13474
|
+
),
|
|
13475
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mt-1.5 px-1 text-xs text-red-600", children: emailError })
|
|
13476
|
+
] }),
|
|
13230
13477
|
pendingImages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mb-2 flex flex-wrap gap-2", children: pendingImages.map((file, index2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13231
13478
|
Attachment,
|
|
13232
13479
|
{
|
|
13233
|
-
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-
|
|
13480
|
+
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-border p-0",
|
|
13234
13481
|
orientation: "vertical",
|
|
13235
13482
|
state: "done",
|
|
13236
13483
|
children: [
|
|
@@ -13256,7 +13503,7 @@ function Composer({
|
|
|
13256
13503
|
},
|
|
13257
13504
|
`${file.name}-${index2}`
|
|
13258
13505
|
)) }),
|
|
13259
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-
|
|
13506
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-border bg-white px-3.5 py-3 transition-[border-color,box-shadow] duration-[250ms] ease-in-out focus-within:border-neutral-900 focus-within:shadow-[0_0_0_1px_var(--scw-ink)]", children: [
|
|
13260
13507
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13261
13508
|
"textarea",
|
|
13262
13509
|
{
|
|
@@ -13325,67 +13572,16 @@ function focusComposer(textareaRef) {
|
|
|
13325
13572
|
});
|
|
13326
13573
|
}
|
|
13327
13574
|
|
|
13328
|
-
// src/lib/
|
|
13575
|
+
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13576
|
+
var import_ai2 = require("ai");
|
|
13577
|
+
|
|
13578
|
+
// ../../chat/client/src/lib/core/toolParts.ts
|
|
13329
13579
|
var import_ai = require("ai");
|
|
13330
|
-
function
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
continue;
|
|
13334
|
-
}
|
|
13335
|
-
if (part.state !== "output-available") {
|
|
13336
|
-
continue;
|
|
13337
|
-
}
|
|
13338
|
-
const output = part.output;
|
|
13339
|
-
if (output?.offerHandoff && !output.declined) {
|
|
13340
|
-
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
13341
|
-
}
|
|
13580
|
+
function isLiveToolPart(part) {
|
|
13581
|
+
if (!(0, import_ai.isToolUIPart)(part)) {
|
|
13582
|
+
return false;
|
|
13342
13583
|
}
|
|
13343
|
-
return
|
|
13344
|
-
}
|
|
13345
|
-
function markHandoffDeclinedInMessages(messages, toolCallId) {
|
|
13346
|
-
let changed = false;
|
|
13347
|
-
const next = messages.map((message) => {
|
|
13348
|
-
if (message.role !== "assistant") {
|
|
13349
|
-
return message;
|
|
13350
|
-
}
|
|
13351
|
-
let messageChanged = false;
|
|
13352
|
-
const parts = (message.parts ?? []).map((part) => {
|
|
13353
|
-
if (!(0, import_ai.isToolUIPart)(part) || (0, import_ai.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
13354
|
-
return part;
|
|
13355
|
-
}
|
|
13356
|
-
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
13357
|
-
return part;
|
|
13358
|
-
}
|
|
13359
|
-
const output = part.output;
|
|
13360
|
-
if (output?.declined) {
|
|
13361
|
-
return part;
|
|
13362
|
-
}
|
|
13363
|
-
messageChanged = true;
|
|
13364
|
-
changed = true;
|
|
13365
|
-
return {
|
|
13366
|
-
...part,
|
|
13367
|
-
output: {
|
|
13368
|
-
...output,
|
|
13369
|
-
declined: true,
|
|
13370
|
-
offerHandoff: false
|
|
13371
|
-
}
|
|
13372
|
-
};
|
|
13373
|
-
});
|
|
13374
|
-
return messageChanged ? { ...message, parts } : message;
|
|
13375
|
-
});
|
|
13376
|
-
return changed ? next : messages;
|
|
13377
|
-
}
|
|
13378
|
-
|
|
13379
|
-
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13380
|
-
var import_ai3 = require("ai");
|
|
13381
|
-
|
|
13382
|
-
// ../../chat/client/src/lib/core/toolParts.ts
|
|
13383
|
-
var import_ai2 = require("ai");
|
|
13384
|
-
function isLiveToolPart(part) {
|
|
13385
|
-
if (!(0, import_ai2.isToolUIPart)(part)) {
|
|
13386
|
-
return false;
|
|
13387
|
-
}
|
|
13388
|
-
return part.state !== "output-available" && part.state !== "output-error";
|
|
13584
|
+
return part.state !== "output-available" && part.state !== "output-error";
|
|
13389
13585
|
}
|
|
13390
13586
|
function messageHasLiveTools(message) {
|
|
13391
13587
|
if (message.role !== "assistant") {
|
|
@@ -13394,13 +13590,13 @@ function messageHasLiveTools(message) {
|
|
|
13394
13590
|
return (message.parts ?? []).some(isLiveToolPart);
|
|
13395
13591
|
}
|
|
13396
13592
|
function toolPartToView(part) {
|
|
13397
|
-
if (!(0,
|
|
13593
|
+
if (!(0, import_ai.isToolUIPart)(part)) {
|
|
13398
13594
|
return null;
|
|
13399
13595
|
}
|
|
13400
13596
|
const view = {
|
|
13401
13597
|
state: part.state,
|
|
13402
13598
|
toolCallId: part.toolCallId,
|
|
13403
|
-
toolName: (0,
|
|
13599
|
+
toolName: (0, import_ai.getToolName)(part)
|
|
13404
13600
|
};
|
|
13405
13601
|
if (part.state === "approval-requested" && "approval" in part) {
|
|
13406
13602
|
view.approvalId = part.approval.id;
|
|
@@ -13427,7 +13623,7 @@ function buildMessageBlocks(message) {
|
|
|
13427
13623
|
textBuffer = "";
|
|
13428
13624
|
};
|
|
13429
13625
|
for (const part of message.parts) {
|
|
13430
|
-
if ((0,
|
|
13626
|
+
if ((0, import_ai2.isTextUIPart)(part)) {
|
|
13431
13627
|
textBuffer += part.text;
|
|
13432
13628
|
continue;
|
|
13433
13629
|
}
|
|
@@ -13447,110 +13643,7 @@ function buildMessageBlocks(message) {
|
|
|
13447
13643
|
}
|
|
13448
13644
|
|
|
13449
13645
|
// src/lib/support/message-utils.ts
|
|
13450
|
-
var
|
|
13451
|
-
|
|
13452
|
-
// src/lib/support/widget-constants.ts
|
|
13453
|
-
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
13454
|
-
var POLL_INTERVAL_MS = 5e3;
|
|
13455
|
-
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
13456
|
-
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
13457
|
-
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
13458
|
-
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
13459
|
-
var BOUNCE_SETTLE_MS = 400;
|
|
13460
|
-
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
13461
|
-
var PANEL_WIDTH_PX = 384;
|
|
13462
|
-
var PANEL_MAX_HEIGHT_PX = 680;
|
|
13463
|
-
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
13464
|
-
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
13465
|
-
var MOBILE_BREAKPOINT_PX = 640;
|
|
13466
|
-
var ROOT_PADDING_PX = 16;
|
|
13467
|
-
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13468
|
-
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13469
|
-
var LAUNCHER_SIZE_PX = 60;
|
|
13470
|
-
var CLOSED_FRAME_SIZE_PX = LAUNCHER_SIZE_PX + ROOT_HORIZONTAL_PADDING_PX;
|
|
13471
|
-
var ROOT_STACK_GAP_PX = 12;
|
|
13472
|
-
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
13473
|
-
var DEFAULT_BRANDING = {
|
|
13474
|
-
agentLabel: "AI Agent",
|
|
13475
|
-
greeting: "Ask us anything, or share your feedback.",
|
|
13476
|
-
replyTime: "a few hours",
|
|
13477
|
-
teamDescription: "The team can also help",
|
|
13478
|
-
workspaceName: "Support"
|
|
13479
|
-
};
|
|
13480
|
-
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
13481
|
-
var SLIDE_TRANSITION = {
|
|
13482
|
-
duration: 0.28,
|
|
13483
|
-
ease: [0.32, 0.72, 0, 1]
|
|
13484
|
-
};
|
|
13485
|
-
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
13486
|
-
var LAUNCHER_ICON_TRANSITION = {
|
|
13487
|
-
type: "spring",
|
|
13488
|
-
stiffness: 420,
|
|
13489
|
-
damping: 30,
|
|
13490
|
-
mass: 0.85
|
|
13491
|
-
};
|
|
13492
|
-
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
13493
|
-
var LAUNCHER_BUTTON_TRANSITION = {
|
|
13494
|
-
type: "spring",
|
|
13495
|
-
stiffness: 520,
|
|
13496
|
-
damping: 28,
|
|
13497
|
-
mass: 0.7
|
|
13498
|
-
};
|
|
13499
|
-
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
13500
|
-
var LAUNCHER_TAP_SCALE = 0.9;
|
|
13501
|
-
var PANEL_SPRING = {
|
|
13502
|
-
type: "spring",
|
|
13503
|
-
stiffness: 380,
|
|
13504
|
-
damping: 32,
|
|
13505
|
-
mass: 0.85,
|
|
13506
|
-
opacity: { duration: 0.22, ease: "easeOut" }
|
|
13507
|
-
};
|
|
13508
|
-
var SCROLL_BOTTOM_TRANSITION = {
|
|
13509
|
-
duration: 0.38,
|
|
13510
|
-
ease: [0.32, 0.72, 0, 1],
|
|
13511
|
-
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
13512
|
-
};
|
|
13513
|
-
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
13514
|
-
var PANEL_CLOSED_SCALE = 0.94;
|
|
13515
|
-
var viewVariants = {
|
|
13516
|
-
center: (t) => ({
|
|
13517
|
-
opacity: 1,
|
|
13518
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
13519
|
-
x: 0
|
|
13520
|
-
}),
|
|
13521
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
13522
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13523
|
-
opacity: 1,
|
|
13524
|
-
transition: SLIDE_TRANSITION,
|
|
13525
|
-
x: t.direction > 0 ? "-100%" : "100%"
|
|
13526
|
-
}
|
|
13527
|
-
};
|
|
13528
|
-
var COMPOSER_FADE_TRANSITION = {
|
|
13529
|
-
duration: 0.2,
|
|
13530
|
-
ease: "easeOut"
|
|
13531
|
-
};
|
|
13532
|
-
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
13533
|
-
duration: 0.22,
|
|
13534
|
-
ease: "easeOut"
|
|
13535
|
-
};
|
|
13536
|
-
var composerVariants = {
|
|
13537
|
-
center: (t) => ({
|
|
13538
|
-
opacity: 1,
|
|
13539
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
13540
|
-
x: 0
|
|
13541
|
-
}),
|
|
13542
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
13543
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13544
|
-
opacity: 0,
|
|
13545
|
-
transition: {
|
|
13546
|
-
...SLIDE_TRANSITION,
|
|
13547
|
-
opacity: COMPOSER_FADE_TRANSITION
|
|
13548
|
-
},
|
|
13549
|
-
x: t.direction > 0 ? "100%" : "-100%"
|
|
13550
|
-
}
|
|
13551
|
-
};
|
|
13552
|
-
|
|
13553
|
-
// src/lib/support/message-utils.ts
|
|
13646
|
+
var import_ai3 = require("ai");
|
|
13554
13647
|
function isAttachmentOnlyPlainBody(text) {
|
|
13555
13648
|
const trimmed = text.trim();
|
|
13556
13649
|
if (trimmed === "[Image]") {
|
|
@@ -13594,7 +13687,7 @@ function createLocalUserMessage({
|
|
|
13594
13687
|
}
|
|
13595
13688
|
function readMessageAttachmentUrls(message) {
|
|
13596
13689
|
const { metadata } = message;
|
|
13597
|
-
if (!
|
|
13690
|
+
if (!isRecord(metadata) || !("attachmentUrls" in metadata)) {
|
|
13598
13691
|
return [];
|
|
13599
13692
|
}
|
|
13600
13693
|
const value = metadata.attachmentUrls;
|
|
@@ -13603,9 +13696,6 @@ function readMessageAttachmentUrls(message) {
|
|
|
13603
13696
|
}
|
|
13604
13697
|
return value.filter((entry) => typeof entry === "string");
|
|
13605
13698
|
}
|
|
13606
|
-
function isRecord2(value) {
|
|
13607
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13608
|
-
}
|
|
13609
13699
|
async function fileToBase64(file) {
|
|
13610
13700
|
const buffer = await file.arrayBuffer();
|
|
13611
13701
|
const bytes = new Uint8Array(buffer);
|
|
@@ -13629,7 +13719,7 @@ function isAssistantMessageReadyToChime(messages, message, isLoading) {
|
|
|
13629
13719
|
return false;
|
|
13630
13720
|
}
|
|
13631
13721
|
const isLastMessage = messages.at(-1)?.id === message.id;
|
|
13632
|
-
if (isLastMessage && (0,
|
|
13722
|
+
if (isLastMessage && (0, import_ai3.lastAssistantMessageIsCompleteWithToolCalls)({ messages })) {
|
|
13633
13723
|
return false;
|
|
13634
13724
|
}
|
|
13635
13725
|
return true;
|
|
@@ -13870,28 +13960,6 @@ function coerceToolArgs(args) {
|
|
|
13870
13960
|
}
|
|
13871
13961
|
return {};
|
|
13872
13962
|
}
|
|
13873
|
-
function buildToolContext({
|
|
13874
|
-
identity: identity2,
|
|
13875
|
-
stateSnapshot: stateSnapshot2
|
|
13876
|
-
}) {
|
|
13877
|
-
const context = {};
|
|
13878
|
-
if (stateSnapshot2 && typeof stateSnapshot2 === "object" && !Array.isArray(stateSnapshot2)) {
|
|
13879
|
-
for (const [key, value] of Object.entries(
|
|
13880
|
-
stateSnapshot2
|
|
13881
|
-
)) {
|
|
13882
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
13883
|
-
context[key] = value;
|
|
13884
|
-
}
|
|
13885
|
-
}
|
|
13886
|
-
}
|
|
13887
|
-
if (identity2?.distinctId) {
|
|
13888
|
-
context.distinctId = identity2.distinctId;
|
|
13889
|
-
}
|
|
13890
|
-
if (identity2?.email) {
|
|
13891
|
-
context.email = identity2.email;
|
|
13892
|
-
}
|
|
13893
|
-
return context;
|
|
13894
|
-
}
|
|
13895
13963
|
|
|
13896
13964
|
// src/lib/support/reconstructDashboardTool.ts
|
|
13897
13965
|
function reconstructDashboardTool(def) {
|
|
@@ -13945,7 +14013,7 @@ function reconstructDashboardTool(def) {
|
|
|
13945
14013
|
|
|
13946
14014
|
// src/lib/support/generated/widget-css.ts
|
|
13947
14015
|
var GENERATED_WIDGET_CSS = `/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
13948
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--scroll-fade-t:0px;--scroll-fade-b:0px;--scroll-fade-s:0px;--scroll-fade-e:0px;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-blue-600:oklch(54.6% .245 262.881);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:calc(var(--radius) - 2px);--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-s-1{inset-inline-start:var(--spacing)}.inset-s-1\\/2{inset-inline-start:50%}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+8px\\)\\]{top:calc(100% + 8px)}.top-\\[var\\(--scw-header-padding\\)\\]{top:var(--scw-header-padding)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[var\\(--scw-header-padding\\)\\]{right:var(--scw-header-padding)}.bottom-0{bottom:0}.bottom-\\[calc\\(var\\(--scw-send-pill-gap\\)\\+var\\(--scw-nav-height\\)\\)\\]{bottom:calc(var(--scw-send-pill-gap) + var(--scw-nav-height))}.bottom-full{bottom:100%}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[5\\]{z-index:5}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-6{margin-block:calc(var(--spacing) * 6)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-\\[-16px\\]{margin-top:-16px}.mb-0{margin-bottom:0}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-\\[0\\.25em\\]{margin-left:.25em}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[1\\.45em\\]{width:1.45em;height:1.45em}.size-\\[18px\\]{width:18px;height:18px}.size-\\[25px\\]{width:25px;height:25px}.size-\\[60px\\]{width:60px;height:60px}.size-\\[var\\(--scw-header-btn-size\\)\\]{width:var(--scw-header-btn-size);height:var(--scw-header-btn-size)}.size-full{width:100%;height:100%}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\\[13px\\]{height:13px}.h-\\[var\\(--scw-panel-height\\,600px\\)\\]{height:var(--scw-panel-height,600px)}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[22px\\]{min-height:22px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[calc\\(var\\(--scw-header-padding\\)\\*2\\+var\\(--scw-header-btn-size\\)\\)\\]{min-height:calc(var(--scw-header-padding) * 2 + var(--scw-header-btn-size))}.min-h-full{min-height:100%}.w-10{width:calc(var(--spacing) * 10)}.w-24{width:calc(var(--spacing) * 24)}.w-\\[var\\(--scw-panel-width\\,384px\\)\\]{width:var(--scw-panel-width,384px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[82\\%\\]{max-width:82%}.max-w-\\[88\\%\\]{max-width:88%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[min\\(240px\\,var\\(--scw-host-viewport-width\\,100vw\\)\\)\\]{max-width:min(240px, var(--scw-host-viewport-width,100vw))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-\\[1\\.45em\\]{min-width:1.45em}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3{--tw-translate-y:calc(var(--spacing) * -3);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3\\/4{--tw-translate-y:calc(calc(3 / 4 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3{--tw-translate-y:calc(var(--spacing) * 3);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3\\/4{--tw-translate-y:calc(3 / 4 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.shimmer{--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.shimmer{background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.shimmer{background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.shimmer{--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.shimmer:where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.scroll-fade-x{--_scroll-fade-size-s:var(--scroll-fade-s-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-e:var(--scroll-fade-e-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-inline:linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x:where([dir=rtl],[dir=rtl] *){--scroll-fade-inline:linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x{-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-x{animation:1ms ease-in-out scroll-fade-reveal-s,1ms ease-in-out scroll-fade-reveal-e;animation-timeline:scroll(self inline),scroll(self inline);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-x{--scroll-fade-s:var(--_scroll-fade-size-s);--scroll-fade-e:var(--_scroll-fade-size-e)}}.scroll-fade{--_scroll-fade-size-t:var(--scroll-fade-t-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-block:linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t,0px), #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade{animation:1ms ease-in-out scroll-fade-reveal-t,1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y),scroll(self y);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade{--scroll-fade-t:var(--_scroll-fade-size-t);--scroll-fade-b:var(--_scroll-fade-size-b)}}.scroll-fade-b{--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-mask:linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);mask-image:var(--scroll-fade-mask);-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-b{animation:1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y);animation-range:calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-b{--scroll-fade-b:var(--_scroll-fade-size-b)}}.animate-\\[scw-spin_\\.7s_linear_infinite\\]{animation:.7s linear infinite scw-spin}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.scroll-px-1{scroll-padding-inline:var(--spacing)}.\\[scrollbar-width\\:none\\],.scrollbar-none{scrollbar-width:none}.scrollbar-thin{scrollbar-width:thin}.\\[scrollbar-gutter\\:auto\\]{scrollbar-gutter:auto}.scrollbar-gutter-stable{scrollbar-gutter:stable}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-\\[var\\(--scw-composer-radius\\,24px\\)\\]{border-radius:var(--scw-composer-radius,24px)}.rounded-\\[var\\(--scw-header-btn-concentric\\)\\]{border-radius:var(--scw-header-btn-concentric)}.rounded-\\[var\\(--scw-panel-radius\\)\\]{border-radius:var(--scw-panel-radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#ececec\\]{border-color:#ececec}.border-\\[\\#f0f0f0\\]{border-color:#f0f0f0}.border-border{border-color:var(--border)}.border-neutral-200{border-color:var(--color-neutral-200)}.border-neutral-300{border-color:var(--color-neutral-300)}.border-neutral-900{border-color:var(--color-neutral-900)}.border-transparent{border-color:#0000}.border-t-neutral-500{border-top-color:var(--color-neutral-500)}.bg-\\[\\#eff6ff\\]{background-color:#eff6ff}.bg-\\[\\#f1f1f3\\]{background-color:#f1f1f3}.bg-\\[rgba\\(10\\,10\\,10\\,\\.72\\)\\]{background-color:#0a0a0ab8}.bg-amber-500{background-color:var(--color-amber-500)}.bg-background{background-color:var(--background)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-200{background-color:var(--color-neutral-200)}.bg-neutral-400{background-color:var(--color-neutral-400)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-\\[var\\(--scw-header-padding\\)\\]{padding:var(--scw-header-padding)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[11px\\]{padding-inline:11px}.px-\\[13px\\]{padding-inline:13px}.px-\\[18px\\]{padding-inline:18px}.px-\\[var\\(--scw-composer-inset\\)\\]{padding-inline:var(--scw-composer-inset)}.px-\\[var\\(--scw-message-inset-x\\,16px\\)\\]{padding-inline:var(--scw-message-inset-x,16px)}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-\\[9px\\]{padding-block:9px}.py-\\[11px\\]{padding-block:11px}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-11{padding-bottom:calc(var(--spacing) * 11)}.pb-\\[calc\\(8px\\+var\\(--scw-nav-height\\)\\+var\\(--scw-send-pill-gap\\)\\+var\\(--scw-send-pill-height\\)\\)\\]{padding-bottom:calc(8px + var(--scw-nav-height) + var(--scw-send-pill-gap) + var(--scw-send-pill-height))}.pb-\\[calc\\(24px\\+var\\(--scw-nav-height\\)\\)\\]{padding-bottom:calc(24px + var(--scw-nav-height))}.pb-\\[var\\(--scw-composer-inset\\)\\]{padding-bottom:var(--scw-composer-inset)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.text-left{text-align:left}.align-baseline{vertical-align:baseline}.\\[font-family\\:var\\(--scw-font\\)\\]{font-family:var(--scw-font)}.font-\\[inherit\\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.78em\\]{font-size:.78em}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.leading-\\[1\\.3\\]{--tw-leading:1.3;line-height:1.3}.leading-\\[1\\.4\\]{--tw-leading:1.4;line-height:1.4}.leading-\\[1\\.35\\]{--tw-leading:1.35;line-height:1.35}.leading-\\[1\\.45\\]{--tw-leading:1.45;line-height:1.45}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.break-words,.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[\\#a3a3a3\\]{color:#a3a3a3}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-neutral-400{color:var(--color-neutral-400)}.text-neutral-500{color:var(--color-neutral-500)}.text-neutral-600{color:var(--color-neutral-600)}.text-neutral-700{color:var(--color-neutral-700)}.text-neutral-900{color:var(--color-neutral-900)}.text-neutral-950{color:var(--color-neutral-950)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_\\#171717\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#171717);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_\\#e5e5e5\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.12\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.08\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#e5e5e5), 0 4px 12px -2px var(--tw-shadow-color,#0000001f), 0 2px 4px -2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(0\\,0\\,0\\,\\.08\\)\\,0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014), 0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,\\.06\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_6px_16px_rgba\\(0\\,0\\,0\\,\\.18\\)\\]{--tw-shadow:0 6px 16px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_\\#e5e5e5\\]{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,#e5e5e5);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-3{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,box-shadow\\]{transition-property:background-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\,box-shadow\\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[translate\\,scale\\,opacity\\]{transition-property:translate,scale,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-\\[120ms\\]{--tw-duration:.12s;transition-duration:.12s}.duration-\\[250ms\\]{--tw-duration:.25s;transition-duration:.25s}.duration-\\[280ms\\]{--tw-duration:.28s;transition-duration:.28s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.contain-content{contain:content}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[-webkit-tap-highlight-color\\:transparent\\]{-webkit-tap-highlight-color:transparent}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.backface-hidden{backface-visibility:hidden}.group-has-data-\\[slot\\=message-footer\\]\\/message\\:-translate-y-8:is(:where(.group\\/message):has([data-slot=message-footer]) *){--tw-translate-y:calc(var(--spacing) * -8);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-has-data-\\[variant\\=ghost\\]\\/message\\:px-0:is(:where(.group\\/message):has([data-variant=ghost]) *){padding-inline:0}.group-data-\\[align\\=end\\]\\/bubble\\:self-end:is(:where(.group\\/bubble)[data-align=end] *){align-self:flex-end}.group-data-\\[align\\=end\\]\\/message\\:justify-end:is(:where(.group\\/message)[data-align=end] *){justify-content:flex-end}.group-data-\\[align\\=end\\]\\/message\\:self-end:is(:where(.group\\/message)[data-align=end] *){align-self:flex-end}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:absolute:is(:where(.group\\/attachment)[data-orientation=vertical] *){position:absolute}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:top-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){top:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:right-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){right:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:w-full:is(:where(.group\\/attachment)[data-orientation=vertical] *){width:100%}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:gap-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){gap:var(--spacing)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:px-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){padding-inline:var(--spacing)}.group-data-\\[size\\=sm\\]\\/attachment\\:w-8:is(:where(.group\\/attachment)[data-size=sm] *){width:calc(var(--spacing) * 8)}.group-data-\\[size\\=xs\\]\\/attachment\\:w-7:is(:where(.group\\/attachment)[data-size=xs] *){width:calc(var(--spacing) * 7)}.group-data-\\[size\\=xs\\]\\/attachment\\:rounded-md:is(:where(.group\\/attachment)[data-size=xs] *){border-radius:calc(var(--radius) - 2px)}.group-data-\\[state\\=done\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=done] *){opacity:1}.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive:is(:where(.group\\/attachment)[data-state=error] *),.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.group-data-\\[state\\=idle\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=idle] *){opacity:1}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[variant\\=separator\\]\\/marker\\:flex-none:is(:where(.group\\/marker)[data-variant=separator] *){flex:none}.group-data-\\[variant\\=separator\\]\\/marker\\:text-center:is(:where(.group\\/marker)[data-variant=separator] *){text-align:center}.placeholder\\:text-neutral-400::placeholder{color:var(--color-neutral-400)}.before\\:mr-1:before{content:var(--tw-content);margin-right:var(--spacing)}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:min-w-0:before{content:var(--tw-content);min-width:0}.before\\:flex-1:before{content:var(--tw-content);flex:1}.before\\:bg-border:before{content:var(--tw-content);background-color:var(--border)}.after\\:ml-1:after{content:var(--tw-content);margin-left:var(--spacing)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:min-w-0:after{content:var(--tw-content);min-width:0}.after\\:flex-1:after{content:var(--tw-content);flex:1}.after\\:bg-border:after{content:var(--tw-content);background-color:var(--border)}.focus-within\\:border-neutral-900:focus-within{border-color:var(--color-neutral-900)}.focus-within\\:shadow-\\[0_0_0_1px_\\#171717\\]:focus-within{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#171717);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover:hover){.hover\\:bg-\\[\\#ebebeb\\]:hover{background-color:#ebebeb}.hover\\:bg-\\[\\#f7f7f7\\]:hover{background-color:#f7f7f7}.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\\:bg-destructive\\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-neutral-50:hover{background-color:var(--color-neutral-50)}.hover\\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\\:bg-neutral-800:hover{background-color:var(--color-neutral-800)}.hover\\:bg-primary\\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/80:hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-neutral-600:hover{color:var(--color-neutral-600)}.hover\\:text-neutral-700:hover{color:var(--color-neutral-700)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_0_0_1px_\\#d4d4d4\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.14\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#d4d4d4), 0 4px 12px -2px var(--tw-shadow-color,#00000024), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[inset_0_0_0_1px_\\#d4d4d4\\]:hover{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,#d4d4d4);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\\:border-neutral-400:focus{border-color:var(--color-neutral-400)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.active\\:not-aria-\\[haspopup\\]\\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (hover:hover){.enabled\\:hover\\:bg-neutral-100:enabled:hover{background-color:var(--color-neutral-100)}.enabled\\:hover\\:text-neutral-700:enabled:hover{color:var(--color-neutral-700)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-45:disabled{opacity:.45}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:w-30:has([data-slot=attachment-content]){width:calc(var(--spacing) * 30)}.has-data-\\[slot\\=attachment-content\\]\\:px-1\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:px-2:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:px-2\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-1:has([data-slot=attachment-content]){padding-block:var(--spacing)}.has-data-\\[slot\\=attachment-content\\]\\:py-1\\.5:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-2:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-media\\]\\:p-1:has([data-slot=attachment-media]){padding:var(--spacing)}.has-data-\\[slot\\=attachment-media\\]\\:p-1\\.5:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-media\\]\\:p-2:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 2)}.has-\\[button\\]\\:p-0:has(:is(button)){padding:0}@media (hover:hover){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}:is(.group-data-\\[align\\=end\\]\\/message\\:\\*\\:data-slot\\:self-end:is(:where(.group\\/message)[data-align=end] *)>*)[data-slot]{align-self:flex-end}.data-\\[active\\=false\\]\\:pointer-events-none[data-active=false]{pointer-events:none}.data-\\[active\\=false\\]\\:scale-95[data-active=false]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=false\\]\\:opacity-0[data-active=false]{opacity:0}.data-\\[active\\=false\\]\\:duration-400[data-active=false]{--tw-duration:.4s;transition-duration:.4s}.data-\\[active\\=false\\]\\:ease-\\[cubic-bezier\\(0\\.7\\,0\\,0\\.84\\,0\\)\\][data-active=false]{--tw-ease:cubic-bezier(.7,0,.84,0);transition-timing-function:cubic-bezier(.7,0,.84,0)}.data-\\[active\\=true\\]\\:translate-y-0[data-active=true]{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[active\\=true\\]\\:scale-100[data-active=true]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=true\\]\\:opacity-100[data-active=true]{opacity:1}.data-\\[active\\=true\\]\\:ease-\\[cubic-bezier\\(0\\.23\\,1\\,0\\.32\\,1\\)\\][data-active=true]{--tw-ease:cubic-bezier(.23,1,.32,1);transition-timing-function:cubic-bezier(.23,1,.32,1)}.data-\\[align\\=end\\]\\:flex-row-reverse[data-align=end]{flex-direction:row-reverse}.data-\\[align\\=end\\]\\:self-end[data-align=end]{align-self:flex-end}.data-\\[direction\\=end\\]\\:bottom-4[data-direction=end]{bottom:calc(var(--spacing) * 4)}.data-\\[direction\\=end\\]\\:data-\\[active\\=false\\]\\:translate-y-full[data-direction=end][data-active=false]{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[direction\\=start\\]\\:top-4[data-direction=start]{top:calc(var(--spacing) * 4)}.data-\\[direction\\=start\\]\\:data-\\[active\\=false\\]\\:-translate-y-full[data-direction=start][data-active=false]{--tw-translate-y:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:flex-none>*)[data-slot=attachment]{flex:none}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:snap-start>*)[data-slot=attachment]{scroll-snap-align:start}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:rounded-none>*)[data-slot=bubble-content]{border-radius:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:border-border>*)[data-slot=bubble-content]{border-color:var(--border)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.93_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .93 calc(c * .4) h)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-background>*)[data-slot=bubble-content]{background-color:var(--background)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-muted>*)[data-slot=bubble-content]{background-color:var(--muted)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-primary>*)[data-slot=bubble-content]{background-color:var(--primary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-secondary>*)[data-slot=bubble-content]{background-color:var(--secondary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-transparent>*)[data-slot=bubble-content]{background-color:#0000}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:p-0>*)[data-slot=bubble-content]{padding:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-destructive>*)[data-slot=bubble-content]{color:var(--destructive)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-foreground>*)[data-slot=bubble-content]{color:var(--foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-primary-foreground>*)[data-slot=bubble-content]{color:var(--primary-foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-secondary-foreground>*)[data-slot=bubble-content]{color:var(--secondary-foreground)}:is(.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\*\\:data-\\[slot\\=spinner\\]\\:size-6\\!:is(:where(.group\\/attachment)[data-orientation=vertical] *)>*)[data-slot=spinner]{width:calc(var(--spacing) * 6)!important;height:calc(var(--spacing) * 6)!important}.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.data-\\[state\\=idle\\]\\:border-dashed[data-state=idle]{--tw-border-style:dashed;border-style:dashed}.data-\\[variant\\=ghost\\]\\:max-w-full[data-variant=ghost]{max-width:100%}.rtl\\:translate-x-1\\/2:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(1 / 2 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}@media (prefers-color-scheme:dark){.dark\\:border-input{border-color:var(--input)}.dark\\:bg-destructive\\/20{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\\:bg-input\\/30{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.3_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .3 calc(c * .4) h)}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}}.\\[\\&_\\*\\]\\:box-border *{box-sizing:border-box}.\\[\\&_img\\]\\:block img{display:block}.\\[\\&_img\\]\\:size-full img{width:100%;height:100%}.\\[\\&_img\\]\\:scale-100 img{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_img\\]\\:scale-\\[1\\.08\\] img{scale:1.08}.\\[\\&_img\\]\\:object-contain img{object-fit:contain}.\\[\\&_img\\]\\:object-cover img{object-fit:cover}.\\[\\&_strong\\]\\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.data-\\[direction\\=start\\]\\:\\[\\&_svg\\]\\:rotate-180[data-direction=start] svg{rotate:180deg}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6:is(:where(.group\\/attachment)[data-orientation=vertical] *) svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.group-data-\\[size\\=xs\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5:is(:where(.group\\/attachment)[data-size=xs] *) svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}.\\[a\\]\\:underline:is(a){text-decoration-line:underline}.\\[a\\]\\:underline-offset-3:is(a){text-underline-offset:3px}:is(.\\*\\:\\[a\\]\\:underline>*):is(a){text-decoration-line:underline}:is(.\\*\\:\\[a\\]\\:underline-offset-3>*):is(a){text-underline-offset:3px}@media (hover:hover){.\\[a\\]\\:hover\\:text-foreground:is(a):hover,:is(.\\*\\:\\[a\\]\\:hover\\:text-foreground>*):is(a):hover{color:var(--foreground)}}.\\[button\\]\\:text-left:is(button){text-align:left}.\\[button\\,a\\]\\:transition-colors:is(button,a){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[button\\,a\\]\\:outline-none:is(button,a){--tw-outline-style:none;outline-style:none}.\\[button\\,a\\]\\:focus-visible\\:border-ring:is(button,a):focus-visible{border-color:var(--ring)}.\\[button\\,a\\]\\:focus-visible\\:ring-3:is(button,a):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}:is(.\\*\\:\\[img\\]\\:aspect-square>*):is(img){aspect-ratio:1}:is(.\\*\\:\\[img\\]\\:w-full>*):is(img){width:100%}:is(.\\*\\:\\[img\\]\\:object-cover>*):is(img){object-fit:cover}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--muted),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.88_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .88 calc(c * .5) h)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:text-foreground>[data-slot=bubble-content]:is(button,a):hover{color:var(--foreground)}@media (prefers-color-scheme:dark){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.35_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .35 calc(c * .5) h)}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}}@property --scroll-fade-t{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-b{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-s{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-e{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-mask{syntax:"*";inherits:false}@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:20deg}@property --shimmer-image{syntax:"*";inherits:false}@property --shimmer-text-fill{syntax:"*";inherits:false}@media (prefers-reduced-motion:reduce){.shimmer{-webkit-text-fill-color:currentColor;background-image:none;animation:none}}:root{--radius:.625rem;--background:#fff;--foreground:#171717;--card:#fff;--card-foreground:#171717;--popover:#fff;--popover-foreground:#171717;--primary:#171717;--primary-foreground:#fafafa;--secondary:#f1f1f3;--secondary-foreground:#171717;--muted:#f5f5f5;--muted-foreground:#737373;--accent:#f5f5f5;--accent-foreground:#171717;--destructive:#dc2626;--border:#e5e5e5;--input:#e5e5e5;--ring:#a3a3a3}html,body{overscroll-behavior:none;background:0 0;width:100%;height:100%;margin:0;padding:0;overflow:hidden}body{--scw-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;flex-direction:column;justify-content:flex-end;align-items:flex-end;display:flex}.scw-panel{--scw-nav-height:52px;--scw-send-pill-gap:24px;--scw-send-pill-height:40px;--scw-composer-clearance:8px;--scw-composer-height:130px;--scw-composer-radius:24px;--scw-composer-inset:12px;--scw-panel-radius:calc(var(--scw-composer-radius) + var(--scw-composer-inset) + 1px);--scw-header-btn-size:36px;--scw-header-btn-concentric:calc(var(--scw-header-btn-size) / 2);--scw-header-padding:calc(var(--scw-panel-radius) - var(--scw-header-btn-concentric) - 1px)}.scw-form:before{content:"";left:var(--scw-composer-inset);right:var(--scw-composer-inset);border-top-left-radius:var(--scw-composer-radius,24px);border-top-right-radius:var(--scw-composer-radius,24px);z-index:-1;pointer-events:none;background:#fff;position:absolute;top:0;bottom:0}.scw-messages{--scw-message-inset-x:16px;scrollbar-width:none}.scw-messages::-webkit-scrollbar{width:0;height:0}@keyframes scw-bounce-top{0%{transform:translateY(0)}35%{transform:translateY(14px)}to{transform:translateY(0)}}@keyframes scw-bounce-bottom{0%{transform:translateY(0)}35%{transform:translateY(-14px)}to{transform:translateY(0)}}.scw-bounce-top{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-top}.scw-bounce-bottom{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-bottom}@keyframes scw-message-in{0%{opacity:0}to{opacity:1}}.scw-message-in{animation:.22s ease-out scw-message-in}@media (prefers-reduced-motion:reduce){.scw-message-in{animation:none}}@keyframes scw-spin{to{transform:rotate(360deg)}}.scw-citation+.scw-citation{margin-left:.3em}.scw-citation-popover{transform:translateX(calc(-50% + var(--scw-citation-popover-shift,0px)))}.scw-citation-popover:before{content:"";height:10px;position:absolute;top:-10px;left:0;right:0}@media (hover:hover) and (pointer:fine){.scw-citation:hover .scw-citation-badge{color:#fff;background:#2563eb}}.scw-scrollbar{top:10px;right:3px;bottom:calc(var(--scw-composer-height,130px) + 2px);z-index:3;pointer-events:none;width:6px;position:absolute}.scw-scrollbar-thumb{opacity:0;pointer-events:auto;cursor:default;touch-action:none;background-color:#d4d4d4;border-radius:9999px;transition:opacity .2s;position:absolute;top:0;left:0;right:0}.scw-scrollbar-visible .scw-scrollbar-thumb{opacity:1}.scw-scrollbar-thumb:hover{background-color:#b8b8b8}.scw-thin-scroll{scrollbar-width:thin;scrollbar-color:#d4d4d4 transparent}.scw-thin-scroll::-webkit-scrollbar{width:6px}.scw-thin-scroll::-webkit-scrollbar-track{background:0 0}.scw-thin-scroll::-webkit-scrollbar-thumb{background-color:#d4d4d4;border-radius:9999px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes scroll-fade-reveal-t{0%{--scroll-fade-t:0px}to{--scroll-fade-t:var(--_scroll-fade-size-t,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-b{0%{--scroll-fade-b:var(--_scroll-fade-size-b,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-b:0px}}@keyframes scroll-fade-reveal-s{0%{--scroll-fade-s:0px}to{--scroll-fade-s:var(--_scroll-fade-size-s,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-e{0%{--scroll-fade-e:var(--_scroll-fade-size-e,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-e:0px}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}}`;
|
|
14016
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--scroll-fade-t:0px;--scroll-fade-b:0px;--scroll-fade-s:0px;--scroll-fade-e:0px;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-blue-600:oklch(54.6% .245 262.881);--color-neutral-50:var(--scw-hover);--color-neutral-100:var(--scw-hover);--color-neutral-200:var(--scw-gray-200);--color-neutral-300:var(--scw-gray-300);--color-neutral-400:var(--scw-gray-400);--color-neutral-500:var(--scw-muted);--color-neutral-600:var(--scw-muted);--color-neutral-700:var(--scw-ink-secondary);--color-neutral-800:var(--scw-ink-body);--color-neutral-900:var(--scw-ink);--color-neutral-950:var(--scw-ink);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:calc(var(--radius) - 2px);--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-s-1{inset-inline-start:var(--spacing)}.inset-s-1\\/2{inset-inline-start:50%}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+8px\\)\\]{top:calc(100% + 8px)}.top-\\[var\\(--scw-header-padding\\)\\]{top:var(--scw-header-padding)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[var\\(--scw-header-padding\\)\\]{right:var(--scw-header-padding)}.bottom-0{bottom:0}.bottom-\\[calc\\(var\\(--scw-send-pill-gap\\)\\+var\\(--scw-nav-height\\)\\)\\]{bottom:calc(var(--scw-send-pill-gap) + var(--scw-nav-height))}.bottom-full{bottom:100%}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[5\\]{z-index:5}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.my-6{margin-block:calc(var(--spacing) * 6)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-\\[-16px\\]{margin-top:-16px}.mb-0{margin-bottom:0}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-\\[0\\.25em\\]{margin-left:.25em}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[1\\.45em\\]{width:1.45em;height:1.45em}.size-\\[18px\\]{width:18px;height:18px}.size-\\[var\\(--scw-header-btn-size\\)\\]{width:var(--scw-header-btn-size);height:var(--scw-header-btn-size)}.size-\\[var\\(--scw-launcher-icon-size\\,25px\\)\\]{width:var(--scw-launcher-icon-size,25px);height:var(--scw-launcher-icon-size,25px)}.size-\\[var\\(--scw-launcher-size\\,60px\\)\\]{width:var(--scw-launcher-size,60px);height:var(--scw-launcher-size,60px)}.size-full{width:100%;height:100%}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\\[13px\\]{height:13px}.h-\\[var\\(--scw-panel-height\\,680px\\)\\]{height:var(--scw-panel-height,680px)}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[22px\\]{min-height:22px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[calc\\(var\\(--scw-header-padding\\)\\*2\\+var\\(--scw-header-btn-size\\)\\)\\]{min-height:calc(var(--scw-header-padding) * 2 + var(--scw-header-btn-size))}.min-h-full{min-height:100%}.w-10{width:calc(var(--spacing) * 10)}.w-24{width:calc(var(--spacing) * 24)}.w-\\[var\\(--scw-panel-width\\,384px\\)\\]{width:var(--scw-panel-width,384px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[82\\%\\]{max-width:82%}.max-w-\\[88\\%\\]{max-width:88%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[min\\(240px\\,var\\(--scw-host-viewport-width\\,100vw\\)\\)\\]{max-width:min(240px, var(--scw-host-viewport-width,100vw))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-\\[1\\.45em\\]{min-width:1.45em}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3{--tw-translate-y:calc(var(--spacing) * -3);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3\\/4{--tw-translate-y:calc(calc(3 / 4 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3{--tw-translate-y:calc(var(--spacing) * 3);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3\\/4{--tw-translate-y:calc(3 / 4 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.shimmer{--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.shimmer{background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.shimmer{background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.shimmer{--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.shimmer:where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.scroll-fade-x{--_scroll-fade-size-s:var(--scroll-fade-s-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-e:var(--scroll-fade-e-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-inline:linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x:where([dir=rtl],[dir=rtl] *){--scroll-fade-inline:linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x{-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-x{animation:1ms ease-in-out scroll-fade-reveal-s,1ms ease-in-out scroll-fade-reveal-e;animation-timeline:scroll(self inline),scroll(self inline);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-x{--scroll-fade-s:var(--_scroll-fade-size-s);--scroll-fade-e:var(--_scroll-fade-size-e)}}.scroll-fade{--_scroll-fade-size-t:var(--scroll-fade-t-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-block:linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t,0px), #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade{animation:1ms ease-in-out scroll-fade-reveal-t,1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y),scroll(self y);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade{--scroll-fade-t:var(--_scroll-fade-size-t);--scroll-fade-b:var(--_scroll-fade-size-b)}}.scroll-fade-b{--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-mask:linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);mask-image:var(--scroll-fade-mask);-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-b{animation:1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y);animation-range:calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-b{--scroll-fade-b:var(--_scroll-fade-size-b)}}.animate-\\[scw-spin_\\.7s_linear_infinite\\]{animation:.7s linear infinite scw-spin}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.scroll-px-1{scroll-padding-inline:var(--spacing)}.\\[scrollbar-width\\:none\\],.scrollbar-none{scrollbar-width:none}.scrollbar-thin{scrollbar-width:thin}.\\[scrollbar-gutter\\:auto\\]{scrollbar-gutter:auto}.scrollbar-gutter-stable{scrollbar-gutter:stable}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-\\[var\\(--scw-composer-radius\\,24px\\)\\]{border-radius:var(--scw-composer-radius,24px)}.rounded-\\[var\\(--scw-header-btn-concentric\\)\\]{border-radius:var(--scw-header-btn-concentric)}.rounded-\\[var\\(--scw-panel-radius\\)\\]{border-radius:var(--scw-panel-radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-border{border-color:var(--border)}.border-neutral-200{border-color:var(--scw-gray-200)}.border-neutral-300{border-color:var(--scw-gray-300)}.border-neutral-900{border-color:var(--scw-ink)}.border-red-400{border-color:var(--color-red-400)}.border-transparent{border-color:#0000}.border-t-neutral-500{border-top-color:var(--scw-muted)}.bg-\\[\\#eff6ff\\]{background-color:#eff6ff}.bg-\\[rgba\\(10\\,10\\,10\\,\\.72\\)\\]{background-color:#0a0a0ab8}.bg-amber-500{background-color:var(--color-amber-500)}.bg-background{background-color:var(--background)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-neutral-50,.bg-neutral-100{background-color:var(--scw-hover)}.bg-neutral-200{background-color:var(--scw-gray-200)}.bg-neutral-400{background-color:var(--scw-gray-400)}.bg-neutral-900{background-color:var(--scw-ink)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-\\[var\\(--scw-header-padding\\)\\]{padding:var(--scw-header-padding)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[11px\\]{padding-inline:11px}.px-\\[13px\\]{padding-inline:13px}.px-\\[18px\\]{padding-inline:18px}.px-\\[var\\(--scw-composer-inset\\)\\]{padding-inline:var(--scw-composer-inset)}.px-\\[var\\(--scw-message-inset-x\\,16px\\)\\]{padding-inline:var(--scw-message-inset-x,16px)}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-\\[9px\\]{padding-block:9px}.py-\\[11px\\]{padding-block:11px}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-11{padding-bottom:calc(var(--spacing) * 11)}.pb-\\[calc\\(8px\\+var\\(--scw-nav-height\\)\\+var\\(--scw-send-pill-gap\\)\\+var\\(--scw-send-pill-height\\)\\)\\]{padding-bottom:calc(8px + var(--scw-nav-height) + var(--scw-send-pill-gap) + var(--scw-send-pill-height))}.pb-\\[calc\\(24px\\+var\\(--scw-nav-height\\)\\)\\]{padding-bottom:calc(24px + var(--scw-nav-height))}.pb-\\[var\\(--scw-composer-inset\\)\\]{padding-bottom:var(--scw-composer-inset)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.text-left{text-align:left}.align-baseline{vertical-align:baseline}.align-top{vertical-align:top}.\\[font-family\\:var\\(--scw-font\\)\\]{font-family:var(--scw-font)}.font-\\[inherit\\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.78em\\]{font-size:.78em}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-\\[1\\.3\\]{--tw-leading:1.3;line-height:1.3}.leading-\\[1\\.4\\]{--tw-leading:1.4;line-height:1.4}.leading-\\[1\\.35\\]{--tw-leading:1.35;line-height:1.35}.leading-\\[1\\.45\\]{--tw-leading:1.45;line-height:1.45}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.break-words,.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-neutral-400{color:var(--scw-gray-400)}.text-neutral-500,.text-neutral-600{color:var(--scw-muted)}.text-neutral-700{color:var(--scw-ink-secondary)}.text-neutral-900,.text-neutral-950{color:var(--scw-ink)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(0\\,0\\,0\\,\\.08\\)\\,0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014), 0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_var\\(--scw-hairline\\)\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.12\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.08\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-hairline)), 0 4px 12px -2px var(--tw-shadow-color,#0000001f), 0 2px 4px -2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_var\\(--scw-ink\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-ink));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,\\.06\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_6px_16px_rgba\\(0\\,0\\,0\\,\\.18\\)\\]{--tw-shadow:0 6px 16px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_var\\(--scw-hairline\\)\\]{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--scw-hairline));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-3{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,box-shadow\\]{transition-property:background-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\,box-shadow\\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[translate\\,scale\\,opacity\\]{transition-property:translate,scale,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-\\[120ms\\]{--tw-duration:.12s;transition-duration:.12s}.duration-\\[250ms\\]{--tw-duration:.25s;transition-duration:.25s}.duration-\\[280ms\\]{--tw-duration:.28s;transition-duration:.28s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.contain-content{contain:content}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[-webkit-tap-highlight-color\\:transparent\\]{-webkit-tap-highlight-color:transparent}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.backface-hidden{backface-visibility:hidden}.group-has-data-\\[slot\\=message-footer\\]\\/message\\:-translate-y-8:is(:where(.group\\/message):has([data-slot=message-footer]) *){--tw-translate-y:calc(var(--spacing) * -8);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-has-data-\\[variant\\=ghost\\]\\/message\\:px-0:is(:where(.group\\/message):has([data-variant=ghost]) *){padding-inline:0}.group-data-\\[align\\=end\\]\\/bubble\\:self-end:is(:where(.group\\/bubble)[data-align=end] *){align-self:flex-end}.group-data-\\[align\\=end\\]\\/message\\:justify-end:is(:where(.group\\/message)[data-align=end] *){justify-content:flex-end}.group-data-\\[align\\=end\\]\\/message\\:self-end:is(:where(.group\\/message)[data-align=end] *){align-self:flex-end}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:absolute:is(:where(.group\\/attachment)[data-orientation=vertical] *){position:absolute}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:top-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){top:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:right-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){right:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:w-full:is(:where(.group\\/attachment)[data-orientation=vertical] *){width:100%}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:gap-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){gap:var(--spacing)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:px-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){padding-inline:var(--spacing)}.group-data-\\[size\\=sm\\]\\/attachment\\:w-8:is(:where(.group\\/attachment)[data-size=sm] *){width:calc(var(--spacing) * 8)}.group-data-\\[size\\=xs\\]\\/attachment\\:w-7:is(:where(.group\\/attachment)[data-size=xs] *){width:calc(var(--spacing) * 7)}.group-data-\\[size\\=xs\\]\\/attachment\\:rounded-md:is(:where(.group\\/attachment)[data-size=xs] *){border-radius:calc(var(--radius) - 2px)}.group-data-\\[state\\=done\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=done] *){opacity:1}.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive:is(:where(.group\\/attachment)[data-state=error] *),.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.group-data-\\[state\\=idle\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=idle] *){opacity:1}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[variant\\=separator\\]\\/marker\\:flex-none:is(:where(.group\\/marker)[data-variant=separator] *){flex:none}.group-data-\\[variant\\=separator\\]\\/marker\\:text-center:is(:where(.group\\/marker)[data-variant=separator] *){text-align:center}.placeholder\\:text-neutral-400::placeholder{color:var(--scw-gray-400)}.before\\:mr-1:before{content:var(--tw-content);margin-right:var(--spacing)}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:min-w-0:before{content:var(--tw-content);min-width:0}.before\\:flex-1:before{content:var(--tw-content);flex:1}.before\\:bg-border:before{content:var(--tw-content);background-color:var(--border)}.after\\:ml-1:after{content:var(--tw-content);margin-left:var(--spacing)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:min-w-0:after{content:var(--tw-content);min-width:0}.after\\:flex-1:after{content:var(--tw-content);flex:1}.after\\:bg-border:after{content:var(--tw-content);background-color:var(--border)}.focus-within\\:border-neutral-900:focus-within{border-color:var(--scw-ink)}.focus-within\\:shadow-\\[0_0_0_1px_var\\(--scw-ink\\)\\]:focus-within{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-ink));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover:hover){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\\:bg-destructive\\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-neutral-50:hover,.hover\\:bg-neutral-100:hover{background-color:var(--scw-hover)}.hover\\:bg-neutral-800:hover{background-color:var(--scw-ink-body)}.hover\\:bg-primary\\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/80:hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-neutral-600:hover{color:var(--scw-muted)}.hover\\:text-neutral-700:hover{color:var(--scw-ink-secondary)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_0_0_1px_var\\(--scw-hairline-strong\\)\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.14\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-hairline-strong)), 0 4px 12px -2px var(--tw-shadow-color,#00000024), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[inset_0_0_0_1px_var\\(--scw-hairline-strong\\)\\]:hover{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--scw-hairline-strong));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\\:border-\\[color\\:var\\(--scw-hairline-strong\\)\\]:focus{border-color:var(--scw-hairline-strong)}.focus\\:border-red-500:focus{border-color:var(--color-red-500)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.active\\:not-aria-\\[haspopup\\]\\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (hover:hover){.enabled\\:hover\\:bg-neutral-100:enabled:hover{background-color:var(--scw-hover)}.enabled\\:hover\\:text-neutral-700:enabled:hover{color:var(--scw-ink-secondary)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-45:disabled{opacity:.45}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:w-30:has([data-slot=attachment-content]){width:calc(var(--spacing) * 30)}.has-data-\\[slot\\=attachment-content\\]\\:px-1\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:px-2:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:px-2\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-1:has([data-slot=attachment-content]){padding-block:var(--spacing)}.has-data-\\[slot\\=attachment-content\\]\\:py-1\\.5:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-2:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-media\\]\\:p-1:has([data-slot=attachment-media]){padding:var(--spacing)}.has-data-\\[slot\\=attachment-media\\]\\:p-1\\.5:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-media\\]\\:p-2:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 2)}.has-\\[button\\]\\:p-0:has(:is(button)){padding:0}@media (hover:hover){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}:is(.group-data-\\[align\\=end\\]\\/message\\:\\*\\:data-slot\\:self-end:is(:where(.group\\/message)[data-align=end] *)>*)[data-slot]{align-self:flex-end}.data-\\[active\\=false\\]\\:pointer-events-none[data-active=false]{pointer-events:none}.data-\\[active\\=false\\]\\:scale-95[data-active=false]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=false\\]\\:opacity-0[data-active=false]{opacity:0}.data-\\[active\\=false\\]\\:duration-400[data-active=false]{--tw-duration:.4s;transition-duration:.4s}.data-\\[active\\=false\\]\\:ease-\\[cubic-bezier\\(0\\.7\\,0\\,0\\.84\\,0\\)\\][data-active=false]{--tw-ease:cubic-bezier(.7,0,.84,0);transition-timing-function:cubic-bezier(.7,0,.84,0)}.data-\\[active\\=true\\]\\:translate-y-0[data-active=true]{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[active\\=true\\]\\:scale-100[data-active=true]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=true\\]\\:opacity-100[data-active=true]{opacity:1}.data-\\[active\\=true\\]\\:ease-\\[cubic-bezier\\(0\\.23\\,1\\,0\\.32\\,1\\)\\][data-active=true]{--tw-ease:cubic-bezier(.23,1,.32,1);transition-timing-function:cubic-bezier(.23,1,.32,1)}.data-\\[align\\=end\\]\\:flex-row-reverse[data-align=end]{flex-direction:row-reverse}.data-\\[align\\=end\\]\\:self-end[data-align=end]{align-self:flex-end}.data-\\[direction\\=end\\]\\:bottom-4[data-direction=end]{bottom:calc(var(--spacing) * 4)}.data-\\[direction\\=end\\]\\:data-\\[active\\=false\\]\\:translate-y-full[data-direction=end][data-active=false]{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[direction\\=start\\]\\:top-4[data-direction=start]{top:calc(var(--spacing) * 4)}.data-\\[direction\\=start\\]\\:data-\\[active\\=false\\]\\:-translate-y-full[data-direction=start][data-active=false]{--tw-translate-y:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:flex-none>*)[data-slot=attachment]{flex:none}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:snap-start>*)[data-slot=attachment]{scroll-snap-align:start}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:rounded-none>*)[data-slot=bubble-content]{border-radius:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:border-border>*)[data-slot=bubble-content]{border-color:var(--border)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.93_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .93 calc(c * .4) h)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-background>*)[data-slot=bubble-content]{background-color:var(--background)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-muted>*)[data-slot=bubble-content]{background-color:var(--muted)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-primary>*)[data-slot=bubble-content]{background-color:var(--primary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-secondary>*)[data-slot=bubble-content]{background-color:var(--secondary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-transparent>*)[data-slot=bubble-content]{background-color:#0000}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:p-0>*)[data-slot=bubble-content]{padding:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-destructive>*)[data-slot=bubble-content]{color:var(--destructive)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-foreground>*)[data-slot=bubble-content]{color:var(--foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-primary-foreground>*)[data-slot=bubble-content]{color:var(--primary-foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-secondary-foreground>*)[data-slot=bubble-content]{color:var(--secondary-foreground)}:is(.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\*\\:data-\\[slot\\=spinner\\]\\:size-6\\!:is(:where(.group\\/attachment)[data-orientation=vertical] *)>*)[data-slot=spinner]{width:calc(var(--spacing) * 6)!important;height:calc(var(--spacing) * 6)!important}.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.data-\\[state\\=idle\\]\\:border-dashed[data-state=idle]{--tw-border-style:dashed;border-style:dashed}.data-\\[variant\\=ghost\\]\\:max-w-full[data-variant=ghost]{max-width:100%}.rtl\\:translate-x-1\\/2:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(1 / 2 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}@media (prefers-color-scheme:dark){.dark\\:border-input{border-color:var(--input)}.dark\\:bg-destructive\\/20{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\\:bg-input\\/30{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.3_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .3 calc(c * .4) h)}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}}.\\[\\&_\\*\\]\\:box-border *{box-sizing:border-box}.\\[\\&_img\\]\\:block img{display:block}.\\[\\&_img\\]\\:size-full img{width:100%;height:100%}.\\[\\&_img\\]\\:scale-100 img{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_img\\]\\:scale-\\[1\\.08\\] img{scale:1.08}.\\[\\&_img\\]\\:object-contain img{object-fit:contain}.\\[\\&_img\\]\\:object-cover img{object-fit:cover}.\\[\\&_strong\\]\\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:size-full svg{width:100%;height:100%}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.data-\\[direction\\=start\\]\\:\\[\\&_svg\\]\\:rotate-180[data-direction=start] svg{rotate:180deg}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6:is(:where(.group\\/attachment)[data-orientation=vertical] *) svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.group-data-\\[size\\=xs\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5:is(:where(.group\\/attachment)[data-size=xs] *) svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_table\\]\\:whitespace-normal table{white-space:normal}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}.\\[a\\]\\:underline:is(a){text-decoration-line:underline}.\\[a\\]\\:underline-offset-3:is(a){text-underline-offset:3px}:is(.\\*\\:\\[a\\]\\:underline>*):is(a){text-decoration-line:underline}:is(.\\*\\:\\[a\\]\\:underline-offset-3>*):is(a){text-underline-offset:3px}@media (hover:hover){.\\[a\\]\\:hover\\:text-foreground:is(a):hover,:is(.\\*\\:\\[a\\]\\:hover\\:text-foreground>*):is(a):hover{color:var(--foreground)}}.\\[button\\]\\:text-left:is(button){text-align:left}.\\[button\\,a\\]\\:transition-colors:is(button,a){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[button\\,a\\]\\:outline-none:is(button,a){--tw-outline-style:none;outline-style:none}.\\[button\\,a\\]\\:focus-visible\\:border-ring:is(button,a):focus-visible{border-color:var(--ring)}.\\[button\\,a\\]\\:focus-visible\\:ring-3:is(button,a):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}:is(.\\*\\:\\[img\\]\\:aspect-square>*):is(img){aspect-ratio:1}:is(.\\*\\:\\[img\\]\\:w-full>*):is(img){width:100%}:is(.\\*\\:\\[img\\]\\:object-cover>*):is(img){object-fit:cover}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--muted),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.88_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .88 calc(c * .5) h)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:text-foreground>[data-slot=bubble-content]:is(button,a):hover{color:var(--foreground)}@media (prefers-color-scheme:dark){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.35_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .35 calc(c * .5) h)}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}}@property --scroll-fade-t{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-b{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-s{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-e{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-mask{syntax:"*";inherits:false}@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:20deg}@property --shimmer-image{syntax:"*";inherits:false}@property --shimmer-text-fill{syntax:"*";inherits:false}@media (prefers-reduced-motion:reduce){.shimmer{-webkit-text-fill-color:currentColor;background-image:none;animation:none}}:root{--scw-canvas:#fff;--scw-ink:#0b0b0b;--scw-ink-body:#2c2c2a;--scw-ink-secondary:#52514e;--scw-muted:#898781;--scw-hover:#f0f0ef;--scw-selected:#edece8;--scw-gray-200:#e5e4e1;--scw-gray-300:#b8b5ae;--scw-gray-400:#9c9a94;--scw-hairline:#0b0b0b1a;--scw-hairline-strong:#0b0b0b33;--scw-ring:#2a78d6;--radius:.625rem;--background:var(--scw-canvas);--foreground:var(--scw-ink);--card:var(--scw-canvas);--card-foreground:var(--scw-ink);--popover:var(--scw-canvas);--popover-foreground:var(--scw-ink);--primary:var(--scw-ink);--primary-foreground:#fff;--secondary:var(--scw-hover);--secondary-foreground:var(--scw-ink);--muted:var(--scw-hover);--muted-foreground:var(--scw-muted);--accent:var(--scw-hover);--accent-foreground:var(--scw-ink);--destructive:#dc2626;--border:var(--scw-hairline);--input:var(--scw-hairline);--ring:var(--scw-ring)}html,body{overscroll-behavior:none;background:0 0;width:100%;height:100%;margin:0;padding:0;overflow:hidden}body{--scw-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;flex-direction:column;justify-content:flex-end;align-items:flex-end;display:flex}html:has(body.scw-preview-stage),body.scw-preview-stage{color-scheme:inherit;background:0 0}body.scw-preview-stage{justify-content:center;align-items:center;padding:0}.scw-panel{--scw-nav-height:52px;--scw-send-pill-gap:24px;--scw-send-pill-height:40px;--scw-composer-clearance:8px;--scw-composer-height:130px;--scw-composer-radius:24px;--scw-composer-inset:12px;--scw-panel-radius:calc(var(--scw-composer-radius) + var(--scw-composer-inset) + 1px);--scw-header-btn-size:36px;--scw-header-btn-concentric:calc(var(--scw-header-btn-size) / 2);--scw-header-padding:calc(var(--scw-panel-radius) - var(--scw-header-btn-concentric) - 1px)}.scw-form:before{content:"";left:var(--scw-composer-inset);right:var(--scw-composer-inset);background:var(--scw-canvas);border-top-left-radius:var(--scw-composer-radius,24px);border-top-right-radius:var(--scw-composer-radius,24px);z-index:-1;pointer-events:none;position:absolute;top:0;bottom:0}.scw-messages{--scw-message-inset-x:16px;scrollbar-width:none}.scw-messages::-webkit-scrollbar{width:0;height:0}@keyframes scw-bounce-top{0%{transform:translateY(0)}35%{transform:translateY(14px)}to{transform:translateY(0)}}@keyframes scw-bounce-bottom{0%{transform:translateY(0)}35%{transform:translateY(-14px)}to{transform:translateY(0)}}.scw-bounce-top{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-top}.scw-bounce-bottom{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-bottom}@keyframes scw-message-in{0%{opacity:0}to{opacity:1}}.scw-message-in{animation:.22s ease-out scw-message-in}@media (prefers-reduced-motion:reduce){.scw-message-in{animation:none}}@keyframes scw-spin{to{transform:rotate(360deg)}}.scw-citation+.scw-citation{margin-left:.3em}.scw-citation-popover{transform:translateX(calc(-50% + var(--scw-citation-popover-shift,0px)))}.scw-citation-popover:before{content:"";height:10px;position:absolute;top:-10px;left:0;right:0}@media (hover:hover) and (pointer:fine){.scw-citation:hover .scw-citation-badge{color:#fff;background:#2563eb}}.scw-scrollbar{top:10px;right:3px;bottom:calc(var(--scw-composer-height,130px) + 2px);z-index:3;pointer-events:none;width:6px;position:absolute}.scw-scrollbar-thumb{background-color:var(--scw-gray-300);opacity:0;pointer-events:auto;cursor:default;touch-action:none;border-radius:9999px;transition:opacity .2s;position:absolute;top:0;left:0;right:0}.scw-scrollbar-visible .scw-scrollbar-thumb{opacity:1}.scw-scrollbar-thumb:hover{background-color:var(--scw-gray-400)}.scw-thin-scroll{scrollbar-width:thin;scrollbar-color:var(--scw-gray-300) transparent}.scw-thin-scroll::-webkit-scrollbar{width:6px}.scw-thin-scroll::-webkit-scrollbar-track{background:0 0}.scw-thin-scroll::-webkit-scrollbar-thumb{background-color:var(--scw-gray-300);border-radius:9999px}.scw-suggestion{box-sizing:border-box;text-align:left;white-space:normal;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:12px;width:100%;min-width:0;max-width:100%;display:grid;overflow:hidden}.scw-suggestion-icon{justify-content:center;align-self:center;align-items:center;width:28px;height:28px;display:flex}.scw-suggestion-copy{flex-direction:column;justify-content:center;min-width:0;max-width:100%;display:flex}.scw-suggestion-label{max-width:100%;display:block;overflow-wrap:anywhere!important;word-break:break-all!important;white-space:normal!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes scroll-fade-reveal-t{0%{--scroll-fade-t:0px}to{--scroll-fade-t:var(--_scroll-fade-size-t,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-b{0%{--scroll-fade-b:var(--_scroll-fade-size-b,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-b:0px}}@keyframes scroll-fade-reveal-s{0%{--scroll-fade-s:0px}to{--scroll-fade-s:var(--_scroll-fade-size-s,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-e{0%{--scroll-fade-e:var(--_scroll-fade-size-e,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-e:0px}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}}`;
|
|
13949
14017
|
|
|
13950
14018
|
// src/lib/support/styles.ts
|
|
13951
14019
|
var STYLE_ATTRIBUTE = "data-saasco-chat";
|
|
@@ -14065,46 +14133,23 @@ function toPreparedFile(blob, originalName) {
|
|
|
14065
14133
|
});
|
|
14066
14134
|
}
|
|
14067
14135
|
|
|
14068
|
-
// src/lib/support/resolveSubmitEmailGate.ts
|
|
14069
|
-
function resolveSubmitEmailGate({
|
|
14070
|
-
emailDraft,
|
|
14071
|
-
isNewConversation,
|
|
14072
|
-
knownEmail
|
|
14073
|
-
}) {
|
|
14074
|
-
if (!isNewConversation || knownEmail) {
|
|
14075
|
-
return {
|
|
14076
|
-
emailForSend: knownEmail ?? void 0,
|
|
14077
|
-
ok: true,
|
|
14078
|
-
optimisticallyCapturedEmail: null
|
|
14079
|
-
};
|
|
14080
|
-
}
|
|
14081
|
-
const candidate = emailDraft.trim();
|
|
14082
|
-
if (!EMAIL_PATTERN.test(candidate)) {
|
|
14083
|
-
return {
|
|
14084
|
-
error: "Enter a valid email so we can reply to you.",
|
|
14085
|
-
ok: false
|
|
14086
|
-
};
|
|
14087
|
-
}
|
|
14088
|
-
return {
|
|
14089
|
-
emailForSend: candidate,
|
|
14090
|
-
ok: true,
|
|
14091
|
-
optimisticallyCapturedEmail: candidate
|
|
14092
|
-
};
|
|
14093
|
-
}
|
|
14094
|
-
|
|
14095
14136
|
// src/lib/support/transport.ts
|
|
14096
14137
|
async function getWidgetConfig({
|
|
14097
14138
|
baseUrl,
|
|
14098
14139
|
projectId
|
|
14099
14140
|
}) {
|
|
14100
|
-
const { branding, tools } = await postJson(
|
|
14141
|
+
const { branding, suggestions, tools } = await postJson(
|
|
14101
14142
|
`${normalizeBaseUrl(baseUrl)}/api/support/settings`,
|
|
14102
14143
|
{ projectId }
|
|
14103
14144
|
);
|
|
14104
14145
|
if (!Array.isArray(tools)) {
|
|
14105
14146
|
throw new TypeError("Support chat settings response is missing `tools`");
|
|
14106
14147
|
}
|
|
14107
|
-
return {
|
|
14148
|
+
return {
|
|
14149
|
+
branding,
|
|
14150
|
+
...Array.isArray(suggestions) ? { suggestions } : {},
|
|
14151
|
+
tools
|
|
14152
|
+
};
|
|
14108
14153
|
}
|
|
14109
14154
|
async function sendMessage({
|
|
14110
14155
|
baseUrl,
|
|
@@ -14163,16 +14208,32 @@ async function resumeSession({
|
|
|
14163
14208
|
body
|
|
14164
14209
|
);
|
|
14165
14210
|
}
|
|
14211
|
+
async function forgetVisitorSession({
|
|
14212
|
+
baseUrl,
|
|
14213
|
+
projectId
|
|
14214
|
+
}) {
|
|
14215
|
+
await postJson(
|
|
14216
|
+
`${normalizeBaseUrl(baseUrl)}/api/support/visitor/forget`,
|
|
14217
|
+
{ projectId }
|
|
14218
|
+
);
|
|
14219
|
+
}
|
|
14166
14220
|
async function requestHandoff({
|
|
14167
14221
|
baseUrl,
|
|
14222
|
+
keepalive,
|
|
14168
14223
|
...body
|
|
14169
14224
|
}) {
|
|
14170
|
-
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body
|
|
14225
|
+
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body, {
|
|
14226
|
+
keepalive,
|
|
14227
|
+
simple: keepalive === true
|
|
14228
|
+
});
|
|
14171
14229
|
}
|
|
14172
|
-
async function postJson(url, body) {
|
|
14230
|
+
async function postJson(url, body, options) {
|
|
14173
14231
|
const response = await fetch(url, {
|
|
14174
14232
|
body: JSON.stringify(body),
|
|
14175
|
-
headers: {
|
|
14233
|
+
headers: {
|
|
14234
|
+
"content-type": options?.simple ? "text/plain" : "application/json"
|
|
14235
|
+
},
|
|
14236
|
+
keepalive: options?.keepalive,
|
|
14176
14237
|
method: "POST"
|
|
14177
14238
|
});
|
|
14178
14239
|
if (!response.ok) {
|
|
@@ -14403,15 +14464,202 @@ function persistEmail(emailStorageKey, email) {
|
|
|
14403
14464
|
}
|
|
14404
14465
|
}
|
|
14405
14466
|
|
|
14467
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14468
|
+
var import_react26 = require("react");
|
|
14469
|
+
|
|
14470
|
+
// src/lib/support/handoff.ts
|
|
14471
|
+
var import_ai4 = require("ai");
|
|
14472
|
+
function readHandoffOffer(message) {
|
|
14473
|
+
for (const part of message.parts ?? []) {
|
|
14474
|
+
if (!(0, import_ai4.isToolUIPart)(part) || (0, import_ai4.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14475
|
+
continue;
|
|
14476
|
+
}
|
|
14477
|
+
if (part.state !== "output-available") {
|
|
14478
|
+
continue;
|
|
14479
|
+
}
|
|
14480
|
+
const output = part.output;
|
|
14481
|
+
if (output?.offerHandoff && !output.declined && !output.resolved) {
|
|
14482
|
+
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
14483
|
+
}
|
|
14484
|
+
}
|
|
14485
|
+
return null;
|
|
14486
|
+
}
|
|
14487
|
+
function readOutstandingHandoffOffers(messages) {
|
|
14488
|
+
const offers = [];
|
|
14489
|
+
for (const message of messages) {
|
|
14490
|
+
const offer = readHandoffOffer(message);
|
|
14491
|
+
if (offer) {
|
|
14492
|
+
offers.push(offer);
|
|
14493
|
+
}
|
|
14494
|
+
}
|
|
14495
|
+
return offers;
|
|
14496
|
+
}
|
|
14497
|
+
function markHandoffOfferInMessages(messages, toolCallId, flag) {
|
|
14498
|
+
let changed = false;
|
|
14499
|
+
const next = messages.map((message) => {
|
|
14500
|
+
if (message.role !== "assistant") {
|
|
14501
|
+
return message;
|
|
14502
|
+
}
|
|
14503
|
+
let messageChanged = false;
|
|
14504
|
+
const parts = (message.parts ?? []).map((part) => {
|
|
14505
|
+
if (!(0, import_ai4.isToolUIPart)(part) || (0, import_ai4.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14506
|
+
return part;
|
|
14507
|
+
}
|
|
14508
|
+
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
14509
|
+
return part;
|
|
14510
|
+
}
|
|
14511
|
+
const output = part.output;
|
|
14512
|
+
if (output?.declined || output?.resolved) {
|
|
14513
|
+
return part;
|
|
14514
|
+
}
|
|
14515
|
+
messageChanged = true;
|
|
14516
|
+
changed = true;
|
|
14517
|
+
return {
|
|
14518
|
+
...part,
|
|
14519
|
+
output: {
|
|
14520
|
+
...output,
|
|
14521
|
+
...flag,
|
|
14522
|
+
offerHandoff: false
|
|
14523
|
+
}
|
|
14524
|
+
};
|
|
14525
|
+
});
|
|
14526
|
+
return messageChanged ? { ...message, parts } : message;
|
|
14527
|
+
});
|
|
14528
|
+
return changed ? next : messages;
|
|
14529
|
+
}
|
|
14530
|
+
|
|
14531
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14532
|
+
function useHandoffDecisions({
|
|
14533
|
+
baseUrl,
|
|
14534
|
+
mergedIdsRef,
|
|
14535
|
+
messagesRef,
|
|
14536
|
+
onAccepted,
|
|
14537
|
+
projectId,
|
|
14538
|
+
sessionRef,
|
|
14539
|
+
setMessages
|
|
14540
|
+
}) {
|
|
14541
|
+
const [dismissedHandoffs, setDismissedHandoffs] = (0, import_react26.useState)(
|
|
14542
|
+
() => /* @__PURE__ */ new Set()
|
|
14543
|
+
);
|
|
14544
|
+
const [handoffPending, setHandoffPending] = (0, import_react26.useState)(false);
|
|
14545
|
+
const handoffPendingRef = (0, import_react26.useRef)(false);
|
|
14546
|
+
const confirmHandoff = (0, import_react26.useCallback)(
|
|
14547
|
+
async (offer) => {
|
|
14548
|
+
const active = sessionRef.current;
|
|
14549
|
+
if (!active || handoffPendingRef.current) {
|
|
14550
|
+
return;
|
|
14551
|
+
}
|
|
14552
|
+
handoffPendingRef.current = true;
|
|
14553
|
+
setHandoffPending(true);
|
|
14554
|
+
try {
|
|
14555
|
+
const result = await requestHandoff({
|
|
14556
|
+
baseUrl,
|
|
14557
|
+
conversationId: active.conversationId,
|
|
14558
|
+
projectId,
|
|
14559
|
+
reason: offer.reason,
|
|
14560
|
+
sessionToken: active.sessionToken,
|
|
14561
|
+
toolCallId: offer.toolCallId
|
|
14562
|
+
});
|
|
14563
|
+
onAccepted();
|
|
14564
|
+
const next = markHandoffOfferInMessages(
|
|
14565
|
+
messagesRef.current,
|
|
14566
|
+
offer.toolCallId,
|
|
14567
|
+
{ resolved: true }
|
|
14568
|
+
);
|
|
14569
|
+
if (result.acknowledgment) {
|
|
14570
|
+
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
14571
|
+
setMessages([...next, toUiMessage(result.acknowledgment)]);
|
|
14572
|
+
} else {
|
|
14573
|
+
setMessages(next);
|
|
14574
|
+
}
|
|
14575
|
+
} catch {
|
|
14576
|
+
} finally {
|
|
14577
|
+
handoffPendingRef.current = false;
|
|
14578
|
+
setHandoffPending(false);
|
|
14579
|
+
}
|
|
14580
|
+
},
|
|
14581
|
+
[
|
|
14582
|
+
baseUrl,
|
|
14583
|
+
mergedIdsRef,
|
|
14584
|
+
messagesRef,
|
|
14585
|
+
onAccepted,
|
|
14586
|
+
projectId,
|
|
14587
|
+
sessionRef,
|
|
14588
|
+
setMessages
|
|
14589
|
+
]
|
|
14590
|
+
);
|
|
14591
|
+
const dismissHandoff = (0, import_react26.useCallback)(
|
|
14592
|
+
(toolCallId) => {
|
|
14593
|
+
setDismissedHandoffs((prev) => {
|
|
14594
|
+
if (prev.has(toolCallId)) {
|
|
14595
|
+
return prev;
|
|
14596
|
+
}
|
|
14597
|
+
const next = new Set(prev);
|
|
14598
|
+
next.add(toolCallId);
|
|
14599
|
+
return next;
|
|
14600
|
+
});
|
|
14601
|
+
setMessages(
|
|
14602
|
+
markHandoffOfferInMessages(messagesRef.current, toolCallId, {
|
|
14603
|
+
declined: true
|
|
14604
|
+
})
|
|
14605
|
+
);
|
|
14606
|
+
const active = sessionRef.current;
|
|
14607
|
+
if (!active) {
|
|
14608
|
+
return;
|
|
14609
|
+
}
|
|
14610
|
+
void requestHandoff({
|
|
14611
|
+
baseUrl,
|
|
14612
|
+
conversationId: active.conversationId,
|
|
14613
|
+
decision: "declined",
|
|
14614
|
+
projectId,
|
|
14615
|
+
sessionToken: active.sessionToken,
|
|
14616
|
+
toolCallId
|
|
14617
|
+
}).catch(() => {
|
|
14618
|
+
});
|
|
14619
|
+
},
|
|
14620
|
+
[baseUrl, messagesRef, projectId, sessionRef, setMessages]
|
|
14621
|
+
);
|
|
14622
|
+
(0, import_react26.useEffect)(() => {
|
|
14623
|
+
function reportUnansweredHandoffs() {
|
|
14624
|
+
const active = sessionRef.current;
|
|
14625
|
+
if (!active || handoffPendingRef.current) {
|
|
14626
|
+
return;
|
|
14627
|
+
}
|
|
14628
|
+
for (const offer of readOutstandingHandoffOffers(messagesRef.current)) {
|
|
14629
|
+
void requestHandoff({
|
|
14630
|
+
baseUrl,
|
|
14631
|
+
conversationId: active.conversationId,
|
|
14632
|
+
decision: "unanswered",
|
|
14633
|
+
keepalive: true,
|
|
14634
|
+
projectId,
|
|
14635
|
+
sessionToken: active.sessionToken,
|
|
14636
|
+
toolCallId: offer.toolCallId
|
|
14637
|
+
}).catch(() => {
|
|
14638
|
+
});
|
|
14639
|
+
}
|
|
14640
|
+
}
|
|
14641
|
+
window.addEventListener("pagehide", reportUnansweredHandoffs);
|
|
14642
|
+
return () => {
|
|
14643
|
+
window.removeEventListener("pagehide", reportUnansweredHandoffs);
|
|
14644
|
+
};
|
|
14645
|
+
}, [baseUrl, messagesRef, projectId, sessionRef]);
|
|
14646
|
+
return {
|
|
14647
|
+
confirmHandoff,
|
|
14648
|
+
dismissedHandoffs,
|
|
14649
|
+
dismissHandoff,
|
|
14650
|
+
handoffPending
|
|
14651
|
+
};
|
|
14652
|
+
}
|
|
14653
|
+
|
|
14406
14654
|
// src/lib/support/useInboundMessageChime.ts
|
|
14407
|
-
var
|
|
14655
|
+
var import_react27 = require("react");
|
|
14408
14656
|
function useInboundMessageChime({
|
|
14409
14657
|
isLoading,
|
|
14410
14658
|
messages
|
|
14411
14659
|
}) {
|
|
14412
|
-
const chimedMessageIdsRef = (0,
|
|
14413
|
-
const inboundChimeSeededRef = (0,
|
|
14414
|
-
(0,
|
|
14660
|
+
const chimedMessageIdsRef = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
|
|
14661
|
+
const inboundChimeSeededRef = (0, import_react27.useRef)(false);
|
|
14662
|
+
(0, import_react27.useEffect)(() => {
|
|
14415
14663
|
if (messages.length === 0) {
|
|
14416
14664
|
inboundChimeSeededRef.current = false;
|
|
14417
14665
|
chimedMessageIdsRef.current.clear();
|
|
@@ -14453,9 +14701,9 @@ function useInboundMessageChime({
|
|
|
14453
14701
|
}
|
|
14454
14702
|
|
|
14455
14703
|
// src/lib/support/useOverscrollBounce.ts
|
|
14456
|
-
var
|
|
14704
|
+
var import_react28 = require("react");
|
|
14457
14705
|
function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
14458
|
-
(0,
|
|
14706
|
+
(0, import_react28.useEffect)(() => {
|
|
14459
14707
|
const el = ref.current;
|
|
14460
14708
|
if (!el || !enabled || reduceMotion) {
|
|
14461
14709
|
return;
|
|
@@ -14511,13 +14759,13 @@ function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
|
14511
14759
|
}, [ref, enabled, reduceMotion]);
|
|
14512
14760
|
}
|
|
14513
14761
|
|
|
14514
|
-
// ../../support/shared/src/lib/supportPresenceConstants.ts
|
|
14762
|
+
// ../../support/shared/src/lib/presence/supportPresenceConstants.ts
|
|
14515
14763
|
var SUPPORT_TYPING_TTL_MS = 3e4;
|
|
14516
14764
|
var SUPPORT_TYPING_POLL_INTERVAL_MS = 4e3;
|
|
14517
14765
|
var SUPPORT_TYPING_REFRESH_MS = SUPPORT_TYPING_TTL_MS / 2;
|
|
14518
14766
|
var SUPPORT_TYPING_IDLE_MS = 8e3;
|
|
14519
14767
|
|
|
14520
|
-
// ../../support/shared/src/lib/createTypingPresenceController.ts
|
|
14768
|
+
// ../../support/shared/src/lib/presence/createTypingPresenceController.ts
|
|
14521
14769
|
function createTypingPresenceController({
|
|
14522
14770
|
ping,
|
|
14523
14771
|
isVisible = defaultIsVisible,
|
|
@@ -14636,16 +14884,16 @@ function defaultIsVisible() {
|
|
|
14636
14884
|
}
|
|
14637
14885
|
|
|
14638
14886
|
// src/lib/support/useSupportTypingPresence.ts
|
|
14639
|
-
var
|
|
14887
|
+
var import_react29 = require("react");
|
|
14640
14888
|
function useSupportTypingPresence({
|
|
14641
14889
|
baseUrl,
|
|
14642
14890
|
enabled,
|
|
14643
14891
|
projectId,
|
|
14644
14892
|
session
|
|
14645
14893
|
}) {
|
|
14646
|
-
const [typing, setTyping] = (0,
|
|
14647
|
-
const controllerRef = (0,
|
|
14648
|
-
(0,
|
|
14894
|
+
const [typing, setTyping] = (0, import_react29.useState)([]);
|
|
14895
|
+
const controllerRef = (0, import_react29.useRef)(null);
|
|
14896
|
+
(0, import_react29.useEffect)(() => {
|
|
14649
14897
|
if (!enabled || !session) {
|
|
14650
14898
|
setTyping([]);
|
|
14651
14899
|
controllerRef.current = null;
|
|
@@ -14679,14 +14927,192 @@ function useSupportTypingPresence({
|
|
|
14679
14927
|
};
|
|
14680
14928
|
}
|
|
14681
14929
|
|
|
14930
|
+
// src/lib/support/useVisitorConversationPersistence.ts
|
|
14931
|
+
var import_react30 = require("react");
|
|
14932
|
+
function useVisitorConversationPersistence({
|
|
14933
|
+
baseUrl,
|
|
14934
|
+
emailStorageKey,
|
|
14935
|
+
identity: identity2,
|
|
14936
|
+
onIdentityWipe,
|
|
14937
|
+
onResumed,
|
|
14938
|
+
projectId,
|
|
14939
|
+
sessionRef,
|
|
14940
|
+
storageKey,
|
|
14941
|
+
userJwt: userJwt2
|
|
14942
|
+
}) {
|
|
14943
|
+
const [session, setSessionState] = (0, import_react30.useState)(null);
|
|
14944
|
+
const [sessionHistory, setSessionHistory] = (0, import_react30.useState)([]);
|
|
14945
|
+
const [capturedEmail, setCapturedEmail] = (0, import_react30.useState)(null);
|
|
14946
|
+
const identityRef = (0, import_react30.useRef)(identity2);
|
|
14947
|
+
const userJwtRef = (0, import_react30.useRef)(userJwt2);
|
|
14948
|
+
const onIdentityWipeRef = (0, import_react30.useRef)(onIdentityWipe);
|
|
14949
|
+
const onResumedRef = (0, import_react30.useRef)(onResumed);
|
|
14950
|
+
const generationRef = (0, import_react30.useRef)(0);
|
|
14951
|
+
const pendingForgetRef = (0, import_react30.useRef)(Promise.resolve());
|
|
14952
|
+
const previousVisitorRef = (0, import_react30.useRef)(null);
|
|
14953
|
+
identityRef.current = identity2;
|
|
14954
|
+
userJwtRef.current = userJwt2;
|
|
14955
|
+
onIdentityWipeRef.current = onIdentityWipe;
|
|
14956
|
+
onResumedRef.current = onResumed;
|
|
14957
|
+
const visitorKey = `${userJwt2 ?? ""}\0${identity2?.distinctId ?? ""}\0${identity2?.email ?? ""}`;
|
|
14958
|
+
const setSession = (0, import_react30.useCallback)(
|
|
14959
|
+
(next) => {
|
|
14960
|
+
sessionRef.current = next;
|
|
14961
|
+
setSessionState(next);
|
|
14962
|
+
},
|
|
14963
|
+
[sessionRef]
|
|
14964
|
+
);
|
|
14965
|
+
const refreshSessionHistory = (0, import_react30.useCallback)(() => {
|
|
14966
|
+
const generation = generationRef.current;
|
|
14967
|
+
void (async () => {
|
|
14968
|
+
try {
|
|
14969
|
+
const rows = await listConversations({
|
|
14970
|
+
baseUrl,
|
|
14971
|
+
distinctId: identityRef.current?.distinctId,
|
|
14972
|
+
projectId,
|
|
14973
|
+
userJwt: userJwtRef.current ?? void 0
|
|
14974
|
+
});
|
|
14975
|
+
if (generation !== generationRef.current) {
|
|
14976
|
+
return;
|
|
14977
|
+
}
|
|
14978
|
+
setSessionHistory(toHistoryEntries(rows));
|
|
14979
|
+
} catch {
|
|
14980
|
+
if (generation !== generationRef.current) {
|
|
14981
|
+
return;
|
|
14982
|
+
}
|
|
14983
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
14984
|
+
}
|
|
14985
|
+
})();
|
|
14986
|
+
}, [baseUrl, projectId, storageKey]);
|
|
14987
|
+
(0, import_react30.useEffect)(() => {
|
|
14988
|
+
const stored = readStoredSession(storageKey);
|
|
14989
|
+
sessionRef.current = stored;
|
|
14990
|
+
setSessionState(stored);
|
|
14991
|
+
if (stored) {
|
|
14992
|
+
ensureActiveSessionInHistory(storageKey, stored);
|
|
14993
|
+
}
|
|
14994
|
+
try {
|
|
14995
|
+
const email = window.localStorage.getItem(emailStorageKey);
|
|
14996
|
+
if (email) {
|
|
14997
|
+
setCapturedEmail(email);
|
|
14998
|
+
}
|
|
14999
|
+
} catch {
|
|
15000
|
+
}
|
|
15001
|
+
}, [emailStorageKey, sessionRef, storageKey]);
|
|
15002
|
+
(0, import_react30.useEffect)(() => {
|
|
15003
|
+
const controller = new AbortController();
|
|
15004
|
+
generationRef.current += 1;
|
|
15005
|
+
const generation = generationRef.current;
|
|
15006
|
+
const ownerId = identityRef.current?.distinctId ?? identityRef.current?.email ?? null;
|
|
15007
|
+
const jwtPresent = Boolean(userJwtRef.current);
|
|
15008
|
+
const previous = previousVisitorRef.current;
|
|
15009
|
+
previousVisitorRef.current = { jwtPresent, ownerId };
|
|
15010
|
+
let wiped = false;
|
|
15011
|
+
if (ownerId) {
|
|
15012
|
+
wiped = reconcileSessionOwner(storageKey, ownerId).cleared;
|
|
15013
|
+
} else if (previous && (previous.ownerId || previous.jwtPresent) && !jwtPresent) {
|
|
15014
|
+
clearChatStorage(storageKey);
|
|
15015
|
+
wiped = true;
|
|
15016
|
+
}
|
|
15017
|
+
if (wiped) {
|
|
15018
|
+
sessionRef.current = null;
|
|
15019
|
+
setSessionState(null);
|
|
15020
|
+
setSessionHistory([]);
|
|
15021
|
+
try {
|
|
15022
|
+
window.localStorage.removeItem(emailStorageKey);
|
|
15023
|
+
} catch {
|
|
15024
|
+
}
|
|
15025
|
+
setCapturedEmail(null);
|
|
15026
|
+
onIdentityWipeRef.current();
|
|
15027
|
+
pendingForgetRef.current = (async () => {
|
|
15028
|
+
try {
|
|
15029
|
+
await forgetVisitorSession({ baseUrl, projectId });
|
|
15030
|
+
} catch {
|
|
15031
|
+
}
|
|
15032
|
+
})();
|
|
15033
|
+
}
|
|
15034
|
+
async function sync() {
|
|
15035
|
+
await pendingForgetRef.current;
|
|
15036
|
+
if (controller.signal.aborted) {
|
|
15037
|
+
return;
|
|
15038
|
+
}
|
|
15039
|
+
const distinctId = identityRef.current?.distinctId;
|
|
15040
|
+
const jwt = userJwtRef.current ?? void 0;
|
|
15041
|
+
const [listResult, resumeResult] = await Promise.allSettled([
|
|
15042
|
+
listConversations({
|
|
15043
|
+
baseUrl,
|
|
15044
|
+
distinctId,
|
|
15045
|
+
projectId,
|
|
15046
|
+
userJwt: jwt
|
|
15047
|
+
}),
|
|
15048
|
+
resumeSession({
|
|
15049
|
+
baseUrl,
|
|
15050
|
+
distinctId,
|
|
15051
|
+
projectId,
|
|
15052
|
+
userJwt: jwt
|
|
15053
|
+
})
|
|
15054
|
+
]);
|
|
15055
|
+
if (controller.signal.aborted || generation !== generationRef.current) {
|
|
15056
|
+
return;
|
|
15057
|
+
}
|
|
15058
|
+
if (listResult.status === "fulfilled") {
|
|
15059
|
+
setSessionHistory(toHistoryEntries(listResult.value));
|
|
15060
|
+
} else {
|
|
15061
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
15062
|
+
}
|
|
15063
|
+
if (resumeResult.status !== "fulfilled" || !resumeResult.value) {
|
|
15064
|
+
return;
|
|
15065
|
+
}
|
|
15066
|
+
const resumed = resumeResult.value;
|
|
15067
|
+
const next = {
|
|
15068
|
+
conversationId: resumed.conversationId,
|
|
15069
|
+
sessionToken: resumed.sessionToken
|
|
15070
|
+
};
|
|
15071
|
+
sessionRef.current = next;
|
|
15072
|
+
setSessionState(next);
|
|
15073
|
+
storeSession(storageKey, next);
|
|
15074
|
+
ensureActiveSessionInHistory(storageKey, next);
|
|
15075
|
+
onResumedRef.current(resumed.conversation);
|
|
15076
|
+
}
|
|
15077
|
+
void sync();
|
|
15078
|
+
return () => {
|
|
15079
|
+
controller.abort();
|
|
15080
|
+
};
|
|
15081
|
+
}, [baseUrl, emailStorageKey, projectId, sessionRef, storageKey, visitorKey]);
|
|
15082
|
+
return {
|
|
15083
|
+
capturedEmail,
|
|
15084
|
+
refreshSessionHistory,
|
|
15085
|
+
session,
|
|
15086
|
+
sessionHistory,
|
|
15087
|
+
setCapturedEmail,
|
|
15088
|
+
setSession
|
|
15089
|
+
};
|
|
15090
|
+
}
|
|
15091
|
+
function toHistoryEntries(rows) {
|
|
15092
|
+
return rows.map((row) => ({
|
|
15093
|
+
conversationId: row.conversationId,
|
|
15094
|
+
preview: row.preview,
|
|
15095
|
+
sessionToken: row.sessionToken,
|
|
15096
|
+
updatedAt: row.updatedAt
|
|
15097
|
+
}));
|
|
15098
|
+
}
|
|
15099
|
+
|
|
14682
15100
|
// src/lib/support/useWidgetFrameSizing.ts
|
|
14683
|
-
var
|
|
15101
|
+
var import_react31 = require("react");
|
|
14684
15102
|
|
|
14685
15103
|
// src/lib/support/widget-sizing.ts
|
|
14686
15104
|
var BRANDING_CACHE_PREFIX = "saasco-chat-branding:";
|
|
15105
|
+
var sizeToIframeViewport = false;
|
|
14687
15106
|
function brandingCacheKey(projectId) {
|
|
14688
15107
|
return `${BRANDING_CACHE_PREFIX}${projectId}`;
|
|
14689
15108
|
}
|
|
15109
|
+
function widgetSessionStorageKeys(projectId, preview) {
|
|
15110
|
+
const slot = preview ? `preview:${projectId}` : projectId;
|
|
15111
|
+
return {
|
|
15112
|
+
emailStorageKey: `saasco-chat-email:${slot}`,
|
|
15113
|
+
storageKey: `saasco-chat-session:${slot}`
|
|
15114
|
+
};
|
|
15115
|
+
}
|
|
14690
15116
|
function readBrandingCache(projectId) {
|
|
14691
15117
|
try {
|
|
14692
15118
|
const raw = window.sessionStorage.getItem(brandingCacheKey(projectId));
|
|
@@ -14718,6 +15144,9 @@ function resolveSizingViewport() {
|
|
|
14718
15144
|
if (host) {
|
|
14719
15145
|
return host;
|
|
14720
15146
|
}
|
|
15147
|
+
if (sizeToIframeViewport && typeof window !== "undefined") {
|
|
15148
|
+
return { height: window.innerHeight, width: window.innerWidth };
|
|
15149
|
+
}
|
|
14721
15150
|
if (isCrossOriginEmbed()) {
|
|
14722
15151
|
return {
|
|
14723
15152
|
height: PANEL_MAX_HEIGHT_PX + PANEL_VERTICAL_RESERVE_PX,
|
|
@@ -14726,20 +15155,29 @@ function resolveSizingViewport() {
|
|
|
14726
15155
|
}
|
|
14727
15156
|
return { height: window.innerHeight, width: window.innerWidth };
|
|
14728
15157
|
}
|
|
14729
|
-
function
|
|
15158
|
+
function widgetScale() {
|
|
15159
|
+
if (sizeToIframeViewport) {
|
|
15160
|
+
return { effectiveWidth: PANEL_WIDTH_PX, isMobile: false, scale: 1 };
|
|
15161
|
+
}
|
|
14730
15162
|
const host = getHostViewport();
|
|
14731
15163
|
if (host) {
|
|
14732
|
-
return host
|
|
15164
|
+
return readWidgetScaleMetrics(host);
|
|
14733
15165
|
}
|
|
14734
15166
|
if (isCrossOriginEmbed()) {
|
|
14735
|
-
return false;
|
|
15167
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
14736
15168
|
}
|
|
14737
|
-
return
|
|
15169
|
+
return readWidgetScaleMetrics();
|
|
15170
|
+
}
|
|
15171
|
+
function isDashboardPreview() {
|
|
15172
|
+
return sizeToIframeViewport;
|
|
14738
15173
|
}
|
|
14739
15174
|
function clampPanelDimensions(viewport, fullscreen) {
|
|
14740
15175
|
if (fullscreen) {
|
|
14741
15176
|
return { height: viewport.height, width: viewport.width };
|
|
14742
15177
|
}
|
|
15178
|
+
if (sizeToIframeViewport) {
|
|
15179
|
+
return { height: PANEL_MAX_HEIGHT_PX, width: PANEL_WIDTH_PX };
|
|
15180
|
+
}
|
|
14743
15181
|
return {
|
|
14744
15182
|
height: Math.min(
|
|
14745
15183
|
PANEL_MAX_HEIGHT_PX,
|
|
@@ -14752,21 +15190,30 @@ function clampPanelDimensions(viewport, fullscreen) {
|
|
|
14752
15190
|
};
|
|
14753
15191
|
}
|
|
14754
15192
|
function computeFrameDimensions(isOpen) {
|
|
15193
|
+
const { isMobile, scale: scale2 } = widgetScale();
|
|
15194
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
14755
15195
|
if (!isOpen) {
|
|
14756
|
-
|
|
14757
|
-
fullscreen: false,
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
};
|
|
15196
|
+
if (hostOwnsLauncher2) {
|
|
15197
|
+
return { fullscreen: false, height: 0, width: 0 };
|
|
15198
|
+
}
|
|
15199
|
+
const closed = closedFrameSizePx(scale2);
|
|
15200
|
+
return { fullscreen: false, height: closed, width: closed };
|
|
14761
15201
|
}
|
|
14762
|
-
const fullscreen =
|
|
15202
|
+
const fullscreen = isMobile;
|
|
14763
15203
|
const panel = clampPanelDimensions(resolveSizingViewport(), fullscreen);
|
|
14764
15204
|
if (fullscreen) {
|
|
14765
15205
|
return { fullscreen: true, height: panel.height, width: panel.width };
|
|
14766
15206
|
}
|
|
15207
|
+
if (hostOwnsLauncher2) {
|
|
15208
|
+
return {
|
|
15209
|
+
fullscreen: false,
|
|
15210
|
+
height: panel.height,
|
|
15211
|
+
width: panel.width
|
|
15212
|
+
};
|
|
15213
|
+
}
|
|
14767
15214
|
return {
|
|
14768
15215
|
fullscreen: false,
|
|
14769
|
-
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX +
|
|
15216
|
+
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX + launcherButtonPx(scale2) + ROOT_PADDING_PX,
|
|
14770
15217
|
width: panel.width + ROOT_HORIZONTAL_PADDING_PX
|
|
14771
15218
|
};
|
|
14772
15219
|
}
|
|
@@ -14776,18 +15223,18 @@ function useWidgetFrameSizing({
|
|
|
14776
15223
|
isOpen,
|
|
14777
15224
|
rootElRef
|
|
14778
15225
|
}) {
|
|
14779
|
-
const isOpenRef = (0,
|
|
15226
|
+
const isOpenRef = (0, import_react31.useRef)(isOpen);
|
|
14780
15227
|
isOpenRef.current = isOpen;
|
|
14781
|
-
const syncFrameRef = (0,
|
|
14782
|
-
const [isMobile, setIsMobile] = (0,
|
|
14783
|
-
(0,
|
|
15228
|
+
const syncFrameRef = (0, import_react31.useRef)(null);
|
|
15229
|
+
const [isMobile, setIsMobile] = (0, import_react31.useState)(false);
|
|
15230
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
14784
15231
|
const rootEl = rootElRef.current;
|
|
14785
15232
|
if (!rootEl) {
|
|
14786
15233
|
return;
|
|
14787
15234
|
}
|
|
14788
15235
|
const syncPanelVars = () => {
|
|
14789
15236
|
const sizingViewport = resolveSizingViewport();
|
|
14790
|
-
const mobile =
|
|
15237
|
+
const { isMobile: mobile, scale: scale2 } = widgetScale();
|
|
14791
15238
|
setIsMobile(mobile);
|
|
14792
15239
|
const panel = clampPanelDimensions(sizingViewport, mobile);
|
|
14793
15240
|
rootEl.style.setProperty("--scw-panel-width", `${panel.width}px`);
|
|
@@ -14796,8 +15243,19 @@ function useWidgetFrameSizing({
|
|
|
14796
15243
|
"--scw-host-viewport-width",
|
|
14797
15244
|
`${sizingViewport.width}px`
|
|
14798
15245
|
);
|
|
15246
|
+
rootEl.style.setProperty(
|
|
15247
|
+
"--scw-launcher-size",
|
|
15248
|
+
`${launcherButtonPx(scale2)}px`
|
|
15249
|
+
);
|
|
15250
|
+
rootEl.style.setProperty(
|
|
15251
|
+
"--scw-launcher-icon-size",
|
|
15252
|
+
`${scaledPx(LAUNCHER_ICON_BASE_PX, scale2)}px`
|
|
15253
|
+
);
|
|
14799
15254
|
};
|
|
14800
15255
|
const syncFrameSize = () => {
|
|
15256
|
+
if (isDashboardPreview()) {
|
|
15257
|
+
return;
|
|
15258
|
+
}
|
|
14801
15259
|
const computed = computeFrameDimensions(isOpenRef.current);
|
|
14802
15260
|
if (isCrossOriginEmbed()) {
|
|
14803
15261
|
postResize(
|
|
@@ -14805,6 +15263,7 @@ function useWidgetFrameSizing({
|
|
|
14805
15263
|
Math.ceil(computed.height),
|
|
14806
15264
|
computed.fullscreen
|
|
14807
15265
|
);
|
|
15266
|
+
postOpenState(isOpenRef.current, computed.fullscreen);
|
|
14808
15267
|
return;
|
|
14809
15268
|
}
|
|
14810
15269
|
const rect = rootEl.getBoundingClientRect();
|
|
@@ -14831,7 +15290,7 @@ function useWidgetFrameSizing({
|
|
|
14831
15290
|
unsubscribe();
|
|
14832
15291
|
};
|
|
14833
15292
|
}, [rootElRef]);
|
|
14834
|
-
(0,
|
|
15293
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
14835
15294
|
syncFrameRef.current?.();
|
|
14836
15295
|
}, [isOpen]);
|
|
14837
15296
|
return { isMobile, syncFrameRef };
|
|
@@ -14914,9 +15373,20 @@ function resolveActiveTransition(reduceMotion, viewTransition) {
|
|
|
14914
15373
|
}
|
|
14915
15374
|
return viewTransition;
|
|
14916
15375
|
}
|
|
15376
|
+
function shouldShowWaitingForTeammate({
|
|
15377
|
+
agentMuted,
|
|
15378
|
+
conversationState,
|
|
15379
|
+
isTyping,
|
|
15380
|
+
messages
|
|
15381
|
+
}) {
|
|
15382
|
+
if (!agentMuted || isTyping || conversationState === "closed") {
|
|
15383
|
+
return false;
|
|
15384
|
+
}
|
|
15385
|
+
return messages.at(-1)?.role === "user";
|
|
15386
|
+
}
|
|
14917
15387
|
|
|
14918
15388
|
// src/lib/support/WidgetLauncher.tsx
|
|
14919
|
-
var
|
|
15389
|
+
var import_react32 = require("react");
|
|
14920
15390
|
|
|
14921
15391
|
// src/lib/support/LauncherIcon.tsx
|
|
14922
15392
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -14927,7 +15397,7 @@ function LauncherIcon({
|
|
|
14927
15397
|
const transition = reduceMotion ? { duration: 0 } : LAUNCHER_ICON_TRANSITION;
|
|
14928
15398
|
const exitRotate = isOpen ? -LAUNCHER_ICON_ROTATE_DEG : LAUNCHER_ICON_ROTATE_DEG;
|
|
14929
15399
|
const enterRotate = isOpen ? LAUNCHER_ICON_ROTATE_DEG : -LAUNCHER_ICON_ROTATE_DEG;
|
|
14930
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "relative flex size-[25px] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
15400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "relative flex size-[var(--scw-launcher-icon-size,25px)] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:size-full [&_svg]:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
14931
15401
|
motion.span,
|
|
14932
15402
|
{
|
|
14933
15403
|
animate: { opacity: 1, rotate: 0, scale: 1 },
|
|
@@ -14950,13 +15420,14 @@ function WidgetLauncher({
|
|
|
14950
15420
|
onClose
|
|
14951
15421
|
}) {
|
|
14952
15422
|
const isEmbedded = isCrossOriginEmbed();
|
|
14953
|
-
const
|
|
15423
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
15424
|
+
const launcherPointerRef = (0, import_react32.useRef)({ hovered: false, pressed: false });
|
|
14954
15425
|
const launcherButtonTransition = reduceMotion ? { duration: 0 } : LAUNCHER_BUTTON_TRANSITION;
|
|
14955
|
-
const syncLauncherState = (0,
|
|
15426
|
+
const syncLauncherState = (0, import_react32.useCallback)(
|
|
14956
15427
|
(next) => {
|
|
14957
15428
|
const state = { ...launcherPointerRef.current, ...next };
|
|
14958
15429
|
launcherPointerRef.current = state;
|
|
14959
|
-
if (!isEmbedded) {
|
|
15430
|
+
if (!isEmbedded || hostOwnsLauncher2) {
|
|
14960
15431
|
return;
|
|
14961
15432
|
}
|
|
14962
15433
|
postLauncherState(
|
|
@@ -14964,18 +15435,21 @@ function WidgetLauncher({
|
|
|
14964
15435
|
state.hovered
|
|
14965
15436
|
);
|
|
14966
15437
|
},
|
|
14967
|
-
[isEmbedded, reduceMotion]
|
|
15438
|
+
[hostOwnsLauncher2, isEmbedded, reduceMotion]
|
|
14968
15439
|
);
|
|
14969
15440
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
14970
15441
|
motion.button,
|
|
14971
15442
|
{
|
|
14972
15443
|
"aria-label": isOpen ? "Close chat" : "Open chat",
|
|
14973
15444
|
className: cn(
|
|
14974
|
-
|
|
14975
|
-
|
|
15445
|
+
// Sized from the host viewport (see useWidgetFrameSizing) so the bubble
|
|
15446
|
+
// keeps its footing on a wide phone — and stays exactly as tall as the
|
|
15447
|
+
// social-proof toast that anchors beside it.
|
|
15448
|
+
"flex size-[var(--scw-launcher-size,60px)] shrink-0 origin-center cursor-pointer items-center justify-center rounded-full border-none bg-white text-neutral-900 outline-none [-webkit-tap-highlight-color:transparent]",
|
|
15449
|
+
isEmbedded ? "shadow-[inset_0_0_0_1px_var(--scw-hairline)]" : "shadow-[0_0_0_1px_var(--scw-hairline),0_4px_12px_-2px_rgba(0,0,0,.12),0_2px_4px_-2px_rgba(0,0,0,.08)]",
|
|
14976
15450
|
"transition-[background-color,box-shadow] duration-[280ms] ease-[cubic-bezier(.32,.72,0,1)]",
|
|
14977
15451
|
!reduceMotion && "hover:bg-neutral-100",
|
|
14978
|
-
!reduceMotion && (isEmbedded ? "hover:shadow-[
|
|
15452
|
+
!reduceMotion && (isEmbedded ? "hover:shadow-[inset_0_0_0_1px_var(--scw-hairline-strong)]" : "hover:shadow-[0_0_0_1px_var(--scw-hairline-strong),0_4px_12px_-2px_rgba(0,0,0,.14),0_2px_4px_-2px_rgba(0,0,0,.1)]")
|
|
14979
15453
|
),
|
|
14980
15454
|
onClick: isOpen ? onClose : onOpen,
|
|
14981
15455
|
onHoverEnd: () => syncLauncherState({ hovered: false }),
|
|
@@ -15012,7 +15486,7 @@ function Avatar({
|
|
|
15012
15486
|
large
|
|
15013
15487
|
}) {
|
|
15014
15488
|
const base = cn(
|
|
15015
|
-
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[
|
|
15489
|
+
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[0_0_0_1px_var(--scw-ink)]",
|
|
15016
15490
|
large && "size-12 text-lg",
|
|
15017
15491
|
"[&_img]:block [&_img]:size-full [&_img]:scale-[1.08] [&_img]:object-cover"
|
|
15018
15492
|
);
|
|
@@ -15034,9 +15508,124 @@ function Avatar({
|
|
|
15034
15508
|
}
|
|
15035
15509
|
|
|
15036
15510
|
// src/lib/support/CompactTime.tsx
|
|
15037
|
-
var
|
|
15511
|
+
var import_react34 = require("react");
|
|
15512
|
+
|
|
15513
|
+
// ../../support/shared/src/lib/message/splitLightMarkdownBlocks.ts
|
|
15514
|
+
var DELIMITER_CELL_PATTERN = /^:?-+:?$/u;
|
|
15515
|
+
function splitLightMarkdownBlocks(text) {
|
|
15516
|
+
if (!text.includes("|")) {
|
|
15517
|
+
return text ? [{ type: "text", text }] : [];
|
|
15518
|
+
}
|
|
15519
|
+
const lines = text.split(/\r?\n/u);
|
|
15520
|
+
const blocks = [];
|
|
15521
|
+
const pending = [];
|
|
15522
|
+
let index2 = 0;
|
|
15523
|
+
while (index2 < lines.length) {
|
|
15524
|
+
const parsed = readTableAt(lines, index2);
|
|
15525
|
+
if (!parsed) {
|
|
15526
|
+
pending.push(lines[index2] ?? "");
|
|
15527
|
+
index2 += 1;
|
|
15528
|
+
continue;
|
|
15529
|
+
}
|
|
15530
|
+
flushPendingText(blocks, pending);
|
|
15531
|
+
blocks.push({ type: "table", table: parsed.table });
|
|
15532
|
+
index2 = parsed.end;
|
|
15533
|
+
}
|
|
15534
|
+
flushPendingText(blocks, pending);
|
|
15535
|
+
return blocks;
|
|
15536
|
+
}
|
|
15537
|
+
function flushPendingText(blocks, pending) {
|
|
15538
|
+
if (pending.length === 0) {
|
|
15539
|
+
return;
|
|
15540
|
+
}
|
|
15541
|
+
blocks.push({ type: "text", text: pending.join("\n") });
|
|
15542
|
+
pending.length = 0;
|
|
15543
|
+
}
|
|
15544
|
+
function readTableAt(lines, start) {
|
|
15545
|
+
const headers = splitTableCells(lines[start] ?? "");
|
|
15546
|
+
const delimiter = splitTableCells(lines[start + 1] ?? "");
|
|
15547
|
+
if (!headers || !delimiter || headers.length === 0 || delimiter.length !== headers.length || !delimiter.every(isDelimiterCell)) {
|
|
15548
|
+
return null;
|
|
15549
|
+
}
|
|
15550
|
+
const rows = [];
|
|
15551
|
+
let end = start + 2;
|
|
15552
|
+
while (end < lines.length) {
|
|
15553
|
+
const row = splitTableCells(lines[end] ?? "");
|
|
15554
|
+
if (!row) {
|
|
15555
|
+
break;
|
|
15556
|
+
}
|
|
15557
|
+
rows.push(fitRow(row, headers.length));
|
|
15558
|
+
end += 1;
|
|
15559
|
+
}
|
|
15560
|
+
return {
|
|
15561
|
+
end,
|
|
15562
|
+
table: {
|
|
15563
|
+
aligns: delimiter.map(alignFromDelimiterCell),
|
|
15564
|
+
headers: fitRow(headers, headers.length),
|
|
15565
|
+
rows
|
|
15566
|
+
}
|
|
15567
|
+
};
|
|
15568
|
+
}
|
|
15569
|
+
function splitTableCells(line) {
|
|
15570
|
+
if (!line.includes("|")) {
|
|
15571
|
+
return null;
|
|
15572
|
+
}
|
|
15573
|
+
const cells = [];
|
|
15574
|
+
let current = "";
|
|
15575
|
+
const trimmed = trimOuterPipes(line.trim());
|
|
15576
|
+
for (let index2 = 0; index2 < trimmed.length; index2 += 1) {
|
|
15577
|
+
const char = trimmed[index2];
|
|
15578
|
+
if (char === "\\" && trimmed[index2 + 1] === "|") {
|
|
15579
|
+
current += "|";
|
|
15580
|
+
index2 += 1;
|
|
15581
|
+
continue;
|
|
15582
|
+
}
|
|
15583
|
+
if (char === "|") {
|
|
15584
|
+
cells.push(current.trim());
|
|
15585
|
+
current = "";
|
|
15586
|
+
continue;
|
|
15587
|
+
}
|
|
15588
|
+
current += char;
|
|
15589
|
+
}
|
|
15590
|
+
cells.push(current.trim());
|
|
15591
|
+
return cells;
|
|
15592
|
+
}
|
|
15593
|
+
function trimOuterPipes(line) {
|
|
15594
|
+
let start = 0;
|
|
15595
|
+
let end = line.length;
|
|
15596
|
+
if (line.startsWith("|")) {
|
|
15597
|
+
start = 1;
|
|
15598
|
+
}
|
|
15599
|
+
if (line.endsWith("|") && !line.endsWith("\\|")) {
|
|
15600
|
+
end -= 1;
|
|
15601
|
+
}
|
|
15602
|
+
return line.slice(start, end);
|
|
15603
|
+
}
|
|
15604
|
+
function isDelimiterCell(cell) {
|
|
15605
|
+
const compact = cell.replaceAll(" ", "");
|
|
15606
|
+
return DELIMITER_CELL_PATTERN.test(compact) && compact.includes("-");
|
|
15607
|
+
}
|
|
15608
|
+
function alignFromDelimiterCell(cell) {
|
|
15609
|
+
const compact = cell.replaceAll(" ", "");
|
|
15610
|
+
const left = compact.startsWith(":");
|
|
15611
|
+
const right = compact.endsWith(":");
|
|
15612
|
+
if (left && right) {
|
|
15613
|
+
return "center";
|
|
15614
|
+
}
|
|
15615
|
+
if (right) {
|
|
15616
|
+
return "right";
|
|
15617
|
+
}
|
|
15618
|
+
return "left";
|
|
15619
|
+
}
|
|
15620
|
+
function fitRow(cells, columnCount) {
|
|
15621
|
+
const row = cells.slice(0, columnCount);
|
|
15622
|
+
while (row.length < columnCount) {
|
|
15623
|
+
row.push("");
|
|
15624
|
+
}
|
|
15625
|
+
return row;
|
|
15626
|
+
}
|
|
15038
15627
|
|
|
15039
|
-
// ../../support/shared/src/lib/formatBotMessageContentForInbox.ts
|
|
15628
|
+
// ../../support/shared/src/lib/message/formatBotMessageContentForInbox.ts
|
|
15040
15629
|
var ATX_HEADING_PATTERN = /^#{1,6}[ \t]+(.+)$/gmu;
|
|
15041
15630
|
function normalizeMarkdownHeadings(text) {
|
|
15042
15631
|
return text.replace(ATX_HEADING_PATTERN, (_match, content) => {
|
|
@@ -15055,7 +15644,7 @@ function normalizeMarkdownHeadings(text) {
|
|
|
15055
15644
|
var import_ai5 = require("ai");
|
|
15056
15645
|
|
|
15057
15646
|
// src/lib/support/KbCitationBadge.tsx
|
|
15058
|
-
var
|
|
15647
|
+
var import_react33 = require("react");
|
|
15059
15648
|
|
|
15060
15649
|
// src/lib/support/hostname.ts
|
|
15061
15650
|
function readHostnameFromHref(href) {
|
|
@@ -15077,20 +15666,20 @@ function KbCitationBadge({
|
|
|
15077
15666
|
number: number2
|
|
15078
15667
|
}) {
|
|
15079
15668
|
const hostname = readHostnameFromHref(article.url);
|
|
15080
|
-
const [open, setOpen] = (0,
|
|
15081
|
-
const closeTimeoutRef = (0,
|
|
15082
|
-
const rootRef = (0,
|
|
15083
|
-
const popoverRef = (0,
|
|
15669
|
+
const [open, setOpen] = (0, import_react33.useState)(false);
|
|
15670
|
+
const closeTimeoutRef = (0, import_react33.useRef)(null);
|
|
15671
|
+
const rootRef = (0, import_react33.useRef)(null);
|
|
15672
|
+
const popoverRef = (0, import_react33.useRef)(null);
|
|
15084
15673
|
function clearCloseTimeout() {
|
|
15085
15674
|
if (closeTimeoutRef.current) {
|
|
15086
15675
|
clearTimeout(closeTimeoutRef.current);
|
|
15087
15676
|
closeTimeoutRef.current = null;
|
|
15088
15677
|
}
|
|
15089
15678
|
}
|
|
15090
|
-
const resetPopoverShift = (0,
|
|
15679
|
+
const resetPopoverShift = (0, import_react33.useCallback)(() => {
|
|
15091
15680
|
popoverRef.current?.style.removeProperty("--scw-citation-popover-shift");
|
|
15092
15681
|
}, []);
|
|
15093
|
-
const alignPopover = (0,
|
|
15682
|
+
const alignPopover = (0, import_react33.useCallback)(() => {
|
|
15094
15683
|
const root = rootRef.current;
|
|
15095
15684
|
const popover = popoverRef.current;
|
|
15096
15685
|
if (!root || !popover) {
|
|
@@ -15118,13 +15707,13 @@ function KbCitationBadge({
|
|
|
15118
15707
|
shift === 0 ? "0px" : `${shift}px`
|
|
15119
15708
|
);
|
|
15120
15709
|
}, [resetPopoverShift]);
|
|
15121
|
-
const attachPopoverListeners = (0,
|
|
15710
|
+
const attachPopoverListeners = (0, import_react33.useCallback)(() => {
|
|
15122
15711
|
alignPopover();
|
|
15123
15712
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15124
15713
|
scroller?.addEventListener("scroll", alignPopover, { passive: true });
|
|
15125
15714
|
window.addEventListener("resize", alignPopover, { passive: true });
|
|
15126
15715
|
}, [alignPopover]);
|
|
15127
|
-
const detachPopoverListeners = (0,
|
|
15716
|
+
const detachPopoverListeners = (0, import_react33.useCallback)(() => {
|
|
15128
15717
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15129
15718
|
scroller?.removeEventListener("scroll", alignPopover);
|
|
15130
15719
|
window.removeEventListener("resize", alignPopover);
|
|
@@ -15141,7 +15730,7 @@ function KbCitationBadge({
|
|
|
15141
15730
|
closeTimeoutRef.current = null;
|
|
15142
15731
|
}, 80);
|
|
15143
15732
|
}
|
|
15144
|
-
(0,
|
|
15733
|
+
(0, import_react33.useEffect)(() => {
|
|
15145
15734
|
if (!open) {
|
|
15146
15735
|
detachPopoverListeners();
|
|
15147
15736
|
return;
|
|
@@ -15149,7 +15738,7 @@ function KbCitationBadge({
|
|
|
15149
15738
|
attachPopoverListeners();
|
|
15150
15739
|
return detachPopoverListeners;
|
|
15151
15740
|
}, [open, attachPopoverListeners, detachPopoverListeners]);
|
|
15152
|
-
(0,
|
|
15741
|
+
(0, import_react33.useEffect)(
|
|
15153
15742
|
() => () => {
|
|
15154
15743
|
clearCloseTimeout();
|
|
15155
15744
|
detachPopoverListeners();
|
|
@@ -15342,17 +15931,86 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15342
15931
|
);
|
|
15343
15932
|
const { body, pendingLinkLabel } = isStreaming ? splitStreamingTail(normalizedText) : { body: normalizedText, pendingLinkLabel: null };
|
|
15344
15933
|
const citationNumbers = buildKbCitationNumberMap(body);
|
|
15934
|
+
const nodes = [];
|
|
15935
|
+
for (const [blockIndex, block] of splitLightMarkdownBlocks(body).entries()) {
|
|
15936
|
+
if (block.type === "table") {
|
|
15937
|
+
nodes.push(
|
|
15938
|
+
renderMessageTable(
|
|
15939
|
+
block.table,
|
|
15940
|
+
kbArticles,
|
|
15941
|
+
citationNumbers,
|
|
15942
|
+
`tbl-${blockIndex}`
|
|
15943
|
+
)
|
|
15944
|
+
);
|
|
15945
|
+
continue;
|
|
15946
|
+
}
|
|
15947
|
+
nodes.push(
|
|
15948
|
+
...renderInlineMessageText(
|
|
15949
|
+
block.text,
|
|
15950
|
+
kbArticles,
|
|
15951
|
+
citationNumbers,
|
|
15952
|
+
`b-${blockIndex}`
|
|
15953
|
+
)
|
|
15954
|
+
);
|
|
15955
|
+
}
|
|
15956
|
+
if (pendingLinkLabel) {
|
|
15957
|
+
nodes.push(
|
|
15958
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: LINK_CLASS_NAME, children: renderPlainTextWithBold(pendingLinkLabel, "lnk-pending") }, "lnk-pending")
|
|
15959
|
+
);
|
|
15960
|
+
}
|
|
15961
|
+
return nodes.length > 0 ? nodes : renderPlainTextWithBold(body, "full");
|
|
15962
|
+
}
|
|
15963
|
+
function renderMessageTable(table, kbArticles, citationNumbers, keyPrefix) {
|
|
15964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
15965
|
+
"div",
|
|
15966
|
+
{
|
|
15967
|
+
className: "my-2 max-w-full overflow-x-auto whitespace-normal",
|
|
15968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "w-full border-collapse text-[13px] leading-[1.35]", children: [
|
|
15969
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { children: table.headers.map((cell, index2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
15970
|
+
"th",
|
|
15971
|
+
{
|
|
15972
|
+
className: "border border-border bg-neutral-50 px-2 py-1.5 font-semibold",
|
|
15973
|
+
style: { textAlign: table.aligns[index2] ?? "left" },
|
|
15974
|
+
children: renderInlineMessageText(
|
|
15975
|
+
cell,
|
|
15976
|
+
kbArticles,
|
|
15977
|
+
citationNumbers,
|
|
15978
|
+
`${keyPrefix}-h-${index2}`
|
|
15979
|
+
)
|
|
15980
|
+
},
|
|
15981
|
+
`${keyPrefix}-h-${index2}`
|
|
15982
|
+
)) }) }),
|
|
15983
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
15984
|
+
"td",
|
|
15985
|
+
{
|
|
15986
|
+
className: "border border-border px-2 py-1.5 align-top",
|
|
15987
|
+
style: { textAlign: table.aligns[cellIndex] ?? "left" },
|
|
15988
|
+
children: renderInlineMessageText(
|
|
15989
|
+
cell,
|
|
15990
|
+
kbArticles,
|
|
15991
|
+
citationNumbers,
|
|
15992
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
15993
|
+
)
|
|
15994
|
+
},
|
|
15995
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
15996
|
+
)) }, `${keyPrefix}-r-${rowIndex}`)) })
|
|
15997
|
+
] })
|
|
15998
|
+
},
|
|
15999
|
+
keyPrefix
|
|
16000
|
+
);
|
|
16001
|
+
}
|
|
16002
|
+
function renderInlineMessageText(text, kbArticles, citationNumbers, keyPrefix) {
|
|
15345
16003
|
const nodes = [];
|
|
15346
16004
|
let lastIndex = 0;
|
|
15347
16005
|
let tokenIndex = 0;
|
|
15348
16006
|
MESSAGE_CONTENT_PATTERN.lastIndex = 0;
|
|
15349
|
-
let match = MESSAGE_CONTENT_PATTERN.exec(
|
|
16007
|
+
let match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15350
16008
|
while (match !== null) {
|
|
15351
16009
|
if (match.index > lastIndex) {
|
|
15352
16010
|
nodes.push(
|
|
15353
16011
|
renderPlainTextWithBold(
|
|
15354
|
-
|
|
15355
|
-
|
|
16012
|
+
text.slice(lastIndex, match.index),
|
|
16013
|
+
`${keyPrefix}-t-${tokenIndex}`
|
|
15356
16014
|
)
|
|
15357
16015
|
);
|
|
15358
16016
|
}
|
|
@@ -15369,7 +16027,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15369
16027
|
article,
|
|
15370
16028
|
number: number2
|
|
15371
16029
|
},
|
|
15372
|
-
|
|
16030
|
+
`${keyPrefix}-cite-${tokenIndex}`
|
|
15373
16031
|
)
|
|
15374
16032
|
);
|
|
15375
16033
|
}
|
|
@@ -15395,7 +16053,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15395
16053
|
target: "_blank",
|
|
15396
16054
|
children: label
|
|
15397
16055
|
},
|
|
15398
|
-
|
|
16056
|
+
`${keyPrefix}-lnk-${tokenIndex}`
|
|
15399
16057
|
)
|
|
15400
16058
|
);
|
|
15401
16059
|
if (trailing) {
|
|
@@ -15404,22 +16062,20 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15404
16062
|
}
|
|
15405
16063
|
tokenIndex += 1;
|
|
15406
16064
|
lastIndex = match.index + full.length;
|
|
15407
|
-
match = MESSAGE_CONTENT_PATTERN.exec(
|
|
15408
|
-
}
|
|
15409
|
-
if (lastIndex < body.length) {
|
|
15410
|
-
nodes.push(
|
|
15411
|
-
renderPlainTextWithBold(body.slice(lastIndex), `tail-${tokenIndex}`)
|
|
15412
|
-
);
|
|
16065
|
+
match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15413
16066
|
}
|
|
15414
|
-
if (
|
|
16067
|
+
if (lastIndex < text.length) {
|
|
15415
16068
|
nodes.push(
|
|
15416
|
-
|
|
16069
|
+
renderPlainTextWithBold(
|
|
16070
|
+
text.slice(lastIndex),
|
|
16071
|
+
`${keyPrefix}-tail-${tokenIndex}`
|
|
16072
|
+
)
|
|
15417
16073
|
);
|
|
15418
16074
|
}
|
|
15419
|
-
return nodes
|
|
16075
|
+
return nodes;
|
|
15420
16076
|
}
|
|
15421
16077
|
function collectKbArticleFromToolEntry(entry, articles) {
|
|
15422
|
-
if (!
|
|
16078
|
+
if (!isRecord(entry)) {
|
|
15423
16079
|
return;
|
|
15424
16080
|
}
|
|
15425
16081
|
if (entry.type === "internal") {
|
|
@@ -15451,9 +16107,9 @@ function resolveKbArticlesFromMessages(messages) {
|
|
|
15451
16107
|
const articles = /* @__PURE__ */ new Map();
|
|
15452
16108
|
for (const message of messages) {
|
|
15453
16109
|
const { metadata } = message;
|
|
15454
|
-
if (
|
|
16110
|
+
if (isRecord(metadata) && Array.isArray(metadata.kbCitations)) {
|
|
15455
16111
|
for (const entry of metadata.kbCitations) {
|
|
15456
|
-
if (!
|
|
16112
|
+
if (!isRecord(entry)) {
|
|
15457
16113
|
continue;
|
|
15458
16114
|
}
|
|
15459
16115
|
const id3 = typeof entry.id === "string" ? entry.id : null;
|
|
@@ -15493,8 +16149,8 @@ function CompactTime({
|
|
|
15493
16149
|
timestamp
|
|
15494
16150
|
}) {
|
|
15495
16151
|
const createdAt = resolveStableCreatedAt(messageId, timestamp);
|
|
15496
|
-
const [now2, setNow] = (0,
|
|
15497
|
-
(0,
|
|
16152
|
+
const [now2, setNow] = (0, import_react34.useState)(() => Date.now());
|
|
16153
|
+
(0, import_react34.useEffect)(() => {
|
|
15498
16154
|
const tick = () => setNow(Date.now());
|
|
15499
16155
|
const interval = setInterval(tick, TICK_MS);
|
|
15500
16156
|
return () => clearInterval(interval);
|
|
@@ -15502,35 +16158,62 @@ function CompactTime({
|
|
|
15502
16158
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: formatCompactTime(createdAt, now2) });
|
|
15503
16159
|
}
|
|
15504
16160
|
|
|
15505
|
-
// src/lib/support/
|
|
16161
|
+
// src/lib/support/Suggestions.tsx
|
|
15506
16162
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
16163
|
+
function Suggestions({
|
|
16164
|
+
onPick,
|
|
16165
|
+
suggestions
|
|
16166
|
+
}) {
|
|
16167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex w-full min-w-0 flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
16168
|
+
"button",
|
|
16169
|
+
{
|
|
16170
|
+
className: "scw-suggestion w-full min-w-0 cursor-pointer overflow-hidden rounded-xl border border-solid border-border bg-white px-3 py-2.5 text-left font-[inherit] hover:bg-neutral-50",
|
|
16171
|
+
onClick: () => onPick(suggestion.prompt),
|
|
16172
|
+
type: "button",
|
|
16173
|
+
children: [
|
|
16174
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "scw-suggestion-icon shrink-0 rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SparklesIcon, {}) }),
|
|
16175
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "scw-suggestion-copy", children: [
|
|
16176
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "scw-suggestion-label text-sm leading-5 font-medium text-neutral-950", children: suggestion.label }),
|
|
16177
|
+
suggestion.description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "scw-suggestion-label mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16178
|
+
] })
|
|
16179
|
+
]
|
|
16180
|
+
},
|
|
16181
|
+
suggestion.label
|
|
16182
|
+
)) });
|
|
16183
|
+
}
|
|
16184
|
+
|
|
16185
|
+
// src/lib/support/HomeView.tsx
|
|
16186
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
15507
16187
|
var SEND_PILL = "inline-flex items-center justify-center gap-2 self-center whitespace-nowrap rounded-[10px] border-none bg-neutral-900 px-[18px] py-[11px] text-sm font-semibold text-white shadow-[0_6px_16px_rgba(0,0,0,.18)] transition-colors duration-150 hover:bg-neutral-800";
|
|
15508
16188
|
function HomeView({
|
|
15509
16189
|
branding,
|
|
15510
16190
|
conversations,
|
|
16191
|
+
onPick,
|
|
15511
16192
|
onResume,
|
|
15512
|
-
onStartNew
|
|
16193
|
+
onStartNew,
|
|
16194
|
+
suggestions
|
|
15513
16195
|
}) {
|
|
15514
16196
|
const [recent] = conversations;
|
|
15515
|
-
return /* @__PURE__ */ (0,
|
|
15516
|
-
/* @__PURE__ */ (0,
|
|
15517
|
-
/* @__PURE__ */ (0,
|
|
15518
|
-
/* @__PURE__ */ (0,
|
|
15519
|
-
/* @__PURE__ */ (0,
|
|
16197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "scw-thin-scroll flex min-w-0 max-w-full flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto overscroll-contain bg-white px-4 pt-6 pb-[calc(24px+var(--scw-nav-height))]", children: [
|
|
16198
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col items-center gap-2 px-0 pt-2 pb-1 text-center", children: [
|
|
16199
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { branding, large: true }),
|
|
16200
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-lg font-semibold text-neutral-950", children: branding.greeting }),
|
|
16201
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-[13px] text-neutral-500", children: branding.teamDescription })
|
|
15520
16202
|
] }),
|
|
15521
|
-
|
|
16203
|
+
suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Suggestions, { onPick, suggestions }),
|
|
16204
|
+
recent && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
15522
16205
|
"button",
|
|
15523
16206
|
{
|
|
15524
|
-
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-
|
|
16207
|
+
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-border bg-white p-3 text-left font-[inherit] shadow-[0_2px_8px_rgba(0,0,0,.06)] transition-colors duration-150 hover:bg-neutral-50",
|
|
15525
16208
|
onClick: () => onResume(recent),
|
|
15526
16209
|
type: "button",
|
|
15527
16210
|
children: [
|
|
15528
|
-
/* @__PURE__ */ (0,
|
|
15529
|
-
/* @__PURE__ */ (0,
|
|
15530
|
-
/* @__PURE__ */ (0,
|
|
15531
|
-
/* @__PURE__ */ (0,
|
|
16211
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { branding }),
|
|
16212
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
16213
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16214
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(recent.preview, recent.conversationId) })
|
|
15532
16215
|
] }),
|
|
15533
|
-
/* @__PURE__ */ (0,
|
|
16216
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
15534
16217
|
CompactTime,
|
|
15535
16218
|
{
|
|
15536
16219
|
messageId: `home-${recent.conversationId}`,
|
|
@@ -15540,54 +16223,47 @@ function HomeView({
|
|
|
15540
16223
|
]
|
|
15541
16224
|
}
|
|
15542
16225
|
),
|
|
15543
|
-
/* @__PURE__ */ (0,
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { className: SEND_PILL, onClick: onStartNew, type: "button", children: [
|
|
15544
16227
|
"Start a new conversation",
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
16228
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ArrowRightIcon, {})
|
|
15546
16229
|
] })
|
|
15547
16230
|
] });
|
|
15548
16231
|
}
|
|
15549
16232
|
|
|
15550
16233
|
// src/lib/support/MessagesView.tsx
|
|
15551
|
-
var
|
|
16234
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
15552
16235
|
var SEND_PILL2 = "inline-flex items-center justify-center gap-2 self-center whitespace-nowrap rounded-[10px] border-none bg-neutral-900 px-[18px] py-[11px] text-sm font-semibold text-white shadow-[0_6px_16px_rgba(0,0,0,.18)] transition-colors duration-150 hover:bg-neutral-800";
|
|
15553
16236
|
function MessagesView({
|
|
15554
|
-
activeConversationId,
|
|
15555
16237
|
branding,
|
|
15556
16238
|
conversations,
|
|
15557
16239
|
onResume,
|
|
15558
16240
|
onStartNew
|
|
15559
16241
|
}) {
|
|
15560
|
-
return /* @__PURE__ */ (0,
|
|
15561
|
-
/* @__PURE__ */ (0,
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
"
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
),
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
]
|
|
15586
|
-
},
|
|
15587
|
-
entry.conversationId
|
|
15588
|
-
);
|
|
15589
|
-
}) }) }),
|
|
15590
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
16242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative flex min-h-0 flex-1 flex-col overflow-hidden", children: [
|
|
16243
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "scw-thin-scroll min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pt-2 pb-[calc(8px+var(--scw-nav-height)+var(--scw-send-pill-gap)+var(--scw-send-pill-height))]", children: conversations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "my-6 text-center text-sm text-neutral-500", children: "No conversations yet. Start one below." }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-col", children: conversations.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
16244
|
+
"button",
|
|
16245
|
+
{
|
|
16246
|
+
className: "flex w-full cursor-pointer items-center gap-3 rounded-xl border-none bg-white p-3 text-left font-[inherit] transition-colors duration-150 hover:bg-neutral-100",
|
|
16247
|
+
onClick: () => onResume(entry),
|
|
16248
|
+
type: "button",
|
|
16249
|
+
children: [
|
|
16250
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Avatar, { branding }),
|
|
16251
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
16252
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16253
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(entry.preview, entry.conversationId) })
|
|
16254
|
+
] }),
|
|
16255
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
16256
|
+
CompactTime,
|
|
16257
|
+
{
|
|
16258
|
+
messageId: `list-${entry.conversationId}`,
|
|
16259
|
+
timestamp: entry.updatedAt
|
|
16260
|
+
}
|
|
16261
|
+
) })
|
|
16262
|
+
]
|
|
16263
|
+
},
|
|
16264
|
+
entry.conversationId
|
|
16265
|
+
)) }) }),
|
|
16266
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15591
16267
|
"button",
|
|
15592
16268
|
{
|
|
15593
16269
|
className: cn(
|
|
@@ -15598,7 +16274,7 @@ function MessagesView({
|
|
|
15598
16274
|
type: "button",
|
|
15599
16275
|
children: [
|
|
15600
16276
|
"Start a new conversation",
|
|
15601
|
-
/* @__PURE__ */ (0,
|
|
16277
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ArrowRightIcon, {})
|
|
15602
16278
|
]
|
|
15603
16279
|
}
|
|
15604
16280
|
)
|
|
@@ -15606,8 +16282,8 @@ function MessagesView({
|
|
|
15606
16282
|
}
|
|
15607
16283
|
|
|
15608
16284
|
// src/lib/support/PanelHeader.tsx
|
|
15609
|
-
var
|
|
15610
|
-
var HEADER_BTN = "flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-
|
|
16285
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
16286
|
+
var HEADER_BTN = "flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-700";
|
|
15611
16287
|
function PanelHeader({
|
|
15612
16288
|
agentMuted: _agentMuted,
|
|
15613
16289
|
branding,
|
|
@@ -15616,66 +16292,69 @@ function PanelHeader({
|
|
|
15616
16292
|
view
|
|
15617
16293
|
}) {
|
|
15618
16294
|
if (view === "chat") {
|
|
15619
|
-
return /* @__PURE__ */ (0,
|
|
15620
|
-
/* @__PURE__ */ (0,
|
|
15621
|
-
/* @__PURE__ */ (0,
|
|
16295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start justify-between gap-2 border-b border-border p-[var(--scw-header-padding)]", children: [
|
|
16296
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
16297
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15622
16298
|
"button",
|
|
15623
16299
|
{
|
|
15624
16300
|
"aria-label": "Back",
|
|
15625
16301
|
className: HEADER_BTN,
|
|
15626
16302
|
onClick: onBack,
|
|
15627
16303
|
type: "button",
|
|
15628
|
-
children: /* @__PURE__ */ (0,
|
|
16304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronLeftIcon, {})
|
|
15629
16305
|
}
|
|
15630
16306
|
),
|
|
15631
|
-
/* @__PURE__ */ (0,
|
|
15632
|
-
/* @__PURE__ */ (0,
|
|
16307
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { branding }),
|
|
16308
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "min-w-0 leading-[1.3]", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-lg font-semibold text-neutral-950", children: branding.workspaceName }) })
|
|
15633
16309
|
] }),
|
|
15634
|
-
/* @__PURE__ */ (0,
|
|
15635
|
-
"button",
|
|
15636
|
-
{
|
|
15637
|
-
"aria-label": "Close chat",
|
|
15638
|
-
className: HEADER_BTN,
|
|
15639
|
-
onClick: onClose,
|
|
15640
|
-
type: "button",
|
|
15641
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon, {})
|
|
15642
|
-
}
|
|
15643
|
-
)
|
|
16310
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseChatButton, { onClose })
|
|
15644
16311
|
] });
|
|
15645
16312
|
}
|
|
15646
|
-
return /* @__PURE__ */ (0,
|
|
16313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15647
16314
|
"div",
|
|
15648
16315
|
{
|
|
15649
16316
|
className: cn(
|
|
15650
|
-
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
16317
|
+
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-border p-[var(--scw-header-padding)]"
|
|
15651
16318
|
),
|
|
15652
16319
|
children: [
|
|
15653
|
-
/* @__PURE__ */ (0,
|
|
15654
|
-
/* @__PURE__ */ (0,
|
|
15655
|
-
|
|
16320
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-lg font-semibold text-neutral-950", children: view === "messages" ? "Messages" : "" }),
|
|
16321
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
16322
|
+
CloseChatButton,
|
|
15656
16323
|
{
|
|
15657
|
-
|
|
15658
|
-
|
|
15659
|
-
HEADER_BTN,
|
|
15660
|
-
"absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]"
|
|
15661
|
-
),
|
|
15662
|
-
onClick: onClose,
|
|
15663
|
-
type: "button",
|
|
15664
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon, {})
|
|
16324
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]",
|
|
16325
|
+
onClose
|
|
15665
16326
|
}
|
|
15666
16327
|
)
|
|
15667
16328
|
]
|
|
15668
16329
|
}
|
|
15669
16330
|
);
|
|
15670
16331
|
}
|
|
16332
|
+
function CloseChatButton({
|
|
16333
|
+
className,
|
|
16334
|
+
onClose
|
|
16335
|
+
}) {
|
|
16336
|
+
if (!onClose) {
|
|
16337
|
+
return null;
|
|
16338
|
+
}
|
|
16339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
16340
|
+
"button",
|
|
16341
|
+
{
|
|
16342
|
+
"aria-label": "Close chat",
|
|
16343
|
+
className: cn(HEADER_BTN, className),
|
|
16344
|
+
onClick: onClose,
|
|
16345
|
+
type: "button",
|
|
16346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon, {})
|
|
16347
|
+
}
|
|
16348
|
+
);
|
|
16349
|
+
}
|
|
15671
16350
|
|
|
15672
16351
|
// src/lib/support/Spinner.tsx
|
|
15673
|
-
var
|
|
16352
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
15674
16353
|
function Spinner({
|
|
15675
16354
|
className,
|
|
15676
16355
|
small
|
|
15677
16356
|
}) {
|
|
15678
|
-
return /* @__PURE__ */ (0,
|
|
16357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15679
16358
|
"span",
|
|
15680
16359
|
{
|
|
15681
16360
|
"aria-hidden": "true",
|
|
@@ -15689,33 +16368,33 @@ function Spinner({
|
|
|
15689
16368
|
}
|
|
15690
16369
|
|
|
15691
16370
|
// src/lib/support/WidgetConversationView.tsx
|
|
15692
|
-
var
|
|
16371
|
+
var import_react42 = require("react");
|
|
15693
16372
|
|
|
15694
16373
|
// src/lib/support/ComposerFooter.tsx
|
|
15695
|
-
var
|
|
16374
|
+
var import_react36 = require("react");
|
|
15696
16375
|
|
|
15697
16376
|
// src/lib/support/PoweredBy.tsx
|
|
15698
|
-
var
|
|
15699
|
-
var
|
|
16377
|
+
var import_react35 = require("react");
|
|
16378
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15700
16379
|
function PoweredBy({
|
|
15701
16380
|
projectId
|
|
15702
16381
|
}) {
|
|
15703
|
-
const identity2 = (0,
|
|
16382
|
+
const identity2 = (0, import_react35.useSyncExternalStore)(
|
|
15704
16383
|
subscribeToRegistry,
|
|
15705
16384
|
getIdentity,
|
|
15706
16385
|
getIdentity
|
|
15707
16386
|
);
|
|
15708
16387
|
const hrefFromTraits = typeof identity2?.traits?.$href === "string" ? identity2.traits.$href : void 0;
|
|
15709
|
-
const [hostDomain, setHostDomain] = (0,
|
|
16388
|
+
const [hostDomain, setHostDomain] = (0, import_react35.useState)(
|
|
15710
16389
|
() => readHostnameFromHref(hrefFromTraits)
|
|
15711
16390
|
);
|
|
15712
|
-
(0,
|
|
16391
|
+
(0, import_react35.useEffect)(() => {
|
|
15713
16392
|
const fromTraits = readHostnameFromHref(hrefFromTraits);
|
|
15714
16393
|
if (fromTraits) {
|
|
15715
16394
|
setHostDomain(fromTraits);
|
|
15716
16395
|
}
|
|
15717
16396
|
}, [hrefFromTraits]);
|
|
15718
|
-
(0,
|
|
16397
|
+
(0, import_react35.useEffect)(() => {
|
|
15719
16398
|
if (hostDomain) {
|
|
15720
16399
|
return;
|
|
15721
16400
|
}
|
|
@@ -15737,17 +16416,17 @@ function PoweredBy({
|
|
|
15737
16416
|
cancelled = true;
|
|
15738
16417
|
};
|
|
15739
16418
|
}, [hostDomain]);
|
|
15740
|
-
return /* @__PURE__ */ (0,
|
|
16419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15741
16420
|
"a",
|
|
15742
16421
|
{
|
|
15743
16422
|
"aria-label": "Powered by Saasco",
|
|
15744
|
-
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-
|
|
16423
|
+
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-border bg-white px-3.5 py-1.5 text-[11px] leading-none text-neutral-400 no-underline transition-colors duration-150 hover:bg-neutral-50",
|
|
15745
16424
|
href: buildSaascoPoweredByHref(projectId, hostDomain),
|
|
15746
16425
|
rel: "noopener noreferrer",
|
|
15747
16426
|
target: "_blank",
|
|
15748
16427
|
children: [
|
|
15749
|
-
/* @__PURE__ */ (0,
|
|
15750
|
-
/* @__PURE__ */ (0,
|
|
16428
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-neutral-400", children: "Powered by" }),
|
|
16429
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SaascoLogo, {})
|
|
15751
16430
|
]
|
|
15752
16431
|
}
|
|
15753
16432
|
) });
|
|
@@ -15766,15 +16445,15 @@ function buildSaascoPoweredByHref(projectId, hostDomain) {
|
|
|
15766
16445
|
|
|
15767
16446
|
// src/lib/support/ui/message-scroller.tsx
|
|
15768
16447
|
var import_message_scroller = require("@shadcn/react/message-scroller");
|
|
15769
|
-
var
|
|
16448
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15770
16449
|
function MessageScrollerProvider(props) {
|
|
15771
|
-
return /* @__PURE__ */ (0,
|
|
16450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_message_scroller.MessageScroller.Provider, { ...props });
|
|
15772
16451
|
}
|
|
15773
16452
|
function MessageScroller({
|
|
15774
16453
|
className,
|
|
15775
16454
|
...props
|
|
15776
16455
|
}) {
|
|
15777
|
-
return /* @__PURE__ */ (0,
|
|
16456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15778
16457
|
import_message_scroller.MessageScroller.Root,
|
|
15779
16458
|
{
|
|
15780
16459
|
"data-slot": "message-scroller",
|
|
@@ -15790,7 +16469,7 @@ function MessageScrollerViewport({
|
|
|
15790
16469
|
className,
|
|
15791
16470
|
...props
|
|
15792
16471
|
}) {
|
|
15793
|
-
return /* @__PURE__ */ (0,
|
|
16472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15794
16473
|
import_message_scroller.MessageScroller.Viewport,
|
|
15795
16474
|
{
|
|
15796
16475
|
"data-slot": "message-scroller-viewport",
|
|
@@ -15810,7 +16489,7 @@ function MessageScrollerContent({
|
|
|
15810
16489
|
className,
|
|
15811
16490
|
...props
|
|
15812
16491
|
}) {
|
|
15813
|
-
return /* @__PURE__ */ (0,
|
|
16492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15814
16493
|
import_message_scroller.MessageScroller.Content,
|
|
15815
16494
|
{
|
|
15816
16495
|
"data-slot": "message-scroller-content",
|
|
@@ -15830,7 +16509,7 @@ function MessageScrollerItem({
|
|
|
15830
16509
|
scrollAnchor = false,
|
|
15831
16510
|
...props
|
|
15832
16511
|
}) {
|
|
15833
|
-
return /* @__PURE__ */ (0,
|
|
16512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15834
16513
|
import_message_scroller.MessageScroller.Item,
|
|
15835
16514
|
{
|
|
15836
16515
|
"data-slot": "message-scroller-item",
|
|
@@ -15847,7 +16526,7 @@ function MessageScrollerItem({
|
|
|
15847
16526
|
}
|
|
15848
16527
|
|
|
15849
16528
|
// src/lib/support/ComposerFooter.tsx
|
|
15850
|
-
var
|
|
16529
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15851
16530
|
function ComposerFooter({
|
|
15852
16531
|
active,
|
|
15853
16532
|
projectId,
|
|
@@ -15858,8 +16537,8 @@ function ComposerFooter({
|
|
|
15858
16537
|
const { scrollToEnd } = (0, import_message_scroller.useMessageScroller)();
|
|
15859
16538
|
const showScrollToBottom = useAwayFromScrollBottom(scrollRef, active);
|
|
15860
16539
|
const transition = reduceMotion ? { duration: 0 } : SCROLL_BOTTOM_TRANSITION;
|
|
15861
|
-
return /* @__PURE__ */ (0,
|
|
15862
|
-
/* @__PURE__ */ (0,
|
|
16540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "pointer-events-none absolute inset-x-0 bottom-full mb-2.5", children: [
|
|
16541
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15863
16542
|
motion.div,
|
|
15864
16543
|
{
|
|
15865
16544
|
animate: {
|
|
@@ -15871,10 +16550,10 @@ function ComposerFooter({
|
|
|
15871
16550
|
initial: false,
|
|
15872
16551
|
style: { pointerEvents: showScrollToBottom ? "none" : "auto" },
|
|
15873
16552
|
transition,
|
|
15874
|
-
children: /* @__PURE__ */ (0,
|
|
16553
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PoweredBy, { projectId })
|
|
15875
16554
|
}
|
|
15876
16555
|
),
|
|
15877
|
-
/* @__PURE__ */ (0,
|
|
16556
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15878
16557
|
motion.button,
|
|
15879
16558
|
{
|
|
15880
16559
|
animate: {
|
|
@@ -15884,7 +16563,7 @@ function ComposerFooter({
|
|
|
15884
16563
|
},
|
|
15885
16564
|
"aria-hidden": !showScrollToBottom,
|
|
15886
16565
|
"aria-label": "Scroll to latest messages",
|
|
15887
|
-
className: "absolute top-1/2 left-1/2 mt-[-16px] flex size-8 cursor-pointer items-center justify-center rounded-full border border-solid border-
|
|
16566
|
+
className: "absolute top-1/2 left-1/2 mt-[-16px] flex size-8 cursor-pointer items-center justify-center rounded-full border border-solid border-border bg-white p-0 text-neutral-600 transition-colors duration-150 hover:bg-neutral-50",
|
|
15888
16567
|
initial: false,
|
|
15889
16568
|
onClick: () => {
|
|
15890
16569
|
scrollReleasedRef.current = true;
|
|
@@ -15894,14 +16573,14 @@ function ComposerFooter({
|
|
|
15894
16573
|
tabIndex: showScrollToBottom ? 0 : -1,
|
|
15895
16574
|
transition,
|
|
15896
16575
|
type: "button",
|
|
15897
|
-
children: /* @__PURE__ */ (0,
|
|
16576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScrollChevronDownIcon, {})
|
|
15898
16577
|
}
|
|
15899
16578
|
)
|
|
15900
16579
|
] });
|
|
15901
16580
|
}
|
|
15902
16581
|
function useAwayFromScrollBottom(scrollRef, active) {
|
|
15903
|
-
const [away, setAway] = (0,
|
|
15904
|
-
(0,
|
|
16582
|
+
const [away, setAway] = (0, import_react36.useState)(false);
|
|
16583
|
+
(0, import_react36.useEffect)(() => {
|
|
15905
16584
|
if (!active) {
|
|
15906
16585
|
setAway(false);
|
|
15907
16586
|
return;
|
|
@@ -15940,11 +16619,11 @@ function useAwayFromScrollBottom(scrollRef, active) {
|
|
|
15940
16619
|
}
|
|
15941
16620
|
|
|
15942
16621
|
// src/lib/support/MessageList.tsx
|
|
15943
|
-
var
|
|
16622
|
+
var import_react40 = require("react");
|
|
15944
16623
|
|
|
15945
16624
|
// src/lib/support/ui/marker.tsx
|
|
15946
16625
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
15947
|
-
var
|
|
16626
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15948
16627
|
var markerVariants = cva(
|
|
15949
16628
|
"group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",
|
|
15950
16629
|
{
|
|
@@ -15964,7 +16643,7 @@ function Marker({
|
|
|
15964
16643
|
...props
|
|
15965
16644
|
}) {
|
|
15966
16645
|
const Comp = asChild ? import_react_slot3.Slot : "div";
|
|
15967
|
-
return /* @__PURE__ */ (0,
|
|
16646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15968
16647
|
Comp,
|
|
15969
16648
|
{
|
|
15970
16649
|
"data-slot": "marker",
|
|
@@ -15975,7 +16654,7 @@ function Marker({
|
|
|
15975
16654
|
);
|
|
15976
16655
|
}
|
|
15977
16656
|
function MarkerIcon({ className, ...props }) {
|
|
15978
|
-
return /* @__PURE__ */ (0,
|
|
16657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15979
16658
|
"span",
|
|
15980
16659
|
{
|
|
15981
16660
|
"data-slot": "marker-icon",
|
|
@@ -15989,7 +16668,7 @@ function MarkerIcon({ className, ...props }) {
|
|
|
15989
16668
|
);
|
|
15990
16669
|
}
|
|
15991
16670
|
function MarkerContent({ className, ...props }) {
|
|
15992
|
-
return /* @__PURE__ */ (0,
|
|
16671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15993
16672
|
"span",
|
|
15994
16673
|
{
|
|
15995
16674
|
"data-slot": "marker-content",
|
|
@@ -16003,37 +16682,13 @@ function MarkerContent({ className, ...props }) {
|
|
|
16003
16682
|
}
|
|
16004
16683
|
|
|
16005
16684
|
// src/lib/support/JoinNotice.tsx
|
|
16006
|
-
var
|
|
16685
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
16007
16686
|
function JoinNotice({
|
|
16008
16687
|
message
|
|
16009
16688
|
}) {
|
|
16010
16689
|
const name = readAuthorName(message);
|
|
16011
16690
|
const label = name && name !== "Team" ? `${name} has joined the conversation` : "A teammate has joined the conversation";
|
|
16012
|
-
return /* @__PURE__ */ (0,
|
|
16013
|
-
}
|
|
16014
|
-
|
|
16015
|
-
// src/lib/support/Suggestions.tsx
|
|
16016
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
16017
|
-
function Suggestions({
|
|
16018
|
-
onPick,
|
|
16019
|
-
suggestions
|
|
16020
|
-
}) {
|
|
16021
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
16022
|
-
"button",
|
|
16023
|
-
{
|
|
16024
|
-
className: "flex cursor-pointer items-start gap-3 rounded-xl border border-solid border-neutral-200 bg-white px-3 py-2.5 text-left font-[inherit] hover:bg-neutral-50",
|
|
16025
|
-
onClick: () => onPick(suggestion.prompt),
|
|
16026
|
-
type: "button",
|
|
16027
|
-
children: [
|
|
16028
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SparklesIcon, {}) }),
|
|
16029
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex min-w-0 flex-col", children: [
|
|
16030
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm font-medium text-neutral-950", children: suggestion.label }),
|
|
16031
|
-
suggestion.description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16032
|
-
] })
|
|
16033
|
-
]
|
|
16034
|
-
},
|
|
16035
|
-
suggestion.label
|
|
16036
|
-
)) });
|
|
16691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Marker, { className: "scw-message-in justify-center py-2 text-center text-xs text-neutral-500", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MarkerContent, { children: label }) });
|
|
16037
16692
|
}
|
|
16038
16693
|
|
|
16039
16694
|
// src/lib/support/HandoffCard.tsx
|
|
@@ -16047,7 +16702,7 @@ function HandoffCard({
|
|
|
16047
16702
|
pending,
|
|
16048
16703
|
reason
|
|
16049
16704
|
}) {
|
|
16050
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "w-full rounded-lg border border-solid border-
|
|
16705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3", children: [
|
|
16051
16706
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-[10px] font-semibold tracking-[0.04em] text-neutral-500 uppercase", children: "Connect with the team" }),
|
|
16052
16707
|
reason ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mt-1.5 text-[13px] text-neutral-900", children: reason }) : null,
|
|
16053
16708
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mt-1 text-xs text-neutral-600", children: "A human teammate can take over from here and reply right in this chat." }),
|
|
@@ -16083,6 +16738,7 @@ function HandoffCard({
|
|
|
16083
16738
|
var import_ai6 = require("ai");
|
|
16084
16739
|
var HIDDEN_WIDGET_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
16085
16740
|
CLOSE_CONVERSATION_TOOL_NAME,
|
|
16741
|
+
REPORT_KNOWLEDGE_GAP_TOOL_NAME,
|
|
16086
16742
|
REQUEST_HUMAN_HANDOFF_TOOL_NAME
|
|
16087
16743
|
]);
|
|
16088
16744
|
function collectHiddenToolCallIds(message) {
|
|
@@ -16124,7 +16780,7 @@ function humanizeToolName(toolName) {
|
|
|
16124
16780
|
}
|
|
16125
16781
|
|
|
16126
16782
|
// src/lib/support/ToolGroup.tsx
|
|
16127
|
-
var
|
|
16783
|
+
var import_react37 = require("react");
|
|
16128
16784
|
|
|
16129
16785
|
// src/lib/support/ApprovalCard.tsx
|
|
16130
16786
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
@@ -16138,7 +16794,7 @@ function ApprovalCard({
|
|
|
16138
16794
|
toolName
|
|
16139
16795
|
}) {
|
|
16140
16796
|
const displayLabel = resolveToolLabel(toolName, label);
|
|
16141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-full rounded-lg border border-solid border-
|
|
16797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3 text-xs text-neutral-900", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-2.5", children: [
|
|
16142
16798
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
16143
16799
|
"div",
|
|
16144
16800
|
{
|
|
@@ -16197,7 +16853,7 @@ function ToolGroup({
|
|
|
16197
16853
|
toolLabels,
|
|
16198
16854
|
tools
|
|
16199
16855
|
}) {
|
|
16200
|
-
const [expanded, setExpanded] = (0,
|
|
16856
|
+
const [expanded, setExpanded] = (0, import_react37.useState)(false);
|
|
16201
16857
|
const hostAwaitingApproval = tools.filter(
|
|
16202
16858
|
(tool) => pending.has(tool.toolCallId)
|
|
16203
16859
|
);
|
|
@@ -16267,10 +16923,10 @@ function ToolGroup({
|
|
|
16267
16923
|
]
|
|
16268
16924
|
}
|
|
16269
16925
|
),
|
|
16270
|
-
expanded && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-1 border-l border-
|
|
16926
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-1 border-l border-border pl-2.5", children: tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
16271
16927
|
"div",
|
|
16272
16928
|
{
|
|
16273
|
-
className: "inline-flex items-center gap-1.5 self-start rounded border border-solid border-
|
|
16929
|
+
className: "inline-flex items-center gap-1.5 self-start rounded border border-solid border-border bg-white px-1.5 py-0.5 font-mono text-[11px] tracking-[-0.01em] text-neutral-600",
|
|
16274
16930
|
children: [
|
|
16275
16931
|
isToolPartComplete(tool.state) ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "size-1 shrink-0 rounded-full bg-neutral-400" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Spinner, { small: true }),
|
|
16276
16932
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: resolveToolDisplayLabel(tool.toolName, toolLabels) })
|
|
@@ -16460,9 +17116,9 @@ function SupportMessage({
|
|
|
16460
17116
|
BubbleContent,
|
|
16461
17117
|
{
|
|
16462
17118
|
className: cn(
|
|
16463
|
-
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold",
|
|
17119
|
+
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold [&_table]:whitespace-normal",
|
|
16464
17120
|
isCustomer && "rounded-2xl rounded-br-[4px] bg-neutral-900 px-[13px] py-[9px] text-white",
|
|
16465
|
-
isTeam && "rounded-2xl rounded-bl-[4px] bg-
|
|
17121
|
+
isTeam && "rounded-2xl rounded-bl-[4px] bg-neutral-100 px-[13px] py-[9px] text-neutral-950",
|
|
16466
17122
|
!isCustomer && !isTeam && "max-w-full rounded-none bg-transparent px-0 py-1 text-neutral-950"
|
|
16467
17123
|
),
|
|
16468
17124
|
children: renderMessageText(block.text, kbArticles, isStreamingBlock)
|
|
@@ -16525,13 +17181,13 @@ function SupportMessage({
|
|
|
16525
17181
|
showHandoffCard && handoffOffer && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16526
17182
|
HandoffCard,
|
|
16527
17183
|
{
|
|
16528
|
-
onConfirm: () => handoff.onConfirm(handoffOffer
|
|
17184
|
+
onConfirm: () => handoff.onConfirm(handoffOffer),
|
|
16529
17185
|
onDismiss: () => handoff.onDismiss(handoffOffer.toolCallId),
|
|
16530
17186
|
pending: handoff.pending,
|
|
16531
17187
|
reason: handoffOffer.reason
|
|
16532
17188
|
}
|
|
16533
17189
|
),
|
|
16534
|
-
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MessageFooter, { className: "px-0 text-[11px] text-
|
|
17190
|
+
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MessageFooter, { className: "px-0 text-[11px] text-neutral-500", children: isCustomer ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16535
17191
|
CompactTime,
|
|
16536
17192
|
{
|
|
16537
17193
|
messageId: message.id,
|
|
@@ -16556,7 +17212,7 @@ function SupportMessage({
|
|
|
16556
17212
|
}
|
|
16557
17213
|
|
|
16558
17214
|
// src/lib/support/useFollowBottomAfterUserScroll.ts
|
|
16559
|
-
var
|
|
17215
|
+
var import_react38 = require("react");
|
|
16560
17216
|
var SPACER_SELECTOR = "[data-message-scroller-spacer]";
|
|
16561
17217
|
var ANCHOR_SELECTOR = '[data-scroll-anchor="true"]';
|
|
16562
17218
|
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -16570,7 +17226,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
|
16570
17226
|
]);
|
|
16571
17227
|
function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
16572
17228
|
const { scrollToEnd } = (0, import_message_scroller.useMessageScroller)();
|
|
16573
|
-
(0,
|
|
17229
|
+
(0, import_react38.useEffect)(() => {
|
|
16574
17230
|
const viewport = scrollRef.current;
|
|
16575
17231
|
const spacer = viewport?.querySelector(SPACER_SELECTOR);
|
|
16576
17232
|
const content = spacer?.parentElement;
|
|
@@ -16647,10 +17303,10 @@ function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
|
16647
17303
|
}
|
|
16648
17304
|
|
|
16649
17305
|
// src/lib/support/useLiftSpacerClamp.ts
|
|
16650
|
-
var
|
|
17306
|
+
var import_react39 = require("react");
|
|
16651
17307
|
var SPACER_SELECTOR2 = "[data-message-scroller-spacer]";
|
|
16652
17308
|
function useLiftSpacerClamp(scrollRef) {
|
|
16653
|
-
(0,
|
|
17309
|
+
(0, import_react39.useEffect)(() => {
|
|
16654
17310
|
const viewport = scrollRef.current;
|
|
16655
17311
|
const spacer = viewport?.querySelector(SPACER_SELECTOR2);
|
|
16656
17312
|
const content = spacer?.parentElement;
|
|
@@ -16660,13 +17316,13 @@ function useLiftSpacerClamp(scrollRef) {
|
|
|
16660
17316
|
const frameWindow = viewport.ownerDocument.defaultView ?? window;
|
|
16661
17317
|
const ResizeObserverImpl = frameWindow.ResizeObserver ?? window.ResizeObserver;
|
|
16662
17318
|
let frame2 = 0;
|
|
16663
|
-
const
|
|
17319
|
+
const clamp3 = () => {
|
|
16664
17320
|
const ceiling = measureLiftCeiling(viewport, content, spacer);
|
|
16665
17321
|
spacer.style.maxHeight = `${ceiling}px`;
|
|
16666
17322
|
};
|
|
16667
17323
|
const observer2 = new ResizeObserverImpl(() => {
|
|
16668
17324
|
frameWindow.cancelAnimationFrame(frame2);
|
|
16669
|
-
frame2 = frameWindow.requestAnimationFrame(
|
|
17325
|
+
frame2 = frameWindow.requestAnimationFrame(clamp3);
|
|
16670
17326
|
});
|
|
16671
17327
|
observer2.observe(content);
|
|
16672
17328
|
observer2.observe(viewport);
|
|
@@ -16710,6 +17366,7 @@ var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
|
16710
17366
|
function MessageList({
|
|
16711
17367
|
agentMuted,
|
|
16712
17368
|
branding,
|
|
17369
|
+
conversationState,
|
|
16713
17370
|
dismissedHandoffs,
|
|
16714
17371
|
error,
|
|
16715
17372
|
handoffPending,
|
|
@@ -16735,11 +17392,11 @@ function MessageList({
|
|
|
16735
17392
|
useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen);
|
|
16736
17393
|
useLiftSpacerClamp(scrollRef);
|
|
16737
17394
|
useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef);
|
|
16738
|
-
const kbArticles = (0,
|
|
17395
|
+
const kbArticles = (0, import_react40.useMemo)(
|
|
16739
17396
|
() => resolveKbArticlesFromMessages(messages),
|
|
16740
17397
|
[messages]
|
|
16741
17398
|
);
|
|
16742
|
-
const lastUserMessageId = (0,
|
|
17399
|
+
const lastUserMessageId = (0, import_react40.useMemo)(() => {
|
|
16743
17400
|
for (let index2 = messages.length - 1; index2 >= 0; index2 -= 1) {
|
|
16744
17401
|
const message = messages[index2];
|
|
16745
17402
|
if (message?.role === "user") {
|
|
@@ -16749,7 +17406,12 @@ function MessageList({
|
|
|
16749
17406
|
return null;
|
|
16750
17407
|
}, [messages]);
|
|
16751
17408
|
const showTyping = typingLabel !== null;
|
|
16752
|
-
const showWaiting =
|
|
17409
|
+
const showWaiting = shouldShowWaitingForTeammate({
|
|
17410
|
+
agentMuted,
|
|
17411
|
+
conversationState,
|
|
17412
|
+
isTyping: showTyping,
|
|
17413
|
+
messages
|
|
17414
|
+
});
|
|
16753
17415
|
const showError = !!error && !isTakeoverError;
|
|
16754
17416
|
const showSuggestions = messages.length === 0 && suggestions.length > 0;
|
|
16755
17417
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScroller, { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -16772,7 +17434,10 @@ function MessageList({
|
|
|
16772
17434
|
ref: scrollRef,
|
|
16773
17435
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(MessageScrollerContent, { "aria-busy": isResponding, children: [
|
|
16774
17436
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
|
|
16775
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.
|
|
17437
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start gap-2 pt-1", children: [
|
|
17438
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Avatar, { branding }),
|
|
17439
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "max-w-[82%] rounded-[14px] bg-neutral-100 px-3 py-2 text-sm leading-[1.45] text-neutral-950", children: branding.greeting })
|
|
17440
|
+
] }),
|
|
16776
17441
|
showSuggestions && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Suggestions, { onPick, suggestions })
|
|
16777
17442
|
] }) }, "intro"),
|
|
16778
17443
|
messages.map((message, index2) => {
|
|
@@ -16850,7 +17515,7 @@ function MessageList({
|
|
|
16850
17515
|
]
|
|
16851
17516
|
}
|
|
16852
17517
|
) }, "waiting"),
|
|
16853
|
-
showError && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "rounded-md border border-solid border-
|
|
17518
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "rounded-md border border-solid border-border bg-neutral-100 px-3 py-2.5 text-xs text-neutral-700", children: [
|
|
16854
17519
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "font-medium text-neutral-900", children: "Something went wrong" }),
|
|
16855
17520
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: error?.message }),
|
|
16856
17521
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -16867,13 +17532,9 @@ function MessageList({
|
|
|
16867
17532
|
}
|
|
16868
17533
|
) });
|
|
16869
17534
|
}
|
|
16870
|
-
function lastMessageIsFromTeam(messages) {
|
|
16871
|
-
const lastMessage = messages.at(-1);
|
|
16872
|
-
return !!lastMessage && readSupportRole(lastMessage) === "team";
|
|
16873
|
-
}
|
|
16874
17535
|
function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
16875
17536
|
const { visibleMessageIds } = (0, import_message_scroller.useMessageScrollerVisibility)();
|
|
16876
|
-
const teamMessageIds = (0,
|
|
17537
|
+
const teamMessageIds = (0, import_react40.useMemo)(() => {
|
|
16877
17538
|
const ids = /* @__PURE__ */ new Set();
|
|
16878
17539
|
for (const message of messages) {
|
|
16879
17540
|
if (readSupportRole(message) === "team") {
|
|
@@ -16883,7 +17544,7 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16883
17544
|
return ids;
|
|
16884
17545
|
}, [messages]);
|
|
16885
17546
|
const visibleTeamKey = visibleMessageIds.filter((id3) => teamMessageIds.has(id3)).join(",");
|
|
16886
|
-
(0,
|
|
17547
|
+
(0, import_react40.useEffect)(() => {
|
|
16887
17548
|
if (!visibleTeamKey) {
|
|
16888
17549
|
return;
|
|
16889
17550
|
}
|
|
@@ -16892,24 +17553,24 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16892
17553
|
}
|
|
16893
17554
|
|
|
16894
17555
|
// src/lib/support/MessageScrollbar.tsx
|
|
16895
|
-
var
|
|
17556
|
+
var import_react41 = require("react");
|
|
16896
17557
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
16897
17558
|
function MessageScrollbar({
|
|
16898
17559
|
recomputeKey,
|
|
16899
17560
|
scrollRef
|
|
16900
17561
|
}) {
|
|
16901
|
-
const trackRef = (0,
|
|
16902
|
-
const thumbRef = (0,
|
|
16903
|
-
const dragRef = (0,
|
|
17562
|
+
const trackRef = (0, import_react41.useRef)(null);
|
|
17563
|
+
const thumbRef = (0, import_react41.useRef)(null);
|
|
17564
|
+
const dragRef = (0, import_react41.useRef)(
|
|
16904
17565
|
null
|
|
16905
17566
|
);
|
|
16906
|
-
const [thumb, setThumb] = (0,
|
|
17567
|
+
const [thumb, setThumb] = (0, import_react41.useState)({
|
|
16907
17568
|
height: 0,
|
|
16908
17569
|
top: 0,
|
|
16909
17570
|
valueNow: 0,
|
|
16910
17571
|
visible: false
|
|
16911
17572
|
});
|
|
16912
|
-
const recompute = (0,
|
|
17573
|
+
const recompute = (0, import_react41.useCallback)(() => {
|
|
16913
17574
|
const scroller = scrollRef.current;
|
|
16914
17575
|
const track = trackRef.current;
|
|
16915
17576
|
if (!(scroller && track)) {
|
|
@@ -16934,10 +17595,10 @@ function MessageScrollbar({
|
|
|
16934
17595
|
visible: true
|
|
16935
17596
|
});
|
|
16936
17597
|
}, [scrollRef]);
|
|
16937
|
-
(0,
|
|
17598
|
+
(0, import_react41.useLayoutEffect)(() => {
|
|
16938
17599
|
recompute();
|
|
16939
17600
|
}, [recompute, recomputeKey]);
|
|
16940
|
-
(0,
|
|
17601
|
+
(0, import_react41.useEffect)(() => {
|
|
16941
17602
|
const scroller = scrollRef.current;
|
|
16942
17603
|
const track = trackRef.current;
|
|
16943
17604
|
if (!(scroller && track)) {
|
|
@@ -17025,9 +17686,11 @@ function WidgetConversationView({
|
|
|
17025
17686
|
activeTransition,
|
|
17026
17687
|
agentMuted,
|
|
17027
17688
|
branding,
|
|
17689
|
+
conversationState,
|
|
17028
17690
|
dismissedHandoffs,
|
|
17029
17691
|
draft,
|
|
17030
17692
|
emailDraft,
|
|
17693
|
+
emailError,
|
|
17031
17694
|
error,
|
|
17032
17695
|
handoffPending,
|
|
17033
17696
|
imageInputRef,
|
|
@@ -17042,6 +17705,7 @@ function WidgetConversationView({
|
|
|
17042
17705
|
onConfirmHandoff,
|
|
17043
17706
|
onDismissHandoff,
|
|
17044
17707
|
onDraftChange,
|
|
17708
|
+
onEmailBlur,
|
|
17045
17709
|
onEmailChange,
|
|
17046
17710
|
onImageSelection,
|
|
17047
17711
|
onPick,
|
|
@@ -17100,6 +17764,7 @@ function WidgetConversationView({
|
|
|
17100
17764
|
{
|
|
17101
17765
|
agentMuted,
|
|
17102
17766
|
branding,
|
|
17767
|
+
conversationState,
|
|
17103
17768
|
dismissedHandoffs,
|
|
17104
17769
|
error,
|
|
17105
17770
|
handoffPending,
|
|
@@ -17159,10 +17824,12 @@ function WidgetConversationView({
|
|
|
17159
17824
|
{
|
|
17160
17825
|
draft,
|
|
17161
17826
|
emailDraft,
|
|
17827
|
+
emailError,
|
|
17162
17828
|
imageInputRef,
|
|
17163
17829
|
isLoading,
|
|
17164
17830
|
needsEmail,
|
|
17165
17831
|
onDraftChange,
|
|
17832
|
+
onEmailBlur,
|
|
17166
17833
|
onEmailChange,
|
|
17167
17834
|
onImageSelection,
|
|
17168
17835
|
onRemovePendingImage,
|
|
@@ -17196,7 +17863,7 @@ function useComposerHeightSync({
|
|
|
17196
17863
|
session,
|
|
17197
17864
|
conversationLoaded
|
|
17198
17865
|
}) {
|
|
17199
|
-
(0,
|
|
17866
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
17200
17867
|
const wrap = composerWrapRef.current;
|
|
17201
17868
|
const messagesEl = scrollRef.current;
|
|
17202
17869
|
if (!wrap || !messagesEl) {
|
|
@@ -17234,7 +17901,7 @@ function WidgetNav({
|
|
|
17234
17901
|
onNavigate,
|
|
17235
17902
|
view
|
|
17236
17903
|
}) {
|
|
17237
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex border-t border-
|
|
17904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex border-t border-border bg-white", children: [
|
|
17238
17905
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17239
17906
|
NavTab,
|
|
17240
17907
|
{
|
|
@@ -17287,6 +17954,7 @@ function WidgetPanel(props) {
|
|
|
17287
17954
|
isChat,
|
|
17288
17955
|
isFullscreen,
|
|
17289
17956
|
isOpeningPanel,
|
|
17957
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
17290
17958
|
onBack,
|
|
17291
17959
|
onClose,
|
|
17292
17960
|
onNavigate,
|
|
@@ -17295,22 +17963,28 @@ function WidgetPanel(props) {
|
|
|
17295
17963
|
view
|
|
17296
17964
|
} = props;
|
|
17297
17965
|
const panelMotionTransition = reduceMotion ? { duration: 0 } : PANEL_SPRING;
|
|
17298
|
-
const panelInitial = { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17966
|
+
const panelInitial = hostOwnsLauncher2 ? { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 0 } : { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17299
17967
|
const panelOpen = { opacity: 1, scale: 1, y: 0 };
|
|
17300
|
-
const panelExit = {
|
|
17968
|
+
const panelExit = hostOwnsLauncher2 ? {
|
|
17969
|
+
opacity: 0,
|
|
17970
|
+
scale: PANEL_CLOSED_SCALE,
|
|
17971
|
+
transition: { duration: 0 },
|
|
17972
|
+
y: 0
|
|
17973
|
+
} : {
|
|
17301
17974
|
opacity: 0,
|
|
17302
17975
|
scale: PANEL_CLOSED_SCALE,
|
|
17303
17976
|
transition: { duration: 0 },
|
|
17304
17977
|
y: 10
|
|
17305
17978
|
};
|
|
17306
17979
|
const isEmbedded = isCrossOriginEmbed();
|
|
17980
|
+
const paintPanelShadow = !isEmbedded || isDashboardPreview();
|
|
17307
17981
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17308
17982
|
motion.div,
|
|
17309
17983
|
{
|
|
17310
17984
|
animate: panelOpen,
|
|
17311
17985
|
className: cn(
|
|
17312
|
-
"scw-panel relative flex h-[var(--scw-panel-height,
|
|
17313
|
-
|
|
17986
|
+
"scw-panel relative flex h-[var(--scw-panel-height,680px)] w-[var(--scw-panel-width,384px)] max-w-full origin-bottom-right flex-col overflow-hidden rounded-[var(--scw-panel-radius)] border border-solid border-border bg-white backface-hidden antialiased",
|
|
17987
|
+
paintPanelShadow && "shadow-[0_10px_15px_-3px_rgba(0,0,0,.1),0_4px_6px_-4px_rgba(0,0,0,.1)]",
|
|
17314
17988
|
isFullscreen && "border-none rounded-none shadow-none"
|
|
17315
17989
|
),
|
|
17316
17990
|
exit: panelExit,
|
|
@@ -17341,9 +18015,11 @@ function BrandedPanelBody({
|
|
|
17341
18015
|
agentMuted,
|
|
17342
18016
|
branding,
|
|
17343
18017
|
composerWrapRef,
|
|
18018
|
+
conversationState,
|
|
17344
18019
|
dismissedHandoffs,
|
|
17345
18020
|
draft,
|
|
17346
18021
|
emailDraft,
|
|
18022
|
+
emailError,
|
|
17347
18023
|
error,
|
|
17348
18024
|
handoffPending,
|
|
17349
18025
|
imageInputRef,
|
|
@@ -17360,6 +18036,7 @@ function BrandedPanelBody({
|
|
|
17360
18036
|
onConfirmHandoff,
|
|
17361
18037
|
onDismissHandoff,
|
|
17362
18038
|
onDraftChange,
|
|
18039
|
+
onEmailBlur,
|
|
17363
18040
|
onEmailChange,
|
|
17364
18041
|
onImageSelection,
|
|
17365
18042
|
onNavigate,
|
|
@@ -17417,14 +18094,15 @@ function BrandedPanelBody({
|
|
|
17417
18094
|
{
|
|
17418
18095
|
branding,
|
|
17419
18096
|
conversations: sortedHistory,
|
|
18097
|
+
onPick,
|
|
17420
18098
|
onResume,
|
|
17421
|
-
onStartNew
|
|
18099
|
+
onStartNew,
|
|
18100
|
+
suggestions
|
|
17422
18101
|
}
|
|
17423
18102
|
),
|
|
17424
18103
|
view === "messages" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17425
18104
|
MessagesView,
|
|
17426
18105
|
{
|
|
17427
|
-
activeConversationId: session?.conversationId,
|
|
17428
18106
|
branding,
|
|
17429
18107
|
conversations: sortedHistory,
|
|
17430
18108
|
onResume,
|
|
@@ -17438,9 +18116,11 @@ function BrandedPanelBody({
|
|
|
17438
18116
|
agentMuted,
|
|
17439
18117
|
branding,
|
|
17440
18118
|
composerWrapRef,
|
|
18119
|
+
conversationState,
|
|
17441
18120
|
dismissedHandoffs,
|
|
17442
18121
|
draft,
|
|
17443
18122
|
emailDraft,
|
|
18123
|
+
emailError,
|
|
17444
18124
|
error,
|
|
17445
18125
|
handoffPending,
|
|
17446
18126
|
imageInputRef,
|
|
@@ -17455,6 +18135,7 @@ function BrandedPanelBody({
|
|
|
17455
18135
|
onConfirmHandoff,
|
|
17456
18136
|
onDismissHandoff,
|
|
17457
18137
|
onDraftChange,
|
|
18138
|
+
onEmailBlur,
|
|
17458
18139
|
onEmailChange,
|
|
17459
18140
|
onImageSelection,
|
|
17460
18141
|
onPick,
|
|
@@ -17502,16 +18183,16 @@ function BrandedPanelBody({
|
|
|
17502
18183
|
}
|
|
17503
18184
|
function PanelLoadingShell({ onClose }) {
|
|
17504
18185
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
17505
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
18186
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-border p-[var(--scw-header-padding)]", children: onClose ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17506
18187
|
"button",
|
|
17507
18188
|
{
|
|
17508
18189
|
"aria-label": "Close chat",
|
|
17509
|
-
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)] flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-
|
|
18190
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)] flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-700",
|
|
17510
18191
|
onClick: onClose,
|
|
17511
18192
|
type: "button",
|
|
17512
18193
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CloseIcon, {})
|
|
17513
18194
|
}
|
|
17514
|
-
) }),
|
|
18195
|
+
) : null }),
|
|
17515
18196
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17516
18197
|
"div",
|
|
17517
18198
|
{
|
|
@@ -17530,28 +18211,36 @@ function SupportWidgetInner({
|
|
|
17530
18211
|
getStateSnapshot,
|
|
17531
18212
|
placeholder = "Message...",
|
|
17532
18213
|
projectId,
|
|
18214
|
+
startOpen = false,
|
|
17533
18215
|
suggestions
|
|
17534
18216
|
}) {
|
|
17535
|
-
const
|
|
17536
|
-
const emailStorageKey =
|
|
17537
|
-
|
|
17538
|
-
|
|
18217
|
+
const dashboardPreview = isDashboardPreview();
|
|
18218
|
+
const { emailStorageKey, storageKey } = widgetSessionStorageKeys(
|
|
18219
|
+
projectId,
|
|
18220
|
+
dashboardPreview
|
|
18221
|
+
);
|
|
18222
|
+
const [isOpen, setIsOpen] = (0, import_react44.useState)(startOpen);
|
|
18223
|
+
const [isOpeningPanel, setIsOpeningPanel] = (0, import_react44.useState)(startOpen);
|
|
17539
18224
|
const reduceMotion = useReducedMotion();
|
|
17540
|
-
const [view, setView] = (0,
|
|
17541
|
-
const [returnView, setReturnView] = (0,
|
|
17542
|
-
const
|
|
17543
|
-
|
|
18225
|
+
const [view, setView] = (0, import_react44.useState)("home");
|
|
18226
|
+
const [returnView, setReturnView] = (0, import_react44.useState)("home");
|
|
18227
|
+
const previewShell2 = (0, import_react44.useSyncExternalStore)(
|
|
18228
|
+
subscribeToRegistry,
|
|
18229
|
+
getPreviewShell,
|
|
18230
|
+
getPreviewShell
|
|
17544
18231
|
);
|
|
17545
|
-
const [
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
const [
|
|
17549
|
-
const [
|
|
17550
|
-
const
|
|
18232
|
+
const [branding, setBranding] = (0, import_react44.useState)(
|
|
18233
|
+
() => previewShell2?.branding ?? readBrandingCache(projectId)
|
|
18234
|
+
);
|
|
18235
|
+
const [resolvedSuggestions, setResolvedSuggestions] = (0, import_react44.useState)(previewShell2?.suggestions ?? suggestions ?? DEFAULT_SUGGESTIONS);
|
|
18236
|
+
const [dashboardTools, setDashboardTools] = (0, import_react44.useState)([]);
|
|
18237
|
+
const [draft, setDraft] = (0, import_react44.useState)("");
|
|
18238
|
+
const [pendingImages, setPendingImages] = (0, import_react44.useState)([]);
|
|
18239
|
+
const pendingImageUrls = (0, import_react44.useMemo)(
|
|
17551
18240
|
() => pendingImages.map((file) => URL.createObjectURL(file)),
|
|
17552
18241
|
[pendingImages]
|
|
17553
18242
|
);
|
|
17554
|
-
(0,
|
|
18243
|
+
(0, import_react44.useEffect)(
|
|
17555
18244
|
() => () => {
|
|
17556
18245
|
for (const url of pendingImageUrls) {
|
|
17557
18246
|
URL.revokeObjectURL(url);
|
|
@@ -17559,8 +18248,8 @@ function SupportWidgetInner({
|
|
|
17559
18248
|
},
|
|
17560
18249
|
[pendingImageUrls]
|
|
17561
18250
|
);
|
|
17562
|
-
const sentImageUrlsRef = (0,
|
|
17563
|
-
(0,
|
|
18251
|
+
const sentImageUrlsRef = (0, import_react44.useRef)([]);
|
|
18252
|
+
(0, import_react44.useEffect)(
|
|
17564
18253
|
() => () => {
|
|
17565
18254
|
for (const url of sentImageUrlsRef.current) {
|
|
17566
18255
|
URL.revokeObjectURL(url);
|
|
@@ -17568,30 +18257,25 @@ function SupportWidgetInner({
|
|
|
17568
18257
|
},
|
|
17569
18258
|
[]
|
|
17570
18259
|
);
|
|
17571
|
-
const [emailDraft, setEmailDraft] = (0,
|
|
17572
|
-
const [
|
|
17573
|
-
const [sendError, setSendError] = (0,
|
|
17574
|
-
const [agentMuted, setAgentMuted] = (0,
|
|
17575
|
-
const [conversation, setConversation] = (0,
|
|
18260
|
+
const [emailDraft, setEmailDraft] = (0, import_react44.useState)("");
|
|
18261
|
+
const [emailTouched, setEmailTouched] = (0, import_react44.useState)(false);
|
|
18262
|
+
const [sendError, setSendError] = (0, import_react44.useState)(null);
|
|
18263
|
+
const [agentMuted, setAgentMuted] = (0, import_react44.useState)(false);
|
|
18264
|
+
const [conversation, setConversation] = (0, import_react44.useState)(
|
|
17576
18265
|
null
|
|
17577
18266
|
);
|
|
17578
|
-
const [conversationLoaded, setConversationLoaded] = (0,
|
|
17579
|
-
const
|
|
17580
|
-
() => /* @__PURE__ */ new Set()
|
|
17581
|
-
);
|
|
17582
|
-
const [handoffPending, setHandoffPending] = (0, import_react42.useState)(false);
|
|
17583
|
-
const handoffPendingRef = (0, import_react42.useRef)(false);
|
|
17584
|
-
const scrollRef = (0, import_react42.useRef)(null);
|
|
18267
|
+
const [conversationLoaded, setConversationLoaded] = (0, import_react44.useState)(false);
|
|
18268
|
+
const scrollRef = (0, import_react44.useRef)(null);
|
|
17585
18269
|
useOverscrollBounce(scrollRef, view === "chat", !!reduceMotion);
|
|
17586
|
-
const scrollReleasedRef = (0,
|
|
17587
|
-
const composerWrapRef = (0,
|
|
17588
|
-
const rootElRef = (0,
|
|
17589
|
-
const textareaRef = (0,
|
|
17590
|
-
const imageInputRef = (0,
|
|
17591
|
-
(0,
|
|
18270
|
+
const scrollReleasedRef = (0, import_react44.useRef)(false);
|
|
18271
|
+
const composerWrapRef = (0, import_react44.useRef)(null);
|
|
18272
|
+
const rootElRef = (0, import_react44.useRef)(null);
|
|
18273
|
+
const textareaRef = (0, import_react44.useRef)(null);
|
|
18274
|
+
const imageInputRef = (0, import_react44.useRef)(null);
|
|
18275
|
+
(0, import_react44.useEffect)(() => {
|
|
17592
18276
|
injectStyles();
|
|
17593
18277
|
}, []);
|
|
17594
|
-
(0,
|
|
18278
|
+
(0, import_react44.useEffect)(() => {
|
|
17595
18279
|
const root = rootElRef.current;
|
|
17596
18280
|
if (!root) {
|
|
17597
18281
|
return;
|
|
@@ -17608,30 +18292,35 @@ function SupportWidgetInner({
|
|
|
17608
18292
|
isOpen,
|
|
17609
18293
|
rootElRef
|
|
17610
18294
|
});
|
|
17611
|
-
const identity2 = (0,
|
|
18295
|
+
const identity2 = (0, import_react44.useSyncExternalStore)(
|
|
17612
18296
|
subscribeToRegistry,
|
|
17613
18297
|
getIdentity,
|
|
17614
18298
|
getIdentity
|
|
17615
18299
|
);
|
|
17616
|
-
const userJwt2 = (0,
|
|
18300
|
+
const userJwt2 = (0, import_react44.useSyncExternalStore)(
|
|
17617
18301
|
subscribeToRegistry,
|
|
17618
18302
|
getUserJwt,
|
|
17619
18303
|
getUserJwt
|
|
17620
18304
|
);
|
|
17621
|
-
const
|
|
18305
|
+
const identityRef = (0, import_react44.useRef)(identity2);
|
|
18306
|
+
const userJwtRef = (0, import_react44.useRef)(userJwt2);
|
|
18307
|
+
const sessionRef = (0, import_react44.useRef)(null);
|
|
18308
|
+
identityRef.current = identity2;
|
|
18309
|
+
userJwtRef.current = userJwt2;
|
|
18310
|
+
const hostOwnsLauncher2 = (0, import_react44.useSyncExternalStore)(
|
|
18311
|
+
subscribeToRegistry,
|
|
18312
|
+
getHostOwnsLauncher,
|
|
18313
|
+
getHostOwnsLauncher
|
|
18314
|
+
);
|
|
18315
|
+
const toolLabels = (0, import_react44.useMemo)(
|
|
17622
18316
|
() => buildToolDisplayLabelMap(dashboardTools),
|
|
17623
18317
|
[dashboardTools]
|
|
17624
18318
|
);
|
|
17625
|
-
const
|
|
17626
|
-
const
|
|
17627
|
-
const snapshotRef = (0, import_react42.useRef)(getStateSnapshot);
|
|
17628
|
-
const identityRef = (0, import_react42.useRef)(identity2);
|
|
17629
|
-
const userJwtRef = (0, import_react42.useRef)(userJwt2);
|
|
18319
|
+
const toolsRef = (0, import_react44.useRef)(dashboardTools);
|
|
18320
|
+
const snapshotRef = (0, import_react44.useRef)(getStateSnapshot);
|
|
17630
18321
|
toolsRef.current = dashboardTools;
|
|
17631
18322
|
snapshotRef.current = getStateSnapshot;
|
|
17632
|
-
|
|
17633
|
-
userJwtRef.current = userJwt2;
|
|
17634
|
-
const openWidget2 = (0, import_react42.useCallback)(() => {
|
|
18323
|
+
const openWidget2 = (0, import_react44.useCallback)(() => {
|
|
17635
18324
|
primeMessageChime();
|
|
17636
18325
|
setIsOpeningPanel(true);
|
|
17637
18326
|
setIsOpen(true);
|
|
@@ -17642,22 +18331,28 @@ function SupportWidgetInner({
|
|
|
17642
18331
|
setView("home");
|
|
17643
18332
|
}
|
|
17644
18333
|
}, []);
|
|
17645
|
-
(0,
|
|
18334
|
+
const closePanel = (0, import_react44.useCallback)(() => {
|
|
18335
|
+
if (dashboardPreview) {
|
|
18336
|
+
return;
|
|
18337
|
+
}
|
|
18338
|
+
setIsOpen(false);
|
|
18339
|
+
}, [dashboardPreview]);
|
|
18340
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
17646
18341
|
setOpenControls({
|
|
17647
|
-
close:
|
|
18342
|
+
close: closePanel,
|
|
17648
18343
|
open: openWidget2
|
|
17649
18344
|
});
|
|
17650
18345
|
return () => {
|
|
17651
18346
|
setOpenControls(null);
|
|
17652
18347
|
};
|
|
17653
|
-
}, [openWidget2]);
|
|
17654
|
-
(0,
|
|
18348
|
+
}, [closePanel, openWidget2]);
|
|
18349
|
+
(0, import_react44.useEffect)(() => {
|
|
17655
18350
|
if (!isOpen) {
|
|
17656
18351
|
setIsOpeningPanel(false);
|
|
17657
18352
|
}
|
|
17658
18353
|
}, [isOpen]);
|
|
17659
|
-
(0,
|
|
17660
|
-
if (!isOpen) {
|
|
18354
|
+
(0, import_react44.useEffect)(() => {
|
|
18355
|
+
if (!isOpen || dashboardPreview) {
|
|
17661
18356
|
return;
|
|
17662
18357
|
}
|
|
17663
18358
|
function handleKeyDown(event) {
|
|
@@ -17665,143 +18360,20 @@ function SupportWidgetInner({
|
|
|
17665
18360
|
return;
|
|
17666
18361
|
}
|
|
17667
18362
|
event.preventDefault();
|
|
17668
|
-
|
|
18363
|
+
closePanel();
|
|
17669
18364
|
}
|
|
17670
18365
|
window.addEventListener("keydown", handleKeyDown);
|
|
17671
18366
|
return () => {
|
|
17672
18367
|
window.removeEventListener("keydown", handleKeyDown);
|
|
17673
18368
|
};
|
|
17674
|
-
}, [isOpen]);
|
|
17675
|
-
const
|
|
17676
|
-
const
|
|
17677
|
-
const
|
|
17678
|
-
const
|
|
17679
|
-
const
|
|
17680
|
-
const
|
|
17681
|
-
|
|
17682
|
-
const refreshSessionHistory = (0, import_react42.useCallback)(() => {
|
|
17683
|
-
const jwt = userJwtRef.current;
|
|
17684
|
-
if (jwt) {
|
|
17685
|
-
void (async () => {
|
|
17686
|
-
try {
|
|
17687
|
-
const rows = await listConversations({
|
|
17688
|
-
baseUrl,
|
|
17689
|
-
projectId,
|
|
17690
|
-
userJwt: jwt
|
|
17691
|
-
});
|
|
17692
|
-
setSessionHistory(
|
|
17693
|
-
rows.map((row) => ({
|
|
17694
|
-
conversationId: row.conversationId,
|
|
17695
|
-
preview: row.preview,
|
|
17696
|
-
sessionToken: row.sessionToken,
|
|
17697
|
-
updatedAt: row.updatedAt
|
|
17698
|
-
}))
|
|
17699
|
-
);
|
|
17700
|
-
} catch {
|
|
17701
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17702
|
-
}
|
|
17703
|
-
})();
|
|
17704
|
-
return;
|
|
17705
|
-
}
|
|
17706
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17707
|
-
}, [baseUrl, projectId, storageKey]);
|
|
17708
|
-
(0, import_react42.useEffect)(() => {
|
|
17709
|
-
const stored = readStoredSession(storageKey);
|
|
17710
|
-
sessionRef.current = stored;
|
|
17711
|
-
setSession(stored);
|
|
17712
|
-
if (stored) {
|
|
17713
|
-
ensureActiveSessionInHistory(storageKey, stored);
|
|
17714
|
-
}
|
|
17715
|
-
refreshSessionHistory();
|
|
17716
|
-
}, [refreshSessionHistory, storageKey]);
|
|
17717
|
-
const resumedJwtRef = (0, import_react42.useRef)(null);
|
|
17718
|
-
(0, import_react42.useEffect)(() => {
|
|
17719
|
-
if (!userJwt2 || resumedJwtRef.current === userJwt2) {
|
|
17720
|
-
return;
|
|
17721
|
-
}
|
|
17722
|
-
const jwt = userJwt2;
|
|
17723
|
-
resumedJwtRef.current = jwt;
|
|
17724
|
-
let cancelled = false;
|
|
17725
|
-
async function resume() {
|
|
17726
|
-
try {
|
|
17727
|
-
const resumed = await resumeSession({
|
|
17728
|
-
baseUrl,
|
|
17729
|
-
projectId,
|
|
17730
|
-
userJwt: jwt
|
|
17731
|
-
});
|
|
17732
|
-
if (cancelled || !resumed) {
|
|
17733
|
-
return;
|
|
17734
|
-
}
|
|
17735
|
-
const next = {
|
|
17736
|
-
conversationId: resumed.conversationId,
|
|
17737
|
-
sessionToken: resumed.sessionToken
|
|
17738
|
-
};
|
|
17739
|
-
sessionRef.current = next;
|
|
17740
|
-
setSession(next);
|
|
17741
|
-
storeSession(storageKey, next);
|
|
17742
|
-
ensureActiveSessionInHistory(storageKey, next);
|
|
17743
|
-
setConversation(resumed.conversation);
|
|
17744
|
-
setConversationLoaded(true);
|
|
17745
|
-
setAgentMuted(!resumed.conversation.agentEnabled);
|
|
17746
|
-
refreshSessionHistory();
|
|
17747
|
-
} catch {
|
|
17748
|
-
resumedJwtRef.current = null;
|
|
17749
|
-
}
|
|
17750
|
-
}
|
|
17751
|
-
void resume();
|
|
17752
|
-
return () => {
|
|
17753
|
-
cancelled = true;
|
|
17754
|
-
};
|
|
17755
|
-
}, [baseUrl, projectId, userJwt2, refreshSessionHistory, storageKey]);
|
|
17756
|
-
const prevOwnerRef = (0, import_react42.useRef)(void 0);
|
|
17757
|
-
const prevJwtPresentRef = (0, import_react42.useRef)(false);
|
|
17758
|
-
(0, import_react42.useEffect)(() => {
|
|
17759
|
-
const ownerId = identity2?.distinctId ?? identity2?.email ?? null;
|
|
17760
|
-
const jwtPresent = Boolean(userJwt2);
|
|
17761
|
-
const previousOwner = prevOwnerRef.current;
|
|
17762
|
-
const previousJwtPresent = prevJwtPresentRef.current;
|
|
17763
|
-
prevOwnerRef.current = ownerId;
|
|
17764
|
-
prevJwtPresentRef.current = jwtPresent;
|
|
17765
|
-
function wipeForIdentitySwitch() {
|
|
17766
|
-
resetChatState();
|
|
17767
|
-
sessionRef.current = null;
|
|
17768
|
-
setSession(null);
|
|
17769
|
-
resumedJwtRef.current = null;
|
|
17770
|
-
try {
|
|
17771
|
-
window.localStorage.removeItem(emailStorageKey);
|
|
17772
|
-
} catch {
|
|
17773
|
-
}
|
|
17774
|
-
setCapturedEmail(null);
|
|
17775
|
-
refreshSessionHistory();
|
|
17776
|
-
}
|
|
17777
|
-
if (ownerId) {
|
|
17778
|
-
const { cleared } = reconcileSessionOwner(storageKey, ownerId);
|
|
17779
|
-
if (cleared) {
|
|
17780
|
-
wipeForIdentitySwitch();
|
|
17781
|
-
} else {
|
|
17782
|
-
refreshSessionHistory();
|
|
17783
|
-
}
|
|
17784
|
-
return;
|
|
17785
|
-
}
|
|
17786
|
-
if ((previousOwner || previousJwtPresent) && !jwtPresent) {
|
|
17787
|
-
clearChatStorage(storageKey);
|
|
17788
|
-
wipeForIdentitySwitch();
|
|
17789
|
-
return;
|
|
17790
|
-
}
|
|
17791
|
-
if (jwtPresent) {
|
|
17792
|
-
refreshSessionHistory();
|
|
17793
|
-
}
|
|
17794
|
-
}, [identity2, userJwt2, storageKey, emailStorageKey, refreshSessionHistory]);
|
|
17795
|
-
(0, import_react42.useEffect)(() => {
|
|
17796
|
-
try {
|
|
17797
|
-
const stored = window.localStorage.getItem(emailStorageKey);
|
|
17798
|
-
if (stored) {
|
|
17799
|
-
setCapturedEmail(stored);
|
|
17800
|
-
}
|
|
17801
|
-
} catch {
|
|
17802
|
-
}
|
|
17803
|
-
}, [emailStorageKey]);
|
|
17804
|
-
(0, import_react42.useEffect)(() => {
|
|
18369
|
+
}, [closePanel, dashboardPreview, isOpen]);
|
|
18370
|
+
const mergedIdsRef = (0, import_react44.useRef)(/* @__PURE__ */ new Set());
|
|
18371
|
+
const reportedSeenMessageIdsRef = (0, import_react44.useRef)(/* @__PURE__ */ new Set());
|
|
18372
|
+
const seededRef = (0, import_react44.useRef)(false);
|
|
18373
|
+
const brandingFetchStartedRef = (0, import_react44.useRef)(false);
|
|
18374
|
+
const pendingPersistRef = (0, import_react44.useRef)(null);
|
|
18375
|
+
const sendInFlightRef = (0, import_react44.useRef)(false);
|
|
18376
|
+
(0, import_react44.useEffect)(() => {
|
|
17805
18377
|
if (brandingFetchStartedRef.current) {
|
|
17806
18378
|
return;
|
|
17807
18379
|
}
|
|
@@ -17811,8 +18383,15 @@ function SupportWidgetInner({
|
|
|
17811
18383
|
try {
|
|
17812
18384
|
const result = await getWidgetConfig({ baseUrl, projectId });
|
|
17813
18385
|
if (!cancelled) {
|
|
17814
|
-
|
|
17815
|
-
|
|
18386
|
+
if (!dashboardPreview) {
|
|
18387
|
+
writeBrandingCache(projectId, result.branding);
|
|
18388
|
+
}
|
|
18389
|
+
if (!getPreviewShell()) {
|
|
18390
|
+
setBranding(result.branding);
|
|
18391
|
+
if (Array.isArray(result.suggestions)) {
|
|
18392
|
+
setResolvedSuggestions(result.suggestions);
|
|
18393
|
+
}
|
|
18394
|
+
}
|
|
17816
18395
|
setDashboardTools(
|
|
17817
18396
|
result.tools.map((tool) => reconstructDashboardTool(tool))
|
|
17818
18397
|
);
|
|
@@ -17828,8 +18407,15 @@ function SupportWidgetInner({
|
|
|
17828
18407
|
return () => {
|
|
17829
18408
|
cancelled = true;
|
|
17830
18409
|
};
|
|
17831
|
-
}, [baseUrl, projectId]);
|
|
17832
|
-
|
|
18410
|
+
}, [baseUrl, dashboardPreview, projectId]);
|
|
18411
|
+
(0, import_react44.useEffect)(() => {
|
|
18412
|
+
if (!previewShell2) {
|
|
18413
|
+
return;
|
|
18414
|
+
}
|
|
18415
|
+
setBranding(previewShell2.branding);
|
|
18416
|
+
setResolvedSuggestions(previewShell2.suggestions);
|
|
18417
|
+
}, [previewShell2]);
|
|
18418
|
+
const runTool = (0, import_react44.useCallback)((toolCall) => {
|
|
17833
18419
|
const match = toolsRef.current.find(
|
|
17834
18420
|
(entry) => normalizeToolName(entry.name) === toolCall.toolName
|
|
17835
18421
|
);
|
|
@@ -17847,7 +18433,7 @@ function SupportWidgetInner({
|
|
|
17847
18433
|
}
|
|
17848
18434
|
return match.execute(toolCall.input ?? {});
|
|
17849
18435
|
}, []);
|
|
17850
|
-
const onToolCallRef = (0,
|
|
18436
|
+
const onToolCallRef = (0, import_react44.useRef)(() => {
|
|
17851
18437
|
});
|
|
17852
18438
|
const {
|
|
17853
18439
|
addToolApprovalResponse,
|
|
@@ -17859,7 +18445,7 @@ function SupportWidgetInner({
|
|
|
17859
18445
|
setMessages,
|
|
17860
18446
|
status,
|
|
17861
18447
|
stop
|
|
17862
|
-
} = (0,
|
|
18448
|
+
} = (0, import_react43.useChat)({
|
|
17863
18449
|
onToolCall: (event) => onToolCallRef.current(event),
|
|
17864
18450
|
sendAutomaticallyWhen: (opts) => (0, import_ai7.lastAssistantMessageIsCompleteWithToolCalls)(opts) || (0, import_ai7.lastAssistantMessageIsCompleteWithApprovalResponses)(opts),
|
|
17865
18451
|
transport: new import_ai7.DefaultChatTransport({
|
|
@@ -17877,9 +18463,9 @@ function SupportWidgetInner({
|
|
|
17877
18463
|
messages: outgoing,
|
|
17878
18464
|
projectId,
|
|
17879
18465
|
sessionToken: sessionRef.current?.sessionToken ?? "",
|
|
17880
|
-
stateSnapshot:
|
|
17881
|
-
|
|
17882
|
-
|
|
18466
|
+
stateSnapshot: pickScalarRecord({
|
|
18467
|
+
...identityRef.current?.traits,
|
|
18468
|
+
...isRecord(liveSnapshot) ? liveSnapshot : {}
|
|
17883
18469
|
}),
|
|
17884
18470
|
userJwt: userJwtRef.current ?? void 0
|
|
17885
18471
|
}
|
|
@@ -17903,70 +18489,68 @@ function SupportWidgetInner({
|
|
|
17903
18489
|
}
|
|
17904
18490
|
return onToolCall(event);
|
|
17905
18491
|
};
|
|
18492
|
+
function resetChatState() {
|
|
18493
|
+
stop();
|
|
18494
|
+
setMessages([]);
|
|
18495
|
+
clearPending();
|
|
18496
|
+
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18497
|
+
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18498
|
+
seededRef.current = false;
|
|
18499
|
+
setAgentMuted(false);
|
|
18500
|
+
setConversation(null);
|
|
18501
|
+
setConversationLoaded(false);
|
|
18502
|
+
setSendError(null);
|
|
18503
|
+
setDraft("");
|
|
18504
|
+
setPendingImages([]);
|
|
18505
|
+
}
|
|
18506
|
+
const {
|
|
18507
|
+
capturedEmail,
|
|
18508
|
+
refreshSessionHistory,
|
|
18509
|
+
session,
|
|
18510
|
+
sessionHistory,
|
|
18511
|
+
setCapturedEmail,
|
|
18512
|
+
setSession
|
|
18513
|
+
} = useVisitorConversationPersistence({
|
|
18514
|
+
baseUrl,
|
|
18515
|
+
emailStorageKey,
|
|
18516
|
+
identity: identity2,
|
|
18517
|
+
onIdentityWipe: resetChatState,
|
|
18518
|
+
onResumed: (resumedConversation) => {
|
|
18519
|
+
setConversation(resumedConversation);
|
|
18520
|
+
setConversationLoaded(true);
|
|
18521
|
+
setAgentMuted(!resumedConversation.agentEnabled);
|
|
18522
|
+
},
|
|
18523
|
+
projectId,
|
|
18524
|
+
sessionRef,
|
|
18525
|
+
storageKey,
|
|
18526
|
+
userJwt: userJwt2
|
|
18527
|
+
});
|
|
18528
|
+
const knownEmail = identity2?.email ?? capturedEmail;
|
|
17906
18529
|
const isLoading = status === "submitted" || status === "streaming";
|
|
17907
|
-
const messagesRef = (0,
|
|
18530
|
+
const messagesRef = (0, import_react44.useRef)(messages);
|
|
17908
18531
|
messagesRef.current = messages;
|
|
17909
|
-
const isLoadingRef = (0,
|
|
18532
|
+
const isLoadingRef = (0, import_react44.useRef)(isLoading);
|
|
17910
18533
|
isLoadingRef.current = isLoading;
|
|
17911
18534
|
const { chimedMessageIdsRef } = useInboundMessageChime({
|
|
17912
18535
|
isLoading,
|
|
17913
18536
|
messages
|
|
17914
18537
|
});
|
|
17915
18538
|
const isTakeoverError = !!error && error.message.includes("human_takeover");
|
|
17916
|
-
(0,
|
|
18539
|
+
(0, import_react44.useEffect)(() => {
|
|
17917
18540
|
if (isTakeoverError) {
|
|
17918
18541
|
setAgentMuted(true);
|
|
17919
18542
|
}
|
|
17920
18543
|
}, [isTakeoverError]);
|
|
17921
|
-
const confirmHandoff
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
baseUrl,
|
|
17932
|
-
conversationId: active.conversationId,
|
|
17933
|
-
projectId,
|
|
17934
|
-
reason,
|
|
17935
|
-
sessionToken: active.sessionToken
|
|
17936
|
-
});
|
|
17937
|
-
setAgentMuted(true);
|
|
17938
|
-
if (result.acknowledgment) {
|
|
17939
|
-
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
17940
|
-
setMessages([
|
|
17941
|
-
...messagesRef.current,
|
|
17942
|
-
toUiMessage(result.acknowledgment)
|
|
17943
|
-
]);
|
|
17944
|
-
}
|
|
17945
|
-
} catch {
|
|
17946
|
-
} finally {
|
|
17947
|
-
handoffPendingRef.current = false;
|
|
17948
|
-
setHandoffPending(false);
|
|
17949
|
-
}
|
|
17950
|
-
},
|
|
17951
|
-
[baseUrl, projectId, setMessages]
|
|
17952
|
-
);
|
|
17953
|
-
const dismissHandoff = (0, import_react42.useCallback)(
|
|
17954
|
-
(toolCallId) => {
|
|
17955
|
-
setDismissedHandoffs((prev) => {
|
|
17956
|
-
if (prev.has(toolCallId)) {
|
|
17957
|
-
return prev;
|
|
17958
|
-
}
|
|
17959
|
-
const next = new Set(prev);
|
|
17960
|
-
next.add(toolCallId);
|
|
17961
|
-
return next;
|
|
17962
|
-
});
|
|
17963
|
-
setMessages(
|
|
17964
|
-
(current) => markHandoffDeclinedInMessages(current, toolCallId)
|
|
17965
|
-
);
|
|
17966
|
-
},
|
|
17967
|
-
[setMessages]
|
|
17968
|
-
);
|
|
17969
|
-
(0, import_react42.useEffect)(() => {
|
|
18544
|
+
const { confirmHandoff, dismissedHandoffs, dismissHandoff, handoffPending } = useHandoffDecisions({
|
|
18545
|
+
baseUrl,
|
|
18546
|
+
mergedIdsRef,
|
|
18547
|
+
messagesRef,
|
|
18548
|
+
onAccepted: () => setAgentMuted(true),
|
|
18549
|
+
projectId,
|
|
18550
|
+
sessionRef,
|
|
18551
|
+
setMessages
|
|
18552
|
+
});
|
|
18553
|
+
(0, import_react44.useEffect)(() => {
|
|
17970
18554
|
if (!isOpen || !session) {
|
|
17971
18555
|
return;
|
|
17972
18556
|
}
|
|
@@ -18015,7 +18599,7 @@ function SupportWidgetInner({
|
|
|
18015
18599
|
setDraft(value);
|
|
18016
18600
|
reportDraftActivity(value);
|
|
18017
18601
|
}
|
|
18018
|
-
const reportTeamMessagesSeen = (0,
|
|
18602
|
+
const reportTeamMessagesSeen = (0, import_react44.useCallback)(
|
|
18019
18603
|
(messageIds) => {
|
|
18020
18604
|
const activeSession = sessionRef.current;
|
|
18021
18605
|
const unseenMessageIds = messageIds.filter(
|
|
@@ -18042,7 +18626,7 @@ function SupportWidgetInner({
|
|
|
18042
18626
|
},
|
|
18043
18627
|
[baseUrl, projectId]
|
|
18044
18628
|
);
|
|
18045
|
-
(0,
|
|
18629
|
+
(0, import_react44.useEffect)(() => {
|
|
18046
18630
|
if (!conversation) {
|
|
18047
18631
|
return;
|
|
18048
18632
|
}
|
|
@@ -18080,7 +18664,7 @@ function SupportWidgetInner({
|
|
|
18080
18664
|
setMessages([...messagesRef.current, ...fresh.map(toUiMessage)]);
|
|
18081
18665
|
maybePlayIncomingChime("soft");
|
|
18082
18666
|
}, [conversation, setMessages, storageKey, refreshSessionHistory]);
|
|
18083
|
-
(0,
|
|
18667
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
18084
18668
|
const el = textareaRef.current;
|
|
18085
18669
|
if (!el) {
|
|
18086
18670
|
return;
|
|
@@ -18089,7 +18673,11 @@ function SupportWidgetInner({
|
|
|
18089
18673
|
el.style.height = `${Math.min(el.scrollHeight, MAX_TEXTAREA_HEIGHT_PX)}px`;
|
|
18090
18674
|
}, [draft]);
|
|
18091
18675
|
const needsEmail = !session && !knownEmail;
|
|
18676
|
+
const emailError = needsEmail && emailTouched ? resolveEmailDraftError(emailDraft) : null;
|
|
18092
18677
|
async function handleSubmit(event) {
|
|
18678
|
+
if (needsEmail) {
|
|
18679
|
+
setEmailTouched(true);
|
|
18680
|
+
}
|
|
18093
18681
|
stopTyping();
|
|
18094
18682
|
await submitWidgetMessage(event, {
|
|
18095
18683
|
agentMuted,
|
|
@@ -18128,20 +18716,6 @@ function SupportWidgetInner({
|
|
|
18128
18716
|
function removePendingImage(index2) {
|
|
18129
18717
|
setPendingImages((current) => current.filter((_, i) => i !== index2));
|
|
18130
18718
|
}
|
|
18131
|
-
function resetChatState() {
|
|
18132
|
-
stop();
|
|
18133
|
-
setMessages([]);
|
|
18134
|
-
clearPending();
|
|
18135
|
-
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18136
|
-
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18137
|
-
seededRef.current = false;
|
|
18138
|
-
setAgentMuted(false);
|
|
18139
|
-
setConversation(null);
|
|
18140
|
-
setConversationLoaded(false);
|
|
18141
|
-
setSendError(null);
|
|
18142
|
-
setDraft("");
|
|
18143
|
-
setPendingImages([]);
|
|
18144
|
-
}
|
|
18145
18719
|
function startNewConversation() {
|
|
18146
18720
|
startNewConversationAction({
|
|
18147
18721
|
resetChatState,
|
|
@@ -18167,6 +18741,9 @@ function SupportWidgetInner({
|
|
|
18167
18741
|
});
|
|
18168
18742
|
}
|
|
18169
18743
|
function pickSuggestion(prompt) {
|
|
18744
|
+
if (view !== "chat") {
|
|
18745
|
+
startNewConversation();
|
|
18746
|
+
}
|
|
18170
18747
|
handleDraftChange(prompt);
|
|
18171
18748
|
textareaRef.current?.focus();
|
|
18172
18749
|
}
|
|
@@ -18175,7 +18752,7 @@ function SupportWidgetInner({
|
|
|
18175
18752
|
messages,
|
|
18176
18753
|
pendingSize: pending.size
|
|
18177
18754
|
});
|
|
18178
|
-
const sortedHistory = (0,
|
|
18755
|
+
const sortedHistory = (0, import_react44.useMemo)(
|
|
18179
18756
|
() => [...sessionHistory].sort((a, b) => b.updatedAt - a.updatedAt),
|
|
18180
18757
|
[sessionHistory]
|
|
18181
18758
|
);
|
|
@@ -18187,15 +18764,15 @@ function SupportWidgetInner({
|
|
|
18187
18764
|
conversation,
|
|
18188
18765
|
conversationLoaded
|
|
18189
18766
|
});
|
|
18190
|
-
const prevViewRef = (0,
|
|
18191
|
-
const viewTransition = (0,
|
|
18767
|
+
const prevViewRef = (0, import_react44.useRef)(view);
|
|
18768
|
+
const viewTransition = (0, import_react44.useMemo)(
|
|
18192
18769
|
() => deriveViewTransition(view, prevViewRef.current),
|
|
18193
18770
|
[view]
|
|
18194
18771
|
);
|
|
18195
|
-
(0,
|
|
18772
|
+
(0, import_react44.useEffect)(() => {
|
|
18196
18773
|
prevViewRef.current = view;
|
|
18197
18774
|
}, [view]);
|
|
18198
|
-
(0,
|
|
18775
|
+
(0, import_react44.useEffect)(() => {
|
|
18199
18776
|
if (isOpen && view === "chat") {
|
|
18200
18777
|
focusComposer(textareaRef);
|
|
18201
18778
|
}
|
|
@@ -18209,8 +18786,9 @@ function SupportWidgetInner({
|
|
|
18209
18786
|
"div",
|
|
18210
18787
|
{
|
|
18211
18788
|
className: cn(
|
|
18212
|
-
"box-border flex
|
|
18789
|
+
"box-border flex flex-none flex-col text-sm leading-[1.45] text-neutral-900 [&_*]:box-border",
|
|
18213
18790
|
"[font-family:var(--scw-font)]",
|
|
18791
|
+
dashboardPreview ? "h-full w-full max-w-full items-center justify-center p-0" : hostOwnsLauncher2 ? "w-max items-end p-0" : "w-max items-end gap-3 p-4",
|
|
18214
18792
|
isFullscreen && "h-full w-full p-0"
|
|
18215
18793
|
),
|
|
18216
18794
|
ref: rootElRef,
|
|
@@ -18225,6 +18803,7 @@ function SupportWidgetInner({
|
|
|
18225
18803
|
dismissedHandoffs,
|
|
18226
18804
|
draft,
|
|
18227
18805
|
emailDraft,
|
|
18806
|
+
emailError,
|
|
18228
18807
|
error,
|
|
18229
18808
|
handoffPending,
|
|
18230
18809
|
imageInputRef,
|
|
@@ -18233,15 +18812,17 @@ function SupportWidgetInner({
|
|
|
18233
18812
|
isLoading,
|
|
18234
18813
|
isLoadingMessages,
|
|
18235
18814
|
isOpeningPanel,
|
|
18815
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
18236
18816
|
isTakeoverError,
|
|
18237
18817
|
messages,
|
|
18238
18818
|
needsEmail,
|
|
18239
18819
|
onApprove: approve,
|
|
18240
18820
|
onBack: () => setView(returnView),
|
|
18241
|
-
onClose:
|
|
18821
|
+
onClose: dashboardPreview ? void 0 : closePanel,
|
|
18242
18822
|
onConfirmHandoff: confirmHandoff,
|
|
18243
18823
|
onDismissHandoff: dismissHandoff,
|
|
18244
18824
|
onDraftChange: handleDraftChange,
|
|
18825
|
+
onEmailBlur: () => setEmailTouched(true),
|
|
18245
18826
|
onEmailChange: setEmailDraft,
|
|
18246
18827
|
onImageSelection: handleImageSelection,
|
|
18247
18828
|
onNavigate: setView,
|
|
@@ -18272,19 +18853,20 @@ function SupportWidgetInner({
|
|
|
18272
18853
|
session,
|
|
18273
18854
|
showThinking,
|
|
18274
18855
|
sortedHistory,
|
|
18275
|
-
suggestions:
|
|
18856
|
+
suggestions: resolvedSuggestions,
|
|
18276
18857
|
textareaRef,
|
|
18277
18858
|
typingLabel,
|
|
18278
18859
|
conversationLoaded,
|
|
18860
|
+
conversationState: conversation?.state ?? null,
|
|
18279
18861
|
toolLabels,
|
|
18280
18862
|
view
|
|
18281
18863
|
}
|
|
18282
18864
|
) }),
|
|
18283
|
-
!isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
18865
|
+
!isFullscreen && !hostOwnsLauncher2 && !dashboardPreview && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
18284
18866
|
WidgetLauncher,
|
|
18285
18867
|
{
|
|
18286
18868
|
isOpen,
|
|
18287
|
-
onClose:
|
|
18869
|
+
onClose: closePanel,
|
|
18288
18870
|
onOpen: openWidget2,
|
|
18289
18871
|
reduceMotion
|
|
18290
18872
|
}
|