@aintela/chat 0.4.14 → 0.4.15

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.
@@ -926,16 +926,23 @@ function Q(o, t, e) {
926
926
  return { next: `${s}${a}${n}`, selectionStart: l, selectionEnd: l, reopenTrigger: !1 };
927
927
  }
928
928
  d(Q, "applyTriggerInsertion");
929
- async function tt(o, { onAtQuery: t, onAtPersonQuery: e }, { personConfidence: s = 0, locationConfidence: n = 0, personFirstThreshold: i = 0.5, vertical: r = "air", hotelConfidence: a = 0 } = {}) {
930
- const [l, c] = await Promise.all([
931
- t ? t(o, { vertical: r, hotelConfidence: a }).catch(() => []) : Promise.resolve([]),
929
+ async function tt(o, { onAtQuery: t, onAtPersonQuery: e }, {
930
+ personConfidence: s = 0,
931
+ locationConfidence: n = 0,
932
+ personFirstThreshold: i = 0.5,
933
+ vertical: r = "air",
934
+ hotelConfidence: a = 0,
935
+ hotelNameConfidence: l = 0
936
+ } = {}) {
937
+ const [c, u] = await Promise.all([
938
+ t ? t(o, { vertical: r, hotelConfidence: a, hotelNameConfidence: l }).catch(() => []) : Promise.resolve([]),
932
939
  e ? e(o).catch(() => []) : Promise.resolve([])
933
- ]);
940
+ ]), p = u.map((h) => h.kind ? h : { ...h, kind: "person" });
934
941
  if (t && e) {
935
- const u = c.map((f) => ({ ...f, group: "person" })), p = l.map((f) => ({ ...f, group: "location" }));
936
- return s >= i && s >= n ? [...u, ...p] : [...p, ...u];
942
+ const h = p.map((m) => ({ ...m, group: "person" })), f = c.map((m) => ({ ...m, group: m.kind === "hotel" ? "hotel" : "location" }));
943
+ return s >= i && s >= n ? [...h, ...f] : [...f, ...h];
937
944
  }
938
- return [...c, ...l];
945
+ return [...p, ...c];
939
946
  }
940
947
  d(tt, "fetchAtMentions");
941
948
  function et(o, t) {
@@ -966,4 +973,4 @@ export {
966
973
  B as s,
967
974
  X as t
968
975
  };
969
- //# sourceMappingURL=atMentions-DbE21rGt.js.map
976
+ //# sourceMappingURL=atMentions-uRBrCgLL.js.map