@akropolys/kiku 1.7.10 → 1.7.12

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/index.js CHANGED
@@ -364,14 +364,45 @@ function renderMarkdown(content, streaming = false) {
364
364
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: elements });
365
365
  }
366
366
 
367
+ // src/utils/icons.tsx
368
+ var import_jsx_runtime3 = require("react/jsx-runtime");
369
+ var ArrowUpIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
370
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "m5 12 7-7 7 7" }),
371
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M12 19V5" })
372
+ ] });
373
+
374
+ // src/utils/theme.ts
375
+ function resolveTheme(theme) {
376
+ if (typeof theme === "string") {
377
+ return { themeAttr: theme, vars: void 0 };
378
+ }
379
+ if (!theme) {
380
+ return { themeAttr: void 0, vars: void 0 };
381
+ }
382
+ const vars = {};
383
+ if (theme.primaryColor) vars["--hsk-primary"] = theme.primaryColor;
384
+ if (theme.backgroundColor) {
385
+ vars["--hsk-bg"] = theme.backgroundColor;
386
+ vars["--hsk-chat-bg"] = theme.backgroundColor;
387
+ }
388
+ if (theme.textColor) {
389
+ vars["--hsk-text"] = theme.textColor;
390
+ vars["--hsk-chat-text"] = theme.textColor;
391
+ }
392
+ if (theme.fontFamily) vars["--hsk-font"] = theme.fontFamily;
393
+ if (theme.fontSize) vars["--hsk-font-size"] = theme.fontSize;
394
+ if (theme.borderRadius) vars["--hsk-border-radius"] = theme.borderRadius;
395
+ return { themeAttr: void 0, vars };
396
+ }
397
+
367
398
  // src/components/VoiceButton.tsx
368
399
  var import_react2 = require("react");
369
- var import_jsx_runtime3 = require("react/jsx-runtime");
370
- var MicIcon = ({ active }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
371
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { x: "9", y: "2", width: "6", height: "11", rx: "3", fill: active ? "currentColor" : "none" }),
372
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M5 10a7 7 0 0 0 14 0" }),
373
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
374
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "8", y1: "23", x2: "16", y2: "23" })
400
+ var import_jsx_runtime4 = require("react/jsx-runtime");
401
+ var MicIcon = ({ active }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
402
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("rect", { x: "9", y: "2", width: "6", height: "11", rx: "3", fill: active ? "currentColor" : "none" }),
403
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M5 10a7 7 0 0 0 14 0" }),
404
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
405
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("line", { x1: "8", y1: "23", x2: "16", y2: "23" })
375
406
  ] });
376
407
  function VoiceButton({
377
408
  onTranscript,
@@ -412,7 +443,7 @@ function VoiceButton({
412
443
  setListening(false);
413
444
  }, []);
414
445
  if (!isSupported) return null;
415
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
446
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
416
447
  "button",
417
448
  {
418
449
  type: "button",
@@ -422,8 +453,8 @@ function VoiceButton({
422
453
  title: listening ? "Stop listening" : "Speak your search",
423
454
  "aria-label": listening ? "Stop voice input" : "Start voice input",
424
455
  children: [
425
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MicIcon, { active: listening }),
426
- listening && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "kiku-voice-ripple", "aria-hidden": "true" })
456
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MicIcon, { active: listening }),
457
+ listening && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kiku-voice-ripple", "aria-hidden": "true" })
427
458
  ]
428
459
  }
429
460
  );
@@ -432,12 +463,12 @@ function VoiceButton({
432
463
  // src/components/VisualSearch.tsx
433
464
  var import_react3 = require("react");
434
465
  var import_sdk2 = require("@akropolys/sdk");
435
- var import_jsx_runtime4 = require("react/jsx-runtime");
436
- var CameraIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
437
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }),
438
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "12", cy: "13", r: "4" })
466
+ var import_jsx_runtime5 = require("react/jsx-runtime");
467
+ var CameraIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
468
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }),
469
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "13", r: "4" })
439
470
  ] });
440
- var SpinnerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "kiku-vs-spin", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
471
+ var SpinnerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "kiku-vs-spin", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
441
472
  function fileToBase64(file) {
442
473
  return new Promise((resolve, reject) => {
443
474
  const reader = new FileReader();
@@ -470,7 +501,7 @@ function VisualSearch({
470
501
  if (inputRef.current) inputRef.current.value = "";
471
502
  }
472
503
  };
473
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
504
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
474
505
  "label",
475
506
  {
476
507
  className: `kiku-vs-btn${loading ? " kiku-vs-btn--loading" : ""} ${className}`,
@@ -478,7 +509,7 @@ function VisualSearch({
478
509
  "aria-label": "Search by uploading a photo",
479
510
  style: { cursor: disabled || loading ? "not-allowed" : "pointer" },
480
511
  children: [
481
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
512
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
482
513
  "input",
483
514
  {
484
515
  ref: inputRef,
@@ -490,36 +521,32 @@ function VisualSearch({
490
521
  hidden: true
491
522
  }
492
523
  ),
493
- loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SpinnerIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CameraIcon, {})
524
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SpinnerIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CameraIcon, {})
494
525
  ]
495
526
  }
496
527
  );
497
528
  }
498
529
 
499
530
  // src/components/ChatWidget.tsx
500
- var import_jsx_runtime5 = require("react/jsx-runtime");
501
- var SparkleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z" }) });
502
- var ArrowUpIcon = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
503
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "m5 12 7-7 7 7" }),
504
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 19V5" })
505
- ] });
531
+ var import_jsx_runtime6 = require("react/jsx-runtime");
532
+ var SparkleIcon = () => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z" }) });
506
533
  function SourceCard({
507
534
  source,
508
535
  defaultCurrency,
509
536
  onSelect,
510
537
  isReferenced
511
538
  }) {
512
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
539
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
513
540
  "div",
514
541
  {
515
542
  className: cn("hsk-source-card", isReferenced && "hsk-source-card--referenced"),
516
543
  onClick: () => onSelect?.(source),
517
544
  children: [
518
- source.image && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: source.image, alt: source.name, className: "hsk-source-img" }),
519
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { flex: 1, minWidth: 0, position: "relative" }, children: [
520
- isReferenced && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", style: { top: "0", right: "0" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SparkleIcon, {}) }),
521
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-source-name", style: { paddingRight: isReferenced ? "20px" : void 0 }, children: source.name }),
522
- source.price && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-source-price", children: [
545
+ source.image && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: source.image, alt: source.name, className: "hsk-source-img" }),
546
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { flex: 1, minWidth: 0, position: "relative" }, children: [
547
+ isReferenced && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", style: { top: "0", right: "0" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
548
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-source-name", style: { paddingRight: isReferenced ? "20px" : void 0 }, children: source.name }),
549
+ source.price && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-source-price", children: [
523
550
  source.currency ?? defaultCurrency,
524
551
  " ",
525
552
  source.price
@@ -656,42 +683,36 @@ I couldn't find any matching products in the store.`;
656
683
  };
657
684
  setChatHistory((prev) => [...prev, userMsg, assistantMsg]);
658
685
  };
659
- const customStyles = {
660
- ...theme?.primaryColor && { "--hsk-primary": theme.primaryColor },
661
- ...theme?.backgroundColor && { "--hsk-bg": theme.backgroundColor },
662
- ...theme?.textColor && { "--hsk-text": theme.textColor },
663
- ...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
664
- ...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
665
- };
666
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
686
+ const { vars: customStyles } = resolveTheme(theme);
687
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
667
688
  "div",
668
689
  {
669
690
  className: cn("hsk-chat-widget", classNames.root, className),
670
691
  style: customStyles,
671
692
  children: [
672
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: cn("hsk-chat-header", classNames.header), children: [
673
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-chat-header-icon", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SparkleIcon, {}) }),
674
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-chat-title", children: title }),
675
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-chat-badge", children: "AI" }),
676
- chatHistory.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "hsk-chat-reset", onClick: reset, style: { marginLeft: "auto" }, children: "Clear" })
693
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("hsk-chat-header", classNames.header), children: [
694
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-chat-header-icon", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
695
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-chat-title", children: title }),
696
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-chat-badge", children: "AI" }),
697
+ chatHistory.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "hsk-chat-reset", onClick: reset, style: { marginLeft: "auto" }, children: "Clear" })
677
698
  ] }),
678
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-chat-messages", children: [
679
- chatHistory.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-chat-empty", children: [
680
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-chat-empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SparkleIcon, {}) }),
681
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: emptyStateText }),
682
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-chat-empty-suggestions", children: emptyStateSuggestions })
683
- ] }) : chatHistory.map((msg, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
684
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `hsk-msg-row ${msg.role}`, children: [
685
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("hsk-msg-avatar", msg.role === "assistant" ? "ai" : "user"), children: msg.role === "assistant" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SparkleIcon, {}) : "U" }),
686
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: cn("hsk-msg-bubble", msg.role, classNames.messageBubble), children: [
687
- msg.imagePreview && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kiku-vs-preview-bubble", style: { marginBottom: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: msg.imagePreview, alt: "Uploaded Preview", className: "kiku-vs-preview-bubble-img", style: { maxWidth: "200px", borderRadius: "8px" } }) }),
699
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-messages", children: [
700
+ chatHistory.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-empty", children: [
701
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
702
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: emptyStateText }),
703
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-empty-suggestions", children: emptyStateSuggestions })
704
+ ] }) : chatHistory.map((msg, idx) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
705
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `hsk-msg-row ${msg.role}`, children: [
706
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("hsk-msg-avatar", msg.role === "assistant" ? "ai" : "user"), children: msg.role === "assistant" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) : "U" }),
707
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("hsk-msg-bubble", msg.role, classNames.messageBubble), children: [
708
+ msg.imagePreview && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-bubble", style: { marginBottom: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: msg.imagePreview, alt: "Uploaded Preview", className: "kiku-vs-preview-bubble-img", style: { maxWidth: "200px", borderRadius: "8px" } }) }),
688
709
  renderMarkdown(msg.content),
689
- msg.styleDNA && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "kiku-vs-preview-banner", style: { marginTop: "10px" }, children: [
690
- chatHistory[idx - 1]?.imagePreview && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: chatHistory[idx - 1].imagePreview, alt: "Visual Search Input", className: "kiku-vs-preview-img" }),
691
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "kiku-vs-preview-info", children: [
692
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kiku-vs-preview-label", children: "Visual Match Palette" }),
693
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kiku-vs-preview-palette", children: msg.styleDNA.color_palette || "Detected Style DNA" }),
694
- msg.styleDNA.style_tags && msg.styleDNA.style_tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kiku-style-tags", children: msg.styleDNA.style_tags.map((tag, ti) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "kiku-style-tag", children: [
710
+ msg.styleDNA && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kiku-vs-preview-banner", style: { marginTop: "10px" }, children: [
711
+ chatHistory[idx - 1]?.imagePreview && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: chatHistory[idx - 1].imagePreview, alt: "Visual Search Input", className: "kiku-vs-preview-img" }),
712
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kiku-vs-preview-info", children: [
713
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-label", children: "Visual Match Palette" }),
714
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-vs-preview-palette", children: msg.styleDNA.color_palette || "Detected Style DNA" }),
715
+ msg.styleDNA.style_tags && msg.styleDNA.style_tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kiku-style-tags", children: msg.styleDNA.style_tags.map((tag, ti) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "kiku-style-tag", children: [
695
716
  "#",
696
717
  tag
697
718
  ] }, ti)) })
@@ -699,13 +720,13 @@ I couldn't find any matching products in the store.`;
699
720
  ] })
700
721
  ] })
701
722
  ] }),
702
- msg.role === "assistant" && msg.visualSources && msg.visualSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources-container", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources", children: msg.visualSources.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SourceCard, { source: src, defaultCurrency, onSelect: onSelectSource }, si)) }) }),
723
+ msg.role === "assistant" && msg.visualSources && msg.visualSources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-container", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: msg.visualSources.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SourceCard, { source: src, defaultCurrency, onSelect: onSelectSource }, si)) }) }),
703
724
  msg.role === "assistant" && idx === chatHistory.length - 1 && !msg.visualSources && sources.length > 0 && (() => {
704
725
  const isStreamingActive = chatLoading || streaming;
705
726
  if (isStreamingActive) {
706
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources-container", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources", children: sources.map((src, si) => {
727
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-container", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: sources.map((src, si) => {
707
728
  const isReferenced = !!(src.id && referencedIds.includes(src.id));
708
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
729
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
709
730
  SourceCard,
710
731
  {
711
732
  source: src,
@@ -719,10 +740,10 @@ I couldn't find any matching products in the store.`;
719
740
  }
720
741
  const featured = sources.filter((src) => src.id && referencedIds.includes(src.id));
721
742
  const general = referencedIds.length > 0 ? [] : sources.filter((src) => !src.id || !referencedIds.includes(src.id));
722
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-sources-container", children: [
723
- featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-sources-group", style: { marginBottom: "10px" }, children: [
724
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources-group-title", children: "\u2B50 Featured in response" }),
725
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources", children: featured.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
743
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-container", children: [
744
+ featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-group", style: { marginBottom: "10px" }, children: [
745
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-group-title", children: "\u2B50 Featured in response" }),
746
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: featured.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
726
747
  SourceCard,
727
748
  {
728
749
  source: src,
@@ -733,9 +754,9 @@ I couldn't find any matching products in the store.`;
733
754
  `feat-${si}`
734
755
  )) })
735
756
  ] }),
736
- general.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-sources-group", children: [
737
- featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources-group-title", children: "All matches" }),
738
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-sources", children: general.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
757
+ general.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-sources-group", children: [
758
+ featured.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources-group-title", children: "All matches" }),
759
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-sources", children: general.map((src, si) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
739
760
  SourceCard,
740
761
  {
741
762
  source: src,
@@ -749,21 +770,21 @@ I couldn't find any matching products in the store.`;
749
770
  ] });
750
771
  })()
751
772
  ] }, idx)),
752
- loading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-msg-row", children: [
753
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-msg-avatar ai", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SparkleIcon, {}) }),
754
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-pending", role: "status", "aria-live": "polite", children: [
755
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-pending-glyph", children: [
756
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-pending-ring" }),
757
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-pending-dot" })
773
+ loading && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-msg-row", children: [
774
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-msg-avatar ai", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SparkleIcon, {}) }),
775
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending", role: "status", "aria-live": "polite", children: [
776
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending-glyph", children: [
777
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-ring" }),
778
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-dot" })
758
779
  ] }),
759
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-pending-text", children: [
760
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-pending-step step-1", children: "Searching catalog" }),
761
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-pending-step step-2", children: "Reasoning" }),
762
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hsk-pending-step step-3", children: "Composing" })
780
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-pending-text", children: [
781
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-1", children: "Searching catalog" }),
782
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-2", children: "Reasoning" }),
783
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "hsk-pending-step step-3", children: "Composing" })
763
784
  ] })
764
785
  ] })
765
786
  ] }),
766
- error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "hsk-chat-error", children: (() => {
787
+ error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hsk-chat-error", children: (() => {
767
788
  try {
768
789
  const parsed = JSON.parse(error);
769
790
  return parsed.error || parsed.message || error;
@@ -771,10 +792,10 @@ I couldn't find any matching products in the store.`;
771
792
  return error;
772
793
  }
773
794
  })() }),
774
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: bottomRef })
795
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: bottomRef })
775
796
  ] }),
776
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hsk-chat-input-area", style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
777
- enableVision && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
797
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "hsk-chat-input-area", style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
798
+ enableVision && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
778
799
  VisualSearch,
779
800
  {
780
801
  onResults: handleVisualResults,
@@ -783,7 +804,7 @@ I couldn't find any matching products in the store.`;
783
804
  disabled: loading
784
805
  }
785
806
  ),
786
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
807
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
787
808
  "textarea",
788
809
  {
789
810
  ref: textareaRef,
@@ -797,7 +818,7 @@ I couldn't find any matching products in the store.`;
797
818
  style: { flex: 1 }
798
819
  }
799
820
  ),
800
- enableVoice && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
821
+ enableVoice && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
801
822
  VoiceButton,
802
823
  {
803
824
  onTranscript: (text) => {
@@ -809,14 +830,14 @@ I couldn't find any matching products in the store.`;
809
830
  disabled: loading
810
831
  }
811
832
  ),
812
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
833
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
813
834
  "button",
814
835
  {
815
836
  className: "hsk-chat-send",
816
837
  onClick: handleSend,
817
838
  disabled: !input.trim() || loading,
818
839
  "aria-label": "Send message",
819
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ArrowUpIcon, {})
840
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ArrowUpIcon, {})
820
841
  }
821
842
  )
822
843
  ] })
@@ -833,7 +854,7 @@ var import_sdk6 = require("@akropolys/sdk");
833
854
 
834
855
  // src/components/ComparisonMatrix.tsx
835
856
  var import_sdk4 = require("@akropolys/sdk");
836
- var import_jsx_runtime6 = require("react/jsx-runtime");
857
+ var import_jsx_runtime7 = require("react/jsx-runtime");
837
858
  function normalizeKey(key) {
838
859
  let s = key.replace(/[_-]+/g, " ");
839
860
  s = s.replace(/([a-z])([A-Z])/g, "$1 $2");
@@ -995,9 +1016,9 @@ function buildRows(products, displayConfig, defaultCurrency = "KES") {
995
1016
  }
996
1017
  function ImageCell({ value, name }) {
997
1018
  if (!value) {
998
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 28, textAlign: "center" }, children: "\u{1F4E6}" });
1019
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { fontSize: 28, textAlign: "center" }, children: "\u{1F4E6}" });
999
1020
  }
1000
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1021
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1001
1022
  "img",
1002
1023
  {
1003
1024
  src: value,
@@ -1014,10 +1035,10 @@ function ImageCell({ value, name }) {
1014
1035
  );
1015
1036
  }
1016
1037
  function AvailabilityCell({ value }) {
1017
- if (!value) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" });
1038
+ if (!value) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" });
1018
1039
  const inStock = /in.?stock/i.test(value);
1019
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 13, color: "var(--hsk-text, #111827)" }, children: [
1020
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: {
1040
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 13, color: "var(--hsk-text, #111827)" }, children: [
1041
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
1021
1042
  width: 8,
1022
1043
  height: 8,
1023
1044
  borderRadius: "50%",
@@ -1056,7 +1077,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
1056
1077
  display: "flex",
1057
1078
  alignItems: "center"
1058
1079
  };
1059
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1080
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1060
1081
  "div",
1061
1082
  {
1062
1083
  className: "hsk-compare-matrix",
@@ -1069,11 +1090,11 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
1069
1090
  fontSize: 13
1070
1091
  },
1071
1092
  children: [
1072
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "grid", gridTemplateColumns: colTemplate, background: "var(--hsk-surface2, #f9fafb)", borderBottom: "2px solid var(--hsk-border, rgba(0,0,0,0.09))" }, children: [
1073
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { ...labelStyle, borderBottom: "none", color: "var(--hsk-text, #111)", fontSize: 12 }, children: "Feature" }),
1093
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", gridTemplateColumns: colTemplate, background: "var(--hsk-surface2, #f9fafb)", borderBottom: "2px solid var(--hsk-border, rgba(0,0,0,0.09))" }, children: [
1094
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...labelStyle, borderBottom: "none", color: "var(--hsk-text, #111)", fontSize: 12 }, children: "Feature" }),
1074
1095
  products.map((p, i) => {
1075
1096
  const { title } = (0, import_sdk4.resolveDisplayFields)(p.fields || p, displayConfig);
1076
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1097
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1077
1098
  "a",
1078
1099
  {
1079
1100
  href: p.url || "#",
@@ -1096,7 +1117,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
1096
1117
  );
1097
1118
  })
1098
1119
  ] }),
1099
- rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1120
+ rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1100
1121
  "div",
1101
1122
  {
1102
1123
  style: {
@@ -1105,18 +1126,18 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
1105
1126
  background: rowIdx % 2 === 1 ? "var(--hsk-surface2, rgba(0,0,0,0.015))" : "transparent"
1106
1127
  },
1107
1128
  children: [
1108
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: labelStyle, children: row.label }),
1129
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: labelStyle, children: row.label }),
1109
1130
  products.map((p, i) => {
1110
1131
  const val = row.values[i];
1111
1132
  const isBest = row.bestIdx === i && row.values.filter(Boolean).length > 1;
1112
1133
  const { title } = (0, import_sdk4.resolveDisplayFields)(p.fields || p, displayConfig);
1113
1134
  if (row.type === "image") {
1114
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { ...cellBase, justifyContent: "center", padding: "12px", borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ImageCell, { value: val, name: title }) }, i);
1135
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...cellBase, justifyContent: "center", padding: "12px", borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ImageCell, { value: val, name: title }) }, i);
1115
1136
  }
1116
1137
  if (row.type === "availability") {
1117
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { ...cellBase, borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AvailabilityCell, { value: val }) }, i);
1138
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { ...cellBase, borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AvailabilityCell, { value: val }) }, i);
1118
1139
  }
1119
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1140
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1120
1141
  "div",
1121
1142
  {
1122
1143
  style: {
@@ -1125,7 +1146,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
1125
1146
  color: isBest ? "var(--hsk-primary, #ea580c)" : row.type === "price" ? "var(--hsk-text, #374151)" : "var(--hsk-text, #111827)",
1126
1147
  borderLeft: i > 0 ? "1px solid var(--hsk-border, rgba(0,0,0,0.07))" : "none"
1127
1148
  },
1128
- children: val ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" })
1149
+ children: val ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "#9ca3af" }, children: "\u2014" })
1129
1150
  },
1130
1151
  i
1131
1152
  );
@@ -1141,7 +1162,7 @@ function ComparisonMatrix({ sources, defaultCurrency = "KES", displayConfig }) {
1141
1162
 
1142
1163
  // src/components/MarkupEditor.tsx
1143
1164
  var import_react5 = require("react");
1144
- var import_jsx_runtime7 = require("react/jsx-runtime");
1165
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1145
1166
  var COLORS = ["#111111", "#ff5a5a", "#ffb300", "#22c55e", "#06b6d4", "#d946ef", "#9ca3af"];
1146
1167
  var MAX_EXPORT_DIM = 1280;
1147
1168
  function MarkupEditor({ src, onCancel, onSend }) {
@@ -1264,13 +1285,13 @@ function MarkupEditor({ src, onCancel, onSend }) {
1264
1285
  }
1265
1286
  };
1266
1287
  const hasMarks = actions.length > 0;
1267
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-markup", role: "dialog", "aria-label": "Mark up image", children: [
1268
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-markup-head", children: [
1269
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "hsk-markup-title", children: "Mark where you want the change" }),
1270
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: "hsk-markup-cancel", onClick: onCancel, children: "Cancel" })
1288
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup", role: "dialog", "aria-label": "Mark up image", children: [
1289
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-head", children: [
1290
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-markup-title", children: "Mark where you want the change" }),
1291
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-cancel", onClick: onCancel, children: "Cancel" })
1271
1292
  ] }),
1272
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-markup-stage", children: loadError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-markup-error", children: "This image can't be edited here." }) : !img ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-markup-loading", children: "Loading image\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-markup-canvas-wrap", children: [
1273
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1293
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-stage", children: loadError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-error", children: "This image can't be edited here." }) : !img ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-loading", children: "Loading image\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-canvas-wrap", children: [
1294
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1274
1295
  "canvas",
1275
1296
  {
1276
1297
  ref: canvasRef,
@@ -1283,7 +1304,7 @@ function MarkupEditor({ src, onCancel, onSend }) {
1283
1304
  onPointerLeave: onPointerUp
1284
1305
  }
1285
1306
  ),
1286
- pendingText && canvasRef.current && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1307
+ pendingText && canvasRef.current && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1287
1308
  "input",
1288
1309
  {
1289
1310
  ref: textInputRef,
@@ -1307,8 +1328,8 @@ function MarkupEditor({ src, onCancel, onSend }) {
1307
1328
  }
1308
1329
  )
1309
1330
  ] }) }),
1310
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-markup-tools", children: [
1311
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-markup-colors", children: COLORS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1331
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-tools", children: [
1332
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-colors", children: COLORS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1312
1333
  "button",
1313
1334
  {
1314
1335
  className: `hsk-markup-color${color === c ? " hsk-markup-color--on" : ""}`,
@@ -1321,16 +1342,16 @@ function MarkupEditor({ src, onCancel, onSend }) {
1321
1342
  },
1322
1343
  c
1323
1344
  )) }),
1324
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-markup-actions", children: [
1325
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: `hsk-markup-tool${tool === "pen" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("pen"), children: "Sketch" }),
1326
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: `hsk-markup-tool${tool === "text" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("text"), children: "Text" }),
1327
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: `hsk-markup-tool${tool === "eraser" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("eraser"), children: "Eraser" }),
1328
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions((prev) => prev.slice(0, -1)), disabled: !hasMarks, children: "Undo" }),
1329
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions([]), disabled: !hasMarks, children: "Clear" })
1345
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-actions", children: [
1346
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "pen" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("pen"), children: "Sketch" }),
1347
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "text" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("text"), children: "Text" }),
1348
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: `hsk-markup-tool${tool === "eraser" ? " hsk-markup-tool--on" : ""}`, onClick: () => setTool("eraser"), children: "Eraser" }),
1349
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions((prev) => prev.slice(0, -1)), disabled: !hasMarks, children: "Undo" }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-markup-tool", onClick: () => setActions([]), disabled: !hasMarks, children: "Clear" })
1330
1351
  ] })
1331
1352
  ] }),
1332
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "hsk-markup-send", children: [
1333
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1353
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-markup-send", children: [
1354
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1334
1355
  "input",
1335
1356
  {
1336
1357
  className: "hsk-markup-instruction",
@@ -1342,7 +1363,7 @@ function MarkupEditor({ src, onCancel, onSend }) {
1342
1363
  }
1343
1364
  }
1344
1365
  ),
1345
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1366
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1346
1367
  "button",
1347
1368
  {
1348
1369
  className: "hsk-markup-go",
@@ -1352,13 +1373,13 @@ function MarkupEditor({ src, onCancel, onSend }) {
1352
1373
  }
1353
1374
  )
1354
1375
  ] }),
1355
- exportError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "hsk-markup-error", children: "Couldn't process this image \u2014 try a newer visualization." })
1376
+ exportError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-error", children: "Couldn't process this image \u2014 try a newer visualization." })
1356
1377
  ] });
1357
1378
  }
1358
1379
 
1359
1380
  // src/components/KikuButton.tsx
1360
- var import_jsx_runtime8 = require("react/jsx-runtime");
1361
- var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1381
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1382
+ var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1362
1383
  "svg",
1363
1384
  {
1364
1385
  className: cn("hsk-brand-mark", className),
@@ -1367,52 +1388,48 @@ var KikuIcon = ({ className, size = 18 }) => /* @__PURE__ */ (0, import_jsx_runt
1367
1388
  viewBox: "0 0 100 100",
1368
1389
  xmlns: "http://www.w3.org/2000/svg",
1369
1390
  "aria-label": "kiku",
1370
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
1371
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z" }),
1372
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
1391
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
1392
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z" }),
1393
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
1373
1394
  ] })
1374
1395
  }
1375
1396
  );
1376
1397
  var SparkleIcon2 = KikuIcon;
1377
- var ArrowUpIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1378
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "m5 12 7-7 7 7" }),
1379
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M12 19V5" })
1398
+ var StopIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("rect", { x: "5", y: "5", width: "14", height: "14", rx: "2" }) });
1399
+ var ExternalIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1400
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
1401
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("polyline", { points: "15 3 21 3 21 9" }),
1402
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
1380
1403
  ] });
1381
- var StopIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("rect", { x: "5", y: "5", width: "14", height: "14", rx: "2" }) });
1382
- var ExternalIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1383
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
1384
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("polyline", { points: "15 3 21 3 21 9" }),
1385
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
1386
- ] });
1387
- var ContinueIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M8 5v14l11-7z" }) });
1388
- var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1389
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1390
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1404
+ var ContinueIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M8 5v14l11-7z" }) });
1405
+ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1406
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1407
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1391
1408
  ] });
1392
- var ChevronRightIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "m9 18 6-6-6-6" }) });
1393
- var HistoryIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1394
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
1395
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M3 3v5h5" }),
1396
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M12 7v5l4 2" })
1409
+ var ChevronRightIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m9 18 6-6-6-6" }) });
1410
+ var HistoryIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1411
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
1412
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 3v5h5" }),
1413
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 7v5l4 2" })
1397
1414
  ] });
1398
- var BookmarkIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M19 21 12 16l-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) });
1399
- var TrashIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1400
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M3 6h18" }),
1401
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
1415
+ var BookmarkIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 21 12 16l-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) });
1416
+ var TrashIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1417
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 6h18" }),
1418
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
1402
1419
  ] });
1403
- var PaperclipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
1404
- var MicIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1405
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z" }),
1406
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
1407
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
1420
+ var PaperclipIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
1421
+ var MicIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1422
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z" }),
1423
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
1424
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
1408
1425
  ] });
1409
- var MicOffIcon = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1410
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "2", y1: "2", x2: "22", y2: "22" }),
1411
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M18.89 13.23A7.12 7.12 0 0 0 19 12v-2" }),
1412
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M5 10v2a7 7 0 0 0 12 5" }),
1413
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33" }),
1414
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" }),
1415
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
1426
+ var MicOffIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1427
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "2", y1: "2", x2: "22", y2: "22" }),
1428
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M18.89 13.23A7.12 7.12 0 0 0 19 12v-2" }),
1429
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M5 10v2a7 7 0 0 0 12 5" }),
1430
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33" }),
1431
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" }),
1432
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
1416
1433
  ] });
1417
1434
  var DEFAULT_CHIPS = [];
1418
1435
  function extractName(raw) {
@@ -1462,7 +1479,7 @@ function KikuPickerMenu({
1462
1479
  onDismiss
1463
1480
  }) {
1464
1481
  const discussed = sources.filter((s) => s.id && referencedIds.includes(s.id));
1465
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1482
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1466
1483
  "div",
1467
1484
  {
1468
1485
  className: "hsk-kiku-picker",
@@ -1470,7 +1487,7 @@ function KikuPickerMenu({
1470
1487
  "aria-label": "@kiku commands",
1471
1488
  onMouseDown: (e) => e.preventDefault(),
1472
1489
  children: [
1473
- discussed.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1490
+ discussed.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1474
1491
  "button",
1475
1492
  {
1476
1493
  className: "hsk-kiku-picker-item",
@@ -1480,9 +1497,9 @@ function KikuPickerMenu({
1480
1497
  onDismiss();
1481
1498
  },
1482
1499
  children: [
1483
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-icon", children: src.image ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: src.image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BookmarkIcon, {}) }),
1484
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-item-name", children: src.name }),
1485
- src.price && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "hsk-kiku-picker-item-price", children: [
1500
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: src.image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: src.image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
1501
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: src.name }),
1502
+ src.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-kiku-picker-item-price", children: [
1486
1503
  src.currency ?? defaultCurrency,
1487
1504
  " ",
1488
1505
  parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
@@ -1491,7 +1508,7 @@ function KikuPickerMenu({
1491
1508
  },
1492
1509
  src.id ?? i
1493
1510
  )),
1494
- discussed.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1511
+ discussed.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1495
1512
  "button",
1496
1513
  {
1497
1514
  className: "hsk-kiku-picker-item",
@@ -1501,8 +1518,8 @@ function KikuPickerMenu({
1501
1518
  onDismiss();
1502
1519
  },
1503
1520
  children: [
1504
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BookmarkIcon, {}) }),
1505
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "hsk-kiku-picker-item-name", children: [
1521
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
1522
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-kiku-picker-item-name", children: [
1506
1523
  "Capture all (",
1507
1524
  discussed.length,
1508
1525
  ")"
@@ -1510,7 +1527,7 @@ function KikuPickerMenu({
1510
1527
  ]
1511
1528
  }
1512
1529
  ),
1513
- discussed.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1530
+ discussed.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1514
1531
  "button",
1515
1532
  {
1516
1533
  className: "hsk-kiku-picker-item",
@@ -1520,12 +1537,12 @@ function KikuPickerMenu({
1520
1537
  onDismiss();
1521
1538
  },
1522
1539
  children: [
1523
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BookmarkIcon, {}) }),
1524
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Capture current page" })
1540
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BookmarkIcon, {}) }),
1541
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Capture current page" })
1525
1542
  ]
1526
1543
  }
1527
1544
  ),
1528
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1545
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1529
1546
  "button",
1530
1547
  {
1531
1548
  className: "hsk-kiku-picker-item",
@@ -1535,12 +1552,12 @@ function KikuPickerMenu({
1535
1552
  onDismiss();
1536
1553
  },
1537
1554
  children: [
1538
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(HistoryIcon, {}) }),
1539
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "What have you saved?" })
1555
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HistoryIcon, {}) }),
1556
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "What have you saved?" })
1540
1557
  ]
1541
1558
  }
1542
1559
  ),
1543
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1560
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1544
1561
  "button",
1545
1562
  {
1546
1563
  className: "hsk-kiku-picker-item",
@@ -1550,8 +1567,8 @@ function KikuPickerMenu({
1550
1567
  onDismiss();
1551
1568
  },
1552
1569
  children: [
1553
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TrashIcon, {}) }),
1554
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Delete this" })
1570
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TrashIcon, {}) }),
1571
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "Delete this" })
1555
1572
  ]
1556
1573
  }
1557
1574
  )
@@ -1560,22 +1577,22 @@ function KikuPickerMenu({
1560
1577
  );
1561
1578
  }
1562
1579
  function AtPickerMenu({ onSelect, onDismiss }) {
1563
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1580
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1564
1581
  "div",
1565
1582
  {
1566
1583
  className: "hsk-kiku-picker",
1567
1584
  role: "menu",
1568
1585
  "aria-label": "Extensions",
1569
1586
  onMouseDown: (e) => e.preventDefault(),
1570
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1587
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1571
1588
  "button",
1572
1589
  {
1573
1590
  className: "hsk-kiku-picker-item",
1574
1591
  role: "menuitem",
1575
1592
  onClick: () => onSelect("@kiku"),
1576
1593
  children: [
1577
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-icon hsk-kiku-picker-icon--accent", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) }),
1578
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "kiku \u2014 capture & remember" })
1594
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-icon hsk-kiku-picker-icon--accent", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
1595
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-picker-item-name", children: "kiku \u2014 capture & remember" })
1579
1596
  ]
1580
1597
  }
1581
1598
  )
@@ -1585,9 +1602,9 @@ function AtPickerMenu({ onSelect, onDismiss }) {
1585
1602
  function SourceImg({ src, alt, onImageClick }) {
1586
1603
  const [failed, setFailed] = (0, import_react6.useState)(false);
1587
1604
  if (failed) {
1588
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", background: "var(--hsk-chat-source-bg, rgba(0,0,0,.04))", color: "var(--hsk-chat-muted, #888)" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) });
1605
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", background: "var(--hsk-chat-source-bg, rgba(0,0,0,.04))", color: "var(--hsk-chat-muted, #888)" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) });
1589
1606
  }
1590
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1607
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1591
1608
  "img",
1592
1609
  {
1593
1610
  src,
@@ -1628,20 +1645,20 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
1628
1645
  };
1629
1646
  const display = sources.filter((s) => s.id && referencedIds.includes(s.id));
1630
1647
  if (display.length === 0) return null;
1631
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("hsk-cb-sources-wrap", compact && "hsk-cb-sources-wrap--compact"), children: [
1632
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-sources", ref: railRef, children: display.map((src, si) => {
1648
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-cb-sources-wrap", compact && "hsk-cb-sources-wrap--compact"), children: [
1649
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-sources", ref: railRef, children: display.map((src, si) => {
1633
1650
  const isReferenced = !!(src.id && referencedIds.includes(src.id));
1634
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1651
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1635
1652
  "div",
1636
1653
  {
1637
1654
  className: cn("hsk-cb-source", isReferenced && "hsk-cb-source--referenced"),
1638
1655
  style: { animationDelay: `${si * 50}ms` },
1639
1656
  onClick: () => onSelectSource?.(src),
1640
1657
  children: [
1641
- src.image ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-src-imgwrap", style: { position: "relative" }, children: [
1642
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SourceImg, { src: src.image, alt: src.name, onImageClick }),
1643
- isReferenced && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, { size: 10 }) }),
1644
- isProperty && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: {
1658
+ src.image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-imgwrap", style: { position: "relative" }, children: [
1659
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SourceImg, { src: src.image, alt: src.name, onImageClick }),
1660
+ isReferenced && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 10 }) }),
1661
+ isProperty && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: {
1645
1662
  position: "absolute",
1646
1663
  top: "6px",
1647
1664
  right: "6px",
@@ -1656,14 +1673,14 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
1656
1673
  color: "#fbbf24",
1657
1674
  // Gold sparkle badge
1658
1675
  boxShadow: "0 2px 4px rgba(0,0,0,0.2)"
1659
- }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, { size: 12 }) })
1660
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-src-imgwrap-empty", style: { position: "relative" }, children: [
1661
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}),
1662
- isReferenced && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, { size: 10 }) })
1676
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 12 }) })
1677
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-imgwrap-empty", style: { position: "relative" }, children: [
1678
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}),
1679
+ isReferenced && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-source-ref-badge", title: "Featured in response", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, { size: 10 }) })
1663
1680
  ] }),
1664
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-src-info", children: [
1665
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-src-name", children: src.name }),
1666
- src.price && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-src-price", children: [
1681
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-info", children: [
1682
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-src-name", children: src.name }),
1683
+ src.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-src-price", children: [
1667
1684
  src.currency ?? defaultCurrency,
1668
1685
  " ",
1669
1686
  parseFloat(String(src.price).replace(/[^0-9.]/g, "") || "0").toLocaleString()
@@ -1674,15 +1691,15 @@ function SourcesCarousel({ sources, defaultCurrency, onSelectSource, onImageClic
1674
1691
  src.id ?? si
1675
1692
  );
1676
1693
  }) }),
1677
- showNext && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1678
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1694
+ showNext && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1695
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1679
1696
  "div",
1680
1697
  {
1681
1698
  className: "hsk-cb-sources-fade",
1682
1699
  style: { background: "linear-gradient(to right, transparent, var(--hsk-fade-bg, #0e0e0f))" }
1683
1700
  }
1684
1701
  ),
1685
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-sources-next", onClick: scrollNext, "aria-label": "See more", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronRightIcon, {}) })
1702
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-sources-next", onClick: scrollNext, "aria-label": "See more", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronRightIcon, {}) })
1686
1703
  ] })
1687
1704
  ] });
1688
1705
  }
@@ -1759,14 +1776,14 @@ function SmartContextPills({
1759
1776
  pills.push({ emoji: "\u{1F4A1}", label: "Recommend something", query: "What do you recommend for me?" });
1760
1777
  }
1761
1778
  if (pills.length === 0) return null;
1762
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-action-pills", children: pills.map((pill) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1779
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-action-pills", children: pills.map((pill) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1763
1780
  "button",
1764
1781
  {
1765
1782
  className: "hsk-action-pill",
1766
1783
  onClick: () => onSend(pill.query),
1767
1784
  disabled: loading,
1768
1785
  children: [
1769
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-pill-emoji", children: pill.emoji }),
1786
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-pill-emoji", children: pill.emoji }),
1770
1787
  pill.label
1771
1788
  ]
1772
1789
  },
@@ -1847,8 +1864,8 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
1847
1864
  const finalSeconds = fixedSeconds ?? seconds;
1848
1865
  const label = isComplete ? finalSeconds !== null && finalSeconds !== void 0 ? `Thought for ${finalSeconds}s` : "Thought process" : `Thinking${seconds ? ` \xB7 ${seconds}s` : "\u2026"}`;
1849
1866
  const expandable = !!text;
1850
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("hsk-cb-think", !isComplete && "hsk-cb-think--live"), children: [
1851
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1867
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-cb-think", !isComplete && "hsk-cb-think--live"), children: [
1868
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1852
1869
  "button",
1853
1870
  {
1854
1871
  type: "button",
@@ -1856,20 +1873,16 @@ function ThinkingBlock({ text, isComplete, seconds: fixedSeconds }) {
1856
1873
  onClick: expandable ? () => setIsOpen((o) => !o) : void 0,
1857
1874
  "aria-expanded": expandable ? isOpen : void 0,
1858
1875
  children: [
1859
- isComplete ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1860
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
1861
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M12 6v6l4 2" })
1862
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "hsk-cb-typing", "aria-hidden": "true", children: [
1863
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {}),
1864
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {}),
1865
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {})
1876
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: !isComplete ? "hsk-cb-think-spin" : void 0, children: [
1877
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
1878
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 6v6l4 2" })
1866
1879
  ] }),
1867
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: label }),
1868
- expandable && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: cn("hsk-cb-think-chevron", isOpen && "hsk-cb-think-chevron--open"), children: "\u25B6" })
1880
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: label }),
1881
+ expandable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("hsk-cb-think-chevron", isOpen && "hsk-cb-think-chevron--open"), children: "\u25B6" })
1869
1882
  ]
1870
1883
  }
1871
1884
  ),
1872
- expandable && isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-think-body", children: text })
1885
+ expandable && isOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-think-body", children: text })
1873
1886
  ] });
1874
1887
  }
1875
1888
  function ChatModal({
@@ -2015,15 +2028,7 @@ function ChatModal({
2015
2028
  }, 1e3);
2016
2029
  return () => clearInterval(t);
2017
2030
  }, [mintedKey]);
2018
- const isStringTheme = typeof theme === "string";
2019
- const hskThemeAttr = isStringTheme ? theme : void 0;
2020
- const customStyles = !isStringTheme && theme ? {
2021
- ...theme?.primaryColor && { "--hsk-primary": theme.primaryColor },
2022
- ...theme?.backgroundColor && { "--hsk-bg": theme.backgroundColor },
2023
- ...theme?.textColor && { "--hsk-text": theme.textColor },
2024
- ...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
2025
- ...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
2026
- } : void 0;
2031
+ const { themeAttr: hskThemeAttr, vars: customStyles } = resolveTheme(theme);
2027
2032
  const retryLastMessage = async () => {
2028
2033
  const lastUserMsg = [...messages].reverse().find((m) => m.role === "user");
2029
2034
  if (lastUserMsg) await handleSend(lastUserMsg.content);
@@ -2219,7 +2224,7 @@ function ChatModal({
2219
2224
  }, [voiceState]);
2220
2225
  const blurVal = typeof backdropBlur === "number" ? `${backdropBlur}px` : backdropBlur ?? "20px";
2221
2226
  const displayMessages = messages;
2222
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2227
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2223
2228
  "div",
2224
2229
  {
2225
2230
  className: cn("hsk-cb-overlay", classNames.overlay),
@@ -2231,7 +2236,7 @@ function ChatModal({
2231
2236
  ...backdropColor ? { background: backdropColor } : {},
2232
2237
  ...customStyles
2233
2238
  },
2234
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2239
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2235
2240
  "div",
2236
2241
  {
2237
2242
  className: cn("hsk-cb-panel", classNames.panel),
@@ -2244,11 +2249,11 @@ function ChatModal({
2244
2249
  }
2245
2250
  },
2246
2251
  children: [
2247
- lightboxSrc && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-lightbox", onClick: () => setLightboxSrc(null), children: [
2248
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-lightbox-close", onClick: () => setLightboxSrc(null), "aria-label": "Close image", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CloseIcon, {}) }),
2249
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: lightboxSrc, alt: "", className: "hsk-lightbox-img", onClick: (e) => e.stopPropagation() })
2252
+ lightboxSrc && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-lightbox", onClick: () => setLightboxSrc(null), children: [
2253
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-lightbox-close", onClick: () => setLightboxSrc(null), "aria-label": "Close image", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon, {}) }),
2254
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: lightboxSrc, alt: "", className: "hsk-lightbox-img", onClick: (e) => e.stopPropagation() })
2250
2255
  ] }),
2251
- markupSrc && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-markup-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2256
+ markupSrc && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-markup-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2252
2257
  MarkupEditor,
2253
2258
  {
2254
2259
  src: markupSrc,
@@ -2262,44 +2267,44 @@ function ChatModal({
2262
2267
  }
2263
2268
  }
2264
2269
  ) }),
2265
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-main", children: [
2266
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-topbar", children: [
2267
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-topbar-left", children: [
2268
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-cb-topbar-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) }),
2269
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-topbar-title", children: activeTitle }) })
2270
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-main", children: [
2271
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar", children: [
2272
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar-left", children: [
2273
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-topbar-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
2274
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-topbar-title", children: activeTitle }) })
2270
2275
  ] }),
2271
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-topbar-actions", children: [
2272
- messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-topbar-btn", onClick: handleReset, children: "Clear chat" }),
2273
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CloseIcon, {}) })
2276
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-topbar-actions", children: [
2277
+ messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-topbar-btn", onClick: handleReset, children: "Clear chat" }),
2278
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon, {}) })
2274
2279
  ] })
2275
2280
  ] }),
2276
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-msgs", ref: msgsContainerRef, children: [
2277
- displayMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-empty", children: [
2278
- awaitingName ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2279
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h2", { className: "hsk-cb-hello", children: [
2281
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-msgs", ref: msgsContainerRef, children: [
2282
+ displayMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-empty", children: [
2283
+ awaitingName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2284
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
2280
2285
  "Hi, I'm ",
2281
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: "kiku" }),
2286
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: "kiku" }),
2282
2287
  "."
2283
2288
  ] }),
2284
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "hsk-cb-hello-lead", children: "I can search, visualize, or capture anything for you \u2014 on this site or any other." }),
2285
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "hsk-cb-hello-ask", children: "What should I call you?" }),
2286
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-hello-skip", onClick: () => setNameSkipped(true), children: "Skip for now" })
2287
- ] }) : shopperName ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2288
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h2", { className: "hsk-cb-hello", children: [
2289
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "I can search, visualize, or capture anything for you \u2014 on this site or any other." }),
2290
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-ask", children: "What should I call you?" }),
2291
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-hello-skip", onClick: () => setNameSkipped(true), children: "Skip for now" })
2292
+ ] }) : shopperName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2293
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
2289
2294
  "Hi, ",
2290
2295
  shopperName,
2291
2296
  "."
2292
2297
  ] }),
2293
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "hsk-cb-hello-lead", children: "What can I find for you today?" })
2294
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2295
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h2", { className: "hsk-cb-hello", children: [
2298
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "What can I find for you today?" })
2299
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2300
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h2", { className: "hsk-cb-hello", children: [
2296
2301
  "Hi, I'm ",
2297
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: "kiku" }),
2302
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("b", { children: "kiku" }),
2298
2303
  "."
2299
2304
  ] }),
2300
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "hsk-cb-hello-lead", children: "Ask me to search, visualize, or capture anything \u2014 I look across the whole site in real time." })
2305
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "hsk-cb-hello-lead", children: "Ask me to search, visualize, or capture anything \u2014 I look across the whole site in real time." })
2301
2306
  ] }),
2302
- !awaitingName && activeChips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-chips", children: activeChips.map((chip) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2307
+ !awaitingName && activeChips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-chips", children: activeChips.map((chip) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2303
2308
  "button",
2304
2309
  {
2305
2310
  className: "hsk-cb-chip",
@@ -2315,37 +2320,49 @@ function ChatModal({
2315
2320
  const compareSources = sources.filter((s) => s.id && referencedIds.includes(s.id));
2316
2321
  const showMatrix = isLast && lastIntent === "compare" && compareSources.length >= 2;
2317
2322
  const displayContent = !isUser && showMatrix ? stripMarkdownTables(msg.content) : msg.content;
2318
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-msg-group", ref: (el) => {
2323
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-msg-group", ref: (el) => {
2319
2324
  messageRefs.current[idx] = el;
2320
- }, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `hsk-cb-user-msg${isLastUser ? " hsk-sent" : ""}`, children: [
2321
- msg.images && msg.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-user-imgs", children: msg.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: img, alt: `attachment ${i + 1}`, className: "hsk-cb-user-img-thumb" }, i)) }),
2322
- msg.content && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-user-bubble", children: /^@kiku\b/i.test(msg.content) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2323
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-kiku-badge", children: "@kiku" }),
2325
+ }, children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `hsk-cb-user-msg${isLastUser ? " hsk-sent" : ""}`, children: [
2326
+ msg.images && msg.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-imgs", children: msg.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: img, alt: `attachment ${i + 1}`, className: "hsk-cb-user-img-thumb" }, i)) }),
2327
+ msg.content && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-bubble", children: /^@kiku\b/i.test(msg.content) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2328
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-kiku-badge", children: "@kiku" }),
2324
2329
  msg.content.replace(/^@kiku\s*/i, "")
2325
2330
  ] }) : msg.content })
2326
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2327
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) }),
2328
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-ai-body", children: [
2331
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2332
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
2333
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-body", children: [
2329
2334
  (() => {
2330
2335
  const parsed = parseThinking(displayContent);
2331
2336
  const thinking = msg.thinking || parsed.thinking;
2332
2337
  const content = parsed.content;
2333
2338
  const isComplete = msg.thinking ? content.length > 0 || !(isLast && streaming) : parsed.isComplete;
2334
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2335
- (thinking || msg.thoughtForSeconds != null) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ThinkingBlock, { text: thinking, isComplete, seconds: msg.thoughtForSeconds }),
2336
- content && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-ai-text", children: [
2339
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2340
+ (thinking || msg.thoughtForSeconds != null) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ThinkingBlock, { text: thinking, isComplete, seconds: msg.thoughtForSeconds }),
2341
+ content && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-text", children: [
2337
2342
  renderMarkdown(content, isLast && streaming),
2338
- isLast && streaming && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { display: "inline-block", width: "0.5em", height: "1.05em", marginLeft: "2px", verticalAlign: "text-bottom", background: "currentColor", opacity: 0.55, borderRadius: "1px" } })
2343
+ isLast && streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { display: "inline-block", width: "0.5em", height: "1.05em", marginLeft: "2px", verticalAlign: "text-bottom", background: "currentColor", opacity: 0.55, borderRadius: "1px" } })
2339
2344
  ] })
2340
2345
  ] });
2341
2346
  })(),
2342
- msg.visualizing && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-viz hsk-cb-viz--loading", children: [
2343
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-cb-viz-spinner" }),
2344
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "Visualizing\u2026" })
2347
+ msg.visualizing && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz hsk-cb-viz--loading", children: [
2348
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-viz-spinner" }),
2349
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: msg.visualizingText || "Visualizing\u2026" })
2345
2350
  ] }),
2346
- msg.visualization && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-viz", children: [
2347
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-viz-imgwrap", children: [
2348
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2351
+ msg.visualization && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz", children: [
2352
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-viz-imgwrap", children: [
2353
+ msg.visualizationType === "video" || msg.visualization.includes("/videos/") ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2354
+ "video",
2355
+ {
2356
+ src: msg.visualization,
2357
+ controls: true,
2358
+ autoPlay: true,
2359
+ loop: true,
2360
+ muted: true,
2361
+ playsInline: true,
2362
+ className: "hsk-markdown-video",
2363
+ style: { display: "block", maxHeight: "400px", objectFit: "contain", width: "100%" }
2364
+ }
2365
+ ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2349
2366
  "img",
2350
2367
  {
2351
2368
  src: msg.visualization,
@@ -2356,18 +2373,18 @@ function ChatModal({
2356
2373
  }
2357
2374
  }
2358
2375
  ),
2359
- isLast && !streaming && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { className: "hsk-cb-viz-mark", onClick: () => setMarkupSrc(msg.visualization), children: [
2360
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
2361
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M12 20h9" }),
2362
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z" })
2376
+ isLast && !streaming && (msg.visualizationType !== "video" && !msg.visualization.includes("/videos/")) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "hsk-cb-viz-mark", onClick: () => setMarkupSrc(msg.visualization), children: [
2377
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
2378
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 20h9" }),
2379
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z" })
2363
2380
  ] }),
2364
2381
  "Mark & edit"
2365
2382
  ] })
2366
2383
  ] }),
2367
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-viz-disclaimer", children: "AI-generated preview \u2014 colours, size and placement may differ from the real product." })
2384
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-viz-disclaimer", children: msg.visualizationType === "video" || msg.visualization.includes("/videos/") ? "AI-generated video makeover \u2014 colors, size and movement may differ from the real product." : "AI-generated preview \u2014 colours, size and placement may differ from the real product." })
2368
2385
  ] }),
2369
- !isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-kimgs", children: msg.knowledgeImages.map((ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-kimg-group", children: [
2370
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-kimg-grid", children: ref.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2386
+ !isUser && (msg.knowledgeImages?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-kimgs", children: msg.knowledgeImages.map((ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-kimg-group", children: [
2387
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-kimg-grid", children: ref.images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2371
2388
  "img",
2372
2389
  {
2373
2390
  src: img.url,
@@ -2381,16 +2398,16 @@ function ChatModal({
2381
2398
  },
2382
2399
  i
2383
2400
  )) }),
2384
- (ref.title || ref.images[0]?.note) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-kimg-caption", children: ref.title || ref.images[0]?.note })
2401
+ (ref.title || ref.images[0]?.note) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-kimg-caption", children: ref.title || ref.images[0]?.note })
2385
2402
  ] }, ref.entryId)) }),
2386
- showMatrix && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
2403
+ showMatrix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComparisonMatrix, { sources: compareSources, defaultCurrency }),
2387
2404
  (() => {
2388
2405
  const msgReferencedIds = isLast ? referencedIds : msg.referencedIds ?? [];
2389
2406
  const msgSources = isLast ? sources : msg.sources ?? [];
2390
2407
  const msgIntent = isLast ? lastIntent : msg.intent;
2391
2408
  const hiddenIntent = msgIntent === "compare" || msgIntent === "capture" || msgIntent === "capture_all" || msgIntent === "delete" || msgIntent === "view_history";
2392
2409
  const showCarousel = msgReferencedIds.length > 0 && !hiddenIntent && (!isLast || lastAction?.type !== "request_kiku_key");
2393
- return showCarousel && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2410
+ return showCarousel && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2394
2411
  SourcesCarousel,
2395
2412
  {
2396
2413
  sources: msgSources,
@@ -2402,11 +2419,11 @@ function ChatModal({
2402
2419
  }
2403
2420
  );
2404
2421
  })(),
2405
- isLast && !loading && lastAction?.url && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-action-pills", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("a", { className: "hsk-action-pill", href: lastAction.url, children: [
2422
+ isLast && !loading && lastAction?.url && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-action-pills", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("a", { className: "hsk-action-pill", href: lastAction.url, children: [
2406
2423
  String(lastAction.type || "continue").replace(/_/g, " "),
2407
2424
  " \u2192"
2408
2425
  ] }) }),
2409
- isLast && !loading && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2426
+ isLast && !loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2410
2427
  SmartContextPills,
2411
2428
  {
2412
2429
  intent: lastIntent,
@@ -2418,16 +2435,16 @@ function ChatModal({
2418
2435
  ] })
2419
2436
  ] }) }, idx);
2420
2437
  }),
2421
- selectedProduct && loading && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2438
+ selectedProduct && loading && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2422
2439
  "div",
2423
2440
  {
2424
2441
  className: "hsk-cb-selected-product",
2425
2442
  onClick: () => selectedProduct.url && window.open(selectedProduct.url, "_blank"),
2426
2443
  children: [
2427
- selectedProduct.image && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { className: "hsk-cb-selected-img", src: selectedProduct.image, alt: selectedProduct.name }),
2428
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-selected-info", children: [
2429
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-selected-name", children: selectedProduct.name }),
2430
- selectedProduct.price && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-selected-price", children: [
2444
+ selectedProduct.image && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { className: "hsk-cb-selected-img", src: selectedProduct.image, alt: selectedProduct.name }),
2445
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-selected-info", children: [
2446
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-selected-name", children: selectedProduct.name }),
2447
+ selectedProduct.price && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-selected-price", children: [
2431
2448
  selectedProduct.currency ?? defaultCurrency,
2432
2449
  " ",
2433
2450
  parseFloat(String(selectedProduct.price ?? "").replace(/[^0-9.]/g, "") || "0").toLocaleString()
@@ -2436,12 +2453,22 @@ function ChatModal({
2436
2453
  ]
2437
2454
  }
2438
2455
  ),
2439
- loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-typing-bubble", "aria-label": "Assistant is typing", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "hsk-cb-typing", children: [
2440
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {}),
2441
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {}),
2442
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {})
2443
- ] }) }),
2444
- lastAction?.type === "open_memory" && lastAction.url && !loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2456
+ loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing-row", style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
2457
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-thinking-icon", children: [
2458
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { className: "hsk-brand-mark", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z", transform: "translate(22.7 19) scale(0.62)", fillRule: "evenodd" }) }),
2459
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { className: "hsk-brand-mark hsk-brand-mark--sheen", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z", transform: "translate(22.7 19) scale(0.62)", fillRule: "evenodd" }) }),
2460
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-orbit", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-handle-ring", children: [
2461
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
2462
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
2463
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
2464
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" }),
2465
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-ball" })
2466
+ ] }) }),
2467
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-handle-rest" })
2468
+ ] }),
2469
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-thinking-text", children: "Thinking\u2026" })
2470
+ ] }),
2471
+ lastAction?.type === "open_memory" && lastAction.url && !loading && !streaming && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2445
2472
  "a",
2446
2473
  {
2447
2474
  className: "hsk-cb-memory-pill",
@@ -2450,23 +2477,23 @@ function ChatModal({
2450
2477
  rel: "noopener noreferrer",
2451
2478
  children: [
2452
2479
  "Open my memory on mimi",
2453
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExternalIcon, {})
2480
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExternalIcon, {})
2454
2481
  ]
2455
2482
  }
2456
2483
  ),
2457
- (stopped || interrupted) && !loading && !streaming && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-stopped", children: [
2458
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-cb-stopped-label", children: stopped ? "You stopped this response." : "This response was interrupted." }),
2459
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { className: "hsk-cb-continue", onClick: continueGenerating, children: [
2460
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ContinueIcon, {}),
2484
+ (stopped || interrupted) && !loading && !streaming && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-stopped", children: [
2485
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-stopped-label", children: stopped ? "You stopped this response." : "This response was interrupted." }),
2486
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "hsk-cb-continue", onClick: continueGenerating, children: [
2487
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ContinueIcon, {}),
2461
2488
  messages[messages.length - 1]?.role === "assistant" ? "Continue generating" : "Generate response"
2462
2489
  ] })
2463
2490
  ] }),
2464
- error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError(error) }),
2465
- keyPhase === "prompt_key" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2466
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) }),
2467
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-text", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-phone-form", children: [
2468
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { className: "hsk-cb-phone-label", children: "Paste your public id \u2014 or create one" }),
2469
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2491
+ error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError(error) }),
2492
+ keyPhase === "prompt_key" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2493
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
2494
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-text", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-phone-form", children: [
2495
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "hsk-cb-phone-label", children: "Paste your public id \u2014 or create one" }),
2496
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2470
2497
  "input",
2471
2498
  {
2472
2499
  type: "text",
@@ -2478,49 +2505,49 @@ function ChatModal({
2478
2505
  autoFocus: true
2479
2506
  }
2480
2507
  ),
2481
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
2482
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleUseExistingKey, disabled: !keyInput.trim(), children: "Use my id" }),
2483
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleCreateKey, disabled: minting, children: minting ? "Creating\u2026" : "I'm new \u2014 create one" })
2508
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8 }, children: [
2509
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleUseExistingKey, disabled: !keyInput.trim(), children: "Use my id" }),
2510
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", onClick: handleCreateKey, disabled: minting, children: minting ? "Creating\u2026" : "I'm new \u2014 create one" })
2484
2511
  ] })
2485
2512
  ] }) }) })
2486
2513
  ] }),
2487
- mintedKey && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2488
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) }),
2489
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-ai-text", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { padding: "12px 14px", border: "1px solid var(--hsk-border, #e5e5e5)", borderRadius: "var(--hsk-border-radius, 0px)", display: "flex", flexDirection: "column", gap: 12 }, children: [
2490
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
2491
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your secret \u2014 shown only once" }),
2492
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", { style: { display: "block", fontSize: 14, fontWeight: 700, marginBottom: 6, wordBreak: "break-all" }, children: mintedKey }),
2493
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
2494
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-phone-submit", style: { padding: "4px 10px" }, onClick: () => copyValue(mintedKey, "secret"), children: copied === "secret" ? "Copied" : "Copy secret" }),
2495
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: 11, opacity: 0.7 }, children: "Keep it private \u2014 use it to unlock your memory at mimi.akropolys.cloud. If lost, the memory is lost with it." })
2514
+ mintedKey && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2515
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
2516
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-text", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { padding: "12px 14px", border: "1px solid var(--hsk-border, #e5e5e5)", borderRadius: "var(--hsk-border-radius, 0px)", display: "flex", flexDirection: "column", gap: 12 }, children: [
2517
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
2518
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your secret \u2014 shown only once" }),
2519
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { display: "block", fontSize: 14, fontWeight: 700, marginBottom: 6, wordBreak: "break-all" }, children: mintedKey }),
2520
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
2521
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", style: { padding: "4px 10px" }, onClick: () => copyValue(mintedKey, "secret"), children: copied === "secret" ? "Copied" : "Copy secret" }),
2522
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: 11, opacity: 0.7 }, children: "Keep it private \u2014 use it to unlock your memory at mimi.akropolys.cloud. If lost, the memory is lost with it." })
2496
2523
  ] })
2497
2524
  ] }),
2498
- mintedPub && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
2499
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your public id" }),
2500
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", { style: { display: "block", fontSize: 13, fontWeight: 600, marginBottom: 6, wordBreak: "break-all", opacity: 0.85 }, children: mintedPub }),
2501
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
2502
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { className: "hsk-cb-phone-submit", style: { padding: "4px 10px" }, onClick: () => copyValue(mintedPub, "pub"), children: copied === "pub" ? "Copied" : "Copy id" }),
2503
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: 11, opacity: 0.7 }, children: "Paste this on any site to keep saving to the same memory." })
2525
+ mintedPub && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
2526
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: "Your public id" }),
2527
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { display: "block", fontSize: 13, fontWeight: 600, marginBottom: 6, wordBreak: "break-all", opacity: 0.85 }, children: mintedPub }),
2528
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
2529
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-cb-phone-submit", style: { padding: "4px 10px" }, onClick: () => copyValue(mintedPub, "pub"), children: copied === "pub" ? "Copied" : "Copy id" }),
2530
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: 11, opacity: 0.7 }, children: "Paste this on any site to keep saving to the same memory." })
2504
2531
  ] })
2505
2532
  ] }),
2506
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { fontSize: 11, opacity: 0.6 }, children: [
2533
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { fontSize: 11, opacity: 0.6 }, children: [
2507
2534
  "Hidden in ",
2508
2535
  keyCountdown,
2509
2536
  "s."
2510
2537
  ] })
2511
2538
  ] }) }) })
2512
2539
  ] }),
2513
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: bottomRef, style: { height: 1 } })
2540
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: bottomRef, style: { height: 1 } })
2514
2541
  ] }),
2515
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
2516
- showAtPicker && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2542
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
2543
+ showAtPicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2517
2544
  AtPickerMenu,
2518
2545
  {
2519
2546
  onSelect: handleSelectExtension,
2520
2547
  onDismiss: () => setShowAtPicker(false)
2521
2548
  }
2522
2549
  ),
2523
- showKikuPicker && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2550
+ showKikuPicker && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2524
2551
  KikuPickerMenu,
2525
2552
  {
2526
2553
  sources,
@@ -2533,9 +2560,9 @@ function ChatModal({
2533
2560
  onDismiss: () => setShowKikuPicker(false)
2534
2561
  }
2535
2562
  ),
2536
- attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-img-strip", children: attachments.map((att, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-img-thumb-wrap", children: [
2537
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: att.data, alt: `attachment ${i + 1}`, className: "hsk-cb-img-thumb" }),
2538
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2563
+ attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-img-strip", children: attachments.map((att, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-img-thumb-wrap", children: [
2564
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: att.data, alt: `attachment ${i + 1}`, className: "hsk-cb-img-thumb" }),
2565
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2539
2566
  "button",
2540
2567
  {
2541
2568
  className: "hsk-cb-img-thumb-remove",
@@ -2545,8 +2572,8 @@ function ChatModal({
2545
2572
  }
2546
2573
  )
2547
2574
  ] }, i)) }),
2548
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "hsk-cb-input-box", children: [
2549
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2575
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-box", children: [
2576
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2550
2577
  "input",
2551
2578
  {
2552
2579
  ref: imageInputRef,
@@ -2557,7 +2584,7 @@ function ChatModal({
2557
2584
  onChange: (e) => handleImageFiles(e.target.files)
2558
2585
  }
2559
2586
  ),
2560
- enableVision && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2587
+ enableVision && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2561
2588
  "button",
2562
2589
  {
2563
2590
  className: "hsk-cb-attach-btn",
@@ -2565,10 +2592,10 @@ function ChatModal({
2565
2592
  disabled: loading,
2566
2593
  "aria-label": "Attach image",
2567
2594
  title: "Attach image",
2568
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaperclipIcon, {})
2595
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PaperclipIcon, {})
2569
2596
  }
2570
2597
  ),
2571
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2598
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2572
2599
  "textarea",
2573
2600
  {
2574
2601
  ref: textareaRef,
@@ -2582,7 +2609,7 @@ function ChatModal({
2582
2609
  autoFocus: true
2583
2610
  }
2584
2611
  ),
2585
- hasSpeechAPI && enableVoice && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2612
+ hasSpeechAPI && enableVoice && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2586
2613
  "button",
2587
2614
  {
2588
2615
  className: cn(
@@ -2595,32 +2622,32 @@ function ChatModal({
2595
2622
  "aria-label": voiceState === "idle" ? "Start voice input" : "Stop recording",
2596
2623
  title: voiceState === "idle" ? "Voice input" : "Stop",
2597
2624
  children: [
2598
- voiceState === "listening" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MicOffIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MicIcon2, {}),
2599
- voiceState === "listening" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-cb-mic-pulse" })
2625
+ voiceState === "listening" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MicOffIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MicIcon2, {}),
2626
+ voiceState === "listening" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-mic-pulse" })
2600
2627
  ]
2601
2628
  }
2602
2629
  ),
2603
- loading || streaming ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2630
+ loading || streaming ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2604
2631
  "button",
2605
2632
  {
2606
2633
  className: cn("hsk-cb-send", "hsk-cb-send--stop", classNames.sendButton),
2607
2634
  onClick: stop,
2608
2635
  "aria-label": "Stop generating",
2609
2636
  title: "Stop generating",
2610
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StopIcon, {})
2637
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StopIcon, {})
2611
2638
  }
2612
- ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2639
+ ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2613
2640
  "button",
2614
2641
  {
2615
2642
  className: cn("hsk-cb-send", classNames.sendButton),
2616
2643
  onClick: () => handleSend(),
2617
2644
  disabled: !input.trim() && attachments.length === 0,
2618
2645
  "aria-label": "Send message",
2619
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ArrowUpIcon2, {})
2646
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowUpIcon, {})
2620
2647
  }
2621
2648
  )
2622
2649
  ] }),
2623
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "hsk-cb-hint", children: "kiku \xB7 searches the whole catalogue in real time" })
2650
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-hint", children: "kiku \xB7 searches the whole catalogue in real time" })
2624
2651
  ] })
2625
2652
  ] })
2626
2653
  ]
@@ -2673,17 +2700,9 @@ function KikuButton({
2673
2700
  window.removeEventListener("akropolys:navigation", handleNavigation);
2674
2701
  };
2675
2702
  }, []);
2676
- const isStringTheme = typeof theme === "string";
2677
- const hskThemeAttr = isStringTheme ? theme : void 0;
2678
- const customStyles = !isStringTheme && theme ? {
2679
- ...theme?.primaryColor && { "--hsk-primary": theme.primaryColor },
2680
- ...theme?.backgroundColor && { "--hsk-bg": theme.backgroundColor },
2681
- ...theme?.textColor && { "--hsk-text": theme.textColor },
2682
- ...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
2683
- ...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
2684
- } : void 0;
2685
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2686
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2703
+ const { themeAttr: hskThemeAttr, vars: customStyles } = resolveTheme(theme);
2704
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2705
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2687
2706
  "button",
2688
2707
  {
2689
2708
  className: cn("hsk-cb-btn", classNames.button, className),
@@ -2692,13 +2711,13 @@ function KikuButton({
2692
2711
  "data-hsk-theme": hskThemeAttr,
2693
2712
  "aria-label": "Open AI chat",
2694
2713
  children: [
2695
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "hsk-cb-btn-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SparkleIcon2, {}) }),
2714
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-cb-btn-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon2, {}) }),
2696
2715
  label !== void 0 ? label : null
2697
2716
  ]
2698
2717
  }
2699
2718
  ),
2700
2719
  open && mounted && (0, import_react_dom.createPortal)(
2701
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2720
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2702
2721
  ChatModal,
2703
2722
  {
2704
2723
  title,
@@ -2726,8 +2745,8 @@ function KikuButton({
2726
2745
  var import_react7 = require("react");
2727
2746
  var import_react_dom2 = require("react-dom");
2728
2747
  var import_sdk7 = require("@akropolys/sdk");
2729
- var import_jsx_runtime9 = require("react/jsx-runtime");
2730
- var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2748
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2749
+ var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2731
2750
  "svg",
2732
2751
  {
2733
2752
  className: cn("hsk-brand-mark", className),
@@ -2736,19 +2755,15 @@ var SparkleIcon3 = ({ className, size = 16 }) => /* @__PURE__ */ (0, import_jsx_
2736
2755
  viewBox: "0 0 100 100",
2737
2756
  xmlns: "http://www.w3.org/2000/svg",
2738
2757
  "aria-label": "kiku",
2739
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
2740
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z" }),
2741
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
2758
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("g", { transform: "translate(22.7 19) scale(0.62)", fill: "currentColor", fillRule: "evenodd", children: [
2759
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M39.4 10.4 Q44 0 48.6 10.4 L86.1 95.8 Q88 100 83.4 100 L4.6 100 Q0 100 1.9 95.8 Z M24 100 L24 65 Q24 60 27.4 56.3 Q44 38 60.6 56.3 Q64 60 64 65 L64 100 Z" }),
2760
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "55", cy: "82", r: "3.4" })
2742
2761
  ] })
2743
2762
  }
2744
2763
  );
2745
- var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
2746
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2747
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2748
- ] });
2749
- var ArrowUpIcon3 = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2750
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m5 12 7-7 7 7" }),
2751
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 19V5" })
2764
+ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
2765
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2766
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2752
2767
  ] });
2753
2768
  var getFriendlyError2 = (err) => {
2754
2769
  let str = "";
@@ -2874,7 +2889,7 @@ Question: ${q}`;
2874
2889
  }
2875
2890
  ] : messages;
2876
2891
  if (isMobile) {
2877
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2892
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2878
2893
  "div",
2879
2894
  {
2880
2895
  className: cn("hsk-sp-backdrop hsk-sp-mobile-view", classNames.backdrop),
@@ -2885,13 +2900,13 @@ Question: ${q}`;
2885
2900
  background: bg ?? void 0,
2886
2901
  ...customStyles
2887
2902
  },
2888
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen hsk-sp-mobile-card", classNames.card), onClick: (e) => e.stopPropagation(), children: [
2889
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-header", children: [
2890
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-header-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {}) }),
2891
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-header-body", children: [
2892
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-header-title-row", children: [
2893
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
2894
- displayProduct && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2903
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen hsk-sp-mobile-card", classNames.card), onClick: (e) => e.stopPropagation(), children: [
2904
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header", children: [
2905
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-header-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
2906
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-body", children: [
2907
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-title-row", children: [
2908
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
2909
+ displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2895
2910
  "button",
2896
2911
  {
2897
2912
  type: "button",
@@ -2901,32 +2916,32 @@ Question: ${q}`;
2901
2916
  }
2902
2917
  )
2903
2918
  ] }),
2904
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-header-sub", children: "kiku" })
2919
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-sub", children: "kiku" })
2905
2920
  ] }),
2906
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-sp-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon2, {}) })
2921
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "hsk-sp-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon2, {}) })
2907
2922
  ] }),
2908
- searchLoading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-bar" }),
2909
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-chat-container", children: [
2910
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-msgs", children: [
2923
+ searchLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-bar" }),
2924
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-chat-container", children: [
2925
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-msgs", children: [
2911
2926
  displayMessages.map((msg, idx) => {
2912
2927
  const isUser = msg.role === "user";
2913
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-msg-group", children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-msg", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-bubble", children: msg.content }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2914
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {}) }),
2915
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-body", children: [
2916
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }),
2917
- idx === 0 && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-attachment-deck", children: [
2918
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-main-card", children: [
2919
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-main-card-img", children: displayProduct.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: displayProduct.images[0], alt: displayProduct.name }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\xF0\u0178\u203A\x8D" }) }),
2920
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-main-card-info", children: [
2921
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-main-card-brand", children: displayProduct.brand || displayProduct.category || "Product" }),
2922
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-main-card-name", children: displayProduct.name }),
2923
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-main-card-price", children: [
2928
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-msg-group", children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-msg", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-bubble", children: msg.content }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
2929
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
2930
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-body", children: [
2931
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }),
2932
+ idx === 0 && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-attachment-deck", children: [
2933
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card", children: [
2934
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-img", children: displayProduct.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: displayProduct.images[0], alt: displayProduct.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\xF0\u0178\u203A\x8D" }) }),
2935
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card-info", children: [
2936
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-brand", children: displayProduct.brand || displayProduct.category || "Product" }),
2937
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-main-card-name", children: displayProduct.name }),
2938
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-main-card-price", children: [
2924
2939
  displayProduct.currency ?? "KES",
2925
2940
  " ",
2926
2941
  parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString()
2927
2942
  ] })
2928
2943
  ] }),
2929
- (displayProduct.specs && Object.keys(displayProduct.specs).length > 0 || displayProduct.description) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2944
+ (displayProduct.specs && Object.keys(displayProduct.specs).length > 0 || displayProduct.description) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2930
2945
  "button",
2931
2946
  {
2932
2947
  type: "button",
@@ -2945,21 +2960,21 @@ Question: ${q}`;
2945
2960
  }
2946
2961
  );
2947
2962
  if (similarProducts.length === 0) return null;
2948
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-inline", children: [
2949
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-title", children: "Similar Products" }),
2950
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-list", children: similarProducts.map((r) => {
2963
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-inline", children: [
2964
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-title", children: "Similar Products" }),
2965
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-list", children: similarProducts.map((r) => {
2951
2966
  const price = parseFloat(r.entity.price?.replace(/[^0-9.]/g, "") || "0");
2952
2967
  const currency = r.entity.currency ?? "KES";
2953
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2968
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2954
2969
  "div",
2955
2970
  {
2956
2971
  className: "hsk-sp-mobile-similar-carousel-item",
2957
2972
  onClick: () => handleNav(r),
2958
2973
  children: [
2959
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-img", children: r.entity.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: r.entity.images[0], alt: r.entity.name }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\xF0\u0178\u203A\x8D" }) }),
2960
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-meta", children: [
2961
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-name", title: r.entity.name, children: r.entity.name }),
2962
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-price", children: [
2974
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-img", children: r.entity.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: r.entity.images[0], alt: r.entity.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\xF0\u0178\u203A\x8D" }) }),
2975
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-meta", children: [
2976
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-similar-carousel-name", title: r.entity.name, children: r.entity.name }),
2977
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-similar-carousel-price", children: [
2963
2978
  currency,
2964
2979
  " ",
2965
2980
  price.toLocaleString()
@@ -2976,19 +2991,19 @@ Question: ${q}`;
2976
2991
  ] })
2977
2992
  ] }) }, idx);
2978
2993
  }),
2979
- chatLoading && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing-row", children: [
2980
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {}) }),
2981
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing", children: [
2982
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-dot" }),
2983
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-dot" }),
2984
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-dot" })
2994
+ chatLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing-row", children: [
2995
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
2996
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing", children: [
2997
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
2998
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
2999
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" })
2985
3000
  ] })
2986
3001
  ] }),
2987
- chatError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
2988
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
3002
+ chatError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
3003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
2989
3004
  ] }),
2990
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-input-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-box", children: [
2991
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3005
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-input-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-box", children: [
3006
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2992
3007
  "textarea",
2993
3008
  {
2994
3009
  ref: chatTextareaRef,
@@ -3001,34 +3016,34 @@ Question: ${q}`;
3001
3016
  disabled: chatLoading
3002
3017
  }
3003
3018
  ),
3004
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3019
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3005
3020
  "button",
3006
3021
  {
3007
3022
  className: "hsk-cb-send",
3008
3023
  onClick: () => handleSend(),
3009
3024
  disabled: !chatInput.trim() || chatLoading,
3010
3025
  "aria-label": "Send message",
3011
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowUpIcon3, {})
3026
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowUpIcon, {})
3012
3027
  }
3013
3028
  )
3014
3029
  ] }) })
3015
3030
  ] }),
3016
- showSpecs && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-mobile-specs-overlay", onClick: () => setShowSpecs(false), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-specs-drawer", onClick: (e) => e.stopPropagation(), children: [
3017
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-specs-header", children: [
3018
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { children: "Specifications" }),
3019
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: () => setShowSpecs(false), children: "Close" })
3031
+ showSpecs && displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-mobile-specs-overlay", onClick: () => setShowSpecs(false), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-drawer", onClick: (e) => e.stopPropagation(), children: [
3032
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-header", children: [
3033
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: "Specifications" }),
3034
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setShowSpecs(false), children: "Close" })
3020
3035
  ] }),
3021
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-specs-body", children: [
3022
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h4", { className: "hsk-sp-mobile-specs-title", children: displayProduct.name }),
3023
- displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-specs-desc", children: [
3024
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h5", { children: "Description" }),
3025
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: displayProduct.description })
3036
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-body", children: [
3037
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "hsk-sp-mobile-specs-title", children: displayProduct.name }),
3038
+ displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-desc", children: [
3039
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { children: "Description" }),
3040
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: displayProduct.description })
3026
3041
  ] }),
3027
- displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-specs-list", children: [
3028
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h5", { children: "Details" }),
3029
- Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-mobile-spec-row", children: [
3030
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-mobile-spec-label", children: key }),
3031
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-mobile-spec-value", children: val })
3042
+ displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-specs-list", children: [
3043
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h5", { children: "Details" }),
3044
+ Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-mobile-spec-row", children: [
3045
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-mobile-spec-label", children: key }),
3046
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-mobile-spec-value", children: val })
3032
3047
  ] }, key))
3033
3048
  ] })
3034
3049
  ] })
@@ -3037,7 +3052,7 @@ Question: ${q}`;
3037
3052
  }
3038
3053
  );
3039
3054
  }
3040
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3055
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3041
3056
  "div",
3042
3057
  {
3043
3058
  className: cn("hsk-sp-backdrop", classNames.backdrop),
@@ -3048,65 +3063,65 @@ Question: ${q}`;
3048
3063
  background: bg ?? void 0,
3049
3064
  ...customStyles
3050
3065
  },
3051
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen", classNames.card), onClick: (e) => e.stopPropagation(), children: [
3052
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-header", children: [
3053
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-header-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {}) }),
3054
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-header-body", children: [
3055
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
3056
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-header-sub", children: "Ask questions, compare specs, or check similar products" })
3066
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("hsk-sp-card hsk-sp-fullscreen", classNames.card), onClick: (e) => e.stopPropagation(), children: [
3067
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header", children: [
3068
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-header-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
3069
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-header-body", children: [
3070
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-title", children: displayProduct?.name || productName }),
3071
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-header-sub", children: "Ask questions, compare specs, or check similar products" })
3057
3072
  ] }),
3058
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "hsk-sp-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon2, {}) })
3073
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "hsk-sp-close", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon2, {}) })
3059
3074
  ] }),
3060
- searchLoading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-bar" }),
3061
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-body", children: [
3062
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-details-pane", children: [
3063
- displayProduct && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-product-profile-container", children: [
3064
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-product-profile", children: [
3065
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-details-imgwrap", children: displayProduct.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: displayProduct.images[0], alt: displayProduct.name }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-img-placeholder", children: "\xF0\u0178\u203A\x8D" }) }),
3066
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-details-meta", children: [
3067
- displayProduct.brand && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-brand", children: displayProduct.brand }),
3068
- displayProduct.category && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-cat", children: displayProduct.category }),
3069
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "hsk-sp-details-name", children: displayProduct.name }),
3070
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
3071
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-currency", children: displayProduct.currency ?? "KES" }),
3072
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-price", children: parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
3073
- displayProduct.originalPrice && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-original-price", children: parseFloat(displayProduct.originalPrice.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
3074
- displayProduct.discount && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-sp-item-discount", children: [
3075
+ searchLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-bar" }),
3076
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-body", children: [
3077
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-pane", children: [
3078
+ displayProduct && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-product-profile-container", children: [
3079
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-product-profile", children: [
3080
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-details-imgwrap", children: displayProduct.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: displayProduct.images[0], alt: displayProduct.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-img-placeholder", children: "\xF0\u0178\u203A\x8D" }) }),
3081
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-meta", children: [
3082
+ displayProduct.brand && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-brand", children: displayProduct.brand }),
3083
+ displayProduct.category && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-cat", children: displayProduct.category }),
3084
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "hsk-sp-details-name", children: displayProduct.name }),
3085
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
3086
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-currency", children: displayProduct.currency ?? "KES" }),
3087
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-price", children: parseFloat(displayProduct.price?.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
3088
+ displayProduct.originalPrice && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-original-price", children: parseFloat(displayProduct.originalPrice.replace(/[^0-9.]/g, "") || "0").toLocaleString() }),
3089
+ displayProduct.discount && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-item-discount", children: [
3075
3090
  "(",
3076
3091
  displayProduct.discount,
3077
3092
  ")"
3078
3093
  ] })
3079
3094
  ] }),
3080
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-item-meta-badges", children: [
3081
- displayProduct.rating && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-rating", children: [
3095
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-meta-badges", children: [
3096
+ displayProduct.rating && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-rating", children: [
3082
3097
  "\xE2\u02DC\u2026 ",
3083
3098
  parseFloat(displayProduct.rating.toString()).toFixed(1),
3084
3099
  " ",
3085
3100
  displayProduct.reviewCount ? `(${displayProduct.reviewCount})` : ""
3086
3101
  ] }),
3087
- displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `hsk-sp-meta-badge hsk-sp-meta-badge-avail ${displayProduct.availability.toLowerCase().includes("in") ? "in-stock" : "out-stock"}`, children: displayProduct.availability }),
3088
- displayProduct.stock && !displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-stock", children: [
3102
+ displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `hsk-sp-meta-badge hsk-sp-meta-badge-avail ${displayProduct.availability.toLowerCase().includes("in") ? "in-stock" : "out-stock"}`, children: displayProduct.availability }),
3103
+ displayProduct.stock && !displayProduct.availability && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-meta-badge hsk-sp-meta-badge-stock", children: [
3089
3104
  "Stock: ",
3090
3105
  displayProduct.stock
3091
3106
  ] })
3092
3107
  ] })
3093
3108
  ] })
3094
3109
  ] }),
3095
- displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-specs-horizontal", children: Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-spec-item-horizontal", children: [
3096
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "hsk-sp-spec-label-horizontal", children: [
3110
+ displayProduct.specs && Object.keys(displayProduct.specs).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-specs-horizontal", children: Object.entries(displayProduct.specs).map(([key, val]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-spec-item-horizontal", children: [
3111
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "hsk-sp-spec-label-horizontal", children: [
3097
3112
  key,
3098
3113
  ":"
3099
3114
  ] }),
3100
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-spec-value-horizontal", title: val, children: val })
3115
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-spec-value-horizontal", title: val, children: val })
3101
3116
  ] }, key)) }),
3102
- displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-details-desc", children: [
3103
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h4", { children: "Description" }),
3104
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: displayProduct.description })
3117
+ displayProduct.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-details-desc", children: [
3118
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { children: "Description" }),
3119
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: displayProduct.description })
3105
3120
  ] })
3106
3121
  ] }),
3107
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-similar-section", children: [
3108
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { children: "Similar Products" }),
3109
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-results", children: (() => {
3122
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-similar-section", children: [
3123
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: "Similar Products" }),
3124
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-results", children: (() => {
3110
3125
  const similarProducts = results.filter(
3111
3126
  (r) => {
3112
3127
  const isSameName = !!(r.entity.name && displayProduct?.name && r.entity.name.toLowerCase() === displayProduct.name.toLowerCase());
@@ -3115,29 +3130,29 @@ Question: ${q}`;
3115
3130
  }
3116
3131
  );
3117
3132
  if (!searchLoading && similarProducts.length === 0) {
3118
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-empty", children: "No similar products found." });
3133
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-empty", children: "No similar products found." });
3119
3134
  }
3120
3135
  return similarProducts.map((r, i) => {
3121
3136
  const price = parseFloat(r.entity.price?.replace(/[^0-9.]/g, "") || "0");
3122
3137
  const currency = r.entity.currency ?? "KES";
3123
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3138
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3124
3139
  "div",
3125
3140
  {
3126
3141
  className: cn("hsk-sp-item", classNames.item),
3127
3142
  style: { animationDelay: `${i * 55}ms`, cursor: "pointer" },
3128
3143
  onClick: () => handleNav(r),
3129
3144
  children: [
3130
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-img-wrap", children: r.entity.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: r.entity.images[0], alt: r.entity.name }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-img-placeholder", children: "\xF0\u0178\u203A\x8D" }) }),
3131
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-item-body", children: [
3132
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3133
- r.entity.category && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-item-cat", children: r.entity.category }),
3134
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-item-name", title: r.entity.name, children: r.entity.name })
3145
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-img-wrap", children: r.entity.images?.[0] ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: r.entity.images[0], alt: r.entity.name }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-img-placeholder", children: "\xF0\u0178\u203A\x8D" }) }),
3146
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-body", children: [
3147
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3148
+ r.entity.category && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-item-cat", children: r.entity.category }),
3149
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-item-name", title: r.entity.name, children: r.entity.name })
3135
3150
  ] }),
3136
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
3137
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-currency", children: currency }),
3138
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-item-price", children: price.toLocaleString() })
3151
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-item-price-row", children: [
3152
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-currency", children: currency }),
3153
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-item-price", children: price.toLocaleString() })
3139
3154
  ] }),
3140
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-actions", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3155
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-actions", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3141
3156
  "button",
3142
3157
  {
3143
3158
  className: "hsk-sp-action hsk-sp-action-primary",
@@ -3157,29 +3172,29 @@ Question: ${q}`;
3157
3172
  })() })
3158
3173
  ] })
3159
3174
  ] }),
3160
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-sp-chat-pane", children: [
3161
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-msgs", children: [
3175
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-sp-chat-pane", children: [
3176
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-msgs", children: [
3162
3177
  displayMessages.map((msg, idx) => {
3163
3178
  const isUser = msg.role === "user";
3164
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-msg-group", children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-msg", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-user-bubble", children: msg.content }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
3165
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {}) }),
3166
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }) })
3179
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-msg-group", children: isUser ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-msg", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-user-bubble", children: msg.content }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-ai-msg", children: [
3180
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
3181
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-body", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-text", children: renderMarkdown(msg.content) }) })
3167
3182
  ] }) }, idx);
3168
3183
  }),
3169
- chatLoading && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing-row", children: [
3170
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {}) }),
3171
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-typing", children: [
3172
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-dot" }),
3173
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-dot" }),
3174
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-dot" })
3184
+ chatLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing-row", children: [
3185
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-ai-icon", style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {}) }),
3186
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-typing", children: [
3187
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
3188
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" }),
3189
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-dot" })
3175
3190
  ] })
3176
3191
  ] }),
3177
- chatError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
3178
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
3192
+ chatError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-error", children: getFriendlyError2(chatError) }),
3193
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: chatBottomRef, style: { height: 1 } })
3179
3194
  ] }),
3180
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
3181
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "hsk-cb-input-box", children: [
3182
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3195
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-wrap", children: [
3196
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "hsk-cb-input-box", children: [
3197
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3183
3198
  "textarea",
3184
3199
  {
3185
3200
  ref: chatTextareaRef,
@@ -3192,22 +3207,22 @@ Question: ${q}`;
3192
3207
  disabled: chatLoading
3193
3208
  }
3194
3209
  ),
3195
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3210
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3196
3211
  "button",
3197
3212
  {
3198
3213
  className: "hsk-cb-send",
3199
3214
  onClick: () => handleSend(),
3200
3215
  disabled: !chatInput.trim() || chatLoading,
3201
3216
  "aria-label": "Send message",
3202
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ArrowUpIcon3, {})
3217
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowUpIcon, {})
3203
3218
  }
3204
3219
  )
3205
3220
  ] }),
3206
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-cb-hint", children: "Akropolys \xB7 instant product knowledge" })
3221
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-cb-hint", children: "Akropolys \xB7 instant product knowledge" })
3207
3222
  ] })
3208
3223
  ] })
3209
3224
  ] }),
3210
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "hsk-sp-footer", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "hsk-sp-esc", children: "Esc to close" }) })
3225
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "hsk-sp-footer", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "hsk-sp-esc", children: "Esc to close" }) })
3211
3226
  ] })
3212
3227
  }
3213
3228
  );
@@ -3237,8 +3252,8 @@ function Sparkle({
3237
3252
  ...theme?.fontFamily && { "--hsk-font": theme.fontFamily },
3238
3253
  ...theme?.borderRadius && { "--hsk-border-radius": theme.borderRadius }
3239
3254
  };
3240
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
3241
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3255
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3256
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3242
3257
  "button",
3243
3258
  {
3244
3259
  className: cn("hsk-sp-btn", classNames.button, className),
@@ -3246,11 +3261,11 @@ function Sparkle({
3246
3261
  style: customStyles,
3247
3262
  title: "Find similar products",
3248
3263
  "aria-label": "Find similar products",
3249
- children: children || /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SparkleIcon3, {})
3264
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SparkleIcon3, {})
3250
3265
  }
3251
3266
  ),
3252
3267
  open && mounted && (0, import_react_dom2.createPortal)(
3253
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3268
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3254
3269
  SparkleModal,
3255
3270
  {
3256
3271
  productName,