@opencx/widget-react 4.0.49 → 4.0.50

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
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, jsxs as d, Fragment as Q } from "react/jsx-runtime";
2
- import * as me from "@radix-ui/react-popover";
2
+ import * as he from "@radix-ui/react-popover";
3
3
  import * as J from "react";
4
- import W, { memo as Kt, forwardRef as xt, useState as D, cloneElement as vt, createContext as Qt, useEffect as se, useContext as Jt, useRef as $, useCallback as q, useMemo as bt, createElement as lt } from "react";
5
- import { useWidget as E, useConfig as N, useSessions as Y, useMessages as O, useWidgetRouter as F, useDocumentDir as ye, useWidgetTrigger as V, useModes as yt, useCsat as kt, useUploadFiles as er, useIsAwaitingBotReply as Ct, useContact as zt, WidgetProvider as tr, WidgetTriggerProvider as rr } from "@opencx/widget-react-headless";
6
- import { X as or, ZoomOut as nr, ZoomIn as sr, RotateCcw as ar, FileText as Nt, CircleDashedIcon as ir, XIcon as ke, SquareXIcon as lr, SquareCheckBigIcon as cr, SquareCheckIcon as dr, ShrinkIcon as pr, Minimize2Icon as mr, MinimizeIcon as hr, Maximize2Icon as ur, MaximizeIcon as gr, ExpandIcon as wr, CircleXIcon as fr, CircleCheckBigIcon as xr, CircleCheckIcon as St, CheckCheckIcon as vr, CheckIcon as br, ChevronLeftIcon as yr, LoaderIcon as kr, ArrowUpIcon as _t, PaperclipIcon as ct, CircleDashed as Cr, AlertCircle as zr, Loader2 as Nr, FileAudio2Icon as Sr, FileVideo2Icon as _r, FileIcon as Ir, UserRoundIcon as Tr, ChevronRightIcon as Mr, SendHorizontal as Dr, ChevronDownIcon as Rr } from "lucide-react";
4
+ import L, { memo as Kt, forwardRef as xt, useState as D, cloneElement as vt, createContext as Qt, useEffect as se, useContext as Jt, useRef as B, useCallback as q, useMemo as bt, createElement as lt } from "react";
5
+ import { useWidget as O, useConfig as C, useSessions as U, useMessages as A, useWidgetRouter as H, useDocumentDir as ye, useWidgetTrigger as V, useModes as yt, useCsat as kt, useUploadFiles as er, useIsAwaitingBotReply as Ct, useContact as zt, WidgetProvider as tr, WidgetTriggerProvider as rr } from "@opencx/widget-react-headless";
6
+ import { X as or, ZoomOut as nr, ZoomIn as sr, RotateCcw as ar, FileText as Nt, CircleDashedIcon as ir, XIcon as ke, SquareXIcon as lr, SquareCheckBigIcon as cr, SquareCheckIcon as dr, ShrinkIcon as pr, Minimize2Icon as hr, MinimizeIcon as mr, Maximize2Icon as ur, MaximizeIcon as gr, ExpandIcon as wr, CircleXIcon as fr, CircleCheckBigIcon as xr, CircleCheckIcon as St, CheckCheckIcon as vr, CheckIcon as br, ChevronLeftIcon as yr, LoaderIcon as kr, ArrowUpIcon as _t, PaperclipIcon as ct, CircleDashed as Cr, AlertCircle as zr, Loader2 as Nr, FileAudio2Icon as Sr, FileVideo2Icon as _r, FileIcon as Ir, UserRoundIcon as Tr, ChevronRightIcon as Mr, SendHorizontal as Dr, ChevronDownIcon as Rr } from "lucide-react";
7
7
  import { clsx as jr } from "clsx";
8
8
  import { twMerge as Pr } from "tailwind-merge";
9
9
  import { motion as re, AnimatePresence as T } from "framer-motion";
@@ -12,7 +12,7 @@ import { cva as Or } from "class-variance-authority";
12
12
  import It from "remark-gfm";
13
13
  import Ar from "react-markdown";
14
14
  import Tt from "rehype-raw";
15
- import { isExhaustive as A, isSupportedLanguage as Fr, getTranslation as Hr } from "@opencx/widget-core";
15
+ import { isExhaustive as F, isSupportedLanguage as Fr, getTranslation as Hr } from "@opencx/widget-core";
16
16
  import * as ee from "@radix-ui/react-avatar";
17
17
  import Mt from "@uiw/react-iframe";
18
18
  import * as ae from "@radix-ui/react-tooltip";
@@ -20,53 +20,53 @@ import dt from "tinycolor2";
20
20
  import { useDropzone as Wr } from "react-dropzone";
21
21
  import Lr from "react-use/lib/useAsyncFn";
22
22
  import { z as ge } from "zod";
23
- function g(e) {
23
+ function w(e) {
24
24
  return { "data-component": e };
25
25
  }
26
- function m(...e) {
26
+ function h(...e) {
27
27
  return Pr(jr(e));
28
28
  }
29
29
  const K = {
30
30
  x: 2,
31
31
  y: 2
32
- }, B = Kt(
32
+ }, Y = Kt(
33
33
  xt(
34
34
  ({ children: e, className: o, scale: t = 1.02, off: n = !1 }, s) => {
35
35
  const [a, i] = D(!1), [l, c] = D({ x: 0, y: 0 });
36
36
  if (n || /translate/.test(
37
37
  e.props.className || ""
38
38
  )) return e;
39
- const b = (f) => {
40
- var y, I;
41
- const { clientX: C, clientY: M } = f, v = f.currentTarget.getBoundingClientRect(), R = C - (v.left + v.width / 2), P = M - (v.top + v.height / 2), j = Math.max(
39
+ const x = (v) => {
40
+ var M, u;
41
+ const { clientX: z, clientY: _ } = v, f = v.currentTarget.getBoundingClientRect(), R = z - (f.left + f.width / 2), P = _ - (f.top + f.height / 2), E = Math.max(
42
42
  -1,
43
- Math.min(1, R / (v.width / 2))
44
- ), u = Math.max(
43
+ Math.min(1, R / (f.width / 2))
44
+ ), g = Math.max(
45
45
  -1,
46
- Math.min(1, P / (v.height / 2))
47
- ), _ = j * K.x, w = u * K.y;
48
- c({ x: _, y: w }), (I = (y = e.props).onMouseMove) == null || I.call(y, f);
49
- }, x = () => {
50
- var f, C;
51
- i(!0), (C = (f = e.props).onMouseEnter) == null || C.call(f);
52
- }, h = () => {
53
- var f, C;
54
- i(!1), c({ x: 0, y: 0 }), (C = (f = e.props).onMouseLeave) == null || C.call(f);
55
- }, z = {
46
+ Math.min(1, P / (f.height / 2))
47
+ ), I = E * K.x, j = g * K.y;
48
+ c({ x: I, y: j }), (u = (M = e.props).onMouseMove) == null || u.call(M, v);
49
+ }, y = () => {
50
+ var v, z;
51
+ i(!0), (z = (v = e.props).onMouseEnter) == null || z.call(v);
52
+ }, m = () => {
53
+ var v, z;
54
+ i(!1), c({ x: 0, y: 0 }), (z = (v = e.props).onMouseLeave) == null || z.call(v);
55
+ }, k = {
56
56
  "--wobble-x": a ? `${l.x}px` : "0px",
57
57
  "--wobble-y": a ? `${l.y}px` : "0px",
58
58
  "--scale": 1 - (t - 1)
59
59
  };
60
60
  return vt(e, {
61
61
  ref: s,
62
- onMouseMove: b,
63
- onMouseEnter: x,
64
- onMouseLeave: h,
62
+ onMouseMove: x,
63
+ onMouseEnter: y,
64
+ onMouseLeave: m,
65
65
  style: {
66
- ...z,
66
+ ...k,
67
67
  ...e.props.style
68
68
  },
69
- className: m(
69
+ className: h(
70
70
  "translate-x-[var(--wobble-x)]",
71
71
  "translate-y-[var(--wobble-y)]",
72
72
  "hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",
@@ -78,7 +78,7 @@ const K = {
78
78
  }
79
79
  )
80
80
  );
81
- B.displayName = "Wobble";
81
+ Y.displayName = "Wobble";
82
82
  const $r = 10, Br = (e, o, t) => ({
83
83
  initial: { opacity: 0, x: -e, ...o.initial },
84
84
  animate: { opacity: 1, x: 0, ...o.animate, transition: { delay: t } },
@@ -100,7 +100,7 @@ const $r = 10, Br = (e, o, t) => ({
100
100
  left: Yr,
101
101
  up: Ur,
102
102
  down: Xr
103
- }, k = xt(
103
+ }, b = xt(
104
104
  ({
105
105
  fadeIn: e = "down",
106
106
  distance: o = $r,
@@ -114,9 +114,9 @@ const $r = 10, Br = (e, o, t) => ({
114
114
  return n && c.exit && typeof c.exit == "object" && !Array.isArray(c.exit) && (c.exit.transition = { duration: 0 }), /* @__PURE__ */ r(re.div, { ref: l, ...i, ...c, children: t });
115
115
  }
116
116
  );
117
- k.displayName = "MotionDiv";
117
+ b.displayName = "MotionDiv";
118
118
  const Vr = Or(
119
- m(
119
+ h(
120
120
  "inline-flex shrink-0 items-center justify-center gap-2",
121
121
  "text-sm font-medium whitespace-nowrap",
122
122
  "ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
@@ -154,18 +154,18 @@ const Vr = Or(
154
154
  size: "default"
155
155
  }
156
156
  }
157
- ), S = J.forwardRef(
158
- ({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, a) => /* @__PURE__ */ r(B, { ref: a, children: /* @__PURE__ */ r(
157
+ ), N = J.forwardRef(
158
+ ({ className: e, variant: o = "default", size: t, asChild: n = !1, ...s }, a) => /* @__PURE__ */ r(Y, { ref: a, children: /* @__PURE__ */ r(
159
159
  n ? Er : "button",
160
160
  {
161
- ...g("ui_lib/btn"),
161
+ ...w("ui_lib/btn"),
162
162
  "data-variant": o,
163
- className: m(Vr({ variant: o, size: t, className: e })),
163
+ className: h(Vr({ variant: o, size: t, className: e })),
164
164
  ...s
165
165
  }
166
166
  ) })
167
167
  );
168
- S.displayName = "Button";
168
+ N.displayName = "Button";
169
169
  const Dt = Qt(null);
170
170
  function Gr({ children: e }) {
171
171
  const [o, t] = D(!1), [n, s] = D(null), a = (l) => {
@@ -186,7 +186,7 @@ function Gr({ children: e }) {
186
186
  }
187
187
  );
188
188
  }
189
- function he() {
189
+ function me() {
190
190
  const e = Jt(Dt);
191
191
  return e || (console.error("useDialoger must be used within a DialogerProvider"), {
192
192
  open: () => {
@@ -198,7 +198,7 @@ function he() {
198
198
  });
199
199
  }
200
200
  function Zr() {
201
- const { contentIframeRef: e } = E(), { isOpen: o, content: t, close: n } = he();
201
+ const { contentIframeRef: e } = O(), { isOpen: o, content: t, close: n } = me();
202
202
  return se(() => {
203
203
  var a, i;
204
204
  const s = (l) => {
@@ -215,7 +215,7 @@ function Zr() {
215
215
  );
216
216
  };
217
217
  }, []), /* @__PURE__ */ r(T, { mode: "wait", children: o && t && /* @__PURE__ */ r(
218
- k,
218
+ b,
219
219
  {
220
220
  overrides: {
221
221
  initial: { y: 0 },
@@ -234,11 +234,11 @@ function Ce({
234
234
  className: o,
235
235
  withClose: t = !1
236
236
  }) {
237
- const { close: n } = he();
237
+ const { close: n } = me();
238
238
  return /* @__PURE__ */ d(
239
239
  "div",
240
240
  {
241
- className: m(
241
+ className: h(
242
242
  "fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",
243
243
  o
244
244
  ),
@@ -246,7 +246,7 @@ function Ce({
246
246
  children: [
247
247
  e,
248
248
  t && /* @__PURE__ */ d(
249
- S,
249
+ N,
250
250
  {
251
251
  size: "fit",
252
252
  className: "rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",
@@ -267,7 +267,7 @@ const Rt = ({
267
267
  }) => /* @__PURE__ */ r(
268
268
  "div",
269
269
  {
270
- className: m("flex flex-col gap-2 text-center pt-2", e),
270
+ className: h("flex flex-col gap-2 text-center pt-2", e),
271
271
  ...o
272
272
  }
273
273
  );
@@ -278,7 +278,7 @@ const jt = ({
278
278
  }) => /* @__PURE__ */ r(
279
279
  "div",
280
280
  {
281
- className: m("flex flex-col gap-2 text-center", e),
281
+ className: h("flex flex-col gap-2 text-center", e),
282
282
  ...o
283
283
  }
284
284
  );
@@ -286,13 +286,13 @@ jt.displayName = "DialogerBody";
286
286
  const Pt = ({
287
287
  className: e,
288
288
  ...o
289
- }) => /* @__PURE__ */ r("div", { className: m("flex flex-col gap-2", e), ...o });
289
+ }) => /* @__PURE__ */ r("div", { className: h("flex flex-col gap-2", e), ...o });
290
290
  Pt.displayName = "DialogerFooter";
291
- const Et = W.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
291
+ const Et = L.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
292
292
  "p",
293
293
  {
294
294
  ref: t,
295
- className: m(
295
+ className: h(
296
296
  "text-lg font-semibold leading-none tracking-tight",
297
297
  e
298
298
  ),
@@ -300,11 +300,11 @@ const Et = W.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
300
300
  }
301
301
  ));
302
302
  Et.displayName = "DialogerTitle";
303
- const Ot = W.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
303
+ const Ot = L.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
304
304
  "p",
305
305
  {
306
306
  ref: t,
307
- className: m("text-sm text-muted-foreground", e),
307
+ className: h("text-sm text-muted-foreground", e),
308
308
  ...o
309
309
  }
310
310
  ));
@@ -313,12 +313,12 @@ function ze({
313
313
  children: e,
314
314
  trigger: o
315
315
  }) {
316
- const { open: t } = he();
316
+ const { open: t } = me();
317
317
  return vt(o, {
318
318
  onClick: () => t(e)
319
319
  });
320
320
  }
321
- const pt = 1, mt = 5, le = 0.5, Kr = 2.5;
321
+ const pt = 1, ht = 5, le = 0.5, Kr = 2.5;
322
322
  function Qr(e, o, t, n) {
323
323
  if (!t || !n || o <= 1) return { x: 0, y: 0 };
324
324
  const s = t.getBoundingClientRect(), a = n.offsetWidth, i = n.offsetHeight, l = Math.max(0, (a * o - s.width) / (2 * o)), c = Math.max(
@@ -334,73 +334,73 @@ function At({
334
334
  src: e,
335
335
  alt: o
336
336
  }) {
337
- const [t, n] = D(1), [s, a] = D({ x: 0, y: 0 }), [i, l] = D(!1), c = $({ x: 0, y: 0 }), p = $({ x: 0, y: 0 }), b = $(null), x = $(null), h = $(!1), z = (u) => Math.min(mt, Math.max(pt, u)), f = q(() => {
337
+ const [t, n] = D(1), [s, a] = D({ x: 0, y: 0 }), [i, l] = D(!1), c = B({ x: 0, y: 0 }), p = B({ x: 0, y: 0 }), x = B(null), y = B(null), m = B(!1), k = (g) => Math.min(ht, Math.max(pt, g)), v = q(() => {
338
338
  n(1), a({ x: 0, y: 0 });
339
- }, []), C = q(() => {
340
- n((u) => z(u + le));
341
- }, []), M = q(() => {
342
- n((u) => {
343
- const _ = z(u - le);
344
- return _ <= 1 && a({ x: 0, y: 0 }), _;
339
+ }, []), z = q(() => {
340
+ n((g) => k(g + le));
341
+ }, []), _ = q(() => {
342
+ n((g) => {
343
+ const I = k(g - le);
344
+ return I <= 1 && a({ x: 0, y: 0 }), I;
345
345
  });
346
346
  }, []);
347
- q((u) => {
348
- u.preventDefault(), u.stopPropagation();
349
- const _ = u.deltaY > 0 ? -le : le;
350
- n((w) => {
351
- const y = z(w + _);
352
- return y <= 1 && a({ x: 0, y: 0 }), y;
347
+ q((g) => {
348
+ g.preventDefault(), g.stopPropagation();
349
+ const I = g.deltaY > 0 ? -le : le;
350
+ n((j) => {
351
+ const M = k(j + I);
352
+ return M <= 1 && a({ x: 0, y: 0 }), M;
353
353
  });
354
354
  }, []);
355
- const v = q(
356
- (u) => {
357
- u.preventDefault(), h.current = !1, l(!0), c.current = { x: u.clientX, y: u.clientY }, p.current = { ...s }, u.target.setPointerCapture(u.pointerId);
355
+ const f = q(
356
+ (g) => {
357
+ g.preventDefault(), m.current = !1, l(!0), c.current = { x: g.clientX, y: g.clientY }, p.current = { ...s }, g.target.setPointerCapture(g.pointerId);
358
358
  },
359
359
  [s]
360
360
  ), R = q(
361
- (u) => {
361
+ (g) => {
362
362
  if (!i) return;
363
- const _ = u.clientX - c.current.x, w = u.clientY - c.current.y;
364
- if ((Math.abs(_) > 3 || Math.abs(w) > 3) && (h.current = !0), t <= 1) return;
365
- const y = {
366
- x: p.current.x + _ / t,
367
- y: p.current.y + w / t
363
+ const I = g.clientX - c.current.x, j = g.clientY - c.current.y;
364
+ if ((Math.abs(I) > 3 || Math.abs(j) > 3) && (m.current = !0), t <= 1) return;
365
+ const M = {
366
+ x: p.current.x + I / t,
367
+ y: p.current.y + j / t
368
368
  };
369
369
  a(
370
- Qr(y, t, b.current, x.current)
370
+ Qr(M, t, x.current, y.current)
371
371
  );
372
372
  },
373
373
  [i, t]
374
374
  ), P = q(() => {
375
- const u = h.current;
376
- l(!1), !u && n((_) => _ > 1 ? (a({ x: 0, y: 0 }), 1) : Kr);
377
- }, []), j = t > 1;
375
+ const g = m.current;
376
+ l(!1), !g && n((I) => I > 1 ? (a({ x: 0, y: 0 }), 1) : Kr);
377
+ }, []), E = t > 1;
378
378
  return /* @__PURE__ */ d(
379
379
  "div",
380
380
  {
381
381
  className: "relative size-full flex items-center justify-center select-none",
382
- onClick: (u) => u.stopPropagation(),
382
+ onClick: (g) => g.stopPropagation(),
383
383
  children: [
384
384
  /* @__PURE__ */ r(
385
385
  "div",
386
386
  {
387
- ref: b,
388
- className: m(
387
+ ref: x,
388
+ className: h(
389
389
  "overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",
390
- j && "size-full"
390
+ E && "size-full"
391
391
  ),
392
- onPointerDown: v,
392
+ onPointerDown: f,
393
393
  onPointerMove: R,
394
394
  onPointerUp: P,
395
395
  onPointerCancel: P,
396
396
  style: {
397
- cursor: i ? "grabbing" : j ? "grab" : "zoom-in",
397
+ cursor: i ? "grabbing" : E ? "grab" : "zoom-in",
398
398
  touchAction: "none"
399
399
  },
400
400
  children: /* @__PURE__ */ r(
401
401
  "img",
402
402
  {
403
- ref: x,
403
+ ref: y,
404
404
  src: e,
405
405
  alt: o,
406
406
  className: "block max-w-full object-contain pointer-events-none",
@@ -416,15 +416,15 @@ function At({
416
416
  }
417
417
  ),
418
418
  /* @__PURE__ */ d("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100", children: [
419
- /* @__PURE__ */ r(we, { onClick: M, label: "Zoom out", disabled: t <= pt, children: /* @__PURE__ */ r(nr, { className: "size-3.5" }) }),
419
+ /* @__PURE__ */ r(we, { onClick: _, label: "Zoom out", disabled: t <= pt, children: /* @__PURE__ */ r(nr, { className: "size-3.5" }) }),
420
420
  /* @__PURE__ */ d("span", { className: "text-white text-xs font-medium min-w-[3ch] text-center tabular-nums", children: [
421
421
  Math.round(t * 100),
422
422
  "%"
423
423
  ] }),
424
- /* @__PURE__ */ r(we, { onClick: C, label: "Zoom in", disabled: t >= mt, children: /* @__PURE__ */ r(sr, { className: "size-3.5" }) }),
425
- j && /* @__PURE__ */ d(Q, { children: [
424
+ /* @__PURE__ */ r(we, { onClick: z, label: "Zoom in", disabled: t >= ht, children: /* @__PURE__ */ r(sr, { className: "size-3.5" }) }),
425
+ E && /* @__PURE__ */ d(Q, { children: [
426
426
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-white/30 mx-0.5" }),
427
- /* @__PURE__ */ r(we, { onClick: f, label: "Reset zoom", children: /* @__PURE__ */ r(ar, { className: "size-3.5" }) })
427
+ /* @__PURE__ */ r(we, { onClick: v, label: "Reset zoom", children: /* @__PURE__ */ r(ar, { className: "size-3.5" }) })
428
428
  ] })
429
429
  ] })
430
430
  ]
@@ -450,16 +450,16 @@ function we({
450
450
  }
451
451
  function Ft({ attachment: e }) {
452
452
  const { name: o, size: t, type: n, url: s } = e, a = n.startsWith("image/"), i = n.startsWith("video/"), l = n.startsWith("audio/"), c = n === "application/pdf";
453
- return l ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "w-full shrink-0 overflow-hidden", children: /* @__PURE__ */ d("audio", { controls: !0, className: "w-full", children: [
453
+ return l ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "w-full shrink-0 overflow-hidden", children: /* @__PURE__ */ d("audio", { controls: !0, className: "w-full", children: [
454
454
  /* @__PURE__ */ r("source", { src: s, type: n }),
455
455
  "Your browser does not support the audio tag."
456
- ] }) }) }) : 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: [
456
+ ] }) }) }) : i ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "w-full border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ d("video", { controls: !0, children: [
457
457
  /* @__PURE__ */ r("source", { src: s, type: n }),
458
458
  "Your browser does not support the video tag."
459
459
  ] }) }) }) : a ? /* @__PURE__ */ r(
460
460
  ze,
461
461
  {
462
- trigger: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ r("img", { src: s, className: "object-cover size-16", alt: o }) }) }) }),
462
+ trigger: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ r("img", { src: s, className: "object-cover size-16", alt: o }) }) }) }),
463
463
  children: /* @__PURE__ */ r(
464
464
  Ce,
465
465
  {
@@ -469,13 +469,13 @@ function Ft({ attachment: e }) {
469
469
  }
470
470
  )
471
471
  }
472
- ) : c ? /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(
472
+ ) : c ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
473
473
  "a",
474
474
  {
475
475
  href: s,
476
476
  target: "_blank",
477
477
  rel: "noopener noreferrer",
478
- className: m(
478
+ className: h(
479
479
  "block size-fit max-w-[min(100%,16rem)] shrink-0 rounded-2xl border",
480
480
  "bg-background/80 transition-colors hover:bg-accent/60",
481
481
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
@@ -484,7 +484,7 @@ function Ft({ attachment: e }) {
484
484
  /* @__PURE__ */ r(
485
485
  "div",
486
486
  {
487
- className: m(
487
+ className: h(
488
488
  "flex size-10 shrink-0 items-center justify-center rounded-xl",
489
489
  "bg-secondary text-muted-foreground"
490
490
  ),
@@ -496,7 +496,7 @@ function Ft({ attachment: e }) {
496
496
  /* @__PURE__ */ r(
497
497
  "span",
498
498
  {
499
- className: m(
499
+ className: h(
500
500
  "text-xs font-medium text-foreground line-clamp-1",
501
501
  "break-words [word-break:break-word]"
502
502
  // `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
@@ -511,14 +511,14 @@ function Ft({ attachment: e }) {
511
511
  ] })
512
512
  ] })
513
513
  }
514
- ) }) : /* @__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: [
514
+ ) }) : /* @__PURE__ */ r(Y, { 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: [
515
515
  /* @__PURE__ */ r(
516
516
  "a",
517
517
  {
518
518
  href: s,
519
519
  target: "_blank",
520
520
  rel: "noopener noreferrer",
521
- className: m(
521
+ className: h(
522
522
  "text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600",
523
523
  "break-words [word-break:break-word]"
524
524
  // `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
@@ -532,7 +532,7 @@ function Ft({ attachment: e }) {
532
532
  ] })
533
533
  ] }) }) });
534
534
  }
535
- const Ht = W.memo(
535
+ const Ht = L.memo(
536
536
  Ar,
537
537
  (e, o) => e.children === o.children && e.className === o.className
538
538
  );
@@ -541,7 +541,7 @@ function Ne({
541
541
  messageType: o,
542
542
  messageId: t
543
543
  }) {
544
- const { anchorTarget: n } = N();
544
+ const { anchorTarget: n } = C();
545
545
  return /* @__PURE__ */ r(
546
546
  Ht,
547
547
  {
@@ -581,15 +581,15 @@ function Ne({
581
581
  function te() {
582
582
  const {
583
583
  widgetCtx: { org: e }
584
- } = E(), {
584
+ } = O(), {
585
585
  sessionState: { session: o }
586
- } = Y(), t = N(), {
586
+ } = U(), t = C(), {
587
587
  messagesState: { messages: n }
588
- } = O(), {
588
+ } = A(), {
589
589
  routerState: { screen: s }
590
- } = F();
590
+ } = H();
591
591
  return {
592
- react: W,
592
+ react: L,
593
593
  org: e,
594
594
  session: o,
595
595
  config: t,
@@ -617,27 +617,27 @@ function fe(e) {
617
617
  classNames: p
618
618
  } = e;
619
619
  if (n !== "AI" && n !== "AGENT") return null;
620
- const { message: b, variant: x = "default" } = o;
620
+ const { message: x, variant: y = "default" } = o;
621
621
  return /* @__PURE__ */ d(
622
622
  "div",
623
623
  {
624
- ...g((c == null ? void 0 : c.messageContainer) ?? "chat/agent_msg/root"),
625
- className: m(
624
+ ...w((c == null ? void 0 : c.messageContainer) ?? "chat/agent_msg/root"),
625
+ className: h(
626
626
  "w-5/6 flex flex-col items-start gap-1",
627
627
  p == null ? void 0 : p.messageContainer
628
628
  ),
629
629
  children: [
630
- s && s.length > 0 && /* @__PURE__ */ r("div", { className: "w-full gap-1 flex flex-row flex-wrap items-center justify-start", children: s == null ? void 0 : s.map((h) => /* @__PURE__ */ r(Ft, { attachment: h }, h.id)) }),
631
- b.length > 0 && /* @__PURE__ */ d("div", { className: "flex flex-row gap-2", children: [
630
+ s && s.length > 0 && /* @__PURE__ */ r("div", { className: "w-full gap-1 flex flex-row flex-wrap items-center justify-start", children: s == null ? void 0 : s.map((m) => /* @__PURE__ */ r(Ft, { attachment: m }, m.id)) }),
631
+ x.length > 0 && /* @__PURE__ */ d("div", { className: "flex flex-row gap-2", children: [
632
632
  /* @__PURE__ */ r(
633
633
  "div",
634
634
  {
635
- ...g((c == null ? void 0 : c.message) ?? "chat/agent_msg/msg"),
635
+ ...w((c == null ? void 0 : c.message) ?? "chat/agent_msg/msg"),
636
636
  "data-first": a,
637
637
  "data-last": i,
638
638
  "data-alone": l,
639
- "data-variant": x,
640
- className: m(
639
+ "data-variant": y,
640
+ className: h(
641
641
  "transition-all",
642
642
  "w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground",
643
643
  "leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline",
@@ -645,14 +645,14 @@ function fe(e) {
645
645
  // `[word-break:break-word]` is deprecated but works in the browser, while `break-words` which is `[overflow-wrap: break-word]` does not work
646
646
  // No need to add "whitespace-pre-wrap" in the agent or bot message because it is markup and content appear on separate lines as expected
647
647
  // Adding "whitespace-pre-wrap" will result in unnecessarily huge line breaks
648
- x === "error" && "bg-destructive/15 text-destructive",
648
+ y === "error" && "bg-destructive/15 text-destructive",
649
649
  // We're using the booleans directly here, not the data attributes, to make any external styling more specific than this
650
650
  a && !l && "rounded-bl-md",
651
651
  i && !l && "rounded-tl-md",
652
652
  !a && !i && !l && "rounded-l-md",
653
653
  p == null ? void 0 : p.message
654
654
  ),
655
- children: /* @__PURE__ */ r(Ne, { messageType: n, messageId: t, children: b })
655
+ children: /* @__PURE__ */ r(Ne, { messageType: n, messageId: t, children: x })
656
656
  }
657
657
  ),
658
658
  /* @__PURE__ */ r(Jr, { currentMessage: e })
@@ -668,7 +668,7 @@ const Se = J.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
668
668
  ee.Root,
669
669
  {
670
670
  ref: t,
671
- className: m(
671
+ className: h(
672
672
  "relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",
673
673
  // 'border',
674
674
  e
@@ -681,7 +681,7 @@ const _e = J.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
681
681
  ee.Image,
682
682
  {
683
683
  ref: t,
684
- className: m("aspect-square h-full w-full", e),
684
+ className: h("aspect-square h-full w-full", e),
685
685
  ...o
686
686
  }
687
687
  ));
@@ -690,7 +690,7 @@ const Ie = J.forwardRef(({ className: e, ...o }, t) => /* @__PURE__ */ r(
690
690
  ee.Fallback,
691
691
  {
692
692
  ref: t,
693
- className: m(
693
+ className: h(
694
694
  "flex size-full text-xs items-center justify-center rounded-lg",
695
695
  e
696
696
  ),
@@ -710,17 +710,17 @@ function xe({
710
710
  }
711
711
  function to({ agent: e }) {
712
712
  return /* @__PURE__ */ r(T, { children: /* @__PURE__ */ d(
713
- k,
713
+ b,
714
714
  {
715
- ...g("chat/bot_loading/root"),
715
+ ...w("chat/bot_loading/root"),
716
716
  className: "flex flex-row items-end w-full gap-2 animate-pulse",
717
717
  children: [
718
718
  /* @__PURE__ */ r(xe, { agent: e }),
719
719
  /* @__PURE__ */ d(
720
720
  "div",
721
721
  {
722
- ...g("chat/bot_loading/bouncing_dots_container"),
723
- className: m(
722
+ ...w("chat/bot_loading/bouncing_dots_container"),
723
+ className: h(
724
724
  "flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"
725
725
  // 'border',
726
726
  ),
@@ -740,7 +740,7 @@ const Wt = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;-
740
740
  {
741
741
  ref: n,
742
742
  sideOffset: o,
743
- className: m(
743
+ className: h(
744
744
  "z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
745
745
  e
746
746
  ),
@@ -754,7 +754,7 @@ function oe({
754
754
  side: t,
755
755
  align: n
756
756
  }) {
757
- const { disableTooltips: s } = N();
757
+ const { disableTooltips: s } = C();
758
758
  return !o || s ? e : /* @__PURE__ */ d(oo, { children: [
759
759
  /* @__PURE__ */ r(no, { asChild: !0, children: e }),
760
760
  /* @__PURE__ */ r(
@@ -769,12 +769,12 @@ function oe({
769
769
  )
770
770
  ] });
771
771
  }
772
- const ht = 450;
773
- function L() {
774
- const [e, o] = W.useState(() => (window.top || window).innerWidth < ht);
775
- return W.useEffect(() => {
772
+ const mt = 450;
773
+ function $() {
774
+ const [e, o] = L.useState(() => (window.top || window).innerWidth < mt);
775
+ return L.useEffect(() => {
776
776
  const t = window.top || window, n = () => {
777
- o(t.innerWidth < ht);
777
+ o(t.innerWidth < mt);
778
778
  };
779
779
  return n(), t.addEventListener("resize", n), () => {
780
780
  t.removeEventListener("resize", n);
@@ -786,17 +786,17 @@ const ce = {
786
786
  transitionDuration: "1000ms"
787
787
  };
788
788
  function G() {
789
- var x, h, z, f, C, M, v, R, P, j, u, _, w, y, I, U, ie, Re, je, Pe, Ee, Oe, Ae, Fe, He, We, Le, $e, Be, Ye, Ue, Xe, qe, Ve, Ge, Ze, Ke, Qe, Je, et, tt, rt, ot, nt, st, at, it;
790
- const { dir: e } = ye(), { isSmallScreen: o } = L(), { theme: t, inline: n } = N(), s = (X) => n ? "100%" : X, a = (X, ue) => o ? `100dv${X}` : ue, i = (X, ue) => s(a(X, ue)), l = {
791
- zIndex: ((x = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : x.zIndex) ?? 1e7,
789
+ var y, m, k, v, z, _, f, R, P, E, g, I, j, M, u, S, ie, Re, je, Pe, Ee, Oe, Ae, Fe, He, We, Le, $e, Be, Ye, Ue, Xe, qe, Ve, Ge, Ze, Ke, Qe, Je, et, tt, rt, ot, nt, st, at, it;
790
+ const { dir: e } = ye(), { isSmallScreen: o } = $(), { theme: t, inline: n } = C(), s = (X) => n ? "100%" : X, a = (X, ue) => o ? `100dv${X}` : ue, i = (X, ue) => s(a(X, ue)), l = {
791
+ zIndex: ((y = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : y.zIndex) ?? 1e7,
792
792
  offset: {
793
- bottom: ((z = (h = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : h.offset) == null ? void 0 : z.bottom) ?? 20,
794
- right: ((C = (f = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : f.offset) == null ? void 0 : C.right) ?? (e === "ltr" ? 20 : "initial"),
795
- left: ((v = (M = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : M.offset) == null ? void 0 : v.left) ?? (e === "rtl" ? 20 : "initial")
793
+ bottom: ((k = (m = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : m.offset) == null ? void 0 : k.bottom) ?? 20,
794
+ right: ((z = (v = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : v.offset) == null ? void 0 : z.right) ?? (e === "ltr" ? 20 : "initial"),
795
+ left: ((f = (_ = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : _.offset) == null ? void 0 : f.left) ?? (e === "rtl" ? 20 : "initial")
796
796
  },
797
797
  size: {
798
798
  button: ((P = (R = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : R.size) == null ? void 0 : P.button) ?? 48,
799
- icon: ((u = (j = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : j.size) == null ? void 0 : u.icon) ?? 24
799
+ icon: ((g = (E = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : E.size) == null ? void 0 : g.icon) ?? 24
800
800
  }
801
801
  }, c = (() => {
802
802
  const X = e === "ltr" ? l.offset.right : l.offset.left;
@@ -806,12 +806,12 @@ function G() {
806
806
  primaryColor: (t == null ? void 0 : t.primaryColor) ?? "hsl(0 0% 9%)",
807
807
  widgetTrigger: l,
808
808
  widgetContentContainer: {
809
- borderRadius: o ? "0px" : ((_ = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : _.borderRadius) ?? "32px",
810
- zIndex: ((w = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : w.zIndex) ?? l.zIndex + 1,
811
- outline: ((y = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : y.outline) ?? "none",
809
+ borderRadius: o ? "0px" : ((I = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : I.borderRadius) ?? "32px",
810
+ zIndex: ((j = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : j.zIndex) ?? l.zIndex + 1,
811
+ outline: ((M = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : M.outline) ?? "none",
812
812
  // was: '1px solid'
813
- outlineColor: ((I = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : I.outlineColor) ?? "hsl(0 0% 50% / .5)",
814
- boxShadow: ((U = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : U.boxShadow) ?? "0 0px 100px 0px rgb(0 0 0 / 0.25)",
813
+ outlineColor: ((u = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : u.outlineColor) ?? "hsl(0 0% 50% / .5)",
814
+ boxShadow: ((S = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : S.boxShadow) ?? "0 0px 100px 0px rgb(0 0 0 / 0.25)",
815
815
  transitionProperty: ((ie = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : ie.transitionProperty) ?? "all",
816
816
  transitionTimingFunction: ((Re = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Re.transitionTimingFunction) ?? ce.transitionTimingFunction,
817
817
  transitionDuration: ((je = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : je.transitionDuration) ?? ce.transitionDuration,
@@ -850,7 +850,7 @@ function G() {
850
850
  }
851
851
  }
852
852
  }
853
- }, b = {
853
+ }, x = {
854
854
  // Subtract the offset.bottom twice so that it adds a bit of padding to the top
855
855
  // Subtract the distance between the trigger and the widget content container
856
856
  // Subtract the invisible padding of the trigger (for the wobble effect)
@@ -890,7 +890,7 @@ function G() {
890
890
  };
891
891
  return {
892
892
  theme: p,
893
- computed: b,
893
+ computed: x,
894
894
  cssVars: so({
895
895
  palette: p.palette,
896
896
  primary: p.primaryColor
@@ -980,11 +980,11 @@ function $t(e) {
980
980
  case "slate":
981
981
  return s;
982
982
  default:
983
- return A(e, $t.name), o;
983
+ return F(e, $t.name), o;
984
984
  }
985
985
  }
986
986
  function Bt() {
987
- const { contentIframeRef: e } = E(), { inline: o } = N();
987
+ const { contentIframeRef: e } = O(), { inline: o } = C();
988
988
  return {
989
989
  setWidth: (t) => {
990
990
  var n;
@@ -1006,7 +1006,7 @@ function Te({
1006
1006
  width: e,
1007
1007
  height: o
1008
1008
  }) {
1009
- const { isSmallScreen: t } = L(), { setWidth: n, setHeight: s } = Bt();
1009
+ const { isSmallScreen: t } = $(), { setWidth: n, setHeight: s } = Bt();
1010
1010
  se(() => {
1011
1011
  e && n(e), o && s(o);
1012
1012
  }, [t, o, e, n, s]);
@@ -1035,9 +1035,9 @@ function ne({
1035
1035
  case "Maximize2":
1036
1036
  return ur;
1037
1037
  case "Minimize":
1038
- return hr;
1039
- case "Minimize2":
1040
1038
  return mr;
1039
+ case "Minimize2":
1040
+ return hr;
1041
1041
  case "Shrink":
1042
1042
  return pr;
1043
1043
  case "SquareCheck":
@@ -1051,10 +1051,10 @@ function ne({
1051
1051
  case void 0:
1052
1052
  return ut;
1053
1053
  default:
1054
- return A(e, ne.name), ut;
1054
+ return F(e, ne.name), ut;
1055
1055
  }
1056
1056
  })();
1057
- return /* @__PURE__ */ r(t, { className: m("size-4", o) });
1057
+ return /* @__PURE__ */ r(t, { className: h("size-4", o) });
1058
1058
  }
1059
1059
  function ao() {
1060
1060
  var t;
@@ -1069,9 +1069,9 @@ function io({ fallback: e }) {
1069
1069
  function Me() {
1070
1070
  const {
1071
1071
  widgetCtx: { org: e }
1072
- } = E(), {
1072
+ } = O(), {
1073
1073
  routerState: { screen: o }
1074
- } = F(), { textContent: t } = N();
1074
+ } = H(), { textContent: t } = C();
1075
1075
  return (() => {
1076
1076
  var s, a;
1077
1077
  switch (o) {
@@ -1082,7 +1082,7 @@ function Me() {
1082
1082
  case "welcome":
1083
1083
  return;
1084
1084
  default:
1085
- A(o, Me.name);
1085
+ F(o, Me.name);
1086
1086
  return;
1087
1087
  }
1088
1088
  })() ?? e.name ?? "Chat";
@@ -1090,23 +1090,23 @@ function Me() {
1090
1090
  function lo(e) {
1091
1091
  switch (e) {
1092
1092
  case "chat":
1093
- return g("chat/header");
1093
+ return w("chat/header");
1094
1094
  case "sessions":
1095
- return g("sessions/header");
1095
+ return w("sessions/header");
1096
1096
  case "welcome":
1097
1097
  return;
1098
1098
  default:
1099
- A(e, Me.name);
1099
+ F(e, Me.name);
1100
1100
  return;
1101
1101
  }
1102
1102
  }
1103
1103
  function co() {
1104
- const { router: e } = N(), {
1104
+ const { router: e } = C(), {
1105
1105
  routerState: { screen: o },
1106
1106
  toSessionsScreen: t
1107
- } = F();
1107
+ } = H();
1108
1108
  return o !== "chat" || e != null && e.chatScreenOnly ? null : /* @__PURE__ */ r(
1109
- S,
1109
+ N,
1110
1110
  {
1111
1111
  variant: "ghost",
1112
1112
  size: "fit",
@@ -1119,9 +1119,9 @@ function co() {
1119
1119
  function po({
1120
1120
  button: e
1121
1121
  }) {
1122
- const { setIsOpen: o } = V(), { isSmallScreen: t } = L();
1122
+ const { setIsOpen: o } = V(), { isSmallScreen: t } = $();
1123
1123
  return t && e.hideOnSmallScreen || !t && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
1124
- S,
1124
+ N,
1125
1125
  {
1126
1126
  variant: "ghost",
1127
1127
  size: "fit",
@@ -1139,7 +1139,7 @@ function ve({
1139
1139
  }) {
1140
1140
  const [o, t] = D(!1), {
1141
1141
  routerState: { screen: n }
1142
- } = F(), { isSmallScreen: s } = L(), { theme: a } = G(), { setWidth: i, setHeight: l } = Bt();
1142
+ } = H(), { isSmallScreen: s } = $(), { theme: a } = G(), { setWidth: i, setHeight: l } = Bt();
1143
1143
  if (n !== "chat" && n !== "sessions") return null;
1144
1144
  const c = (() => {
1145
1145
  switch (n) {
@@ -1148,7 +1148,7 @@ function ve({
1148
1148
  case "sessions":
1149
1149
  return a.screens.sessions.height;
1150
1150
  default:
1151
- return A(n, ve.name), a.screens.chat.height;
1151
+ return F(n, ve.name), a.screens.chat.height;
1152
1152
  }
1153
1153
  })(), p = (() => {
1154
1154
  switch (n) {
@@ -1157,21 +1157,21 @@ function ve({
1157
1157
  case "sessions":
1158
1158
  return a.screens.sessions.width;
1159
1159
  default:
1160
- return A(n, ve.name), a.screens.chat.width;
1160
+ return F(n, ve.name), a.screens.chat.width;
1161
1161
  }
1162
- })(), b = () => {
1163
- t((x) => {
1164
- const h = !x;
1165
- return l(h ? "100vh" : c), i(h ? `max(40vw, ${p})` : p), h;
1162
+ })(), x = () => {
1163
+ t((y) => {
1164
+ const m = !y;
1165
+ return l(m ? "100vh" : c), i(m ? `max(40vw, ${p})` : p), m;
1166
1166
  });
1167
1167
  };
1168
1168
  return s && e.hideOnSmallScreen || !s && e.hideOnLargeScreen ? null : /* @__PURE__ */ r(
1169
- S,
1169
+ N,
1170
1170
  {
1171
1171
  variant: "ghost",
1172
1172
  size: "fit",
1173
1173
  className: "rounded-full",
1174
- onClick: b,
1174
+ onClick: x,
1175
1175
  children: /* @__PURE__ */ r(
1176
1176
  ne,
1177
1177
  {
@@ -1184,10 +1184,10 @@ function ve({
1184
1184
  function Yt({
1185
1185
  button: e
1186
1186
  }) {
1187
- var C, M;
1188
- const { close: o } = he(), { widgetCtx: t } = E(), { setIsOpen: n } = V(), { resolveSession: s, sessionState: a } = Y(), { isSmallScreen: i } = L(), l = !a.session, c = ((C = a.session) == null ? void 0 : C.isOpened) === !1, p = e.onResolved || "stay-in-chat", b = e.behaviorBeforeSessionCreation || "disabled", x = e.behaviorIfSessionIsResolved || "disabled", h = !!(a.isResolvingSession || l && b === "disabled" || c && x === "disabled"), z = async () => {
1189
- const { success: v, error: R } = await s();
1190
- if (o(), !v) return console.error(R);
1187
+ var z, _;
1188
+ const { close: o } = me(), { widgetCtx: t } = O(), { setIsOpen: n } = V(), { resolveSession: s, sessionState: a } = U(), { isSmallScreen: i } = $(), l = !a.session, c = ((z = a.session) == null ? void 0 : z.isOpened) === !1, p = e.onResolved || "stay-in-chat", x = e.behaviorBeforeSessionCreation || "disabled", y = e.behaviorIfSessionIsResolved || "disabled", m = !!(a.isResolvingSession || l && x === "disabled" || c && y === "disabled"), k = async () => {
1189
+ const { success: f, error: R } = await s();
1190
+ if (o(), !f) return console.error(R);
1191
1191
  switch (p) {
1192
1192
  case "stay-in-chat":
1193
1193
  return;
@@ -1201,25 +1201,25 @@ function Yt({
1201
1201
  n(!1), t.resetChat();
1202
1202
  break;
1203
1203
  default:
1204
- A(p, Yt.name);
1204
+ F(p, Yt.name);
1205
1205
  break;
1206
1206
  }
1207
- }, f = () => {
1207
+ }, v = () => {
1208
1208
  if (l)
1209
- switch (b) {
1209
+ switch (x) {
1210
1210
  case "disabled":
1211
1211
  return;
1212
1212
  case "close-widget":
1213
1213
  n(!1);
1214
1214
  break;
1215
1215
  default:
1216
- A(
1217
- b,
1218
- f.name
1216
+ F(
1217
+ x,
1218
+ v.name
1219
1219
  );
1220
1220
  }
1221
1221
  if (c)
1222
- switch (x) {
1222
+ switch (y) {
1223
1223
  case "disabled":
1224
1224
  return;
1225
1225
  case "close-widget":
@@ -1234,22 +1234,22 @@ function Yt({
1234
1234
  }, 200);
1235
1235
  break;
1236
1236
  default:
1237
- A(
1238
- x,
1239
- f.name
1237
+ F(
1238
+ y,
1239
+ v.name
1240
1240
  );
1241
1241
  }
1242
1242
  };
1243
- return i && e.hideOnSmallScreen || !i && e.hideOnLargeScreen ? null : ((M = e.confirmation) == null ? void 0 : M.type) === "modal" && !c && !l ? /* @__PURE__ */ r(
1243
+ return i && e.hideOnSmallScreen || !i && e.hideOnLargeScreen ? null : ((_ = e.confirmation) == null ? void 0 : _.type) === "modal" && !c && !l ? /* @__PURE__ */ r(
1244
1244
  ze,
1245
1245
  {
1246
1246
  trigger: /* @__PURE__ */ r(
1247
- S,
1247
+ N,
1248
1248
  {
1249
1249
  variant: "ghost",
1250
1250
  size: "fit",
1251
1251
  className: "rounded-full",
1252
- disabled: h,
1252
+ disabled: m,
1253
1253
  children: /* @__PURE__ */ r(ne, { name: e.icon })
1254
1254
  }
1255
1255
  ),
@@ -1258,7 +1258,7 @@ function Yt({
1258
1258
  /* @__PURE__ */ r(jt, { children: /* @__PURE__ */ r(Ot, { children: e.confirmation.description || "Are you sure you want to close this conversation?" }) }),
1259
1259
  /* @__PURE__ */ d(Pt, { children: [
1260
1260
  /* @__PURE__ */ r(
1261
- S,
1261
+ N,
1262
1262
  {
1263
1263
  variant: "secondary",
1264
1264
  onClick: o,
@@ -1267,10 +1267,10 @@ function Yt({
1267
1267
  }
1268
1268
  ),
1269
1269
  /* @__PURE__ */ r(
1270
- S,
1270
+ N,
1271
1271
  {
1272
1272
  variant: "destructive",
1273
- onClick: z,
1273
+ onClick: k,
1274
1274
  disabled: a.isResolvingSession,
1275
1275
  children: e.confirmation.confirmButtonText || "Yes"
1276
1276
  }
@@ -1279,13 +1279,13 @@ function Yt({
1279
1279
  ] })
1280
1280
  }
1281
1281
  ) : /* @__PURE__ */ r(
1282
- S,
1282
+ N,
1283
1283
  {
1284
1284
  variant: "ghost",
1285
1285
  size: "fit",
1286
1286
  className: "rounded-full",
1287
- onClick: c || l ? f : z,
1288
- disabled: h,
1287
+ onClick: c || l ? v : k,
1288
+ disabled: m,
1289
1289
  children: /* @__PURE__ */ r(ne, { name: e.icon })
1290
1290
  }
1291
1291
  );
@@ -1299,19 +1299,19 @@ function be({ button: e }) {
1299
1299
  case "resolve-session":
1300
1300
  return /* @__PURE__ */ r(Yt, { button: e });
1301
1301
  default:
1302
- return A(e, be.name), null;
1302
+ return F(e, be.name), null;
1303
1303
  }
1304
1304
  }
1305
- const mo = {
1305
+ const ho = {
1306
1306
  functionality: "close-widget",
1307
1307
  hideOnLargeScreen: !0,
1308
1308
  icon: "X"
1309
1309
  };
1310
- function ho() {
1310
+ function mo() {
1311
1311
  const {
1312
1312
  routerState: { screen: e }
1313
- } = F(), { headerButtons: o } = N(), t = e === "chat" ? o == null ? void 0 : o.chatScreen : e === "sessions" ? o == null ? void 0 : o.sessionsScreen : [];
1314
- return !t || t.length === 0 ? /* @__PURE__ */ r(be, { button: mo }) : /* @__PURE__ */ r(Q, { children: t.map((n) => /* @__PURE__ */ r(
1313
+ } = H(), { headerButtons: o } = C(), t = e === "chat" ? o == null ? void 0 : o.chatScreen : e === "sessions" ? o == null ? void 0 : o.sessionsScreen : [];
1314
+ return !t || t.length === 0 ? /* @__PURE__ */ r(be, { button: ho }) : /* @__PURE__ */ r(Q, { children: t.map((n) => /* @__PURE__ */ r(
1315
1315
  be,
1316
1316
  {
1317
1317
  button: n
@@ -1322,14 +1322,14 @@ function ho() {
1322
1322
  function Ut() {
1323
1323
  const {
1324
1324
  routerState: { screen: e }
1325
- } = F(), o = lo(e), t = Me();
1325
+ } = H(), o = lo(e), t = Me();
1326
1326
  return /* @__PURE__ */ d("header", { ...o, className: "py-2 px-4 shrink-0", children: [
1327
1327
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1328
1328
  /* @__PURE__ */ r(co, {}),
1329
1329
  /* @__PURE__ */ r(
1330
1330
  "div",
1331
1331
  {
1332
- className: m(
1332
+ className: h(
1333
1333
  "flex-1 h-8 flex items-center",
1334
1334
  e === "sessions" && "ps-2"
1335
1335
  ),
@@ -1341,24 +1341,24 @@ function Ut() {
1341
1341
  )
1342
1342
  }
1343
1343
  ),
1344
- /* @__PURE__ */ r(ho, {})
1344
+ /* @__PURE__ */ r(mo, {})
1345
1345
  ] }),
1346
1346
  /* @__PURE__ */ r(ao, {})
1347
1347
  ] });
1348
1348
  }
1349
1349
  function Xt({ className: e }) {
1350
- return /* @__PURE__ */ r(kr, { className: m("size-4 animate-spin", e) });
1350
+ return /* @__PURE__ */ r(kr, { className: h("size-4 animate-spin", e) });
1351
1351
  }
1352
1352
  function uo() {
1353
1353
  const {
1354
1354
  messagesState: { isInitialFetchLoading: e }
1355
- } = O(), { isSmallScreen: o } = L(), { activeMode: t, Component: n } = yt();
1355
+ } = A(), { isSmallScreen: o } = $(), { activeMode: t, Component: n } = yt();
1356
1356
  return {
1357
1357
  isCanvasOpen: !e && !o && !!t && !!n
1358
1358
  };
1359
1359
  }
1360
1360
  function go() {
1361
- const e = te(), { activeMode: o, Component: t } = yt(), { sendMessage: n } = O(), { createStateCheckpoint: s } = Y(), [a, i] = D(!1), l = async (c) => {
1361
+ const e = te(), { activeMode: o, Component: t } = yt(), { sendMessage: n } = A(), { createStateCheckpoint: s } = U(), [a, i] = D(!1), l = async (c) => {
1362
1362
  try {
1363
1363
  i(!0), await n(c);
1364
1364
  } catch (p) {
@@ -1378,15 +1378,15 @@ function go() {
1378
1378
  }
1379
1379
  );
1380
1380
  }
1381
- const H = W.forwardRef(
1381
+ const W = L.forwardRef(
1382
1382
  (e, o) => {
1383
1383
  var t, n, s;
1384
1384
  return /* @__PURE__ */ r(
1385
- k,
1385
+ b,
1386
1386
  {
1387
1387
  ...e,
1388
1388
  ref: o,
1389
- className: m("overflow-hidden", e.className),
1389
+ className: h("overflow-hidden", e.className),
1390
1390
  overrides: {
1391
1391
  initial: { height: 0, opacity: 0, ...(t = e.overrides) == null ? void 0 : t.initial },
1392
1392
  animate: { height: "auto", opacity: 1, ...(n = e.overrides) == null ? void 0 : n.animate },
@@ -1396,7 +1396,7 @@ const H = W.forwardRef(
1396
1396
  );
1397
1397
  }
1398
1398
  );
1399
- H.displayName = "MotionDiv__VerticalReveal";
1399
+ W.displayName = "MotionDiv__VerticalReveal";
1400
1400
  const wo = [
1401
1401
  {
1402
1402
  label: "Terrible",
@@ -1425,58 +1425,58 @@ const wo = [
1425
1425
  }
1426
1426
  ];
1427
1427
  function fo() {
1428
- const { isSmallScreen: e } = L(), {
1428
+ const { isSmallScreen: e } = $(), {
1429
1429
  submitCsat: o,
1430
1430
  isCsatRequested: t,
1431
1431
  isCsatSubmitted: n,
1432
1432
  submittedScore: s,
1433
1433
  submittedFeedback: a
1434
- } = kt(), [i, l] = D(null), [c, p] = D(null), b = (h) => {
1435
- l((z) => z === h ? null : h);
1436
- }, x = () => {
1434
+ } = kt(), [i, l] = D(null), [c, p] = D(null), x = (m) => {
1435
+ l((k) => k === m ? null : m);
1436
+ }, y = () => {
1437
1437
  i && o({
1438
1438
  score: i,
1439
1439
  feedback: c || void 0
1440
1440
  });
1441
1441
  };
1442
1442
  return !t && !n ? null : /* @__PURE__ */ d("div", { className: "w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden", children: [
1443
- /* @__PURE__ */ r(T, { mode: "wait", children: t && !i ? /* @__PURE__ */ r(H, { 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(H, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: "You rated the conversation as" }) }, "csat-submitted-title") : null }),
1443
+ /* @__PURE__ */ r(T, { mode: "wait", children: t && !i ? /* @__PURE__ */ r(W, { 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(W, { children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground text-center pt-2", children: "You rated the conversation as" }) }, "csat-submitted-title") : null }),
1444
1444
  /* @__PURE__ */ r(
1445
1445
  "div",
1446
1446
  {
1447
- className: m(
1447
+ className: h(
1448
1448
  "flex gap-4 justify-between pt-2 px-2 pb-2",
1449
1449
  "transition-all",
1450
1450
  n && "gap-0 justify-center"
1451
1451
  ),
1452
- children: wo.map((h) => /* @__PURE__ */ r(
1453
- S,
1452
+ children: wo.map((m) => /* @__PURE__ */ r(
1453
+ N,
1454
1454
  {
1455
- variant: h.value === i ? "secondary" : "ghost",
1455
+ variant: m.value === i ? "secondary" : "ghost",
1456
1456
  size: "selfless",
1457
- className: m(
1457
+ className: h(
1458
1458
  "transition-all overflow-hidden",
1459
1459
  "text-2xl size-8 rounded-full",
1460
1460
  "opacity-35",
1461
1461
  "hover:opacity-100",
1462
1462
  !i && "opacity-100",
1463
- h.value === i && "opacity-100",
1464
- n && h.value !== s && "opacity-0 size-0",
1465
- n && h.value === s && "opacity-100 size-fit text-4xl"
1463
+ m.value === i && "opacity-100",
1464
+ n && m.value !== s && "opacity-0 size-0",
1465
+ n && m.value === s && "opacity-100 size-fit text-4xl"
1466
1466
  ),
1467
- onClick: t ? () => b(h.value) : void 0,
1468
- children: h.emoji
1467
+ onClick: t ? () => x(m.value) : void 0,
1468
+ children: m.emoji
1469
1469
  },
1470
- h.value
1470
+ m.value
1471
1471
  ))
1472
1472
  }
1473
1473
  ),
1474
- /* @__PURE__ */ r(T, { mode: "wait", children: (i || s) && /* @__PURE__ */ r(H, { children: /* @__PURE__ */ d("div", { className: "pb-2 px-2 flex items-end", children: [
1474
+ /* @__PURE__ */ r(T, { mode: "wait", children: (i || s) && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ d("div", { className: "pb-2 px-2 flex items-end", children: [
1475
1475
  /* @__PURE__ */ r(
1476
1476
  "textarea",
1477
1477
  {
1478
1478
  rows: 3,
1479
- className: m(
1479
+ className: h(
1480
1480
  "transition-all",
1481
1481
  "max-h-40 [field-sizing:content]",
1482
1482
  "w-full resize-none",
@@ -1487,18 +1487,18 @@ function fo() {
1487
1487
  n && "text-center"
1488
1488
  ),
1489
1489
  value: n ? a || "" : c || "",
1490
- onChange: t ? (h) => p(h.target.value) : void 0,
1490
+ onChange: t ? (m) => p(m.target.value) : void 0,
1491
1491
  readOnly: n,
1492
1492
  placeholder: t ? "Tell us more... (optional)" : void 0
1493
1493
  }
1494
1494
  ),
1495
1495
  /* @__PURE__ */ r(
1496
- S,
1496
+ N,
1497
1497
  {
1498
1498
  size: "fit",
1499
- onClick: x,
1499
+ onClick: y,
1500
1500
  disabled: !i,
1501
- className: m(
1501
+ className: h(
1502
1502
  "transition-all overflow-hidden",
1503
1503
  "rounded-full size-8 flex items-center justify-center p-0",
1504
1504
  n && "opacity-0 size-0"
@@ -1507,11 +1507,11 @@ function fo() {
1507
1507
  }
1508
1508
  )
1509
1509
  ] }) }, "feedback-box") }),
1510
- /* @__PURE__ */ r("div", { className: m("h-0 transition-[height]", n && "h-4") })
1510
+ /* @__PURE__ */ r("div", { className: h("h-0 transition-[height]", n && "h-4") })
1511
1511
  ] });
1512
1512
  }
1513
1513
  function Z() {
1514
- const { dir: e } = ye(), o = N();
1514
+ const { dir: e } = ye(), o = C();
1515
1515
  return bt(() => {
1516
1516
  const t = Fr(o.language) ? o.language : "en";
1517
1517
  return {
@@ -1527,16 +1527,16 @@ function De({
1527
1527
  className: o,
1528
1528
  ...t
1529
1529
  }) {
1530
- const { sendMessage: n } = O(), s = () => {
1530
+ const { sendMessage: n } = A(), s = () => {
1531
1531
  const a = e.trim();
1532
1532
  a && n({ content: a });
1533
1533
  };
1534
1534
  return /* @__PURE__ */ r(
1535
- S,
1535
+ N,
1536
1536
  {
1537
- ...g("chat/suggested_reply_btn"),
1537
+ ...w("chat/suggested_reply_btn"),
1538
1538
  size: "sm",
1539
- className: m("rounded-xl w-fit", o),
1539
+ className: h("rounded-xl w-fit", o),
1540
1540
  ...t,
1541
1541
  onClick: s,
1542
1542
  children: e
@@ -1548,7 +1548,7 @@ function xo() {
1548
1548
  return /* @__PURE__ */ r(
1549
1549
  "div",
1550
1550
  {
1551
- ...g("chat/might_solve_user_issue_suggested_replies_container"),
1551
+ ...w("chat/might_solve_user_issue_suggested_replies_container"),
1552
1552
  className: "flex items-center gap-2 p-2 pb-0 flex-wrap",
1553
1553
  children: o.map((t) => /* @__PURE__ */ r(
1554
1554
  De,
@@ -1562,8 +1562,8 @@ function xo() {
1562
1562
  );
1563
1563
  }
1564
1564
  function gt() {
1565
- const { sessionState: e } = Y(), { chatFooterItems: o } = N(), t = !!e.session && !e.session.isOpened, n = !t;
1566
- return /* @__PURE__ */ r(T, { mode: "wait", children: o == null ? void 0 : o.map((s, a) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(H, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(Ne, { children: s.message }) }) }, `${s.message}-${a}`)) });
1565
+ const { sessionState: e } = U(), { chatFooterItems: o } = C(), t = !!e.session && !e.session.isOpened, n = !t;
1566
+ return /* @__PURE__ */ r(T, { mode: "wait", children: o == null ? void 0 : o.map((s, a) => s.showWhenSessionIsOpen === !1 && n || s.showWhenSessionIsResolved === !1 && t ? null : /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("div", { className: "pb-2 text-center text-xs", children: /* @__PURE__ */ r(Ne, { children: s.message }) }) }, `${s.message}-${a}`)) });
1567
1567
  }
1568
1568
  function vo({
1569
1569
  file: { status: e, file: o, error: t },
@@ -1608,7 +1608,7 @@ function vo({
1608
1608
  children: /* @__PURE__ */ d(
1609
1609
  "div",
1610
1610
  {
1611
- className: m(
1611
+ className: h(
1612
1612
  e === "uploading" && "opacity-50",
1613
1613
  "group",
1614
1614
  "size-12 border rounded-2xl overflow-hidden relative",
@@ -1620,7 +1620,7 @@ function vo({
1620
1620
  "button",
1621
1621
  {
1622
1622
  type: "button",
1623
- className: m(
1623
+ className: h(
1624
1624
  "absolute bg-black/50 inset-0 size-full z-10 opacity-0",
1625
1625
  "flex items-center justify-center",
1626
1626
  "opacity-0 group-hover:opacity-100 transition"
@@ -1637,46 +1637,46 @@ function vo({
1637
1637
  );
1638
1638
  }
1639
1639
  function bo() {
1640
- var _;
1641
- const { isSmallScreen: e } = L(), o = $(null), { sendMessage: t } = O(), { sessionState: n } = Y(), { t: s } = Z(), [a, i] = D(""), {
1642
- allFiles: l,
1643
- emptyTheFiles: c,
1644
- handleCancelUpload: p,
1645
- appendFiles: b,
1646
- isUploading: x,
1647
- successFiles: h
1648
- } = er(), z = !!((_ = n.session) != null && _.isHandedOff), { isAwaitingBotReply: f } = Ct(), C = (w) => {
1649
- b(w);
1650
- }, M = !a.trim() && h.length === 0, v = async () => {
1651
- if (f || M) return;
1652
- x && console.info("please wait for the file(s) to upload");
1653
- const w = a.trim();
1640
+ var M;
1641
+ const { isSmallScreen: e } = $(), o = B(null), { sendMessage: t } = A(), { sessionState: n } = U(), { disableSendingWhenAwaitingAIReply: s } = C(), { t: a } = Z(), [i, l] = D(""), {
1642
+ allFiles: c,
1643
+ emptyTheFiles: p,
1644
+ handleCancelUpload: x,
1645
+ appendFiles: y,
1646
+ isUploading: m,
1647
+ successFiles: k
1648
+ } = er(), v = !!((M = n.session) != null && M.isHandedOff), { isAwaitingBotReply: z } = Ct(), _ = s !== !1 && z, f = (u) => {
1649
+ y(u);
1650
+ }, R = !i.trim() && k.length === 0, P = async () => {
1651
+ if (_ || R) return;
1652
+ m && console.info("please wait for the file(s) to upload");
1653
+ const u = i.trim();
1654
1654
  t({
1655
- content: w,
1656
- attachments: h.flatMap(
1657
- (y) => y.fileUrl ? [
1655
+ content: u,
1656
+ attachments: k.flatMap(
1657
+ (S) => S.fileUrl ? [
1658
1658
  {
1659
- url: y.fileUrl,
1660
- type: y.file.type,
1661
- name: y.file.name,
1662
- id: y.id,
1663
- size: y.file.size
1659
+ url: S.fileUrl,
1660
+ type: S.file.type,
1661
+ name: S.file.name,
1662
+ id: S.id,
1663
+ size: S.file.size
1664
1664
  }
1665
1665
  ] : []
1666
1666
  )
1667
- }), i(""), c();
1667
+ }), l(""), p();
1668
1668
  }, {
1669
- getRootProps: R,
1670
- getInputProps: P,
1671
- open: j
1669
+ getRootProps: E,
1670
+ getInputProps: g,
1671
+ open: I
1672
1672
  } = Wr({
1673
- onDrop: C,
1673
+ onDrop: f,
1674
1674
  noClick: !0,
1675
1675
  onDropRejected() {
1676
1676
  console.error("unsupported file type, or the file is too large");
1677
1677
  },
1678
1678
  maxSize: 5 * 1024 * 1024,
1679
- accept: z ? {
1679
+ accept: v ? {
1680
1680
  "text/*": [".txt"],
1681
1681
  "image/*": [".png", ".jpg", ".jpeg", ".gif"],
1682
1682
  "application/pdf": [".pdf"]
@@ -1687,23 +1687,23 @@ function bo() {
1687
1687
  "image/webp": [".webp"],
1688
1688
  "application/pdf": [".pdf"]
1689
1689
  }
1690
- }), u = (w) => {
1691
- const y = w.clipboardData;
1692
- y && y.files.length > 0 && C(Array.from(y.files));
1690
+ }), j = (u) => {
1691
+ const S = u.clipboardData;
1692
+ S && S.files.length > 0 && f(Array.from(S.files));
1693
1693
  };
1694
1694
  return /* @__PURE__ */ d(
1695
1695
  "div",
1696
1696
  {
1697
- ...g("chat/input_box/root"),
1697
+ ...w("chat/input_box/root"),
1698
1698
  className: "p-2 relative space-y-1",
1699
- ...R(),
1699
+ ...E(),
1700
1700
  children: [
1701
- /* @__PURE__ */ r("input", { ...P() }),
1701
+ /* @__PURE__ */ r("input", { ...g() }),
1702
1702
  /* @__PURE__ */ d(
1703
1703
  "div",
1704
1704
  {
1705
- ...g("chat/input_box/inner_root"),
1706
- className: m(
1705
+ ...w("chat/input_box/inner_root"),
1706
+ className: h(
1707
1707
  "transition-all",
1708
1708
  "bg-white",
1709
1709
  // 'border',
@@ -1714,48 +1714,48 @@ function bo() {
1714
1714
  /* @__PURE__ */ d(
1715
1715
  "div",
1716
1716
  {
1717
- ...g("chat/input_box/textarea_and_attachments_container"),
1717
+ ...w("chat/input_box/textarea_and_attachments_container"),
1718
1718
  className: "flex flex-col gap-2",
1719
1719
  children: [
1720
- l.length > 0 && /* @__PURE__ */ r(
1720
+ c.length > 0 && /* @__PURE__ */ r(
1721
1721
  "div",
1722
1722
  {
1723
- ...g("chat/input_box/attachments_container"),
1723
+ ...w("chat/input_box/attachments_container"),
1724
1724
  className: "flex items-center gap-1",
1725
- children: /* @__PURE__ */ r(T, { mode: "popLayout", children: l.map((w) => /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(
1725
+ children: /* @__PURE__ */ r(T, { mode: "popLayout", children: c.map((u) => /* @__PURE__ */ r(b, { snapExit: !0, children: /* @__PURE__ */ r(
1726
1726
  vo,
1727
1727
  {
1728
- onCancel: () => p(w.id),
1729
- file: w
1728
+ onCancel: () => x(u.id),
1729
+ file: u
1730
1730
  }
1731
- ) }, w.id)) })
1731
+ ) }, u.id)) })
1732
1732
  }
1733
1733
  ),
1734
1734
  /* @__PURE__ */ r(
1735
1735
  "textarea",
1736
1736
  {
1737
- ...g("chat/input_box/textarea"),
1738
- onPaste: u,
1737
+ ...w("chat/input_box/textarea"),
1738
+ onPaste: j,
1739
1739
  ref: o,
1740
1740
  id: "chat-input",
1741
- value: a,
1741
+ value: i,
1742
1742
  rows: 3,
1743
- className: m(
1743
+ className: h(
1744
1744
  /** Match the border radius of the container */
1745
1745
  // INPUT_CONTAINER_B_RADIUS,
1746
1746
  "max-h-16 [field-sizing:content]",
1747
1747
  "w-full resize-none px-2",
1748
- l.length === 0 && "pt-1",
1748
+ c.length === 0 && "pt-1",
1749
1749
  "bg-transparent outline-none",
1750
1750
  "placeholder:text-muted-foreground",
1751
1751
  // 16px on mobiles prevents auto-zoom on the input when focused
1752
1752
  e ? "text-[16px]" : "text-sm"
1753
1753
  ),
1754
- onChange: (w) => i(w.target.value),
1755
- onKeyDown: async (w) => {
1756
- w.key === "Enter" && !w.shiftKey && (w.preventDefault(), v());
1754
+ onChange: (u) => l(u.target.value),
1755
+ onKeyDown: async (u) => {
1756
+ u.key === "Enter" && !u.shiftKey && (u.preventDefault(), P());
1757
1757
  },
1758
- placeholder: s("write_a_message_placeholder")
1758
+ placeholder: a("write_a_message_placeholder")
1759
1759
  }
1760
1760
  )
1761
1761
  ]
@@ -1769,27 +1769,27 @@ function bo() {
1769
1769
  align: "start",
1770
1770
  content: "attach images or PDF (maximum size 5mb)",
1771
1771
  children: /* @__PURE__ */ r(
1772
- S,
1772
+ N,
1773
1773
  {
1774
- onClick: j,
1774
+ onClick: I,
1775
1775
  size: "fit",
1776
1776
  variant: "ghost",
1777
- className: m(
1777
+ className: h(
1778
1778
  "rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"
1779
1779
  ),
1780
- children: /* @__PURE__ */ r(T, { mode: "wait", children: f ? /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(ct, { className: "size-4 opacity-50" }) }, "paper-clip-disabled") : /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(ct, { className: "size-4" }) }, "paper-clip") })
1780
+ children: /* @__PURE__ */ r(T, { mode: "wait", children: _ ? /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(ct, { className: "size-4 opacity-50" }) }, "paper-clip-disabled") : /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(ct, { className: "size-4" }) }, "paper-clip") })
1781
1781
  }
1782
1782
  )
1783
1783
  }
1784
1784
  ),
1785
1785
  /* @__PURE__ */ r(oe, { content: "send message", side: "top", align: "end", children: /* @__PURE__ */ r(
1786
- S,
1786
+ N,
1787
1787
  {
1788
1788
  size: "fit",
1789
- onClick: v,
1790
- disabled: f || x || M,
1789
+ onClick: P,
1790
+ disabled: _ || m || R,
1791
1791
  className: "rounded-full size-8 flex items-center justify-center p-0",
1792
- children: /* @__PURE__ */ r(T, { mode: "wait", children: f || x ? /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(Cr, { className: "size-4 animate-spin animate-iteration-infinite" }) }, "loading") : /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(_t, { className: "size-4" }) }, "send") })
1792
+ children: /* @__PURE__ */ r(T, { mode: "wait", children: _ || m ? /* @__PURE__ */ r(b, { snapExit: !0, children: /* @__PURE__ */ r(Cr, { className: "size-4 animate-spin animate-iteration-infinite" }) }, "loading") : /* @__PURE__ */ r(b, { snapExit: !0, children: /* @__PURE__ */ r(_t, { className: "size-4" }) }, "send") })
1793
1793
  }
1794
1794
  ) })
1795
1795
  ] })
@@ -1801,15 +1801,15 @@ function bo() {
1801
1801
  );
1802
1802
  }
1803
1803
  function wt() {
1804
- const { widgetCtx: e } = E(), { router: o } = N(), { canCreateNewSession: t } = Y(), { toSessionsScreen: n } = F(), { t: s } = Z();
1805
- return /* @__PURE__ */ r(Q, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(S, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(S, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
1804
+ const { widgetCtx: e } = O(), { router: o } = C(), { canCreateNewSession: t } = U(), { toSessionsScreen: n } = H(), { t: s } = Z();
1805
+ return /* @__PURE__ */ r(Q, { children: t || o != null && o.chatScreenOnly ? /* @__PURE__ */ r(N, { onClick: e.resetChat, className: "rounded-2xl w-full", children: s("new_conversation") }) : /* @__PURE__ */ r(N, { onClick: n, className: "rounded-2xl w-full", children: s("back_to_conversations") }) });
1806
1806
  }
1807
1807
  function yo() {
1808
1808
  const { t: e } = Z(), { isCsatRequested: o, isCsatSubmitted: t } = kt();
1809
- return /* @__PURE__ */ r("div", { className: "p-2", children: /* @__PURE__ */ r("div", { className: "p-2 bg-muted rounded-3xl", children: /* @__PURE__ */ r(T, { mode: "wait", children: o || t ? /* @__PURE__ */ d(H, { children: [
1809
+ return /* @__PURE__ */ r("div", { className: "p-2", children: /* @__PURE__ */ r("div", { className: "p-2 bg-muted rounded-3xl", children: /* @__PURE__ */ r(T, { mode: "wait", children: o || t ? /* @__PURE__ */ d(W, { children: [
1810
1810
  /* @__PURE__ */ r(fo, {}),
1811
- /* @__PURE__ */ r(T, { mode: "wait", children: t && /* @__PURE__ */ r(H, { children: /* @__PURE__ */ r(wt, {}) }, "new-conv-or-back-to-convs-button") })
1812
- ] }, "csat") : /* @__PURE__ */ d(H, { children: [
1811
+ /* @__PURE__ */ r(T, { mode: "wait", children: t && /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(wt, {}) }, "new-conv-or-back-to-convs-button") })
1812
+ ] }, "csat") : /* @__PURE__ */ d(W, { children: [
1813
1813
  /* @__PURE__ */ d("div", { className: "ps-2 flex items-center gap-1 pb-2", children: [
1814
1814
  /* @__PURE__ */ r(St, { className: "size-4 text-emerald-600" }),
1815
1815
  /* @__PURE__ */ r("h2", { className: "text-sm font-medium", children: e("your_issue_has_been_resolved") })
@@ -1819,11 +1819,11 @@ function yo() {
1819
1819
  }
1820
1820
  function ko() {
1821
1821
  var i;
1822
- const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = N(), { sessionState: n } = Y(), { messagesState: s } = O(), a = s.messages.length === 0;
1823
- return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(T, { mode: "wait", children: n.session && !((i = n.session) != null && i.isOpened) ? /* @__PURE__ */ d(H, { children: [
1822
+ const { initialQuestions: e, initialQuestionsPosition: o, thisWasHelpfulOrNot: t } = C(), { sessionState: n } = U(), { messagesState: s } = A(), a = s.messages.length === 0;
1823
+ return /* @__PURE__ */ r("footer", { children: /* @__PURE__ */ r(T, { mode: "wait", children: n.session && !((i = n.session) != null && i.isOpened) ? /* @__PURE__ */ d(W, { children: [
1824
1824
  /* @__PURE__ */ r(yo, {}),
1825
1825
  /* @__PURE__ */ r(gt, {})
1826
- ] }, "session-closed") : /* @__PURE__ */ d(H, { children: [
1826
+ ] }, "session-closed") : /* @__PURE__ */ d(W, { children: [
1827
1827
  s.lastAIResMightSolveUserIssue && (t == null ? void 0 : t.enabled) !== !1 && /* @__PURE__ */ r(xo, {}),
1828
1828
  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((l, c) => /* @__PURE__ */ r(
1829
1829
  De,
@@ -1842,7 +1842,7 @@ function Co({
1842
1842
  isAloneInGroup: t,
1843
1843
  ...n
1844
1844
  }) {
1845
- const { componentStore: s } = E();
1845
+ const { componentStore: s } = O();
1846
1846
  if (n.type !== "AGENT" && n.type !== "AI") return null;
1847
1847
  if (n.data.action) {
1848
1848
  const i = s.getComponent(n.data.action.name);
@@ -1884,7 +1884,7 @@ function qt({
1884
1884
  containerClassName: t
1885
1885
  }) {
1886
1886
  var i, l;
1887
- const { timestamps: n } = N();
1887
+ const { timestamps: n } = C();
1888
1888
  if (!((i = n == null ? void 0 : n.perMessageGroup) != null && i.enabled))
1889
1889
  return null;
1890
1890
  const s = (l = e[e.length - 1]) == null ? void 0 : l.timestamp;
@@ -1900,7 +1900,7 @@ function qt({
1900
1900
  return console.error(c), null;
1901
1901
  }
1902
1902
  })();
1903
- return a ? /* @__PURE__ */ r("div", { className: t, children: /* @__PURE__ */ r("span", { className: m("text-xs text-muted-foreground", o), children: a }) }) : null;
1903
+ return a ? /* @__PURE__ */ r("div", { className: t, children: /* @__PURE__ */ r("span", { className: h("text-xs text-muted-foreground", o), children: a }) }) : null;
1904
1904
  }
1905
1905
  function pe({
1906
1906
  messages: e,
@@ -1910,36 +1910,36 @@ function pe({
1910
1910
  return /* @__PURE__ */ d(
1911
1911
  "div",
1912
1912
  {
1913
- ...g("chat/agent_msg_group/root"),
1914
- className: m("flex items-end gap-2"),
1913
+ ...w("chat/agent_msg_group/root"),
1914
+ className: h("flex items-end gap-2"),
1915
1915
  children: [
1916
1916
  /* @__PURE__ */ r(oe, { content: o == null ? void 0 : o.name, side: "right", align: "end", children: /* @__PURE__ */ r(
1917
1917
  xe,
1918
1918
  {
1919
- ...g("chat/agent_msg_group/root/avatar"),
1919
+ ...w("chat/agent_msg_group/root/avatar"),
1920
1920
  agent: o,
1921
1921
  className: "hidden"
1922
1922
  }
1923
1923
  ) }),
1924
- /* @__PURE__ */ d("div", { className: m("flex-1 flex flex-col gap-1"), children: [
1924
+ /* @__PURE__ */ d("div", { className: h("flex-1 flex flex-col gap-1"), children: [
1925
1925
  /* @__PURE__ */ d(
1926
1926
  "div",
1927
1927
  {
1928
- ...g("chat/agent_msg_group/avatar_and_msgs/root"),
1929
- className: m("flex items-end gap-2"),
1928
+ ...w("chat/agent_msg_group/avatar_and_msgs/root"),
1929
+ className: h("flex items-end gap-2"),
1930
1930
  children: [
1931
1931
  /* @__PURE__ */ r(oe, { content: o == null ? void 0 : o.name, side: "right", align: "end", children: /* @__PURE__ */ r(
1932
1932
  xe,
1933
1933
  {
1934
- ...g("chat/agent_msg_group/avatar_and_msgs/avatar"),
1934
+ ...w("chat/agent_msg_group/avatar_and_msgs/avatar"),
1935
1935
  agent: o
1936
1936
  }
1937
1937
  ) }),
1938
1938
  /* @__PURE__ */ d(
1939
1939
  "div",
1940
1940
  {
1941
- ...g("chat/agent_msg_group/avatar_and_msgs/msgs"),
1942
- className: m("flex-1 flex flex-col gap-1"),
1941
+ ...w("chat/agent_msg_group/avatar_and_msgs/msgs"),
1942
+ className: h("flex-1 flex flex-col gap-1"),
1943
1943
  children: [
1944
1944
  e.map((n, s, a) => /* @__PURE__ */ r(
1945
1945
  Co,
@@ -1961,8 +1961,8 @@ function pe({
1961
1961
  t && t.length > 0 && /* @__PURE__ */ r(
1962
1962
  "div",
1963
1963
  {
1964
- ...g("chat/agent_msg_group/suggestions"),
1965
- className: m("flex flex-col gap-1 ps-8"),
1964
+ ...w("chat/agent_msg_group/suggestions"),
1965
+ className: h("flex flex-col gap-1 ps-8"),
1966
1966
  children: t == null ? void 0 : t.map((n, s) => /* @__PURE__ */ r(
1967
1967
  De,
1968
1968
  {
@@ -1994,18 +1994,18 @@ function No({
1994
1994
  return /* @__PURE__ */ d(
1995
1995
  "div",
1996
1996
  {
1997
- ...g("chat/user_msg/root"),
1997
+ ...w("chat/user_msg/root"),
1998
1998
  className: "w-5/6 flex flex-col items-end gap-1",
1999
1999
  children: [
2000
2000
  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(Ft, { attachment: a }, a.id)) }),
2001
2001
  e.content.length > 0 && /* @__PURE__ */ r(
2002
2002
  "div",
2003
2003
  {
2004
- ...g("chat/user_msg/msg"),
2004
+ ...w("chat/user_msg/msg"),
2005
2005
  "data-first": o,
2006
2006
  "data-last": t,
2007
2007
  "data-alone": n,
2008
- className: m(
2008
+ className: h(
2009
2009
  "transition-all",
2010
2010
  "w-fit py-3 px-4 rounded-3xl text-sm",
2011
2011
  "bg-primary text-primary-foreground",
@@ -2030,8 +2030,8 @@ function So({
2030
2030
  return /* @__PURE__ */ d(
2031
2031
  "div",
2032
2032
  {
2033
- ...g("chat/user_msg_group/root"),
2034
- className: m("group", "flex flex-col gap-1 justify-end items-end"),
2033
+ ...w("chat/user_msg_group/root"),
2034
+ className: h("group", "flex flex-col gap-1 justify-end items-end"),
2035
2035
  children: [
2036
2036
  e.map((o, t, n) => /* @__PURE__ */ r(
2037
2037
  No,
@@ -2073,12 +2073,12 @@ function Mo(e) {
2073
2073
  function Do() {
2074
2074
  const {
2075
2075
  messagesState: { messages: e }
2076
- } = O(), {
2076
+ } = A(), {
2077
2077
  advancedInitialMessages: o = [],
2078
2078
  initialQuestionsPosition: t,
2079
2079
  initialQuestions: n,
2080
2080
  bot: s
2081
- } = N();
2081
+ } = C();
2082
2082
  return /* @__PURE__ */ r(Q, { children: e.length === 0 && o.length > 0 && /* @__PURE__ */ r(
2083
2083
  pe,
2084
2084
  {
@@ -2099,7 +2099,7 @@ function Do() {
2099
2099
  function Ro() {
2100
2100
  const {
2101
2101
  messagesState: { messages: e }
2102
- } = O(), { chatBannerItems: o } = N();
2102
+ } = A(), { chatBannerItems: o } = C();
2103
2103
  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(
2104
2104
  ({ message: t, persistent: n }, s) => e.length > 0 && !n ? null : /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Ne, { children: t }) }, `${t}-${s}`)
2105
2105
  ) });
@@ -2107,7 +2107,7 @@ function Ro() {
2107
2107
  function jo() {
2108
2108
  const {
2109
2109
  messagesState: { messages: e }
2110
- } = O(), o = N(), {
2110
+ } = A(), o = C(), {
2111
2111
  advancedInitialMessages: t = [],
2112
2112
  initialQuestions: n,
2113
2113
  initialQuestionsPosition: s
@@ -2140,12 +2140,12 @@ function Po() {
2140
2140
  function Eo() {
2141
2141
  const {
2142
2142
  messagesState: { messages: e }
2143
- } = O(), { isAwaitingBotReply: o } = Ct(), { componentStore: t } = E(), { bot: n, humanAgent: s } = N(), a = bt(
2143
+ } = A(), { isAwaitingBotReply: o } = Ct(), { componentStore: t } = O(), { bot: n, humanAgent: s } = C(), a = bt(
2144
2144
  () => _o(e),
2145
2145
  [e]
2146
2146
  ), i = t.getComponent(
2147
2147
  "loading"
2148
- ), l = $(null);
2148
+ ), l = B(null);
2149
2149
  function c() {
2150
2150
  setTimeout(() => {
2151
2151
  const p = l.current;
@@ -2157,40 +2157,40 @@ function Eo() {
2157
2157
  }, [e]), /* @__PURE__ */ d(
2158
2158
  "div",
2159
2159
  {
2160
- ...g("chat/msgs/root"),
2160
+ ...w("chat/msgs/root"),
2161
2161
  ref: l,
2162
2162
  className: "max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",
2163
2163
  children: [
2164
2164
  /* @__PURE__ */ r(Ro, {}),
2165
2165
  /* @__PURE__ */ r(Do, {}),
2166
2166
  /* @__PURE__ */ r(jo, {}),
2167
- a.map((p, b) => {
2168
- var z, f, C, M;
2169
- const x = (z = p == null ? void 0 : p[0]) == null ? void 0 : z.type, h = (f = p[0]) == null ? void 0 : f.id;
2170
- if (!x || !h) return null;
2167
+ a.map((p, x) => {
2168
+ var k, v, z, _;
2169
+ const y = (k = p == null ? void 0 : p[0]) == null ? void 0 : k.type, m = (v = p[0]) == null ? void 0 : v.id;
2170
+ if (!y || !m) return null;
2171
2171
  if (Io(p))
2172
- return /* @__PURE__ */ r(So, { messages: p }, h);
2172
+ return /* @__PURE__ */ r(So, { messages: p }, m);
2173
2173
  if (To(p)) {
2174
- const v = b === a.length - 1;
2175
- return o && v ? null : ((C = p[0]) == null || C.agent, /* @__PURE__ */ r(
2174
+ const f = x === a.length - 1;
2175
+ return o && f ? null : ((z = p[0]) == null || z.agent, /* @__PURE__ */ r(
2176
2176
  pe,
2177
2177
  {
2178
2178
  messages: p,
2179
2179
  agent: n ? { ...n, isAi: !0, id: null } : void 0
2180
2180
  },
2181
- h
2181
+ m
2182
2182
  ));
2183
2183
  }
2184
2184
  if (Mo(p)) {
2185
- const v = (M = p[0]) == null ? void 0 : M.agent;
2185
+ const f = (_ = p[0]) == null ? void 0 : _.agent;
2186
2186
  return /* @__PURE__ */ r(
2187
2187
  pe,
2188
2188
  {
2189
2189
  messages: p,
2190
- agent: v ? {
2191
- ...v,
2192
- name: (s == null ? void 0 : s.name) || v.name || "",
2193
- avatarUrl: (s == null ? void 0 : s.avatarUrl) || v.avatarUrl || null
2190
+ agent: f ? {
2191
+ ...f,
2192
+ name: (s == null ? void 0 : s.name) || f.name || "",
2193
+ avatarUrl: (s == null ? void 0 : s.avatarUrl) || f.avatarUrl || null
2194
2194
  } : s ? {
2195
2195
  isAi: !1,
2196
2196
  id: null,
@@ -2198,7 +2198,7 @@ function Eo() {
2198
2198
  avatarUrl: s.avatarUrl || null
2199
2199
  } : void 0
2200
2200
  },
2201
- h
2201
+ m
2202
2202
  );
2203
2203
  }
2204
2204
  return null;
@@ -2213,19 +2213,19 @@ function Eo() {
2213
2213
  function Oo() {
2214
2214
  const {
2215
2215
  messagesState: { isInitialFetchLoading: e }
2216
- } = O(), {
2216
+ } = A(), {
2217
2217
  sessionState: { session: o }
2218
- } = Y(), { isCanvasOpen: t } = uo(), { theme: n } = G();
2218
+ } = U(), { isCanvasOpen: t } = uo(), { theme: n } = G();
2219
2219
  Te({
2220
2220
  width: t ? n.screens.chat.withCanvas.width : n.screens.chat.width,
2221
2221
  height: t ? n.screens.chat.withCanvas.height : n.screens.chat.height
2222
2222
  });
2223
- const s = $((o == null ? void 0 : o.id) || "chat").current;
2223
+ const s = B((o == null ? void 0 : o.id) || "chat").current;
2224
2224
  return /* @__PURE__ */ r(
2225
2225
  "div",
2226
2226
  {
2227
- ...g("chat/root"),
2228
- className: m("flex flex-col overflow-hidden"),
2227
+ ...w("chat/root"),
2228
+ className: h("flex flex-col overflow-hidden"),
2229
2229
  style: {
2230
2230
  width: "100vw",
2231
2231
  // Relative to the iframe
@@ -2239,14 +2239,14 @@ function Oo() {
2239
2239
  children: /* @__PURE__ */ d("div", { className: "size-full justify-between flex flex-col", children: [
2240
2240
  /* @__PURE__ */ r(Ut, {}),
2241
2241
  /* @__PURE__ */ r(T, { mode: "wait", children: e ? /* @__PURE__ */ r(
2242
- k,
2242
+ b,
2243
2243
  {
2244
2244
  className: "flex flex-col items-center justify-center w-full flex-1",
2245
2245
  children: /* @__PURE__ */ r(Xt, {})
2246
2246
  },
2247
2247
  "loading"
2248
2248
  ) : /* @__PURE__ */ d(
2249
- k,
2249
+ b,
2250
2250
  {
2251
2251
  className: "flex items-start h-full flex-1 overflow-auto",
2252
2252
  snapExit: !0,
@@ -2254,8 +2254,8 @@ function Oo() {
2254
2254
  /* @__PURE__ */ d(
2255
2255
  "div",
2256
2256
  {
2257
- ...g("chat/main/root"),
2258
- className: m(
2257
+ ...w("chat/main/root"),
2258
+ className: h(
2259
2259
  "flex flex-col h-full overflow-auto transition-all",
2260
2260
  t ? "w-2/5" : "w-full"
2261
2261
  ),
@@ -2272,8 +2272,8 @@ function Oo() {
2272
2272
  /* @__PURE__ */ r(
2273
2273
  "div",
2274
2274
  {
2275
- ...g("chat/canvas/root"),
2276
- className: m(
2275
+ ...w("chat/canvas/root"),
2276
+ className: h(
2277
2277
  "h-full overflow-auto transition-all",
2278
2278
  t ? "w-3/5" : "w-0"
2279
2279
  ),
@@ -2299,7 +2299,7 @@ function Ao({
2299
2299
  return /* @__PURE__ */ r(
2300
2300
  "div",
2301
2301
  {
2302
- className: m("animate-pulse rounded-md bg-secondary", e),
2302
+ className: h("animate-pulse rounded-md bg-secondary", e),
2303
2303
  ...o
2304
2304
  }
2305
2305
  );
@@ -2313,7 +2313,7 @@ function Fo({ className: e }) {
2313
2313
  viewBox: "0 0 26 32",
2314
2314
  fill: "none",
2315
2315
  xmlns: "http://www.w3.org/2000/svg",
2316
- className: m("text-primary-foreground", e),
2316
+ className: h("text-primary-foreground", e),
2317
2317
  children: /* @__PURE__ */ r(
2318
2318
  "path",
2319
2319
  {
@@ -2325,21 +2325,21 @@ function Fo({ className: e }) {
2325
2325
  );
2326
2326
  }
2327
2327
  function Vt({ className: e }) {
2328
- const { token: o } = N();
2328
+ const { token: o } = C();
2329
2329
  return /* @__PURE__ */ r(
2330
2330
  "div",
2331
2331
  {
2332
- className: m(
2332
+ className: h(
2333
2333
  "flex items-center justify-center gap-2 p-2 pt-0",
2334
2334
  e
2335
2335
  ),
2336
- children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ d(
2336
+ children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ d(
2337
2337
  "a",
2338
2338
  {
2339
2339
  href: `https://open.cx/?ref=${o}`,
2340
2340
  target: "_blank",
2341
2341
  rel: "noreferrer",
2342
- className: m(
2342
+ className: h(
2343
2343
  "text-[10px] flex items-center",
2344
2344
  "text-muted-foreground/70 [&_svg]:text-muted-foreground/70",
2345
2345
  "hover:text-primary [&_svg]:hover:text-primary"
@@ -2364,26 +2364,26 @@ function ft({
2364
2364
  session: e,
2365
2365
  className: o
2366
2366
  }) {
2367
- const { bot: t, humanAgent: n } = N(), { toChatScreen: s } = F(), a = e.assignee.kind === "human" ? (n == null ? void 0 : n.name) || e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", i = e.assignee.kind === "human" ? (n == null ? void 0 : n.avatarUrl) || e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatarUrl) || (t == null ? void 0 : t.avatar) || "";
2367
+ const { bot: t, humanAgent: n } = C(), { toChatScreen: s } = H(), a = e.assignee.kind === "human" ? (n == null ? void 0 : n.name) || e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", i = e.assignee.kind === "human" ? (n == null ? void 0 : n.avatarUrl) || e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatarUrl) || (t == null ? void 0 : t.avatar) || "";
2368
2368
  return /* @__PURE__ */ d(
2369
- S,
2369
+ N,
2370
2370
  {
2371
2371
  variant: "ghost",
2372
2372
  size: "lg",
2373
- className: m(
2373
+ className: h(
2374
2374
  "rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",
2375
2375
  o
2376
2376
  ),
2377
2377
  onClick: () => s(e.id),
2378
2378
  children: [
2379
2379
  /* @__PURE__ */ d("div", { className: "flex-1 flex gap-2 items-center", children: [
2380
- /* @__PURE__ */ r(T, { mode: "wait", children: /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ d(Se, { className: "size-10", children: [
2380
+ /* @__PURE__ */ r(T, { mode: "wait", children: /* @__PURE__ */ r(b, { snapExit: !0, children: /* @__PURE__ */ d(Se, { className: "size-10", children: [
2381
2381
  /* @__PURE__ */ r(_e, { src: i, alt: "Agent Icon" }),
2382
2382
  /* @__PURE__ */ r(Ie, { children: /* @__PURE__ */ r(Tr, { className: "size-4" }) })
2383
2383
  ] }) }) }),
2384
2384
  /* @__PURE__ */ d("div", { className: "flex-1", children: [
2385
- /* @__PURE__ */ r(T, { mode: "wait", children: /* @__PURE__ */ r(k, { snapExit: !0, children: a }, a) }),
2386
- /* @__PURE__ */ r(T, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ r(k, { snapExit: !0, children: /* @__PURE__ */ r(
2385
+ /* @__PURE__ */ r(T, { mode: "wait", children: /* @__PURE__ */ r(b, { snapExit: !0, children: a }, a) }),
2386
+ /* @__PURE__ */ r(T, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ r(b, { snapExit: !0, children: /* @__PURE__ */ r(
2387
2387
  Ht,
2388
2388
  {
2389
2389
  remarkPlugins: [It],
@@ -2391,7 +2391,7 @@ function ft({
2391
2391
  className: "line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",
2392
2392
  children: e.lastMessage
2393
2393
  }
2394
- ) }, e.lastMessage || "content") : /* @__PURE__ */ r(k, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r(Ao, { className: "h-4 w-full" }) }, "skeleton") })
2394
+ ) }, e.lastMessage || "content") : /* @__PURE__ */ r(b, { className: "w-1/2", snapExit: !0, children: /* @__PURE__ */ r(Ao, { className: "h-4 w-full" }) }, "skeleton") })
2395
2395
  ] })
2396
2396
  ] }),
2397
2397
  /* @__PURE__ */ r(Mr, { className: "size-4 text-muted-foreground shrink-0 rtl:-scale-100" })
@@ -2400,27 +2400,27 @@ function ft({
2400
2400
  );
2401
2401
  }
2402
2402
  function Wo() {
2403
- const { t: e } = Z(), { toChatScreen: o } = F(), {
2403
+ const { t: e } = Z(), { toChatScreen: o } = H(), {
2404
2404
  sessionsState: { data: t, isInitialFetchLoading: n },
2405
2405
  openSessions: s,
2406
2406
  closedSessions: a,
2407
2407
  canCreateNewSession: i
2408
- } = Y();
2408
+ } = U();
2409
2409
  return /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col overflow-scroll py-2 px-2", children: /* @__PURE__ */ r(T, { mode: "wait", children: n ? /* @__PURE__ */ r(
2410
- k,
2410
+ b,
2411
2411
  {
2412
2412
  className: "flex-1 flex items-center justify-center",
2413
2413
  children: /* @__PURE__ */ r(Xt, {})
2414
2414
  },
2415
2415
  "loading"
2416
2416
  ) : /* @__PURE__ */ r(
2417
- k,
2417
+ b,
2418
2418
  {
2419
2419
  className: "flex-1 flex flex-col gap-2 relative",
2420
2420
  children: t.length ? /* @__PURE__ */ d(Q, { children: [
2421
2421
  /* @__PURE__ */ d(T, { children: [
2422
2422
  s.length > 0 && /* @__PURE__ */ r(
2423
- k,
2423
+ b,
2424
2424
  {
2425
2425
  fadeIn: "up",
2426
2426
  delay: 0.2,
@@ -2431,7 +2431,7 @@ function Wo() {
2431
2431
  "open-sessions"
2432
2432
  ),
2433
2433
  a.length > 0 && /* @__PURE__ */ d(
2434
- k,
2434
+ b,
2435
2435
  {
2436
2436
  className: "space-y-2",
2437
2437
  delay: 0.2,
@@ -2452,9 +2452,9 @@ function Wo() {
2452
2452
  )
2453
2453
  ] }),
2454
2454
  i && /* @__PURE__ */ r("div", { className: "mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background", children: /* @__PURE__ */ lt(
2455
- S,
2455
+ N,
2456
2456
  {
2457
- ...g("sessions/new_conversation_btn"),
2457
+ ...w("sessions/new_conversation_btn"),
2458
2458
  size: "lg",
2459
2459
  key: "new-session",
2460
2460
  className: "w-full",
@@ -2465,9 +2465,9 @@ function Wo() {
2465
2465
  ] }) : /* @__PURE__ */ d("div", { className: "flex-1 flex flex-col gap-2 items-center", children: [
2466
2466
  /* @__PURE__ */ r("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ r("p", { className: "text-muted-foreground", children: e("no_conversations_yet") }) }),
2467
2467
  /* @__PURE__ */ lt(
2468
- S,
2468
+ N,
2469
2469
  {
2470
- ...g("sessions/new_conversation_btn"),
2470
+ ...w("sessions/new_conversation_btn"),
2471
2471
  size: "lg",
2472
2472
  key: "new-session",
2473
2473
  className: "w-full",
@@ -2488,8 +2488,8 @@ function Lo() {
2488
2488
  }), /* @__PURE__ */ r(
2489
2489
  "div",
2490
2490
  {
2491
- ...g("sessions/root"),
2492
- className: m("flex flex-col overflow-hidden bg-background"),
2491
+ ...w("sessions/root"),
2492
+ className: h("flex flex-col overflow-hidden bg-background"),
2493
2493
  style: {
2494
2494
  width: "100vw",
2495
2495
  // Relative to the iframe
@@ -2510,13 +2510,13 @@ function Lo() {
2510
2510
  }
2511
2511
  const de = J.forwardRef(
2512
2512
  ({ className: e, type: o, ...t }, n) => {
2513
- const { isSmallScreen: s } = L();
2513
+ const { isSmallScreen: s } = $();
2514
2514
  return /* @__PURE__ */ r(
2515
2515
  "input",
2516
2516
  {
2517
2517
  ref: n,
2518
2518
  type: o,
2519
- className: m(
2519
+ className: h(
2520
2520
  // 16px on mobiles prevents auto-zoom on the input when focused
2521
2521
  s ? "text-[16px]" : "text-sm",
2522
2522
  "flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition",
@@ -2531,7 +2531,7 @@ const de = J.forwardRef(
2531
2531
  );
2532
2532
  de.displayName = "Input";
2533
2533
  function $o() {
2534
- const { contentIframeRef: e } = E(), { inline: o } = N(), t = $(null);
2534
+ const { contentIframeRef: e } = O(), { inline: o } = C(), t = B(null);
2535
2535
  return se(() => {
2536
2536
  const n = e == null ? void 0 : e.current;
2537
2537
  if (n && t.current) {
@@ -2557,30 +2557,30 @@ const Bo = ge.object({
2557
2557
  email: ge.string().email()
2558
2558
  });
2559
2559
  function Yo() {
2560
- var v, R, P, j, u, _, w, y;
2560
+ var f, R, P, E, g, I, j, M;
2561
2561
  const {
2562
2562
  widgetCtx: { org: e }
2563
- } = E(), { setIsOpen: o } = V(), { createUnverifiedContact: t } = zt(), { isSmallScreen: n } = L(), s = N(), { theme: a } = G(), { t: i } = Z(), { observedElementRef: l } = $o();
2563
+ } = O(), { setIsOpen: o } = V(), { createUnverifiedContact: t } = zt(), { isSmallScreen: n } = $(), s = C(), { theme: a } = G(), { t: i } = Z(), { observedElementRef: l } = $o();
2564
2564
  Te({
2565
2565
  height: void 0,
2566
2566
  width: a.screens.welcome.width
2567
2567
  });
2568
- const [c, p] = D(((v = s.prefillUserData) == null ? void 0 : v.name) || ""), [b, x] = D(((R = s.prefillUserData) == null ? void 0 : R.email) || ""), h = (s.extraDataCollectionFields || []).filter(
2569
- (I) => I !== "name" && I !== "email" && !!I
2570
- ), [z, f] = D({}), [C, M] = Lr(
2571
- async (I) => {
2572
- I.preventDefault();
2573
- const U = Bo.safeParse({ name: c, email: b });
2574
- U.success && await t(
2568
+ const [c, p] = D(((f = s.prefillUserData) == null ? void 0 : f.name) || ""), [x, y] = D(((R = s.prefillUserData) == null ? void 0 : R.email) || ""), m = (s.extraDataCollectionFields || []).filter(
2569
+ (u) => u !== "name" && u !== "email" && !!u
2570
+ ), [k, v] = D({}), [z, _] = Lr(
2571
+ async (u) => {
2572
+ u.preventDefault();
2573
+ const S = Bo.safeParse({ name: c, email: x });
2574
+ S.success && await t(
2575
2575
  {
2576
- email: U.data.email,
2577
- non_verified_name: U.data.name
2576
+ email: S.data.email,
2577
+ non_verified_name: S.data.name
2578
2578
  },
2579
2579
  // Only pass extra data if there is any
2580
- Object.values(z).filter(Boolean).length ? z : void 0
2580
+ Object.values(k).filter(Boolean).length ? k : void 0
2581
2581
  );
2582
2582
  },
2583
- [c, b, z]
2583
+ [c, x, k]
2584
2584
  );
2585
2585
  return /* @__PURE__ */ r(
2586
2586
  "div",
@@ -2601,7 +2601,7 @@ function Yo() {
2601
2601
  "div",
2602
2602
  {
2603
2603
  ref: l,
2604
- className: m(
2604
+ className: h(
2605
2605
  "flex flex-col",
2606
2606
  n && "h-full",
2607
2607
  "bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"
@@ -2610,23 +2610,23 @@ function Yo() {
2610
2610
  /* @__PURE__ */ d(
2611
2611
  "div",
2612
2612
  {
2613
- className: m(
2613
+ className: h(
2614
2614
  "flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10",
2615
2615
  "text-primary-foreground"
2616
2616
  ),
2617
2617
  children: [
2618
- n && /* @__PURE__ */ r(k, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(S, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(ke, { className: "size-4" }) }) }),
2618
+ n && /* @__PURE__ */ r(b, { className: "absolute top-6 end-6", children: /* @__PURE__ */ r(N, { size: "selfless", onClick: () => o(!1), children: /* @__PURE__ */ r(ke, { className: "size-4" }) }) }),
2619
2619
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full mb-2", children: (P = s.assets) != null && P.organizationLogo ? /* @__PURE__ */ r(
2620
2620
  "img",
2621
2621
  {
2622
- src: (j = s.assets) == null ? void 0 : j.organizationLogo,
2622
+ src: (E = s.assets) == null ? void 0 : E.organizationLogo,
2623
2623
  alt: "Company Logo",
2624
2624
  className: "h-8 w-auto object-contain"
2625
2625
  }
2626
2626
  ) : /* @__PURE__ */ r("h2", { className: "font-bold text-sm", children: e.name }) }),
2627
2627
  /* @__PURE__ */ d("div", { className: "space-y-2", children: [
2628
- /* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((_ = (u = s.textContent) == null ? void 0 : u.welcomeScreen) == null ? void 0 : _.title) || i("welcome_screen_title") }),
2629
- /* @__PURE__ */ r("p", { className: "text-sm", children: ((y = (w = s.textContent) == null ? void 0 : w.welcomeScreen) == null ? void 0 : y.description) || i("welcome_screen_description") })
2628
+ /* @__PURE__ */ r("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((I = (g = s.textContent) == null ? void 0 : g.welcomeScreen) == null ? void 0 : I.title) || i("welcome_screen_title") }),
2629
+ /* @__PURE__ */ r("p", { className: "text-sm", children: ((M = (j = s.textContent) == null ? void 0 : j.welcomeScreen) == null ? void 0 : M.description) || i("welcome_screen_description") })
2630
2630
  ] })
2631
2631
  ]
2632
2632
  }
@@ -2634,19 +2634,19 @@ function Yo() {
2634
2634
  /* @__PURE__ */ d(
2635
2635
  "div",
2636
2636
  {
2637
- className: m(
2637
+ className: h(
2638
2638
  "z-10 m-2 px-2 pt-2 bp-0 space-y-2",
2639
2639
  "bg-[white]",
2640
2640
  "border shadow",
2641
2641
  "rounded-3xl"
2642
2642
  ),
2643
2643
  children: [
2644
- /* @__PURE__ */ d("form", { onSubmit: M, className: "space-y-2", children: [
2644
+ /* @__PURE__ */ d("form", { onSubmit: _, className: "space-y-2", children: [
2645
2645
  /* @__PURE__ */ r(
2646
2646
  de,
2647
2647
  {
2648
2648
  value: c,
2649
- onChange: (I) => p(I.target.value),
2649
+ onChange: (u) => p(u.target.value),
2650
2650
  required: !0,
2651
2651
  placeholder: i("your_name_placeholder"),
2652
2652
  name: "name"
@@ -2656,33 +2656,33 @@ function Yo() {
2656
2656
  de,
2657
2657
  {
2658
2658
  required: !0,
2659
- value: b,
2660
- onChange: (I) => x(I.target.value),
2659
+ value: x,
2660
+ onChange: (u) => y(u.target.value),
2661
2661
  type: "email",
2662
2662
  placeholder: i("your_email_placeholder"),
2663
2663
  name: "email"
2664
2664
  }
2665
2665
  ),
2666
- h.map((I) => /* @__PURE__ */ r(
2666
+ m.map((u) => /* @__PURE__ */ r(
2667
2667
  de,
2668
2668
  {
2669
- value: z[I],
2670
- onChange: (U) => f((ie) => ({
2669
+ value: k[u],
2670
+ onChange: (S) => v((ie) => ({
2671
2671
  ...ie,
2672
- [I]: U.target.value
2672
+ [u]: S.target.value
2673
2673
  })),
2674
- placeholder: `${I} (${i("optional")})`
2674
+ placeholder: `${u} (${i("optional")})`
2675
2675
  },
2676
- I
2676
+ u
2677
2677
  )),
2678
2678
  /* @__PURE__ */ d(
2679
- S,
2679
+ N,
2680
2680
  {
2681
- disabled: C.loading,
2681
+ disabled: z.loading,
2682
2682
  className: "w-full",
2683
2683
  size: "lg",
2684
2684
  children: [
2685
- C.loading ? i("start_chat_button_loading") : i("start_chat_button"),
2685
+ z.loading ? i("start_chat_button_loading") : i("start_chat_button"),
2686
2686
  /* @__PURE__ */ r(Dr, { className: "size-4 rtl:-scale-100" })
2687
2687
  ]
2688
2688
  }
@@ -2701,12 +2701,12 @@ function Yo() {
2701
2701
  function Gt() {
2702
2702
  const {
2703
2703
  routerState: { screen: e }
2704
- } = F();
2704
+ } = H();
2705
2705
  return /* @__PURE__ */ r("div", { className: "relative bg-background size-full", children: /* @__PURE__ */ r(T, { mode: "wait", children: (() => {
2706
2706
  switch (e) {
2707
2707
  case "welcome":
2708
2708
  return /* @__PURE__ */ r(
2709
- k,
2709
+ b,
2710
2710
  {
2711
2711
  fadeIn: "right",
2712
2712
  className: "size-full",
@@ -2717,7 +2717,7 @@ function Gt() {
2717
2717
  );
2718
2718
  case "sessions":
2719
2719
  return /* @__PURE__ */ r(
2720
- k,
2720
+ b,
2721
2721
  {
2722
2722
  fadeIn: "right",
2723
2723
  className: "size-full",
@@ -2728,7 +2728,7 @@ function Gt() {
2728
2728
  );
2729
2729
  case "chat":
2730
2730
  return /* @__PURE__ */ r(
2731
- k,
2731
+ b,
2732
2732
  {
2733
2733
  fadeIn: "right",
2734
2734
  className: "size-full",
@@ -2738,11 +2738,11 @@ function Gt() {
2738
2738
  e
2739
2739
  );
2740
2740
  default:
2741
- return A(e, Gt.name), null;
2741
+ return F(e, Gt.name), null;
2742
2742
  }
2743
2743
  })() }) });
2744
2744
  }
2745
- const Uo = "4.0.49", Xo = `<!DOCTYPE html>
2745
+ const Uo = "4.0.50", Xo = `<!DOCTYPE html>
2746
2746
  <html>
2747
2747
  <head>
2748
2748
  <style>
@@ -2761,7 +2761,7 @@ html, body {
2761
2761
  </body>
2762
2762
  </html>`;
2763
2763
  function Zt() {
2764
- const { isOpen: e } = V(), { contentIframeRef: o } = E(), { cssOverrides: t, inline: n } = N(), { theme: s, cssVars: a, computed: i } = G(), { dir: l } = Z();
2764
+ const { isOpen: e } = V(), { contentIframeRef: o } = O(), { cssOverrides: t, inline: n } = C(), { theme: s, cssVars: a, computed: i } = G(), { dir: l } = Z();
2765
2765
  return /* @__PURE__ */ r(
2766
2766
  re.div,
2767
2767
  {
@@ -2823,7 +2823,7 @@ function Zt() {
2823
2823
  zIndex: s.widgetContentContainer.zIndex
2824
2824
  },
2825
2825
  "data-version": Uo,
2826
- className: m(
2826
+ className: h(
2827
2827
  "antialiased font-sans size-full overflow-hidden relative text-secondary-foreground isolate"
2828
2828
  ),
2829
2829
  dir: l,
@@ -2846,7 +2846,7 @@ function Zt() {
2846
2846
  function qo() {
2847
2847
  const { theme: e } = G();
2848
2848
  return /* @__PURE__ */ r(
2849
- me.Content,
2849
+ he.Content,
2850
2850
  {
2851
2851
  onInteractOutside: (o) => o.preventDefault(),
2852
2852
  forceMount: !0,
@@ -2877,7 +2877,7 @@ function Vo({
2877
2877
  viewBox: "0 0 32 30",
2878
2878
  fill: "none",
2879
2879
  xmlns: "http://www.w3.org/2000/svg",
2880
- className: m("text-primary-foreground", e),
2880
+ className: h("text-primary-foreground", e),
2881
2881
  style: o,
2882
2882
  children: [
2883
2883
  /* @__PURE__ */ r(
@@ -2919,9 +2919,9 @@ html, body {
2919
2919
  </html>`;
2920
2920
  function Zo() {
2921
2921
  var l, c;
2922
- const { isOpen: e, setIsOpen: o } = V(), { cssOverrides: t, assets: n, customComponents: s } = N(), { theme: a, cssVars: i } = G();
2922
+ const { isOpen: e, setIsOpen: o } = V(), { cssOverrides: t, assets: n, customComponents: s } = C(), { theme: a, cssVars: i } = G();
2923
2923
  return s != null && s.widgetTrigger ? s.widgetTrigger({
2924
- react: W,
2924
+ react: L,
2925
2925
  isOpen: e,
2926
2926
  setIsOpen: (p) => o(p)
2927
2927
  }) : /* @__PURE__ */ d(
@@ -2958,20 +2958,20 @@ function Zo() {
2958
2958
  justifyContent: "center"
2959
2959
  },
2960
2960
  children: /* @__PURE__ */ r(
2961
- me.PopoverTrigger,
2961
+ he.PopoverTrigger,
2962
2962
  {
2963
- className: m(
2963
+ className: h(
2964
2964
  "font-sans flex items-center justify-center rounded-full"
2965
2965
  ),
2966
2966
  style: {
2967
2967
  height: a.widgetTrigger.size.button,
2968
2968
  width: a.widgetTrigger.size.button
2969
2969
  },
2970
- children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(
2970
+ children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(
2971
2971
  "div",
2972
2972
  {
2973
- ...g("trigger/btn"),
2974
- className: m(
2973
+ ...w("trigger/btn"),
2974
+ className: h(
2975
2975
  "relative size-full rounded-full",
2976
2976
  "flex items-center justify-center",
2977
2977
  "overflow-hidden",
@@ -2980,7 +2980,7 @@ function Zo() {
2980
2980
  "text-primary-foreground"
2981
2981
  ),
2982
2982
  children: /* @__PURE__ */ r(T, { mode: "wait", children: e ? /* @__PURE__ */ r(
2983
- k,
2983
+ b,
2984
2984
  {
2985
2985
  snapExit: !0,
2986
2986
  fadeIn: "up",
@@ -3010,7 +3010,7 @@ function Zo() {
3010
3010
  },
3011
3011
  "x-icon"
3012
3012
  ) : /* @__PURE__ */ r(
3013
- k,
3013
+ b,
3014
3014
  {
3015
3015
  snapExit: !0,
3016
3016
  overrides: {
@@ -3053,7 +3053,7 @@ function Zo() {
3053
3053
  function Ko() {
3054
3054
  const { dir: e } = ye();
3055
3055
  return /* @__PURE__ */ r(
3056
- me.Anchor,
3056
+ he.Anchor,
3057
3057
  {
3058
3058
  style: {
3059
3059
  position: "fixed",
@@ -3067,11 +3067,11 @@ function Ko() {
3067
3067
  function Qo({
3068
3068
  widgetRef: e
3069
3069
  }) {
3070
- const { widgetCtx: o } = E(), { contactState: t } = zt(), { setIsOpen: n, isOpen: s } = V(), {
3070
+ const { widgetCtx: o } = O(), { contactState: t } = zt(), { setIsOpen: n, isOpen: s } = V(), {
3071
3071
  toChatScreen: a,
3072
3072
  routerState: { screen: i }
3073
- } = F(), { sendMessage: l } = O();
3074
- return W.useImperativeHandle(
3073
+ } = H(), { sendMessage: l } = A();
3074
+ return L.useImperativeHandle(
3075
3075
  e,
3076
3076
  () => ({
3077
3077
  newChat: async (c) => {
@@ -3096,7 +3096,7 @@ function Qo({
3096
3096
  }
3097
3097
  function Jo() {
3098
3098
  const { isOpen: e, setIsOpen: o } = V();
3099
- return /* @__PURE__ */ d(me.Root, { open: e, onOpenChange: o, children: [
3099
+ return /* @__PURE__ */ d(he.Root, { open: e, onOpenChange: o, children: [
3100
3100
  /* @__PURE__ */ r(Ko, {}),
3101
3101
  /* @__PURE__ */ r(Zo, {}),
3102
3102
  /* @__PURE__ */ r(qo, {})
@@ -3127,7 +3127,7 @@ const en = [
3127
3127
  remove: async (e) => {
3128
3128
  localStorage.removeItem(e);
3129
3129
  }
3130
- }, rn = W.forwardRef(function({ options: o, components: t = [], loadingComponent: n }, s) {
3130
+ }, rn = L.forwardRef(function({ options: o, components: t = [], loadingComponent: n }, s) {
3131
3131
  return /* @__PURE__ */ r(
3132
3132
  tr,
3133
3133
  {