@opencx/widget-react 4.0.30 → 4.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/index.cjs +7 -7
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +362 -354
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/components/Header.d.ts.map +1 -1
  6. package/dist/src/components/custom-components/ChatBottomComponents.d.ts.map +1 -0
  7. package/dist/src/components/custom-components/HeaderBottomComponent.d.ts.map +1 -0
  8. package/dist/src/components/custom-components/HeaderTitleComponent.d.ts +5 -0
  9. package/dist/src/components/custom-components/HeaderTitleComponent.d.ts.map +1 -0
  10. package/dist/src/components/custom-components/SessionResolvedComponent.d.ts.map +1 -0
  11. package/dist/src/hooks/useComponentContext.d.ts +3 -0
  12. package/dist/src/hooks/useComponentContext.d.ts.map +1 -0
  13. package/dist/src/hooks/useTranslation.d.ts +1 -1
  14. package/dist/src/screens/chat/ChatCanvas.d.ts.map +1 -1
  15. package/package.json +5 -5
  16. package/dist/src/components/special-components/ChatBottomComponents.d.ts.map +0 -1
  17. package/dist/src/components/special-components/HeaderBottomComponent.d.ts.map +0 -1
  18. package/dist/src/components/special-components/SessionResolvedComponent.d.ts.map +0 -1
  19. package/dist/src/hooks/useSpecialComponentProps.d.ts +0 -5
  20. package/dist/src/hooks/useSpecialComponentProps.d.ts.map +0 -1
  21. /package/dist/src/components/{special-components → custom-components}/ChatBottomComponents.d.ts +0 -0
  22. /package/dist/src/components/{special-components → custom-components}/HeaderBottomComponent.d.ts +0 -0
  23. /package/dist/src/components/{special-components → custom-components}/SessionResolvedComponent.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { jsx as r, jsxs as d, Fragment as te } from "react/jsx-runtime";
2
- import * as le from "@radix-ui/react-popover";
2
+ import * as ce from "@radix-ui/react-popover";
3
3
  import * as G from "react";
4
- import q, { memo as $t, forwardRef as dt, useState as T, cloneElement as pt, createContext as Lt, useEffect as re, useContext as Yt, useMemo as ht, useRef as ce, createElement as ot } from "react";
5
- import { useWidget as R, useConfig as x, useDocumentDir as fe, useSessions as $, useMessages as j, useWidgetRouter as P, useWidgetTrigger as K, useModes as mt, useCsat as gt, useUploadFiles as qt, useIsAwaitingBotReply as wt, useContact as Xt, WidgetProvider as Ut, WidgetTriggerProvider as Vt } from "@opencx/widget-react-headless";
4
+ import q, { memo as $t, forwardRef as dt, useState as T, cloneElement as pt, createContext as Lt, useEffect as re, useContext as Yt, useMemo as ht, useRef as de, createElement as ot } from "react";
5
+ import { useWidget as R, useConfig as x, useDocumentDir as ve, useSessions as $, useMessages as j, useWidgetRouter as P, useWidgetTrigger as K, useModes as mt, useCsat as gt, useUploadFiles as qt, useIsAwaitingBotReply as wt, useContact as Xt, WidgetProvider as Ut, WidgetTriggerProvider as Vt } from "@opencx/widget-react-headless";
6
6
  import { clsx as Gt } from "clsx";
7
7
  import { twMerge as Kt } from "tailwind-merge";
8
8
  import { motion as Z, AnimatePresence as _ } from "framer-motion";
9
9
  import { Slot as Qt } from "@radix-ui/react-slot";
10
10
  import { cva as Zt } from "class-variance-authority";
11
- import { X as Jt, CircleDashedIcon as er, XIcon as ve, SquareXIcon as tr, SquareCheckBigIcon as rr, SquareCheckIcon as or, ShrinkIcon as nr, Minimize2Icon as sr, MinimizeIcon as ir, Maximize2Icon as ar, MaximizeIcon as lr, ExpandIcon as cr, CircleXIcon as dr, CircleCheckBigIcon as pr, CircleCheckIcon as ut, CheckCheckIcon as hr, CheckIcon as mr, ChevronLeftIcon as gr, LoaderIcon as wr, ArrowUpIcon as ft, PaperclipIcon as ur, ImageIcon as fr, CircleDashed as vr, AlertCircle as xr, Loader2 as br, FileAudio2Icon as yr, FileVideo2Icon as kr, FileIcon as Cr, UserRoundIcon as zr, ChevronRightIcon as Nr, SendHorizontal as Sr, ChevronDownIcon as _r } from "lucide-react";
11
+ import { X as Jt, CircleDashedIcon as er, XIcon as xe, SquareXIcon as tr, SquareCheckBigIcon as rr, SquareCheckIcon as or, ShrinkIcon as nr, Minimize2Icon as sr, MinimizeIcon as ir, Maximize2Icon as ar, MaximizeIcon as lr, ExpandIcon as cr, CircleXIcon as dr, CircleCheckBigIcon as pr, CircleCheckIcon as ut, CheckCheckIcon as hr, CheckIcon as mr, ChevronLeftIcon as gr, LoaderIcon as wr, ArrowUpIcon as ft, PaperclipIcon as ur, ImageIcon as fr, CircleDashed as vr, AlertCircle as xr, Loader2 as br, FileAudio2Icon as yr, FileVideo2Icon as kr, FileIcon as Cr, UserRoundIcon as zr, ChevronRightIcon as Nr, SendHorizontal as Sr, ChevronDownIcon as _r } from "lucide-react";
12
12
  import vt from "remark-gfm";
13
13
  import Ir from "react-markdown";
14
14
  import xt from "rehype-raw";
@@ -19,7 +19,7 @@ import * as oe from "@radix-ui/react-tooltip";
19
19
  import nt from "tinycolor2";
20
20
  import { useDropzone as Dr } from "react-dropzone";
21
21
  import Rr from "react-use/lib/useAsyncFn";
22
- import { z as he } from "zod";
22
+ import { z as me } from "zod";
23
23
  function g(e) {
24
24
  return { "data-component": e };
25
25
  }
@@ -32,29 +32,29 @@ const V = {
32
32
  }, B = $t(
33
33
  dt(
34
34
  ({ children: e, className: o, scale: t = 1.02, off: n = !1 }, s) => {
35
- const [i, a] = T(!1), [c, l] = T({ x: 0, y: 0 });
35
+ const [a, i] = T(!1), [c, l] = T({ x: 0, y: 0 });
36
36
  if (n || /translate/.test(
37
37
  e.props.className || ""
38
38
  )) return e;
39
39
  const b = (u) => {
40
40
  var z, N;
41
- const { clientX: y, clientY: I } = u, S = u.currentTarget.getBoundingClientRect(), M = y - (S.left + S.width / 2), F = I - (S.top + S.height / 2), H = Math.max(
41
+ const { clientX: y, clientY: I } = u, S = u.currentTarget.getBoundingClientRect(), M = y - (S.left + S.width / 2), H = I - (S.top + S.height / 2), F = Math.max(
42
42
  -1,
43
43
  Math.min(1, M / (S.width / 2))
44
44
  ), W = Math.max(
45
45
  -1,
46
- Math.min(1, F / (S.height / 2))
47
- ), E = H * V.x, v = W * V.y;
46
+ Math.min(1, H / (S.height / 2))
47
+ ), E = F * V.x, v = W * V.y;
48
48
  l({ x: E, y: v }), (N = (z = e.props).onMouseMove) == null || N.call(z, u);
49
49
  }, w = () => {
50
50
  var u, y;
51
- a(!0), (y = (u = e.props).onMouseEnter) == null || y.call(u);
51
+ i(!0), (y = (u = e.props).onMouseEnter) == null || y.call(u);
52
52
  }, m = () => {
53
53
  var u, y;
54
- a(!1), l({ x: 0, y: 0 }), (y = (u = e.props).onMouseLeave) == null || y.call(u);
54
+ i(!1), l({ x: 0, y: 0 }), (y = (u = e.props).onMouseLeave) == null || y.call(u);
55
55
  }, C = {
56
- "--wobble-x": i ? `${c.x}px` : "0px",
57
- "--wobble-y": i ? `${c.y}px` : "0px",
56
+ "--wobble-x": a ? `${c.x}px` : "0px",
57
+ "--wobble-y": a ? `${c.y}px` : "0px",
58
58
  "--scale": 1 - (t - 1)
59
59
  };
60
60
  return pt(e, {
@@ -95,7 +95,7 @@ const jr = 10, Er = (e, o, t) => ({
95
95
  initial: { opacity: 0, y: -e, ...o.initial },
96
96
  animate: { opacity: 1, y: 0, ...o.animate, transition: { delay: t } },
97
97
  exit: { opacity: 0, y: e, ...o.exit }
98
- }), Fr = {
98
+ }), Hr = {
99
99
  right: Er,
100
100
  left: Or,
101
101
  up: Pr,
@@ -107,15 +107,15 @@ const jr = 10, Er = (e, o, t) => ({
107
107
  children: t,
108
108
  snapExit: n = !1,
109
109
  overrides: s = {},
110
- delay: i = 0,
111
- ...a
110
+ delay: a = 0,
111
+ ...i
112
112
  }, c) => {
113
- const l = e ? Fr[e](o, s, i) : {};
114
- return n && l.exit && typeof l.exit == "object" && !Array.isArray(l.exit) && (l.exit.transition = { duration: 0 }), /* @__PURE__ */ r(Z.div, { ref: c, ...a, ...l, children: t });
113
+ const l = e ? Hr[e](o, s, a) : {};
114
+ return n && l.exit && typeof l.exit == "object" && !Array.isArray(l.exit) && (l.exit.transition = { duration: 0 }), /* @__PURE__ */ r(Z.div, { ref: c, ...i, ...l, children: t });
115
115
  }
116
116
  );
117
117
  f.displayName = "MotionDiv";
118
- const Hr = Zt(
118
+ const Fr = Zt(
119
119
  p(
120
120
  "inline-flex shrink-0 items-center justify-center gap-2",
121
121
  "text-sm font-medium whitespace-nowrap",
@@ -155,12 +155,12 @@ const Hr = Zt(
155
155
  }
156
156
  }
157
157
  ), k = G.forwardRef(
158
- ({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, i) => /* @__PURE__ */ r(B, { ref: i, children: /* @__PURE__ */ r(
158
+ ({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, a) => /* @__PURE__ */ r(B, { ref: a, children: /* @__PURE__ */ r(
159
159
  n ? Qt : "button",
160
160
  {
161
161
  ...g("ui_lib/btn"),
162
162
  "data-variant": o,
163
- className: p(Hr({ variant: o, size: t, className: e })),
163
+ className: p(Fr({ variant: o, size: t, className: e })),
164
164
  ...s
165
165
  }
166
166
  ) })
@@ -168,9 +168,9 @@ const Hr = Zt(
168
168
  k.displayName = "Button";
169
169
  const yt = Lt(null);
170
170
  function Wr({ children: e }) {
171
- const [o, t] = T(!1), [n, s] = T(null), i = (c) => {
171
+ const [o, t] = T(!1), [n, s] = T(null), a = (c) => {
172
172
  s(c), t(!0);
173
- }, a = () => {
173
+ }, i = () => {
174
174
  t(!1), setTimeout(() => {
175
175
  s(null);
176
176
  }, 200);
@@ -178,7 +178,7 @@ function Wr({ children: e }) {
178
178
  return /* @__PURE__ */ d(
179
179
  yt.Provider,
180
180
  {
181
- value: { open: i, close: a, isOpen: o, content: n },
181
+ value: { open: a, close: i, isOpen: o, content: n },
182
182
  children: [
183
183
  /* @__PURE__ */ r(Br, {}),
184
184
  e
@@ -186,7 +186,7 @@ function Wr({ children: e }) {
186
186
  }
187
187
  );
188
188
  }
189
- function de() {
189
+ function pe() {
190
190
  const e = Yt(yt);
191
191
  return e || (console.error("useDialoger must be used within a DialogerProvider"), {
192
192
  open: () => {
@@ -198,13 +198,13 @@ function de() {
198
198
  });
199
199
  }
200
200
  function Br() {
201
- const { contentIframeRef: e } = R(), { isOpen: o, content: t, close: n } = de();
201
+ const { contentIframeRef: e } = R(), { isOpen: o, content: t, close: n } = pe();
202
202
  return re(() => {
203
- var i, a;
203
+ var a, i;
204
204
  const s = (c) => {
205
205
  c.key === "Escape" && n();
206
206
  };
207
- return (a = (i = e == null ? void 0 : e.current) == null ? void 0 : i.contentWindow) == null || a.document.addEventListener(
207
+ return (i = (a = e == null ? void 0 : e.current) == null ? void 0 : a.contentWindow) == null || i.document.addEventListener(
208
208
  "keydown",
209
209
  s
210
210
  ), () => {
@@ -234,7 +234,7 @@ function kt({
234
234
  className: o,
235
235
  withClose: t = !1
236
236
  }) {
237
- const { close: n } = de();
237
+ const { close: n } = pe();
238
238
  return /* @__PURE__ */ d(
239
239
  "div",
240
240
  {
@@ -314,20 +314,20 @@ function It({
314
314
  children: e,
315
315
  trigger: o
316
316
  }) {
317
- const { open: t } = de();
317
+ const { open: t } = pe();
318
318
  return pt(o, {
319
319
  onClick: () => t(e)
320
320
  });
321
321
  }
322
322
  function Tt({ attachment: e }) {
323
- const { name: o, size: t, type: n, url: s } = e, i = n.startsWith("image/"), a = n.startsWith("video/"), c = n.startsWith("audio/");
323
+ const { name: o, size: t, type: n, url: s } = e, a = n.startsWith("image/"), i = n.startsWith("video/"), c = n.startsWith("audio/");
324
324
  return c ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "w-full shrink-0 overflow-hidden", children: /* @__PURE__ */ d("audio", { controls: !0, className: "w-full", children: [
325
325
  /* @__PURE__ */ r("source", { src: s, type: n }),
326
326
  "Your browser does not support the audio tag."
327
- ] }) }) }) : a ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "w-full border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("video", { controls: !0, children: [
327
+ ] }) }) }) : i ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "w-full border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("video", { controls: !0, children: [
328
328
  /* @__PURE__ */ r("source", { src: s, type: n }),
329
329
  "Your browser does not support the video tag."
330
- ] }) }) }) : !i && !a && !c ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("div", { className: "flex items-end gap-2 p-2", children: [
330
+ ] }) }) }) : !a && !i && !c ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("div", { className: "flex items-end gap-2 p-2", children: [
331
331
  /* @__PURE__ */ r(
332
332
  "a",
333
333
  {
@@ -349,13 +349,13 @@ function Tt({ attachment: e }) {
349
349
  ] }) }) }) : /* @__PURE__ */ r(
350
350
  It,
351
351
  {
352
- trigger: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: i && /* @__PURE__ */ r("img", { src: s, className: "object-cover size-16", alt: o }) }) }) }),
352
+ trigger: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: a && /* @__PURE__ */ r("img", { src: s, className: "object-cover size-16", alt: o }) }) }) }),
353
353
  children: /* @__PURE__ */ r(
354
354
  kt,
355
355
  {
356
356
  className: "size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",
357
357
  withClose: !0,
358
- children: i && /* @__PURE__ */ r("div", { className: "size-fit shrink-0 rounded-2xl overflow-hidden max-h-full", children: /* @__PURE__ */ r("img", { src: s, className: "object-cover size-auto", alt: o }) })
358
+ children: a && /* @__PURE__ */ r("div", { className: "size-fit shrink-0 rounded-2xl overflow-hidden max-h-full", children: /* @__PURE__ */ r("img", { src: s, className: "object-cover size-auto", alt: o }) })
359
359
  }
360
360
  )
361
361
  }
@@ -365,7 +365,7 @@ const Mt = q.memo(
365
365
  Ir,
366
366
  (e, o) => e.children === o.children && e.className === o.className
367
367
  );
368
- function xe({
368
+ function be({
369
369
  children: e,
370
370
  messageType: o,
371
371
  messageId: t
@@ -379,20 +379,20 @@ function xe({
379
379
  remarkPlugins: [vt],
380
380
  rehypePlugins: [xt],
381
381
  components: {
382
- a: ({ children: s, ...i }) => /* @__PURE__ */ r("a", { target: i.target || n || "_top", ...i, children: s })
382
+ a: ({ children: s, ...a }) => /* @__PURE__ */ r("a", { target: a.target || n || "_top", ...a, children: s })
383
383
  },
384
384
  children: e
385
385
  }
386
386
  );
387
387
  }
388
- function me({
388
+ function ge({
389
389
  data: e,
390
390
  id: o,
391
391
  type: t,
392
392
  attachments: n,
393
393
  isFirstInGroup: s,
394
- isLastInGroup: i,
395
- isAloneInGroup: a,
394
+ isLastInGroup: a,
395
+ isAloneInGroup: i,
396
396
  dataComponentNames: c,
397
397
  classNames: l
398
398
  }) {
@@ -413,8 +413,8 @@ function me({
413
413
  {
414
414
  ...g((c == null ? void 0 : c.message) ?? "chat/agent_msg/msg"),
415
415
  "data-first": s,
416
- "data-last": i,
417
- "data-alone": a,
416
+ "data-last": a,
417
+ "data-alone": i,
418
418
  "data-variant": b,
419
419
  className: p(
420
420
  "transition-all",
@@ -426,12 +426,12 @@ function me({
426
426
  // Adding "whitespace-pre-wrap" will result in unnecessarily huge line breaks
427
427
  b === "error" && "bg-destructive/15 text-destructive",
428
428
  // We're using the booleans directly here, not the data attributes, to make any external styling more specific than this
429
- s && !a && "rounded-bl-md",
430
- i && !a && "rounded-tl-md",
431
- !s && !i && !a && "rounded-l-md",
429
+ s && !i && "rounded-bl-md",
430
+ a && !i && "rounded-tl-md",
431
+ !s && !a && !i && "rounded-l-md",
432
432
  l == null ? void 0 : l.message
433
433
  ),
434
- children: /* @__PURE__ */ r(xe, { messageType: t, messageId: o, children: h })
434
+ children: /* @__PURE__ */ r(be, { messageType: t, messageId: o, children: h })
435
435
  }
436
436
  )
437
437
  ]
@@ -441,7 +441,7 @@ function me({
441
441
  function $r(e) {
442
442
  return /* @__PURE__ */ r("div", { className: "w-full max-w-full overflow-auto shrink-0", children: /* @__PURE__ */ r("pre", { className: "text-xs leading-tight whitespace-pre-wrap break-word", children: JSON.stringify(e, null, 1) }) });
443
443
  }
444
- const be = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
444
+ const ye = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
445
445
  Q.Root,
446
446
  {
447
447
  ref: t,
@@ -453,8 +453,8 @@ const be = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
453
453
  ...o
454
454
  }
455
455
  ));
456
- be.displayName = Q.Root.displayName;
457
- const ye = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
456
+ ye.displayName = Q.Root.displayName;
457
+ const ke = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
458
458
  Q.Image,
459
459
  {
460
460
  ref: t,
@@ -462,8 +462,8 @@ const ye = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
462
462
  ...o
463
463
  }
464
464
  ));
465
- ye.displayName = Q.Image.displayName;
466
- const ke = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
465
+ ke.displayName = Q.Image.displayName;
466
+ const Ce = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
467
467
  Q.Fallback,
468
468
  {
469
469
  ref: t,
@@ -474,15 +474,15 @@ const ke = G.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
474
474
  ...o
475
475
  }
476
476
  ));
477
- ke.displayName = Q.Fallback.displayName;
478
- function ge({
477
+ Ce.displayName = Q.Fallback.displayName;
478
+ function we({
479
479
  agent: e,
480
480
  ...o
481
481
  }) {
482
482
  var t, n;
483
- return /* @__PURE__ */ d(be, { ...o, children: [
484
- /* @__PURE__ */ r(ye, { src: (e == null ? void 0 : e.avatar) ?? "", alt: "Agent Icon" }),
485
- (e == null ? void 0 : e.name) && /* @__PURE__ */ r(ke, { children: (n = (t = e == null ? void 0 : e.name) == null ? void 0 : t.slice(0, 1)) == null ? void 0 : n.toUpperCase() })
483
+ return /* @__PURE__ */ d(ye, { ...o, children: [
484
+ /* @__PURE__ */ r(ke, { src: (e == null ? void 0 : e.avatar) ?? "", alt: "Agent Icon" }),
485
+ (e == null ? void 0 : e.name) && /* @__PURE__ */ r(Ce, { children: (n = (t = e == null ? void 0 : e.name) == null ? void 0 : t.slice(0, 1)) == null ? void 0 : n.toUpperCase() })
486
486
  ] });
487
487
  }
488
488
  function Lr({ agent: e }) {
@@ -492,7 +492,7 @@ function Lr({ agent: e }) {
492
492
  ...g("chat/bot_loading/root"),
493
493
  className: "flex flex-row items-end w-full gap-2 animate-pulse",
494
494
  children: [
495
- /* @__PURE__ */ r(ge, { agent: e }),
495
+ /* @__PURE__ */ r(we, { agent: e }),
496
496
  /* @__PURE__ */ d(
497
497
  "div",
498
498
  {
@@ -558,13 +558,13 @@ function A() {
558
558
  };
559
559
  }, []), { isSmallScreen: e };
560
560
  }
561
- const se = {
561
+ const ie = {
562
562
  transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
563
563
  transitionDuration: "1000ms"
564
564
  };
565
565
  function X() {
566
- var w, m, C, u, y, I, S, M, F, H, W, E, v, z, N, L, ne, _e, Ie, Te, Me, De, Re, je, Ee, Oe, Pe, Ae, Fe, He, We, Be, $e, Le, Ye, qe, Xe, Ue, Ve, Ge, Ke, Qe, Ze, Je, et, tt, rt;
567
- const { dir: e } = fe(), { isSmallScreen: o } = A(), { theme: t, inline: n } = x(), s = (Y) => n ? "100%" : Y, i = (Y, pe) => o ? `100dv${Y}` : pe, a = (Y, pe) => s(i(Y, pe)), c = {
566
+ var w, m, C, u, y, I, S, M, H, F, W, E, v, z, N, L, se, _e, Ie, Te, Me, De, Re, je, Ee, Oe, Pe, Ae, He, Fe, We, Be, $e, Le, Ye, qe, Xe, Ue, Ve, Ge, Ke, Qe, Ze, Je, et, tt, rt;
567
+ const { dir: e } = ve(), { isSmallScreen: o } = A(), { theme: t, inline: n } = x(), s = (Y) => n ? "100%" : Y, a = (Y, he) => o ? `100dv${Y}` : he, i = (Y, he) => s(a(Y, he)), c = {
568
568
  zIndex: ((w = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : w.zIndex) ?? 1e7,
569
569
  offset: {
570
570
  bottom: ((C = (m = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : m.offset) == null ? void 0 : C.bottom) ?? 20,
@@ -572,8 +572,8 @@ function X() {
572
572
  left: ((S = (I = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : I.offset) == null ? void 0 : S.left) ?? (e === "rtl" ? 20 : "initial")
573
573
  },
574
574
  size: {
575
- button: ((F = (M = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : M.size) == null ? void 0 : F.button) ?? 48,
576
- icon: ((W = (H = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : H.size) == null ? void 0 : W.icon) ?? 24
575
+ button: ((H = (M = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : M.size) == null ? void 0 : H.button) ?? 48,
576
+ icon: ((W = (F = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : F.size) == null ? void 0 : W.icon) ?? 24
577
577
  }
578
578
  }, l = (() => {
579
579
  const Y = e === "ltr" ? c.offset.right : c.offset.left;
@@ -589,9 +589,9 @@ function X() {
589
589
  // was: '1px solid'
590
590
  outlineColor: ((N = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : N.outlineColor) ?? "hsl(0 0% 50% / .5)",
591
591
  boxShadow: ((L = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : L.boxShadow) ?? "0 0px 100px 0px rgb(0 0 0 / 0.25)",
592
- transitionProperty: ((ne = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : ne.transitionProperty) ?? "all",
593
- transitionTimingFunction: ((_e = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : _e.transitionTimingFunction) ?? se.transitionTimingFunction,
594
- transitionDuration: ((Ie = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Ie.transitionDuration) ?? se.transitionDuration,
592
+ transitionProperty: ((se = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : se.transitionProperty) ?? "all",
593
+ transitionTimingFunction: ((_e = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : _e.transitionTimingFunction) ?? ie.transitionTimingFunction,
594
+ transitionDuration: ((Ie = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Ie.transitionDuration) ?? ie.transitionDuration,
595
595
  offset: {
596
596
  side: o ? 0 : c.offset.bottom + c.size.button + V.y * 2 + (((Me = (Te = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Te.offset) == null ? void 0 : Me.side) ?? 10),
597
597
  align: o ? 0 : l + (((Re = (De = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : De.offset) == null ? void 0 : Re.align) ?? 0)
@@ -599,31 +599,31 @@ function X() {
599
599
  },
600
600
  screens: {
601
601
  welcome: {
602
- width: a("w", ((Ee = (je = t == null ? void 0 : t.screens) == null ? void 0 : je.welcome) == null ? void 0 : Ee.width) ?? "400px"),
602
+ width: i("w", ((Ee = (je = t == null ? void 0 : t.screens) == null ? void 0 : je.welcome) == null ? void 0 : Ee.width) ?? "400px"),
603
603
  // By setting minHeight to 1px, a nice animation will play from 1px to the dynamic height of the content of the screen
604
- minHeight: a(
604
+ minHeight: i(
605
605
  "h",
606
606
  ((Pe = (Oe = t == null ? void 0 : t.screens) == null ? void 0 : Oe.welcome) == null ? void 0 : Pe.minHeight) ?? "1px"
607
607
  )
608
608
  },
609
609
  sessions: {
610
- width: a("w", ((Fe = (Ae = t == null ? void 0 : t.screens) == null ? void 0 : Ae.sessions) == null ? void 0 : Fe.width) ?? "450px"),
611
- height: a("h", ((We = (He = t == null ? void 0 : t.screens) == null ? void 0 : He.sessions) == null ? void 0 : We.height) ?? "600px")
610
+ width: i("w", ((He = (Ae = t == null ? void 0 : t.screens) == null ? void 0 : Ae.sessions) == null ? void 0 : He.width) ?? "450px"),
611
+ height: i("h", ((We = (Fe = t == null ? void 0 : t.screens) == null ? void 0 : Fe.sessions) == null ? void 0 : We.height) ?? "600px")
612
612
  },
613
613
  chat: {
614
- width: a("w", (($e = (Be = t == null ? void 0 : t.screens) == null ? void 0 : Be.chat) == null ? void 0 : $e.width) ?? "525px"),
615
- height: a("h", ((Ye = (Le = t == null ? void 0 : t.screens) == null ? void 0 : Le.chat) == null ? void 0 : Ye.height) ?? "700px"),
614
+ width: i("w", (($e = (Be = t == null ? void 0 : t.screens) == null ? void 0 : Be.chat) == null ? void 0 : $e.width) ?? "525px"),
615
+ height: i("h", ((Ye = (Le = t == null ? void 0 : t.screens) == null ? void 0 : Le.chat) == null ? void 0 : Ye.height) ?? "700px"),
616
616
  withCanvas: {
617
- width: a(
617
+ width: i(
618
618
  "w",
619
619
  ((Ue = (Xe = (qe = t == null ? void 0 : t.screens) == null ? void 0 : qe.chat) == null ? void 0 : Xe.withCanvas) == null ? void 0 : Ue.width) ?? "min(1050px, 100vw)"
620
620
  ),
621
- height: a(
621
+ height: i(
622
622
  "h",
623
623
  ((Ke = (Ge = (Ve = t == null ? void 0 : t.screens) == null ? void 0 : Ve.chat) == null ? void 0 : Ge.withCanvas) == null ? void 0 : Ke.height) ?? "min(800px, 100vh)"
624
624
  ),
625
- transitionTimingFunction: ((Je = (Ze = (Qe = t == null ? void 0 : t.screens) == null ? void 0 : Qe.chat) == null ? void 0 : Ze.withCanvas) == null ? void 0 : Je.transitionTimingFunction) ?? se.transitionTimingFunction,
626
- transitionDuration: ((rt = (tt = (et = t == null ? void 0 : t.screens) == null ? void 0 : et.chat) == null ? void 0 : tt.withCanvas) == null ? void 0 : rt.transitionDuration) ?? se.transitionDuration
625
+ transitionTimingFunction: ((Je = (Ze = (Qe = t == null ? void 0 : t.screens) == null ? void 0 : Qe.chat) == null ? void 0 : Ze.withCanvas) == null ? void 0 : Je.transitionTimingFunction) ?? ie.transitionTimingFunction,
626
+ transitionDuration: ((rt = (tt = (et = t == null ? void 0 : t.screens) == null ? void 0 : et.chat) == null ? void 0 : tt.withCanvas) == null ? void 0 : rt.transitionDuration) ?? ie.transitionDuration
627
627
  }
628
628
  }
629
629
  }
@@ -631,7 +631,7 @@ function X() {
631
631
  // Subtract the offset.bottom twice so that it adds a bit of padding to the top
632
632
  // Subtract the distance between the trigger and the widget content container
633
633
  // Subtract the invisible padding of the trigger (for the wobble effect)
634
- maxHeight: a(
634
+ maxHeight: i(
635
635
  "h",
636
636
  `calc(
637
637
  100vh
@@ -641,14 +641,14 @@ function X() {
641
641
  )`
642
642
  ),
643
643
  // Subtract the offset.right twice so that it adds a bit of padding to the left
644
- maxWidth: a(
644
+ maxWidth: i(
645
645
  "w",
646
646
  `calc(
647
647
  100vw
648
648
  - ${l * 2}px
649
649
  )`
650
650
  ),
651
- minHeight: a(
651
+ minHeight: i(
652
652
  "h",
653
653
  `min(
654
654
  ${h.screens.welcome.minHeight},
@@ -656,7 +656,7 @@ function X() {
656
656
  ${h.screens.chat.height}
657
657
  )`
658
658
  ),
659
- minWidth: a(
659
+ minWidth: i(
660
660
  "w",
661
661
  `min(
662
662
  ${h.screens.welcome.width},
@@ -779,7 +779,7 @@ function Et() {
779
779
  }
780
780
  };
781
781
  }
782
- function Ce({
782
+ function ze({
783
783
  width: e,
784
784
  height: o
785
785
  }) {
@@ -824,7 +824,7 @@ function ee({
824
824
  case "SquareX":
825
825
  return tr;
826
826
  case "X":
827
- return ve;
827
+ return xe;
828
828
  case void 0:
829
829
  return it;
830
830
  default:
@@ -833,7 +833,7 @@ function ee({
833
833
  })();
834
834
  return /* @__PURE__ */ r(t, { className: p("size-4", o) });
835
835
  }
836
- function ze() {
836
+ function ne() {
837
837
  const {
838
838
  widgetCtx: { org: e }
839
839
  } = R(), {
@@ -844,21 +844,24 @@ function ze() {
844
844
  routerState: { screen: s }
845
845
  } = P();
846
846
  return {
847
- props: {
848
- react: q,
849
- org: e,
850
- session: o,
851
- config: t,
852
- messages: n,
853
- currentScreen: s
854
- }
847
+ react: q,
848
+ org: e,
849
+ session: o,
850
+ config: t,
851
+ messages: n,
852
+ currentScreen: s
855
853
  };
856
854
  }
857
855
  function Vr() {
858
856
  var t;
859
- const { props: e } = ze(), o = (t = e.config.specialComponents) == null ? void 0 : t.headerBottom;
857
+ const e = ne(), o = (t = e.config.customComponents) == null ? void 0 : t.headerBottom;
860
858
  return o ? /* @__PURE__ */ r(o, { ...e }) : null;
861
859
  }
860
+ function Gr({ fallback: e }) {
861
+ var n;
862
+ const o = ne(), t = (n = o.config.customComponents) == null ? void 0 : n.headerTitle;
863
+ return t ? /* @__PURE__ */ r(t, { ...o }) : e;
864
+ }
862
865
  function Ne() {
863
866
  const {
864
867
  widgetCtx: { org: e }
@@ -866,12 +869,12 @@ function Ne() {
866
869
  routerState: { screen: o }
867
870
  } = P(), { textContent: t } = x();
868
871
  return (() => {
869
- var s, i;
872
+ var s, a;
870
873
  switch (o) {
871
874
  case "chat":
872
875
  return (s = t == null ? void 0 : t.chatScreen) == null ? void 0 : s.headerTitle;
873
876
  case "sessions":
874
- return (i = t == null ? void 0 : t.sessionsScreen) == null ? void 0 : i.headerTitle;
877
+ return (a = t == null ? void 0 : t.sessionsScreen) == null ? void 0 : a.headerTitle;
875
878
  case "welcome":
876
879
  return;
877
880
  default:
@@ -880,7 +883,7 @@ function Ne() {
880
883
  }
881
884
  })() ?? e.name ?? "Chat";
882
885
  }
883
- function Gr(e) {
886
+ function Kr(e) {
884
887
  switch (e) {
885
888
  case "chat":
886
889
  return g("chat/header");
@@ -893,7 +896,7 @@ function Gr(e) {
893
896
  return;
894
897
  }
895
898
  }
896
- function Kr() {
899
+ function Qr() {
897
900
  const { router: e } = x(), {
898
901
  routerState: { screen: o },
899
902
  toSessionsScreen: t
@@ -909,7 +912,7 @@ function Kr() {
909
912
  }
910
913
  );
911
914
  }
912
- function Qr({
915
+ function Zr({
913
916
  button: e
914
917
  }) {
915
918
  const { setIsOpen: o } = K(), { isSmallScreen: t } = A();
@@ -927,35 +930,35 @@ function Qr({
927
930
  }
928
931
  );
929
932
  }
930
- function we({
933
+ function ue({
931
934
  button: e
932
935
  }) {
933
936
  const [o, t] = T(!1), {
934
937
  routerState: { screen: n }
935
- } = P(), { isSmallScreen: s } = A(), { theme: i } = X(), { setWidth: a, setHeight: c } = Et();
938
+ } = P(), { isSmallScreen: s } = A(), { theme: a } = X(), { setWidth: i, setHeight: c } = Et();
936
939
  if (n !== "chat" && n !== "sessions") return null;
937
940
  const l = (() => {
938
941
  switch (n) {
939
942
  case "chat":
940
- return i.screens.chat.height;
943
+ return a.screens.chat.height;
941
944
  case "sessions":
942
- return i.screens.sessions.height;
945
+ return a.screens.sessions.height;
943
946
  default:
944
- return D(n, we.name), i.screens.chat.height;
947
+ return D(n, ue.name), a.screens.chat.height;
945
948
  }
946
949
  })(), h = (() => {
947
950
  switch (n) {
948
951
  case "chat":
949
- return i.screens.chat.width;
952
+ return a.screens.chat.width;
950
953
  case "sessions":
951
- return i.screens.sessions.width;
954
+ return a.screens.sessions.width;
952
955
  default:
953
- return D(n, we.name), i.screens.chat.width;
956
+ return D(n, ue.name), a.screens.chat.width;
954
957
  }
955
958
  })(), b = () => {
956
959
  t((w) => {
957
960
  const m = !w;
958
- return c(m ? "100vh" : l), a(m ? `max(40vw, ${h})` : h), m;
961
+ return c(m ? "100vh" : l), i(m ? `max(40vw, ${h})` : h), m;
959
962
  });
960
963
  };
961
964
  return s && e.hideOnSmallScreen || !s && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
@@ -978,7 +981,7 @@ function Ot({
978
981
  button: e
979
982
  }) {
980
983
  var y, I;
981
- const { close: o } = de(), { widgetCtx: t } = R(), { setIsOpen: n } = K(), { resolveSession: s, sessionState: i } = $(), { isSmallScreen: a } = A(), c = !i.session, l = ((y = i.session) == null ? void 0 : y.isOpened) === !1, h = e.onResolved || "stay-in-chat", b = e.behaviorBeforeSessionCreation || "disabled", w = e.behaviorIfSessionIsResolved || "disabled", m = !!(i.isResolvingSession || c && b === "disabled" || l && w === "disabled"), C = async () => {
984
+ const { close: o } = pe(), { widgetCtx: t } = R(), { setIsOpen: n } = K(), { resolveSession: s, sessionState: a } = $(), { isSmallScreen: i } = A(), c = !a.session, l = ((y = a.session) == null ? void 0 : y.isOpened) === !1, h = e.onResolved || "stay-in-chat", b = e.behaviorBeforeSessionCreation || "disabled", w = e.behaviorIfSessionIsResolved || "disabled", m = !!(a.isResolvingSession || c && b === "disabled" || l && w === "disabled"), C = async () => {
982
985
  const { success: S, error: M } = await s();
983
986
  if (o(), !S) return console.error(M);
984
987
  switch (h) {
@@ -1033,7 +1036,7 @@ function Ot({
1033
1036
  );
1034
1037
  }
1035
1038
  };
1036
- return a && e.hideOnSmallScreen || !a && e.hideOnLargeScreen ? null : ((I = e.confirmation) == null ? void 0 : I.type) === "modal" && !l && !c ? /* @__PURE__ */ r(
1039
+ return i && e.hideOnSmallScreen || !i && e.hideOnLargeScreen ? null : ((I = e.confirmation) == null ? void 0 : I.type) === "modal" && !l && !c ? /* @__PURE__ */ r(
1037
1040
  It,
1038
1041
  {
1039
1042
  trigger: /* @__PURE__ */ r(
@@ -1055,7 +1058,7 @@ function Ot({
1055
1058
  {
1056
1059
  variant: "secondary",
1057
1060
  onClick: o,
1058
- disabled: i.isResolvingSession,
1061
+ disabled: a.isResolvingSession,
1059
1062
  children: e.confirmation.cancelButtonText || "No"
1060
1063
  }
1061
1064
  ),
@@ -1064,7 +1067,7 @@ function Ot({
1064
1067
  {
1065
1068
  variant: "destructive",
1066
1069
  onClick: C,
1067
- disabled: i.isResolvingSession,
1070
+ disabled: a.isResolvingSession,
1068
1071
  children: e.confirmation.confirmButtonText || "Yes"
1069
1072
  }
1070
1073
  )
@@ -1083,29 +1086,29 @@ function Ot({
1083
1086
  }
1084
1087
  );
1085
1088
  }
1086
- function ue({ button: e }) {
1089
+ function fe({ button: e }) {
1087
1090
  switch (e.functionality) {
1088
1091
  case "close-widget":
1089
- return /* @__PURE__ */ r(Qr, { button: e });
1092
+ return /* @__PURE__ */ r(Zr, { button: e });
1090
1093
  case "expand-shrink":
1091
- return /* @__PURE__ */ r(we, { button: e });
1094
+ return /* @__PURE__ */ r(ue, { button: e });
1092
1095
  case "resolve-session":
1093
1096
  return /* @__PURE__ */ r(Ot, { button: e });
1094
1097
  default:
1095
- return D(e, ue.name), null;
1098
+ return D(e, fe.name), null;
1096
1099
  }
1097
1100
  }
1098
- const Zr = {
1101
+ const Jr = {
1099
1102
  functionality: "close-widget",
1100
1103
  hideOnLargeScreen: !0,
1101
1104
  icon: "X"
1102
1105
  };
1103
- function Jr() {
1106
+ function eo() {
1104
1107
  const {
1105
1108
  routerState: { screen: e }
1106
1109
  } = P(), { headerButtons: o } = x(), t = e === "chat" ? o == null ? void 0 : o.chatScreen : e === "sessions" ? o == null ? void 0 : o.sessionsScreen : [];
1107
- return !t || t.length === 0 ? /* @__PURE__ */ r(ue, { button: Zr }) : /* @__PURE__ */ r(te, { children: t.map((n) => /* @__PURE__ */ r(
1108
- ue,
1110
+ return !t || t.length === 0 ? /* @__PURE__ */ r(fe, { button: Jr }) : /* @__PURE__ */ r(te, { children: t.map((n) => /* @__PURE__ */ r(
1111
+ fe,
1109
1112
  {
1110
1113
  button: n
1111
1114
  },
@@ -1115,10 +1118,10 @@ function Jr() {
1115
1118
  function Pt() {
1116
1119
  const {
1117
1120
  routerState: { screen: e }
1118
- } = P(), o = Gr(e), t = Ne();
1121
+ } = P(), o = Kr(e), t = Ne();
1119
1122
  return /* @__PURE__ */ d("header", { ...o, className: "py-2 px-4 shrink-0", children: [
1120
1123
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1121
- /* @__PURE__ */ r(Kr, {}),
1124
+ /* @__PURE__ */ r(Qr, {}),
1122
1125
  /* @__PURE__ */ r(
1123
1126
  "div",
1124
1127
  {
@@ -1126,10 +1129,15 @@ function Pt() {
1126
1129
  "flex-1 h-8 flex items-center",
1127
1130
  e === "sessions" && "ps-2"
1128
1131
  ),
1129
- children: /* @__PURE__ */ r("h2", { className: "font-semibold", children: t })
1132
+ children: /* @__PURE__ */ r(
1133
+ Gr,
1134
+ {
1135
+ fallback: /* @__PURE__ */ r("h2", { className: "font-semibold", children: t })
1136
+ }
1137
+ )
1130
1138
  }
1131
1139
  ),
1132
- /* @__PURE__ */ r(Jr, {})
1140
+ /* @__PURE__ */ r(eo, {})
1133
1141
  ] }),
1134
1142
  /* @__PURE__ */ r(Vr, {})
1135
1143
  ] });
@@ -1137,7 +1145,7 @@ function Pt() {
1137
1145
  function At({ className: e }) {
1138
1146
  return /* @__PURE__ */ r(wr, { className: p("size-4 animate-spin", e) });
1139
1147
  }
1140
- function eo() {
1148
+ function to() {
1141
1149
  const {
1142
1150
  messagesState: { isInitialFetchLoading: e }
1143
1151
  } = j(), { isSmallScreen: o } = A(), { activeMode: t, Component: n } = mt();
@@ -1145,24 +1153,24 @@ function eo() {
1145
1153
  isCanvasOpen: !e && !o && !!t && !!n
1146
1154
  };
1147
1155
  }
1148
- function to() {
1149
- const { activeMode: e, Component: o } = mt(), { sendMessage: t } = j(), { createStateCheckpoint: n } = $(), [s, i] = T(!1), a = async (c) => {
1156
+ function ro() {
1157
+ const e = ne(), { activeMode: o, Component: t } = mt(), { sendMessage: n } = j(), { createStateCheckpoint: s } = $(), [a, i] = T(!1), c = async (l) => {
1150
1158
  try {
1151
- i(!0), await t(c);
1152
- } catch (l) {
1153
- console.error(l);
1159
+ i(!0), await n(l);
1160
+ } catch (h) {
1161
+ console.error(h);
1154
1162
  } finally {
1155
1163
  i(!1);
1156
1164
  }
1157
1165
  };
1158
- return !e || !o ? null : /* @__PURE__ */ r(
1159
- o,
1166
+ return !o || !t ? null : /* @__PURE__ */ r(
1167
+ t,
1160
1168
  {
1161
- react: q,
1162
- mode: e,
1163
- createStateCheckpoint: n,
1164
- sendMessage: a,
1165
- isSendingMessage: s
1169
+ ...e,
1170
+ mode: o,
1171
+ createStateCheckpoint: s,
1172
+ sendMessage: c,
1173
+ isSendingMessage: a
1166
1174
  }
1167
1175
  );
1168
1176
  }
@@ -1185,7 +1193,7 @@ const O = q.forwardRef(
1185
1193
  }
1186
1194
  );
1187
1195
  O.displayName = "MotionDiv__VerticalReveal";
1188
- const ro = [
1196
+ const oo = [
1189
1197
  {
1190
1198
  label: "Terrible",
1191
1199
  value: 1,
@@ -1212,23 +1220,23 @@ const ro = [
1212
1220
  emoji: "😍"
1213
1221
  }
1214
1222
  ];
1215
- function oo() {
1223
+ function no() {
1216
1224
  const { isSmallScreen: e } = A(), {
1217
1225
  submitCsat: o,
1218
1226
  isCsatRequested: t,
1219
1227
  isCsatSubmitted: n,
1220
1228
  submittedScore: s,
1221
- submittedFeedback: i
1222
- } = gt(), [a, c] = T(null), [l, h] = T(null), b = (m) => {
1229
+ submittedFeedback: a
1230
+ } = gt(), [i, c] = T(null), [l, h] = T(null), b = (m) => {
1223
1231
  c((C) => C === m ? null : m);
1224
1232
  }, w = () => {
1225
- a && o({
1226
- score: a,
1233
+ i && o({
1234
+ score: i,
1227
1235
  feedback: l || void 0
1228
1236
  });
1229
1237
  };
1230
1238
  return !t && !n ? null : /* @__PURE__ */ d("div", { className: "w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden", children: [
1231
- /* @__PURE__ */ r(_, { mode: "wait", children: t && !a ? /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: "How was your conversation?" }) }, "csat-requested-title") : n ? /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: "You rated the conversation as" }) }, "csat-submitted-title") : null }),
1239
+ /* @__PURE__ */ r(_, { mode: "wait", children: t && !i ? /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: "How was your conversation?" }) }, "csat-requested-title") : n ? /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: "You rated the conversation as" }) }, "csat-submitted-title") : null }),
1232
1240
  /* @__PURE__ */ r(
1233
1241
  "div",
1234
1242
  {
@@ -1237,18 +1245,18 @@ function oo() {
1237
1245
  "transition-all",
1238
1246
  n && "gap-0 justify-center"
1239
1247
  ),
1240
- children: ro.map((m) => /* @__PURE__ */ r(
1248
+ children: oo.map((m) => /* @__PURE__ */ r(
1241
1249
  k,
1242
1250
  {
1243
- variant: m.value === a ? "secondary" : "ghost",
1251
+ variant: m.value === i ? "secondary" : "ghost",
1244
1252
  size: "selfless",
1245
1253
  className: p(
1246
1254
  "transition-all overflow-hidden",
1247
1255
  "text-2xl size-8 rounded-full",
1248
1256
  "opacity-35",
1249
1257
  "hover:opacity-100",
1250
- !a && "opacity-100",
1251
- m.value === a && "opacity-100",
1258
+ !i && "opacity-100",
1259
+ m.value === i && "opacity-100",
1252
1260
  n && m.value !== s && "opacity-0 size-0",
1253
1261
  n && m.value === s && "opacity-100 size-fit text-4xl"
1254
1262
  ),
@@ -1259,7 +1267,7 @@ function oo() {
1259
1267
  ))
1260
1268
  }
1261
1269
  ),
1262
- /* @__PURE__ */ r(_, { mode: "wait", children: (a || s) && /* @__PURE__ */ r(O, { children: /* @__PURE__ */ d("div", { className: "pb-2 px-2 flex items-end", children: [
1270
+ /* @__PURE__ */ r(_, { mode: "wait", children: (i || s) && /* @__PURE__ */ r(O, { children: /* @__PURE__ */ d("div", { className: "pb-2 px-2 flex items-end", children: [
1263
1271
  /* @__PURE__ */ r(
1264
1272
  "textarea",
1265
1273
  {
@@ -1274,7 +1282,7 @@ function oo() {
1274
1282
  e ? "text-[16px]" : "text-sm",
1275
1283
  n && "text-center"
1276
1284
  ),
1277
- value: n ? i || "" : l || "",
1285
+ value: n ? a || "" : l || "",
1278
1286
  onChange: t ? (m) => h(m.target.value) : void 0,
1279
1287
  readOnly: n,
1280
1288
  placeholder: t ? "Tell us more... (optional)" : void 0
@@ -1285,7 +1293,7 @@ function oo() {
1285
1293
  {
1286
1294
  size: "fit",
1287
1295
  onClick: w,
1288
- disabled: !a,
1296
+ disabled: !i,
1289
1297
  className: p(
1290
1298
  "transition-all overflow-hidden",
1291
1299
  "rounded-full size-8 flex items-center justify-center p-0",
@@ -1299,7 +1307,7 @@ function oo() {
1299
1307
  ] });
1300
1308
  }
1301
1309
  function U() {
1302
- const { dir: e } = fe(), o = x();
1310
+ const { dir: e } = ve(), o = x();
1303
1311
  return ht(() => {
1304
1312
  const t = Tr(o.language) ? o.language : "en";
1305
1313
  return {
@@ -1316,8 +1324,8 @@ function Se({
1316
1324
  ...t
1317
1325
  }) {
1318
1326
  const { sendMessage: n } = j(), s = () => {
1319
- const i = e.trim();
1320
- i && n({ content: i });
1327
+ const a = e.trim();
1328
+ a && n({ content: a });
1321
1329
  };
1322
1330
  return /* @__PURE__ */ r(
1323
1331
  k,
@@ -1331,7 +1339,7 @@ function Se({
1331
1339
  }
1332
1340
  );
1333
1341
  }
1334
- function no() {
1342
+ function so() {
1335
1343
  const { t: e } = U(), o = [e("i_need_more_help"), e("this_was_helpful")];
1336
1344
  return /* @__PURE__ */ r(
1337
1345
  "div",
@@ -1351,21 +1359,21 @@ function no() {
1351
1359
  }
1352
1360
  function at() {
1353
1361
  const { sessionState: e } = $(), { chatFooterItems: o } = x(), t = !!e.session && !e.session.isOpened, n = !t;
1354
- return /* @__PURE__ */ r(_, { mode: "wait", children: o == null ? void 0 : o.map((s, i) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(xe, { children: s.message }) }) }, `${s.message}-${i}`)) });
1362
+ return /* @__PURE__ */ r(_, { mode: "wait", children: o == null ? void 0 : o.map((s, a) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(be, { children: s.message }) }) }, `${s.message}-${a}`)) });
1355
1363
  }
1356
- function so({
1364
+ function io({
1357
1365
  file: { status: e, file: o, error: t },
1358
1366
  onCancel: n
1359
1367
  }) {
1360
- const [s, i] = T(
1368
+ const [s, a] = T(
1361
1369
  null
1362
1370
  );
1363
1371
  re(() => {
1364
1372
  if (!o.type.startsWith("image/")) return;
1365
1373
  const l = new FileReader();
1366
- return l.onload = () => i(l.result), l.onerror = () => console.error("Error reading file"), l.readAsDataURL(o), () => l.abort();
1374
+ return l.onload = () => a(l.result), l.onerror = () => console.error("Error reading file"), l.readAsDataURL(o), () => l.abort();
1367
1375
  }, [o]);
1368
- const a = () => {
1376
+ const i = () => {
1369
1377
  switch (e) {
1370
1378
  case "uploading":
1371
1379
  return /* @__PURE__ */ r(br, { className: "size-4 animate-spin" });
@@ -1403,7 +1411,7 @@ function so({
1403
1411
  "flex items-center justify-center shrink-0"
1404
1412
  ),
1405
1413
  children: [
1406
- /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center", children: a() }),
1414
+ /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center", children: i() }),
1407
1415
  /* @__PURE__ */ r(
1408
1416
  "button",
1409
1417
  {
@@ -1414,7 +1422,7 @@ function so({
1414
1422
  "opacity-0 group-hover:opacity-100 transition"
1415
1423
  ),
1416
1424
  onClick: n,
1417
- children: /* @__PURE__ */ r(ve, { className: "size-4 text-primary-foreground" })
1425
+ children: /* @__PURE__ */ r(xe, { className: "size-4 text-primary-foreground" })
1418
1426
  }
1419
1427
  ),
1420
1428
  /* @__PURE__ */ r(c, {})
@@ -1424,9 +1432,9 @@ function so({
1424
1432
  }
1425
1433
  );
1426
1434
  }
1427
- function io() {
1435
+ function ao() {
1428
1436
  var E;
1429
- const { isSmallScreen: e } = A(), o = ce(null), { sendMessage: t } = j(), { sessionState: n } = $(), { t: s } = U(), [i, a] = T(""), {
1437
+ const { isSmallScreen: e } = A(), o = de(null), { sendMessage: t } = j(), { sessionState: n } = $(), { t: s } = U(), [a, i] = T(""), {
1430
1438
  allFiles: c,
1431
1439
  emptyTheFiles: l,
1432
1440
  handleCancelUpload: h,
@@ -1435,10 +1443,10 @@ function io() {
1435
1443
  successFiles: m
1436
1444
  } = qt(), C = !!((E = n.session) != null && E.isHandedOff), { isAwaitingBotReply: u } = wt(), y = (v) => {
1437
1445
  b(v);
1438
- }, I = !i.trim() && m.length === 0, S = async () => {
1446
+ }, I = !a.trim() && m.length === 0, S = async () => {
1439
1447
  if (u || I) return;
1440
1448
  w && console.info("please wait for the file(s) to upload");
1441
- const v = i.trim();
1449
+ const v = a.trim();
1442
1450
  t({
1443
1451
  content: v,
1444
1452
  attachments: m.flatMap(
@@ -1452,11 +1460,11 @@ function io() {
1452
1460
  }
1453
1461
  ] : []
1454
1462
  )
1455
- }), a(""), l();
1463
+ }), i(""), l();
1456
1464
  }, {
1457
1465
  getRootProps: M,
1458
- getInputProps: F,
1459
- open: H
1466
+ getInputProps: H,
1467
+ open: F
1460
1468
  } = Dr({
1461
1469
  onDrop: y,
1462
1470
  noClick: !0,
@@ -1485,7 +1493,7 @@ function io() {
1485
1493
  className: "p-2 relative space-y-1",
1486
1494
  ...M(),
1487
1495
  children: [
1488
- /* @__PURE__ */ r("input", { ...F() }),
1496
+ /* @__PURE__ */ r("input", { ...H() }),
1489
1497
  /* @__PURE__ */ d(
1490
1498
  "div",
1491
1499
  {
@@ -1510,7 +1518,7 @@ function io() {
1510
1518
  ...g("chat/input_box/attachments_container"),
1511
1519
  className: "flex items-center gap-1",
1512
1520
  children: /* @__PURE__ */ r(_, { mode: "popLayout", children: c.map((v) => /* @__PURE__ */ r(f, { snapExit: !0, children: /* @__PURE__ */ r(
1513
- so,
1521
+ io,
1514
1522
  {
1515
1523
  onCancel: () => h(v.id),
1516
1524
  file: v
@@ -1525,7 +1533,7 @@ function io() {
1525
1533
  onPaste: W,
1526
1534
  ref: o,
1527
1535
  id: "chat-input",
1528
- value: i,
1536
+ value: a,
1529
1537
  rows: 3,
1530
1538
  className: p(
1531
1539
  /** Match the border radius of the container */
@@ -1538,7 +1546,7 @@ function io() {
1538
1546
  // 16px on mobiles prevents auto-zoom on the input when focused
1539
1547
  e ? "text-[16px]" : "text-sm"
1540
1548
  ),
1541
- onChange: (v) => a(v.target.value),
1549
+ onChange: (v) => i(v.target.value),
1542
1550
  onKeyDown: async (v) => {
1543
1551
  v.key === "Enter" && !v.shiftKey && (v.preventDefault(), S());
1544
1552
  },
@@ -1558,7 +1566,7 @@ function io() {
1558
1566
  children: /* @__PURE__ */ r(
1559
1567
  k,
1560
1568
  {
1561
- onClick: H,
1569
+ onClick: F,
1562
1570
  size: "fit",
1563
1571
  variant: "ghost",
1564
1572
  className: p(
@@ -1591,10 +1599,10 @@ function lt() {
1591
1599
  const { widgetCtx: e } = R(), { router: o } = x(), { canCreateNewSession: t } = $(), { toSessionsScreen: n } = P(), { t: s } = U();
1592
1600
  return /* @__PURE__ */ r(te, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(k, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(k, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
1593
1601
  }
1594
- function ao() {
1602
+ function lo() {
1595
1603
  const { t: e } = U(), { isCsatRequested: o, isCsatSubmitted: t } = gt();
1596
1604
  return /* @__PURE__ */ r("div", { className: "p-2", children: /* @__PURE__ */ r("div", { className: "p-2 bg-muted rounded-3xl", children: /* @__PURE__ */ r(_, { mode: "wait", children: o || t ? /* @__PURE__ */ d(O, { children: [
1597
- /* @__PURE__ */ r(oo, {}),
1605
+ /* @__PURE__ */ r(no, {}),
1598
1606
  /* @__PURE__ */ r(_, { mode: "wait", children: t && /* @__PURE__ */ r(O, { children: /* @__PURE__ */ r(lt, {}) }, "new-conv-or-back-to-convs-button") })
1599
1607
  ] }, "csat") : /* @__PURE__ */ d(O, { children: [
1600
1608
  /* @__PURE__ */ d("div", { className: "ps-2 flex items-center gap-1 pb-2", children: [
@@ -1604,26 +1612,26 @@ function ao() {
1604
1612
  /* @__PURE__ */ r(lt, {})
1605
1613
  ] }, "session-closed") }) }) });
1606
1614
  }
1607
- function lo() {
1608
- var a;
1609
- const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = x(), { sessionState: n } = $(), { messagesState: s } = j(), i = s.messages.length === 0;
1610
- return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(_, { mode: "wait", children: n.session && !((a = n.session) != null && a.isOpened) ? /* @__PURE__ */ d(O, { children: [
1611
- /* @__PURE__ */ r(ao, {}),
1615
+ function co() {
1616
+ var i;
1617
+ const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = x(), { sessionState: n } = $(), { messagesState: s } = j(), a = s.messages.length === 0;
1618
+ return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(_, { mode: "wait", children: n.session && !((i = n.session) != null && i.isOpened) ? /* @__PURE__ */ d(O, { children: [
1619
+ /* @__PURE__ */ r(lo, {}),
1612
1620
  /* @__PURE__ */ r(at, {})
1613
1621
  ] }, "session-closed") : /* @__PURE__ */ d(O, { children: [
1614
- s.lastAIResMightSolveUserIssue && (t == null ? void 0 : t.enabled) !== !1 && /* @__PURE__ */ r(no, {}),
1615
- i && e && o !== "below-initial-messages" && /* @__PURE__ */ r("div", { className: "flex items-center flex-row justify-end gap-2 flex-wrap px-2", children: e == null ? void 0 : e.map((c, l) => /* @__PURE__ */ r(
1622
+ s.lastAIResMightSolveUserIssue && (t == null ? void 0 : t.enabled) !== !1 && /* @__PURE__ */ r(so, {}),
1623
+ a && e && o !== "below-initial-messages" && /* @__PURE__ */ r("div", { className: "flex items-center flex-row justify-end gap-2 flex-wrap px-2", children: e == null ? void 0 : e.map((c, l) => /* @__PURE__ */ r(
1616
1624
  Se,
1617
1625
  {
1618
1626
  suggestion: c
1619
1627
  },
1620
1628
  `${c}-${l}`
1621
1629
  )) }),
1622
- /* @__PURE__ */ r(io, {}),
1630
+ /* @__PURE__ */ r(ao, {}),
1623
1631
  /* @__PURE__ */ r(at, {})
1624
1632
  ] }, "chat-input") }) });
1625
1633
  }
1626
- function co({
1634
+ function po({
1627
1635
  isFirstInGroup: e,
1628
1636
  isLastInGroup: o,
1629
1637
  isAloneInGroup: t,
@@ -1632,10 +1640,10 @@ function co({
1632
1640
  const { componentStore: s } = R();
1633
1641
  if (n.type !== "AGENT" && n.type !== "AI") return null;
1634
1642
  if (n.data.action) {
1635
- const a = s.getComponent(n.data.action.name);
1636
- if (a)
1643
+ const i = s.getComponent(n.data.action.name);
1644
+ if (i)
1637
1645
  return /* @__PURE__ */ r(
1638
- a,
1646
+ i,
1639
1647
  {
1640
1648
  ...n,
1641
1649
  id: n.id,
@@ -1645,9 +1653,9 @@ function co({
1645
1653
  }
1646
1654
  );
1647
1655
  }
1648
- const i = s.getComponent(n.component);
1649
- return i ? /* @__PURE__ */ r(
1650
- i,
1656
+ const a = s.getComponent(n.component);
1657
+ return a ? /* @__PURE__ */ r(
1658
+ a,
1651
1659
  {
1652
1660
  ...n,
1653
1661
  id: n.id,
@@ -1656,7 +1664,7 @@ function co({
1656
1664
  isAloneInGroup: t
1657
1665
  }
1658
1666
  ) : /* @__PURE__ */ r(
1659
- me,
1667
+ ge,
1660
1668
  {
1661
1669
  ...n,
1662
1670
  isFirstInGroup: e,
@@ -1665,18 +1673,18 @@ function co({
1665
1673
  }
1666
1674
  );
1667
1675
  }
1668
- function Ft({
1676
+ function Ht({
1669
1677
  messages: e,
1670
1678
  className: o,
1671
1679
  containerClassName: t
1672
1680
  }) {
1673
- var a, c;
1681
+ var i, c;
1674
1682
  const { timestamps: n } = x();
1675
- if (!((a = n == null ? void 0 : n.perMessageGroup) != null && a.enabled))
1683
+ if (!((i = n == null ? void 0 : n.perMessageGroup) != null && i.enabled))
1676
1684
  return null;
1677
1685
  const s = (c = e[e.length - 1]) == null ? void 0 : c.timestamp;
1678
1686
  if (!s) return null;
1679
- const i = (() => {
1687
+ const a = (() => {
1680
1688
  try {
1681
1689
  return new Date(s).toLocaleTimeString([], {
1682
1690
  hour: "2-digit",
@@ -1687,9 +1695,9 @@ function Ft({
1687
1695
  return console.error(l), null;
1688
1696
  }
1689
1697
  })();
1690
- return i ? /* @__PURE__ */ r("div", { className: t, children: /* @__PURE__ */ r("span", { className: p("text-xs text-muted-foreground", o), children: i }) }) : null;
1698
+ return a ? /* @__PURE__ */ r("div", { className: t, children: /* @__PURE__ */ r("span", { className: p("text-xs text-muted-foreground", o), children: a }) }) : null;
1691
1699
  }
1692
- function ae({
1700
+ function le({
1693
1701
  messages: e,
1694
1702
  agent: o,
1695
1703
  suggestedReplies: t
@@ -1701,7 +1709,7 @@ function ae({
1701
1709
  className: p("flex items-end gap-2"),
1702
1710
  children: [
1703
1711
  /* @__PURE__ */ r(J, { content: o == null ? void 0 : o.name, side: "right", align: "end", children: /* @__PURE__ */ r(
1704
- ge,
1712
+ we,
1705
1713
  {
1706
1714
  ...g("chat/agent_msg_group/root/avatar"),
1707
1715
  agent: o,
@@ -1716,7 +1724,7 @@ function ae({
1716
1724
  className: p("flex items-end gap-2"),
1717
1725
  children: [
1718
1726
  /* @__PURE__ */ r(J, { content: o == null ? void 0 : o.name, side: "right", align: "end", children: /* @__PURE__ */ r(
1719
- ge,
1727
+ we,
1720
1728
  {
1721
1729
  ...g("chat/agent_msg_group/avatar_and_msgs/avatar"),
1722
1730
  agent: o
@@ -1728,17 +1736,17 @@ function ae({
1728
1736
  ...g("chat/agent_msg_group/avatar_and_msgs/msgs"),
1729
1737
  className: p("flex-1 flex flex-col gap-1"),
1730
1738
  children: [
1731
- e.map((n, s, i) => /* @__PURE__ */ r(
1732
- co,
1739
+ e.map((n, s, a) => /* @__PURE__ */ r(
1740
+ po,
1733
1741
  {
1734
1742
  isFirstInGroup: s === 0,
1735
- isLastInGroup: s === i.length - 1,
1736
- isAloneInGroup: i.length === 1,
1743
+ isLastInGroup: s === a.length - 1,
1744
+ isAloneInGroup: a.length === 1,
1737
1745
  ...n
1738
1746
  },
1739
1747
  n.id
1740
1748
  )),
1741
- /* @__PURE__ */ r(Ft, { messages: e })
1749
+ /* @__PURE__ */ r(Ht, { messages: e })
1742
1750
  ]
1743
1751
  }
1744
1752
  )
@@ -1764,14 +1772,14 @@ function ae({
1764
1772
  }
1765
1773
  );
1766
1774
  }
1767
- function po() {
1775
+ function ho() {
1768
1776
  var t, n;
1769
- const { props: e } = ze();
1777
+ const e = ne();
1770
1778
  if ((t = e.session) != null && t.isOpened || !e.session) return null;
1771
- const o = (n = e.config.specialComponents) == null ? void 0 : n.onSessionResolved;
1779
+ const o = (n = e.config.customComponents) == null ? void 0 : n.onSessionResolved;
1772
1780
  return o ? /* @__PURE__ */ r(o, { ...e }) : null;
1773
1781
  }
1774
- function ho({
1782
+ function mo({
1775
1783
  message: e,
1776
1784
  isFirstInGroup: o,
1777
1785
  isLastInGroup: t,
@@ -1784,7 +1792,7 @@ function ho({
1784
1792
  ...g("chat/user_msg/root"),
1785
1793
  className: "w-5/6 flex flex-col items-end gap-1",
1786
1794
  children: [
1787
- e.attachments && e.attachments.length > 0 && /* @__PURE__ */ r("div", { className: "w-full flex gap-1 flex-wrap justify-end", children: (s = e.attachments) == null ? void 0 : s.map((i) => /* @__PURE__ */ r(Tt, { attachment: i }, i.id)) }),
1795
+ e.attachments && e.attachments.length > 0 && /* @__PURE__ */ r("div", { className: "w-full flex gap-1 flex-wrap justify-end", children: (s = e.attachments) == null ? void 0 : s.map((a) => /* @__PURE__ */ r(Tt, { attachment: a }, a.id)) }),
1788
1796
  e.content.length > 0 && /* @__PURE__ */ r(
1789
1797
  "div",
1790
1798
  {
@@ -1811,7 +1819,7 @@ function ho({
1811
1819
  }
1812
1820
  );
1813
1821
  }
1814
- function mo({
1822
+ function go({
1815
1823
  messages: e
1816
1824
  }) {
1817
1825
  return /* @__PURE__ */ d(
@@ -1821,7 +1829,7 @@ function mo({
1821
1829
  className: p("group", "flex flex-col gap-1 justify-end items-end"),
1822
1830
  children: [
1823
1831
  e.map((o, t, n) => /* @__PURE__ */ r(
1824
- ho,
1832
+ mo,
1825
1833
  {
1826
1834
  message: o,
1827
1835
  isFirstInGroup: t === 0,
@@ -1830,34 +1838,34 @@ function mo({
1830
1838
  },
1831
1839
  o.id
1832
1840
  )),
1833
- /* @__PURE__ */ r(Ft, { messages: e, containerClassName: "ms-auto" })
1841
+ /* @__PURE__ */ r(Ht, { messages: e, containerClassName: "ms-auto" })
1834
1842
  ]
1835
1843
  }
1836
1844
  );
1837
1845
  }
1838
- function go(e) {
1846
+ function wo(e) {
1839
1847
  const o = [];
1840
1848
  let t = null;
1841
1849
  return e.forEach((n) => {
1842
- var s, i, a, c, l, h;
1850
+ var s, a, i, c, l, h;
1843
1851
  // Start a new group if the type changes
1844
1852
  (((s = t == null ? void 0 : t[0]) == null ? void 0 : s.type) !== n.type || // Start a new group if the agent changes
1845
- ((i = t[0]) == null ? void 0 : i.type) === "AGENT" && n.type === "AGENT" && (((a = n.agent) == null ? void 0 : a.id) !== ((c = t[0].agent) == null ? void 0 : c.id) || ((l = n.agent) == null ? void 0 : l.name) !== ((h = t[0].agent) == null ? void 0 : h.name))) && (t = [], o.push(t)), t.push(n);
1853
+ ((a = t[0]) == null ? void 0 : a.type) === "AGENT" && n.type === "AGENT" && (((i = n.agent) == null ? void 0 : i.id) !== ((c = t[0].agent) == null ? void 0 : c.id) || ((l = n.agent) == null ? void 0 : l.name) !== ((h = t[0].agent) == null ? void 0 : h.name))) && (t = [], o.push(t)), t.push(n);
1846
1854
  }), o;
1847
1855
  }
1848
- function wo(e) {
1856
+ function uo(e) {
1849
1857
  var o;
1850
1858
  return ((o = e == null ? void 0 : e[0]) == null ? void 0 : o.type) === "USER";
1851
1859
  }
1852
- function uo(e) {
1860
+ function fo(e) {
1853
1861
  var o;
1854
1862
  return ((o = e == null ? void 0 : e[0]) == null ? void 0 : o.type) === "AI";
1855
1863
  }
1856
- function fo(e) {
1864
+ function vo(e) {
1857
1865
  var o;
1858
1866
  return ((o = e == null ? void 0 : e[0]) == null ? void 0 : o.type) === "AGENT";
1859
1867
  }
1860
- function vo() {
1868
+ function xo() {
1861
1869
  const {
1862
1870
  messagesState: { messages: e }
1863
1871
  } = j(), {
@@ -1867,13 +1875,13 @@ function vo() {
1867
1875
  bot: s
1868
1876
  } = x();
1869
1877
  return /* @__PURE__ */ r(te, { children: e.length === 0 && o.length > 0 && /* @__PURE__ */ r(
1870
- ae,
1878
+ le,
1871
1879
  {
1872
1880
  messages: o.map(
1873
- ({ message: i }, a) => ({
1881
+ ({ message: a }, i) => ({
1874
1882
  component: "bot_message",
1875
- data: { message: i },
1876
- id: `${a}-${i}`,
1883
+ data: { message: a },
1884
+ id: `${i}-${a}`,
1877
1885
  type: "AI",
1878
1886
  timestamp: null
1879
1887
  })
@@ -1883,33 +1891,33 @@ function vo() {
1883
1891
  }
1884
1892
  ) });
1885
1893
  }
1886
- function xo() {
1894
+ function bo() {
1887
1895
  const {
1888
1896
  messagesState: { messages: e }
1889
1897
  } = j(), { chatBannerItems: o } = x();
1890
1898
  return !(o != null && o.length) || e.length > 0 && o.every((t) => !t.persistent) ? null : /* @__PURE__ */ r("div", { className: "w-full text-center text-xs", children: o.map(
1891
- ({ message: t, persistent: n }, s) => e.length > 0 && !n ? null : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(xe, { children: t }) }, `${t}-${s}`)
1899
+ ({ message: t, persistent: n }, s) => e.length > 0 && !n ? null : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(be, { children: t }) }, `${t}-${s}`)
1892
1900
  ) });
1893
1901
  }
1894
- function bo() {
1902
+ function yo() {
1895
1903
  const {
1896
1904
  messagesState: { messages: e }
1897
1905
  } = j(), o = x(), {
1898
1906
  advancedInitialMessages: t = [],
1899
1907
  initialQuestions: n,
1900
1908
  initialQuestionsPosition: s
1901
- } = o, i = (() => {
1902
- var a;
1903
- return t.length ? [] : e.length ? [] : (a = o.initialMessages) != null && a.length ? o.initialMessages : ["Hello, how can I help you?"];
1909
+ } = o, a = (() => {
1910
+ var i;
1911
+ return t.length ? [] : e.length ? [] : (i = o.initialMessages) != null && i.length ? o.initialMessages : ["Hello, how can I help you?"];
1904
1912
  })();
1905
- return /* @__PURE__ */ r(te, { children: e.length === 0 && i.length > 0 && /* @__PURE__ */ r(
1906
- ae,
1913
+ return /* @__PURE__ */ r(te, { children: e.length === 0 && a.length > 0 && /* @__PURE__ */ r(
1914
+ le,
1907
1915
  {
1908
- messages: i.map(
1909
- (a, c) => ({
1916
+ messages: a.map(
1917
+ (i, c) => ({
1910
1918
  component: "bot_message",
1911
- data: { message: a },
1912
- id: `${c}-${a}`,
1919
+ data: { message: i },
1920
+ id: `${c}-${i}`,
1913
1921
  type: "AI",
1914
1922
  timestamp: null
1915
1923
  })
@@ -1919,23 +1927,23 @@ function bo() {
1919
1927
  }
1920
1928
  ) });
1921
1929
  }
1922
- function yo() {
1930
+ function ko() {
1923
1931
  var t;
1924
- const { props: e } = ze(), o = (t = e.config.specialComponents) == null ? void 0 : t.chatBottomComponents;
1932
+ const e = ne(), o = (t = e.config.customComponents) == null ? void 0 : t.chatBottomComponents;
1925
1933
  return o ? /* @__PURE__ */ r("div", { children: o.map(({ key: n, component: s }) => /* @__PURE__ */ r(s, { ...e }, n)) }) : null;
1926
1934
  }
1927
- function ko() {
1935
+ function Co() {
1928
1936
  const {
1929
1937
  messagesState: { messages: e }
1930
1938
  } = j(), { isAwaitingBotReply: o } = wt(), { componentStore: t } = R(), n = x(), s = ht(
1931
- () => go(e),
1939
+ () => wo(e),
1932
1940
  [e]
1933
- ), i = t.getComponent(
1941
+ ), a = t.getComponent(
1934
1942
  "loading"
1935
- ), a = ce(null);
1943
+ ), i = de(null);
1936
1944
  function c() {
1937
1945
  setTimeout(() => {
1938
- const l = a.current;
1946
+ const l = i.current;
1939
1947
  l && (l.scrollTop = l.scrollHeight);
1940
1948
  }, 0);
1941
1949
  }
@@ -1945,24 +1953,24 @@ function ko() {
1945
1953
  "div",
1946
1954
  {
1947
1955
  ...g("chat/msgs/root"),
1948
- ref: a,
1956
+ ref: i,
1949
1957
  className: "max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",
1950
1958
  children: [
1951
- /* @__PURE__ */ r(xo, {}),
1952
- /* @__PURE__ */ r(vo, {}),
1953
1959
  /* @__PURE__ */ r(bo, {}),
1960
+ /* @__PURE__ */ r(xo, {}),
1961
+ /* @__PURE__ */ r(yo, {}),
1954
1962
  s.map((l, h) => {
1955
1963
  var m, C, u, y;
1956
1964
  const b = (m = l == null ? void 0 : l[0]) == null ? void 0 : m.type, w = (C = l[0]) == null ? void 0 : C.id;
1957
1965
  if (!b || !w) return null;
1958
- if (wo(l))
1959
- return /* @__PURE__ */ r(mo, { messages: l }, w);
1960
- if (uo(l)) {
1966
+ if (uo(l))
1967
+ return /* @__PURE__ */ r(go, { messages: l }, w);
1968
+ if (fo(l)) {
1961
1969
  const I = h === s.length - 1;
1962
1970
  if (o && I) return null;
1963
1971
  const S = (u = l[0]) == null ? void 0 : u.agent;
1964
1972
  return /* @__PURE__ */ r(
1965
- ae,
1973
+ le,
1966
1974
  {
1967
1975
  messages: l,
1968
1976
  agent: S
@@ -1970,10 +1978,10 @@ function ko() {
1970
1978
  w
1971
1979
  );
1972
1980
  }
1973
- if (fo(l)) {
1981
+ if (vo(l)) {
1974
1982
  const I = (y = l[0]) == null ? void 0 : y.agent;
1975
1983
  return /* @__PURE__ */ r(
1976
- ae,
1984
+ le,
1977
1985
  {
1978
1986
  messages: l,
1979
1987
  agent: I
@@ -1983,24 +1991,24 @@ function ko() {
1983
1991
  }
1984
1992
  return null;
1985
1993
  }),
1986
- o && i && /* @__PURE__ */ r(i, { agent: n.bot }),
1987
- /* @__PURE__ */ r(yo, {}),
1988
- /* @__PURE__ */ r(po, {})
1994
+ o && a && /* @__PURE__ */ r(a, { agent: n.bot }),
1995
+ /* @__PURE__ */ r(ko, {}),
1996
+ /* @__PURE__ */ r(ho, {})
1989
1997
  ]
1990
1998
  }
1991
1999
  );
1992
2000
  }
1993
- function Co() {
2001
+ function zo() {
1994
2002
  const {
1995
2003
  messagesState: { isInitialFetchLoading: e }
1996
2004
  } = j(), {
1997
2005
  sessionState: { session: o }
1998
- } = $(), { isCanvasOpen: t } = eo(), { theme: n } = X();
1999
- Ce({
2006
+ } = $(), { isCanvasOpen: t } = to(), { theme: n } = X();
2007
+ ze({
2000
2008
  width: t ? n.screens.chat.withCanvas.width : n.screens.chat.width,
2001
2009
  height: t ? n.screens.chat.withCanvas.height : n.screens.chat.height
2002
2010
  });
2003
- const s = ce((o == null ? void 0 : o.id) || "chat").current;
2011
+ const s = de((o == null ? void 0 : o.id) || "chat").current;
2004
2012
  return /* @__PURE__ */ r(
2005
2013
  "div",
2006
2014
  {
@@ -2044,8 +2052,8 @@ function Co() {
2044
2052
  transitionDuration: n.screens.chat.withCanvas.transitionDuration
2045
2053
  },
2046
2054
  children: [
2047
- /* @__PURE__ */ r(ko, {}),
2048
- /* @__PURE__ */ r(lo, {})
2055
+ /* @__PURE__ */ r(Co, {}),
2056
+ /* @__PURE__ */ r(co, {})
2049
2057
  ]
2050
2058
  }
2051
2059
  ),
@@ -2061,7 +2069,7 @@ function Co() {
2061
2069
  transitionTimingFunction: n.screens.chat.withCanvas.transitionTimingFunction,
2062
2070
  transitionDuration: n.screens.chat.withCanvas.transitionDuration
2063
2071
  },
2064
- children: /* @__PURE__ */ r(to, {})
2072
+ children: /* @__PURE__ */ r(ro, {})
2065
2073
  }
2066
2074
  )
2067
2075
  ]
@@ -2072,7 +2080,7 @@ function Co() {
2072
2080
  }
2073
2081
  );
2074
2082
  }
2075
- function zo({
2083
+ function No({
2076
2084
  className: e,
2077
2085
  ...o
2078
2086
  }) {
@@ -2084,7 +2092,7 @@ function zo({
2084
2092
  }
2085
2093
  );
2086
2094
  }
2087
- function No({ className: e }) {
2095
+ function So({ className: e }) {
2088
2096
  return /* @__PURE__ */ r(
2089
2097
  "svg",
2090
2098
  {
@@ -2104,7 +2112,7 @@ function No({ className: e }) {
2104
2112
  }
2105
2113
  );
2106
2114
  }
2107
- function Ht({ className: e }) {
2115
+ function Ft({ className: e }) {
2108
2116
  const { token: o } = x();
2109
2117
  return /* @__PURE__ */ r(
2110
2118
  "div",
@@ -2128,7 +2136,7 @@ function Ht({ className: e }) {
2128
2136
  /* @__PURE__ */ r("span", { children: "Powered by" }),
2129
2137
  /* @__PURE__ */ r("span", { children: " " }),
2130
2138
  /* @__PURE__ */ d("span", { className: "flex items-center gap-[1px]", children: [
2131
- /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(No, { className: "size-3 inline-block" }) }),
2139
+ /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(So, { className: "size-3 inline-block" }) }),
2132
2140
  /* @__PURE__ */ r("span", { className: "font-semibold", children: "open" })
2133
2141
  ] })
2134
2142
  ]
@@ -2137,14 +2145,14 @@ function Ht({ className: e }) {
2137
2145
  }
2138
2146
  );
2139
2147
  }
2140
- function So({ children: e }) {
2148
+ function _o({ children: e }) {
2141
2149
  return /* @__PURE__ */ r("p", { className: "ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight", children: e });
2142
2150
  }
2143
2151
  function ct({
2144
2152
  session: e,
2145
2153
  className: o
2146
2154
  }) {
2147
- const { bot: t } = x(), { toChatScreen: n } = P(), s = e.assignee.kind === "human" ? e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", i = e.assignee.kind === "human" ? e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatar) || "";
2155
+ const { bot: t } = x(), { toChatScreen: n } = P(), s = e.assignee.kind === "human" ? e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", a = e.assignee.kind === "human" ? e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatar) || "";
2148
2156
  return /* @__PURE__ */ d(
2149
2157
  k,
2150
2158
  {
@@ -2157,9 +2165,9 @@ function ct({
2157
2165
  onClick: () => n(e.id),
2158
2166
  children: [
2159
2167
  /* @__PURE__ */ d("div", { className: "flex-1 flex gap-2 items-center", children: [
2160
- /* @__PURE__ */ r(_, { mode: "wait", children: /* @__PURE__ */ r(f, { snapExit: !0, children: /* @__PURE__ */ d(be, { className: "size-10", children: [
2161
- /* @__PURE__ */ r(ye, { src: i, alt: "Agent Icon" }),
2162
- /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(zr, { className: "size-4" }) })
2168
+ /* @__PURE__ */ r(_, { mode: "wait", children: /* @__PURE__ */ r(f, { snapExit: !0, children: /* @__PURE__ */ d(ye, { className: "size-10", children: [
2169
+ /* @__PURE__ */ r(ke, { src: a, alt: "Agent Icon" }),
2170
+ /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(zr, { className: "size-4" }) })
2163
2171
  ] }) }) }),
2164
2172
  /* @__PURE__ */ d("div", { className: "flex-1", children: [
2165
2173
  /* @__PURE__ */ r(_, { mode: "wait", children: /* @__PURE__ */ r(f, { snapExit: !0, children: s }, s) }),
@@ -2171,7 +2179,7 @@ function ct({
2171
2179
  className: "line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",
2172
2180
  children: e.lastMessage
2173
2181
  }
2174
- ) }, e.lastMessage || "content") : /* @__PURE__ */ r(f, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r(zo, { className: "h-4 w-full" }) }, "skeleton") })
2182
+ ) }, e.lastMessage || "content") : /* @__PURE__ */ r(f, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r(No, { className: "h-4 w-full" }) }, "skeleton") })
2175
2183
  ] })
2176
2184
  ] }),
2177
2185
  /* @__PURE__ */ r(Nr, { className: "size-4 text-muted-foreground shrink-0 rtl:-scale-100" })
@@ -2179,12 +2187,12 @@ function ct({
2179
2187
  }
2180
2188
  );
2181
2189
  }
2182
- function _o() {
2190
+ function Io() {
2183
2191
  const { t: e } = U(), { toChatScreen: o } = P(), {
2184
2192
  sessionsState: { data: t, isInitialFetchLoading: n },
2185
2193
  openSessions: s,
2186
- closedSessions: i,
2187
- canCreateNewSession: a
2194
+ closedSessions: a,
2195
+ canCreateNewSession: i
2188
2196
  } = $();
2189
2197
  return /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col overflow-scroll py-2 px-2", children: /* @__PURE__ */ r(_, { mode: "wait", children: n ? /* @__PURE__ */ r(
2190
2198
  f,
@@ -2210,15 +2218,15 @@ function _o() {
2210
2218
  },
2211
2219
  "open-sessions"
2212
2220
  ),
2213
- i.length > 0 && /* @__PURE__ */ d(
2221
+ a.length > 0 && /* @__PURE__ */ d(
2214
2222
  f,
2215
2223
  {
2216
2224
  className: "space-y-2",
2217
2225
  delay: 0.2,
2218
2226
  snapExit: !0,
2219
2227
  children: [
2220
- /* @__PURE__ */ r(So, { children: e("closed_conversations") }),
2221
- i.map((c) => /* @__PURE__ */ r(
2228
+ /* @__PURE__ */ r(_o, { children: e("closed_conversations") }),
2229
+ a.map((c) => /* @__PURE__ */ r(
2222
2230
  ct,
2223
2231
  {
2224
2232
  session: c,
@@ -2231,7 +2239,7 @@ function _o() {
2231
2239
  "closed-sessions"
2232
2240
  )
2233
2241
  ] }),
2234
- a && /* @__PURE__ */ r("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ ot(
2242
+ i && /* @__PURE__ */ r("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ ot(
2235
2243
  k,
2236
2244
  {
2237
2245
  ...g("sessions/new_conversation_btn"),
@@ -2260,9 +2268,9 @@ function _o() {
2260
2268
  "sessions"
2261
2269
  ) }) });
2262
2270
  }
2263
- function Io() {
2271
+ function To() {
2264
2272
  const { theme: e } = X();
2265
- return Ce({
2273
+ return ze({
2266
2274
  width: e.screens.sessions.width,
2267
2275
  height: e.screens.sessions.height
2268
2276
  }), /* @__PURE__ */ r(
@@ -2282,13 +2290,13 @@ function Io() {
2282
2290
  },
2283
2291
  children: /* @__PURE__ */ d("div", { className: "size-full flex flex-col", children: [
2284
2292
  /* @__PURE__ */ r(Pt, {}),
2285
- /* @__PURE__ */ r(_o, {}),
2286
- /* @__PURE__ */ r(Ht, {})
2293
+ /* @__PURE__ */ r(Io, {}),
2294
+ /* @__PURE__ */ r(Ft, {})
2287
2295
  ] })
2288
2296
  }
2289
2297
  );
2290
2298
  }
2291
- const ie = G.forwardRef(
2299
+ const ae = G.forwardRef(
2292
2300
  ({ className: e, type: o, ...t }, n) => {
2293
2301
  const { isSmallScreen: s } = A();
2294
2302
  return /* @__PURE__ */ r(B, { ref: n, children: /* @__PURE__ */ r(
@@ -2308,16 +2316,16 @@ const ie = G.forwardRef(
2308
2316
  ) });
2309
2317
  }
2310
2318
  );
2311
- ie.displayName = "Input";
2312
- function To() {
2313
- const { contentIframeRef: e } = R(), { inline: o } = x(), t = ce(null);
2319
+ ae.displayName = "Input";
2320
+ function Mo() {
2321
+ const { contentIframeRef: e } = R(), { inline: o } = x(), t = de(null);
2314
2322
  return re(() => {
2315
2323
  const n = e == null ? void 0 : e.current;
2316
2324
  if (n && t.current) {
2317
2325
  const s = t.current;
2318
- let i;
2319
- const a = new ResizeObserver(() => {
2320
- i = requestAnimationFrame(() => {
2326
+ let a;
2327
+ const i = new ResizeObserver(() => {
2328
+ a = requestAnimationFrame(() => {
2321
2329
  const c = s.offsetHeight;
2322
2330
  n.style.setProperty(
2323
2331
  "--opencx-widget-height",
@@ -2325,31 +2333,31 @@ function To() {
2325
2333
  );
2326
2334
  });
2327
2335
  });
2328
- return a.observe(s), () => {
2329
- cancelAnimationFrame(i), a.unobserve(s);
2336
+ return i.observe(s), () => {
2337
+ cancelAnimationFrame(a), i.unobserve(s);
2330
2338
  };
2331
2339
  }
2332
2340
  }, [e, o]), { observedElementRef: t };
2333
2341
  }
2334
- const Mo = he.object({
2335
- name: he.string().min(2),
2336
- email: he.string().email()
2342
+ const Do = me.object({
2343
+ name: me.string().min(2),
2344
+ email: me.string().email()
2337
2345
  });
2338
- function Do() {
2339
- var S, M, F, H, W, E, v, z;
2346
+ function Ro() {
2347
+ var S, M, H, F, W, E, v, z;
2340
2348
  const {
2341
2349
  widgetCtx: { org: e }
2342
- } = R(), { setIsOpen: o } = K(), { createUnverifiedContact: t } = Xt(), { isSmallScreen: n } = A(), s = x(), { theme: i } = X(), { t: a } = U(), { observedElementRef: c } = To();
2343
- Ce({
2350
+ } = R(), { setIsOpen: o } = K(), { createUnverifiedContact: t } = Xt(), { isSmallScreen: n } = A(), s = x(), { theme: a } = X(), { t: i } = U(), { observedElementRef: c } = Mo();
2351
+ ze({
2344
2352
  height: void 0,
2345
- width: i.screens.welcome.width
2353
+ width: a.screens.welcome.width
2346
2354
  });
2347
2355
  const [l, h] = T(((S = s.prefillUserData) == null ? void 0 : S.name) || ""), [b, w] = T(((M = s.prefillUserData) == null ? void 0 : M.email) || ""), m = (s.extraDataCollectionFields || []).filter(
2348
2356
  (N) => N !== "name" && N !== "email" && !!N
2349
2357
  ), [C, u] = T({}), [y, I] = Rr(
2350
2358
  async (N) => {
2351
2359
  N.preventDefault();
2352
- const L = Mo.safeParse({ name: l, email: b });
2360
+ const L = Do.safeParse({ name: l, email: b });
2353
2361
  L.success && await t(
2354
2362
  {
2355
2363
  email: L.data.email,
@@ -2369,7 +2377,7 @@ function Do() {
2369
2377
  // Relative to the iframe
2370
2378
  maxWidth: "100vw",
2371
2379
  // Relative to the iframe
2372
- minHeight: i.screens.welcome.minHeight,
2380
+ minHeight: a.screens.welcome.minHeight,
2373
2381
  height: "100vh",
2374
2382
  // Relative to the iframe
2375
2383
  maxHeight: "100vh",
@@ -2394,18 +2402,18 @@ function Do() {
2394
2402
  "text-primary-foreground"
2395
2403
  ),
2396
2404
  children: [
2397
- n && /* @__PURE__ */ r(f, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(k, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(ve, { className: "size-4" }) }) }),
2398
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (F = s.assets) != null && F.organizationLogo ? /* @__PURE__ */ r(
2405
+ n && /* @__PURE__ */ r(f, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(k, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(xe, { className: "size-4" }) }) }),
2406
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (H = s.assets) != null && H.organizationLogo ? /* @__PURE__ */ r(
2399
2407
  "img",
2400
2408
  {
2401
- src: (H = s.assets) == null ? void 0 : H.organizationLogo,
2409
+ src: (F = s.assets) == null ? void 0 : F.organizationLogo,
2402
2410
  alt: "Company Logo",
2403
2411
  className: "h-8 w-auto object-contain"
2404
2412
  }
2405
2413
  ) : /* @__PURE__ */ r("h2", { className: "font-bold text-sm", children: e.name }) }),
2406
2414
  /* @__PURE__ */ d("div", { className: "space-y-2", children: [
2407
- /* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((E = (W = s.textContent) == null ? void 0 : W.welcomeScreen) == null ? void 0 : E.title) || a("welcome_screen_title") }),
2408
- /* @__PURE__ */ r("p", { className: "text-sm", children: ((z = (v = s.textContent) == null ? void 0 : v.welcomeScreen) == null ? void 0 : z.description) || a("welcome_screen_description") })
2415
+ /* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((E = (W = s.textContent) == null ? void 0 : W.welcomeScreen) == null ? void 0 : E.title) || i("welcome_screen_title") }),
2416
+ /* @__PURE__ */ r("p", { className: "text-sm", children: ((z = (v = s.textContent) == null ? void 0 : v.welcomeScreen) == null ? void 0 : z.description) || i("welcome_screen_description") })
2409
2417
  ] })
2410
2418
  ]
2411
2419
  }
@@ -2422,35 +2430,35 @@ function Do() {
2422
2430
  children: [
2423
2431
  /* @__PURE__ */ d("form", { onSubmit: I, className: "space-y-2", children: [
2424
2432
  /* @__PURE__ */ r(
2425
- ie,
2433
+ ae,
2426
2434
  {
2427
2435
  value: l,
2428
2436
  onChange: (N) => h(N.target.value),
2429
2437
  required: !0,
2430
- placeholder: a("your_name_placeholder"),
2438
+ placeholder: i("your_name_placeholder"),
2431
2439
  name: "name"
2432
2440
  }
2433
2441
  ),
2434
2442
  /* @__PURE__ */ r(
2435
- ie,
2443
+ ae,
2436
2444
  {
2437
2445
  required: !0,
2438
2446
  value: b,
2439
2447
  onChange: (N) => w(N.target.value),
2440
2448
  type: "email",
2441
- placeholder: a("your_email_placeholder"),
2449
+ placeholder: i("your_email_placeholder"),
2442
2450
  name: "email"
2443
2451
  }
2444
2452
  ),
2445
2453
  m.map((N) => /* @__PURE__ */ r(
2446
- ie,
2454
+ ae,
2447
2455
  {
2448
2456
  value: C[N],
2449
- onChange: (L) => u((ne) => ({
2450
- ...ne,
2457
+ onChange: (L) => u((se) => ({
2458
+ ...se,
2451
2459
  [N]: L.target.value
2452
2460
  })),
2453
- placeholder: `${N} (${a("optional")})`
2461
+ placeholder: `${N} (${i("optional")})`
2454
2462
  },
2455
2463
  N
2456
2464
  )),
@@ -2461,13 +2469,13 @@ function Do() {
2461
2469
  className: "w-full",
2462
2470
  size: "lg",
2463
2471
  children: [
2464
- y.loading ? a("start_chat_button_loading") : a("start_chat_button"),
2472
+ y.loading ? i("start_chat_button_loading") : i("start_chat_button"),
2465
2473
  /* @__PURE__ */ r(Sr, { className: "size-4 rtl:-scale-100" })
2466
2474
  ]
2467
2475
  }
2468
2476
  )
2469
2477
  ] }),
2470
- /* @__PURE__ */ r(Ht, {})
2478
+ /* @__PURE__ */ r(Ft, {})
2471
2479
  ]
2472
2480
  }
2473
2481
  )
@@ -2490,7 +2498,7 @@ function Wt() {
2490
2498
  fadeIn: "right",
2491
2499
  className: "size-full",
2492
2500
  snapExit: !0,
2493
- children: /* @__PURE__ */ r(Do, {})
2501
+ children: /* @__PURE__ */ r(Ro, {})
2494
2502
  },
2495
2503
  e
2496
2504
  );
@@ -2501,7 +2509,7 @@ function Wt() {
2501
2509
  fadeIn: "right",
2502
2510
  className: "size-full",
2503
2511
  snapExit: !0,
2504
- children: /* @__PURE__ */ r(Io, {})
2512
+ children: /* @__PURE__ */ r(To, {})
2505
2513
  },
2506
2514
  e
2507
2515
  );
@@ -2512,7 +2520,7 @@ function Wt() {
2512
2520
  fadeIn: "right",
2513
2521
  className: "size-full",
2514
2522
  snapExit: !0,
2515
- children: /* @__PURE__ */ r(Co, {})
2523
+ children: /* @__PURE__ */ r(zo, {})
2516
2524
  },
2517
2525
  e
2518
2526
  );
@@ -2521,7 +2529,7 @@ function Wt() {
2521
2529
  }
2522
2530
  })() }) });
2523
2531
  }
2524
- const Ro = "4.0.30", jo = `<!DOCTYPE html>
2532
+ const jo = "4.0.32", Eo = `<!DOCTYPE html>
2525
2533
  <html>
2526
2534
  <head>
2527
2535
  <style>
@@ -2540,7 +2548,7 @@ html, body {
2540
2548
  </body>
2541
2549
  </html>`;
2542
2550
  function Bt() {
2543
- const { isOpen: e } = K(), { contentIframeRef: o } = R(), { cssOverrides: t, inline: n } = x(), { theme: s, cssVars: i, computed: a } = X(), { dir: c } = U();
2551
+ const { isOpen: e } = K(), { contentIframeRef: o } = R(), { cssOverrides: t, inline: n } = x(), { theme: s, cssVars: a, computed: i } = X(), { dir: c } = U();
2544
2552
  return /* @__PURE__ */ r(
2545
2553
  Z.div,
2546
2554
  {
@@ -2564,20 +2572,20 @@ function Bt() {
2564
2572
  bt,
2565
2573
  {
2566
2574
  ref: o,
2567
- initialContent: jo,
2575
+ initialContent: Eo,
2568
2576
  allowFullScreen: !0,
2569
2577
  title: "OpenCX Live Chat",
2570
2578
  style: {
2571
2579
  // @ts-expect-error this is a valid css variable
2572
- "--opencx-widget-width": a.minWidth,
2573
- "--opencx-widget-height": a.minHeight,
2574
- minWidth: a.minWidth,
2580
+ "--opencx-widget-width": i.minWidth,
2581
+ "--opencx-widget-height": i.minHeight,
2582
+ minWidth: i.minWidth,
2575
2583
  width: "var(--opencx-widget-width)",
2576
- maxWidth: a.maxWidth,
2584
+ maxWidth: i.maxWidth,
2577
2585
  // Relative to the viewport
2578
- minHeight: a.minHeight,
2586
+ minHeight: i.minHeight,
2579
2587
  height: "var(--opencx-widget-height)",
2580
- maxHeight: a.maxHeight,
2588
+ maxHeight: i.maxHeight,
2581
2589
  // Relative to the viewport
2582
2590
  overflow: "hidden",
2583
2591
  /** outline is better than border because of box sizing; the outline wouldn't affect the content inside... the border will mess up how the children's border radius sits with the parent */
@@ -2598,10 +2606,10 @@ function Bt() {
2598
2606
  "div",
2599
2607
  {
2600
2608
  style: {
2601
- ...i,
2609
+ ...a,
2602
2610
  zIndex: s.widgetContentContainer.zIndex
2603
2611
  },
2604
- "data-version": Ro,
2612
+ "data-version": jo,
2605
2613
  className: p(
2606
2614
  "antialiased font-sans size-full overflow-hidden relative text-secondary-foreground isolate"
2607
2615
  ),
@@ -2622,10 +2630,10 @@ function Bt() {
2622
2630
  }
2623
2631
  );
2624
2632
  }
2625
- function Eo() {
2633
+ function Oo() {
2626
2634
  const { theme: e } = X();
2627
2635
  return /* @__PURE__ */ r(
2628
- le.Content,
2636
+ ce.Content,
2629
2637
  {
2630
2638
  onInteractOutside: (o) => o.preventDefault(),
2631
2639
  forceMount: !0,
@@ -2642,7 +2650,7 @@ function Eo() {
2642
2650
  }
2643
2651
  );
2644
2652
  }
2645
- function Oo({
2653
+ function Po({
2646
2654
  className: e,
2647
2655
  style: o
2648
2656
  }) {
@@ -2677,7 +2685,7 @@ function Oo({
2677
2685
  }
2678
2686
  );
2679
2687
  }
2680
- const Po = `<!DOCTYPE html>
2688
+ const Ao = `<!DOCTYPE html>
2681
2689
  <html>
2682
2690
  <head>
2683
2691
  <style>
@@ -2694,13 +2702,13 @@ html, body {
2694
2702
  <body>
2695
2703
  </body>
2696
2704
  </html>`;
2697
- function Ao() {
2698
- var i, a;
2705
+ function Ho() {
2706
+ var a, i;
2699
2707
  const { isOpen: e } = K(), { cssOverrides: o, assets: t } = x(), { theme: n, cssVars: s } = X();
2700
2708
  return /* @__PURE__ */ d(
2701
2709
  bt,
2702
2710
  {
2703
- initialContent: Po,
2711
+ initialContent: Ao,
2704
2712
  style: {
2705
2713
  height: `calc(${n.widgetTrigger.size.button}px + ${V.x * 2}px)`,
2706
2714
  width: `calc(${n.widgetTrigger.size.button}px + ${V.y * 2}px)`,
@@ -2730,7 +2738,7 @@ function Ao() {
2730
2738
  justifyContent: "center"
2731
2739
  },
2732
2740
  children: /* @__PURE__ */ r(
2733
- le.PopoverTrigger,
2741
+ ce.PopoverTrigger,
2734
2742
  {
2735
2743
  className: p(
2736
2744
  "font-sans flex items-center justify-center rounded-full"
@@ -2760,7 +2768,7 @@ function Ao() {
2760
2768
  initial: { rotate: 45 },
2761
2769
  animate: { rotate: 0 }
2762
2770
  },
2763
- children: (i = t == null ? void 0 : t.widgetTrigger) != null && i.closeIcon ? /* @__PURE__ */ r(
2771
+ children: (a = t == null ? void 0 : t.widgetTrigger) != null && a.closeIcon ? /* @__PURE__ */ r(
2764
2772
  "img",
2765
2773
  {
2766
2774
  src: t.widgetTrigger.closeIcon,
@@ -2789,7 +2797,7 @@ function Ao() {
2789
2797
  initial: { rotate: 45 },
2790
2798
  animate: { rotate: 0 }
2791
2799
  },
2792
- children: (a = t == null ? void 0 : t.widgetTrigger) != null && a.openIcon ? /* @__PURE__ */ r(
2800
+ children: (i = t == null ? void 0 : t.widgetTrigger) != null && i.openIcon ? /* @__PURE__ */ r(
2793
2801
  "img",
2794
2802
  {
2795
2803
  src: t.widgetTrigger.openIcon,
@@ -2800,7 +2808,7 @@ function Ao() {
2800
2808
  }
2801
2809
  }
2802
2810
  ) : /* @__PURE__ */ r(
2803
- Oo,
2811
+ Po,
2804
2812
  {
2805
2813
  style: {
2806
2814
  width: n.widgetTrigger.size.icon,
@@ -2823,9 +2831,9 @@ function Ao() {
2823
2831
  );
2824
2832
  }
2825
2833
  function Fo() {
2826
- const { dir: e } = fe();
2834
+ const { dir: e } = ve();
2827
2835
  return /* @__PURE__ */ r(
2828
- le.Anchor,
2836
+ ce.Anchor,
2829
2837
  {
2830
2838
  style: {
2831
2839
  position: "fixed",
@@ -2836,15 +2844,15 @@ function Fo() {
2836
2844
  }
2837
2845
  );
2838
2846
  }
2839
- function Ho() {
2847
+ function Wo() {
2840
2848
  const { isOpen: e, setIsOpen: o } = K();
2841
- return /* @__PURE__ */ d(le.Root, { open: e, onOpenChange: o, children: [
2849
+ return /* @__PURE__ */ d(ce.Root, { open: e, onOpenChange: o, children: [
2842
2850
  /* @__PURE__ */ r(Fo, {}),
2843
- /* @__PURE__ */ r(Ao, {}),
2844
- /* @__PURE__ */ r(Eo, {})
2851
+ /* @__PURE__ */ r(Ho, {}),
2852
+ /* @__PURE__ */ r(Oo, {})
2845
2853
  ] });
2846
2854
  }
2847
- const Wo = [
2855
+ const Bo = [
2848
2856
  {
2849
2857
  key: "loading",
2850
2858
  component: Lr
@@ -2855,13 +2863,13 @@ const Wo = [
2855
2863
  },
2856
2864
  {
2857
2865
  key: "bot_message",
2858
- component: me
2866
+ component: ge
2859
2867
  },
2860
2868
  {
2861
2869
  key: "agent_message",
2862
- component: me
2870
+ component: ge
2863
2871
  }
2864
- ], Bo = {
2872
+ ], $o = {
2865
2873
  get: async (e) => localStorage.getItem(e),
2866
2874
  set: async (e, o) => {
2867
2875
  localStorage.setItem(e, o);
@@ -2870,7 +2878,7 @@ const Wo = [
2870
2878
  localStorage.removeItem(e);
2871
2879
  }
2872
2880
  };
2873
- function an({
2881
+ function ln({
2874
2882
  options: e,
2875
2883
  components: o = [],
2876
2884
  loadingComponent: t
@@ -2878,15 +2886,15 @@ function an({
2878
2886
  return /* @__PURE__ */ r(
2879
2887
  Ut,
2880
2888
  {
2881
- components: [...Wo, ...o],
2889
+ components: [...Bo, ...o],
2882
2890
  options: e,
2883
- storage: Bo,
2891
+ storage: $o,
2884
2892
  loadingComponent: t,
2885
- children: /* @__PURE__ */ r(Vt, { children: e.inline ? /* @__PURE__ */ r(Bt, {}) : /* @__PURE__ */ r(Ho, {}) })
2893
+ children: /* @__PURE__ */ r(Vt, { children: e.inline ? /* @__PURE__ */ r(Bt, {}) : /* @__PURE__ */ r(Wo, {}) })
2886
2894
  }
2887
2895
  );
2888
2896
  }
2889
2897
  export {
2890
- an as Widget
2898
+ ln as Widget
2891
2899
  };
2892
2900
  //# sourceMappingURL=index.js.map