@epam/statgpt-conversation-view 0.7.0-dev.7 → 0.7.0-dev.9

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.mjs CHANGED
@@ -2,7 +2,7 @@ import e, { Fragment as t, createContext as n, startTransition as r, useCallback
2
2
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
3
3
  import { DialSchemaProperties as m, LikeState as h, Role as g, SharePermission as _ } from "@epam/ai-dial-shared";
4
4
  import { Alert as v, AlertType as y, Button as b, Calendar as x, Checkbox as S, CloseButton as C, CollapsibleBlock as w, CopyButton as T, DownloadFormatMessage as E, DraggableList as D, Dropdown as O, IconButton as k, InlineAlert as A, InlineAlertType as j, InputWithIcon as M, KeyboardKey as N, Link as P, Loader as F, MOBILE_BREAKPOINT as I, PopUpSize as L, PopUpState as R, Popup as z, Radio as B, RequestLimitMessage as ee, SERIES_LIMIT as V, TREE_NODE_ARROW_SIZE as te, TREE_NODE_PADDING as H, Tag as ne, filterDraggableListNodes as U, useAgentAvailability as W, useDebounce as G, useIsMobile as K } from "@epam/statgpt-ui-components";
5
- import { IconCheck as re, IconCircleFilled as ie, IconCopy as ae, IconDatabase as q, IconExternalLink as oe, IconInfoCircle as se, IconPlayerStopFilled as ce, IconPlus as le, IconPointFilled as ue, IconRefresh as de, IconRotate as fe, IconSearch as pe, IconSettings as me, IconX as he } from "@tabler/icons-react";
5
+ import { IconCheck as re, IconCircleFilled as ie, IconCopy as ae, IconDatabase as oe, IconExternalLink as se, IconInfoCircle as ce, IconPlayerStopFilled as q, IconPlus as le, IconPointFilled as ue, IconRefresh as de, IconRotate as fe, IconSearch as pe, IconSettings as me, IconX as he } from "@tabler/icons-react";
6
6
  import J from "classnames";
7
7
  import { AttachmentType as Y, CUSTOM_VIEW_STATE_KEY as ge, DIAL_ERROR_CODES as _e, DIAL_ERROR_TYPES as ve, ERROR_CONTEXT_KIND as ye, InvitationType as be, ShareTarget as xe, formatDateTime as Se, generateConversationId as Ce, getRateLimitRestoreDate as we, getSharedConversationsRequest as Te, isRateLimitStillActive as Ee, mergeMessages as De, streamChatResponse as Oe } from "@epam/statgpt-dial-toolkit";
8
8
  import { CUSTOM_PERIOD as ke, CalendarResolution as Ae, HTTP_ERROR_CODES as je, HttpError as Me, Locale as Ne, QueryFilterType as Pe, SHARE_CONVERSATION_ROUTE as Fe, cleanConversationNames as Ie, defaultFormatNumbers as Le, formatNumberBySign as Re, getConversationAttachmentUrls as ze, getConversationNavPath as Be, getTimePeriod as Ve, isHttpError as He, linkifyText as Ue, replaceConversationAttachmentUrls as We } from "@epam/statgpt-shared-toolkit";
@@ -117,7 +117,7 @@ var In = n(void 0), Ln = ({ children: e }) => {
117
117
  }) : e ? /* @__PURE__ */ f(k, {
118
118
  buttonClassName: "input-for-ask-button",
119
119
  onClick: () => d?.(),
120
- icon: /* @__PURE__ */ f(ce, {})
120
+ icon: /* @__PURE__ */ f(q, {})
121
121
  }) : m ? /* @__PURE__ */ f(k, {
122
122
  buttonClassName: "input-for-ask-button",
123
123
  onClick: () => _(m),
@@ -1137,7 +1137,7 @@ var wr = (e, t) => ({
1137
1137
  t,
1138
1138
  O,
1139
1139
  k
1140
- ]), q = i(async (e) => {
1140
+ ]), oe = i(async (e) => {
1141
1141
  let t = await w?.(Te(xe.OTHERS));
1142
1142
  if (t) return Er({ id: e }, t.resources);
1143
1143
  }, [w]);
@@ -1147,7 +1147,7 @@ var wr = (e, t) => ({
1147
1147
  let e = new AbortController();
1148
1148
  return G.current = e, (async () => {
1149
1149
  try {
1150
- let t = wr(K, Dr(await a?.(K))), n = await s?.(t), r = await q(K);
1150
+ let t = wr(K, Dr(await a?.(K))), n = await s?.(t), r = await oe(K);
1151
1151
  if (e.signal.aborted || !n) return;
1152
1152
  I(Tr(n)), B(r), V(!0);
1153
1153
  } catch (t) {
@@ -1161,16 +1161,16 @@ var wr = (e, t) => ({
1161
1161
  K,
1162
1162
  s,
1163
1163
  a,
1164
- q
1164
+ oe
1165
1165
  ]);
1166
- let oe = i(() => {
1166
+ let se = i(() => {
1167
1167
  G.current?.abort(), W.current = null, n(), I(null), V(!1), H(!1);
1168
- }, [n]), ce = i(() => {
1168
+ }, [n]), q = i(() => {
1169
1169
  H(!0), navigator.clipboard.writeText(ie || "");
1170
1170
  }, [ie]), le = async () => {
1171
1171
  try {
1172
1172
  if (U(!0), R && await T?.({ resources: [R] }), K) {
1173
- let e = await q(K);
1173
+ let e = await oe(K);
1174
1174
  G.current?.signal.aborted || B(e);
1175
1175
  }
1176
1176
  } catch (e) {
@@ -1186,10 +1186,10 @@ var wr = (e, t) => ({
1186
1186
  }),
1187
1187
  title: te ? y ?? "Copied" : v ?? "Copy link",
1188
1188
  disabled: te,
1189
- onClick: ce
1189
+ onClick: q
1190
1190
  }), [
1191
1191
  te,
1192
- ce,
1192
+ q,
1193
1193
  y,
1194
1194
  v
1195
1195
  ]);
@@ -1198,14 +1198,14 @@ var wr = (e, t) => ({
1198
1198
  portalId: "share",
1199
1199
  size: L.SM,
1200
1200
  dividers: r,
1201
- onClose: oe,
1201
+ onClose: se,
1202
1202
  closeButtonTitle: h ?? "Close",
1203
1203
  children: [ee ? /* @__PURE__ */ p("div", {
1204
1204
  className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0",
1205
1205
  children: [
1206
1206
  N ? /* @__PURE__ */ f(A, {
1207
1207
  type: j.Note,
1208
- icon: /* @__PURE__ */ f(se, {
1208
+ icon: /* @__PURE__ */ f(ce, {
1209
1209
  width: 16,
1210
1210
  height: 16
1211
1211
  }),
@@ -3732,13 +3732,13 @@ var us = {
3732
3732
  getSourceArtefactUrn: C,
3733
3733
  getAvailableHierarchies: e?.getAvailableHierarchies,
3734
3734
  getHierarchy: e?.getHierarchy
3735
- }), { modalFilters: B, setModalFilters: ee, appliedFilters: V, setAppliedFilters: te, selectedFilter: H, setSelectedFilter: ne, selectedFilterValues: U, selectedTimeOption: W, disabledDatasetUrns: G, appliedDisabledUrns: K, onSelectDisplayMode: re, onClearAllDatasets: ie, onToggleDataset: ae, onTimePeriodChange: q } = gs({
3735
+ }), { modalFilters: B, setModalFilters: ee, appliedFilters: V, setAppliedFilters: te, selectedFilter: H, setSelectedFilter: ne, selectedFilterValues: U, selectedTimeOption: W, disabledDatasetUrns: G, appliedDisabledUrns: K, onSelectDisplayMode: re, onClearAllDatasets: ie, onToggleDataset: ae, onTimePeriodChange: oe } = gs({
3736
3736
  mode: g,
3737
3737
  modalState: A,
3738
3738
  dataQueries: g === "multi" ? r : void 0,
3739
3739
  hierarchyStateMap: P,
3740
3740
  loadAvailableHierarchies: I
3741
- }), { isConstraintsLoading: oe, isDisableFilterValues: se, isFilterValuesLoading: ce, setIsConstraintsLoading: le, handleFiltersWithConstraints: ue, handleFiltersDelete: de, updateSelectedFilterValues: fe } = ms({
3741
+ }), { isConstraintsLoading: se, isDisableFilterValues: ce, isFilterValuesLoading: q, setIsConstraintsLoading: le, handleFiltersWithConstraints: ue, handleFiltersDelete: de, updateSelectedFilterValues: fe } = ms({
3742
3742
  strategy: _,
3743
3743
  modalFilters: B,
3744
3744
  setModalFilters: ee,
@@ -3789,11 +3789,11 @@ var us = {
3789
3789
  g,
3790
3790
  B,
3791
3791
  ie
3792
- ]), _e = oe || se || he;
3792
+ ]), _e = se || ce || he;
3793
3793
  return {
3794
3794
  buttonProps: t,
3795
3795
  selectedFiltersCount: Si(U),
3796
- isLoading: oe,
3796
+ isLoading: se,
3797
3797
  setModalState: j,
3798
3798
  isModalClosed: M,
3799
3799
  filterIconClassName: m,
@@ -3809,8 +3809,8 @@ var us = {
3809
3809
  state: {
3810
3810
  filtersList: B,
3811
3811
  selectedFilter: H,
3812
- isDisableValues: se,
3813
- isValuesLoading: ce,
3812
+ isDisableValues: ce,
3813
+ isValuesLoading: q,
3814
3814
  selectedTimeOption: W,
3815
3815
  disabledDatasetUrns: G,
3816
3816
  timeSeriesCount: k === void 0 ? void 0 : `${k}`
@@ -3827,7 +3827,7 @@ var us = {
3827
3827
  onDeleteFilter: Y,
3828
3828
  onClearAllFilters: ge,
3829
3829
  updateSelectedFilterValues: fe,
3830
- onTimePeriodChange: q,
3830
+ onTimePeriodChange: oe,
3831
3831
  onToggleDataset: ae,
3832
3832
  onClearAllDatasets: ie
3833
3833
  },
@@ -5363,7 +5363,7 @@ var vl = ({ isExpanded: e, onToggle: t, title: n }) => /* @__PURE__ */ f(k, {
5363
5363
  /* @__PURE__ */ p("div", {
5364
5364
  className: "flex items-center gap-2",
5365
5365
  children: [
5366
- /* @__PURE__ */ f(q, { className: "size-4 text-neutrals-700" }),
5366
+ /* @__PURE__ */ f(oe, { className: "size-4 text-neutrals-700" }),
5367
5367
  /* @__PURE__ */ f("p", {
5368
5368
  className: "h4 break-words text-neutrals-1000",
5369
5369
  children: i(e?.value)
@@ -5372,7 +5372,7 @@ var vl = ({ isExpanded: e, onToggle: t, title: n }) => /* @__PURE__ */ f(k, {
5372
5372
  href: r,
5373
5373
  target: "_blank",
5374
5374
  rel: "noopener noreferrer",
5375
- children: /* @__PURE__ */ f(oe, { className: "size-4 shrink-0 cursor-pointer text-primary" })
5375
+ children: /* @__PURE__ */ f(se, { className: "size-4 shrink-0 cursor-pointer text-primary" })
5376
5376
  })
5377
5377
  ]
5378
5378
  }),
@@ -6056,7 +6056,16 @@ var yu = { cellDataType: !1 }, bu = ({ attachment: e, isDataLoading: t, isChartC
6056
6056
  R,
6057
6057
  z
6058
6058
  ]);
6059
- return g || t ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ p("div", {
6059
+ return g || t ? /* @__PURE__ */ f("div", {
6060
+ className: "size-full",
6061
+ children: /* @__PURE__ */ f("div", {
6062
+ className: "flex size-full flex-col",
6063
+ children: /* @__PURE__ */ f("div", {
6064
+ className: J("flex items-center justify-center", a ? "h-full min-h-0" : r ? "h-full max-h-[400px] min-h-[400px]" : "h-full min-h-[300px]"),
6065
+ children: /* @__PURE__ */ f(F, {})
6066
+ })
6067
+ })
6068
+ }) : /* @__PURE__ */ p("div", {
6060
6069
  className: "size-full",
6061
6070
  children: [/* @__PURE__ */ f(vu, {
6062
6071
  ref: T,
@@ -6401,7 +6410,16 @@ var Vu = ({ attachment: e, icons: t, isDataLoading: n, openAdvancedView: r, fixH
6401
6410
  }, [x.length]), R = i(() => {
6402
6411
  w((e) => Math.max(e - 1, 0));
6403
6412
  }, []), z = g ? "flex-col overflow-auto" : "flex-row overflow-hidden", B = s ? "flex-1 min-h-0" : g ? "h-full min-h-[500px]" : a ? "h-full max-h-[400px] min-h-[400px]" : "h-full min-h-[300px]";
6404
- return _ || n ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ f("div", {
6413
+ return _ || n ? /* @__PURE__ */ f("div", {
6414
+ className: "chart-attachment size-full",
6415
+ children: /* @__PURE__ */ f("div", {
6416
+ className: "flex size-full flex-col gap-4",
6417
+ children: /* @__PURE__ */ f("div", {
6418
+ className: J("flex items-center justify-center", B),
6419
+ children: /* @__PURE__ */ f(F, {})
6420
+ })
6421
+ })
6422
+ }) : /* @__PURE__ */ f("div", {
6405
6423
  className: "chart-attachment size-full",
6406
6424
  ref: M,
6407
6425
  children: y && /* @__PURE__ */ f("div", {
@@ -7010,7 +7028,16 @@ var Nd = { cellDataType: !1 }, Pd = ({ attachment: e, isDataLoading: t, isChartC
7010
7028
  D,
7011
7029
  T
7012
7030
  ]);
7013
- return m || t ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ f("div", {
7031
+ return m || t ? /* @__PURE__ */ f("div", {
7032
+ className: "size-full",
7033
+ children: /* @__PURE__ */ f("div", {
7034
+ className: "flex size-full flex-col",
7035
+ children: /* @__PURE__ */ f("div", {
7036
+ className: J("flex items-center justify-center", r ? "h-full max-h-[400px] min-h-[400px]" : "h-full min-h-[300px]"),
7037
+ children: /* @__PURE__ */ f(F, {})
7038
+ })
7039
+ })
7040
+ }) : /* @__PURE__ */ f("div", {
7014
7041
  className: "size-full",
7015
7042
  children: /* @__PURE__ */ f(vu, {
7016
7043
  fixHeight: r,
@@ -7247,44 +7274,77 @@ var Nd = { cellDataType: !1 }, Pd = ({ attachment: e, isDataLoading: t, isChartC
7247
7274
  onClose: v
7248
7275
  }
7249
7276
  };
7250
- }, Bd = ({ attachments: e, actions: t, isSystemAttachments: n, isShowAttachments: r, showAdvancedView: a, currentDataQuery: s, dataQueries: l, attachmentInfoList: m, datasets: h, initialSelectedDatasetUrn: g, isDataLoading: _, isDataSetAttachments: v, locale: y, dimensions: b, filters: x, selectDataset: S, onAdvancedViewOpen: C, hideDownloadButton: w, containerClassName: T, isTableSettingsOpen: E, onTableSettingsOpen: D, onTableSettingsClose: O, onGridApiReady: k }) => {
7251
- let { titles: A, messageStyles: j, attachmentsStyles: M, limitMessages: N, attachmentsConfig: P } = Z(), { isCrossDatasetModeOn: I } = Bi(), [L, z] = u(0), { isOpenedAdvancedView: B, setIsOpenedAdvancedView: V } = kn(), [te, H] = u(R.Closed), [ne, U] = u(!1), [W, G] = u(!1), K = ot.DATA_IN_TABLE, re = c(() => {
7252
- if (!I || !l?.some((e) => e.disabled)) return h;
7253
- let e = new Set(l.filter((e) => !e.disabled).map((e) => e.urn));
7254
- return h?.filter((t) => {
7277
+ }, Bd = ".scroll-hidden-container", Vd = 1e3;
7278
+ function Hd(e, t) {
7279
+ let n = l(null), r = l(null), a = l(""), s = l(null), c = i(() => {
7280
+ n.current != null && (cancelAnimationFrame(n.current), n.current = null), r.current && (r.current.style.overflowAnchor = a.current), s.current?.(), s.current = null, r.current = null;
7281
+ }, []), u = i(() => {
7282
+ if (!t || typeof window > "u") return;
7283
+ let i = e.current?.closest(Bd);
7284
+ if (!i) return;
7285
+ c();
7286
+ let o = i.scrollTop;
7287
+ r.current = i, a.current = i.style.overflowAnchor, i.style.overflowAnchor = "none";
7288
+ let l = () => c();
7289
+ i.addEventListener("wheel", l, { passive: !0 }), i.addEventListener("touchmove", l, { passive: !0 }), s.current = () => {
7290
+ i.removeEventListener("wheel", l), i.removeEventListener("touchmove", l);
7291
+ };
7292
+ let u = performance.now(), d = () => {
7293
+ let e = r.current;
7294
+ if (!e) {
7295
+ c();
7296
+ return;
7297
+ }
7298
+ e.scrollTop !== o && (e.scrollTop = o), performance.now() - u >= Vd ? c() : n.current = requestAnimationFrame(d);
7299
+ };
7300
+ n.current = requestAnimationFrame(d);
7301
+ }, [
7302
+ t,
7303
+ e,
7304
+ c
7305
+ ]);
7306
+ return o(() => c, [c]), { captureAnchor: u };
7307
+ }
7308
+ //#endregion
7309
+ //#region libs/conversation-view/src/components/Attachments/AttachmentRenderer.tsx
7310
+ var Ud = ({ attachments: e, actions: t, isSystemAttachments: n, isShowAttachments: r, showAdvancedView: a, currentDataQuery: s, dataQueries: m, attachmentInfoList: h, datasets: g, initialSelectedDatasetUrn: _, isDataLoading: v, isDataSetAttachments: y, locale: b, dimensions: x, filters: S, selectDataset: C, onAdvancedViewOpen: w, hideDownloadButton: T, containerClassName: E, isTableSettingsOpen: D, onTableSettingsOpen: O, onTableSettingsClose: k, onGridApiReady: A }) => {
7311
+ let { titles: j, messageStyles: M, attachmentsStyles: N, limitMessages: P, attachmentsConfig: I } = Z(), { isCrossDatasetModeOn: L } = Bi(), [z, B] = u(0), { isOpenedAdvancedView: V, setIsOpenedAdvancedView: te } = kn(), [H, ne] = u(R.Closed), [U, W] = u(!1), [G, K] = u(!1), re = ot.DATA_IN_TABLE, ie = l(null), { captureAnchor: ae } = Hd(ie, !V), oe = c(() => {
7312
+ if (!L || !m?.some((e) => e.disabled)) return g;
7313
+ let e = new Set(m.filter((e) => !e.disabled).map((e) => e.urn));
7314
+ return g?.filter((t) => {
7255
7315
  let n = yt(t?.id, t?.version, t?.agencyID);
7256
7316
  return e.has(n);
7257
7317
  });
7258
7318
  }, [
7259
- h,
7260
- l,
7261
- I
7262
- ]), ie = (e) => {
7263
- z(e);
7264
- }, ae = i(() => {
7265
- C?.(), V(!0), t.updateCurrentDataQuery(s || l?.[0]), t.updateDataQueries(l), t.updateDatasets(h);
7319
+ g,
7320
+ m,
7321
+ L
7322
+ ]), se = (e) => {
7323
+ ae(), B(e);
7324
+ }, ce = i(() => {
7325
+ w?.(), te(!0), t.updateCurrentDataQuery(s || m?.[0]), t.updateDataQueries(m), t.updateDatasets(g);
7266
7326
  }, [
7267
7327
  t,
7268
7328
  s,
7269
- l,
7270
- h,
7271
- V,
7272
- C
7273
- ]), q = e[L] || null;
7329
+ m,
7330
+ g,
7331
+ te,
7332
+ w
7333
+ ]), q = e[z] || null;
7274
7334
  o(() => {
7275
- U(v && (h == null || h?.length == 0));
7276
- }, [h, v]), o(() => {
7277
- E && q && !Us(q) && !qs(q) && O?.();
7335
+ W(y && (g == null || g?.length == 0));
7336
+ }, [g, y]), o(() => {
7337
+ D && q && !Us(q) && !qs(q) && k?.();
7278
7338
  }, [
7279
- E,
7339
+ D,
7280
7340
  q,
7281
- O
7341
+ k
7282
7342
  ]);
7283
- let oe = i(() => {
7284
- H(R.Closed);
7285
- }, [H]), se = P?.isExternaLinkIncludeFilters, ce = Dc(se, x, s || l?.[0], b), le = c(() => {
7286
- if (l?.length) return new Map(l.map((e) => [e.urn, Dc(se, void 0, e)]));
7287
- }, [l, se]), ue = c(() => {
7343
+ let le = i(() => {
7344
+ ne(R.Closed);
7345
+ }, [ne]), ue = I?.isExternaLinkIncludeFilters, de = Dc(ue, S, s || m?.[0], x), fe = c(() => {
7346
+ if (m?.length) return new Map(m.map((e) => [e.urn, Dc(ue, void 0, e)]));
7347
+ }, [m, ue]), pe = c(() => {
7288
7348
  if (!q || !qs(q)) return;
7289
7349
  let e = q.gridContent?.data ?? [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
7290
7350
  for (let r of e) {
@@ -7295,116 +7355,117 @@ var Nd = { cellDataType: !1 }, Pd = ({ attachment: e, isDataLoading: t, isChartC
7295
7355
  urn: e,
7296
7356
  name: n.get(e) ?? e,
7297
7357
  rowCount: t,
7298
- dataQuery: l?.find((t) => t.urn === e)
7358
+ dataQuery: m?.find((t) => t.urn === e)
7299
7359
  }));
7300
- }, [q, l]), de = c(() => {
7360
+ }, [q, m]), me = c(() => {
7301
7361
  if (q) {
7302
7362
  if (Us(q)) return q.grid_data?.data?.length;
7303
7363
  if (qs(q)) return q.gridContent?.data?.length;
7304
7364
  }
7305
- }, [q]), { startDownload: fe, isDownloadRunning: pe, downloadAlertProps: me } = zd({
7306
- attachmentsStyles: M,
7365
+ }, [q]), { startDownload: he, isDownloadRunning: Y, downloadAlertProps: ge } = zd({
7366
+ attachmentsStyles: N,
7307
7367
  downloadDataSet: t.downloadDataSet
7308
7368
  });
7309
7369
  if (!e || e.length === 0) return null;
7310
- let he = !B && ne || !!_;
7311
- return /* @__PURE__ */ f(d, { children: B && !r ? /* @__PURE__ */ f(sc, {
7312
- icon: j?.advanceViewIcon,
7313
- title: j?.openAdvanceViewTitle ?? "Opened in Advanced view"
7370
+ let _e = !V && U || !!v;
7371
+ return /* @__PURE__ */ f(d, { children: V && !r ? /* @__PURE__ */ f(sc, {
7372
+ icon: M?.advanceViewIcon,
7373
+ title: M?.openAdvanceViewTitle ?? "Opened in Advanced view"
7314
7374
  }) : /* @__PURE__ */ p("div", {
7315
- className: Zl("space-y-3 max-w-full max-h-full h-full", !B && !n ? "pt-5" : "pt-0", "flex flex-col pb-1", T),
7316
- children: [!B && re?.length != null && re?.length > 0 && /* @__PURE__ */ f(xc, {
7317
- datasets: re,
7318
- initialSelectedDatasetUrn: g,
7319
- locale: y,
7320
- selectDataset: S
7321
- }), he ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ p(d, { children: [
7322
- n && !B && /* @__PURE__ */ f(oc, {
7375
+ className: Zl("space-y-3 max-w-full max-h-full h-full", !V && !n ? "pt-5" : "pt-0", "flex flex-col pb-1", E),
7376
+ children: [!V && oe?.length != null && oe?.length > 0 && /* @__PURE__ */ f(xc, {
7377
+ datasets: oe,
7378
+ initialSelectedDatasetUrn: _,
7379
+ locale: b,
7380
+ selectDataset: C
7381
+ }), _e ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ p(d, { children: [
7382
+ n && !V && /* @__PURE__ */ f(oc, {
7323
7383
  titles: {
7324
- queryUpdatedManuallyTitle: A?.queryUpdatedManually,
7325
- setToTitle: A?.setTo,
7326
- datasetLabel: A?.dataset
7384
+ queryUpdatedManuallyTitle: j?.queryUpdatedManually,
7385
+ setToTitle: j?.setTo,
7386
+ datasetLabel: j?.dataset
7327
7387
  },
7328
- datasetIcon: M?.datasetIcon,
7329
- attachmentInfoList: m,
7330
- dataQueries: l
7388
+ datasetIcon: N?.datasetIcon,
7389
+ attachmentInfoList: h,
7390
+ dataQueries: m
7331
7391
  }),
7332
- W && /* @__PURE__ */ f(ee, {
7333
- limitMessages: N,
7392
+ G && /* @__PURE__ */ f(ee, {
7393
+ limitMessages: P,
7334
7394
  showAdvancedViewButton: !!q && Js(q) && a,
7335
- onAdvancedViewClick: ae,
7336
- query: ce
7395
+ onAdvancedViewClick: ce,
7396
+ query: de
7337
7397
  }),
7338
7398
  /* @__PURE__ */ f("div", {
7339
- className: J(!B && h?.length && "attachments-bordered", "attachments-wrapper h-full min-h-0"),
7399
+ className: J(!V && g?.length && "attachments-bordered", "attachments-wrapper h-full min-h-0"),
7340
7400
  children: /* @__PURE__ */ p("div", {
7401
+ ref: ie,
7341
7402
  className: "flex h-full max-w-full flex-col items-center gap-4",
7342
7403
  children: [/* @__PURE__ */ f(Pc, {
7343
7404
  attachments: e,
7344
- selectedAttachmentIndex: L,
7405
+ selectedAttachmentIndex: z,
7345
7406
  selectedAttachment: q,
7346
- attachmentsStyles: M,
7347
- externalLink: ce,
7348
- isExternalLinkIncludeFilters: se,
7349
- limitMessages: N,
7350
- onSelectedAttachmentChange: ie,
7351
- onDownloadClick: () => H(R.Opened),
7352
- hideDownloadButton: w,
7407
+ attachmentsStyles: N,
7408
+ externalLink: de,
7409
+ isExternalLinkIncludeFilters: ue,
7410
+ limitMessages: P,
7411
+ onSelectedAttachmentChange: se,
7412
+ onDownloadClick: () => ne(R.Opened),
7413
+ hideDownloadButton: T,
7353
7414
  showAdvancedView: a,
7354
- onOpenAdvancedView: ae,
7355
- isTableSettingsOpen: E,
7356
- onTableSettingsOpen: D
7415
+ onOpenAdvancedView: ce,
7416
+ isTableSettingsOpen: D,
7417
+ onTableSettingsOpen: O
7357
7418
  }), q != null && /* @__PURE__ */ f(Fd, {
7358
7419
  selectedAttachment: q,
7359
7420
  actions: t,
7360
- attachmentsStyles: M,
7361
- isDataLoading: _,
7362
- isOpenedAdvancedView: B,
7363
- onOpenAdvancedView: ae,
7364
- showLimitMessage: G,
7365
- onGridApiReady: k,
7366
- externalLink: ce,
7367
- externalLinksMap: le
7421
+ attachmentsStyles: N,
7422
+ isDataLoading: v,
7423
+ isOpenedAdvancedView: V,
7424
+ onOpenAdvancedView: ce,
7425
+ showLimitMessage: K,
7426
+ onGridApiReady: A,
7427
+ externalLink: de,
7428
+ externalLinksMap: fe
7368
7429
  })]
7369
7430
  })
7370
7431
  }),
7371
- /* @__PURE__ */ p(d, { children: [te === R.Opened && /* @__PURE__ */ f(gc, {
7372
- onCloseModal: oe,
7373
- onDownloadStart: fe,
7374
- isDownloadInProgress: pe,
7432
+ /* @__PURE__ */ p(d, { children: [H === R.Opened && /* @__PURE__ */ f(gc, {
7433
+ onCloseModal: le,
7434
+ onDownloadStart: he,
7435
+ isDownloadInProgress: Y,
7375
7436
  dataQuery: s,
7376
7437
  datasetName: q?.title || "",
7377
- locale: y,
7378
- type: K,
7379
- dimensions: b,
7380
- filters: x,
7438
+ locale: b,
7439
+ type: re,
7440
+ dimensions: x,
7441
+ filters: S,
7381
7442
  urn: s?.urn,
7382
- titles: M?.downloadTitles,
7383
- rowCount: de,
7384
- collapsible: M?.downloadCollapsible,
7385
- downloadDatasets: ue,
7386
- limitMessages: N,
7387
- showLimitMessage: W,
7388
- externalLink: ce
7389
- }), /* @__PURE__ */ f(Id, { ...me })] })
7443
+ titles: N?.downloadTitles,
7444
+ rowCount: me,
7445
+ collapsible: N?.downloadCollapsible,
7446
+ downloadDatasets: pe,
7447
+ limitMessages: P,
7448
+ showLimitMessage: G,
7449
+ externalLink: de
7450
+ }), /* @__PURE__ */ f(Id, { ...ge })] })
7390
7451
  ] })]
7391
7452
  }) });
7392
- }, Vd = ({ label: e, colDef: t }) => !!e.trim() && !t.suppressColumnsToolPanel;
7393
- function Hd(e) {
7453
+ }, Wd = ({ label: e, colDef: t }) => !!e.trim() && !t.suppressColumnsToolPanel;
7454
+ function Gd(e) {
7394
7455
  return e.colId ?? e.field ?? null;
7395
7456
  }
7396
- function Ud(e) {
7457
+ function Kd(e) {
7397
7458
  return String(e.headerName ?? e.field ?? e.colId ?? "").trim();
7398
7459
  }
7399
- function Wd(e) {
7460
+ function qd(e) {
7400
7461
  return new Map(e.getColumnState().map((e) => [e.colId, e]));
7401
7462
  }
7402
- function Gd(e, t) {
7403
- let n = e.getColumnDefs() ?? [], r = Wd(e), i = [];
7463
+ function Jd(e, t) {
7464
+ let n = e.getColumnDefs() ?? [], r = qd(e), i = [];
7404
7465
  for (let e of n) {
7405
- let n = Hd(e);
7466
+ let n = Gd(e);
7406
7467
  if (!n) continue;
7407
- let a = Ud(e);
7468
+ let a = Kd(e);
7408
7469
  if (!t({
7409
7470
  colId: n,
7410
7471
  label: a,
@@ -7423,13 +7484,13 @@ function Gd(e, t) {
7423
7484
  let a = e.getColumnState().map((e) => e.colId), o = new Map(a.map((e, t) => [e, t]));
7424
7485
  return i.sort((e, t) => (o.get(e.id) ?? 2 ** 53 - 1) - (o.get(t.id) ?? 2 ** 53 - 1));
7425
7486
  }
7426
- function Kd(e, t, n) {
7487
+ function Yd(e, t, n) {
7427
7488
  let r = [...t];
7428
7489
  return e.map((e) => n.has(e) ? r.shift() ?? e : e);
7429
7490
  }
7430
7491
  //#endregion
7431
7492
  //#region libs/conversation-view/src/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/draggableListUtils.ts
7432
- function qd(e, t) {
7493
+ function Xd(e, t) {
7433
7494
  let n = e, r;
7434
7495
  for (let e of t) {
7435
7496
  if (r = n.find((t) => t.id === e), !r) return;
@@ -7437,7 +7498,7 @@ function qd(e, t) {
7437
7498
  }
7438
7499
  return r?.type === "item" ? r : void 0;
7439
7500
  }
7440
- function Jd(e) {
7501
+ function Zd(e) {
7441
7502
  if (!e.items?.length) return e;
7442
7503
  if (e.items.every((e) => e.type === "item")) {
7443
7504
  let t = e.items, n = t.filter((e) => e.isChecked !== !1);
@@ -7477,11 +7538,11 @@ function Jd(e) {
7477
7538
  items: t
7478
7539
  };
7479
7540
  }
7480
- function Yd(e, t) {
7541
+ function Qd(e, t) {
7481
7542
  let n = [];
7482
7543
  for (let r of e) {
7483
7544
  if (r.type === "group") {
7484
- n.push(...Yd(r.items, t));
7545
+ n.push(...Qd(r.items, t));
7485
7546
  continue;
7486
7547
  }
7487
7548
  if (t?.(r)) {
@@ -7489,7 +7550,7 @@ function Yd(e, t) {
7489
7550
  continue;
7490
7551
  }
7491
7552
  if (r.items?.length) {
7492
- n.push(...Yd(r.items, t));
7553
+ n.push(...Qd(r.items, t));
7493
7554
  continue;
7494
7555
  }
7495
7556
  n.push(r.id);
@@ -7498,12 +7559,12 @@ function Yd(e, t) {
7498
7559
  }
7499
7560
  //#endregion
7500
7561
  //#region libs/conversation-view/src/components/AdvancedView/TableSettings/AgGridColumnPanel/hooks/useAgGridColumnsPanel.ts
7501
- function Xd({ api: e, searchQuery: t, includeColumn: n = Vd, enrichItem: r, onSubItemOrderChange: a, onSubItemVisibilityChange: o }) {
7562
+ function $d({ api: e, searchQuery: t, includeColumn: n = Wd, enrichItem: r, onSubItemOrderChange: a, onSubItemVisibilityChange: o }) {
7502
7563
  let [s, l] = u(0), [d, f] = u(/* @__PURE__ */ new Set()), p = i(() => {
7503
7564
  l((e) => e + 1);
7504
7565
  }, []);
7505
7566
  Zu(e, p);
7506
- let m = c(() => !e || !e.getColumnState() ? [] : Gd(e, n), [
7567
+ let m = c(() => !e || !e.getColumnState() ? [] : Jd(e, n), [
7507
7568
  e,
7508
7569
  n,
7509
7570
  s
@@ -7521,7 +7582,7 @@ function Xd({ api: e, searchQuery: t, includeColumn: n = Vd, enrichItem: r, onSu
7521
7582
  o(e, r, n, !t.nextChecked);
7522
7583
  return;
7523
7584
  }
7524
- let n = qd(h, t.path);
7585
+ let n = Xd(h, t.path);
7525
7586
  !n || !g.has(n.id) || (e.applyColumnState({ state: [{
7526
7587
  colId: n.id,
7527
7588
  hide: !t.nextChecked
@@ -7535,11 +7596,11 @@ function Xd({ api: e, searchQuery: t, includeColumn: n = Vd, enrichItem: r, onSu
7535
7596
  ]), y = i((t) => {
7536
7597
  if (!e) return;
7537
7598
  if (bd(t.itemId) && o) {
7538
- let { urn: e, dimensionKey: n } = xd(t.itemId), r = t.path[0], i = qd(h, t.path);
7599
+ let { urn: e, dimensionKey: n } = xd(t.itemId), r = t.path[0], i = Xd(h, t.path);
7539
7600
  i?.type === "item" && o(e, r, n, i.isChecked ?? !0);
7540
7601
  return;
7541
7602
  }
7542
- let n = qd(h, t.path);
7603
+ let n = Xd(h, t.path);
7543
7604
  if (!n || !g.has(n.id)) return;
7544
7605
  let r = !(e.getColumnState().find((e) => e.colId === n.id)?.hide ?? !1);
7545
7606
  e.applyColumnState({ state: [{
@@ -7567,7 +7628,7 @@ function Xd({ api: e, searchQuery: t, includeColumn: n = Vd, enrichItem: r, onSu
7567
7628
  handleItemClick: y,
7568
7629
  handleItemsChange: i((t) => {
7569
7630
  if (!e) return;
7570
- let n = e.getColumnState().map((e) => e.colId), r = new Set(m.map((e) => e.id)), i = Kd(n, Yd(t, (e) => g.has(e.id)), r);
7631
+ let n = e.getColumnState().map((e) => e.colId), r = new Set(m.map((e) => e.id)), i = Yd(n, Qd(t, (e) => g.has(e.id)), r);
7571
7632
  if (e.applyColumnState({
7572
7633
  state: i.map((e) => ({ colId: e })),
7573
7634
  applyOrder: !0
@@ -7597,18 +7658,18 @@ function Xd({ api: e, searchQuery: t, includeColumn: n = Vd, enrichItem: r, onSu
7597
7658
  }
7598
7659
  //#endregion
7599
7660
  //#region libs/conversation-view/src/components/AdvancedView/TableSettings/AgGridColumnPanel/AgGridColumnsPanel.tsx
7600
- function Zd({ api: e, includeColumn: t, enrichItem: n, renderLabel: r, onSubItemOrderChange: a, onSubItemVisibilityChange: o, searchPlaceholder: s }) {
7661
+ function ef({ api: e, includeColumn: t, enrichItem: n, renderLabel: r, onSubItemOrderChange: a, onSubItemVisibilityChange: o, searchPlaceholder: s }) {
7601
7662
  let [l, d] = u(""), m = i((e) => {
7602
7663
  d(e);
7603
7664
  }, [d]), h = i(() => d(""), [d]), g = c(() => /* @__PURE__ */ f("button", {
7604
7665
  type: "button",
7605
7666
  onClick: h,
7606
7667
  children: /* @__PURE__ */ f(he, { className: "size-4 text-neutrals-1000" })
7607
- }), [h]), { visibleItems: _, handleItemsChange: v, handleToggleChecked: y, handleToggleExpanded: b, handleItemClick: x } = Xd({
7668
+ }), [h]), { visibleItems: _, handleItemsChange: v, handleToggleChecked: y, handleToggleExpanded: b, handleItemClick: x } = $d({
7608
7669
  api: e,
7609
7670
  includeColumn: t,
7610
7671
  searchQuery: l,
7611
- enrichItem: i((e) => Jd(n ? n(e) : e), [n]),
7672
+ enrichItem: i((e) => Zd(n ? n(e) : e), [n]),
7612
7673
  onSubItemOrderChange: a,
7613
7674
  onSubItemVisibilityChange: o
7614
7675
  });
@@ -7638,7 +7699,7 @@ function Zd({ api: e, includeColumn: t, enrichItem: n, renderLabel: r, onSubItem
7638
7699
  }
7639
7700
  //#endregion
7640
7701
  //#region libs/conversation-view/src/components/AdvancedView/TableSettings/hooks/useDatasetScopedColumnRenderLabel.tsx
7641
- function Qd() {
7702
+ function tf() {
7642
7703
  let { dataQueries: e, structuresMap: t, locale: n, gridViewMode: r } = nd(), i = lu(), a = c(() => {
7643
7704
  let a = /* @__PURE__ */ new Map();
7644
7705
  if (!i || !e?.length) return a;
@@ -7685,13 +7746,13 @@ var Q = /* @__PURE__ */ function(e) {
7685
7746
  return e.Header = "header", e.Cell = "cell", e;
7686
7747
  }({}), $ = /* @__PURE__ */ function(e) {
7687
7748
  return e.Focus = "focus", e.Default = "default", e;
7688
- }({}), $d = "grid gap-1", ef = {
7749
+ }({}), nf = "grid gap-1", rf = {
7689
7750
  gridTemplateColumns: "44px 23px 23px",
7690
7751
  gridTemplateRows: "repeat(4, 14px)"
7691
- }, tf = {
7752
+ }, af = {
7692
7753
  gridTemplateColumns: "repeat(4, 21.5px)",
7693
7754
  gridTemplateRows: "repeat(4, 14px)"
7694
- }, nf = {
7755
+ }, of = {
7695
7756
  [Q.Header]: {
7696
7757
  [$.Focus]: "content-center rounded-sm border border-accent-300 bg-accent-300 text-center text-[8px] font-semibold",
7697
7758
  [$.Default]: "rounded-sm bg-semantic-warning border border-accent-300"
@@ -7700,14 +7761,14 @@ var Q = /* @__PURE__ */ function(e) {
7700
7761
  [$.Focus]: "content-center rounded-sm border border-accent-300 bg-hues-100 pl-1 text-left text-[8px] font-semibold",
7701
7762
  [$.Default]: "rounded-sm bg-neutrals-100 border border-accent-300"
7702
7763
  }
7703
- }, rf = ({ rows: e, style: n }) => /* @__PURE__ */ f("div", {
7704
- className: $d,
7764
+ }, sf = ({ rows: e, style: n }) => /* @__PURE__ */ f("div", {
7765
+ className: nf,
7705
7766
  style: n,
7706
7767
  children: e.map((e, n) => /* @__PURE__ */ f(t, { children: e.map((e, t) => /* @__PURE__ */ f("span", {
7707
- className: Zl([nf[e.role][e.emphasis], !e.label && "text-transparent"]),
7768
+ className: Zl([of[e.role][e.emphasis], !e.label && "text-transparent"]),
7708
7769
  children: e.label || " "
7709
7770
  }, `${n}-${t}`)) }, n))
7710
- }), af = [
7771
+ }), cf = [
7711
7772
  [
7712
7773
  {
7713
7774
  role: Q.Header,
@@ -7768,10 +7829,10 @@ var Q = /* @__PURE__ */ function(e) {
7768
7829
  emphasis: $.Default
7769
7830
  }
7770
7831
  ]
7771
- ], of = () => /* @__PURE__ */ f(rf, {
7772
- rows: af,
7773
- style: ef
7774
- }), sf = [
7832
+ ], lf = () => /* @__PURE__ */ f(sf, {
7833
+ rows: cf,
7834
+ style: rf
7835
+ }), uf = [
7775
7836
  [
7776
7837
  {
7777
7838
  role: Q.Header,
@@ -7853,10 +7914,10 @@ var Q = /* @__PURE__ */ function(e) {
7853
7914
  emphasis: $.Default
7854
7915
  }
7855
7916
  ]
7856
- ], cf = () => /* @__PURE__ */ f(rf, {
7857
- rows: sf,
7858
- style: tf
7859
- }), lf = ({ title: e, description: t, visual: n, mode: r, activeMode: i, onClick: a }) => /* @__PURE__ */ p("button", {
7917
+ ], df = () => /* @__PURE__ */ f(sf, {
7918
+ rows: uf,
7919
+ style: af
7920
+ }), ff = ({ title: e, description: t, visual: n, mode: r, activeMode: i, onClick: a }) => /* @__PURE__ */ p("button", {
7860
7921
  type: "button",
7861
7922
  className: Zl(["flex items-center gap-3 rounded border p-1", r === i && "border-primary"]),
7862
7923
  onClick: () => a(r),
@@ -7873,25 +7934,25 @@ var Q = /* @__PURE__ */ function(e) {
7873
7934
  children: t
7874
7935
  })]
7875
7936
  })]
7876
- }), uf = ({ gridViewMode: e, onModeChange: t, compactViewTitle: n, compactViewDescription: r, extendedViewTitle: i, extendedViewDescription: a }) => /* @__PURE__ */ p("div", {
7937
+ }), pf = ({ gridViewMode: e, onModeChange: t, compactViewTitle: n, compactViewDescription: r, extendedViewTitle: i, extendedViewDescription: a }) => /* @__PURE__ */ p("div", {
7877
7938
  className: "mx-5 my-3 flex flex-col gap-2",
7878
- children: [/* @__PURE__ */ f(lf, {
7939
+ children: [/* @__PURE__ */ f(ff, {
7879
7940
  title: n || "Compact view",
7880
7941
  description: r ?? /* @__PURE__ */ p(d, { children: ["Related dimensions ", /* @__PURE__ */ f("strong", { children: "combined into a single column." })] }),
7881
- visual: /* @__PURE__ */ f(of, {}),
7942
+ visual: /* @__PURE__ */ f(lf, {}),
7882
7943
  mode: $u.Compact,
7883
7944
  activeMode: e,
7884
7945
  onClick: t
7885
- }), /* @__PURE__ */ f(lf, {
7946
+ }), /* @__PURE__ */ f(ff, {
7886
7947
  title: i || "Extended view",
7887
7948
  description: a ?? /* @__PURE__ */ p(d, { children: ["Each dimension displayed in ", /* @__PURE__ */ f("strong", { children: "separate column." })] }),
7888
- visual: /* @__PURE__ */ f(cf, {}),
7949
+ visual: /* @__PURE__ */ f(df, {}),
7889
7950
  mode: $u.Extended,
7890
7951
  activeMode: e,
7891
7952
  onClick: t
7892
7953
  })]
7893
- }), df = "table-settings-side-panel", ff = () => {
7894
- let { gridApi: e, initialColumnsState: t, structuresMap: n, locale: r, dataQueries: a, dimensionCustomization: o, setDimensionKeyOrder: s, setDimensionKeyHidden: l, resetDimensionCustomization: u, clearUserColumnState: d, clearInitialColumnState: m, gridViewMode: h, setGridViewMode: g, texts: _, resetIcon: v } = nd(), y = lu(), b = Qd(), x = i((e) => {
7954
+ }), mf = "table-settings-side-panel", hf = () => {
7955
+ let { gridApi: e, initialColumnsState: t, structuresMap: n, locale: r, dataQueries: a, dimensionCustomization: o, setDimensionKeyOrder: s, setDimensionKeyHidden: l, resetDimensionCustomization: u, clearUserColumnState: d, clearInitialColumnState: m, gridViewMode: h, setGridViewMode: g, texts: _, resetIcon: v } = nd(), y = lu(), b = tf(), x = i((e) => {
7895
7956
  d(), m(), u(), g(e);
7896
7957
  }, [
7897
7958
  d,
@@ -7925,7 +7986,7 @@ var Q = /* @__PURE__ */ function(e) {
7925
7986
  return e ? /* @__PURE__ */ p("div", {
7926
7987
  className: "flex h-full flex-col",
7927
7988
  children: [
7928
- /* @__PURE__ */ f(uf, {
7989
+ /* @__PURE__ */ f(pf, {
7929
7990
  gridViewMode: h,
7930
7991
  onModeChange: x,
7931
7992
  compactViewTitle: _?.compactViewTitle,
@@ -7946,7 +8007,7 @@ var Q = /* @__PURE__ */ function(e) {
7946
8007
  children: v ?? /* @__PURE__ */ f(fe, { className: "size-4 rotate-180" })
7947
8008
  })]
7948
8009
  }),
7949
- /* @__PURE__ */ f(Zd, {
8010
+ /* @__PURE__ */ f(ef, {
7950
8011
  api: e,
7951
8012
  enrichItem: C,
7952
8013
  renderLabel: b,
@@ -7956,24 +8017,24 @@ var Q = /* @__PURE__ */ function(e) {
7956
8017
  })
7957
8018
  ]
7958
8019
  }) : null;
7959
- }, pf = (e) => {
8020
+ }, gf = (e) => {
7960
8021
  let { attachmentsStyles: t } = Z(), { onGridApiReady: n } = nd(), r = nu(), a = i(() => {
7961
8022
  r && r.openPanel({
7962
- id: df,
8023
+ id: mf,
7963
8024
  scope: "advanced",
7964
8025
  title: t?.tableSettings || "Table settings",
7965
8026
  headerClassName: "border-b border-neutrals-500",
7966
- content: /* @__PURE__ */ f(ff, {})
8027
+ content: /* @__PURE__ */ f(hf, {})
7967
8028
  });
7968
8029
  }, [r, t?.tableSettings]);
7969
- return /* @__PURE__ */ f(Bd, {
8030
+ return /* @__PURE__ */ f(Ud, {
7970
8031
  ...e,
7971
8032
  isTableSettingsOpen: r?.isPanelOpen("table-settings-side-panel") ?? !1,
7972
8033
  onTableSettingsOpen: r ? a : void 0,
7973
8034
  onTableSettingsClose: r?.closePanel,
7974
8035
  onGridApiReady: n
7975
8036
  });
7976
- }, mf = (e, t, n) => c(() => e?.map((e) => {
8037
+ }, _f = (e, t, n) => c(() => e?.map((e) => {
7977
8038
  let r = t?.get(e.urn)?.dataflows?.[0], i = X(r, n ?? ""), a = i ? yt(i, "", r?.agencyID) : void 0;
7978
8039
  return a ? {
7979
8040
  ...e,
@@ -7983,8 +8044,8 @@ var Q = /* @__PURE__ */ function(e) {
7983
8044
  e,
7984
8045
  n,
7985
8046
  t
7986
- ]), hf = ({ actions: e, dataQueries: t, datasetDimensionsMetadataMap: n, structureDataMaps: r, datasetIcon: a, locale: o, onMultipleDataFiltersChange: s }) => {
7987
- let d = l(r?.constraintsMap), [f, p] = u(), m = c(() => mo(t, r), [t, r]), h = mf(t, r?.structuresMap, o), g = i((e) => {
8047
+ ]), vf = ({ actions: e, dataQueries: t, datasetDimensionsMetadataMap: n, structureDataMaps: r, datasetIcon: a, locale: o, onMultipleDataFiltersChange: s }) => {
8048
+ let d = l(r?.constraintsMap), [f, p] = u(), m = c(() => mo(t, r), [t, r]), h = _f(t, r?.structuresMap, o), g = i((e) => {
7988
8049
  let t = e.filterType === "dataset" ? e.datasetUrn : e.sourceDatasetUrns?.[0];
7989
8050
  return t ? d.current?.get(t) : void 0;
7990
8051
  }, []), _ = i((e) => Ds(e, r?.dimensionsMap, r?.structuresMap), [r?.dimensionsMap, r?.structuresMap]), v = i((e) => _(e).codelistUrn, [_]), y = i((e) => _(e).sourceArtefactUrn, [_]), b = i((i, a) => {
@@ -8146,9 +8207,9 @@ var Q = /* @__PURE__ */ function(e) {
8146
8207
  h
8147
8208
  ])
8148
8209
  };
8149
- }, gf = (e) => {
8210
+ }, yf = (e) => {
8150
8211
  let t = lu();
8151
- return vs(e, hf({
8212
+ return vs(e, vf({
8152
8213
  actions: e.actions,
8153
8214
  dataQueries: e.dataQueries,
8154
8215
  datasetDimensionsMetadataMap: t.map,
@@ -8157,7 +8218,7 @@ var Q = /* @__PURE__ */ function(e) {
8157
8218
  locale: e.locale,
8158
8219
  onMultipleDataFiltersChange: e.onMultipleDataFiltersChange
8159
8220
  }));
8160
- }, _f = (e) => /* @__PURE__ */ f(os, { ...gf(e) }), vf = ({ filtersProps: e, actions: t, attachments: n, attachmentsDataQuery: r, dataQueries: i, dimensions: a, locale: s, isDataLoading: c, setIsFiltering: l, filters: u, onFiltersChange: d }) => {
8221
+ }, bf = (e) => /* @__PURE__ */ f(os, { ...yf(e) }), xf = ({ filtersProps: e, actions: t, attachments: n, attachmentsDataQuery: r, dataQueries: i, dimensions: a, locale: s, isDataLoading: c, setIsFiltering: l, filters: u, onFiltersChange: d }) => {
8161
8222
  let { titles: m, limitMessages: h } = Z(), g = {
8162
8223
  getConstraints: t.getConstraints,
8163
8224
  getAvailableHierarchies: e.actions?.getAvailableHierarchies,
@@ -8171,7 +8232,7 @@ var Q = /* @__PURE__ */ function(e) {
8171
8232
  className: "flex h-full flex-col gap-4 overflow-x-hidden",
8172
8233
  children: [/* @__PURE__ */ p("div", {
8173
8234
  className: "data-details-header flex items-center justify-between",
8174
- children: [/* @__PURE__ */ f("h2", { children: m?.content ?? "Content" }), f(_ ? _f : ic, {
8235
+ children: [/* @__PURE__ */ f("h2", { children: m?.content ?? "Content" }), f(_ ? bf : ic, {
8175
8236
  attachmentsDataQuery: r,
8176
8237
  dataQueries: i,
8177
8238
  updateDataQueries: t?.updateDataQueries,
@@ -8184,7 +8245,7 @@ var Q = /* @__PURE__ */ function(e) {
8184
8245
  })]
8185
8246
  }), /* @__PURE__ */ f("div", {
8186
8247
  className: "advanced-view-attachments-container min-h-0 flex-1",
8187
- children: /* @__PURE__ */ f(pf, {
8248
+ children: /* @__PURE__ */ f(gf, {
8188
8249
  attachments: n,
8189
8250
  currentDataQuery: r,
8190
8251
  dataQueries: i,
@@ -8199,7 +8260,7 @@ var Q = /* @__PURE__ */ function(e) {
8199
8260
  })]
8200
8261
  })
8201
8262
  });
8202
- }, yf = ({ isShowAgency: e, isShowDatasetBadge: t, dataset: n, data: r, structures: a, metadataSettings: s, locale: m, getDatasetUpdatedTime: h, externalLink: g, datasetIcon: _, externalLinkIcon: v, metadataButtonClassName: y, metadataIconClassName: b, infoSegmentContainerClassName: x, infoSegmentHeaderClassName: S, nameAndMetadataContainerClassName: C }) => {
8263
+ }, Sf = ({ isShowAgency: e, isShowDatasetBadge: t, dataset: n, data: r, structures: a, metadataSettings: s, locale: m, getDatasetUpdatedTime: h, externalLink: g, datasetIcon: _, externalLinkIcon: v, metadataButtonClassName: y, metadataIconClassName: b, infoSegmentContainerClassName: x, infoSegmentHeaderClassName: S, nameAndMetadataContainerClassName: C }) => {
8203
8264
  let { titles: w } = Z(), [T, E] = u(""), [D, O] = u(!1), A = l(null), [j, M] = u(""), [N, P] = u(""), [F, I] = u(!1), { onboardingFileSchema: L, isShowOnboarding: R } = Rn(), { isOpenedAdvancedView: z } = kn(), B = nu(), { isMetadataInSidePanel: ee } = Bi(), { getDatasetLastUpdated: V } = cu(), [te, H] = u(!1), ne = c(() => s?.isMetadataDescription ? Fl(n, T, m, w) : [], [
8204
8265
  n,
8205
8266
  T,
@@ -8299,7 +8360,7 @@ var Q = /* @__PURE__ */ function(e) {
8299
8360
  href: g,
8300
8361
  target: "_blank",
8301
8362
  rel: "noopener noreferrer",
8302
- children: v || /* @__PURE__ */ f(oe, { className: "size-4 shrink-0 cursor-pointer text-primary" })
8363
+ children: v || /* @__PURE__ */ f(se, { className: "size-4 shrink-0 cursor-pointer text-primary" })
8303
8364
  })]
8304
8365
  }), /* @__PURE__ */ p("div", {
8305
8366
  className: "body-3 flex items-center gap-2",
@@ -8325,7 +8386,7 @@ var Q = /* @__PURE__ */ function(e) {
8325
8386
  })
8326
8387
  ]
8327
8388
  });
8328
- }, bf = ({ locale: e, isShowShare: t, shareConversationProps: n, conversation: r }) => {
8389
+ }, Cf = ({ locale: e, isShowShare: t, shareConversationProps: n, conversation: r }) => {
8329
8390
  let { titles: i } = Z(), { setIsOpenedAdvancedView: a } = kn(), s = l(null), [c, d] = u(""), [m, h] = u(""), [g, _] = u(!1), { onboardingFileSchema: v, isShowOnboarding: y } = Rn();
8330
8391
  return o(() => {
8331
8392
  if (y) {
@@ -8366,8 +8427,8 @@ var Q = /* @__PURE__ */ function(e) {
8366
8427
  };
8367
8428
  //#endregion
8368
8429
  //#region libs/conversation-view/src/utils/attachments/data-grid/columns.ts
8369
- function xf(e, t, n, r, i, a, o, s, c) {
8370
- let l = Sf(e, n), u = Cf(e, t, n, r, i, a, c?.startPeriod && c.endPeriod ? bt(s, c) : []);
8430
+ function wf(e, t, n, r, i, a, o, s, c) {
8431
+ let l = Tf(e, n), u = Ef(e, t, n, r, i, a, c?.startPeriod && c.endPeriod ? bt(s, c) : []);
8371
8432
  return [
8372
8433
  rl(e, t?.data, n, i, a, o),
8373
8434
  ...l,
@@ -8375,7 +8436,7 @@ function xf(e, t, n, r, i, a, o, s, c) {
8375
8436
  il(e, t?.data, n, void 0, a, o)
8376
8437
  ];
8377
8438
  }
8378
- function Sf(e, t) {
8439
+ function Tf(e, t) {
8379
8440
  let n = e.conceptSchemes || [], r = e.codelists || [], i = kt(e)?.dimensions || [];
8380
8441
  return i.map((e) => {
8381
8442
  let { codeList: a, concept: o } = id(e, n, r);
@@ -8392,10 +8453,10 @@ function Sf(e, t) {
8392
8453
  };
8393
8454
  });
8394
8455
  }
8395
- function Cf(e, t, n, r, i, a, o) {
8396
- return Tf(Ef(o, Ht(t)), (e, t) => wf(e, t || e, r, a), e, n, i, a);
8456
+ function Ef(e, t, n, r, i, a, o) {
8457
+ return Of(kf(o, Ht(t)), (e, t) => Df(e, t || e, r, a), e, n, i, a);
8397
8458
  }
8398
- var wf = (e, t, n = Le, r) => ({
8459
+ var Df = (e, t, n = Le, r) => ({
8399
8460
  headerName: ui(t, r),
8400
8461
  colId: e,
8401
8462
  field: e,
@@ -8405,7 +8466,7 @@ var wf = (e, t, n = Le, r) => ({
8405
8466
  width: 200,
8406
8467
  cellClass: ["justify-end", "cell-with-meta"],
8407
8468
  valueFormatter: (e) => Re(e.value, n)
8408
- }), Tf = (e, t, n, r, i, a) => {
8469
+ }), Of = (e, t, n, r, i, a) => {
8409
8470
  let o = [];
8410
8471
  return e.sort((e, t) => en(e, t)).forEach((e) => {
8411
8472
  o.push({
@@ -8424,7 +8485,7 @@ var wf = (e, t, n = Le, r) => ({
8424
8485
  }
8425
8486
  });
8426
8487
  }), o;
8427
- }, Ef = (e = [], t = []) => {
8488
+ }, kf = (e = [], t = []) => {
8428
8489
  if (!e.length) return t;
8429
8490
  if (!t.length) return e;
8430
8491
  let n = t.some((e) => Qt(e)), r = t.some((e) => Xt(e)), i = t.some((e) => Yt(e)), a = t.some((e) => Jt(e)), o = t.some((e) => Zt(e)), s = t.some((e) => qt(e)), c = e.filter((e) => Qt(e) ? n : Xt(e) ? r : Yt(e) ? i : Jt(e) ? a : Zt(e) ? o : qt(e) ? s : !0);
@@ -8432,50 +8493,50 @@ var wf = (e, t, n = Le, r) => ({
8432
8493
  };
8433
8494
  //#endregion
8434
8495
  //#region libs/conversation-view/src/utils/attachments/data-grid/get-converted-data.ts
8435
- function Df(e, t, n) {
8496
+ function Af(e, t, n) {
8436
8497
  let r = t.map((e) => e.id).filter((e) => e != null);
8437
- return Of(e, r, n.map((e) => e.id).filter((e) => e != null), r);
8498
+ return jf(e, r, n.map((e) => e.id).filter((e) => e != null), r);
8438
8499
  }
8439
- var Of = (e, t, n, r) => {
8500
+ var jf = (e, t, n, r) => {
8440
8501
  let i = {};
8441
8502
  for (let a of e) {
8442
- let e = Mf(a, t), o = kf(e, r), s = i[o];
8503
+ let e = Ff(a, t), o = Mf(e, r), s = i[o];
8443
8504
  if (s == null) {
8444
8505
  s = {}, i[o] = s;
8445
8506
  for (let t of r) s[t] = e[t];
8446
8507
  }
8447
- let c = Ff(a.attributes);
8448
- if (If(s, o, c, a), !a.values.length) {
8449
- jf(s, e, n);
8508
+ let c = Rf(a.attributes);
8509
+ if (zf(s, o, c, a), !a.values.length) {
8510
+ Pf(s, e, n);
8450
8511
  continue;
8451
8512
  }
8452
8513
  for (let t of a.values) {
8453
- let r = Ff(t.obsAttributes);
8454
- If(s, o, c, a), jf(s, e, n, t.dimensionAtObservation, Nf(a, t), r);
8514
+ let r = Rf(t.obsAttributes);
8515
+ zf(s, o, c, a), Pf(s, e, n, t.dimensionAtObservation, If(a, t), r);
8455
8516
  }
8456
8517
  }
8457
8518
  return Object.values(i);
8458
- }, kf = (e, t) => t.map((t) => e[t]).join("_"), Af = (e, t, n) => t.map((t) => t === "TIME_PERIOD" ? n : e[t]).join("_"), jf = (e, t, n, r, i, a) => {
8459
- let o = Af(t, n, r);
8519
+ }, Mf = (e, t) => t.map((t) => e[t]).join("_"), Nf = (e, t, n) => t.map((t) => t === "TIME_PERIOD" ? n : e[t]).join("_"), Pf = (e, t, n, r, i, a) => {
8520
+ let o = Nf(t, n, r);
8460
8521
  e[o] = {
8461
8522
  value: i,
8462
8523
  obsAttributes: a
8463
8524
  };
8464
- }, Mf = (e, t) => {
8525
+ }, Ff = (e, t) => {
8465
8526
  let n = {}, r = e.name.split(".");
8466
8527
  for (let e = 0; e < t.length; e += 1) n[t[e]] = r[e];
8467
8528
  return n;
8468
- }, Nf = (e, t) => {
8469
- let n = Pf(e.attributes);
8529
+ }, If = (e, t) => {
8530
+ let n = Lf(e.attributes);
8470
8531
  if (n) return [n];
8471
- let r = Pf(t.obsAttributes);
8532
+ let r = Lf(t.obsAttributes);
8472
8533
  return r ? [r] : t.values;
8473
- }, Pf = (e = []) => e.find(({ name: e }) => e === "OBS_VALUE"), Ff = (e = []) => e.filter(({ value: e }) => e), If = (e, t, n, r) => {
8534
+ }, Lf = (e = []) => e.find(({ name: e }) => e === "OBS_VALUE"), Rf = (e = []) => e.filter(({ value: e }) => e), zf = (e, t, n, r) => {
8474
8535
  e.attributes ??= n, e.id = t, e.originalData = r;
8475
- }, Lf = "#EEEEEE", Rf = "#777777";
8536
+ }, Bf = "#EEEEEE", Vf = "#777777";
8476
8537
  //#endregion
8477
8538
  //#region libs/conversation-view/src/utils/attachments/charting/chart-config-building.ts
8478
- function zf(e, t, n) {
8539
+ function Hf(e, t, n) {
8479
8540
  let r = {
8480
8541
  animation: !1,
8481
8542
  tooltip: {
@@ -8496,20 +8557,20 @@ function zf(e, t, n) {
8496
8557
  containLabel: !0
8497
8558
  },
8498
8559
  xAxis: {
8499
- ...Bf(n?.ticksColor, n?.labelsColor),
8560
+ ...Uf(n?.ticksColor, n?.labelsColor),
8500
8561
  type: "category",
8501
8562
  boundaryGap: !1,
8502
8563
  data: e
8503
8564
  },
8504
8565
  yAxis: {
8505
- ...Bf(n?.ticksColor, n?.labelsColor),
8566
+ ...Uf(n?.ticksColor, n?.labelsColor),
8506
8567
  type: "value"
8507
8568
  },
8508
8569
  series: t
8509
8570
  };
8510
8571
  return n?.colors != null && (r.color = n.colors), r;
8511
8572
  }
8512
- function Bf(e = Lf, t = Rf) {
8573
+ function Uf(e = Bf, t = Vf) {
8513
8574
  return {
8514
8575
  splitLine: {
8515
8576
  show: !0,
@@ -8523,7 +8584,7 @@ function Bf(e = Lf, t = Rf) {
8523
8584
  }
8524
8585
  //#endregion
8525
8586
  //#region libs/conversation-view/src/utils/attachments/charting/serie-title.ts
8526
- function Vf(e, t, n, r) {
8587
+ function Wf(e, t, n, r) {
8527
8588
  return t.map((t) => {
8528
8589
  let i = kt(n)?.dimensions || [], a = i?.find((e) => e.id === t);
8529
8590
  if (a == null) return e[t] || "";
@@ -8533,71 +8594,71 @@ function Vf(e, t, n, r) {
8533
8594
  }
8534
8595
  //#endregion
8535
8596
  //#region libs/conversation-view/src/utils/attachments/charting/sort-dimensions.ts
8536
- function Hf(e, t) {
8597
+ function Gf(e, t) {
8537
8598
  let n = [...t?.metadata?.indicatorDimensions || []].filter((e) => e != null), r = (kt(e)?.dimensions)?.filter((e) => e.id != null && !n.includes(e.id) && t?.metadata?.countryDimension !== e.id).map((e) => e.id).filter((e) => e != null) || [];
8538
8599
  return [...n, ...r];
8539
8600
  }
8540
8601
  //#endregion
8541
8602
  //#region libs/conversation-view/src/utils/attachments/charting/split-for-units.ts
8542
- function Uf(e, t, n) {
8603
+ function Kf(e, t, n) {
8543
8604
  let r = {};
8544
8605
  return e.forEach((e) => {
8545
- let i = Wf(e, t, n);
8606
+ let i = qf(e, t, n);
8546
8607
  r[i] || (r[i] = { rows: [] }), r[i].rows.push(e);
8547
8608
  }), Object.keys(r).map((e) => r[e]);
8548
8609
  }
8549
- function Wf(e, t, n) {
8610
+ function qf(e, t, n) {
8550
8611
  let r = n.dataStructures?.[0]?.dataStructureComponents?.dimensionList?.dimensions || [];
8551
8612
  return t.map((t) => r?.find((e) => e.id === t) == null ? e[t] || "" : ad(r, t, e)).join(" - ");
8552
8613
  }
8553
8614
  //#endregion
8554
8615
  //#region libs/conversation-view/src/utils/attachments/charting/data-uniqueness.ts
8555
- function Gf(e, t) {
8616
+ function Jf(e, t) {
8556
8617
  let n = {};
8557
- return e.forEach((e) => n[e] = Kf(e, t)), { nonUniqDimensions: e.filter((e) => !n[e]) };
8618
+ return e.forEach((e) => n[e] = Yf(e, t)), { nonUniqDimensions: e.filter((e) => !n[e]) };
8558
8619
  }
8559
- function Kf(e, t) {
8560
- let n = t.map((t) => qf(e, t));
8620
+ function Yf(e, t) {
8621
+ let n = t.map((t) => Xf(e, t));
8561
8622
  return new Set(n).size === 1;
8562
8623
  }
8563
- function qf(e, t) {
8624
+ function Xf(e, t) {
8564
8625
  return t[e];
8565
8626
  }
8566
8627
  //#endregion
8567
8628
  //#region libs/conversation-view/src/utils/attachments/charting/chart-data.ts
8568
- var Jf = "line", Yf = 10, Xf = 2;
8569
- function Zf(e) {
8629
+ var Zf = "line", Qf = 10, $f = 2;
8630
+ function ep(e) {
8570
8631
  return typeof e == "number" ? Number.isFinite(e) : typeof e == "string" && e.trim() !== "" ? Number.isFinite(Number(e)) : !1;
8571
8632
  }
8572
- function Qf(e) {
8633
+ function tp(e) {
8573
8634
  let t = (e.groups ?? []).flatMap((e) => e.units);
8574
8635
  return [...e.units, ...t].some((e) => e.isPlottable);
8575
8636
  }
8576
- function $f(e, t, n, r, i) {
8577
- let a = lp(t, e, n, r, i, { includeChartData: !1 }), o = Ht(t).sort((e, t) => en(e, t)), { nonUniqDimensions: s } = Gf(Hf(e, n), a);
8578
- return { units: Uf(a, s, e).map((t) => np(t, e, n, o, r, i)) };
8637
+ function np(e, t, n, r, i) {
8638
+ let a = fp(t, e, n, r, i, { includeChartData: !1 }), o = Ht(t).sort((e, t) => en(e, t)), { nonUniqDimensions: s } = Jf(Gf(e, n), a);
8639
+ return { units: Kf(a, s, e).map((t) => ap(t, e, n, o, r, i)) };
8579
8640
  }
8580
- function ep(e, t, n, r, i) {
8641
+ function rp(e, t, n, r, i) {
8581
8642
  let a;
8582
- return () => (a ??= $f(e, t, n, r, i), a);
8643
+ return () => (a ??= np(e, t, n, r, i), a);
8583
8644
  }
8584
- function tp(e, t, n, r, i, a) {
8585
- return np({ rows: [e] }, n, r, t, i, a);
8645
+ function ip(e, t, n, r, i, a) {
8646
+ return ap({ rows: [e] }, n, r, t, i, a);
8586
8647
  }
8587
- function np(e, t, n, r, i, a) {
8588
- let o = sp(e.rows, t, n, i), s = o?.find((e) => st.includes(e?.id))?.id, c = ip(r, e?.rows?.[0], s), l = ap(e.rows.length > Yf ? e.rows.slice(0, Yf) : e.rows, t, n, i, c);
8648
+ function ap(e, t, n, r, i, a) {
8649
+ let o = up(e.rows, t, n, i), s = o?.find((e) => st.includes(e?.id))?.id, c = sp(r, e?.rows?.[0], s), l = cp(e.rows.length > Qf ? e.rows.slice(0, Qf) : e.rows, t, n, i, c);
8589
8650
  return {
8590
8651
  rows: e.rows,
8591
- limitedByRowsAmountTo: e.rows.length > Yf ? Yf : void 0,
8652
+ limitedByRowsAmountTo: e.rows.length > Qf ? Qf : void 0,
8592
8653
  dimensions: o,
8593
- config: zf(c, l, a),
8594
- isPlottable: rp(l)
8654
+ config: Hf(c, l, a),
8655
+ isPlottable: op(l)
8595
8656
  };
8596
8657
  }
8597
- function rp(e) {
8598
- return e.some((e) => e.data.filter(Zf).length >= Xf);
8658
+ function op(e) {
8659
+ return e.some((e) => e.data.filter(ep).length >= $f);
8599
8660
  }
8600
- function ip(e, t, n) {
8661
+ function sp(e, t, n) {
8601
8662
  if (n) {
8602
8663
  let r = t?.[n];
8603
8664
  if (r === ft.MONTHLY) return e?.filter((e) => Jt(e));
@@ -8606,55 +8667,55 @@ function ip(e, t, n) {
8606
8667
  }
8607
8668
  return e;
8608
8669
  }
8609
- function ap(e, t, n, r, i) {
8670
+ function cp(e, t, n, r, i) {
8610
8671
  return e.map((e) => ({
8611
- name: n?.metadata?.countryDimension == null ? "" : Vf(e, [n?.metadata?.countryDimension], t, r),
8612
- type: Jf,
8613
- data: i.map((t) => op(t, e))
8672
+ name: n?.metadata?.countryDimension == null ? "" : Wf(e, [n?.metadata?.countryDimension], t, r),
8673
+ type: Zf,
8674
+ data: i.map((t) => lp(t, e))
8614
8675
  }));
8615
8676
  }
8616
- function op(e, t) {
8677
+ function lp(e, t) {
8617
8678
  return t[e]?.value?.[0]?.value || null;
8618
8679
  }
8619
- function sp(e, t, n, r) {
8680
+ function up(e, t, n, r) {
8620
8681
  let i = n?.metadata?.countryDimension;
8621
8682
  return (kt(t)?.dimensions || []).map((n) => {
8622
8683
  if (!(n.id == null || n.id === i)) return {
8623
8684
  id: n.id,
8624
- title: cp(n, t, r),
8625
- value: Vf(e[0], [n.id], t, r)
8685
+ title: dp(n, t, r),
8686
+ value: Wf(e[0], [n.id], t, r)
8626
8687
  };
8627
8688
  }).filter((e) => e != null);
8628
8689
  }
8629
- function cp(e, t, n) {
8690
+ function dp(e, t, n) {
8630
8691
  let { concept: r } = id(e, t.conceptSchemes || [], t.codelists || []);
8631
8692
  return X(r, n) || e.id;
8632
8693
  }
8633
8694
  //#endregion
8634
8695
  //#region libs/conversation-view/src/utils/attachments/data-grid/rows-data.ts
8635
- function lp(e, t, n, r, i, a = {}) {
8636
- let o = Df(e == null ? [] : Lt(e), kt(t)?.dimensions || [], kt(t)?.timeDimensions || []);
8637
- return a.includeChartData === !1 ? o : up(o, e, t, n, r, i);
8696
+ function fp(e, t, n, r, i, a = {}) {
8697
+ let o = Af(e == null ? [] : Lt(e), kt(t)?.dimensions || [], kt(t)?.timeDimensions || []);
8698
+ return a.includeChartData === !1 ? o : pp(o, e, t, n, r, i);
8638
8699
  }
8639
- function up(e, t, n, r, i, a) {
8700
+ function pp(e, t, n, r, i, a) {
8640
8701
  let o = Ht(t).sort((e, t) => en(e, t));
8641
8702
  return e.map((e) => ({
8642
8703
  ...e,
8643
- [nl]: () => tp(e, o, n, r, i, a)
8704
+ [nl]: () => ip(e, o, n, r, i, a)
8644
8705
  }));
8645
8706
  }
8646
8707
  //#endregion
8647
8708
  //#region libs/conversation-view/src/utils/attachments/data-grid/data-grid.ts
8648
- function dp(e, t, n, r, i, a, o, s, c, l, u) {
8709
+ function mp(e, t, n, r, i, a, o, s, c, l, u) {
8649
8710
  return {
8650
- columns: xf(e, t, r, i, a, s, c, l, u),
8651
- data: lp(t, e, n, r, o)
8711
+ columns: wf(e, t, r, i, a, s, c, l, u),
8712
+ data: fp(t, e, n, r, o)
8652
8713
  };
8653
8714
  }
8654
8715
  //#endregion
8655
8716
  //#region libs/conversation-view/src/utils/attachments/data-grid/build-custom-grid-attachment.ts
8656
- function fp(e, t, n, r, i, a, o, s, c, l, u) {
8657
- let d = e.dataflows?.[0]?.names?.[r], f = dp(e, t, n, r, i, a, o, s, c, l, u);
8717
+ function hp(e, t, n, r, i, a, o, s, c, l, u) {
8718
+ let d = e.dataflows?.[0]?.names?.[r], f = mp(e, t, n, r, i, a, o, s, c, l, u);
8658
8719
  return {
8659
8720
  title: d || s?.dataGrid || "Data Grid",
8660
8721
  grid_data: f
@@ -8662,7 +8723,7 @@ function fp(e, t, n, r, i, a, o, s, c, l, u) {
8662
8723
  }
8663
8724
  //#endregion
8664
8725
  //#region libs/conversation-view/src/utils/attachments/unwrap-markdown-code.ts
8665
- function pp(e) {
8726
+ function gp(e) {
8666
8727
  let t = e.replace(/\r\n/g, "\n");
8667
8728
  if (!t.startsWith("```")) return { code: e };
8668
8729
  let n = t.split("\n"), r = n[0].slice(3).trim() || void 0, i = -1;
@@ -8680,24 +8741,24 @@ function pp(e) {
8680
8741
  }
8681
8742
  //#endregion
8682
8743
  //#region libs/conversation-view/src/utils/attachments/markdown-attachments.ts
8683
- var mp = ["python"];
8684
- function hp(e, t, n) {
8744
+ var _p = ["python"];
8745
+ function vp(e, t, n) {
8685
8746
  return e.filter((e) => e.type === Y.MARKDOWN).filter((e) => !t || e.title?.includes(t)).map((e) => {
8686
- let t = pp(e.data ?? "");
8747
+ let t = gp(e.data ?? "");
8687
8748
  return {
8688
8749
  title: n ?? "Code samples",
8689
8750
  type: Y.CUSTOM_CODE_SAMPLE,
8690
8751
  language: t.language,
8691
8752
  data: t.code
8692
8753
  };
8693
- }).filter((e) => mp.includes(e.language ?? ""));
8754
+ }).filter((e) => _p.includes(e.language ?? ""));
8694
8755
  }
8695
8756
  //#endregion
8696
8757
  //#region libs/conversation-view/src/utils/attachments/python-attachment.ts
8697
- function gp(e, t) {
8758
+ function yp(e, t) {
8698
8759
  return e?.find((e) => e.type === Y.MARKDOWN && e.data?.includes("```python") && e.title?.includes(t.urn))?.title ?? t.urn;
8699
8760
  }
8700
- function _p(e) {
8761
+ function bp(e) {
8701
8762
  let { getPythonAttachment: t, dataQueries: n, requestIdRef: r, codeTitle: i, markdownTitle: a, datasetUrn: o, setCodeAttachments: s, onCodeAttachmentUpdated: c } = e, l = ++r.current;
8702
8763
  t(n).then((e) => {
8703
8764
  l === r.current && e?.python_code && (s([{
@@ -8712,20 +8773,20 @@ function _p(e) {
8712
8773
  }, o));
8713
8774
  }).catch((e) => console.error("Error refreshing python attachment:", e));
8714
8775
  }
8715
- var vp = (e) => ({
8776
+ var xp = (e) => ({
8716
8777
  title: e || "Data Grid",
8717
8778
  type: Y.CUSTOM_DATA_GRID
8718
- }), yp = (e) => ({
8779
+ }), Sp = (e) => ({
8719
8780
  title: e || "Chart",
8720
8781
  type: Y.CUSTOM_CHART
8721
- }), bp = (e) => ({
8782
+ }), Cp = (e) => ({
8722
8783
  title: e || "Data",
8723
8784
  type: Y.CROSS_DATASET_GRID
8724
8785
  });
8725
8786
  //#endregion
8726
8787
  //#region libs/conversation-view/src/context/AttachmentsData.tsx
8727
- function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8728
- let [_, v] = u(), [y, b] = u(), [x, S] = u(), [C, w] = u(), [T, E] = u(vp(d?.dataGrid)), [D, O] = u(yp(d?.chart)), [k, A] = u(!1), [j, M] = u([]), [N, P] = u([]), [F, I] = u([]), [L, R] = u(!1), [z, B] = u(!1), ee = l(0), [V, te] = u({
8788
+ function wp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8789
+ let [_, v] = u(), [y, b] = u(), [x, S] = u(), [C, w] = u(), [T, E] = u(xp(d?.dataGrid)), [D, O] = u(Sp(d?.chart)), [k, A] = u(!1), [j, M] = u([]), [N, P] = u([]), [F, I] = u([]), [L, R] = u(!1), [z, B] = u(!1), ee = l(0), [V, te] = u({
8729
8790
  startPeriod: null,
8730
8791
  endPeriod: null
8731
8792
  }), { getConstraints: H, getDataSet: ne, getDataSetData: U, putOnboardingFile: W, getPythonAttachment: G } = e, K = i((e) => {
@@ -8787,12 +8848,12 @@ function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8787
8848
  let i = r?.find((e) => e.id === ht)?.timeRange;
8788
8849
  i && te(i), ra(U, na(n?.urn || "", e), () => U(n?.urn || "", e)).then((e) => {
8789
8850
  B(!0), v(e || void 0), I(Bt(e));
8790
- }).finally(() => R(!1)), G && n && r && _p({
8851
+ }).finally(() => R(!1)), G && n && r && bp({
8791
8852
  getPythonAttachment: G,
8792
8853
  dataQueries: [ma(n, r, !1)],
8793
8854
  requestIdRef: ee,
8794
8855
  codeTitle: d?.codeSamples || "Python Code",
8795
- markdownTitle: gp(f, n),
8856
+ markdownTitle: yp(f, n),
8796
8857
  setCodeAttachments: M,
8797
8858
  onCodeAttachmentUpdated: h,
8798
8859
  datasetUrn: n.urn
@@ -8814,7 +8875,7 @@ function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8814
8875
  let e = xu(() => {
8815
8876
  E((e) => ({
8816
8877
  ...e,
8817
- ...fp(C, _, n, t, r, s, a, d, W, x, V)
8878
+ ...hp(C, _, n, t, r, s, a, d, W, x, V)
8818
8879
  })), B(!1);
8819
8880
  });
8820
8881
  return () => {
@@ -8836,14 +8897,14 @@ function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8836
8897
  W
8837
8898
  ]), o(() => {
8838
8899
  if (C == null || _ == null) return;
8839
- let e = ep(C, _, n, t, a);
8900
+ let e = rp(C, _, n, t, a);
8840
8901
  return O((t) => ({
8841
8902
  ...t,
8842
8903
  charting_data: void 0,
8843
8904
  getChartingData: e
8844
8905
  })), A(!1), xu(() => {
8845
8906
  try {
8846
- A(Qf(e()));
8907
+ A(tp(e()));
8847
8908
  } catch (e) {
8848
8909
  console.error("Error evaluating chart plottability", e), A(!1);
8849
8910
  }
@@ -8856,7 +8917,7 @@ function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8856
8917
  a
8857
8918
  ]), o(() => {
8858
8919
  if (f?.length) {
8859
- let e = hp(f, n?.urn, d?.codeSamples);
8920
+ let e = vp(f, n?.urn, d?.codeSamples);
8860
8921
  e.length > 0 && M(e);
8861
8922
  }
8862
8923
  }, [
@@ -8864,7 +8925,7 @@ function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8864
8925
  d,
8865
8926
  n
8866
8927
  ]);
8867
- let q = c(() => [
8928
+ let oe = c(() => [
8868
8929
  T,
8869
8930
  ...k ? [D] : [],
8870
8931
  ...j
@@ -8883,12 +8944,12 @@ function xp(e, t, n, r, a, s, d, f, p, m = !1, h, g = !1) {
8883
8944
  onFiltersChange: ae,
8884
8945
  constraints: x,
8885
8946
  isLoadingGridData: L || z,
8886
- dataSetAttachments: q
8947
+ dataSetAttachments: oe
8887
8948
  };
8888
8949
  }
8889
8950
  //#endregion
8890
8951
  //#region libs/conversation-view/src/utils/attachments/replace-python-attachment.ts
8891
- function Sp(e, t, n, r) {
8952
+ function Tp(e, t, n, r) {
8892
8953
  let i = -1;
8893
8954
  if (n) i = e.findIndex((e) => e.id === n);
8894
8955
  else for (let t = e.length - 1; t >= 0; t--) if (e[t].role === g.System) {
@@ -8907,7 +8968,7 @@ function Sp(e, t, n, r) {
8907
8968
  }
8908
8969
  //#endregion
8909
8970
  //#region libs/conversation-view/src/utils/attachments/attachments-data.ts
8910
- var Cp = async (e, t) => {
8971
+ var Ep = async (e, t) => {
8911
8972
  let n = /* @__PURE__ */ new Map(), r = Mt(e);
8912
8973
  return (await Promise.allSettled(e.map(async (e) => {
8913
8974
  let n = Qi(r?.get(e.urn) || []);
@@ -8921,14 +8982,14 @@ var Cp = async (e, t) => {
8921
8982
  Array.isArray(t) && n.set(e.value.urn, t);
8922
8983
  }
8923
8984
  }), n;
8924
- }, wp = () => ({
8985
+ }, Dp = () => ({
8925
8986
  datasetsMap: /* @__PURE__ */ new Map(),
8926
8987
  dataMessagesMap: /* @__PURE__ */ new Map(),
8927
8988
  structuresMap: /* @__PURE__ */ new Map(),
8928
8989
  dimensionsMap: /* @__PURE__ */ new Map(),
8929
8990
  structureDimensionsMap: /* @__PURE__ */ new Map()
8930
- }), Tp = async (e, t, n, r, i) => {
8931
- let a = wp();
8991
+ }), Op = async (e, t, n, r, i) => {
8992
+ let a = Dp();
8932
8993
  await Promise.allSettled(e.map(async (e) => {
8933
8994
  let n = await ra(t, na(e.urn), () => t(e.urn));
8934
8995
  if (n?.data) {
@@ -8941,7 +9002,7 @@ var Cp = async (e, t) => {
8941
9002
  let t = a.structuresMap?.get(e.urn);
8942
9003
  if (!t || o && !o.has(e.urn)) return;
8943
9004
  let i = kt(t), s = i?.dimensions == null ? null : Kt(i?.dimensions, e.filters ?? []), c = sa(e, i);
8944
- await Ep(e, o?.get(e.urn) ?? {
9005
+ await kp(e, o?.get(e.urn) ?? {
8945
9006
  filterKey: s,
8946
9007
  timeFilter: c
8947
9008
  }, n).then(({ dataMessage: t, structureDimensions: n }) => {
@@ -8950,7 +9011,7 @@ var Cp = async (e, t) => {
8950
9011
  a?.structureDimensionsMap?.set(e.urn, []);
8951
9012
  }).finally(() => r(!1));
8952
9013
  })), a;
8953
- }, Ep = async (e, t, n) => {
9014
+ }, kp = async (e, t, n) => {
8954
9015
  let r = await ra(n, na(e.urn, t), () => n(e.urn, t));
8955
9016
  return {
8956
9017
  dataMessage: r,
@@ -8959,10 +9020,10 @@ var Cp = async (e, t) => {
8959
9020
  };
8960
9021
  //#endregion
8961
9022
  //#region libs/conversation-view/src/utils/attachments/cross-dataset-grid/dataset-info-columns.ts
8962
- function Dp(e, t, n, r) {
8963
- return [kp(e, r), Op(e, t, n, r)];
9023
+ function Ap(e, t, n, r) {
9024
+ return [Mp(e, r), jp(e, t, n, r)];
8964
9025
  }
8965
- function Op(e, t, n, r) {
9026
+ function jp(e, t, n, r) {
8966
9027
  return {
8967
9028
  headerName: r?.dataset || "Dataset",
8968
9029
  field: Uu,
@@ -8985,7 +9046,7 @@ function Op(e, t, n, r) {
8985
9046
  }
8986
9047
  };
8987
9048
  }
8988
- function kp(e, t) {
9049
+ function Mp(e, t) {
8989
9050
  return {
8990
9051
  headerName: t?.agency || "Agency",
8991
9052
  field: Wu,
@@ -9000,9 +9061,9 @@ function kp(e, t) {
9000
9061
  }
9001
9062
  //#endregion
9002
9063
  //#region libs/conversation-view/src/utils/attachments/cross-dataset-grid/timeseries-columns.ts
9003
- function Ap(e, t, n, r, i) {
9004
- return jp(e).sort((e, t) => en(e, t)).map((e) => ({
9005
- ...Mp(e, r, i),
9064
+ function Np(e, t, n, r, i) {
9065
+ return Pp(e).sort((e, t) => en(e, t)).map((e) => ({
9066
+ ...Fp(e, r, i),
9006
9067
  valueGetter: (e) => e.data[e.column.getColId()]?.value?.[0]?.value || null,
9007
9068
  cellClass: Yc,
9008
9069
  cellRenderer: Zc,
@@ -9014,13 +9075,13 @@ function Ap(e, t, n, r, i) {
9014
9075
  }
9015
9076
  }));
9016
9077
  }
9017
- function jp(e) {
9078
+ function Pp(e) {
9018
9079
  let t = /* @__PURE__ */ new Set();
9019
9080
  return e.forEach((e) => {
9020
9081
  e != null && Ht(e).forEach((e) => t.add(e));
9021
9082
  }), Array.from(t);
9022
9083
  }
9023
- function Mp(e, t = Le, n) {
9084
+ function Fp(e, t = Le, n) {
9024
9085
  return {
9025
9086
  headerName: ui(e, n),
9026
9087
  colId: e,
@@ -9035,8 +9096,8 @@ function Mp(e, t = Le, n) {
9035
9096
  }
9036
9097
  //#endregion
9037
9098
  //#region libs/conversation-view/src/utils/attachments/cross-dataset-grid/build-cross-dataset-grid-columns.ts
9038
- function Np(e, t, n, r, i, a, o = $u.Compact) {
9039
- let s = new Map([...n.entries()].map(([e, t]) => [e, t?.data])), c = Dp(e, s, r, i), l = sd(e, t, r, i, o), u = Ap(n, e, r, a, i);
9099
+ function Ip(e, t, n, r, i, a, o = $u.Compact) {
9100
+ let s = new Map([...n.entries()].map(([e, t]) => [e, t?.data])), c = Ap(e, s, r, i), l = sd(e, t, r, i, o), u = Np(n, e, r, a, i);
9040
9101
  return [
9041
9102
  ol(e, s, r, i),
9042
9103
  ...c,
@@ -9047,12 +9108,12 @@ function Np(e, t, n, r, i, a, o = $u.Compact) {
9047
9108
  }
9048
9109
  //#endregion
9049
9110
  //#region libs/conversation-view/src/utils/attachments/cross-dataset-grid/build-cross-dataset-grid-data.ts
9050
- function Pp(e, t, n, r, i) {
9111
+ function Lp(e, t, n, r, i) {
9051
9112
  let a = [];
9052
9113
  return n.filter((e) => !e.disabled).forEach((n) => {
9053
9114
  let o = n.urn, s = t.get(o), c = e.get(o);
9054
9115
  if (s == null || c == null) return;
9055
- let l = lp(s, c, n, r, i), u = X(c.dataflows?.[0], r);
9116
+ let l = fp(s, c, n, r, i), u = X(c.dataflows?.[0], r);
9056
9117
  a.push(...l.map((e) => ({
9057
9118
  ...e,
9058
9119
  dataset: { urn: o },
@@ -9062,31 +9123,31 @@ function Pp(e, t, n, r, i) {
9062
9123
  }
9063
9124
  //#endregion
9064
9125
  //#region libs/conversation-view/src/utils/attachments/cross-dataset-grid/build-cross-dataset-grid-attachment.ts
9065
- function Fp(e, t, n, r, i, a, o, s, c, l, u, d = $u.Compact) {
9066
- let f = Ip(e, t, n, r, i, a, o, s, c, l, u, d);
9126
+ function Rp(e, t, n, r, i, a, o, s, c, l, u, d = $u.Compact) {
9127
+ let f = zp(e, t, n, r, i, a, o, s, c, l, u, d);
9067
9128
  return {
9068
9129
  title: c?.dataGrid || "Data",
9069
9130
  gridContent: f
9070
9131
  };
9071
9132
  }
9072
- function Ip(e, t, n, r, i, a, o, s, c, l, u, d = $u.Compact) {
9133
+ function zp(e, t, n, r, i, a, o, s, c, l, u, d = $u.Compact) {
9073
9134
  return {
9074
- columns: Np(e, n, t, i, c, a, d),
9075
- data: Pp(e, t, r, i, s)
9135
+ columns: Ip(e, n, t, i, c, a, d),
9136
+ data: Lp(e, t, r, i, s)
9076
9137
  };
9077
9138
  }
9078
9139
  //#endregion
9079
9140
  //#region libs/conversation-view/src/utils/attachments/charting/cross-dataset-chart-data.ts
9080
- function Lp(e, t, n, r, i) {
9141
+ function Bp(e, t, n, r, i) {
9081
9142
  let a;
9082
- return () => (a ??= Rp(e, t, n, r, i), a);
9143
+ return () => (a ??= Vp(e, t, n, r, i), a);
9083
9144
  }
9084
- function Rp(e, t, n, r, i) {
9145
+ function Vp(e, t, n, r, i) {
9085
9146
  let a = n.filter((e) => !e.disabled).flatMap((n) => {
9086
9147
  let a = e.get(n.urn), o = t.get(n.urn);
9087
9148
  return !a || !o ? [] : [{
9088
9149
  title: X(a.dataflows?.[0], r),
9089
- units: $f(a, o, n, r, i).units
9150
+ units: np(a, o, n, r, i).units
9090
9151
  }];
9091
9152
  });
9092
9153
  return {
@@ -9096,18 +9157,18 @@ function Rp(e, t, n, r, i) {
9096
9157
  }
9097
9158
  //#endregion
9098
9159
  //#region libs/conversation-view/src/context/AttachmentsDataMultipleQueries.tsx
9099
- var zp = 5e3;
9100
- function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9101
- let g = Array.isArray(f) ? f : void 0, [_, v] = u(), [y, b] = u(), [x, S] = u(!1), [C, w] = u(g ? new Set(g) : null), [T, E] = u(!1), D = l(0), O = l(m), k = l(_), A = l(0), j = l(null), [M, N] = u(bp(h?.dataGrid)), [P, F] = u(yp(h?.chart)), [I, L] = u(!1), [R, z] = u([]), { getConstraints: B, getDataSet: ee, getDataSetData: V, getPythonAttachment: te } = e, H = l(n);
9160
+ var Hp = 5e3;
9161
+ function Up(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9162
+ let g = Array.isArray(f) ? f : void 0, [_, v] = u(), [y, b] = u(), [x, S] = u(!1), [C, w] = u(g ? new Set(g) : null), [T, E] = u(!1), D = l(0), O = l(m), k = l(_), A = l(0), j = l(null), [M, N] = u(Cp(h?.dataGrid)), [P, F] = u(Sp(h?.chart)), [I, L] = u(!1), [R, z] = u([]), { getConstraints: B, getDataSet: ee, getDataSetData: V, getPythonAttachment: te } = e, H = l(n);
9102
9163
  H.current = n;
9103
9164
  let ne = l(g);
9104
9165
  ne.current = g;
9105
9166
  let U = c(() => n?.map((e) => e.urn).join(",") ?? "", [n]), W = cu(), { getDimensionsScheme: G } = W, K = i(async (e) => {
9106
9167
  try {
9107
- let t = await Cp(e.map((e) => ({
9168
+ let t = await Ep(e.map((e) => ({
9108
9169
  ...e,
9109
9170
  filters: []
9110
- })), B), n = co(e, t, W.map), r = n === e ? t : await Cp(n, B);
9171
+ })), B), n = co(e, t, W.map), r = n === e ? t : await Ep(n, B);
9111
9172
  return v((e) => ({
9112
9173
  ...e,
9113
9174
  constraintsMap: r
@@ -9120,7 +9181,7 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9120
9181
  })), e;
9121
9182
  }
9122
9183
  }, [W.map, B]), re = i(async (e, n) => {
9123
- let r = await Tp(e, ee, V, S, async (r) => {
9184
+ let r = await Op(e, ee, V, S, async (r) => {
9124
9185
  let i = wo(e.filter((e) => !e.disabled), r, n, t, W.map);
9125
9186
  if (i) return w(i.compatibleUrns), i.filterParamsMap;
9126
9187
  });
@@ -9160,7 +9221,7 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9160
9221
  re
9161
9222
  ]), o(() => {
9162
9223
  if (d?.length) {
9163
- let e = hp(d, void 0, h?.codeSamples);
9224
+ let e = vp(d, void 0, h?.codeSamples);
9164
9225
  e.length > 0 && z(e);
9165
9226
  }
9166
9227
  }, [d, h]), o(() => () => {
@@ -9175,7 +9236,7 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9175
9236
  let l = n?.filter((e) => !e.disabled), u = C ?? new Set((l ?? []).map((e) => e.urn)), d = io(l, u), f = ao(i, u), p = ao(o, u), g = ao(y, u);
9176
9237
  N((e) => ({
9177
9238
  ...e,
9178
- ...Fp(f, p, g, d, t, a, s, r, h, c, {
9239
+ ...Rp(f, p, g, d, t, a, s, r, h, c, {
9179
9240
  startPeriod: null,
9180
9241
  endPeriod: null
9181
9242
  }, m)
@@ -9201,14 +9262,14 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9201
9262
  ]), o(() => {
9202
9263
  let { structuresMap: e, dataMessagesMap: i } = _ ?? {};
9203
9264
  if (e != null && e.size > 0 && i != null && !x) {
9204
- let a = n?.filter((e) => !e.disabled), o = C ?? new Set((a ?? []).map((e) => e.urn)), s = io(a, o), c = Lp(ao(e, o), ao(i, o), s, t, r);
9265
+ let a = n?.filter((e) => !e.disabled), o = C ?? new Set((a ?? []).map((e) => e.urn)), s = io(a, o), c = Bp(ao(e, o), ao(i, o), s, t, r);
9205
9266
  return F((e) => ({
9206
9267
  ...e,
9207
9268
  charting_data: void 0,
9208
9269
  getChartingData: c
9209
9270
  })), L(!1), xu(() => {
9210
9271
  try {
9211
- L(Qf(c()));
9272
+ L(tp(c()));
9212
9273
  } catch (e) {
9213
9274
  console.error("Error evaluating cross-dataset chart plottability", e), L(!1);
9214
9275
  }
@@ -9231,7 +9292,7 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9231
9292
  P,
9232
9293
  R,
9233
9294
  I
9234
- ]), q = i((e, n, r, i, a) => {
9295
+ ]), oe = i((e, n, r, i, a) => {
9235
9296
  try {
9236
9297
  S(!0);
9237
9298
  let o = ++A.current;
@@ -9264,8 +9325,8 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9264
9325
  };
9265
9326
  j.current = setTimeout(() => {
9266
9327
  j.current = null, o === A.current && d.size > 0 && (f(), S(!1));
9267
- }, zp);
9268
- let m = s.map((e) => Ep(e, u?.get(e?.urn), V).then(({ dataMessage: t, structureDimensions: n }) => {
9328
+ }, Hp);
9329
+ let m = s.map((e) => kp(e, u?.get(e?.urn), V).then(({ dataMessage: t, structureDimensions: n }) => {
9269
9330
  d.set(e.urn, {
9270
9331
  urn: e.urn,
9271
9332
  dataMessage: t,
@@ -9274,7 +9335,7 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9274
9335
  }));
9275
9336
  Promise.allSettled(m).finally(() => {
9276
9337
  o === A.current && (j.current !== null && (clearTimeout(j.current), j.current = null), f(), S(!1));
9277
- }), te && s.length && _p({
9338
+ }), te && s.length && bp({
9278
9339
  getPythonAttachment: te,
9279
9340
  dataQueries: s.map((e) => ma(e, a ?? i?.get(e.urn) ?? [])),
9280
9341
  requestIdRef: D,
@@ -9301,12 +9362,12 @@ function Bp(e, t, n, r, a, s, d, f, p, m = $u.Compact, h) {
9301
9362
  isLoadingGridData: x || T,
9302
9363
  crossDatasetAttachments: ae,
9303
9364
  activeDatasetUrns: C,
9304
- onMultipleDataFiltersChange: q
9365
+ onMultipleDataFiltersChange: oe
9305
9366
  };
9306
9367
  }
9307
9368
  //#endregion
9308
9369
  //#region libs/conversation-view/src/context/CrossDatasetAttachmentsContext.tsx
9309
- var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up = (e) => {
9370
+ var Wp = n(void 0), Gp = { setCrossDatasetAttachmentsState: () => void 0 }, Kp = (e) => {
9310
9371
  if (!e) return "";
9311
9372
  try {
9312
9373
  return JSON.stringify({
@@ -9323,9 +9384,9 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9323
9384
  attachmentsLength: e.attachments?.length ?? 0
9324
9385
  });
9325
9386
  }
9326
- }, Wp = ({ children: e }) => {
9387
+ }, qp = ({ children: e }) => {
9327
9388
  let [t, n] = u({}), r = i((e) => {
9328
- let t = Up(e);
9389
+ let t = Kp(e);
9329
9390
  n((n) => n.signature === t ? n : {
9330
9391
  ...e,
9331
9392
  isLoading: !!e?.isLoading,
@@ -9335,15 +9396,15 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9335
9396
  ...t,
9336
9397
  setCrossDatasetAttachmentsState: r
9337
9398
  }), [r, t]);
9338
- return /* @__PURE__ */ f(Vp.Provider, {
9399
+ return /* @__PURE__ */ f(Wp.Provider, {
9339
9400
  value: a,
9340
9401
  children: e
9341
9402
  });
9342
- }, Gp = () => {
9343
- let e = a(Vp);
9344
- return e === void 0 ? Hp : e;
9345
- }, Kp = ({ attachmentsProps: e, actions: t, titles: n, shareConversationProps: r, metadataSettings: a, formattingSettings: s, locale: m, advanceViewStyles: h, getDatasetUpdatedTime: g, attachmentsConfig: _, datasetInfoOptions: v, limitMessages: y, ...b }) => {
9346
- let x = c(() => e.currentDataQuery?.urn ?? e.dataQueries?.[0]?.urn ?? "default", [e.currentDataQuery?.urn, e.dataQueries]), S = c(() => e?.dataQueries?.filter((e) => !e.disabled), [e?.dataQueries]), [C, w] = u($u.Compact), { isOpenedAdvancedView: T } = kn(), { activeDatasetUrns: E, dataQueriesKey: D, setCrossDatasetAttachmentsState: O } = Gp(), { isCrossDatasetModeOn: k, isMetadataInSidePanel: A } = Bi(), j = cu(), M = !A, N = e.datasets ?? [], P = N.length > 1 && !k, I = c(() => {
9403
+ }, Jp = () => {
9404
+ let e = a(Wp);
9405
+ return e === void 0 ? Gp : e;
9406
+ }, Yp = ({ attachmentsProps: e, actions: t, titles: n, shareConversationProps: r, metadataSettings: a, formattingSettings: s, locale: m, advanceViewStyles: h, getDatasetUpdatedTime: g, attachmentsConfig: _, datasetInfoOptions: v, limitMessages: y, ...b }) => {
9407
+ let x = c(() => e.currentDataQuery?.urn ?? e.dataQueries?.[0]?.urn ?? "default", [e.currentDataQuery?.urn, e.dataQueries]), S = c(() => e?.dataQueries?.filter((e) => !e.disabled), [e?.dataQueries]), [C, w] = u($u.Compact), { isOpenedAdvancedView: T } = kn(), { activeDatasetUrns: E, dataQueriesKey: D, setCrossDatasetAttachmentsState: O } = Jp(), { isCrossDatasetModeOn: k, isMetadataInSidePanel: A } = Bi(), j = cu(), M = !A, N = e.datasets ?? [], P = N.length > 1 && !k, I = c(() => {
9347
9408
  let e = b.filtersProps.conversation?.messages ?? [], t = Xs(e);
9348
9409
  return t >= 0 ? e[t].custom_content?.attachments : void 0;
9349
9410
  }, [b.filtersProps.conversation?.messages]), L = c(() => lo(e.dataQueries), [e.dataQueries]), R = D === L ? E : oo(e.dataQueries, j.map), z = k && !!e.dataQueries?.length, B = l(b.filtersProps.conversation);
@@ -9351,7 +9412,7 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9351
9412
  let ee = i((e, t) => {
9352
9413
  let n = B.current;
9353
9414
  if (!n) return;
9354
- let r = Sp(n.messages, e, void 0, t);
9415
+ let r = Tp(n.messages, e, void 0, t);
9355
9416
  if (!r) return;
9356
9417
  let i = {
9357
9418
  ...n,
@@ -9361,36 +9422,36 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9361
9422
  name: i.name,
9362
9423
  messages: i.messages
9363
9424
  });
9364
- }, []), { dataMessage: V, dataset: te, dimensions: H, structureDimensions: ne, structures: U, dataSetAttachments: W, onFiltersChange: G, isLoadingGridData: K, constraints: re } = xp(t, m, e.currentDataQuery, s, e.styles?.chartingStyles, a, n, I, void 0, !1, ee, z), ie = M && !!te, { structureDataMaps: ae, crossDatasetAttachments: q, activeDatasetUrns: oe, isLoadingGridData: se, onMultipleDataFiltersChange: ce } = Bp(t, m, e.dataQueries, e.styles?.chartingStyles, s, a, I, R, ee, C, n);
9425
+ }, []), { dataMessage: V, dataset: te, dimensions: H, structureDimensions: ne, structures: U, dataSetAttachments: W, onFiltersChange: G, isLoadingGridData: K, constraints: re } = wp(t, m, e.currentDataQuery, s, e.styles?.chartingStyles, a, n, I, void 0, !1, ee, z), ie = M && !!te, { structureDataMaps: ae, crossDatasetAttachments: oe, activeDatasetUrns: se, isLoadingGridData: ce, onMultipleDataFiltersChange: q } = Up(t, m, e.dataQueries, e.styles?.chartingStyles, s, a, I, R, ee, C, n);
9365
9426
  o(() => {
9366
9427
  if (!k || !e.dataQueries?.length) {
9367
9428
  O();
9368
9429
  return;
9369
9430
  }
9370
9431
  ae && O({
9371
- attachments: q,
9432
+ attachments: oe,
9372
9433
  dataQueriesKey: L,
9373
- activeDatasetUrns: oe ? Array.from(oe) : void 0,
9374
- isLoading: se
9434
+ activeDatasetUrns: se ? Array.from(se) : void 0,
9435
+ isLoading: ce
9375
9436
  });
9376
9437
  }, [
9377
- oe,
9438
+ se,
9378
9439
  e.dataQueries?.length,
9379
- q,
9440
+ oe,
9380
9441
  L,
9381
9442
  k,
9382
- se,
9443
+ ce,
9383
9444
  O,
9384
9445
  ae
9385
9446
  ]);
9386
9447
  let [le, ue] = u({
9387
9448
  filterKey: null,
9388
9449
  timeFilter: null
9389
- }), [de, fe] = u(), pe = k ? se : K, me = k ? q : W, he = i((e, t, n) => {
9450
+ }), [de, fe] = u(), pe = k ? ce : K, me = k ? oe : W, he = i((e, t, n) => {
9390
9451
  ue(e), fe(!0), G(e, t, n);
9391
9452
  }, [G]), Y = i((e, t, n, r, i) => {
9392
- fe(!0), ce(e, t, n, r, i);
9393
- }, [ce]), ge = i((n) => {
9453
+ fe(!0), q(e, t, n, r, i);
9454
+ }, [q]), ge = i((n) => {
9394
9455
  n && t?.updateCurrentDataQuery(e?.dataQueries?.find((e) => e?.urn === n) || e.currentDataQuery);
9395
9456
  }, [
9396
9457
  t,
@@ -9423,7 +9484,7 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9423
9484
  resetIcon: e.styles?.tableSettingsResetIcon,
9424
9485
  children: /* @__PURE__ */ f(cs, { children: /* @__PURE__ */ p("div", {
9425
9486
  className: "advanced-view flex h-full min-w-0 flex-1 flex-col",
9426
- children: [/* @__PURE__ */ f(bf, {
9487
+ children: [/* @__PURE__ */ f(Cf, {
9427
9488
  locale: m,
9428
9489
  shareConversationProps: r,
9429
9490
  isShowShare: h?.isShowShare,
@@ -9433,7 +9494,7 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9433
9494
  initialSelectedDatasetUrn: e?.currentDataQuery?.urn,
9434
9495
  locale: m,
9435
9496
  selectDataset: ge
9436
- }), pe && !de ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ p(d, { children: [ie && /* @__PURE__ */ f(yf, {
9497
+ }), pe && !de ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ p(d, { children: [ie && /* @__PURE__ */ f(Sf, {
9437
9498
  ...v,
9438
9499
  locale: m,
9439
9500
  dataset: te,
@@ -9446,7 +9507,7 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9446
9507
  className: J("flex flex-1 min-h-0 overflow-auto", ie && "border-t border-neutrals-500"),
9447
9508
  children: [/* @__PURE__ */ f("div", {
9448
9509
  className: J("flex-1 min-h-0 overflow-auto", "advanced-view-filters"),
9449
- children: /* @__PURE__ */ f(vf, {
9510
+ children: /* @__PURE__ */ f(xf, {
9450
9511
  ...b,
9451
9512
  actions: t,
9452
9513
  attachments: me,
@@ -9476,7 +9537,7 @@ var Vp = n(void 0), Hp = { setCrossDatasetAttachmentsState: () => void 0 }, Up =
9476
9537
  };
9477
9538
  //#endregion
9478
9539
  //#region libs/conversation-view/src/context/Datasets.tsx
9479
- function qp(e, t, n, r, i, a) {
9540
+ function Xp(e, t, n, r, i, a) {
9480
9541
  let [s, c] = u([]), [d, f] = u(), [p, m] = u(!1), h = l(void 0);
9481
9542
  return o(() => {
9482
9543
  h.current = a;
@@ -9516,14 +9577,14 @@ function qp(e, t, n, r, i, a) {
9516
9577
  }
9517
9578
  //#endregion
9518
9579
  //#region libs/conversation-view/src/utils/attachments/parse-data-query.ts
9519
- function Jp(e) {
9580
+ function Zp(e) {
9520
9581
  let t = e?.filter((e) => zs(e));
9521
9582
  if (t?.every((e) => !!e?.data)) return t?.map((e) => ({
9522
9583
  title: e?.title,
9523
- ...Xp(Yp(e?.data))
9584
+ ...$p(Qp(e?.data))
9524
9585
  }));
9525
9586
  }
9526
- function Yp(e) {
9587
+ function Qp(e) {
9527
9588
  if (e) try {
9528
9589
  return JSON.parse(e);
9529
9590
  } catch (e) {
@@ -9531,7 +9592,7 @@ function Yp(e) {
9531
9592
  }
9532
9593
  return null;
9533
9594
  }
9534
- function Xp(e) {
9595
+ function $p(e) {
9535
9596
  return {
9536
9597
  ...e,
9537
9598
  filters: e?.filters?.map((e) => ({
@@ -9549,9 +9610,9 @@ function Xp(e) {
9549
9610
  }
9550
9611
  //#endregion
9551
9612
  //#region libs/conversation-view/src/constants/message-stages.ts
9552
- var Zp = /* @__PURE__ */ function(e) {
9613
+ var em = /* @__PURE__ */ function(e) {
9553
9614
  return e.COMPLETED = "completed", e;
9554
- }({}), Qp = ({ stage: e, stageRef: t, isCurrentStage: n }) => /* @__PURE__ */ p("div", {
9615
+ }({}), tm = ({ stage: e, stageRef: t, isCurrentStage: n }) => /* @__PURE__ */ p("div", {
9555
9616
  ref: t,
9556
9617
  className: "message-stage relative flex pb-8 last:mb-8 last:pb-0",
9557
9618
  children: [
@@ -9620,10 +9681,10 @@ var Zp = /* @__PURE__ */ function(e) {
9620
9681
  })]
9621
9682
  })
9622
9683
  ]
9623
- }), $p = ({ stages: e, expandIcon: t, processingTitle: n, prefixIcon: r }) => {
9684
+ }), nm = ({ stages: e, expandIcon: t, processingTitle: n, prefixIcon: r }) => {
9624
9685
  let [i, a] = u(), [s, c] = u(), d = l(null), m = l(null);
9625
9686
  return o(() => {
9626
- c(e?.filter((e) => e?.status !== Zp.COMPLETED)?.at(-1));
9687
+ c(e?.filter((e) => e?.status !== em.COMPLETED)?.at(-1));
9627
9688
  }, [e]), o(() => {
9628
9689
  i && m?.current?.scrollIntoView({
9629
9690
  block: "nearest",
@@ -9658,14 +9719,14 @@ var Zp = /* @__PURE__ */ function(e) {
9658
9719
  ]
9659
9720
  }), i && e && /* @__PURE__ */ f("div", {
9660
9721
  className: "flex flex-col",
9661
- children: e?.map((e) => /* @__PURE__ */ f(Qp, {
9722
+ children: e?.map((e) => /* @__PURE__ */ f(tm, {
9662
9723
  stage: e,
9663
9724
  stageRef: s ? m : null,
9664
9725
  isCurrentStage: e?.index === s?.index
9665
9726
  }, e.index))
9666
9727
  })]
9667
9728
  });
9668
- }, em = 2e3, tm = ({ message: e, regenerateMessage: t, messageActionsIcons: n, rateResponse: r, isStreaming: i = !1, isReadOnly: a = !1, isRegenerateAvailable: s = !1 }) => {
9729
+ }, rm = 2e3, im = ({ message: e, regenerateMessage: t, messageActionsIcons: n, rateResponse: r, isStreaming: i = !1, isReadOnly: a = !1, isRegenerateAvailable: s = !1 }) => {
9669
9730
  let { messageActionsTitles: c } = Z(), d = n?.copy, m = n?.copied, g = n?.regenerate, _ = n?.thumbUp, v = n?.thumbDown, y = n?.thumbPressed, [b, x] = u(e.like ?? h.NoState), [S, C] = u(!1), w = l(null), { isAgentAvailable: T } = W();
9670
9731
  o(() => () => {
9671
9732
  w.current && clearTimeout(w.current);
@@ -9680,7 +9741,7 @@ var Zp = /* @__PURE__ */ function(e) {
9680
9741
  onClick: () => {
9681
9742
  navigator.clipboard.writeText(e.content), C(!0), w.current && clearTimeout(w.current), w.current = setTimeout(() => {
9682
9743
  C(!1);
9683
- }, em);
9744
+ }, rm);
9684
9745
  },
9685
9746
  title: c?.copy,
9686
9747
  children: S && m ? m : d
@@ -9711,7 +9772,7 @@ var Zp = /* @__PURE__ */ function(e) {
9711
9772
  }))
9712
9773
  ]
9713
9774
  });
9714
- }, nm = ({ message: e, onEditClick: t, messageActionsIcons: n, isStreaming: r = !1, isReadOnly: i = !1 }) => {
9775
+ }, am = ({ message: e, onEditClick: t, messageActionsIcons: n, isStreaming: r = !1, isReadOnly: i = !1 }) => {
9715
9776
  let a = n?.copy, o = n?.edit, { isAgentAvailable: s } = W();
9716
9777
  return /* @__PURE__ */ p("div", {
9717
9778
  className: J("message-actions", "flex gap-x-2 pt-2 ml-12"),
@@ -9725,7 +9786,7 @@ var Zp = /* @__PURE__ */ function(e) {
9725
9786
  children: o
9726
9787
  })]
9727
9788
  });
9728
- }, rm = ({ content: e, textColorClass: t, onCancel: n, onEditApply: r, editMessageTitles: i }) => {
9789
+ }, om = ({ content: e, textColorClass: t, onCancel: n, onEditApply: r, editMessageTitles: i }) => {
9729
9790
  let { isOpenedAdvancedView: a } = kn(), s = l(null);
9730
9791
  o(() => {
9731
9792
  let e = s.current;
@@ -9757,23 +9818,23 @@ var Zp = /* @__PURE__ */ function(e) {
9757
9818
  })]
9758
9819
  })]
9759
9820
  });
9760
- }, im = ({ message: e, previousMessage: t, actions: n, dataQuery: r, isStreaming: a = !1, isCurrentMessageStreaming: s = !1, showAdvancedView: l, locale: m, metadataSettings: h, onAdvancedViewOpen: _, regenerateMessage: v, selectMessageToSend: y, rateResponse: b, editMessage: x, isReadOnlyConversation: S, isLastNotUserMessage: C, onCodeAttachmentUpdated: w }) => {
9761
- let { messageStyles: T, attachmentsStyles: E, formattingSettings: D, messageActionsIcons: O, editMessageTitles: k, expandStagesIcon: A, titles: j } = Z(), [M, N] = u(), [P, L] = u(), [R, z] = u([]), [B, ee] = u([]), [V, te] = u(), [H, ne] = u(!1), { isCrossDatasetModeOn: U } = Bi(), W = cu(), G = e.role === g.User, re = e.role === g.System, { datasets: ie, datasetStructuresMap: ae, isLoading: q } = qp(n.getDataSet, n.updateDatasets, n.updateDataQueries, n.updateCurrentDataQuery, M, r), [oe, se] = u(!1), [ce, le] = u([]);
9821
+ }, sm = ({ message: e, previousMessage: t, actions: n, dataQuery: r, isStreaming: a = !1, isCurrentMessageStreaming: s = !1, showAdvancedView: l, locale: m, metadataSettings: h, onAdvancedViewOpen: _, regenerateMessage: v, selectMessageToSend: y, rateResponse: b, editMessage: x, isReadOnlyConversation: S, isLastNotUserMessage: C, onCodeAttachmentUpdated: w }) => {
9822
+ let { messageStyles: T, attachmentsStyles: E, formattingSettings: D, messageActionsIcons: O, editMessageTitles: k, expandStagesIcon: A, titles: j } = Z(), [M, N] = u(), [P, L] = u(), [R, z] = u([]), [B, ee] = u([]), [V, te] = u(), [H, ne] = u(!1), { isCrossDatasetModeOn: U } = Bi(), W = cu(), G = e.role === g.User, re = e.role === g.System, { datasets: ie, datasetStructuresMap: ae, isLoading: oe } = Xp(n.getDataSet, n.updateDatasets, n.updateDataQueries, n.updateCurrentDataQuery, M, r), [se, ce] = u(!1), [q, le] = u([]);
9762
9823
  o(() => {
9763
9824
  L(M?.[0]);
9764
9825
  }, [M]);
9765
9826
  let ue = U && !!M?.length, de = i((t) => {
9766
9827
  e.id && w?.(e.id, t);
9767
- }, [e.id, w]), { dataSetAttachments: fe, dimensions: pe, isLoadingGridData: me } = xp(n, m, P, D, E?.chartingStyles, h, j, e.custom_content?.attachments, P ? ae?.get(P.urn) : void 0, q, de, ue), he = c(() => oo(M, W.map), [M, W.map]), { crossDatasetAttachments: Y, isLoadingGridData: ge } = Bp(n, m, M, E?.chartingStyles, D, h, e.custom_content?.attachments, he, de, void 0, j), { isOpenedAdvancedView: _e } = kn(), ve = K(I), ye = !ve, { attachments: be, dataQueriesKey: xe, isLoading: Se } = Gp(), Ce = c(() => lo(M), [M]), we = U && !!l && be != null && xe === Ce, Te = we ? be : Y, Ee = c(() => U ? we ? Se : ge : me, [
9828
+ }, [e.id, w]), { dataSetAttachments: fe, dimensions: pe, isLoadingGridData: me } = wp(n, m, P, D, E?.chartingStyles, h, j, e.custom_content?.attachments, P ? ae?.get(P.urn) : void 0, oe, de, ue), he = c(() => oo(M, W.map), [M, W.map]), { crossDatasetAttachments: Y, isLoadingGridData: ge } = Up(n, m, M, E?.chartingStyles, D, h, e.custom_content?.attachments, he, de, void 0, j), { isOpenedAdvancedView: _e } = kn(), ve = K(I), ye = !ve, { attachments: be, dataQueriesKey: xe, isLoading: Se } = Jp(), Ce = c(() => lo(M), [M]), we = U && !!l && be != null && xe === Ce, Te = we ? be : Y, Ee = c(() => U ? we ? Se : ge : me, [
9768
9829
  U,
9769
9830
  ge,
9770
9831
  me,
9771
9832
  Se,
9772
9833
  we
9773
9834
  ]), De = () => {
9774
- G && se(!0);
9835
+ G && ce(!0);
9775
9836
  }, Oe = () => {
9776
- se(!1);
9837
+ ce(!1);
9777
9838
  }, ke = (t) => {
9778
9839
  Oe(), x?.({
9779
9840
  ...e,
@@ -9786,7 +9847,7 @@ var Zp = /* @__PURE__ */ function(e) {
9786
9847
  let t = e.custom_content?.form_schema?.properties;
9787
9848
  le((C ? t?.choice?.oneOf || t?.completion?.oneOf : []) || []);
9788
9849
  }, [e, C]), o(() => {
9789
- let t = Ls(e), n = Jp(t), r = t.filter((e) => Hs(e));
9850
+ let t = Ls(e), n = Zp(t), r = t.filter((e) => Hs(e));
9790
9851
  N(n), ee(r);
9791
9852
  }, [e]), o(() => {
9792
9853
  ne(M != null && M.length > 0);
@@ -9794,7 +9855,7 @@ var Zp = /* @__PURE__ */ function(e) {
9794
9855
  r?.urn && M?.some((e) => e?.urn === r.urn) && te(r.urn);
9795
9856
  }, [r, M]), o(() => {
9796
9857
  if (e?.role === g.System && t) {
9797
- let e = Jp(Ls(t)) || [];
9858
+ let e = Zp(Ls(t)) || [];
9798
9859
  M && e && ae && z(Cc(e, M, ae, m, W.map));
9799
9860
  }
9800
9861
  }, [
@@ -9821,7 +9882,7 @@ var Zp = /* @__PURE__ */ function(e) {
9821
9882
  T?.systemMessageIcon,
9822
9883
  _e,
9823
9884
  s
9824
- ]), Me = ve ? je("inline") : null, Ne = ve && (Me != null || s) ? /* @__PURE__ */ p(d, { children: [Me, s && /* @__PURE__ */ f(F, {})] }) : null, Pe = !G && !_e && !!e?.custom_content?.stages, Fe = ve && !Pe && !s && !oe && Me != null, Ie = c(() => /* @__PURE__ */ f(Bd, {
9885
+ ]), Me = ve ? je("inline") : null, Ne = ve && (Me != null || s) ? /* @__PURE__ */ p(d, { children: [Me, s && /* @__PURE__ */ f(F, {})] }) : null, Pe = !G && !_e && !!e?.custom_content?.stages, Fe = ve && !Pe && !s && !se && Me != null, Ie = c(() => /* @__PURE__ */ f(Ud, {
9825
9886
  actions: n,
9826
9887
  attachments: H ? U ? Te : fe : B,
9827
9888
  onAdvancedViewOpen: _,
@@ -9858,13 +9919,13 @@ var Zp = /* @__PURE__ */ function(e) {
9858
9919
  U
9859
9920
  ]);
9860
9921
  if (re && _e) return null;
9861
- let Le = s ? null : G ? oe ? null : /* @__PURE__ */ f(nm, {
9922
+ let Le = s ? null : G ? se ? null : /* @__PURE__ */ f(am, {
9862
9923
  messageActionsIcons: O,
9863
9924
  message: e,
9864
9925
  isStreaming: a,
9865
9926
  onEditClick: De,
9866
9927
  isReadOnly: S
9867
- }) : re ? null : /* @__PURE__ */ f(tm, {
9928
+ }) : re ? null : /* @__PURE__ */ f(im, {
9868
9929
  messageActionsIcons: O,
9869
9930
  message: e,
9870
9931
  isStreaming: a,
@@ -9876,7 +9937,7 @@ var Zp = /* @__PURE__ */ function(e) {
9876
9937
  return /* @__PURE__ */ f("div", {
9877
9938
  className: J("max-w-full flex", G ? "justify-end" : "justify-start", "message-wrapper"),
9878
9939
  children: /* @__PURE__ */ p("div", {
9879
- className: J("flex items-start", G && !oe ? "max-w-full" : "w-full"),
9940
+ className: J("flex items-start", G && !se ? "max-w-full" : "w-full"),
9880
9941
  children: [ye && /* @__PURE__ */ p("div", {
9881
9942
  className: "relative mr-2",
9882
9943
  children: [je(), s && /* @__PURE__ */ f(F, {})]
@@ -9884,8 +9945,8 @@ var Zp = /* @__PURE__ */ function(e) {
9884
9945
  className: "min-w-0 flex-1",
9885
9946
  children: [
9886
9947
  /* @__PURE__ */ p("div", {
9887
- className: J(G ? "bg-neutrals-300 px-6" : "pt-0", G ? "user-message" : "system-message", G && (oe ? "w-[100%] ml-0" : "ml-12")),
9888
- children: [Pe ? /* @__PURE__ */ f($p, {
9948
+ className: J(G ? "bg-neutrals-300 px-6" : "pt-0", G ? "user-message" : "system-message", G && (se ? "w-[100%] ml-0" : "ml-12")),
9949
+ children: [Pe ? /* @__PURE__ */ f(nm, {
9889
9950
  stages: e?.custom_content?.stages,
9890
9951
  expandIcon: A,
9891
9952
  processingTitle: T?.processingTitle,
@@ -9899,7 +9960,7 @@ var Zp = /* @__PURE__ */ function(e) {
9899
9960
  }) : /* @__PURE__ */ f("p", {
9900
9961
  className: "body-1 loading-message text-neutrals-700",
9901
9962
  children: j?.loading
9902
- }) }), oe ? /* @__PURE__ */ f(rm, {
9963
+ }) }), se ? /* @__PURE__ */ f(om, {
9903
9964
  content: e.content,
9904
9965
  onCancel: Oe,
9905
9966
  onEditApply: ke,
@@ -9915,14 +9976,14 @@ var Zp = /* @__PURE__ */ function(e) {
9915
9976
  Ie,
9916
9977
  Le,
9917
9978
  !_e && !Ee && /* @__PURE__ */ f(Mr, {
9918
- choiceButtons: ce,
9979
+ choiceButtons: q,
9919
9980
  onClick: y
9920
9981
  })
9921
9982
  ]
9922
9983
  })]
9923
9984
  })
9924
9985
  });
9925
- }, am = ({ messages: e, isStreaming: n = !1, isReadOnly: r, conversationViewState: a, ...s }) => {
9986
+ }, cm = ({ messages: e, isStreaming: n = !1, isReadOnly: r, conversationViewState: a, ...s }) => {
9926
9987
  let { scrollBottomIcon: c } = Z(), d = l(null), m = l(null), { isOpenedAdvancedView: h } = kn(), _ = nu(), [v, y] = u(null), [b, x] = u(!1), S = _?.isPanelOpen() ?? !1, C = () => {
9927
9988
  let e = m.current?.parentElement, t = d.current;
9928
9989
  if (e && t) {
@@ -9967,7 +10028,7 @@ var Zp = /* @__PURE__ */ function(e) {
9967
10028
  target: "_blank",
9968
10029
  rel: "noopener noreferrer",
9969
10030
  className: "inline-flex items-center align-middle",
9970
- children: /* @__PURE__ */ f(oe, { className: "size-4 shrink-0 cursor-pointer text-primary" })
10031
+ children: /* @__PURE__ */ f(se, { className: "size-4 shrink-0 cursor-pointer text-primary" })
9971
10032
  }, n))
9972
10033
  }), []);
9973
10034
  return /* @__PURE__ */ p("div", {
@@ -9986,7 +10047,7 @@ var Zp = /* @__PURE__ */ function(e) {
9986
10047
  }, o);
9987
10048
  if (h && t.role === g.System) return null;
9988
10049
  let c = i === e.length - 1, l = Ys(e, i), u = Xs(e);
9989
- return /* @__PURE__ */ f(im, {
10050
+ return /* @__PURE__ */ f(sm, {
9990
10051
  message: t,
9991
10052
  previousMessage: l,
9992
10053
  onAdvancedViewOpen: w,
@@ -10009,7 +10070,7 @@ var Zp = /* @__PURE__ */ function(e) {
10009
10070
  })
10010
10071
  })]
10011
10072
  });
10012
- }, om = ({ conversationViewState: e, isAgentAvailable: t, statusMessages: n, isStreaming: r, isLastMessageFailed: i, regenerateLastMessage: a, inputMessageStyles: o, askAnythingTitle: s, onSendMessage: c, onStopStreaming: l }) => {
10073
+ }, lm = ({ conversationViewState: e, isAgentAvailable: t, statusMessages: n, isStreaming: r, isLastMessageFailed: i, regenerateLastMessage: a, inputMessageStyles: o, askAnythingTitle: s, onSendMessage: c, onStopStreaming: l }) => {
10013
10074
  if (e?.errorContext?.kind === ye.RATE_LIMIT && Ee(e.errorContext)) {
10014
10075
  let t = we(e.errorContext);
10015
10076
  if (t) {
@@ -10035,7 +10096,7 @@ var Zp = /* @__PURE__ */ function(e) {
10035
10096
  type: j.Error,
10036
10097
  children: n.assistantUnavailable
10037
10098
  });
10038
- }, sm = ({ conversation: e, locale: t, titles: n, messageStyles: r, attachmentsStyles: i, inputMessageStyles: a, formattingSettings: o, metadataSettings: s, messageActionsIcons: c, messageActionsTitles: l, editMessageTitles: u, expandStagesIcon: d, scrollBottomIcon: m, limitMessages: h, attachmentsConfig: g, shareConversationProps: _, showConversationHeaderAdvancedView: v = !0, headerRightSlot: y, dataQuery: x, isFinalMessage: S, children: C, isReadonlyConversation: w, isStreaming: T, isOpenedAdvancedView: E, isShowOnboarding: D, isAgentAvailable: O, statusMessages: k, conversationViewState: A, messageServerActions: j, sendMessageToConversation: M, regenerateMessage: N, editMessage: P, onStopStreaming: F, isLastMessageFailed: I, regenerateLastMessage: L, rateResponse: R, handleCodeAttachmentUpdated: z, duplicateConversation: B, handleOpeningOfNewConversation: ee }) => /* @__PURE__ */ f(Xn, {
10099
+ }, um = ({ conversation: e, locale: t, titles: n, messageStyles: r, attachmentsStyles: i, inputMessageStyles: a, formattingSettings: o, metadataSettings: s, messageActionsIcons: c, messageActionsTitles: l, editMessageTitles: u, expandStagesIcon: d, scrollBottomIcon: m, limitMessages: h, attachmentsConfig: g, shareConversationProps: _, showConversationHeaderAdvancedView: v = !0, headerRightSlot: y, dataQuery: x, isFinalMessage: S, children: C, isReadonlyConversation: w, isStreaming: T, isOpenedAdvancedView: E, isShowOnboarding: D, isAgentAvailable: O, statusMessages: k, conversationViewState: A, messageServerActions: j, sendMessageToConversation: M, regenerateMessage: N, editMessage: P, onStopStreaming: F, isLastMessageFailed: I, regenerateLastMessage: L, rateResponse: R, handleCodeAttachmentUpdated: z, duplicateConversation: B, handleOpeningOfNewConversation: ee }) => /* @__PURE__ */ f(Xn, {
10039
10100
  styles: {
10040
10101
  titles: n,
10041
10102
  messageStyles: r,
@@ -10065,7 +10126,7 @@ var Zp = /* @__PURE__ */ function(e) {
10065
10126
  children: [
10066
10127
  /* @__PURE__ */ f("div", {
10067
10128
  className: J("flex-1 min-h-0 flex flex-col items-end scroll-hidden-container", r?.messagesWrapperClass),
10068
- children: /* @__PURE__ */ f(am, {
10129
+ children: /* @__PURE__ */ f(cm, {
10069
10130
  messages: e?.messages || [],
10070
10131
  actions: j,
10071
10132
  isStreaming: T,
@@ -10096,7 +10157,7 @@ var Zp = /* @__PURE__ */ function(e) {
10096
10157
  })
10097
10158
  }) : /* @__PURE__ */ f("div", {
10098
10159
  className: J(a.inputContainerClass),
10099
- children: /* @__PURE__ */ f(om, {
10160
+ children: /* @__PURE__ */ f(lm, {
10100
10161
  conversationViewState: A,
10101
10162
  isAgentAvailable: O,
10102
10163
  statusMessages: k,
@@ -10124,28 +10185,28 @@ var Zp = /* @__PURE__ */ function(e) {
10124
10185
  }), !E && /* @__PURE__ */ f(ru, { scope: "conversation" })]
10125
10186
  })]
10126
10187
  })
10127
- }), cm = (e, t) => {
10188
+ }), dm = (e, t) => {
10128
10189
  let n = e.lastIndexOf(".");
10129
10190
  return n <= 0 ? `${e}-${t}` : `${e.slice(0, n)}-${t}${e.slice(n)}`;
10130
- }, lm = (e, t, n) => {
10191
+ }, fm = (e, t, n) => {
10131
10192
  let r = e.split("/");
10132
10193
  if (r[0] !== "files" || r.length < 3) return e;
10133
- let i = cm(r.at(-1) ?? "file", n);
10194
+ let i = dm(r.at(-1) ?? "file", n);
10134
10195
  return [
10135
10196
  "files",
10136
10197
  t,
10137
10198
  ...r.slice(2, -1),
10138
10199
  i
10139
10200
  ].join("/");
10140
- }, um = async ({ conversation: e, bucket: t, getFileBlob: n, putFile: r }) => {
10201
+ }, pm = async ({ conversation: e, bucket: t, getFileBlob: n, putFile: r }) => {
10141
10202
  let i = ze(e), a = Date.now();
10142
10203
  if (!i.length) return e;
10143
10204
  let o = await Promise.all(i.map(async (e) => {
10144
- let i = lm(e, t, `${a}`);
10205
+ let i = fm(e, t, `${a}`);
10145
10206
  return i === e || await r(i, await n(e)), [e, i];
10146
10207
  }));
10147
10208
  return We(e, Object.fromEntries(o));
10148
- }, dm = (e, t, n) => {
10209
+ }, mm = (e, t, n) => {
10149
10210
  let r = `${t}/${n}`, i = Ce({
10150
10211
  folderId: r,
10151
10212
  name: e?.name
@@ -10155,7 +10216,7 @@ var Zp = /* @__PURE__ */ function(e) {
10155
10216
  folderId: r,
10156
10217
  id: i
10157
10218
  };
10158
- }, fm = (e, t, n) => `/${t}${n}/${Be(e?.folderId, e?.id)}`, pm = ({ actions: e, conversation: t, locale: n, conversationsRoute: r, openUrl: a, setConversations: o }) => ({
10219
+ }, hm = (e, t, n) => `/${t}${n}/${Be(e?.folderId, e?.id)}`, gm = ({ actions: e, conversation: t, locale: n, conversationsRoute: r, openUrl: a, setConversations: o }) => ({
10159
10220
  handleOpeningOfNewConversation: i(() => {
10160
10221
  a(`/${n}${r}`);
10161
10222
  }, [
@@ -10165,13 +10226,13 @@ var Zp = /* @__PURE__ */ function(e) {
10165
10226
  ]),
10166
10227
  duplicateConversation: i(async () => {
10167
10228
  try {
10168
- let { bucket: i } = await e.getBucket(), s = dm(e.getFileBlob && e.putFile ? await um({
10229
+ let { bucket: i } = await e.getBucket(), s = mm(e.getFileBlob && e.putFile ? await pm({
10169
10230
  conversation: t,
10170
10231
  bucket: i,
10171
10232
  getFileBlob: e.getFileBlob,
10172
10233
  putFile: e.putFile
10173
10234
  }) : t, i, n);
10174
- await e.createConversation(s, n), o(Ie(await e.getConversations(n))), a(fm(s, n, r));
10235
+ await e.createConversation(s, n), o(Ie(await e.getConversations(n))), a(hm(s, n, r));
10175
10236
  } catch (e) {
10176
10237
  console.error("Failed to save conversation:", e);
10177
10238
  }
@@ -10183,7 +10244,7 @@ var Zp = /* @__PURE__ */ function(e) {
10183
10244
  a,
10184
10245
  o
10185
10246
  ])
10186
- }), mm = "local", hm = (e) => !e.permissions?.includes(_.WRITE) && !_m(e), gm = (e, t) => vm(e) !== t, _m = (e) => vm(e) === mm, vm = (e) => e.id.split("/")[0], ym = ({ conversationKey: e, actions: t, setConversation: n, setCrossDatasetAttachmentsState: r, sendMessageToConversation: i, onConversationNotFound: a }) => {
10247
+ }), _m = "local", vm = (e) => !e.permissions?.includes(_.WRITE) && !bm(e), ym = (e, t) => xm(e) !== t, bm = (e) => xm(e) === _m, xm = (e) => e.id.split("/")[0], Sm = ({ conversationKey: e, actions: t, setConversation: n, setCrossDatasetAttachmentsState: r, sendMessageToConversation: i, onConversationNotFound: a }) => {
10187
10248
  let [s, c] = u(!1), [l, d] = u(!0);
10188
10249
  return o(() => {
10189
10250
  aa(), r();
@@ -10191,7 +10252,7 @@ var Zp = /* @__PURE__ */ function(e) {
10191
10252
  try {
10192
10253
  d(!0);
10193
10254
  let { bucket: r } = await t.getBucket(), a = await t.getConversation(decodeURI(e));
10194
- n(a), c(hm(a) && gm(a, r)), (a.messages.length === 0 || a?.messages?.[0]?.role === g.Assistant && a?.messages?.length === 1) && i(a.prompt, a);
10255
+ n(a), c(vm(a) && ym(a, r)), (a.messages.length === 0 || a?.messages?.[0]?.role === g.Assistant && a?.messages?.length === 1) && i(a.prompt, a);
10195
10256
  } catch {
10196
10257
  c(!0), a?.();
10197
10258
  } finally {
@@ -10205,7 +10266,7 @@ var Zp = /* @__PURE__ */ function(e) {
10205
10266
  isLoading: l,
10206
10267
  isReadonlyConversation: s
10207
10268
  };
10208
- }, bm = ({ actions: e, conversationKey: t }) => i(async (n) => {
10269
+ }, Cm = ({ actions: e, conversationKey: t }) => i(async (n) => {
10209
10270
  try {
10210
10271
  await e.updateConversation(decodeURI(t), {
10211
10272
  name: n.name,
@@ -10215,7 +10276,7 @@ var Zp = /* @__PURE__ */ function(e) {
10215
10276
  } catch (e) {
10216
10277
  console.error("Failed to save conversation:", e);
10217
10278
  }
10218
- }, [e, t]), xm = "AbortError", Sm = (e, t) => {
10279
+ }, [e, t]), wm = "AbortError", Tm = (e, t) => {
10219
10280
  let n = e.customViewState ?? {}, r = n[ge] ?? {};
10220
10281
  return {
10221
10282
  ...e,
@@ -10227,7 +10288,7 @@ var Zp = /* @__PURE__ */ function(e) {
10227
10288
  }
10228
10289
  }
10229
10290
  };
10230
- }, Cm = ({ error: e, statusMessages: t }) => {
10291
+ }, Em = ({ error: e, statusMessages: t }) => {
10231
10292
  if (e) {
10232
10293
  if (e.type === ve.RATE_LIMIT_EXCEEDED) {
10233
10294
  let n = e.exceeded_limit?.length ? t.getExceededLimitsMessage(e.exceeded_limit) : e.display_message ?? "";
@@ -10249,7 +10310,7 @@ var Zp = /* @__PURE__ */ function(e) {
10249
10310
  code: e.code
10250
10311
  });
10251
10312
  }
10252
- }, wm = ({ error: e, statusMessages: t }) => {
10313
+ }, Dm = ({ error: e, statusMessages: t }) => {
10253
10314
  if (e.code === ve.RATE_LIMIT_EXCEEDED) {
10254
10315
  let t = e;
10255
10316
  return {
@@ -10258,29 +10319,29 @@ var Zp = /* @__PURE__ */ function(e) {
10258
10319
  };
10259
10320
  }
10260
10321
  return e.code === _e.CONTENT_FILTER ? { errorMessage: t.contentFilterError ?? e.message } : { errorMessage: e.status === je.SERVICE_UNAVAILABLE ? t.serverOverloaded : t.serverError };
10261
- }, Tm = (e) => {
10322
+ }, Om = (e) => {
10262
10323
  let t = {};
10263
10324
  return e.choices?.[0]?.delta?.content && (t.content = e.choices[0].delta.content), e.choices?.[0]?.delta?.custom_content && (t.custom_content = e.choices[0].delta.custom_content), e.choices?.[0]?.delta?.role && (t.role = e.choices[0].delta.role), e.id && (t.responseId = e.id), t;
10264
- }, Em = () => {
10325
+ }, km = () => {
10265
10326
  try {
10266
10327
  return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
10267
10328
  } catch {
10268
10329
  return "UTC";
10269
10330
  }
10270
- }, Dm = (e, t) => Om([...t?.messages || [], e]), Om = (e) => [...e].map((e) => {
10331
+ }, Am = (e, t) => jm([...t?.messages || [], e]), jm = (e) => [...e].map((e) => {
10271
10332
  let t = {
10272
10333
  role: e.role,
10273
10334
  content: e.content
10274
10335
  };
10275
- return (e.role === g.Assistant || e.role === g.System) && e.custom_content != null && (e.custom_content.state != null || e.custom_content.attachments != null || e.custom_content.form_schema != null) && (t.custom_content = {}, e.custom_content.state != null && (t.custom_content.state = e.custom_content.state), e.custom_content.attachments != null && (t.custom_content.attachments = jm(e.custom_content.attachments)), e.custom_content.form_schema != null && (t.custom_content.form_schema = e.custom_content.form_schema)), e.role === g.User && e.custom_content && (t.custom_content = e.custom_content), t;
10276
- }), km = (e, t) => {
10336
+ return (e.role === g.Assistant || e.role === g.System) && e.custom_content != null && (e.custom_content.state != null || e.custom_content.attachments != null || e.custom_content.form_schema != null) && (t.custom_content = {}, e.custom_content.state != null && (t.custom_content.state = e.custom_content.state), e.custom_content.attachments != null && (t.custom_content.attachments = Pm(e.custom_content.attachments)), e.custom_content.form_schema != null && (t.custom_content.form_schema = e.custom_content.form_schema)), e.role === g.User && e.custom_content && (t.custom_content = e.custom_content), t;
10337
+ }), Mm = (e, t) => {
10277
10338
  let n = t?.messages, r = n?.findIndex((t) => e.id === t.id);
10278
- return Om(n?.slice(0, r) || []);
10279
- }, Am = (e, t) => {
10339
+ return jm(n?.slice(0, r) || []);
10340
+ }, Nm = (e, t) => {
10280
10341
  let n = t?.messages, r = n?.findIndex((t) => e.id === t.id);
10281
- return Om([...n?.slice(0, r) || [], e]);
10342
+ return jm([...n?.slice(0, r) || [], e]);
10282
10343
  };
10283
- function jm(e) {
10344
+ function Pm(e) {
10284
10345
  return e.map((e) => ({
10285
10346
  type: e.type,
10286
10347
  title: e.title,
@@ -10292,7 +10353,7 @@ function jm(e) {
10292
10353
  }
10293
10354
  //#endregion
10294
10355
  //#region libs/conversation-view/src/utils/validate-message.ts
10295
- var Mm = (e, t, n, r) => {
10356
+ var Fm = (e, t, n, r) => {
10296
10357
  if (!n || t) return null;
10297
10358
  let i = {
10298
10359
  id: `msg-${Date.now()}`,
@@ -10301,12 +10362,12 @@ var Mm = (e, t, n, r) => {
10301
10362
  timestamp: Date.now()
10302
10363
  };
10303
10364
  return r && (i.custom_content = { form_value: { [r === Bn.COMPLETE ? zn.COMPLETION : zn.CHOICE]: r } }), i;
10304
- }, Nm = (e) => e?.name === xm, Pm = ({ conversation: e, setConversation: t, saveConversation: n, updateAssistantMessage: r, addUserMessageToConversation: a, initializeAssistantMessage: o, isStreaming: s, setIsStreaming: l, statusMessages: d, isCrossDatasetModeOn: f, token: p, handleInvalidStreaming: m }) => {
10365
+ }, Im = (e) => e?.name === wm, Lm = ({ conversation: e, setConversation: t, saveConversation: n, updateAssistantMessage: r, addUserMessageToConversation: a, initializeAssistantMessage: o, isStreaming: s, setIsStreaming: l, statusMessages: d, isCrossDatasetModeOn: f, token: p, handleInvalidStreaming: m }) => {
10305
10366
  let [h, g] = u(null), _ = i((e, t) => {
10306
10367
  let n = d.serverError, i, a;
10307
10368
  if (He(e)) {
10308
10369
  a = e;
10309
- let t = wm({
10370
+ let t = Dm({
10310
10371
  error: e,
10311
10372
  statusMessages: d
10312
10373
  });
@@ -10335,7 +10396,7 @@ var Mm = (e, t, n, r) => {
10335
10396
  ...s,
10336
10397
  configuration: {
10337
10398
  ...s.configuration,
10338
- timezone: Em(),
10399
+ timezone: km(),
10339
10400
  ...f && { merge_python_code: !0 }
10340
10401
  }
10341
10402
  };
@@ -10343,18 +10404,18 @@ var Mm = (e, t, n, r) => {
10343
10404
  model: n.model,
10344
10405
  signal: i?.signal,
10345
10406
  onMessage: (e) => {
10346
- Cm({
10407
+ Em({
10347
10408
  error: e.error,
10348
10409
  statusMessages: d
10349
10410
  });
10350
- let t = Tm(e);
10411
+ let t = Om(e);
10351
10412
  (t.content || t.role || t.responseId) && (a = r(a, t));
10352
10413
  },
10353
10414
  onError: (e) => {
10354
- if (!Nm(e)) throw console.error("Streaming error:", e), e;
10415
+ if (!Im(e)) throw console.error("Streaming error:", e), e;
10355
10416
  }
10356
10417
  }, p, c).catch((e) => {
10357
- if (!Nm(e)) {
10418
+ if (!Im(e)) {
10358
10419
  let { assistantMessage: t, errorContext: n } = _(e, a);
10359
10420
  a = t, o = n;
10360
10421
  }
@@ -10370,14 +10431,14 @@ var Mm = (e, t, n, r) => {
10370
10431
  f
10371
10432
  ]), y = i(async (e, t, r, i) => {
10372
10433
  if (!t) return;
10373
- let a = Sm(t, i);
10434
+ let a = Tm(t, i);
10374
10435
  a = {
10375
10436
  ...a,
10376
10437
  messages: [...t.messages],
10377
10438
  updatedAt: Date.now()
10378
10439
  }, r && a.messages.push(r), a.messages.push(e), await n(a);
10379
10440
  }, [n]), b = i((e) => {
10380
- t((t) => t && Sm(t, e));
10441
+ t((t) => t && Tm(t, e));
10381
10442
  }, [t]), x = i((e, n) => {
10382
10443
  t((e) => e ? {
10383
10444
  ...e,
@@ -10386,15 +10447,15 @@ var Mm = (e, t, n, r) => {
10386
10447
  }, [t]), S = i(() => {
10387
10448
  h && !h.signal.aborted && h.abort();
10388
10449
  }, [h]), C = i(async (e, t, n, r, i, a = !0) => {
10389
- Nm(i) ? await y(r ?? n, e, a ? t : void 0) : x(i, t);
10450
+ Im(i) ? await y(r ?? n, e, a ? t : void 0) : x(i, t);
10390
10451
  }, [y, x]), w = i(async (e, t, n) => {
10391
10452
  if (!t || !e) return;
10392
- let r = Mm(e, s, t, n), i, c;
10453
+ let r = Fm(e, s, t, n), i, c;
10393
10454
  if (r) {
10394
10455
  a(r);
10395
10456
  try {
10396
10457
  l(!0), i = o();
10397
- let e = Dm(r, t), { assistantMessage: n, errorContext: a } = await v(i, e, t);
10458
+ let e = Am(r, t), { assistantMessage: n, errorContext: a } = await v(i, e, t);
10398
10459
  b(a), c = n, await y(c, t, r, a);
10399
10460
  } catch (e) {
10400
10461
  C(t, r, i, c, e);
@@ -10431,7 +10492,7 @@ var Mm = (e, t, n, r) => {
10431
10492
  b
10432
10493
  ]), E = i(async (e, n) => {
10433
10494
  if (!n || !e) return;
10434
- let r = km(e, n), i = {
10495
+ let r = Mm(e, n), i = {
10435
10496
  ...n,
10436
10497
  messages: n.messages.slice(0, r.length)
10437
10498
  };
@@ -10441,7 +10502,7 @@ var Mm = (e, t, n, r) => {
10441
10502
  } : null), T(r, i, e);
10442
10503
  }, [t, T]), D = i(async (e, n) => {
10443
10504
  if (!n || !e) return;
10444
- let r = Am(e, n), i = {
10505
+ let r = Nm(e, n), i = {
10445
10506
  ...n,
10446
10507
  messages: [...n.messages.slice(0, r.length - 1), e]
10447
10508
  };
@@ -10464,10 +10525,10 @@ var Mm = (e, t, n, r) => {
10464
10525
  isLastMessageFailed: O,
10465
10526
  regenerateLastMessage: k
10466
10527
  };
10467
- }, Fm = ({ actions: e, conversation: t, setConversation: n, saveConversation: r }) => ({
10528
+ }, Rm = ({ actions: e, conversation: t, setConversation: n, saveConversation: r }) => ({
10468
10529
  handleCodeAttachmentUpdated: i((e, i) => {
10469
10530
  if (!t) return;
10470
- let a = Sp(t.messages, i, e);
10531
+ let a = Tp(t.messages, i, e);
10471
10532
  if (!a) return;
10472
10533
  let o = {
10473
10534
  ...t,
@@ -10486,7 +10547,7 @@ var Mm = (e, t, n, r) => {
10486
10547
  t,
10487
10548
  r
10488
10549
  ])
10489
- }), Im = ({ setConversation: e }) => ({
10550
+ }), zm = ({ setConversation: e }) => ({
10490
10551
  addUserMessageToConversation: i((t) => {
10491
10552
  e((e) => e ? {
10492
10553
  ...e,
@@ -10512,7 +10573,7 @@ var Mm = (e, t, n, r) => {
10512
10573
  messages: e.messages.map((e) => e.id === t.id ? { ...r } : e)
10513
10574
  } : null), r;
10514
10575
  }, [e])
10515
- }), Lm = ({ actions: e }) => {
10576
+ }), Bm = ({ actions: e }) => {
10516
10577
  let { isOpenedAdvancedView: t } = kn(), { onboardingFileSchema: n, onboardingFilePath: r, onboardingFileName: i, setOnboardingFileSchema: a } = Rn();
10517
10578
  o(() => {
10518
10579
  n && e.putOnboardingFile?.(i, r, n);
@@ -10529,13 +10590,13 @@ var Mm = (e, t, n, r) => {
10529
10590
  a,
10530
10591
  n
10531
10592
  ]);
10532
- }, Rm = (e) => {
10533
- let { conversationKey: t, conversation: n, actions: r, locale: i, conversationsRoute: a, token: o, handleInvalidStreaming: s, onConversationNotFound: l, setConversation: u, setConversations: d, openUrl: f } = e, { isStreaming: p, setIsStreaming: m } = Mn(), { isOpenedAdvancedView: h } = kn(), { setCrossDatasetAttachmentsState: g } = Gp(), { isCrossDatasetModeOn: _ } = Bi(), { isAgentAvailable: v } = W(), { statusMessages: y } = Fn(), { isShowOnboarding: b } = Rn();
10534
- Lm({ actions: r });
10535
- let x = bm({
10593
+ }, Vm = (e) => {
10594
+ let { conversationKey: t, conversation: n, actions: r, locale: i, conversationsRoute: a, token: o, handleInvalidStreaming: s, onConversationNotFound: l, setConversation: u, setConversations: d, openUrl: f } = e, { isStreaming: p, setIsStreaming: m } = Mn(), { isOpenedAdvancedView: h } = kn(), { setCrossDatasetAttachmentsState: g } = Jp(), { isCrossDatasetModeOn: _ } = Bi(), { isAgentAvailable: v } = W(), { statusMessages: y } = Fn(), { isShowOnboarding: b } = Rn();
10595
+ Bm({ actions: r });
10596
+ let x = Cm({
10536
10597
  actions: r,
10537
10598
  conversationKey: t
10538
- }), { addUserMessageToConversation: S, initializeAssistantMessage: C, updateAssistantMessage: w } = Im({ setConversation: u }), { sendMessageToConversation: T, regenerateMessage: E, editMessage: D, onStopStreaming: O, isLastMessageFailed: k, regenerateLastMessage: A } = Pm({
10599
+ }), { addUserMessageToConversation: S, initializeAssistantMessage: C, updateAssistantMessage: w } = zm({ setConversation: u }), { sendMessageToConversation: T, regenerateMessage: E, editMessage: D, onStopStreaming: O, isLastMessageFailed: k, regenerateLastMessage: A } = Lm({
10539
10600
  conversation: n,
10540
10601
  setConversation: u,
10541
10602
  saveConversation: x,
@@ -10548,19 +10609,19 @@ var Mm = (e, t, n, r) => {
10548
10609
  isCrossDatasetModeOn: _,
10549
10610
  token: o,
10550
10611
  handleInvalidStreaming: s
10551
- }), { rateResponse: j, handleCodeAttachmentUpdated: M } = Fm({
10612
+ }), { rateResponse: j, handleCodeAttachmentUpdated: M } = Rm({
10552
10613
  actions: r,
10553
10614
  conversation: n,
10554
10615
  setConversation: u,
10555
10616
  saveConversation: x
10556
- }), { duplicateConversation: N, handleOpeningOfNewConversation: P } = pm({
10617
+ }), { duplicateConversation: N, handleOpeningOfNewConversation: P } = gm({
10557
10618
  actions: r,
10558
10619
  conversation: n,
10559
10620
  locale: i,
10560
10621
  conversationsRoute: a,
10561
10622
  openUrl: f,
10562
10623
  setConversations: d
10563
- }), { isLoading: F, isReadonlyConversation: I } = ym({
10624
+ }), { isLoading: F, isReadonlyConversation: I } = Sm({
10564
10625
  conversationKey: t,
10565
10626
  actions: r,
10566
10627
  setConversation: u,
@@ -10599,13 +10660,13 @@ var Mm = (e, t, n, r) => {
10599
10660
  duplicateConversation: N,
10600
10661
  handleOpeningOfNewConversation: P
10601
10662
  };
10602
- }, zm = (e) => {
10603
- let t = Rm(e);
10604
- return t.isLoading ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ f(sm, {
10663
+ }, Hm = (e) => {
10664
+ let t = Vm(e);
10665
+ return t.isLoading ? /* @__PURE__ */ f(F, {}) : /* @__PURE__ */ f(um, {
10605
10666
  ...e,
10606
10667
  ...t
10607
10668
  });
10608
- }, Bm = ({ conversationName: e, expandTitle: t, expandIcon: n, onExpand: r }) => /* @__PURE__ */ p("div", {
10669
+ }, Um = ({ conversationName: e, expandTitle: t, expandIcon: n, onExpand: r }) => /* @__PURE__ */ p("div", {
10609
10670
  className: "flex h-full w-[51px] shrink-0 flex-col items-center border border-neutrals-400 bg-white",
10610
10671
  children: [/* @__PURE__ */ f("button", {
10611
10672
  type: "button",
@@ -10624,4 +10685,4 @@ var Mm = (e, t, n, r) => {
10624
10685
  })]
10625
10686
  });
10626
10687
  //#endregion
10627
- export { Kp as AdvancedView, On as AdvancedViewProvider, Bd as AttachmentRenderer, Bn as CUSTOM_CHOICE_ID, Hn as ChartingIcon, Fr as ChatFooter, jn as ChatMessagesProvider, Pr as ChatOnboardingFooter, Bm as CollapsedChatPanel, zm as ConversationView, zi as ConversationViewFeatureTogglesProvider, Pn as ConversationViewMessagesProvider, ru as ConversationViewSidePanelOutlet, eu as ConversationViewSidePanelProvider, Xn as ConversationViewStylesProvider, Ir as ConversationWelcome, Wp as CrossDatasetAttachmentsProvider, Pd as CrossDatasetGridAttachment, $u as CrossDatasetGridViewMode, Vu as CustomChartAttachment, zn as CustomContentProperties, bu as CustomDataGridAttachment, su as DatasetDimensionsMetadataMapProvider, Ln as OnboardingProvider, Vn as STAGE_STATUS, Rp as buildCrossDatasetChartingData, Ip as buildCrossDatasetGridContent, Qf as isChartingDataPlottable, kn as useAdvancedView, Mn as useChatMessages, Bi as useConversationViewFeatureToggles, Fn as useConversationViewMessages, nu as useConversationViewSidePanelOptional, Z as useConversationViewStyles, Gp as useCrossDatasetAttachments, cu as useDatasetDimensionsMetadataMap, lu as useDatasetDimensionsMetadataMapOptional, Rn as useOnboarding };
10688
+ export { Yp as AdvancedView, On as AdvancedViewProvider, Ud as AttachmentRenderer, Bn as CUSTOM_CHOICE_ID, Hn as ChartingIcon, Fr as ChatFooter, jn as ChatMessagesProvider, Pr as ChatOnboardingFooter, Um as CollapsedChatPanel, Hm as ConversationView, zi as ConversationViewFeatureTogglesProvider, Pn as ConversationViewMessagesProvider, ru as ConversationViewSidePanelOutlet, eu as ConversationViewSidePanelProvider, Xn as ConversationViewStylesProvider, Ir as ConversationWelcome, qp as CrossDatasetAttachmentsProvider, Pd as CrossDatasetGridAttachment, $u as CrossDatasetGridViewMode, Vu as CustomChartAttachment, zn as CustomContentProperties, bu as CustomDataGridAttachment, su as DatasetDimensionsMetadataMapProvider, Ln as OnboardingProvider, Vn as STAGE_STATUS, Vp as buildCrossDatasetChartingData, zp as buildCrossDatasetGridContent, tp as isChartingDataPlottable, kn as useAdvancedView, Mn as useChatMessages, Bi as useConversationViewFeatureToggles, Fn as useConversationViewMessages, nu as useConversationViewSidePanelOptional, Z as useConversationViewStyles, Jp as useCrossDatasetAttachments, cu as useDatasetDimensionsMetadataMap, lu as useDatasetDimensionsMetadataMapOptional, Rn as useOnboarding };