@sevenfold/setto-client 0.24.6 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/chat/SettoChat.d.ts +1 -0
- package/dist/setto-client.js +127 -26
- package/dist/setto-client.js.map +1 -1
- package/package.json +1 -1
package/dist/setto-client.js
CHANGED
|
@@ -34655,6 +34655,8 @@ function remarkGfm(options) {
|
|
|
34655
34655
|
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
34656
34656
|
}
|
|
34657
34657
|
const VISITOR_KEY = "setto-chat-visitor";
|
|
34658
|
+
const ACTIVE_CONVERSATION_KEY = "setto-chat-active";
|
|
34659
|
+
const NAVIGATION_KEY = "setto-chat-navigation";
|
|
34658
34660
|
const CLOSE_MS = 210;
|
|
34659
34661
|
const MIN_COMPOSER_HEIGHT = 36;
|
|
34660
34662
|
const MAX_COMPOSER_HEIGHT = 200;
|
|
@@ -34669,6 +34671,69 @@ function visitorId() {
|
|
|
34669
34671
|
return crypto.randomUUID();
|
|
34670
34672
|
}
|
|
34671
34673
|
}
|
|
34674
|
+
function activeConversationKey(siteId) {
|
|
34675
|
+
return `${ACTIVE_CONVERSATION_KEY}:${siteId}`;
|
|
34676
|
+
}
|
|
34677
|
+
function navigationKey(siteId) {
|
|
34678
|
+
return `${NAVIGATION_KEY}:${siteId}`;
|
|
34679
|
+
}
|
|
34680
|
+
function storedActiveConversation(siteId) {
|
|
34681
|
+
try {
|
|
34682
|
+
const value = window.sessionStorage.getItem(activeConversationKey(siteId));
|
|
34683
|
+
return value && /^[0-9a-f]{8}-[0-9a-f-]{27,}$/i.test(value) ? value : null;
|
|
34684
|
+
} catch {
|
|
34685
|
+
return null;
|
|
34686
|
+
}
|
|
34687
|
+
}
|
|
34688
|
+
function nextWordBoundary(content2, visibleLength) {
|
|
34689
|
+
if (visibleLength >= content2.length) return content2.length;
|
|
34690
|
+
const match = content2.slice(visibleLength).match(/^\s*\S+\s*/u);
|
|
34691
|
+
return Math.min(content2.length, visibleLength + (match?.[0].length ?? 1));
|
|
34692
|
+
}
|
|
34693
|
+
function createWordRevealer(onReveal) {
|
|
34694
|
+
let target = "";
|
|
34695
|
+
let visibleLength = 0;
|
|
34696
|
+
let timer = null;
|
|
34697
|
+
let finished = false;
|
|
34698
|
+
let settled = false;
|
|
34699
|
+
let resolveDrain = () => void 0;
|
|
34700
|
+
const drained = new Promise((resolve) => {
|
|
34701
|
+
resolveDrain = resolve;
|
|
34702
|
+
});
|
|
34703
|
+
const settle = () => {
|
|
34704
|
+
if (settled) return;
|
|
34705
|
+
settled = true;
|
|
34706
|
+
if (timer) clearTimeout(timer);
|
|
34707
|
+
timer = null;
|
|
34708
|
+
resolveDrain();
|
|
34709
|
+
};
|
|
34710
|
+
const tick = () => {
|
|
34711
|
+
timer = null;
|
|
34712
|
+
if (visibleLength < target.length) {
|
|
34713
|
+
visibleLength = nextWordBoundary(target, visibleLength);
|
|
34714
|
+
onReveal(target.slice(0, visibleLength));
|
|
34715
|
+
timer = setTimeout(tick, 28);
|
|
34716
|
+
return;
|
|
34717
|
+
}
|
|
34718
|
+
if (finished) settle();
|
|
34719
|
+
};
|
|
34720
|
+
const schedule = () => {
|
|
34721
|
+
if (!timer && !settled) timer = setTimeout(tick, 0);
|
|
34722
|
+
};
|
|
34723
|
+
return {
|
|
34724
|
+
push(next) {
|
|
34725
|
+
target = next;
|
|
34726
|
+
schedule();
|
|
34727
|
+
},
|
|
34728
|
+
finish(next) {
|
|
34729
|
+
if (next !== void 0) target = next;
|
|
34730
|
+
finished = true;
|
|
34731
|
+
schedule();
|
|
34732
|
+
return drained;
|
|
34733
|
+
},
|
|
34734
|
+
cancel: settle
|
|
34735
|
+
};
|
|
34736
|
+
}
|
|
34672
34737
|
function norwegian(locale) {
|
|
34673
34738
|
return locale.toLowerCase().startsWith("no");
|
|
34674
34739
|
}
|
|
@@ -34761,19 +34826,9 @@ function PersonIcon() {
|
|
|
34761
34826
|
function StaggeredText({ children }) {
|
|
34762
34827
|
return Children.map(children, (child) => {
|
|
34763
34828
|
if (typeof child !== "string") return child;
|
|
34764
|
-
let wordIndex = 0;
|
|
34765
34829
|
return child.split(/(\s+)/).map((part, index2) => {
|
|
34766
34830
|
if (!part || /^\s+$/.test(part)) return part;
|
|
34767
|
-
|
|
34768
|
-
return /* @__PURE__ */ jsx(
|
|
34769
|
-
"span",
|
|
34770
|
-
{
|
|
34771
|
-
className: "setto-chat__word",
|
|
34772
|
-
style: { animationDelay: `${delay}ms` },
|
|
34773
|
-
children: part
|
|
34774
|
-
},
|
|
34775
|
-
`${index2}-${part}`
|
|
34776
|
-
);
|
|
34831
|
+
return /* @__PURE__ */ jsx("span", { className: "setto-chat__word", children: part }, `${index2}-${part}`);
|
|
34777
34832
|
});
|
|
34778
34833
|
});
|
|
34779
34834
|
}
|
|
@@ -35112,11 +35167,12 @@ function SettoChat() {
|
|
|
35112
35167
|
const [sending, setSending] = useState(false);
|
|
35113
35168
|
const [queued, setQueued] = useState(false);
|
|
35114
35169
|
const [loadingConversation, setLoadingConversation] = useState(false);
|
|
35170
|
+
const [humanJoined, setHumanJoined] = useState(false);
|
|
35115
35171
|
const [availability, setAvailability] = useState({
|
|
35116
35172
|
humanAvailable: false,
|
|
35117
35173
|
avatarUrl: null
|
|
35118
35174
|
});
|
|
35119
|
-
const conversationId = useRef(
|
|
35175
|
+
const conversationId = useRef(storedActiveConversation(config.siteId));
|
|
35120
35176
|
const visitor = useRef(null);
|
|
35121
35177
|
const logRef = useRef(null);
|
|
35122
35178
|
const pinToBottomRef = useRef(true);
|
|
@@ -35137,6 +35193,7 @@ function SettoChat() {
|
|
|
35137
35193
|
chats: "Chats",
|
|
35138
35194
|
newChat: "Ny chat",
|
|
35139
35195
|
placeholder: "Hva vil du spørre om?",
|
|
35196
|
+
humanPlaceholder: "Skriv til teamet · bruk @barista for AI",
|
|
35140
35197
|
send: "Send melding",
|
|
35141
35198
|
sending: "Svarer …",
|
|
35142
35199
|
attach: "Legg ved bilde",
|
|
@@ -35152,6 +35209,7 @@ function SettoChat() {
|
|
|
35152
35209
|
chats: "Chats",
|
|
35153
35210
|
newChat: "New chat",
|
|
35154
35211
|
placeholder: "What would you like to ask?",
|
|
35212
|
+
humanPlaceholder: "Message the team · use @barista for AI",
|
|
35155
35213
|
send: "Send message",
|
|
35156
35214
|
sending: "Replying …",
|
|
35157
35215
|
attach: "Attach image",
|
|
@@ -35164,6 +35222,29 @@ function SettoChat() {
|
|
|
35164
35222
|
function ensureVisitor() {
|
|
35165
35223
|
return visitor.current ??= visitorId();
|
|
35166
35224
|
}
|
|
35225
|
+
function rememberConversation(id) {
|
|
35226
|
+
conversationId.current = id;
|
|
35227
|
+
try {
|
|
35228
|
+
if (id) window.sessionStorage.setItem(activeConversationKey(config.siteId), id);
|
|
35229
|
+
else window.sessionStorage.removeItem(activeConversationKey(config.siteId));
|
|
35230
|
+
} catch {
|
|
35231
|
+
}
|
|
35232
|
+
}
|
|
35233
|
+
function applyConversation(next) {
|
|
35234
|
+
rememberConversation(next.conversationId);
|
|
35235
|
+
setHumanJoined(next.humanJoined);
|
|
35236
|
+
setMessages(next.messages);
|
|
35237
|
+
const navigation = [...next.messages].reverse().find((message) => message.kind === "navigation" && message.action?.type === "navigate");
|
|
35238
|
+
if (!navigation?.id || !navigation.action?.url) return;
|
|
35239
|
+
try {
|
|
35240
|
+
if (window.sessionStorage.getItem(navigationKey(config.siteId)) === navigation.id) return;
|
|
35241
|
+
const target = new URL(navigation.action.url, window.location.href);
|
|
35242
|
+
if (target.origin !== window.location.origin || target.href === window.location.href) return;
|
|
35243
|
+
window.sessionStorage.setItem(navigationKey(config.siteId), navigation.id);
|
|
35244
|
+
window.location.assign(target.href);
|
|
35245
|
+
} catch {
|
|
35246
|
+
}
|
|
35247
|
+
}
|
|
35167
35248
|
async function loadChats() {
|
|
35168
35249
|
const id = visitor.current;
|
|
35169
35250
|
if (!id) return;
|
|
@@ -35191,9 +35272,8 @@ function SettoChat() {
|
|
|
35191
35272
|
);
|
|
35192
35273
|
if (!response.ok) return;
|
|
35193
35274
|
const next = await response.json();
|
|
35194
|
-
conversationId.current = next.conversationId;
|
|
35195
35275
|
pinToBottomRef.current = true;
|
|
35196
|
-
|
|
35276
|
+
applyConversation(next);
|
|
35197
35277
|
setDrawer(false);
|
|
35198
35278
|
} finally {
|
|
35199
35279
|
setLoadingConversation(false);
|
|
@@ -35258,7 +35338,7 @@ function SettoChat() {
|
|
|
35258
35338
|
);
|
|
35259
35339
|
if (!response.ok || cancelled) return;
|
|
35260
35340
|
const next = await response.json();
|
|
35261
|
-
if (!cancelled)
|
|
35341
|
+
if (!cancelled) applyConversation(next);
|
|
35262
35342
|
} catch {
|
|
35263
35343
|
}
|
|
35264
35344
|
};
|
|
@@ -35289,6 +35369,7 @@ function SettoChat() {
|
|
|
35289
35369
|
window.requestAnimationFrame(() => setVisible(true));
|
|
35290
35370
|
ensureVisitor();
|
|
35291
35371
|
void loadChats();
|
|
35372
|
+
if (conversationId.current) void loadConversation(conversationId.current);
|
|
35292
35373
|
}
|
|
35293
35374
|
function hide() {
|
|
35294
35375
|
if (document.activeElement instanceof HTMLElement) document.activeElement.blur();
|
|
@@ -35305,7 +35386,8 @@ function SettoChat() {
|
|
|
35305
35386
|
});
|
|
35306
35387
|
}
|
|
35307
35388
|
function startNew() {
|
|
35308
|
-
|
|
35389
|
+
rememberConversation(null);
|
|
35390
|
+
setHumanJoined(false);
|
|
35309
35391
|
setMessages([{ role: "assistant", content: intro(locale, settings?.displayName ?? void 0) }]);
|
|
35310
35392
|
setDraft("");
|
|
35311
35393
|
setQueued(false);
|
|
@@ -35343,6 +35425,7 @@ function SettoChat() {
|
|
|
35343
35425
|
setFiles([]);
|
|
35344
35426
|
setSending(true);
|
|
35345
35427
|
const visitorIdValue = ensureVisitor();
|
|
35428
|
+
let revealer = null;
|
|
35346
35429
|
try {
|
|
35347
35430
|
const uploaded = [];
|
|
35348
35431
|
for (const image2 of turnFiles) {
|
|
@@ -35358,7 +35441,7 @@ function SettoChat() {
|
|
|
35358
35441
|
);
|
|
35359
35442
|
if (!response2.ok) throw new Error("image_upload_failed");
|
|
35360
35443
|
const body = await response2.json();
|
|
35361
|
-
|
|
35444
|
+
rememberConversation(body.conversationId);
|
|
35362
35445
|
uploaded.push(body.attachment);
|
|
35363
35446
|
}
|
|
35364
35447
|
setMessages((previous2) => [
|
|
@@ -35370,6 +35453,9 @@ function SettoChat() {
|
|
|
35370
35453
|
},
|
|
35371
35454
|
{ role: "assistant", content: "", reveal: true }
|
|
35372
35455
|
]);
|
|
35456
|
+
revealer = createWordRevealer((answer) => {
|
|
35457
|
+
setMessages((previous2) => replaceLastAssistant(previous2, answer));
|
|
35458
|
+
});
|
|
35373
35459
|
const response = await fetch(
|
|
35374
35460
|
`${apiUrl}/sites/${encodeURIComponent(config.siteId)}/chat/messages`,
|
|
35375
35461
|
{
|
|
@@ -35386,12 +35472,18 @@ function SettoChat() {
|
|
|
35386
35472
|
}
|
|
35387
35473
|
);
|
|
35388
35474
|
const headerConversation = response.headers.get("X-Setto-Conversation");
|
|
35389
|
-
if (headerConversation)
|
|
35475
|
+
if (headerConversation) rememberConversation(headerConversation);
|
|
35390
35476
|
if (!response.ok) throw new Error(`chat_failed_${response.status}`);
|
|
35391
35477
|
if ((response.headers.get("content-type") ?? "").includes("application/json")) {
|
|
35392
35478
|
const body = await response.json();
|
|
35393
|
-
if (body.conversationId)
|
|
35394
|
-
|
|
35479
|
+
if (body.conversationId) rememberConversation(body.conversationId);
|
|
35480
|
+
if (body.humanJoined) setHumanJoined(true);
|
|
35481
|
+
if (body.silent) {
|
|
35482
|
+
revealer.cancel();
|
|
35483
|
+
setMessages((previous2) => removeLastEmptyAssistant(previous2));
|
|
35484
|
+
} else {
|
|
35485
|
+
await revealer.finish(body.answer || labels.failed);
|
|
35486
|
+
}
|
|
35395
35487
|
} else {
|
|
35396
35488
|
const reader = response.body?.getReader();
|
|
35397
35489
|
if (!reader) throw new Error("chat_missing_stream");
|
|
@@ -35401,15 +35493,14 @@ function SettoChat() {
|
|
|
35401
35493
|
const { done, value } = await reader.read();
|
|
35402
35494
|
if (done) break;
|
|
35403
35495
|
answer += decoder.decode(value, { stream: true });
|
|
35404
|
-
|
|
35496
|
+
revealer.push(answer);
|
|
35405
35497
|
}
|
|
35406
35498
|
answer += decoder.decode();
|
|
35407
|
-
|
|
35408
|
-
setMessages((previous2) => replaceLastAssistant(previous2, labels.failed));
|
|
35409
|
-
}
|
|
35499
|
+
await revealer.finish(answer.trim() ? answer : labels.failed);
|
|
35410
35500
|
}
|
|
35411
35501
|
void loadChats();
|
|
35412
35502
|
} catch {
|
|
35503
|
+
revealer?.cancel();
|
|
35413
35504
|
setMessages((previous2) => replaceLastAssistant(previous2, labels.failed));
|
|
35414
35505
|
} finally {
|
|
35415
35506
|
for (const image2 of turnFiles) URL.revokeObjectURL(image2.preview);
|
|
@@ -35556,7 +35647,7 @@ function SettoChat() {
|
|
|
35556
35647
|
onSubmit: queueOrSend,
|
|
35557
35648
|
busy: sending,
|
|
35558
35649
|
queued,
|
|
35559
|
-
placeholder: labels.placeholder,
|
|
35650
|
+
placeholder: humanJoined ? labels.humanPlaceholder : labels.placeholder,
|
|
35560
35651
|
attachLabel: labels.attach,
|
|
35561
35652
|
sendLabel: labels.send,
|
|
35562
35653
|
removeLabel: labels.remove,
|
|
@@ -35599,12 +35690,22 @@ function replaceLastAssistant(messages, content2) {
|
|
|
35599
35690
|
}
|
|
35600
35691
|
return [...messages, { role: "assistant", content: content2, reveal: true }];
|
|
35601
35692
|
}
|
|
35693
|
+
function removeLastEmptyAssistant(messages) {
|
|
35694
|
+
for (let index2 = messages.length - 1; index2 >= 0; index2 -= 1) {
|
|
35695
|
+
const current = messages[index2];
|
|
35696
|
+
if (current?.role === "assistant" && !current.content) {
|
|
35697
|
+
return [...messages.slice(0, index2), ...messages.slice(index2 + 1)];
|
|
35698
|
+
}
|
|
35699
|
+
if (current?.role !== "system") break;
|
|
35700
|
+
}
|
|
35701
|
+
return messages;
|
|
35702
|
+
}
|
|
35602
35703
|
function useChatStyles() {
|
|
35603
35704
|
useInsertionEffect(() => {
|
|
35604
35705
|
const style = document.createElement("style");
|
|
35605
35706
|
style.dataset.settoChat = "";
|
|
35606
35707
|
style.textContent = `
|
|
35607
|
-
.setto-chat__markdown{display:block;min-width:0;white-space:normal}.setto-chat__markdown> :first-child{margin-top:0}.setto-chat__markdown> :last-child{margin-bottom:0}.setto-chat__markdown p{margin:0 0 .72em}.setto-chat__markdown h1,.setto-chat__markdown h2,.setto-chat__markdown h3{margin:.95em 0 .36em;font-size:1em;font-weight:680;line-height:1.28;letter-spacing:-.012em}.setto-chat__markdown h1{font-size:1.08em}.setto-chat__markdown ul,.setto-chat__markdown ol{margin:.12em 0 .72em;padding-left:1.25em}.setto-chat__markdown ul{list-style:disc}.setto-chat__markdown ol{list-style:decimal}.setto-chat__markdown li{margin:.2em 0;padding-left:.08em}.setto-chat__markdown li::marker{color:color-mix(in srgb,var(--setto-chat-accent) 78%,var(--setto-chat-ink))}.setto-chat__markdown strong{font-weight:700}.setto-chat__markdown a{color:inherit;text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--setto-chat-accent) 70%,transparent);text-decoration-thickness:1px;text-underline-offset:.16em}.setto-chat__markdown blockquote{margin:.2em 0 .72em;padding:.08em 0 .08em .7em;border-left:2px solid color-mix(in srgb,var(--setto-chat-accent) 58%,transparent);color:color-mix(in srgb,var(--setto-chat-ink) 76%,transparent)}.setto-chat__markdown hr{height:1px;margin:.85em 0;border:0;background:color-mix(in srgb,var(--setto-chat-ink) 13%,transparent)}.setto-chat__markdown code{padding:.08em .28em;border-radius:.32em;background:color-mix(in srgb,var(--setto-chat-ink) 8%,transparent);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em}.setto-chat__markdown pre{max-width:100%;margin:.3em 0 .78em;padding:.7em;overflow-x:auto;border-radius:.7em;background:color-mix(in srgb,var(--setto-chat-ink) 8%,transparent);white-space:pre;-webkit-overflow-scrolling:touch}.setto-chat__markdown pre code{padding:0;background:transparent}.setto-chat__table-wrap{max-width:100%;margin:.25em 0 .75em;overflow-x:auto;-webkit-overflow-scrolling:touch}.setto-chat__markdown table{width:100%;border-collapse:collapse;font-size:.88em}.setto-chat__markdown th,.setto-chat__markdown td{padding:.38em .5em;border-bottom:1px solid color-mix(in srgb,var(--setto-chat-ink) 13%,transparent);text-align:left;vertical-align:top}.setto-chat__markdown th{font-weight:680}.setto-chat__markdown-image-label{font-style:italic;color:color-mix(in srgb,var(--setto-chat-ink) 62%,transparent)}.setto-chat__word{display:inline-block}.setto-chat__markdown.is-revealing .setto-chat__word{opacity:0;transform:translateY(.
|
|
35708
|
+
.setto-chat__markdown{display:block;min-width:0;white-space:normal}.setto-chat__markdown> :first-child{margin-top:0}.setto-chat__markdown> :last-child{margin-bottom:0}.setto-chat__markdown p{margin:0 0 .72em}.setto-chat__markdown h1,.setto-chat__markdown h2,.setto-chat__markdown h3{margin:.95em 0 .36em;font-size:1em;font-weight:680;line-height:1.28;letter-spacing:-.012em}.setto-chat__markdown h1{font-size:1.08em}.setto-chat__markdown ul,.setto-chat__markdown ol{margin:.12em 0 .72em;padding-left:1.25em}.setto-chat__markdown ul{list-style:disc}.setto-chat__markdown ol{list-style:decimal}.setto-chat__markdown li{margin:.2em 0;padding-left:.08em}.setto-chat__markdown li::marker{color:color-mix(in srgb,var(--setto-chat-accent) 78%,var(--setto-chat-ink))}.setto-chat__markdown strong{font-weight:700}.setto-chat__markdown a{color:inherit;text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--setto-chat-accent) 70%,transparent);text-decoration-thickness:1px;text-underline-offset:.16em}.setto-chat__markdown blockquote{margin:.2em 0 .72em;padding:.08em 0 .08em .7em;border-left:2px solid color-mix(in srgb,var(--setto-chat-accent) 58%,transparent);color:color-mix(in srgb,var(--setto-chat-ink) 76%,transparent)}.setto-chat__markdown hr{height:1px;margin:.85em 0;border:0;background:color-mix(in srgb,var(--setto-chat-ink) 13%,transparent)}.setto-chat__markdown code{padding:.08em .28em;border-radius:.32em;background:color-mix(in srgb,var(--setto-chat-ink) 8%,transparent);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em}.setto-chat__markdown pre{max-width:100%;margin:.3em 0 .78em;padding:.7em;overflow-x:auto;border-radius:.7em;background:color-mix(in srgb,var(--setto-chat-ink) 8%,transparent);white-space:pre;-webkit-overflow-scrolling:touch}.setto-chat__markdown pre code{padding:0;background:transparent}.setto-chat__table-wrap{max-width:100%;margin:.25em 0 .75em;overflow-x:auto;-webkit-overflow-scrolling:touch}.setto-chat__markdown table{width:100%;border-collapse:collapse;font-size:.88em}.setto-chat__markdown th,.setto-chat__markdown td{padding:.38em .5em;border-bottom:1px solid color-mix(in srgb,var(--setto-chat-ink) 13%,transparent);text-align:left;vertical-align:top}.setto-chat__markdown th{font-weight:680}.setto-chat__markdown-image-label{font-style:italic;color:color-mix(in srgb,var(--setto-chat-ink) 62%,transparent)}.setto-chat__word{display:inline-block}.setto-chat__markdown.is-revealing .setto-chat__word{opacity:0;transform:translateY(.08em);filter:blur(.35px);animation:setto-chat-word-in 180ms cubic-bezier(.2,.8,.2,1) forwards;will-change:opacity,transform,filter}@keyframes setto-chat-word-in{to{opacity:1;transform:none;filter:none}}
|
|
35608
35709
|
.setto-chat{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:2147483000;color:var(--setto-chat-ink);font-family:"Archivo Variable",Archivo,system-ui,sans-serif;-webkit-font-smoothing:antialiased}.setto-chat *,.setto-chat *::before,.setto-chat *::after{box-sizing:border-box}.setto-chat button,.setto-chat input,.setto-chat textarea{font:inherit}.setto-chat--mounted{top:0;right:auto;bottom:auto;left:0;width:100vw;height:var(--setto-chat-layout-height,100lvh);overflow:hidden;background:var(--setto-chat-canvas);opacity:0;transition:opacity ${CLOSE_MS}ms ease}.setto-chat--visible{opacity:1}.setto-chat__shell{position:absolute;top:var(--setto-chat-top,0);left:0;width:100%;height:var(--setto-chat-height,100svh);display:flex;overflow:hidden;background:var(--setto-chat-canvas);opacity:0;transform:translateY(12px) scale(.994);transform-origin:center bottom;transition:opacity ${CLOSE_MS}ms ease,transform ${CLOSE_MS}ms cubic-bezier(.16,1,.3,1)}.setto-chat--visible .setto-chat__shell{opacity:1;transform:none}
|
|
35609
35710
|
.setto-chat__scrim{position:absolute;inset:0;z-index:45;border:0;background:rgba(33,23,17,.32);opacity:0;pointer-events:none;transition:opacity 220ms ease}.setto-chat__scrim.is-open{opacity:1;pointer-events:auto}.setto-chat__chats{position:relative;z-index:50;width:min(84vw,280px);height:100%;flex:0 0 280px;padding:1rem .85rem calc(1rem + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:.9rem;background:color-mix(in srgb,var(--setto-chat-crema) 32%,var(--setto-chat-canvas));border-right:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);overflow:hidden}.setto-chat__chats-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:34px;font-size:.66rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__chats-heading button{width:34px;height:34px;padding:0;border:0;border-radius:8px;background:transparent;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.setto-chat__new{display:flex;align-items:center;gap:.55rem;width:100%;padding:.5rem .55rem;border:0;border-radius:8px;background:transparent;color:var(--setto-chat-ink);font-weight:600;font-size:.9rem;text-align:left;cursor:pointer;transition:background 140ms ease}.setto-chat__new:hover{background:color-mix(in srgb,var(--setto-chat-ink) 5%,transparent)}.setto-chat__chat-list{display:flex;flex-direction:column;gap:.1rem;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;margin-right:-.85rem;padding-right:.3rem}.setto-chat__chat-list p{margin:.35rem .55rem;font-size:.85rem;line-height:1.5;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__chat-row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem;padding:.55rem;border:0;border-radius:8px;background:transparent;color:var(--setto-chat-ink);text-align:left;cursor:pointer}.setto-chat__chat-row:hover,.setto-chat__chat-row.is-active{background:color-mix(in srgb,var(--setto-chat-ink) 7.5%,transparent)}.setto-chat__chat-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem;font-weight:600}.setto-chat__chat-row time{font-size:.72rem;color:color-mix(in srgb,var(--setto-chat-ink) 55%,transparent)}
|
|
35610
35711
|
.setto-chat__main{position:relative;z-index:1;display:flex;flex:1;min-width:0;max-width:820px;height:100%;margin:0 auto;flex-direction:column;background:var(--setto-chat-canvas)}.setto-chat__header{position:absolute;inset:0 0 auto;z-index:30;min-height:58px;padding:.35rem .75rem;display:flex;align-items:center;gap:.5rem;background:linear-gradient(to bottom,color-mix(in srgb,var(--setto-chat-crema) 88%,transparent),color-mix(in srgb,var(--setto-chat-crema) 72%,transparent));border-bottom:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);backdrop-filter:blur(20px) saturate(150%);-webkit-backdrop-filter:blur(20px) saturate(150%);isolation:isolate}.setto-chat__round-button{flex:none;width:46px;height:46px;padding:0;border:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);border-radius:50%;background:var(--setto-chat-raised);color:var(--setto-chat-ink);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background 160ms ease,border-color 160ms ease,color 160ms ease}.setto-chat__round-button:hover{background:var(--setto-chat-crema);border-color:var(--setto-chat-accent);color:var(--setto-chat-accent)}.setto-chat__round-button:active{transform:scale(.96)}.setto-chat__brand{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;line-height:1.15;text-align:center}.setto-chat__brand h2{margin:0;color:var(--setto-chat-ink);font-size:1.02rem;font-weight:600;line-height:1.15}.setto-chat__brand p{max-width:100%;margin:2px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:color-mix(in srgb,var(--setto-chat-ink) 56%,transparent);font-size:.78rem;line-height:1.15}
|