@bymos/agentkit-sdk 0.7.2 → 0.7.3

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/index.js CHANGED
@@ -2754,11 +2754,11 @@ ct.create = (e, t) => new ct({
2754
2754
  typeName: I.ZodReadonly,
2755
2755
  ...E(t)
2756
2756
  });
2757
- var wo = { object: te.lazycreate }, I;
2757
+ var So = { object: te.lazycreate }, I;
2758
2758
  (function(e) {
2759
2759
  e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
2760
2760
  })(I || (I = {}));
2761
- var W = qe.create, So = wt.create, Co = Pt.create, Io = Ct.create, vt = Nt.create, No = Et.create, Eo = Mt.create, Mo = et.create, Lo = tt.create, To = Lt.create, za = Ne.create, Ao = ve.create, Ro = Tt.create, jo = Le.create, Dt = te.create, Zo = te.strictCreate, Oo = rt.create, Fo = Pa.create, Po = at.create, $o = be.create, Wa = $a.create, Vo = jt.create, zo = Zt.create, Wo = Va.create, Do = nt.create, Uo = it.create, $t = ft.create, Bo = st.create, Go = Fe.create, Ho = pe.create, Yo = fe.create, Xo = _e.create, Jo = pe.createWithPreprocess, Qo = $r.create, Da = Dt({
2761
+ var W = qe.create, Co = wt.create, Io = Pt.create, No = Ct.create, vt = Nt.create, Eo = Et.create, Mo = Mt.create, Lo = et.create, To = tt.create, Ao = Lt.create, za = Ne.create, Ro = ve.create, jo = Tt.create, Zo = Le.create, Dt = te.create, Oo = te.strictCreate, Fo = rt.create, Po = Pa.create, $o = at.create, Vo = be.create, Wa = $a.create, zo = jt.create, Wo = Zt.create, Do = Va.create, Uo = nt.create, Bo = it.create, $t = ft.create, Go = st.create, Ho = Fe.create, Yo = pe.create, Xo = fe.create, Jo = _e.create, Qo = pe.createWithPreprocess, Ko = $r.create, Da = Dt({
2762
2762
  mode: $t([
2763
2763
  "light",
2764
2764
  "dark",
@@ -5696,7 +5696,10 @@ function _s(e, t) {
5696
5696
  function xs(e) {
5697
5697
  e.remove();
5698
5698
  }
5699
- function ws() {
5699
+ function ws(e) {
5700
+ document.body ? document.body.appendChild(e) : document.addEventListener("DOMContentLoaded", () => document.body.appendChild(e), { once: !0 });
5701
+ }
5702
+ function Ss() {
5700
5703
  const e = document.createElement("div");
5701
5704
  return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText = [
5702
5705
  "position: fixed",
@@ -5704,9 +5707,9 @@ function ws() {
5704
5707
  "right: 24px",
5705
5708
  "z-index: 2147483647",
5706
5709
  "pointer-events: none"
5707
- ].join("; "), document.body.appendChild(e), e;
5710
+ ].join("; "), ws(e), e;
5708
5711
  }
5709
- function Ss(e) {
5712
+ function Cs(e) {
5710
5713
  getComputedStyle(e).position === "static" && (e.style.position = "relative");
5711
5714
  const t = document.createElement("div");
5712
5715
  return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText = [
@@ -5717,19 +5720,19 @@ function Ss(e) {
5717
5720
  "pointer-events: none"
5718
5721
  ].join("; "), e.appendChild(t), t;
5719
5722
  }
5720
- function Cs(e) {
5723
+ function Is(e) {
5721
5724
  return e.setAttribute("data-agentkit-root", "inline"), getComputedStyle(e).position === "static" && (e.style.position = "relative"), e;
5722
5725
  }
5723
- function Is(e) {
5726
+ function Ns(e) {
5724
5727
  e.remove();
5725
5728
  }
5726
- function Ns(e) {
5729
+ function Es(e) {
5727
5730
  e.removeAttribute("data-agentkit-root");
5728
5731
  }
5729
5732
  function Yt(e, t, r, a, n) {
5730
5733
  const i = e.mode === "inline";
5731
5734
  let s = !1;
5732
- const o = i && n ? Cs(n) : !i && n ? Ss(n) : ws(), l = bs(o);
5735
+ const o = i && n ? Is(n) : !i && n ? Cs(n) : Ss(), l = bs(o);
5733
5736
  _s(l.styleSlot, a);
5734
5737
  const d = new vs(e, t, (p, f) => {
5735
5738
  s || h.update(p, f);
@@ -5763,7 +5766,7 @@ function Yt(e, t, r, a, n) {
5763
5766
  s || (d.resetConversation(), d.emitter.emit("reset"));
5764
5767
  },
5765
5768
  destroy() {
5766
- s || (s = !0, d.closeEventStream(), h.destroy(), xs(l.host), i && n ? Ns(n) : Is(o), d.emitter.emit("destroy"), d.emitter.removeAllListeners());
5769
+ s || (s = !0, d.closeEventStream(), h.destroy(), xs(l.host), i && n ? Es(n) : Ns(o), d.emitter.emit("destroy"), d.emitter.removeAllListeners());
5767
5770
  },
5768
5771
  on(p, f) {
5769
5772
  d.emitter.on(p, f);
@@ -5777,41 +5780,41 @@ function Yt(e, t, r, a, n) {
5777
5780
  };
5778
5781
  return u;
5779
5782
  }
5780
- var Ee = /* @__PURE__ */ new Map(), Es = 0;
5783
+ var Ee = /* @__PURE__ */ new Map(), Ms = 0;
5781
5784
  function Xt(e) {
5782
- const t = `agentkit-widget-${++Es}`, r = e.destroy.bind(e);
5785
+ const t = `agentkit-widget-${++Ms}`, r = e.destroy.bind(e);
5783
5786
  return e.destroy = () => {
5784
5787
  Ee.delete(t), r();
5785
5788
  }, Ee.set(t, e), t;
5786
5789
  }
5787
- function Ms(e, t, r) {
5790
+ function Ls(e, t, r) {
5788
5791
  const a = {
5789
5792
  ...e,
5790
5793
  mode: "floating"
5791
5794
  }, n = Yt(Ve(a), a, t, r);
5792
5795
  return Xt(n), n;
5793
5796
  }
5794
- function Ls(e, t, r, a) {
5797
+ function Ts(e, t, r, a) {
5795
5798
  const n = {
5796
5799
  ...t,
5797
5800
  mode: "floating"
5798
5801
  }, i = Yt(Ve(n), n, r, a, e);
5799
5802
  return Xt(i), i;
5800
5803
  }
5801
- function Ts(e, t, r, a) {
5804
+ function As(e, t, r, a) {
5802
5805
  const n = {
5803
5806
  ...t,
5804
5807
  mode: "inline"
5805
5808
  }, i = Yt(Ve(n), n, r, a, e);
5806
5809
  return Xt(i), i;
5807
5810
  }
5808
- function As(e) {
5811
+ function Rs(e) {
5809
5812
  e ? Ee.get(e)?.destroy() : (Ee.forEach((t) => t.destroy()), Ee.clear());
5810
5813
  }
5811
- function Ko() {
5814
+ function qo() {
5812
5815
  return Array.from(Ee.keys());
5813
5816
  }
5814
- function Rs(e) {
5817
+ function js(e) {
5815
5818
  const { theme: t } = e, r = [
5816
5819
  `--ak-accent: ${t.accentColor}`,
5817
5820
  `--ak-font: ${t.fontFamily}`,
@@ -5819,10 +5822,10 @@ function Rs(e) {
5819
5822
  ];
5820
5823
  return r.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`), `:host { ${r.join("; ")} }`;
5821
5824
  }
5822
- function js(e) {
5825
+ function Zs(e) {
5823
5826
  return e !== "system" ? e : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
5824
5827
  }
5825
- var Zs = `
5828
+ var Os = `
5826
5829
  *, *::before, *::after {
5827
5830
  box-sizing: border-box;
5828
5831
  margin: 0;
@@ -7728,7 +7731,7 @@ var Zs = `
7728
7731
  }
7729
7732
  }
7730
7733
  `;
7731
- function Os() {
7734
+ function Fs() {
7732
7735
  return /* @__PURE__ */ y("svg", {
7733
7736
  width: "16",
7734
7737
  height: "16",
@@ -7767,7 +7770,7 @@ function Os() {
7767
7770
  ]
7768
7771
  });
7769
7772
  }
7770
- function Fs() {
7773
+ function Ps() {
7771
7774
  return /* @__PURE__ */ y("svg", {
7772
7775
  width: "14",
7773
7776
  height: "14",
@@ -7789,7 +7792,7 @@ function Fs() {
7789
7792
  })]
7790
7793
  });
7791
7794
  }
7792
- function Ps() {
7795
+ function $s() {
7793
7796
  return /* @__PURE__ */ y("svg", {
7794
7797
  width: "16",
7795
7798
  height: "16",
@@ -7802,7 +7805,7 @@ function Ps() {
7802
7805
  children: [/* @__PURE__ */ c("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ c("path", { d: "M3 3v5h5" })]
7803
7806
  });
7804
7807
  }
7805
- function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideClose: i = !1 }) {
7808
+ function Vs({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideClose: i = !1 }) {
7806
7809
  const [s, o] = ne(!1);
7807
7810
  return /* @__PURE__ */ y("div", {
7808
7811
  className: `ak-header${s ? " ak-header--confirming" : ""}`,
@@ -7817,7 +7820,7 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
7817
7820
  }) : /* @__PURE__ */ c("span", {
7818
7821
  className: "ak-header__bot-icon",
7819
7822
  "aria-hidden": "true",
7820
- children: /* @__PURE__ */ c(Os, {})
7823
+ children: /* @__PURE__ */ c(Fs, {})
7821
7824
  }),
7822
7825
  /* @__PURE__ */ y("div", {
7823
7826
  className: "ak-header__title-group",
@@ -7846,14 +7849,14 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
7846
7849
  "aria-label": "New conversation",
7847
7850
  type: "button",
7848
7851
  title: "Start a new conversation (Retains current conversation to memory)",
7849
- children: /* @__PURE__ */ c(Ps, {})
7852
+ children: /* @__PURE__ */ c($s, {})
7850
7853
  }),
7851
7854
  !i && /* @__PURE__ */ c("button", {
7852
7855
  className: "ak-header__close",
7853
7856
  onClick: a,
7854
7857
  "aria-label": "Close chat",
7855
7858
  type: "button",
7856
- children: /* @__PURE__ */ c(Fs, {})
7859
+ children: /* @__PURE__ */ c(Ps, {})
7857
7860
  })
7858
7861
  ]
7859
7862
  })
@@ -7902,7 +7905,7 @@ function $e(e) {
7902
7905
  "tel"
7903
7906
  ].includes(r) ? t : null : t;
7904
7907
  }
7905
- function Vs(e) {
7908
+ function zs(e) {
7906
7909
  return e.replace(/\\text\{([^}]*)\}/g, "$1").replace(/\\implies/g, "→").replace(/\\Rightarrow/g, "⟹").replace(/\\times/g, "×").replace(/\\div/g, "÷").replace(/\\cdot/g, "·").replace(/\\quad/g, " ").replace(/\\qquad/g, " ").replace(/\\leq/g, "≤").replace(/\\geq/g, "≥").replace(/\\neq/g, "≠").replace(/\\approx/g, "≈").replace(/\\infty/g, "∞").replace(/\\\((.+?)\\\)/gs, "$1").replace(/\\\[[\s\S]+?\\\]/g, "").replace(/\\\$/g, "\0DOLLAR\0").replace(/\$\$(?!\d)[\s\S]+?\$\$/g, "").replace(/\$(?![\s\d])([^$\n]+?)(?<!\s)\$/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, `
7907
7910
 
7908
7911
  `);
@@ -7915,8 +7918,8 @@ function ia(e) {
7915
7918
  return () => clearInterval(r);
7916
7919
  }, [e]);
7917
7920
  }
7918
- var zs = 800;
7919
- function Ws({ up: e }) {
7921
+ var Ws = 800;
7922
+ function Ds({ up: e }) {
7920
7923
  return /* @__PURE__ */ c("svg", {
7921
7924
  width: "10",
7922
7925
  height: "10",
@@ -7986,11 +7989,11 @@ function yr({ events: e, live: t, answerStartedAtMs: r }) {
7986
7989
  })
7987
7990
  });
7988
7991
  }
7989
- function Ds({ events: e, answerStartedAtMs: t }) {
7992
+ function Us({ events: e, answerStartedAtMs: t }) {
7990
7993
  const [r, a] = ne(0), n = Math.min(r, e.length - 1), i = n < e.length - 1;
7991
7994
  X(() => {
7992
7995
  if (!i) return;
7993
- const h = setTimeout(() => a((u) => Math.min(u + 1, e.length - 1)), zs);
7996
+ const h = setTimeout(() => a((u) => Math.min(u + 1, e.length - 1)), Ws);
7994
7997
  return () => clearTimeout(h);
7995
7998
  }, [
7996
7999
  i,
@@ -8025,7 +8028,7 @@ function Ds({ events: e, answerStartedAtMs: t }) {
8025
8028
  })
8026
8029
  });
8027
8030
  }
8028
- function Us({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1, turnMeta: n, answerStartedAtMs: i }) {
8031
+ function Bs({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1, turnMeta: n, answerStartedAtMs: i }) {
8029
8032
  const [s, o] = ne(!r);
8030
8033
  X(() => {
8031
8034
  a && o(!r);
@@ -8049,7 +8052,7 @@ function Us({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
8049
8052
  events: t,
8050
8053
  live: !0,
8051
8054
  answerStartedAtMs: i
8052
- }) : /* @__PURE__ */ c(Ds, {
8055
+ }) : /* @__PURE__ */ c(Us, {
8053
8056
  events: t,
8054
8057
  answerStartedAtMs: i
8055
8058
  });
@@ -8082,7 +8085,7 @@ function Us({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
8082
8085
  t.length === 1 ? "" : "s"
8083
8086
  ]
8084
8087
  }),
8085
- /* @__PURE__ */ c(Ws, { up: s })
8088
+ /* @__PURE__ */ c(Ds, { up: s })
8086
8089
  ]
8087
8090
  }), s && /* @__PURE__ */ c(yr, {
8088
8091
  events: t,
@@ -8104,7 +8107,7 @@ function Us({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
8104
8107
  })
8105
8108
  }) : null;
8106
8109
  }
8107
- function Bs() {
8110
+ function Gs() {
8108
8111
  return /* @__PURE__ */ c("svg", {
8109
8112
  className: "ak-agent-status__icon",
8110
8113
  width: "13",
@@ -8115,12 +8118,12 @@ function Bs() {
8115
8118
  children: /* @__PURE__ */ c("path", { d: "M12 2C12 2 12.7 8.1 14.5 9.5C16.3 10.9 22 12 22 12C22 12 16.3 13.1 14.5 14.5C12.7 15.9 12 22 12 22C12 22 11.3 15.9 9.5 14.5C7.7 13.1 2 12 2 12C2 12 7.7 10.9 9.5 9.5C11.3 8.1 12 2 12 2Z" })
8116
8119
  });
8117
8120
  }
8118
- function Gs({ status: e }) {
8121
+ function Hs({ status: e }) {
8119
8122
  return /* @__PURE__ */ y("div", {
8120
8123
  className: "ak-agent-status",
8121
8124
  role: "status",
8122
8125
  "aria-live": "polite",
8123
- children: [/* @__PURE__ */ c(Bs, {}), /* @__PURE__ */ c("span", {
8126
+ children: [/* @__PURE__ */ c(Gs, {}), /* @__PURE__ */ c("span", {
8124
8127
  className: "ak-agent-status__text",
8125
8128
  children: e
8126
8129
  })]
@@ -8425,7 +8428,7 @@ function xr({ url: e, mimeType: t, fileName: r }) {
8425
8428
  })]
8426
8429
  });
8427
8430
  }
8428
- function Hs(e) {
8431
+ function Ys(e) {
8429
8432
  try {
8430
8433
  return new Date(e).toLocaleTimeString([], {
8431
8434
  hour: "2-digit",
@@ -8471,8 +8474,8 @@ function Y(e) {
8471
8474
  }
8472
8475
  return r < e.length && t.push(e.slice(r)), t;
8473
8476
  }
8474
- function Ys(e) {
8475
- e = Vs(e);
8477
+ function Xs(e) {
8478
+ e = zs(e);
8476
8479
  const t = e.split(`
8477
8480
  `), r = [];
8478
8481
  let a = 0, n = 0;
@@ -8652,7 +8655,7 @@ function Ys(e) {
8652
8655
  }
8653
8656
  return /* @__PURE__ */ c(ye, { children: r });
8654
8657
  }
8655
- function Xs({ message: e }) {
8658
+ function Js({ message: e }) {
8656
8659
  const [t, r] = ne(null), [a, n] = ne(null), i = e.role === "user", s = e.status === "error", o = e.status === "streaming", l = !!(e.images && e.images.length > 0), d = !!(e.documents && e.documents.length > 0), h = (() => {
8657
8660
  if (!i) return [];
8658
8661
  const N = (e.uploadedAttachments ?? []).filter((P) => P.kind === "image").map((P) => ({
@@ -8712,7 +8715,7 @@ function Xs({ message: e }) {
8712
8715
  }),
8713
8716
  e.content && /* @__PURE__ */ y("div", {
8714
8717
  className: k ? "ak-message__image-caption" : void 0,
8715
- children: [g ? Ys(e.content) : e.content, o && /* @__PURE__ */ y("span", {
8718
+ children: [g ? Xs(e.content) : e.content, o && /* @__PURE__ */ y("span", {
8716
8719
  className: "ak-cursor",
8717
8720
  "aria-hidden": "true",
8718
8721
  children: [
@@ -8724,14 +8727,14 @@ function Xs({ message: e }) {
8724
8727
  }),
8725
8728
  /* @__PURE__ */ c("span", {
8726
8729
  className: "ak-message__time",
8727
- children: Hs(e.createdAt)
8730
+ children: Ys(e.createdAt)
8728
8731
  })
8729
8732
  ]
8730
8733
  }), T = !!e.content || k || f || d || !o && !e.toolStatus;
8731
8734
  return /* @__PURE__ */ y("div", {
8732
8735
  className: `ak-message ${R}`,
8733
8736
  children: [
8734
- !i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Us, {
8737
+ !i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Bs, {
8735
8738
  ackText: e.ackText,
8736
8739
  events: e.progressEvents,
8737
8740
  collapsed: e.progressCollapsed,
@@ -8749,7 +8752,7 @@ function Xs({ message: e }) {
8749
8752
  /* @__PURE__ */ c("span", { className: "ak-typing-row__dot" })
8750
8753
  ]
8751
8754
  }),
8752
- !i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Gs, { status: e.toolStatus }),
8755
+ !i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Hs, { status: e.toolStatus }),
8753
8756
  w && /* @__PURE__ */ y("span", {
8754
8757
  className: "ak-message__sender-label",
8755
8758
  children: [/* @__PURE__ */ c("span", {
@@ -8788,7 +8791,7 @@ function Xs({ message: e }) {
8788
8791
  ]
8789
8792
  });
8790
8793
  }
8791
- function Js() {
8794
+ function Qs() {
8792
8795
  return /* @__PURE__ */ y("div", {
8793
8796
  className: "ak-typing",
8794
8797
  "aria-label": "Assistant is typing",
@@ -8799,7 +8802,7 @@ function Js() {
8799
8802
  ]
8800
8803
  });
8801
8804
  }
8802
- function Qs(e, t) {
8805
+ function Ks(e, t) {
8803
8806
  const r = [];
8804
8807
  let a = null;
8805
8808
  for (const n of e) {
@@ -8818,8 +8821,8 @@ function Qs(e, t) {
8818
8821
  }
8819
8822
  return r;
8820
8823
  }
8821
- function Ks({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }) {
8822
- const a = he(null), n = he(null), i = he(!0), s = Mr(() => Qs(e, r), [e, r]);
8824
+ function qs({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }) {
8825
+ const a = he(null), n = he(null), i = he(!0), s = Mr(() => Ks(e, r), [e, r]);
8823
8826
  return X(() => {
8824
8827
  if (!(a.current?.parentElement ?? a.current)) return;
8825
8828
  const o = (h) => {
@@ -8848,13 +8851,13 @@ function Ks({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }
8848
8851
  className: "ak-handoff-divider__label",
8849
8852
  children: o.label
8850
8853
  })
8851
- }, o.id) : /* @__PURE__ */ c(Xs, { message: o.message }, o.message.id)),
8852
- t && !e.some((o) => o.status === "streaming") && /* @__PURE__ */ c(Js, {}),
8854
+ }, o.id) : /* @__PURE__ */ c(Js, { message: o.message }, o.message.id)),
8855
+ t && !e.some((o) => o.status === "streaming") && /* @__PURE__ */ c(Qs, {}),
8853
8856
  /* @__PURE__ */ c("div", { ref: n })
8854
8857
  ]
8855
8858
  });
8856
8859
  }
8857
- function qs() {
8860
+ function eo() {
8858
8861
  return /* @__PURE__ */ y("svg", {
8859
8862
  width: "30",
8860
8863
  height: "30",
@@ -8894,7 +8897,7 @@ function qs() {
8894
8897
  ]
8895
8898
  });
8896
8899
  }
8897
- function eo({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onSelect: n }) {
8900
+ function to({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onSelect: n }) {
8898
8901
  const i = (r ?? []).filter((s) => (s.title ?? "").trim().length > 0);
8899
8902
  return /* @__PURE__ */ y("div", {
8900
8903
  className: "ak-empty-state",
@@ -8917,7 +8920,7 @@ function eo({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onS
8917
8920
  }) : /* @__PURE__ */ c("span", {
8918
8921
  className: "ak-empty-state__bot-icon",
8919
8922
  "aria-hidden": "true",
8920
- children: /* @__PURE__ */ c(qs, {})
8923
+ children: /* @__PURE__ */ c(eo, {})
8921
8924
  })
8922
8925
  }),
8923
8926
  /* @__PURE__ */ c("p", {
@@ -8948,8 +8951,8 @@ function eo({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onS
8948
8951
  ]
8949
8952
  });
8950
8953
  }
8951
- var to = "https://klicforge.ai/privacy-policy", ro = "https://klicforge.ai/terms-of-service";
8952
- function ao() {
8954
+ var ro = "https://klicforge.ai/privacy-policy", ao = "https://klicforge.ai/terms-of-service";
8955
+ function no() {
8953
8956
  return /* @__PURE__ */ y("svg", {
8954
8957
  width: "16",
8955
8958
  height: "16",
@@ -8967,7 +8970,7 @@ function ao() {
8967
8970
  }), /* @__PURE__ */ c("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })]
8968
8971
  });
8969
8972
  }
8970
- function no() {
8973
+ function io() {
8971
8974
  return /* @__PURE__ */ y("svg", {
8972
8975
  width: "14",
8973
8976
  height: "14",
@@ -8989,7 +8992,7 @@ function no() {
8989
8992
  })]
8990
8993
  });
8991
8994
  }
8992
- function io() {
8995
+ function so() {
8993
8996
  return /* @__PURE__ */ y("svg", {
8994
8997
  width: "14",
8995
8998
  height: "14",
@@ -9052,21 +9055,21 @@ var sa = [
9052
9055
  ".md",
9053
9056
  ".txt",
9054
9057
  ".csv"
9055
- ], so = [...oa, ...sa].join(","), la = [
9058
+ ], oo = [...oa, ...sa].join(","), la = [
9056
9059
  "image/jpeg",
9057
9060
  "image/png",
9058
9061
  "image/gif",
9059
9062
  "image/webp"
9060
- ], oo = la.join(",");
9061
- function lo(e) {
9063
+ ], lo = la.join(",");
9064
+ function co(e) {
9062
9065
  if (sa.includes(e.type)) return !0;
9063
9066
  const t = e.name.toLowerCase();
9064
9067
  return oa.some((r) => t.endsWith(r));
9065
9068
  }
9066
- function co(e) {
9069
+ function uo(e) {
9067
9070
  return la.includes(e.type);
9068
9071
  }
9069
- function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", photoSendingEnabled: a = !1, fileUploadEnabled: n = !1, attachmentMaxCount: i = 5, attachmentMaxFileSizeMb: s = 1 }) {
9072
+ function ho({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", photoSendingEnabled: a = !1, fileUploadEnabled: n = !1, attachmentMaxCount: i = 5, attachmentMaxFileSizeMb: s = 1 }) {
9070
9073
  const [o, l] = ne(""), [d, h] = ne([]), [u, p] = ne(/* @__PURE__ */ new Map()), [f, k] = ne(!1), v = he(null), S = he(null), g = he(null), w = he(null), R = he(null), F = a || n, $ = Mr(() => s * 1024 * 1024, [s]);
9071
9074
  X(() => () => {
9072
9075
  u.forEach((M) => URL.revokeObjectURL(M));
@@ -9115,11 +9118,11 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9115
9118
  if (M.length === 0) return;
9116
9119
  const K = [], V = [];
9117
9120
  for (const G of M) {
9118
- if (O === "image" && !co(G)) {
9121
+ if (O === "image" && !uo(G)) {
9119
9122
  V.push(`${G.name} (image type not supported)`);
9120
9123
  continue;
9121
9124
  }
9122
- if (O === "file" && !lo(G)) {
9125
+ if (O === "file" && !co(G)) {
9123
9126
  V.push(`${G.name} (file type not supported)`);
9124
9127
  continue;
9125
9128
  }
@@ -9171,7 +9174,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9171
9174
  type: "button",
9172
9175
  role: "menuitem",
9173
9176
  disabled: t,
9174
- children: [/* @__PURE__ */ c(io, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
9177
+ children: [/* @__PURE__ */ c(so, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
9175
9178
  }), n && /* @__PURE__ */ y("button", {
9176
9179
  className: "ak-composer__attach-menu-item",
9177
9180
  onClick: da,
@@ -9235,7 +9238,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9235
9238
  ref: S,
9236
9239
  type: "file",
9237
9240
  multiple: !0,
9238
- accept: oo,
9241
+ accept: lo,
9239
9242
  className: "ak-composer__file-input",
9240
9243
  onChange: Ue,
9241
9244
  disabled: t,
@@ -9245,7 +9248,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9245
9248
  ref: g,
9246
9249
  type: "file",
9247
9250
  multiple: !0,
9248
- accept: so,
9251
+ accept: oo,
9249
9252
  className: "ak-composer__file-input",
9250
9253
  onChange: pt,
9251
9254
  disabled: t,
@@ -9262,7 +9265,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9262
9265
  "aria-haspopup": "true",
9263
9266
  "aria-expanded": f,
9264
9267
  type: "button",
9265
- children: /* @__PURE__ */ c(no, {})
9268
+ children: /* @__PURE__ */ c(io, {})
9266
9269
  })
9267
9270
  })
9268
9271
  ] }),
@@ -9283,7 +9286,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9283
9286
  disabled: !ua,
9284
9287
  "aria-label": "Send message",
9285
9288
  type: "button",
9286
- children: /* @__PURE__ */ c(ao, {})
9289
+ children: /* @__PURE__ */ c(no, {})
9287
9290
  })
9288
9291
  ]
9289
9292
  }),
@@ -9293,7 +9296,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9293
9296
  "By chatting you agree to our",
9294
9297
  " ",
9295
9298
  /* @__PURE__ */ c("a", {
9296
- href: to,
9299
+ href: ro,
9297
9300
  target: "_blank",
9298
9301
  rel: "noopener noreferrer",
9299
9302
  children: "Privacy Policy"
@@ -9302,7 +9305,7 @@ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9302
9305
  "and",
9303
9306
  " ",
9304
9307
  /* @__PURE__ */ c("a", {
9305
- href: ro,
9308
+ href: ao,
9306
9309
  target: "_blank",
9307
9310
  rel: "noopener noreferrer",
9308
9311
  children: "Terms of Service"
@@ -9346,7 +9349,7 @@ function Ir({ message: e }) {
9346
9349
  })]
9347
9350
  });
9348
9351
  }
9349
- function ho() {
9352
+ function fo() {
9350
9353
  return /* @__PURE__ */ y("svg", {
9351
9354
  width: "28",
9352
9355
  height: "28",
@@ -9364,7 +9367,7 @@ function ho() {
9364
9367
  }), /* @__PURE__ */ c("path", { d: "M12 7v5l3 2" })]
9365
9368
  });
9366
9369
  }
9367
- function fo() {
9370
+ function po() {
9368
9371
  return /* @__PURE__ */ y("div", {
9369
9372
  className: "ak-maintenance",
9370
9373
  role: "status",
@@ -9376,7 +9379,7 @@ function fo() {
9376
9379
  }),
9377
9380
  /* @__PURE__ */ c("div", {
9378
9381
  className: "ak-maintenance__icon",
9379
- children: /* @__PURE__ */ c(ho, {})
9382
+ children: /* @__PURE__ */ c(fo, {})
9380
9383
  }),
9381
9384
  /* @__PURE__ */ c("p", {
9382
9385
  className: "ak-maintenance__title",
@@ -9389,7 +9392,7 @@ function fo() {
9389
9392
  ]
9390
9393
  });
9391
9394
  }
9392
- function po() {
9395
+ function mo() {
9393
9396
  return /* @__PURE__ */ y("svg", {
9394
9397
  width: "11",
9395
9398
  height: "11",
@@ -9408,11 +9411,11 @@ function po() {
9408
9411
  })]
9409
9412
  });
9410
9413
  }
9411
- function mo() {
9414
+ function go() {
9412
9415
  return /* @__PURE__ */ y("div", {
9413
9416
  className: "ak-branding",
9414
9417
  children: [
9415
- /* @__PURE__ */ c(po, {}),
9418
+ /* @__PURE__ */ c(mo, {}),
9416
9419
  /* @__PURE__ */ c("span", {
9417
9420
  className: "ak-branding__label",
9418
9421
  children: "Powered by"
@@ -9432,7 +9435,7 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
9432
9435
  role: "dialog",
9433
9436
  "aria-label": e.title,
9434
9437
  children: [
9435
- /* @__PURE__ */ c($s, {
9438
+ /* @__PURE__ */ c(Vs, {
9436
9439
  title: e.title,
9437
9440
  subtitle: e.subtitle,
9438
9441
  avatarUrl: e.avatarUrl,
@@ -9453,21 +9456,21 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
9453
9456
  }),
9454
9457
  i === "disabled" && /* @__PURE__ */ c("div", {
9455
9458
  className: "ak-init-status ak-init-status--maintenance",
9456
- children: /* @__PURE__ */ c(fo, {})
9459
+ children: /* @__PURE__ */ c(po, {})
9457
9460
  }),
9458
9461
  i === "ready" && /* @__PURE__ */ y(ye, { children: [
9459
- t.length === 0 ? /* @__PURE__ */ c(eo, {
9462
+ t.length === 0 ? /* @__PURE__ */ c(to, {
9460
9463
  title: e.title,
9461
9464
  description: e.description ?? e.subtitle,
9462
9465
  suggestedQuestions: e.suggestedQuestions,
9463
9466
  avatarUrl: e.avatarUrl,
9464
9467
  onSelect: (l) => o.onSendMessage(l, [])
9465
- }) : /* @__PURE__ */ c(Ks, {
9468
+ }) : /* @__PURE__ */ c(qs, {
9466
9469
  messages: t,
9467
9470
  isLoading: r
9468
9471
  }),
9469
9472
  a && /* @__PURE__ */ c(Ir, { message: a }),
9470
- /* @__PURE__ */ c(uo, {
9473
+ /* @__PURE__ */ c(ho, {
9471
9474
  onSend: o.onSendMessage,
9472
9475
  disabled: r,
9473
9476
  placeholder: "Type a message…",
@@ -9478,10 +9481,10 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
9478
9481
  })
9479
9482
  ] })
9480
9483
  ]
9481
- }), !n && /* @__PURE__ */ c(mo, {})]
9484
+ }), !n && /* @__PURE__ */ c(go, {})]
9482
9485
  });
9483
9486
  }
9484
- function go() {
9487
+ function vo() {
9485
9488
  return /* @__PURE__ */ c("svg", {
9486
9489
  width: "24",
9487
9490
  height: "24",
@@ -9494,7 +9497,7 @@ function go() {
9494
9497
  children: /* @__PURE__ */ c("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
9495
9498
  });
9496
9499
  }
9497
- function vo() {
9500
+ function ko() {
9498
9501
  return /* @__PURE__ */ c("svg", {
9499
9502
  width: "22",
9500
9503
  height: "22",
@@ -9507,7 +9510,7 @@ function vo() {
9507
9510
  children: /* @__PURE__ */ c("polyline", { points: "6,9 12,15 18,9" })
9508
9511
  });
9509
9512
  }
9510
- function ko({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat" }) {
9513
+ function yo({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat" }) {
9511
9514
  const n = !e && !!r;
9512
9515
  return /* @__PURE__ */ c("button", {
9513
9516
  className: `ak-launcher${n ? " ak-launcher--avatar" : ""}`,
@@ -9515,12 +9518,12 @@ function ko({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat"
9515
9518
  "aria-label": a,
9516
9519
  "aria-expanded": e,
9517
9520
  type: "button",
9518
- children: e ? /* @__PURE__ */ c(vo, {}) : n ? /* @__PURE__ */ c("img", {
9521
+ children: e ? /* @__PURE__ */ c(ko, {}) : n ? /* @__PURE__ */ c("img", {
9519
9522
  src: r,
9520
9523
  alt: "",
9521
9524
  className: "ak-launcher__avatar-img",
9522
9525
  "aria-hidden": "true"
9523
- }) : /* @__PURE__ */ c(go, {})
9526
+ }) : /* @__PURE__ */ c(vo, {})
9524
9527
  });
9525
9528
  }
9526
9529
  function Er({ config: e, state: t, callbacks: r }) {
@@ -9528,7 +9531,7 @@ function Er({ config: e, state: t, callbacks: r }) {
9528
9531
  return X(() => {
9529
9532
  const i = n.current?.getRootNode()?.host;
9530
9533
  if (!i) return;
9531
- const s = js(e.theme.mode);
9534
+ const s = Zs(e.theme.mode);
9532
9535
  i.setAttribute("data-theme", s);
9533
9536
  }, [e.theme.mode]), X(() => {
9534
9537
  if (a) return;
@@ -9559,7 +9562,7 @@ function Er({ config: e, state: t, callbacks: r }) {
9559
9562
  initStatus: t.initStatus,
9560
9563
  initError: t.initError,
9561
9564
  callbacks: r
9562
- }), /* @__PURE__ */ c(ko, {
9565
+ }), /* @__PURE__ */ c(yo, {
9563
9566
  isOpen: t.isOpen,
9564
9567
  onClick: t.isOpen ? r.onClose : r.onOpen,
9565
9568
  avatarUrl: e.avatarUrl
@@ -9587,61 +9590,61 @@ var Jt = (e, t, r, a) => {
9587
9590
  }
9588
9591
  };
9589
9592
  };
9590
- function yo(e) {
9591
- return Zs + `
9592
- ` + Rs(e);
9593
+ function bo(e) {
9594
+ return Os + `
9595
+ ` + js(e);
9593
9596
  }
9594
9597
  function Qt(e, t) {
9595
- return yo(Ve({
9598
+ return bo(Ve({
9596
9599
  ...e,
9597
9600
  mode: t
9598
9601
  }));
9599
9602
  }
9600
- function qo(e, t = Jt, r) {
9601
- return Ms(e, t, r ?? Qt(e, "floating"));
9602
- }
9603
- function el(e, t, r = Jt, a) {
9604
- return Ts(e, t, r, a ?? Qt(t, "inline"));
9603
+ function el(e, t = Jt, r) {
9604
+ return Ls(e, t, r ?? Qt(e, "floating"));
9605
9605
  }
9606
9606
  function tl(e, t, r = Jt, a) {
9607
- return Ls(e, t, r, a ?? Qt(t, "floating"));
9607
+ return As(e, t, r, a ?? Qt(t, "inline"));
9608
+ }
9609
+ function rl(e, t, r = Jt, a) {
9610
+ return Ts(e, t, r, a ?? Qt(t, "floating"));
9608
9611
  }
9609
- function rl(e) {
9610
- As(e);
9612
+ function al(e) {
9613
+ Rs(e);
9611
9614
  }
9612
9615
  export {
9613
9616
  is as ApiClient,
9614
- uo as Composer,
9617
+ ho as Composer,
9615
9618
  Ir as ErrorState,
9616
9619
  fs as EventEmitter,
9617
- $s as Header,
9618
- ko as Launcher,
9619
- Xs as MessageBubble,
9620
- Ks as MessageList,
9621
- Js as TypingIndicator,
9620
+ Vs as Header,
9621
+ yo as Launcher,
9622
+ Js as MessageBubble,
9623
+ qs as MessageList,
9624
+ Qs as TypingIndicator,
9622
9625
  Er as WidgetApp,
9623
9626
  vs as WidgetClient,
9624
9627
  Nr as WidgetShell,
9625
- Rs as buildThemeVars,
9626
- yo as buildWidgetCSS,
9628
+ js as buildThemeVars,
9629
+ bo as buildWidgetCSS,
9627
9630
  vr as clearSession,
9628
- ws as createFloatingContainer,
9631
+ Ss as createFloatingContainer,
9629
9632
  bs as createShadowHost,
9630
9633
  Yt as createWidget,
9631
- rl as destroy,
9632
- As as destroyWidget,
9634
+ al as destroy,
9635
+ Rs as destroyWidget,
9633
9636
  ms as getSessionId,
9634
- qo as init,
9637
+ el as init,
9635
9638
  _s as injectStyles,
9636
- Ko as listWidgets,
9637
- el as mount,
9638
- tl as mountFloating,
9639
+ qo as listWidgets,
9640
+ tl as mount,
9641
+ rl as mountFloating,
9639
9642
  Ve as normalizeConfig,
9640
- Cs as prepareInlineContainer,
9643
+ Is as prepareInlineContainer,
9641
9644
  xs as removeShadowHost,
9642
9645
  Jt as renderWidget,
9643
- js as resolveThemeMode,
9646
+ Zs as resolveThemeMode,
9644
9647
  Ye as setSessionId,
9645
9648
  ls as streamChat,
9646
- Zs as widgetCSS
9649
+ Os as widgetCSS
9647
9650
  };