@opencx/widget-react 4.0.5 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/index.cjs +3 -3
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +2 -9
  4. package/dist/index.js +137 -137
  5. package/dist/index.js.map +1 -1
  6. package/dist/src/index.d.ts +9 -0
  7. package/dist-embed/script.js +43 -43
  8. package/dist-embed/script.js.map +1 -1
  9. package/package.json +3 -3
  10. /package/dist/{WidgetPopoverAnchor.d.ts → src/WidgetPopoverAnchor.d.ts} +0 -0
  11. /package/dist/{WidgetPopoverContent.d.ts → src/WidgetPopoverContent.d.ts} +0 -0
  12. /package/dist/{WidgetPopoverTrigger.d.ts → src/WidgetPopoverTrigger.d.ts} +0 -0
  13. /package/dist/{components → src/components}/AgentOrBotAvatar.d.ts +0 -0
  14. /package/dist/{components → src/components}/AttachmentPreview.d.ts +0 -0
  15. /package/dist/{components → src/components}/BotOrAgentMessage.d.ts +0 -0
  16. /package/dist/{components → src/components}/BotOrAgentMessageGroup.d.ts +0 -0
  17. /package/dist/{components → src/components}/Header.d.ts +0 -0
  18. /package/dist/{components → src/components}/MightSolveUserIssueSuggestedReplies.d.ts +0 -0
  19. /package/dist/{components → src/components}/PoweredByOpen.d.ts +0 -0
  20. /package/dist/{components → src/components}/SuggestedReplyButton.d.ts +0 -0
  21. /package/dist/{components → src/components}/UserMessage.d.ts +0 -0
  22. /package/dist/{components → src/components}/UserMessageGroup.d.ts +0 -0
  23. /package/dist/{components → src/components}/custom-components/BotOrAgentTextResponse.component.d.ts +0 -0
  24. /package/dist/{components → src/components}/custom-components/Fallback.component.d.ts +0 -0
  25. /package/dist/{components → src/components}/custom-components/Handoff.component.d.ts +0 -0
  26. /package/dist/{components → src/components}/custom-components/Loading.component.d.ts +0 -0
  27. /package/dist/{components → src/components}/lib/DynamicIcon.d.ts +0 -0
  28. /package/dist/{components → src/components}/lib/LoadingSpinner.d.ts +0 -0
  29. /package/dist/{components → src/components}/lib/MotionDiv.d.ts +0 -0
  30. /package/dist/{components → src/components}/lib/avatar.d.ts +0 -0
  31. /package/dist/{components → src/components}/lib/button.d.ts +0 -0
  32. /package/dist/{components → src/components}/lib/dialog.d.ts +0 -0
  33. /package/dist/{components → src/components}/lib/dropdown-menu.d.ts +0 -0
  34. /package/dist/{components → src/components}/lib/input.d.ts +0 -0
  35. /package/dist/{components → src/components}/lib/popover.d.ts +0 -0
  36. /package/dist/{components → src/components}/lib/skeleton.d.ts +0 -0
  37. /package/dist/{components → src/components}/lib/switch.d.ts +0 -0
  38. /package/dist/{components → src/components}/lib/tooltip.d.ts +0 -0
  39. /package/dist/{components → src/components}/lib/utils/cn.d.ts +0 -0
  40. /package/dist/{components → src/components}/lib/widget-portal.d.ts +0 -0
  41. /package/dist/{components → src/components}/lib/wobble.d.ts +0 -0
  42. /package/dist/{components → src/components}/markdown.d.ts +0 -0
  43. /package/dist/{components → src/components}/svg/ChatBubbleSvg.d.ts +0 -0
  44. /package/dist/{components → src/components}/svg/OpenLogoSvg.d.ts +0 -0
  45. /package/dist/{hooks → src/hooks}/useCanvas.d.ts +0 -0
  46. /package/dist/{hooks → src/hooks}/useIsSmallScreen.d.ts +0 -0
  47. /package/dist/{hooks → src/hooks}/useSetWidgetSize.d.ts +0 -0
  48. /package/dist/{hooks → src/hooks}/useTheme.d.ts +0 -0
  49. /package/dist/{hooks → src/hooks}/useTranslation.d.ts +0 -0
  50. /package/dist/{hooks → src/hooks}/useWidgetContentHeight.d.ts +0 -0
  51. /package/dist/{screens → src/screens}/chat/ChatCanvas.d.ts +0 -0
  52. /package/dist/{screens → src/screens}/chat/ChatFooter.d.ts +0 -0
  53. /package/dist/{screens → src/screens}/chat/ChatMain.d.ts +0 -0
  54. /package/dist/{screens → src/screens}/chat/index.d.ts +0 -0
  55. /package/dist/{screens → src/screens}/index.d.ts +0 -0
  56. /package/dist/{screens → src/screens}/sessions/index.d.ts +0 -0
  57. /package/dist/{screens → src/screens}/welcome/index.d.ts +0 -0
  58. /package/dist/{translation → src/translation}/ar.d.ts +0 -0
  59. /package/dist/{translation → src/translation}/de.d.ts +0 -0
  60. /package/dist/{translation → src/translation}/en.d.ts +0 -0
  61. /package/dist/{translation → src/translation}/es.d.ts +0 -0
  62. /package/dist/{translation → src/translation}/fr.d.ts +0 -0
  63. /package/dist/{translation → src/translation}/index.d.ts +0 -0
  64. /package/dist/{translation → src/translation}/nl.d.ts +0 -0
  65. /package/dist/{translation → src/translation}/pt.d.ts +0 -0
  66. /package/dist/{translation → src/translation}/tr.d.ts +0 -0
  67. /package/dist/{translation → src/translation}/translation.types.d.ts +0 -0
  68. /package/dist/{utils → src/utils}/data-component.d.ts +0 -0
  69. /package/dist/{utils → src/utils}/group-messages-by-type.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as c, Fragment as ve } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as l, Fragment as ve } from "react/jsx-runtime";
2
2
  import * as ie from "@radix-ui/react-popover";
3
3
  import * as E from "react";
4
4
  import se, { memo as Ht, forwardRef as ct, useState as j, cloneElement as At, useEffect as le, useMemo as dt, useRef as ce, createElement as nt } from "react";
@@ -48,7 +48,7 @@ const V = {
48
48
  }, W = Ht(
49
49
  ct(
50
50
  ({ children: e, className: r, scale: t = 1.02, off: n = !1 }, s) => {
51
- const [a, i] = j(!1), [l, p] = j({ x: 0, y: 0 });
51
+ const [a, i] = j(!1), [c, p] = j({ x: 0, y: 0 });
52
52
  if (n || /translate/.test(
53
53
  e.props.className || ""
54
54
  )) return e;
@@ -69,8 +69,8 @@ const V = {
69
69
  var m, u;
70
70
  i(!1), p({ x: 0, y: 0 }), (u = (m = e.props).onMouseLeave) == null || u.call(m);
71
71
  }, h = {
72
- "--wobble-x": a ? `${l.x}px` : "0px",
73
- "--wobble-y": a ? `${l.y}px` : "0px",
72
+ "--wobble-x": a ? `${c.x}px` : "0px",
73
+ "--wobble-y": a ? `${c.y}px` : "0px",
74
74
  "--scale": 1 - (t - 1)
75
75
  };
76
76
  return At(e, {
@@ -158,9 +158,9 @@ const vt = R.Root, bt = R.Trigger, xt = E.forwardRef(({ className: e, ...r }, t)
158
158
  }
159
159
  ));
160
160
  xt.displayName = R.Overlay.displayName;
161
- const ye = E.forwardRef(({ className: e, children: r, withClose: t = !1, ...n }, s) => /* @__PURE__ */ c(pe.Portal, { children: [
161
+ const ye = E.forwardRef(({ className: e, children: r, withClose: t = !1, ...n }, s) => /* @__PURE__ */ l(pe.Portal, { children: [
162
162
  /* @__PURE__ */ o(xt, {}),
163
- /* @__PURE__ */ c(
163
+ /* @__PURE__ */ l(
164
164
  R.Content,
165
165
  {
166
166
  ref: s,
@@ -176,7 +176,7 @@ const ye = E.forwardRef(({ className: e, children: r, withClose: t = !1, ...n },
176
176
  {
177
177
  asChild: !0,
178
178
  className: "absolute end-4 top-4 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
179
- children: /* @__PURE__ */ c(z, { size: "fit", className: "rounded-full", variant: "secondary", children: [
179
+ children: /* @__PURE__ */ l(z, { size: "fit", className: "rounded-full", variant: "secondary", children: [
180
180
  /* @__PURE__ */ o(qt, { className: "h-4 w-4" }),
181
181
  /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
182
182
  ] })
@@ -236,14 +236,14 @@ const zt = E.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
236
236
  ));
237
237
  zt.displayName = R.Description.displayName;
238
238
  function Nt({ attachment: e }) {
239
- const { name: r, size: t, type: n, url: s } = e, a = n.startsWith("image/"), i = n.startsWith("video/"), l = n.startsWith("audio/");
240
- return l ? /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("div", { className: "w-full shrink-0 overflow-hidden", children: /* @__PURE__ */ c("audio", { controls: !0, className: "w-full", children: [
239
+ const { name: r, size: t, type: n, url: s } = e, a = n.startsWith("image/"), i = n.startsWith("video/"), c = n.startsWith("audio/");
240
+ return c ? /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("div", { className: "w-full shrink-0 overflow-hidden", children: /* @__PURE__ */ l("audio", { controls: !0, className: "w-full", children: [
241
241
  /* @__PURE__ */ o("source", { src: s, type: n }),
242
242
  "Your browser does not support the audio tag."
243
- ] }) }) }) : i ? /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("div", { className: "w-full border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ c("video", { controls: !0, children: [
243
+ ] }) }) }) : i ? /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("div", { className: "w-full border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ l("video", { controls: !0, children: [
244
244
  /* @__PURE__ */ o("source", { src: s, type: n }),
245
245
  "Your browser does not support the video tag."
246
- ] }) }) }) : !a && !i && !l ? /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ c("div", { className: "flex items-end gap-2 p-2", children: [
246
+ ] }) }) }) : !a && !i && !c ? /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: /* @__PURE__ */ l("div", { className: "flex items-end gap-2 p-2", children: [
247
247
  /* @__PURE__ */ o(
248
248
  "a",
249
249
  {
@@ -258,13 +258,13 @@ function Nt({ attachment: e }) {
258
258
  children: r
259
259
  }
260
260
  ),
261
- /* @__PURE__ */ c("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
261
+ /* @__PURE__ */ l("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: [
262
262
  (t / 1024).toFixed(2),
263
263
  " KB"
264
264
  ] })
265
- ] }) }) }) : /* @__PURE__ */ c(vt, { children: [
265
+ ] }) }) }) : /* @__PURE__ */ l(vt, { children: [
266
266
  /* @__PURE__ */ o(W, { children: /* @__PURE__ */ o(bt, { children: /* @__PURE__ */ o("div", { className: "size-fit border shrink-0 rounded-2xl overflow-hidden", children: a && /* @__PURE__ */ o("img", { src: s, className: "object-cover size-16", alt: r }) }) }) }),
267
- /* @__PURE__ */ c(
267
+ /* @__PURE__ */ l(
268
268
  ye,
269
269
  {
270
270
  "aria-describedby": void 0,
@@ -290,14 +290,14 @@ function ae({
290
290
  isFirstInGroup: s,
291
291
  isLastInGroup: a,
292
292
  isAloneInGroup: i,
293
- dataComponentNames: l,
293
+ dataComponentNames: c,
294
294
  classNames: p
295
295
  }) {
296
296
  const { anchorTarget: g } = S(), { message: x, variant: y = "default" } = e;
297
- return y === "error" ? /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { className: "flex flex-row flex-wrap items-center justify-start", children: /* @__PURE__ */ o("div", { className: "leading-snug text-sm text-destructive", children: x }) }) }) : /* @__PURE__ */ c(
297
+ return y === "error" ? /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { className: "flex flex-row flex-wrap items-center justify-start", children: /* @__PURE__ */ o("div", { className: "leading-snug text-sm text-destructive", children: x }) }) }) : /* @__PURE__ */ l(
298
298
  "div",
299
299
  {
300
- ...w((l == null ? void 0 : l.messageContainer) ?? "chat/agent_msg/root"),
300
+ ...w((c == null ? void 0 : c.messageContainer) ?? "chat/agent_msg/root"),
301
301
  className: d(
302
302
  "w-5/6 flex flex-col items-start gap-1",
303
303
  p == null ? void 0 : p.messageContainer
@@ -307,7 +307,7 @@ function ae({
307
307
  x.length > 0 && /* @__PURE__ */ o(
308
308
  "div",
309
309
  {
310
- ...w((l == null ? void 0 : l.message) ?? "chat/agent_msg/msg"),
310
+ ...w((c == null ? void 0 : c.message) ?? "chat/agent_msg/msg"),
311
311
  "data-first": s,
312
312
  "data-last": a,
313
313
  "data-alone": i,
@@ -386,7 +386,7 @@ function ge({
386
386
  ...r
387
387
  }) {
388
388
  var t, n;
389
- return /* @__PURE__ */ c(Ce, { ...r, children: [
389
+ return /* @__PURE__ */ l(Ce, { ...r, children: [
390
390
  /* @__PURE__ */ o(ze, { src: (e == null ? void 0 : e.avatar) ?? "", alt: "Agent Icon" }),
391
391
  (e == null ? void 0 : e.name) && /* @__PURE__ */ o(Ne, { children: (n = (t = e == null ? void 0 : e.name) == null ? void 0 : t.slice(0, 1)) == null ? void 0 : n.toUpperCase() })
392
392
  ] });
@@ -421,21 +421,21 @@ const Eo = 10, Fo = (e, r, t) => ({
421
421
  overrides: s = {},
422
422
  delay: a = 0,
423
423
  ...i
424
- }, l) => {
424
+ }, c) => {
425
425
  const p = e ? Ao[e](r, s, a) : {};
426
- return n && p.exit && typeof p.exit == "object" && !Array.isArray(p.exit) && (p.exit.transition = { duration: 0 }), /* @__PURE__ */ o(J.div, { ref: l, ...i, ...p, children: t });
426
+ return n && p.exit && typeof p.exit == "object" && !Array.isArray(p.exit) && (p.exit.transition = { duration: 0 }), /* @__PURE__ */ o(J.div, { ref: c, ...i, ...p, children: t });
427
427
  }
428
428
  );
429
429
  f.displayName = "MotionDiv";
430
430
  function Bo({ agent: e }) {
431
- return /* @__PURE__ */ o(T, { children: /* @__PURE__ */ c(
431
+ return /* @__PURE__ */ o(T, { children: /* @__PURE__ */ l(
432
432
  f,
433
433
  {
434
434
  ...w("chat/bot_loading/root"),
435
435
  className: "flex flex-row items-end w-full gap-2 animate-pulse",
436
436
  children: [
437
437
  /* @__PURE__ */ o(ge, { agent: e }),
438
- /* @__PURE__ */ c(
438
+ /* @__PURE__ */ l(
439
439
  "div",
440
440
  {
441
441
  ...w("chat/bot_loading/bouncing_dots_container"),
@@ -474,7 +474,7 @@ function Q({
474
474
  align: n
475
475
  }) {
476
476
  const { disableTooltips: s } = S();
477
- return !r || s ? e : /* @__PURE__ */ c($o, { children: [
477
+ return !r || s ? e : /* @__PURE__ */ l($o, { children: [
478
478
  /* @__PURE__ */ o(Yo, { asChild: !0, children: e }),
479
479
  /* @__PURE__ */ o(
480
480
  It,
@@ -506,7 +506,7 @@ const re = {
506
506
  };
507
507
  function X() {
508
508
  var y, v, h, m, u, _, k, I, M, F, P, O, b, C, B, N, L, oe, Te, Me, De, Re, Oe, je, Ee, Fe, Pe, We, He, Ae, Be, Le, $e, Ye, qe, Ue, Xe, Ve, Ke, Ge, Ze, Je, Qe, et, tt, ot, rt;
509
- const { dir: e } = be(), { isSmallScreen: r } = A(), { theme: t, inline: n } = S(), s = ($) => n ? "100%" : $, a = ($, he) => r ? `100dv${$}` : he, i = ($, he) => s(a($, he)), l = {
509
+ const { dir: e } = be(), { isSmallScreen: r } = A(), { theme: t, inline: n } = S(), s = ($) => n ? "100%" : $, a = ($, he) => r ? `100dv${$}` : he, i = ($, he) => s(a($, he)), c = {
510
510
  zIndex: ((y = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : y.zIndex) ?? 1e7,
511
511
  offset: {
512
512
  bottom: ((h = (v = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : v.offset) == null ? void 0 : h.bottom) ?? 20,
@@ -518,15 +518,15 @@ function X() {
518
518
  icon: ((P = (F = t == null ? void 0 : t.widgetTrigger) == null ? void 0 : F.size) == null ? void 0 : P.icon) ?? 24
519
519
  }
520
520
  }, p = (() => {
521
- const $ = e === "ltr" ? l.offset.right : l.offset.left;
521
+ const $ = e === "ltr" ? c.offset.right : c.offset.left;
522
522
  return typeof $ != "number" ? 0 : $;
523
523
  })(), g = {
524
524
  palette: (t == null ? void 0 : t.palette) ?? "neutral",
525
525
  primaryColor: (t == null ? void 0 : t.primaryColor) ?? "hsl(0 0% 9%)",
526
- widgetTrigger: l,
526
+ widgetTrigger: c,
527
527
  widgetContentContainer: {
528
528
  borderRadius: r ? "0px" : ((O = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : O.borderRadius) ?? "32px",
529
- zIndex: ((b = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : b.zIndex) ?? l.zIndex + 1,
529
+ zIndex: ((b = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : b.zIndex) ?? c.zIndex + 1,
530
530
  outline: ((C = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : C.outline) ?? "none",
531
531
  // was: '1px solid'
532
532
  outlineColor: ((B = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : B.outlineColor) ?? "hsl(0 0% 50% / .5)",
@@ -535,7 +535,7 @@ function X() {
535
535
  transitionTimingFunction: ((oe = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : oe.transitionTimingFunction) ?? re.transitionTimingFunction,
536
536
  transitionDuration: ((Te = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Te.transitionDuration) ?? re.transitionDuration,
537
537
  offset: {
538
- side: r ? 0 : l.offset.bottom + l.size.button + V.y * 2 + (((De = (Me = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Me.offset) == null ? void 0 : De.side) ?? 10),
538
+ side: r ? 0 : c.offset.bottom + c.size.button + V.y * 2 + (((De = (Me = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Me.offset) == null ? void 0 : De.side) ?? 10),
539
539
  align: r ? 0 : p + (((Oe = (Re = t == null ? void 0 : t.widgetContentContainer) == null ? void 0 : Re.offset) == null ? void 0 : Oe.align) ?? 0)
540
540
  }
541
541
  },
@@ -859,7 +859,7 @@ function ue({
859
859
  }) {
860
860
  const [r, t] = j(!1), {
861
861
  routerState: { screen: n }
862
- } = H(), { isSmallScreen: s } = A(), { theme: a } = X(), { setWidth: i, setHeight: l } = Mt();
862
+ } = H(), { isSmallScreen: s } = A(), { theme: a } = X(), { setWidth: i, setHeight: c } = Mt();
863
863
  if (n !== "chat" && n !== "sessions") return null;
864
864
  const p = (() => {
865
865
  switch (n) {
@@ -882,7 +882,7 @@ function ue({
882
882
  })(), x = () => {
883
883
  t((y) => {
884
884
  const v = !y;
885
- return l(v ? "100vh" : p), i(v ? `max(40vw, ${g})` : g), v;
885
+ return c(v ? "100vh" : p), i(v ? `max(40vw, ${g})` : g), v;
886
886
  });
887
887
  };
888
888
  return s && e.hideOnSmallScreen || !s && e.hideOnLargeScreen ? null : /* @__PURE__ */ o(
@@ -905,7 +905,7 @@ function Rt({
905
905
  button: e
906
906
  }) {
907
907
  var _, k;
908
- const [r, t] = j(!1), { widgetCtx: n } = Y(), { setIsOpen: s } = K(), { resolveSession: a, sessionState: i } = q(), { isSmallScreen: l } = A(), p = !i.session, g = ((_ = i.session) == null ? void 0 : _.isOpened) === !1, x = e.onResolved || "stay-in-chat", y = e.behaviorBeforeSessionCreation || "disabled", v = e.behaviorIfSessionIsResolved || "disabled", h = !!(i.isResolvingSession || p && y === "disabled" || g && v === "disabled"), m = async () => {
908
+ const [r, t] = j(!1), { widgetCtx: n } = Y(), { setIsOpen: s } = K(), { resolveSession: a, sessionState: i } = q(), { isSmallScreen: c } = A(), p = !i.session, g = ((_ = i.session) == null ? void 0 : _.isOpened) === !1, x = e.onResolved || "stay-in-chat", y = e.behaviorBeforeSessionCreation || "disabled", v = e.behaviorIfSessionIsResolved || "disabled", h = !!(i.isResolvingSession || p && y === "disabled" || g && v === "disabled"), m = async () => {
909
909
  const { success: I, error: M } = await a();
910
910
  if (t(!1), !I) return console.error(M);
911
911
  switch (x) {
@@ -958,7 +958,7 @@ function Rt({
958
958
  );
959
959
  }
960
960
  };
961
- return l && e.hideOnSmallScreen || !l && e.hideOnLargeScreen ? null : ((k = e.confirmation) == null ? void 0 : k.type) === "modal" && !g && !p ? /* @__PURE__ */ c(vt, { open: r, onOpenChange: t, children: [
961
+ return c && e.hideOnSmallScreen || !c && e.hideOnLargeScreen ? null : ((k = e.confirmation) == null ? void 0 : k.type) === "modal" && !g && !p ? /* @__PURE__ */ l(vt, { open: r, onOpenChange: t, children: [
962
962
  /* @__PURE__ */ o(bt, { asChild: !0, children: /* @__PURE__ */ o(
963
963
  z,
964
964
  {
@@ -969,10 +969,10 @@ function Rt({
969
969
  children: /* @__PURE__ */ o(ee, { name: e.icon })
970
970
  }
971
971
  ) }),
972
- /* @__PURE__ */ c(ye, { children: [
972
+ /* @__PURE__ */ l(ye, { children: [
973
973
  /* @__PURE__ */ o(yt, { children: /* @__PURE__ */ o(ke, { children: e.confirmation.title || "Close conversation" }) }),
974
974
  /* @__PURE__ */ o(kt, { children: /* @__PURE__ */ o(zt, { children: e.confirmation.description || "Are you sure you want to close this conversation?" }) }),
975
- /* @__PURE__ */ c(Ct, { children: [
975
+ /* @__PURE__ */ l(Ct, { children: [
976
976
  /* @__PURE__ */ o(
977
977
  z,
978
978
  {
@@ -1038,7 +1038,7 @@ function Ot() {
1038
1038
  const {
1039
1039
  routerState: { screen: e }
1040
1040
  } = H(), { isLoading: r } = de(), t = Uo(e), n = _e();
1041
- return /* @__PURE__ */ o("header", { ...t, className: "py-2 px-4 shrink-0", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1041
+ return /* @__PURE__ */ o("header", { ...t, className: "py-2 px-4 shrink-0", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
1042
1042
  /* @__PURE__ */ o(Xo, {}),
1043
1043
  /* @__PURE__ */ o(
1044
1044
  "div",
@@ -1065,9 +1065,9 @@ function Zo() {
1065
1065
  };
1066
1066
  }
1067
1067
  function Jo() {
1068
- const { activeMode: e, Component: r } = pt(), { sendMessage: t } = U(), { createStateCheckpoint: n } = q(), [s, a] = j(!1), i = async (l) => {
1068
+ const { activeMode: e, Component: r } = pt(), { sendMessage: t } = U(), { createStateCheckpoint: n } = q(), [s, a] = j(!1), i = async (c) => {
1069
1069
  try {
1070
- a(!0), await t(l);
1070
+ a(!0), await t(c);
1071
1071
  } catch (p) {
1072
1072
  console.error(p);
1073
1073
  } finally {
@@ -1305,7 +1305,7 @@ function pr({
1305
1305
  default:
1306
1306
  return null;
1307
1307
  }
1308
- }, l = () => {
1308
+ }, c = () => {
1309
1309
  const p = r.type.split("/")[0];
1310
1310
  return p === "image" && s ? /* @__PURE__ */ o(
1311
1311
  "img",
@@ -1320,11 +1320,11 @@ function pr({
1320
1320
  Q,
1321
1321
  {
1322
1322
  side: "bottom",
1323
- content: e === "error" ? /* @__PURE__ */ c("span", { className: "text-destructive", children: [
1323
+ content: e === "error" ? /* @__PURE__ */ l("span", { className: "text-destructive", children: [
1324
1324
  "Failed to upload: ",
1325
1325
  t
1326
1326
  ] }) : r.name,
1327
- children: /* @__PURE__ */ c(
1327
+ children: /* @__PURE__ */ l(
1328
1328
  "div",
1329
1329
  {
1330
1330
  className: d(
@@ -1348,7 +1348,7 @@ function pr({
1348
1348
  children: /* @__PURE__ */ o(xe, { className: "size-4 text-primary-foreground" })
1349
1349
  }
1350
1350
  ),
1351
- /* @__PURE__ */ o(l, {})
1351
+ /* @__PURE__ */ o(c, {})
1352
1352
  ]
1353
1353
  }
1354
1354
  )
@@ -1358,7 +1358,7 @@ function pr({
1358
1358
  function hr() {
1359
1359
  var O;
1360
1360
  const { isSmallScreen: e } = A(), r = ce(null), { sendMessage: t } = U(), { sessionState: n } = q(), { t: s } = Z(), [a, i] = j(""), {
1361
- allFiles: l,
1361
+ allFiles: c,
1362
1362
  emptyTheFiles: p,
1363
1363
  handleCancelUpload: g,
1364
1364
  appendFiles: x,
@@ -1409,7 +1409,7 @@ function hr() {
1409
1409
  const C = b.clipboardData;
1410
1410
  C && C.files.length > 0 && u(Array.from(C.files));
1411
1411
  };
1412
- return /* @__PURE__ */ c(
1412
+ return /* @__PURE__ */ l(
1413
1413
  "div",
1414
1414
  {
1415
1415
  ...w("chat/input_box/root"),
@@ -1417,7 +1417,7 @@ function hr() {
1417
1417
  ...I(),
1418
1418
  children: [
1419
1419
  /* @__PURE__ */ o("input", { ...M() }),
1420
- /* @__PURE__ */ c(
1420
+ /* @__PURE__ */ l(
1421
1421
  "div",
1422
1422
  {
1423
1423
  ...w("chat/input_box/inner_root"),
@@ -1429,18 +1429,18 @@ function hr() {
1429
1429
  "hover:border-primary focus-within:border-primary"
1430
1430
  ),
1431
1431
  children: [
1432
- /* @__PURE__ */ c(
1432
+ /* @__PURE__ */ l(
1433
1433
  "div",
1434
1434
  {
1435
1435
  ...w("chat/input_box/textarea_and_attachments_container"),
1436
1436
  className: "flex flex-col gap-2",
1437
1437
  children: [
1438
- l.length > 0 && /* @__PURE__ */ o(
1438
+ c.length > 0 && /* @__PURE__ */ o(
1439
1439
  "div",
1440
1440
  {
1441
1441
  ...w("chat/input_box/attachments_container"),
1442
1442
  className: "flex items-center gap-1",
1443
- children: /* @__PURE__ */ o(T, { mode: "popLayout", children: l.map((b) => /* @__PURE__ */ o(f, { snapExit: !0, children: /* @__PURE__ */ o(
1443
+ children: /* @__PURE__ */ o(T, { mode: "popLayout", children: c.map((b) => /* @__PURE__ */ o(f, { snapExit: !0, children: /* @__PURE__ */ o(
1444
1444
  pr,
1445
1445
  {
1446
1446
  onCancel: () => g(b.id),
@@ -1463,7 +1463,7 @@ function hr() {
1463
1463
  // INPUT_CONTAINER_B_RADIUS,
1464
1464
  "max-h-16 [field-sizing:content]",
1465
1465
  "w-full resize-none px-2",
1466
- l.length === 0 && "pt-1",
1466
+ c.length === 0 && "pt-1",
1467
1467
  "bg-transparent outline-none",
1468
1468
  "placeholder:text-muted-foreground",
1469
1469
  // 16px on mobiles prevents auto-zoom on the input when focused
@@ -1479,7 +1479,7 @@ function hr() {
1479
1479
  ]
1480
1480
  }
1481
1481
  ),
1482
- /* @__PURE__ */ c("div", { className: "gap-2 flex justify-between", children: [
1482
+ /* @__PURE__ */ l("div", { className: "gap-2 flex justify-between", children: [
1483
1483
  /* @__PURE__ */ o(
1484
1484
  Q,
1485
1485
  {
@@ -1520,8 +1520,8 @@ function hr() {
1520
1520
  }
1521
1521
  function mr() {
1522
1522
  const { widgetCtx: e } = Y(), { router: r } = S(), { canCreateNewSession: t } = q(), { toSessionsScreen: n } = H(), { t: s } = Z();
1523
- return /* @__PURE__ */ o("div", { className: "p-2", children: /* @__PURE__ */ c("div", { className: "p-2 bg-muted rounded-3xl space-y-2", children: [
1524
- /* @__PURE__ */ c("div", { className: "ps-2 flex items-center gap-1", children: [
1523
+ return /* @__PURE__ */ o("div", { className: "p-2", children: /* @__PURE__ */ l("div", { className: "p-2 bg-muted rounded-3xl space-y-2", children: [
1524
+ /* @__PURE__ */ l("div", { className: "ps-2 flex items-center gap-1", children: [
1525
1525
  /* @__PURE__ */ o(gt, { className: "size-4 text-emerald-600" }),
1526
1526
  /* @__PURE__ */ o("h2", { className: "text-sm font-medium", children: s("session-closed-lead") })
1527
1527
  ] }),
@@ -1550,7 +1550,7 @@ function wr() {
1550
1550
  children: /* @__PURE__ */ o(mr, {})
1551
1551
  },
1552
1552
  "session-closed"
1553
- ) : /* @__PURE__ */ c(
1553
+ ) : /* @__PURE__ */ l(
1554
1554
  f,
1555
1555
  {
1556
1556
  className: "overflow-hidden",
@@ -1561,12 +1561,12 @@ function wr() {
1561
1561
  },
1562
1562
  children: [
1563
1563
  s.lastAIResMightSolveUserIssue && (t == null ? void 0 : t.enabled) !== !1 && /* @__PURE__ */ o(dr, {}),
1564
- a && e && r !== "below-initial-messages" && /* @__PURE__ */ o("div", { className: "flex items-center flex-row justify-end gap-2 flex-wrap px-2", children: e == null ? void 0 : e.map((l, p) => /* @__PURE__ */ o(
1564
+ a && e && r !== "below-initial-messages" && /* @__PURE__ */ o("div", { className: "flex items-center flex-row justify-end gap-2 flex-wrap px-2", children: e == null ? void 0 : e.map((c, p) => /* @__PURE__ */ o(
1565
1565
  Ie,
1566
1566
  {
1567
- suggestion: l
1567
+ suggestion: c
1568
1568
  },
1569
- `${l}-${p}`
1569
+ `${c}-${p}`
1570
1570
  )) }),
1571
1571
  /* @__PURE__ */ o(hr, {})
1572
1572
  ]
@@ -1620,7 +1620,7 @@ function we({
1620
1620
  agent: r,
1621
1621
  suggestedReplies: t
1622
1622
  }) {
1623
- return /* @__PURE__ */ c(
1623
+ return /* @__PURE__ */ l(
1624
1624
  "div",
1625
1625
  {
1626
1626
  ...w("chat/agent_msg_group/root"),
@@ -1634,8 +1634,8 @@ function we({
1634
1634
  className: "hidden"
1635
1635
  }
1636
1636
  ) }),
1637
- /* @__PURE__ */ c("div", { className: d("flex-1 flex flex-col gap-2"), children: [
1638
- /* @__PURE__ */ c(
1637
+ /* @__PURE__ */ l("div", { className: d("flex-1 flex flex-col gap-2"), children: [
1638
+ /* @__PURE__ */ l(
1639
1639
  "div",
1640
1640
  {
1641
1641
  ...w("chat/agent_msg_group/avatar_and_msgs/root"),
@@ -1694,7 +1694,7 @@ function ur({
1694
1694
  isAloneInGroup: n
1695
1695
  }) {
1696
1696
  var s;
1697
- return /* @__PURE__ */ c(
1697
+ return /* @__PURE__ */ l(
1698
1698
  "div",
1699
1699
  {
1700
1700
  ...w("chat/user_msg/root"),
@@ -1752,8 +1752,8 @@ function vr(e) {
1752
1752
  const r = [];
1753
1753
  let t = null;
1754
1754
  return e.forEach((n) => {
1755
- var s, a, i, l;
1756
- (!t || ((s = t[0]) == null ? void 0 : s.type) !== n.type) && (t = [], r.push(t)), ((a = t[0]) == null ? void 0 : a.type) === "FROM_AGENT" && n.type === "FROM_AGENT" && ((i = n.agent) == null ? void 0 : i.id) !== ((l = t[0].agent) == null ? void 0 : l.id) && (t = [], r.push(t)), t.push(n);
1755
+ var s, a, i, c;
1756
+ (!t || ((s = t[0]) == null ? void 0 : s.type) !== n.type) && (t = [], r.push(t)), ((a = t[0]) == null ? void 0 : a.type) === "FROM_AGENT" && n.type === "FROM_AGENT" && ((i = n.agent) == null ? void 0 : i.id) !== ((c = t[0].agent) == null ? void 0 : c.id) && (t = [], r.push(t)), t.push(n);
1757
1757
  }), r;
1758
1758
  }
1759
1759
  function br(e) {
@@ -1774,7 +1774,7 @@ function kr() {
1774
1774
  } = U(), { isAwaitingBotReply: r } = ht(), { componentStore: t } = Y(), n = S(), { initialQuestions: s, initialQuestionsPosition: a } = n, i = dt(
1775
1775
  () => vr(e),
1776
1776
  [e]
1777
- ), l = n.persistentInitialMessages || [], p = (() => {
1777
+ ), c = n.persistentInitialMessages || [], p = (() => {
1778
1778
  var h;
1779
1779
  return e.length ? ((h = n.advancedInitialMessages) == null ? void 0 : h.filter((m) => !!m.persistent)) || [] : n.advancedInitialMessages || [];
1780
1780
  })(), g = (() => {
@@ -1791,14 +1791,14 @@ function kr() {
1791
1791
  }
1792
1792
  return le(() => {
1793
1793
  v();
1794
- }, [e]), /* @__PURE__ */ c(
1794
+ }, [e]), /* @__PURE__ */ l(
1795
1795
  "div",
1796
1796
  {
1797
1797
  ...w("chat/msgs/root"),
1798
1798
  ref: y,
1799
1799
  className: "max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",
1800
1800
  children: [
1801
- /* @__PURE__ */ o("div", { ...w("chat/persistent_initial_msgs/root"), children: l.map((h, m, u) => /* @__PURE__ */ o(
1801
+ /* @__PURE__ */ o("div", { ...w("chat/persistent_initial_msgs/root"), children: c.map((h, m, u) => /* @__PURE__ */ o(
1802
1802
  ae,
1803
1803
  {
1804
1804
  component: "bot_message",
@@ -1904,7 +1904,7 @@ function Cr() {
1904
1904
  maxHeight: "100vh"
1905
1905
  // Relative to the iframe
1906
1906
  },
1907
- children: /* @__PURE__ */ c("div", { className: "size-full justify-between flex flex-col", children: [
1907
+ children: /* @__PURE__ */ l("div", { className: "size-full justify-between flex flex-col", children: [
1908
1908
  /* @__PURE__ */ o(Ot, {}),
1909
1909
  /* @__PURE__ */ o(T, { mode: "wait", children: e ? /* @__PURE__ */ o(
1910
1910
  f,
@@ -1913,13 +1913,13 @@ function Cr() {
1913
1913
  children: /* @__PURE__ */ o(jt, {})
1914
1914
  },
1915
1915
  "loading"
1916
- ) : /* @__PURE__ */ c(
1916
+ ) : /* @__PURE__ */ l(
1917
1917
  f,
1918
1918
  {
1919
1919
  className: "flex items-start h-full flex-1 overflow-auto",
1920
1920
  snapExit: !0,
1921
1921
  children: [
1922
- /* @__PURE__ */ c(
1922
+ /* @__PURE__ */ l(
1923
1923
  "div",
1924
1924
  {
1925
1925
  ...w("chat/main/root"),
@@ -1989,7 +1989,7 @@ function Ft({ className: e }) {
1989
1989
  "flex items-center justify-center gap-2 p-2 pt-0",
1990
1990
  e
1991
1991
  ),
1992
- children: /* @__PURE__ */ o(W, { children: /* @__PURE__ */ c(
1992
+ children: /* @__PURE__ */ o(W, { children: /* @__PURE__ */ l(
1993
1993
  "a",
1994
1994
  {
1995
1995
  href: `https://open.cx/?ref=${r}`,
@@ -2003,7 +2003,7 @@ function Ft({ className: e }) {
2003
2003
  children: [
2004
2004
  /* @__PURE__ */ o("span", { children: "Powered by" }),
2005
2005
  /* @__PURE__ */ o("span", { children: " " }),
2006
- /* @__PURE__ */ c("span", { className: "flex items-center gap-[1px]", children: [
2006
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-[1px]", children: [
2007
2007
  /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(zr, { className: "size-3 inline-block" }) }),
2008
2008
  /* @__PURE__ */ o("span", { className: "font-semibold", children: "open" })
2009
2009
  ] })
@@ -2021,7 +2021,7 @@ function lt({
2021
2021
  className: r
2022
2022
  }) {
2023
2023
  const { bot: t } = S(), { toChatScreen: n } = H(), s = e.assignee.kind === "human" ? e.assignee.name || "Support Agent" : (t == null ? void 0 : t.name) || "AI Support Agent", a = e.assignee.kind === "human" ? e.assignee.avatarUrl || "" : (t == null ? void 0 : t.avatar) || "";
2024
- return /* @__PURE__ */ c(
2024
+ return /* @__PURE__ */ l(
2025
2025
  z,
2026
2026
  {
2027
2027
  variant: "ghost",
@@ -2032,12 +2032,12 @@ function lt({
2032
2032
  ),
2033
2033
  onClick: () => n(e.id),
2034
2034
  children: [
2035
- /* @__PURE__ */ c("div", { className: "flex-1 flex gap-2 items-center", children: [
2036
- /* @__PURE__ */ o(T, { mode: "wait", children: /* @__PURE__ */ o(f, { snapExit: !0, children: /* @__PURE__ */ c(Ce, { className: "size-10", children: [
2035
+ /* @__PURE__ */ l("div", { className: "flex-1 flex gap-2 items-center", children: [
2036
+ /* @__PURE__ */ o(T, { mode: "wait", children: /* @__PURE__ */ o(f, { snapExit: !0, children: /* @__PURE__ */ l(Ce, { className: "size-10", children: [
2037
2037
  /* @__PURE__ */ o(ze, { src: a, alt: "Agent Icon" }),
2038
2038
  /* @__PURE__ */ o(Ne, { children: /* @__PURE__ */ o(vo, { className: "size-4" }) })
2039
2039
  ] }) }) }),
2040
- /* @__PURE__ */ c("div", { className: "flex-1", children: [
2040
+ /* @__PURE__ */ l("div", { className: "flex-1", children: [
2041
2041
  /* @__PURE__ */ o(T, { mode: "wait", children: /* @__PURE__ */ o(f, { snapExit: !0, children: s }, s) }),
2042
2042
  /* @__PURE__ */ o(T, { mode: "wait", children: e.lastMessage ? /* @__PURE__ */ o(f, { snapExit: !0, children: /* @__PURE__ */ o(
2043
2043
  St,
@@ -2073,8 +2073,8 @@ function Sr() {
2073
2073
  f,
2074
2074
  {
2075
2075
  className: "flex-1 flex flex-col gap-2 relative",
2076
- children: t.length ? /* @__PURE__ */ c(ve, { children: [
2077
- /* @__PURE__ */ c(T, { children: [
2076
+ children: t.length ? /* @__PURE__ */ l(ve, { children: [
2077
+ /* @__PURE__ */ l(T, { children: [
2078
2078
  s.length > 0 && /* @__PURE__ */ o(
2079
2079
  f,
2080
2080
  {
@@ -2082,11 +2082,11 @@ function Sr() {
2082
2082
  delay: 0.2,
2083
2083
  className: "space-y-2",
2084
2084
  snapExit: !0,
2085
- children: s.map((l) => /* @__PURE__ */ o(lt, { session: l }, l.id))
2085
+ children: s.map((c) => /* @__PURE__ */ o(lt, { session: c }, c.id))
2086
2086
  },
2087
2087
  "open-sessions"
2088
2088
  ),
2089
- a.length > 0 && /* @__PURE__ */ c(
2089
+ a.length > 0 && /* @__PURE__ */ l(
2090
2090
  f,
2091
2091
  {
2092
2092
  className: "space-y-2",
@@ -2094,13 +2094,13 @@ function Sr() {
2094
2094
  snapExit: !0,
2095
2095
  children: [
2096
2096
  /* @__PURE__ */ o(Nr, { children: e("closed-conversations") }),
2097
- a.map((l) => /* @__PURE__ */ o(
2097
+ a.map((c) => /* @__PURE__ */ o(
2098
2098
  lt,
2099
2099
  {
2100
- session: l,
2100
+ session: c,
2101
2101
  className: "opacity-50 hover:opacity-100"
2102
2102
  },
2103
- l.id
2103
+ c.id
2104
2104
  ))
2105
2105
  ]
2106
2106
  },
@@ -2118,7 +2118,7 @@ function Sr() {
2118
2118
  },
2119
2119
  e("new-conversation")
2120
2120
  ) })
2121
- ] }) : /* @__PURE__ */ c("div", { className: "flex-1 flex flex-col gap-2 items-center", children: [
2121
+ ] }) : /* @__PURE__ */ l("div", { className: "flex-1 flex flex-col gap-2 items-center", children: [
2122
2122
  /* @__PURE__ */ o("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ o("p", { className: "text-muted-foreground", children: e("no-conversations-yet") }) }),
2123
2123
  /* @__PURE__ */ nt(
2124
2124
  z,
@@ -2156,7 +2156,7 @@ function _r() {
2156
2156
  maxHeight: "100vh"
2157
2157
  // Relative to the iframe
2158
2158
  },
2159
- children: /* @__PURE__ */ c("div", { className: "size-full flex flex-col", children: [
2159
+ children: /* @__PURE__ */ l("div", { className: "size-full flex flex-col", children: [
2160
2160
  /* @__PURE__ */ o(Ot, {}),
2161
2161
  /* @__PURE__ */ o(Sr, {}),
2162
2162
  /* @__PURE__ */ o(Ft, {})
@@ -2194,10 +2194,10 @@ function Ir() {
2194
2194
  let a;
2195
2195
  const i = new ResizeObserver(() => {
2196
2196
  a = requestAnimationFrame(() => {
2197
- const l = s.offsetHeight;
2197
+ const c = s.offsetHeight;
2198
2198
  n.style.setProperty(
2199
2199
  "--opencx-widget-height",
2200
- r ? "100%" : `${l.toFixed(1)}px`
2200
+ r ? "100%" : `${c.toFixed(1)}px`
2201
2201
  );
2202
2202
  });
2203
2203
  });
@@ -2213,7 +2213,7 @@ const Tr = me.object({
2213
2213
  });
2214
2214
  function Mr() {
2215
2215
  var k, I, M, F, P, O, b, C, B;
2216
- const { setIsOpen: e } = K(), { createUnverifiedContact: r } = Lt(), { isSmallScreen: t } = A(), n = S(), { theme: s } = X(), { t: a } = Z(), { data: i } = de(), { observedElementRef: l } = Ir();
2216
+ const { setIsOpen: e } = K(), { createUnverifiedContact: r } = Lt(), { isSmallScreen: t } = A(), n = S(), { theme: s } = X(), { t: a } = Z(), { data: i } = de(), { observedElementRef: c } = Ir();
2217
2217
  Se({
2218
2218
  height: void 0,
2219
2219
  width: s.screens.welcome.width
@@ -2250,17 +2250,17 @@ function Mr() {
2250
2250
  // Relative to the iframe
2251
2251
  overflowY: "auto"
2252
2252
  },
2253
- children: /* @__PURE__ */ c(
2253
+ children: /* @__PURE__ */ l(
2254
2254
  "div",
2255
2255
  {
2256
- ref: l,
2256
+ ref: c,
2257
2257
  className: d(
2258
2258
  "flex flex-col",
2259
2259
  t && "h-full",
2260
2260
  "bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"
2261
2261
  ),
2262
2262
  children: [
2263
- /* @__PURE__ */ c(
2263
+ /* @__PURE__ */ l(
2264
2264
  "div",
2265
2265
  {
2266
2266
  className: d(
@@ -2277,14 +2277,14 @@ function Mr() {
2277
2277
  className: "h-8 w-auto object-contain"
2278
2278
  }
2279
2279
  ) : /* @__PURE__ */ o("h2", { className: "font-bold text-sm", children: (P = i == null ? void 0 : i.data) == null ? void 0 : P.organizationName }) }),
2280
- /* @__PURE__ */ c("div", { className: "space-y-2", children: [
2280
+ /* @__PURE__ */ l("div", { className: "space-y-2", children: [
2281
2281
  /* @__PURE__ */ o("h1", { className: "text-[1.75rem] font-semibold tracking-tight leading-none", children: ((b = (O = n.textContent) == null ? void 0 : O.welcomeScreen) == null ? void 0 : b.title) || a("welcome-title") }),
2282
2282
  /* @__PURE__ */ o("p", { className: "text-sm", children: ((B = (C = n.textContent) == null ? void 0 : C.welcomeScreen) == null ? void 0 : B.description) || a("welcome-description") })
2283
2283
  ] })
2284
2284
  ]
2285
2285
  }
2286
2286
  ),
2287
- /* @__PURE__ */ c(
2287
+ /* @__PURE__ */ l(
2288
2288
  "div",
2289
2289
  {
2290
2290
  className: d(
@@ -2294,7 +2294,7 @@ function Mr() {
2294
2294
  "rounded-3xl"
2295
2295
  ),
2296
2296
  children: [
2297
- /* @__PURE__ */ c("form", { onSubmit: _, className: "space-y-2", children: [
2297
+ /* @__PURE__ */ l("form", { onSubmit: _, className: "space-y-2", children: [
2298
2298
  /* @__PURE__ */ o(
2299
2299
  ne,
2300
2300
  {
@@ -2328,7 +2328,7 @@ function Mr() {
2328
2328
  },
2329
2329
  N
2330
2330
  )),
2331
- /* @__PURE__ */ c(
2331
+ /* @__PURE__ */ l(
2332
2332
  z,
2333
2333
  {
2334
2334
  disabled: u.loading,
@@ -2356,7 +2356,7 @@ function Pt() {
2356
2356
  const {
2357
2357
  routerState: { screen: e }
2358
2358
  } = H();
2359
- return /* @__PURE__ */ c(ve, { children: [
2359
+ return /* @__PURE__ */ l(ve, { children: [
2360
2360
  /* @__PURE__ */ o(pe.Container, {}),
2361
2361
  /* @__PURE__ */ o("div", { className: "relative bg-background size-full", children: /* @__PURE__ */ o(T, { mode: "wait", children: (() => {
2362
2362
  switch (e) {
@@ -2399,7 +2399,7 @@ function Pt() {
2399
2399
  })() }) })
2400
2400
  ] });
2401
2401
  }
2402
- const Dr = `<!DOCTYPE html>
2402
+ const Dr = "4.0.6", Rr = `<!DOCTYPE html>
2403
2403
  <html>
2404
2404
  <head>
2405
2405
  <style>
@@ -2418,7 +2418,7 @@ html, body {
2418
2418
  </body>
2419
2419
  </html>`;
2420
2420
  function Wt() {
2421
- const { isOpen: e } = K(), { version: r, contentIframeRef: t } = Y(), { cssOverrides: n, inline: s } = S(), { theme: a, cssVars: i, computed: l } = X(), { dir: p } = Z();
2421
+ const { isOpen: e } = K(), { contentIframeRef: r } = Y(), { cssOverrides: t, inline: n } = S(), { theme: s, cssVars: a, computed: i } = X(), { dir: c } = Z();
2422
2422
  return /* @__PURE__ */ o(
2423
2423
  J.div,
2424
2424
  {
@@ -2435,43 +2435,43 @@ function Wt() {
2435
2435
  opacity: 1,
2436
2436
  y: 0,
2437
2437
  display: "block",
2438
- height: s ? "100%" : void 0
2438
+ height: n ? "100%" : void 0
2439
2439
  }
2440
2440
  },
2441
- children: /* @__PURE__ */ c(
2441
+ children: /* @__PURE__ */ l(
2442
2442
  ut,
2443
2443
  {
2444
- ref: t,
2445
- initialContent: Dr,
2444
+ ref: r,
2445
+ initialContent: Rr,
2446
2446
  allowFullScreen: !0,
2447
2447
  title: "OpenCX Live Chat",
2448
2448
  style: {
2449
2449
  // @ts-expect-error this is a valid css variable
2450
- "--opencx-widget-width": l.minWidth,
2451
- "--opencx-widget-height": l.minHeight,
2452
- minWidth: l.minWidth,
2450
+ "--opencx-widget-width": i.minWidth,
2451
+ "--opencx-widget-height": i.minHeight,
2452
+ minWidth: i.minWidth,
2453
2453
  width: "var(--opencx-widget-width)",
2454
- maxWidth: l.maxWidth,
2454
+ maxWidth: i.maxWidth,
2455
2455
  // Relative to the viewport
2456
- minHeight: l.minHeight,
2456
+ minHeight: i.minHeight,
2457
2457
  height: "var(--opencx-widget-height)",
2458
- maxHeight: l.maxHeight,
2458
+ maxHeight: i.maxHeight,
2459
2459
  // Relative to the viewport
2460
2460
  overflow: "hidden",
2461
2461
  /** outline is better than border because of box sizing; the outline wouldn't affect the content inside... the border will mess up how the children's border radius sits with the parent */
2462
- outline: a.widgetContentContainer.outline,
2463
- outlineColor: a.widgetContentContainer.outlineColor,
2464
- borderRadius: a.widgetContentContainer.borderRadius,
2465
- boxShadow: a.widgetContentContainer.boxShadow,
2466
- transitionProperty: a.widgetContentContainer.transitionProperty,
2467
- transitionTimingFunction: a.widgetContentContainer.transitionTimingFunction,
2468
- transitionDuration: a.widgetContentContainer.transitionDuration,
2462
+ outline: s.widgetContentContainer.outline,
2463
+ outlineColor: s.widgetContentContainer.outlineColor,
2464
+ borderRadius: s.widgetContentContainer.borderRadius,
2465
+ boxShadow: s.widgetContentContainer.boxShadow,
2466
+ transitionProperty: s.widgetContentContainer.transitionProperty,
2467
+ transitionTimingFunction: s.widgetContentContainer.transitionTimingFunction,
2468
+ transitionDuration: s.widgetContentContainer.transitionDuration,
2469
2469
  // reset iframe defaults
2470
2470
  boxSizing: "border-box",
2471
2471
  borderWidth: "0px"
2472
2472
  },
2473
2473
  children: [
2474
- n && /* @__PURE__ */ o("style", { children: n }),
2474
+ t && /* @__PURE__ */ o("style", { children: t }),
2475
2475
  /* @__PURE__ */ o(
2476
2476
  Lo,
2477
2477
  {
@@ -2481,13 +2481,13 @@ function Wt() {
2481
2481
  "div",
2482
2482
  {
2483
2483
  style: {
2484
- ...i
2484
+ ...a
2485
2485
  },
2486
- "data-version": r,
2486
+ "data-version": Dr,
2487
2487
  className: d(
2488
2488
  "antialiased font-sans size-full overflow-hidden relative text-secondary-foreground"
2489
2489
  ),
2490
- dir: p,
2490
+ dir: c,
2491
2491
  children: /* @__PURE__ */ o(Pt, {})
2492
2492
  }
2493
2493
  )
@@ -2499,7 +2499,7 @@ function Wt() {
2499
2499
  }
2500
2500
  );
2501
2501
  }
2502
- function Rr() {
2502
+ function Or() {
2503
2503
  const { theme: e } = X();
2504
2504
  return /* @__PURE__ */ o(
2505
2505
  ie.Content,
@@ -2519,11 +2519,11 @@ function Rr() {
2519
2519
  }
2520
2520
  );
2521
2521
  }
2522
- function Or({
2522
+ function jr({
2523
2523
  className: e,
2524
2524
  style: r
2525
2525
  }) {
2526
- return /* @__PURE__ */ c(
2526
+ return /* @__PURE__ */ l(
2527
2527
  "svg",
2528
2528
  {
2529
2529
  width: "32",
@@ -2554,7 +2554,7 @@ function Or({
2554
2554
  }
2555
2555
  );
2556
2556
  }
2557
- const jr = `<!DOCTYPE html>
2557
+ const Er = `<!DOCTYPE html>
2558
2558
  <html>
2559
2559
  <head>
2560
2560
  <style>
@@ -2571,13 +2571,13 @@ html, body {
2571
2571
  <body>
2572
2572
  </body>
2573
2573
  </html>`;
2574
- function Er() {
2574
+ function Fr() {
2575
2575
  var a, i;
2576
2576
  const { isOpen: e } = K(), { cssOverrides: r, assets: t } = S(), { theme: n, cssVars: s } = X();
2577
- return /* @__PURE__ */ c(
2577
+ return /* @__PURE__ */ l(
2578
2578
  ut,
2579
2579
  {
2580
- initialContent: jr,
2580
+ initialContent: Er,
2581
2581
  style: {
2582
2582
  height: `calc(${n.widgetTrigger.size.button}px + ${V.x * 2}px)`,
2583
2583
  width: `calc(${n.widgetTrigger.size.button}px + ${V.y * 2}px)`,
@@ -2677,7 +2677,7 @@ function Er() {
2677
2677
  }
2678
2678
  }
2679
2679
  ) : /* @__PURE__ */ o(
2680
- Or,
2680
+ jr,
2681
2681
  {
2682
2682
  style: {
2683
2683
  width: n.widgetTrigger.size.icon,
@@ -2699,7 +2699,7 @@ function Er() {
2699
2699
  }
2700
2700
  );
2701
2701
  }
2702
- function Fr() {
2702
+ function Pr() {
2703
2703
  const { dir: e } = be();
2704
2704
  return /* @__PURE__ */ o(
2705
2705
  ie.Anchor,
@@ -2713,15 +2713,15 @@ function Fr() {
2713
2713
  }
2714
2714
  );
2715
2715
  }
2716
- function Pr() {
2716
+ function Wr() {
2717
2717
  const { isOpen: e, setIsOpen: r } = K();
2718
- return /* @__PURE__ */ c(ie.Root, { open: e, onOpenChange: r, children: [
2718
+ return /* @__PURE__ */ l(ie.Root, { open: e, onOpenChange: r, children: [
2719
+ /* @__PURE__ */ o(Pr, {}),
2719
2720
  /* @__PURE__ */ o(Fr, {}),
2720
- /* @__PURE__ */ o(Er, {}),
2721
- /* @__PURE__ */ o(Rr, {})
2721
+ /* @__PURE__ */ o(Or, {})
2722
2722
  ] });
2723
2723
  }
2724
- const Wr = [
2724
+ const Hr = [
2725
2725
  {
2726
2726
  key: "loading",
2727
2727
  component: Bo
@@ -2738,7 +2738,7 @@ const Wr = [
2738
2738
  key: "agent_message",
2739
2739
  component: ae
2740
2740
  }
2741
- ], Hr = {
2741
+ ], Ar = {
2742
2742
  get: async (e) => localStorage.getItem(e),
2743
2743
  set: async (e, r) => {
2744
2744
  localStorage.setItem(e, r);
@@ -2747,7 +2747,7 @@ const Wr = [
2747
2747
  localStorage.removeItem(e);
2748
2748
  }
2749
2749
  };
2750
- function sn({
2750
+ function an({
2751
2751
  options: e,
2752
2752
  components: r = [],
2753
2753
  loadingComponent: t
@@ -2755,15 +2755,15 @@ function sn({
2755
2755
  return /* @__PURE__ */ o(
2756
2756
  $t,
2757
2757
  {
2758
- components: [...Wr, ...r],
2758
+ components: [...Hr, ...r],
2759
2759
  options: e,
2760
- storage: Hr,
2760
+ storage: Ar,
2761
2761
  loadingComponent: t,
2762
- children: /* @__PURE__ */ o(Yt, { children: e.inline ? /* @__PURE__ */ o(Wt, {}) : /* @__PURE__ */ o(Pr, {}) })
2762
+ children: /* @__PURE__ */ o(Yt, { children: e.inline ? /* @__PURE__ */ o(Wt, {}) : /* @__PURE__ */ o(Wr, {}) })
2763
2763
  }
2764
2764
  );
2765
2765
  }
2766
2766
  export {
2767
- sn as Widget
2767
+ an as Widget
2768
2768
  };
2769
2769
  //# sourceMappingURL=index.js.map