@streamoid/agent 0.5.14 → 0.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +179 -172
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10653,8 +10653,8 @@ function compiler$1(e) {
10653
10653
  link: l(Un),
10654
10654
  listItem: l(Xn),
10655
10655
  listItemValue: R,
10656
- listOrdered: l(Gn, E),
10657
- listUnordered: l(Gn),
10656
+ listOrdered: l(Hn, E),
10657
+ listUnordered: l(Hn),
10658
10658
  paragraph: l(Qn),
10659
10659
  reference: _e,
10660
10660
  referenceString: c,
@@ -11092,7 +11092,7 @@ function compiler$1(e) {
11092
11092
  children: []
11093
11093
  };
11094
11094
  }
11095
- function Gn(Pt) {
11095
+ function Hn(Pt) {
11096
11096
  return {
11097
11097
  type: "list",
11098
11098
  ordered: Pt.type === "listOrdered",
@@ -23922,8 +23922,8 @@ function compiler(e) {
23922
23922
  link: l(Un),
23923
23923
  listItem: l(Xn),
23924
23924
  listItemValue: R,
23925
- listOrdered: l(Gn, E),
23926
- listUnordered: l(Gn),
23925
+ listOrdered: l(Hn, E),
23926
+ listUnordered: l(Hn),
23927
23927
  paragraph: l(Qn),
23928
23928
  reference: _e,
23929
23929
  referenceString: c,
@@ -24361,7 +24361,7 @@ function compiler(e) {
24361
24361
  children: []
24362
24362
  };
24363
24363
  }
24364
- function Gn(Pt) {
24364
+ function Hn(Pt) {
24365
24365
  return {
24366
24366
  type: "list",
24367
24367
  ordered: Pt.type === "listOrdered",
@@ -35273,7 +35273,7 @@ function requireJsuites() {
35273
35273
  }, Ze;
35274
35274
  }
35275
35275
  var Un = Vn();
35276
- function Gn(Ze, it) {
35276
+ function Hn(Ze, it) {
35277
35277
  var Pe = {};
35278
35278
  Pe.options = {};
35279
35279
  var je = {
@@ -35896,7 +35896,7 @@ function requireJsuites() {
35896
35896
  notification: Un,
35897
35897
  palette: Je,
35898
35898
  picker: Ge,
35899
- progressbar: Gn,
35899
+ progressbar: Hn,
35900
35900
  rating: Xn,
35901
35901
  search: Qn,
35902
35902
  slider: Jn,
@@ -37925,7 +37925,7 @@ function requireDist$1() {
37925
37925
  function Un(z) {
37926
37926
  return [M, I, T, F, P, R].indexOf(z) >= 0 || typeof z == "number" && (isNaN(z) || !isFinite(z));
37927
37927
  }
37928
- function Gn(z) {
37928
+ function Hn(z) {
37929
37929
  return Un(z) || z === Z;
37930
37930
  }
37931
37931
  function Xn(z) {
@@ -39392,7 +39392,7 @@ function requireDist$1() {
39392
39392
  }, h.HYPGEOM = Ct, h.HYPGEOMDIST = Lu, h.IF = function(z, ee, Fe) {
39393
39393
  return z instanceof Error ? z : ((ee = !(arguments.length >= 2) || ee) == null && (ee = 0), (Fe = arguments.length === 3 && Fe) == null && (Fe = 0), z ? ee : Fe);
39394
39394
  }, h.IFERROR = function(z, ee) {
39395
- return Gn(z) ? ee : z;
39395
+ return Hn(z) ? ee : z;
39396
39396
  }, h.IFNA = function(z, ee) {
39397
39397
  return z === Z ? ee : z;
39398
39398
  }, h.IFS = function() {
@@ -39514,7 +39514,7 @@ function requireDist$1() {
39514
39514
  return Yn;
39515
39515
  }, h.ISBLANK = function(z) {
39516
39516
  return z === null;
39517
- }, h.ISERR = Un, h.ISERROR = Gn, h.ISEVEN = function(z) {
39517
+ }, h.ISERR = Un, h.ISERROR = Hn, h.ISEVEN = function(z) {
39518
39518
  return !(1 & Math.floor(Math.abs(z)));
39519
39519
  }, h.ISFORMULA = function() {
39520
39520
  throw new Error("ISFORMULA is not implemented");
@@ -39638,7 +39638,7 @@ function requireDist$1() {
39638
39638
  }, h.MUNIT = function(z) {
39639
39639
  return arguments.length > 1 ? Z : !(z = parseInt(z)) || z <= 0 ? M : Array(z).fill(0).map((() => Array(z).fill(0))).map(((ee, Fe) => (ee[Fe] = 1, ee)));
39640
39640
  }, h.N = function(z) {
39641
- return Qn(z) ? z : z instanceof Date ? z.getTime() : z === !0 ? 1 : z === !1 ? 0 : Gn(z) ? z : 0;
39641
+ return Qn(z) ? z : z instanceof Date ? z.getTime() : z === !0 ? 1 : z === !1 ? 0 : Hn(z) ? z : 0;
39642
39642
  }, h.NA = function() {
39643
39643
  return Z;
39644
39644
  }, h.NEGBINOM = Mn, h.NEGBINOMDIST = Zc, h.NETWORKDAYS = Po, h.NETWORKDAYSINTL = wo, h.NOMINAL = function(z, ee) {
@@ -40064,7 +40064,7 @@ function requireDist$1() {
40064
40064
  }, h.TRUNC = function(z, ee) {
40065
40065
  return tt(z = _e(z), ee = _e(ee)) || (z > 0 ? 1 : -1) * Math.floor(Math.abs(z) * Math.pow(10, ee)) / Math.pow(10, ee);
40066
40066
  }, h.TTEST = Pu, h.TYPE = function(z) {
40067
- return Qn(z) ? 1 : Jn(z) ? 2 : Xn(z) ? 4 : Gn(z) ? 16 : Array.isArray(z) ? 64 : void 0;
40067
+ return Qn(z) ? 1 : Jn(z) ? 2 : Xn(z) ? 4 : Hn(z) ? 16 : Array.isArray(z) ? 64 : void 0;
40068
40068
  }, h.UNICHAR = yl, h.UNICODE = Ki, h.UNIQUE = Sn, h.UPPER = function(z) {
40069
40069
  return (z = pt(z)) instanceof Error ? z : z.toUpperCase();
40070
40070
  }, h.VALUE = function(z) {
@@ -44972,7 +44972,7 @@ var CRC32 = /* @__PURE__ */ (function() {
44972
44972
  var vt = et & 7, ct = et >>> 3;
44973
44973
  return vt <= 5 ? Oe[ct] |= (st & 7) << vt : (Oe[ct] |= st << vt & 255, Oe[ct + 1] = (st & 7) >> 8 - vt), et + 3;
44974
44974
  }
44975
- function Gn(Oe, et, st) {
44975
+ function Hn(Oe, et, st) {
44976
44976
  var vt = et & 7, ct = et >>> 3;
44977
44977
  return st = (st & 1) << vt, Oe[ct] |= st, et + 1;
44978
44978
  }
@@ -45079,7 +45079,7 @@ var CRC32 = /* @__PURE__ */ (function() {
45079
45079
  wn[In] = Wt & 32767, In = (In << 5 ^ Mt[Wt]) & 32767, ++Wt;
45080
45080
  En -= sr - 1;
45081
45081
  } else
45082
- Tn <= 143 ? Tn = Tn + 48 : Ut = Gn(It, Ut, 1), Ut = Xn(It, Ut, At[Tn]), wn[In] = Wt & 32767, ++Wt;
45082
+ Tn <= 143 ? Tn = Tn + 48 : Ut = Hn(It, Ut, 1), Ut = Xn(It, Ut, At[Tn]), wn[In] = Wt & 32767, ++Wt;
45083
45083
  }
45084
45084
  Ut = Xn(It, Ut, 0) - 1;
45085
45085
  }
@@ -50078,9 +50078,9 @@ var WK_ = /* @__PURE__ */ (function() {
50078
50078
  /* NUMBER */
50079
50079
  case 16:
50080
50080
  Un == 14 && (on[2] & 112) == 112 && (on[2] & 15) > 1 && (on[2] & 15) < 15 && (on[1].z = at.dateNF || table_fmt[14], at.cellDates && (on[1].t = "d", on[1].v = numdate(on[1].v))), at.qpro && on[3] > Et && (pt["!ref"] = encode_range(xt), bt[St] = pt, At.push(St), pt = at.dense ? [] : {}, xt = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } }, Et = on[3], St = wt || "Sheet" + (Et + 1), wt = "");
50081
- var Gn = at.dense ? (pt[on[0].r] || [])[on[0].c] : pt[encode_cell(on[0])];
50082
- if (Gn) {
50083
- Gn.t = on[1].t, Gn.v = on[1].v, on[1].z != null && (Gn.z = on[1].z), on[1].f != null && (Gn.f = on[1].f);
50081
+ var Hn = at.dense ? (pt[on[0].r] || [])[on[0].c] : pt[encode_cell(on[0])];
50082
+ if (Hn) {
50083
+ Hn.t = on[1].t, Hn.v = on[1].v, on[1].z != null && (Hn.z = on[1].z), on[1].f != null && (Hn.f = on[1].f);
50084
50084
  break;
50085
50085
  }
50086
50086
  at.dense ? (pt[on[0].r] || (pt[on[0].r] = []), pt[on[0].r][on[0].c] = on[1]) : pt[encode_cell(on[0])] = on[1];
@@ -58663,8 +58663,8 @@ function parse_workbook(e, t) {
58663
58663
  if (Q = make_cell(xt.val, xt.cell.ixfe, xt.tt), Q.XF = Ne[Q.ixfe], t.cellFormula) {
58664
58664
  var Vn = xt.formula;
58665
58665
  if (Vn && Vn[0] && Vn[0][0] && Vn[0][0][0] == "PtgExp") {
58666
- var Un = Vn[0][0][1][0], Gn = Vn[0][0][1][1], Xn = encode_cell({ r: Un, c: Gn });
58667
- F[Xn] ? Q.f = "" + stringify_formula(xt.formula, c, xt.cell, ut, qe) : Q.F = ((t.dense ? (s[Un] || [])[Gn] : s[Xn]) || {}).F;
58666
+ var Un = Vn[0][0][1][0], Hn = Vn[0][0][1][1], Xn = encode_cell({ r: Un, c: Hn });
58667
+ F[Xn] ? Q.f = "" + stringify_formula(xt.formula, c, xt.cell, ut, qe) : Q.F = ((t.dense ? (s[Un] || [])[Hn] : s[Xn]) || {}).F;
58668
58668
  } else Q.f = "" + stringify_formula(xt.formula, c, xt.cell, ut, qe);
58669
58669
  }
58670
58670
  Ve > 0 && (Q.z = _e[Q.ixfe >> 8 & 63]), safe_format_xf(Q, t, n.opts.Date1904), He(xt.cell, Q, t), f = xt;
@@ -68135,7 +68135,7 @@ function DynamicForm(e) {
68135
68135
  } finally {
68136
68136
  Ie(!1);
68137
68137
  }
68138
- }, Gn = async (nt) => {
68138
+ }, Hn = async (nt) => {
68139
68139
  nt?.preventDefault(), Vn() && await Un(I, Ae);
68140
68140
  }, Xn = async () => {
68141
68141
  await Un(P ?? "Cancel", Ae);
@@ -68630,7 +68630,7 @@ function DynamicForm(e) {
68630
68630
  size: "md",
68631
68631
  text: I,
68632
68632
  onClick: () => {
68633
- Gn();
68633
+ Hn();
68634
68634
  }
68635
68635
  }
68636
68636
  )
@@ -68690,7 +68690,7 @@ function DynamicForm(e) {
68690
68690
  }
68691
68691
  )
68692
68692
  ] }),
68693
- /* @__PURE__ */ jsxs("form", { onSubmit: Gn, className: "flex flex-col", children: [
68693
+ /* @__PURE__ */ jsxs("form", { onSubmit: Hn, className: "flex flex-col", children: [
68694
68694
  Ze && /* @__PURE__ */ jsx("div", { className: "px-[24px] pt-[16px]", children: Ze }),
68695
68695
  /* @__PURE__ */ jsx("div", { className: "max-h-[40vh] overflow-y-auto", children: Rt }),
68696
68696
  ft
@@ -68715,7 +68715,7 @@ function DynamicForm(e) {
68715
68715
  }
68716
68716
  )
68717
68717
  ] }),
68718
- /* @__PURE__ */ jsxs("form", { onSubmit: Gn, className: "relative flex-1 min-h-0 flex flex-col", children: [
68718
+ /* @__PURE__ */ jsxs("form", { onSubmit: Hn, className: "relative flex-1 min-h-0 flex flex-col", children: [
68719
68719
  Ze && /* @__PURE__ */ jsx("div", { className: "px-3 sm:px-5 pb-2 flex-shrink-0", children: Ze }),
68720
68720
  /* @__PURE__ */ jsx("div", { className: `scroll-fade-top ${$t ? "" : "fade-hidden"}` }),
68721
68721
  /* @__PURE__ */ jsx(
@@ -69065,7 +69065,7 @@ function SpreadsheetField({
69065
69065
  }, [g, He, Je, E, pt]), Vn = on ? Object.keys(on).length : 0, Un = useMemo(
69066
69066
  () => `${He}:${gn.length}:${Bt.length}:${Je}:${Vn}`,
69067
69067
  [He, gn.length, Bt.length, Je, Vn]
69068
- ), Gn = useMemo(
69068
+ ), Hn = useMemo(
69069
69069
  () => ({ current: null }),
69070
69070
  [ke, Un]
69071
69071
  ), Xn = useMemo(
@@ -69147,7 +69147,7 @@ function SpreadsheetField({
69147
69147
  }
69148
69148
  )
69149
69149
  ] }), jn = (mn, Ze) => {
69150
- const it = mn === "preview", Pe = it ? Xn : Gn, je = ke === "compact" ? "spreadsheet-density-compact" : "spreadsheet-density-comfortable";
69150
+ const it = mn === "preview", Pe = it ? Xn : Hn, je = ke === "compact" ? "spreadsheet-density-compact" : "spreadsheet-density-comfortable";
69151
69151
  return gn.length ? /* @__PURE__ */ jsxs(
69152
69152
  "div",
69153
69153
  {
@@ -81085,7 +81085,7 @@ function SelectProducts({
81085
81085
  try {
81086
81086
  const Vn = await fetchRequiredFields(t);
81087
81087
  if (Vn?.status?.code !== 0 || !Vn.data) return;
81088
- const { columns: Un, allowedValues: Gn } = buildFromRequiredFields(Vn.data), Xn = new Set(DEFAULT_COLUMNS.map((Jn) => Jn.value)), Qn = Un.filter((Jn) => !Xn.has(Jn.value));
81088
+ const { columns: Un, allowedValues: Hn } = buildFromRequiredFields(Vn.data), Xn = new Set(DEFAULT_COLUMNS.map((Jn) => Jn.value)), Qn = Un.filter((Jn) => !Xn.has(Jn.value));
81089
81089
  Qn.length > 0 && (P((Jn) => {
81090
81090
  const Sn = new Set(Jn.map((Pt) => Pt.value)), nr = Qn.filter((Pt) => !Sn.has(Pt.value));
81091
81091
  return nr.length > 0 ? [...Jn, ...nr] : Jn;
@@ -81094,7 +81094,7 @@ function SelectProducts({
81094
81094
  for (const nr of Qn)
81095
81095
  !CORE_COLUMN_VALUES.has(nr.value) && Sn[nr.value] === void 0 && (Sn[nr.value] = !1);
81096
81096
  return Sn;
81097
- })), Z((Jn) => mergeAllowedValues(Jn, Gn));
81097
+ })), Z((Jn) => mergeAllowedValues(Jn, Hn));
81098
81098
  } catch (Vn) {
81099
81099
  console.error("Failed to fetch required fields:", Vn);
81100
81100
  } finally {
@@ -81105,12 +81105,12 @@ function SelectProducts({
81105
81105
  const At = useCallback(
81106
81106
  async (Vn = 1) => {
81107
81107
  if (!t) return;
81108
- const Un = ++bt.current, Gn = buildFieldsFromColumns(I, DEFAULT_SOURCE_MP), Xn = buildFiltersFromFields(Gn), Qn = (Vn - 1) * PRODUCTS_PER_PAGE;
81108
+ const Un = ++bt.current, Hn = buildFieldsFromColumns(I, DEFAULT_SOURCE_MP), Xn = buildFiltersFromFields(Hn), Qn = (Vn - 1) * PRODUCTS_PER_PAGE;
81109
81109
  R(!0);
81110
81110
  try {
81111
81111
  const Jn = await searchProducts({
81112
81112
  storeId: t,
81113
- fields: Gn,
81113
+ fields: Hn,
81114
81114
  filters: Xn,
81115
81115
  start: Qn,
81116
81116
  rows: PRODUCTS_PER_PAGE
@@ -81140,8 +81140,8 @@ function SelectProducts({
81140
81140
  !t || !Ke || At(Ne);
81141
81141
  }, [t, Ne, Ke]);
81142
81142
  const Ht = useCallback(
81143
- async (Vn, Un, Gn, Xn) => {
81144
- const Qn = Gn === "required" ? "product" : Gn, Jn = Vn.product_code, Sn = Vn.product_uuid;
81143
+ async (Vn, Un, Hn, Xn) => {
81144
+ const Qn = Hn === "required" ? "product" : Hn, Jn = Vn.product_code, Sn = Vn.product_uuid;
81145
81145
  if (!Jn || !Sn)
81146
81146
  throw new Error("Missing product code or UUID");
81147
81147
  await updateProduct({
@@ -81174,7 +81174,7 @@ function SelectProducts({
81174
81174
  new Set(gn.map((Qn) => Qn.product_uuid).filter(Boolean))
81175
81175
  ), Un = Array.from(
81176
81176
  new Set(gn.map((Qn) => Qn.product_code).filter(Boolean))
81177
- ), Gn = h ? { product_uuids: Vn } : { product_codes: Un }, Xn = {
81177
+ ), Hn = h ? { product_uuids: Vn } : { product_codes: Un }, Xn = {
81178
81178
  product_uuids: Vn,
81179
81179
  product_codes: Un,
81180
81180
  workspaceId: e,
@@ -81191,7 +81191,7 @@ function SelectProducts({
81191
81191
  {},
81192
81192
  // filters
81193
81193
  h,
81194
- Gn,
81194
+ Hn,
81195
81195
  Xn
81196
81196
  );
81197
81197
  Qn?.submitted && (at(!0), St(Qn.submittedValues ?? Xn));
@@ -81213,7 +81213,7 @@ function SelectProducts({
81213
81213
  }));
81214
81214
  }, []);
81215
81215
  if (_e) {
81216
- const Vn = pt, Un = Array.isArray(Vn?.product_uuids) ? Vn.product_uuids : [], Gn = Array.isArray(Vn?.product_codes) ? Vn.product_codes : [], Xn = Un.length || Gn.length;
81216
+ const Vn = pt, Un = Array.isArray(Vn?.product_uuids) ? Vn.product_uuids : [], Hn = Array.isArray(Vn?.product_codes) ? Vn.product_codes : [], Xn = Un.length || Hn.length;
81217
81217
  return /* @__PURE__ */ jsx("div", { className: "w-fit max-w-full py-2 animate-in fade-in duration-300", children: /* @__PURE__ */ jsxs("div", { className: "rounded-md border p-2.5 flex items-start gap-2 bg-emerald-50/50 border-emerald-200 dark:bg-muted/20 dark:border-border", children: [
81218
81218
  /* @__PURE__ */ jsx("div", { className: "mt-px text-emerald-500", children: /* @__PURE__ */ jsx(CircleCheckBig$1, { className: "w-4 h-4" }) }),
81219
81219
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
@@ -82942,7 +82942,7 @@ function EditFeed({
82942
82942
  }), He((Xe) => new Set(Xe).add(`${Rt}:${Lt}`));
82943
82943
  },
82944
82944
  []
82945
- ), [Un, Gn] = useState(null), [Xn, Qn] = useState(null), Jn = useRef(null), Sn = useRef(Un);
82945
+ ), [Un, Hn] = useState(null), [Xn, Qn] = useState(null), Jn = useRef(null), Sn = useRef(Un);
82946
82946
  useEffect(() => {
82947
82947
  Sn.current = Un;
82948
82948
  }, [Un]);
@@ -82953,10 +82953,10 @@ function EditFeed({
82953
82953
  at
82954
82954
  ]);
82955
82955
  const Pt = useCallback((Rt, Lt) => {
82956
- Gn({ col: Lt, anchorRow: Rt, focusRow: Rt });
82956
+ Hn({ col: Lt, anchorRow: Rt, focusRow: Rt });
82957
82957
  }, []), Kt = useCallback(
82958
82958
  (Rt, Lt) => {
82959
- Gn((ze) => !ze || ze.col !== Lt ? { col: Lt, anchorRow: Rt, focusRow: Rt } : { ...ze, focusRow: Rt });
82959
+ Hn((ze) => !ze || ze.col !== Lt ? { col: Lt, anchorRow: Rt, focusRow: Rt } : { ...ze, focusRow: Rt });
82960
82960
  },
82961
82961
  []
82962
82962
  ), pn = useCallback(
@@ -83009,7 +83009,7 @@ function EditFeed({
83009
83009
  const Gt = Tt - 1 - jt;
83010
83010
  Gt >= 0 && Vn(Gt, gt, Nn[jt]);
83011
83011
  }
83012
- return Gn({
83012
+ return Hn({
83013
83013
  col: gt,
83014
83014
  anchorRow: Zt,
83015
83015
  focusRow: Vt
@@ -83019,7 +83019,7 @@ function EditFeed({
83019
83019
  const Xt = computeFillValues(Mn, qn.length);
83020
83020
  return qn.forEach((un, Nn) => {
83021
83021
  Vn(un, gt, Xt[Nn]);
83022
- }), Gn({
83022
+ }), Hn({
83023
83023
  col: gt,
83024
83024
  anchorRow: Tt,
83025
83025
  focusRow: Zt
@@ -83060,7 +83060,7 @@ function EditFeed({
83060
83060
  else if (Lt.key === "ArrowLeft") ft = -1;
83061
83061
  else if (Lt.key === "ArrowRight") ft = 1;
83062
83062
  else if (Lt.key === "Escape") {
83063
- Lt.preventDefault(), Gn(null);
83063
+ Lt.preventDefault(), Hn(null);
83064
83064
  return;
83065
83065
  } else
83066
83066
  return;
@@ -83073,11 +83073,11 @@ function EditFeed({
83073
83073
  0,
83074
83074
  Math.min(nt, Un.focusRow + Xe)
83075
83075
  );
83076
- Gn({ ...Un, focusRow: Zt }), it(Zt, Un.col);
83076
+ Hn({ ...Un, focusRow: Zt }), it(Zt, Un.col);
83077
83077
  return;
83078
83078
  }
83079
83079
  const gt = Math.max(0, Math.min(dt, Ct + ft)), Tt = Ie[gt], Vt = Math.max(0, Math.min(nt, Un.focusRow + Xe));
83080
- Gn({ col: Tt, anchorRow: Vt, focusRow: Vt }), it(Vt, Tt);
83080
+ Hn({ col: Tt, anchorRow: Vt, focusRow: Vt }), it(Vt, Tt);
83081
83081
  };
83082
83082
  return window.addEventListener("keydown", Rt), () => window.removeEventListener("keydown", Rt);
83083
83083
  }, [Un, Ie, F.length, it]);
@@ -85434,7 +85434,7 @@ var catalogixManifest = [
85434
85434
  }
85435
85435
  }
85436
85436
  function T() {
85437
- var ze = Gn.A;
85437
+ var ze = Hn.A;
85438
85438
  return ze === null ? null : ze.getOwner();
85439
85439
  }
85440
85440
  function M() {
@@ -85675,7 +85675,7 @@ Your code should look like:
85675
85675
  throw ze._result;
85676
85676
  }
85677
85677
  function qe() {
85678
- var ze = Gn.H;
85678
+ var ze = Hn.H;
85679
85679
  return ze === null && console.error(
85680
85680
  `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
85681
85681
  1. You might have mismatching versions of React and the renderer (such as React DOM)
@@ -85685,7 +85685,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85685
85685
  ), ze;
85686
85686
  }
85687
85687
  function Je() {
85688
- Gn.asyncTransitions--;
85688
+ Hn.asyncTransitions--;
85689
85689
  }
85690
85690
  function Qe(ze) {
85691
85691
  if (it === null)
@@ -85715,7 +85715,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85715
85715
  ), Pe = Xe;
85716
85716
  }
85717
85717
  function Ke(ze, Xe, ft) {
85718
- var Ct = Gn.actQueue;
85718
+ var Ct = Hn.actQueue;
85719
85719
  if (Ct !== null)
85720
85720
  if (Ct.length !== 0)
85721
85721
  try {
@@ -85724,10 +85724,10 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85724
85724
  });
85725
85725
  return;
85726
85726
  } catch (nt) {
85727
- Gn.thrownErrors.push(nt);
85727
+ Hn.thrownErrors.push(nt);
85728
85728
  }
85729
- else Gn.actQueue = null;
85730
- 0 < Gn.thrownErrors.length ? (Ct = ot(Gn.thrownErrors), Gn.thrownErrors.length = 0, ft(Ct)) : Xe(ze);
85729
+ else Hn.actQueue = null;
85730
+ 0 < Hn.thrownErrors.length ? (Ct = ot(Hn.thrownErrors), Hn.thrownErrors.length = 0, ft(Ct)) : Xe(ze);
85731
85731
  }
85732
85732
  function lt(ze) {
85733
85733
  if (!yt) {
@@ -85737,10 +85737,10 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85737
85737
  for (; Xe < ze.length; Xe++) {
85738
85738
  var ft = ze[Xe];
85739
85739
  do {
85740
- Gn.didUsePromise = !1;
85740
+ Hn.didUsePromise = !1;
85741
85741
  var Ct = ft(!1);
85742
85742
  if (Ct !== null) {
85743
- if (Gn.didUsePromise) {
85743
+ if (Hn.didUsePromise) {
85744
85744
  ze[Xe] = ft, ze.splice(0, Xe);
85745
85745
  return;
85746
85746
  }
@@ -85750,7 +85750,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85750
85750
  }
85751
85751
  ze.length = 0;
85752
85752
  } catch (nt) {
85753
- ze.splice(0, Xe + 1), Gn.thrownErrors.push(nt);
85753
+ ze.splice(0, Xe + 1), Hn.thrownErrors.push(nt);
85754
85754
  } finally {
85755
85755
  yt = !1;
85756
85756
  }
@@ -85793,7 +85793,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85793
85793
  for (Lt in on)
85794
85794
  on.hasOwnProperty(Lt) && n(Lt, on[Lt]);
85795
85795
  c.prototype = l.prototype, on = f.prototype = new c(), on.constructor = f, vn(on, l.prototype), on.isPureReactComponent = !0;
85796
- var Vn = Array.isArray, Un = /* @__PURE__ */ Symbol.for("react.client.reference"), Gn = {
85796
+ var Vn = Array.isArray, Un = /* @__PURE__ */ Symbol.for("react.client.reference"), Hn = {
85797
85797
  H: null,
85798
85798
  A: null,
85799
85799
  T: null,
@@ -85872,17 +85872,17 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85872
85872
  return ze;
85873
85873
  }
85874
85874
  };
85875
- e.Activity = Ht, e.Children = Lt, e.Component = l, e.Fragment = $t, e.Profiler = _e, e.PureComponent = f, e.StrictMode = Ve, e.Suspense = wt, e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Gn, e.__COMPILER_RUNTIME = on, e.act = function(ze) {
85876
- var Xe = Gn.actQueue, ft = Pe;
85875
+ e.Activity = Ht, e.Children = Lt, e.Component = l, e.Fragment = $t, e.Profiler = _e, e.PureComponent = f, e.StrictMode = Ve, e.Suspense = wt, e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Hn, e.__COMPILER_RUNTIME = on, e.act = function(ze) {
85876
+ var Xe = Hn.actQueue, ft = Pe;
85877
85877
  Pe++;
85878
- var Ct = Gn.actQueue = Xe !== null ? Xe : [], nt = !1;
85878
+ var Ct = Hn.actQueue = Xe !== null ? Xe : [], nt = !1;
85879
85879
  try {
85880
85880
  var dt = ze();
85881
85881
  } catch (Vt) {
85882
- Gn.thrownErrors.push(Vt);
85882
+ Hn.thrownErrors.push(Vt);
85883
85883
  }
85884
- if (0 < Gn.thrownErrors.length)
85885
- throw tt(Xe, ft), ze = ot(Gn.thrownErrors), Gn.thrownErrors.length = 0, ze;
85884
+ if (0 < Hn.thrownErrors.length)
85885
+ throw tt(Xe, ft), ze = ot(Hn.thrownErrors), Hn.thrownErrors.length = 0, ze;
85886
85886
  if (dt !== null && typeof dt == "object" && typeof dt.then == "function") {
85887
85887
  var gt = dt;
85888
85888
  return Rt(function() {
@@ -85903,20 +85903,20 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85903
85903
  );
85904
85904
  });
85905
85905
  } catch (qn) {
85906
- Gn.thrownErrors.push(qn);
85906
+ Hn.thrownErrors.push(qn);
85907
85907
  }
85908
- if (0 < Gn.thrownErrors.length) {
85908
+ if (0 < Hn.thrownErrors.length) {
85909
85909
  var Mn = ot(
85910
- Gn.thrownErrors
85910
+ Hn.thrownErrors
85911
85911
  );
85912
- Gn.thrownErrors.length = 0, Zt(Mn);
85912
+ Hn.thrownErrors.length = 0, Zt(Mn);
85913
85913
  }
85914
85914
  } else Vt(hn);
85915
85915
  },
85916
85916
  function(hn) {
85917
- tt(Xe, ft), 0 < Gn.thrownErrors.length && (hn = ot(
85918
- Gn.thrownErrors
85919
- ), Gn.thrownErrors.length = 0), Zt(hn);
85917
+ tt(Xe, ft), 0 < Hn.thrownErrors.length && (hn = ot(
85918
+ Hn.thrownErrors
85919
+ ), Hn.thrownErrors.length = 0), Zt(hn);
85920
85920
  }
85921
85921
  );
85922
85922
  }
@@ -85927,11 +85927,11 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85927
85927
  nt || je || (je = !0, console.error(
85928
85928
  "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
85929
85929
  ));
85930
- }), Gn.actQueue = null), 0 < Gn.thrownErrors.length)
85931
- throw ze = ot(Gn.thrownErrors), Gn.thrownErrors.length = 0, ze;
85930
+ }), Hn.actQueue = null), 0 < Hn.thrownErrors.length)
85931
+ throw ze = ot(Hn.thrownErrors), Hn.thrownErrors.length = 0, ze;
85932
85932
  return {
85933
85933
  then: function(Vt, Zt) {
85934
- nt = !0, ft === 0 ? (Gn.actQueue = Ct, Qe(function() {
85934
+ nt = !0, ft === 0 ? (Hn.actQueue = Ct, Qe(function() {
85935
85935
  return Ke(
85936
85936
  Tt,
85937
85937
  Vt,
@@ -85947,7 +85947,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85947
85947
  }, e.cacheSignal = function() {
85948
85948
  return null;
85949
85949
  }, e.captureOwnerStack = function() {
85950
- var ze = Gn.getCurrentStack;
85950
+ var ze = Hn.getCurrentStack;
85951
85951
  return ze === null ? null : ze();
85952
85952
  }, e.cloneElement = function(ze, Xe, ft) {
85953
85953
  if (ze == null)
@@ -86025,7 +86025,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
86025
86025
  Ct,
86026
86026
  typeof ze == "function" ? ze.displayName || ze.name || "Unknown" : ze
86027
86027
  );
86028
- var Vt = 1e4 > Gn.recentlyCreatedOwnerStacks++;
86028
+ var Vt = 1e4 > Hn.recentlyCreatedOwnerStacks++;
86029
86029
  return Z(
86030
86030
  ze,
86031
86031
  nt,
@@ -86097,11 +86097,11 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
86097
86097
  }
86098
86098
  }), Xe;
86099
86099
  }, e.startTransition = function(ze) {
86100
- var Xe = Gn.T, ft = {};
86101
- ft._updatedFibers = /* @__PURE__ */ new Set(), Gn.T = ft;
86100
+ var Xe = Hn.T, ft = {};
86101
+ ft._updatedFibers = /* @__PURE__ */ new Set(), Hn.T = ft;
86102
86102
  try {
86103
- var Ct = ze(), nt = Gn.S;
86104
- nt !== null && nt(ft, Ct), typeof Ct == "object" && Ct !== null && typeof Ct.then == "function" && (Gn.asyncTransitions++, Ct.then(Je, Je), Ct.then(h, mn));
86103
+ var Ct = ze(), nt = Hn.S;
86104
+ nt !== null && nt(ft, Ct), typeof Ct == "object" && Ct !== null && typeof Ct.then == "function" && (Hn.asyncTransitions++, Ct.then(Je, Je), Ct.then(h, mn));
86105
86105
  } catch (dt) {
86106
86106
  mn(dt);
86107
86107
  } finally {
@@ -86109,7 +86109,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
86109
86109
  "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
86110
86110
  )), Xe !== null && ft.types !== null && (Xe.types !== null && Xe.types !== ft.types && console.error(
86111
86111
  "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
86112
- ), Xe.types = ft.types), Gn.T = Xe;
86112
+ ), Xe.types = ft.types), Hn.T = Xe;
86113
86113
  }
86114
86114
  }, e.unstable_useCacheRefresh = function() {
86115
86115
  return qe().useCacheRefresh();
@@ -86874,7 +86874,7 @@ Error generating stack: ` + te.message + `
86874
86874
  ` + te.stack;
86875
86875
  }
86876
86876
  }
86877
- var Gn = Object.prototype.hasOwnProperty, Xn = t.unstable_scheduleCallback, Qn = t.unstable_cancelCallback, Jn = t.unstable_shouldYield, Sn = t.unstable_requestPaint, nr = t.unstable_now, Pt = t.unstable_getCurrentPriorityLevel, Kt = t.unstable_ImmediatePriority, pn = t.unstable_UserBlockingPriority, jn = t.unstable_NormalPriority, mn = t.unstable_LowPriority, Ze = t.unstable_IdlePriority, it = t.log, Pe = t.unstable_setDisableYieldValue, je = null, yt = null;
86877
+ var Hn = Object.prototype.hasOwnProperty, Xn = t.unstable_scheduleCallback, Qn = t.unstable_cancelCallback, Jn = t.unstable_shouldYield, Sn = t.unstable_requestPaint, nr = t.unstable_now, Pt = t.unstable_getCurrentPriorityLevel, Kt = t.unstable_ImmediatePriority, pn = t.unstable_UserBlockingPriority, jn = t.unstable_NormalPriority, mn = t.unstable_LowPriority, Ze = t.unstable_IdlePriority, it = t.log, Pe = t.unstable_setDisableYieldValue, je = null, yt = null;
86878
86878
  function Rt(C) {
86879
86879
  if (typeof it == "function" && Pe(C), yt && typeof yt.setStrictMode == "function")
86880
86880
  try {
@@ -87144,7 +87144,7 @@ Error generating stack: ` + te.message + `
87144
87144
  "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
87145
87145
  ), Mi = {}, wi = {};
87146
87146
  function Cr(C) {
87147
- return Gn.call(wi, C) ? !0 : Gn.call(Mi, C) ? !1 : ur.test(C) ? wi[C] = !0 : (Mi[C] = !0, !1);
87147
+ return Hn.call(wi, C) ? !0 : Hn.call(Mi, C) ? !1 : ur.test(C) ? wi[C] = !0 : (Mi[C] = !0, !1);
87148
87148
  }
87149
87149
  function Ta(C, j, V) {
87150
87150
  if (Cr(j))
@@ -87913,7 +87913,7 @@ Error generating stack: ` + te.message + `
87913
87913
  if (V.length !== te.length) return !1;
87914
87914
  for (te = 0; te < V.length; te++) {
87915
87915
  var Be = V[te];
87916
- if (!Gn.call(j, Be) || !Kn(C[Be], j[Be]))
87916
+ if (!Hn.call(j, Be) || !Kn(C[Be], j[Be]))
87917
87917
  return !1;
87918
87918
  }
87919
87919
  return !0;
@@ -88046,10 +88046,10 @@ Error generating stack: ` + te.message + `
88046
88046
  va[Ea++] = C, va[Ea++] = j, va[Ea++] = V, va[Ea++] = te, oi |= te, C.lanes |= te, C = C.alternate, C !== null && (C.lanes |= te);
88047
88047
  }
88048
88048
  function Yt(C, j, V, te) {
88049
- return Ot(C, j, V, te), Hn(C);
88049
+ return Ot(C, j, V, te), Gn(C);
88050
88050
  }
88051
88051
  function rn(C, j) {
88052
- return Ot(C, null, null, j), Hn(C);
88052
+ return Ot(C, null, null, j), Gn(C);
88053
88053
  }
88054
88054
  function Wn(C, j, V) {
88055
88055
  C.lanes |= V;
@@ -88059,7 +88059,7 @@ Error generating stack: ` + te.message + `
88059
88059
  Ue.childLanes |= V, te = Ue.alternate, te !== null && (te.childLanes |= V), Ue.tag === 22 && (C = Ue.stateNode, C === null || C._visibility & 1 || (Be = !0)), C = Ue, Ue = Ue.return;
88060
88060
  return C.tag === 3 ? (Ue = C.stateNode, Be && j !== null && (Be = 31 - Lt(V), C = Ue.hiddenUpdates, te = C[Be], te === null ? C[Be] = [j] : te.push(j), j.lane = V | 536870912), Ue) : null;
88061
88061
  }
88062
- function Hn(C) {
88062
+ function Gn(C) {
88063
88063
  if (50 < df)
88064
88064
  throw df = 0, Bp = null, Error(s(185));
88065
88065
  for (var j = C.return; j !== null; )
@@ -88984,9 +88984,9 @@ Error generating stack: ` + te.message + `
88984
88984
  if (te === null) return null;
88985
88985
  if (te = te.shared, (oa & 2) !== 0) {
88986
88986
  var Be = te.pending;
88987
- return Be === null ? j.next = j : (j.next = Be.next, Be.next = j), te.pending = j, j = Hn(C), Wn(C, null, V), j;
88987
+ return Be === null ? j.next = j : (j.next = Be.next, Be.next = j), te.pending = j, j = Gn(C), Wn(C, null, V), j;
88988
88988
  }
88989
- return Ot(C, te, j, V), Hn(C);
88989
+ return Ot(C, te, j, V), Gn(C);
88990
88990
  }
88991
88991
  function du(C, j, V) {
88992
88992
  if (j = j.updateQueue, j !== null && (j = j.shared, (V & 4194048) !== 0)) {
@@ -96949,7 +96949,7 @@ Error generating stack: ` + rt.message + `
96949
96949
  Bt(d)
96950
96950
  ), Jt(d);
96951
96951
  }
96952
- function Gn(d) {
96952
+ function Hn(d) {
96953
96953
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u") return !1;
96954
96954
  var v = __REACT_DEVTOOLS_GLOBAL_HOOK__;
96955
96955
  if (v.isDisabled) return !0;
@@ -99877,7 +99877,7 @@ It can also happen if the client has a browser extension installed which messes
99877
99877
  d.actualDuration += v, d.selfBaseDuration = v, xs = -1;
99878
99878
  }
99879
99879
  }
99880
- function Hn(d) {
99880
+ function Gn(d) {
99881
99881
  if (0 <= xs) {
99882
99882
  var v = Ui() - xs;
99883
99883
  d.actualDuration += v, xs = -1;
@@ -106851,7 +106851,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
106851
106851
  N,
106852
106852
  v,
106853
106853
  Mu
106854
- ), (v.mode & Fr) !== wr && Hn(v), N !== null) {
106854
+ ), (v.mode & Fr) !== wr && Gn(v), N !== null) {
106855
106855
  Ur = N;
106856
106856
  return;
106857
106857
  }
@@ -106871,7 +106871,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
106871
106871
  return;
106872
106872
  }
106873
106873
  if ((d.mode & Fr) !== wr) {
106874
- Hn(d), N = d.actualDuration;
106874
+ Gn(d), N = d.actualDuration;
106875
106875
  for (var q = d.child; q !== null; )
106876
106876
  N += q.actualDuration, q = q.sibling;
106877
106877
  d.actualDuration = N;
@@ -113198,7 +113198,7 @@ Learn more: https://react.dev/warnings/version-mismatch`)
113198
113198
  currentDispatcherRef: $n,
113199
113199
  reconcilerVersion: "19.2.4"
113200
113200
  };
113201
- return d.overrideHookState = o_, d.overrideHookStateDeletePath = s_, d.overrideHookStateRenamePath = l_, d.overrideProps = c_, d.overridePropsDeletePath = u_, d.overridePropsRenamePath = d_, d.scheduleUpdate = f_, d.scheduleRetry = p_, d.setErrorHandler = h_, d.setSuspenseHandler = m_, d.scheduleRefresh = I, d.scheduleRoot = M, d.setRefreshHandler = P, d.getCurrentFiber = wa, Gn(d);
113201
+ return d.overrideHookState = o_, d.overrideHookStateDeletePath = s_, d.overrideHookStateRenamePath = l_, d.overrideProps = c_, d.overridePropsDeletePath = u_, d.overridePropsRenamePath = d_, d.scheduleUpdate = f_, d.scheduleRetry = p_, d.setErrorHandler = h_, d.setSuspenseHandler = m_, d.scheduleRefresh = I, d.scheduleRoot = M, d.setRefreshHandler = P, d.getCurrentFiber = wa, Hn(d);
113202
113202
  })() && Nu && window.top === window.self && (-1 < navigator.userAgent.indexOf("Chrome") && navigator.userAgent.indexOf("Edge") === -1 || -1 < navigator.userAgent.indexOf("Firefox"))) {
113203
113203
  var g_ = window.location.protocol;
113204
113204
  /^(https?|file):$/.test(g_) && console.info(
@@ -115863,7 +115863,7 @@ var ApiError = class extends Error {
115863
115863
  updateAdTemplate: on,
115864
115864
  deleteAdTemplate: Vn,
115865
115865
  addStylingCategory: Un,
115866
- updateStylingCategory: Gn,
115866
+ updateStylingCategory: Hn,
115867
115867
  deleteStylingCategory: Xn,
115868
115868
  addStylingItem: Qn,
115869
115869
  updateStylingItem: Jn,
@@ -116043,7 +116043,7 @@ var ApiError = class extends Error {
116043
116043
  updateAdTemplate: on,
116044
116044
  deleteAdTemplate: Vn,
116045
116045
  addStylingCategory: Un,
116046
- updateStylingCategory: Gn,
116046
+ updateStylingCategory: Hn,
116047
116047
  deleteStylingCategory: Xn,
116048
116048
  addStylingItem: Qn,
116049
116049
  updateStylingItem: Jn,
@@ -126093,7 +126093,7 @@ var import_react37 = __toESM(require_react(), 1), import_react_dom = __toESM(req
126093
126093
  const pn = new Map(Kt);
126094
126094
  return pn.delete(Pt), pn;
126095
126095
  });
126096
- }, Gn = (Pt) => {
126096
+ }, Hn = (Pt) => {
126097
126097
  const Kt = b.selectedGroupIds.size > 0 ? Array.from(b.selectedGroupIds) : b.activeGroupId ? [b.activeGroupId] : [];
126098
126098
  b.hasGroups && Kt.length > 0 ? Qe((pn) => {
126099
126099
  const jn = new Map(pn);
@@ -126153,7 +126153,7 @@ var import_react37 = __toESM(require_react(), 1), import_react_dom = __toESM(req
126153
126153
  onChange: bt,
126154
126154
  variant: "modal",
126155
126155
  showFavorites: !0,
126156
- onUpload: Gn,
126156
+ onUpload: Hn,
126157
126157
  onRemoveCustom: Xn,
126158
126158
  customUpload: tt || null
126159
126159
  }
@@ -126713,7 +126713,7 @@ var import_react37 = __toESM(require_react(), 1), import_react_dom = __toESM(req
126713
126713
  Jt?.age || ""
126714
126714
  ).length > 0, Un = (0, import_react51.useMemo)(() => new Set(
126715
126715
  Object.values(g).flat().filter((Xe) => Xe.isBackPose || Xe.name.toLowerCase().includes("back") || Xe.id.toLowerCase().includes("back")).map((Xe) => Xe.id)
126716
- ), [g]), Gn = (0, import_react51.useMemo)(() => {
126716
+ ), [g]), Hn = (0, import_react51.useMemo)(() => {
126717
126717
  const Xe = /* @__PURE__ */ new Set();
126718
126718
  return R || Un.forEach((ft) => Xe.add(ft)), Xe;
126719
126719
  }, [R, Un]), Xn = (0, import_react51.useMemo)(() => {
@@ -126955,7 +126955,7 @@ ${xt}`,
126955
126955
  modelAge: Jt?.age,
126956
126956
  variant: "modal",
126957
126957
  allowMultiSelect: !0,
126958
- disabledPoseIds: Gn
126958
+ disabledPoseIds: Hn
126959
126959
  }
126960
126960
  ) }),
126961
126961
  isValid: tt.size > 0
@@ -128110,7 +128110,7 @@ function DirectEditorHost({
128110
128110
  propIds: on = [],
128111
128111
  prompt: Vn = "",
128112
128112
  quality: Un,
128113
- ...Gn
128113
+ ...Hn
128114
128114
  } = xt, Xn = Ke.find((Pe) => Pe.id === gn), Qn = lt.find((Pe) => Pe.id === Bt), Jn = vn.map((Pe) => ut.find((je) => je.id === Pe)?.image).filter(Boolean), Sn = Jt.map((Pe) => Ge.find((je) => je.id === Pe)?.image).filter(Boolean), nr = on.map((Pe) => $t.find((je) => je.id === Pe)?.image).filter(Boolean), Pt = Jt.map((Pe) => {
128115
128115
  const je = Ge.find((yt) => yt.id === Pe);
128116
128116
  return je?.prompt || je?.name || "";
@@ -128127,7 +128127,7 @@ function DirectEditorHost({
128127
128127
  propsPrompt: Kt
128128
128128
  });
128129
128129
  _e({
128130
- ...Gn,
128130
+ ...Hn,
128131
128131
  modelId: gn,
128132
128132
  bgId: Bt,
128133
128133
  quality: Un,
@@ -128151,7 +128151,7 @@ function DirectEditorHost({
128151
128151
  ]
128152
128152
  ), pt = (0, import_react56.useCallback)(
128153
128153
  (xt) => {
128154
- const { selectedBgId: gn, propIds: Bt = [], customPrompt: vn = "", quality: Jt, ...on } = xt, Vn = lt.find((Pt) => Pt.id === gn), Un = Bt.map((Pt) => $t.find((Kt) => Kt.id === Pt)?.image).filter(Boolean), Gn = gn === CUSTOM_BG_ID, Xn = Vn ? isAllowedBgImage(Vn.name) : !1, Qn = Gn || Xn, Jn = tt("product-bg-change") || DEFAULT_BG_CHANGE_TEMPLATE, Sn = [Vn?.prompt, vn].filter(Boolean).join(" "), nr = Jn.replace("{{bgPrompt}}", Sn).replace("[BG PROMPT HERE]", Sn);
128154
+ const { selectedBgId: gn, propIds: Bt = [], customPrompt: vn = "", quality: Jt, ...on } = xt, Vn = lt.find((Pt) => Pt.id === gn), Un = Bt.map((Pt) => $t.find((Kt) => Kt.id === Pt)?.image).filter(Boolean), Hn = gn === CUSTOM_BG_ID, Xn = Vn ? isAllowedBgImage(Vn.name) : !1, Qn = Hn || Xn, Jn = tt("product-bg-change") || DEFAULT_BG_CHANGE_TEMPLATE, Sn = [Vn?.prompt, vn].filter(Boolean).join(" "), nr = Jn.replace("{{bgPrompt}}", Sn).replace("[BG PROMPT HERE]", Sn);
128155
128155
  _e({
128156
128156
  ...on,
128157
128157
  selectedBgId: gn,
@@ -130920,6 +130920,16 @@ function BriefChips({
130920
130920
  }
130921
130921
  );
130922
130922
  }
130923
+ function normalizeSpecializationKey(e) {
130924
+ return e?.trim().toLowerCase() || null;
130925
+ }
130926
+ function briefsForRole(e, t) {
130927
+ const n = normalizeSpecializationKey(t);
130928
+ return n ? e.filter((o) => {
130929
+ const s = normalizeSpecializationKey(o.specialization_key);
130930
+ return !s || s === n;
130931
+ }) : e.filter((o) => !normalizeSpecializationKey(o.specialization_key));
130932
+ }
130923
130933
  function extractClipboardImageFiles(e) {
130924
130934
  return e?.items ? Array.from(e.items).flatMap((t) => {
130925
130935
  if (t.kind !== "file" || !t.type.startsWith("image/"))
@@ -133284,7 +133294,7 @@ function MoreBriefsBrowser({
133284
133294
  const Jt = [], on = [];
133285
133295
  for (const Un of o)
133286
133296
  matchesSearch(Un, Ke) && (Un.scope_type === "user" ? on.push(Un) : Jt.push(Un));
133287
- const Vn = (Un, Gn) => Un.sort_order - Gn.sort_order || Un.title.localeCompare(Gn.title);
133297
+ const Vn = (Un, Hn) => Un.sort_order - Hn.sort_order || Un.title.localeCompare(Hn.title);
133288
133298
  return { presetBriefs: Jt.sort(Vn), customBriefs: on.sort(Vn) };
133289
133299
  }, [o, Ke]), Ge = useMemo(
133290
133300
  () => [
@@ -134573,9 +134583,6 @@ function isUserSideRow(e) {
134573
134583
  function isScrollAnchorRow(e) {
134574
134584
  return e === "user";
134575
134585
  }
134576
- function normalizeSpecializationKey(e) {
134577
- return e?.trim().toLowerCase() || null;
134578
- }
134579
134586
  function CopyContentButton({
134580
134587
  text: e,
134581
134588
  idleLabel: t,
@@ -134638,7 +134645,7 @@ function ChatScreen() {
134638
134645
  setTechpackStatus: Ke,
134639
134646
  removeBrowserSession: lt
134640
134647
  } = useChatStore(), ut = useRef(null), Ge = useRef(null), $t = useRef(n), Ve = useRef(n), _e = useRef(null), at = useRef(!0), pt = useRef(!0), St = useRef(!1), wt = useRef(null), Et = useRef(0), bt = useRef(!1), At = useRef(null), Ht = useRef([]), xt = useRef([]), gn = useRef(null), Bt = useRef(null), vn = useRef(null), Jt = useRef(!1), on = useRef(null), Vn = useRef(!1), Un = useRef(() => {
134641
- }), Gn = useRef(null), Xn = useRef(/* @__PURE__ */ new Set()), Qn = useRef(/* @__PURE__ */ new Set()), Jn = useRef([]), [Sn, nr] = useState(n);
134648
+ }), Hn = useRef(null), Xn = useRef(/* @__PURE__ */ new Set()), Qn = useRef(/* @__PURE__ */ new Set()), Jn = useRef([]), [Sn, nr] = useState(n);
134642
134649
  useEffect(() => {
134643
134650
  Qe(null);
134644
134651
  }, [Sn, Qe]);
@@ -134677,7 +134684,7 @@ function ChatScreen() {
134677
134684
  specialization_key: Yt ?? void 0
134678
134685
  });
134679
134686
  if (Ot !== yl.current) return;
134680
- const Wn = Yt ? rn.data.filter((Hn) => normalizeSpecializationKey(Hn.specialization_key) === Yt) : rn.data.filter((Hn) => !normalizeSpecializationKey(Hn.specialization_key));
134687
+ const Wn = briefsForRole(rn.data, Yt);
134681
134688
  wn(Wn.map(toPromptEntry));
134682
134689
  } catch (Yt) {
134683
134690
  if (Ot !== yl.current) return;
@@ -134728,8 +134735,8 @@ function ChatScreen() {
134728
134735
  In((Ot) => (Ot || _r(normalizeSpecializationKey(f) ?? ""), !Ot));
134729
134736
  }, [f]), bl = useCallback((Ot, Yt, rn) => {
134730
134737
  E((Wn) => dedupeMessagesByIdentity(
134731
- Wn.map((Hn) => Hn.role !== "user" || Hn.chatId !== Ot || getMessageClientMessageId(Hn) !== Yt ? Hn : {
134732
- ...Hn,
134738
+ Wn.map((Gn) => Gn.role !== "user" || Gn.chatId !== Ot || getMessageClientMessageId(Gn) !== Yt ? Gn : {
134739
+ ...Gn,
134733
134740
  request_id: rn
134734
134741
  })
134735
134742
  ));
@@ -134763,31 +134770,31 @@ function ChatScreen() {
134763
134770
  }, [Ci]), bo = useCallback((Ot, Yt) => {
134764
134771
  const rn = ut.current;
134765
134772
  if (!rn) return;
134766
- const Wn = rn.getBoundingClientRect(), Hn = Ot.element.getBoundingClientRect(), er = rn.scrollTop + (Hn.bottom - Wn.bottom);
134773
+ const Wn = rn.getBoundingClientRect(), Gn = Ot.element.getBoundingClientRect(), er = rn.scrollTop + (Gn.bottom - Wn.bottom);
134767
134774
  Ci(Math.max(0, er), Yt);
134768
134775
  }, [Ci]), Ss = useRef(() => null), Cs = useRef(() => {
134769
134776
  }), Xc = useRef(() => !0), Da = useRef(!1), Di = useCallback((Ot, Yt = !1) => {
134770
134777
  const rn = ut.current, Wn = Ge.current;
134771
134778
  if (!rn || yt.current || !Yt && !at.current) return;
134772
- const Hn = Si(Ot);
134779
+ const Gn = Si(Ot);
134773
134780
  if (Ot === "initial-load") {
134774
- kr(Hn);
134781
+ kr(Gn);
134775
134782
  return;
134776
134783
  }
134777
134784
  if (Ot === "user-submit" && Ss.current() !== null) {
134778
- Cs.current(Hn);
134785
+ Cs.current(Gn);
134779
134786
  return;
134780
134787
  }
134781
134788
  if (Ot === "follow-tail") {
134782
134789
  if (Da.current && Xc.current() && Ss.current() !== null) {
134783
- Cs.current(Hn);
134790
+ Cs.current(Gn);
134784
134791
  return;
134785
134792
  }
134786
- kr(Hn);
134793
+ kr(Gn);
134787
134794
  return;
134788
134795
  }
134789
134796
  const er = _i(Wn ?? rn, Ot);
134790
- er ? bo(er, Hn) : kr(Hn);
134797
+ er ? bo(er, Gn) : kr(Gn);
134791
134798
  }, [Si, _i, bo, kr]), wl = useCallback((Ot) => Ot === "follow-tail" ? 0 : Ot === "initial-load" ? 1 : Ot === "form-close" ? 2 : Ot === "user-submit" ? 3 : 4, []), Us = useCallback(() => {
134792
134799
  vn.current = null, gn.current !== null && (window.clearTimeout(gn.current), gn.current = null), Bt.current !== null && (window.cancelAnimationFrame(Bt.current), Bt.current = null);
134793
134800
  }, []);
@@ -134797,30 +134804,30 @@ function ChatScreen() {
134797
134804
  if (Wn !== null && wl(Wn) > rn)
134798
134805
  return;
134799
134806
  vn.current = Ot, gn.current !== null && (window.clearTimeout(gn.current), gn.current = null), Bt.current !== null && (window.cancelAnimationFrame(Bt.current), Bt.current = null);
134800
- const Hn = () => {
134807
+ const Gn = () => {
134801
134808
  Bt.current = window.requestAnimationFrame(() => {
134802
134809
  Bt.current = null, vn.current = null, Di(Ot, Yt?.force ?? !1);
134803
134810
  });
134804
134811
  };
134805
134812
  if (Yt?.delayMs && Yt.delayMs > 0) {
134806
134813
  gn.current = window.setTimeout(() => {
134807
- gn.current = null, Hn();
134814
+ gn.current = null, Gn();
134808
134815
  }, Yt.delayMs);
134809
134816
  return;
134810
134817
  }
134811
- Hn();
134818
+ Gn();
134812
134819
  }, [Di]), _l = useCallback(() => {
134813
134820
  Ht.current.forEach((Ot) => window.clearTimeout(Ot)), xt.current.forEach((Ot) => window.cancelAnimationFrame(Ot)), Ht.current = [], xt.current = [];
134814
134821
  }, []), ks = useCallback((Ot) => {
134815
134822
  _l(), pt.current = !0, Et.current = Date.now() + FORM_SCROLL_SUPPRESS_MS, (Ot === "form-open" ? [0, FORM_LAYOUT_SETTLE_MS] : [0, FORM_LAYOUT_SETTLE_MS, FORM_LAYOUT_SETTLE_MS * 2]).forEach((rn) => {
134816
134823
  const Wn = window.setTimeout(() => {
134817
- const Hn = window.requestAnimationFrame(() => {
134824
+ const Gn = window.requestAnimationFrame(() => {
134818
134825
  const er = window.requestAnimationFrame(() => {
134819
134826
  Di(Ot, !0), xt.current = xt.current.filter((hr) => hr !== er);
134820
134827
  });
134821
- xt.current.push(er), xt.current = xt.current.filter((hr) => hr !== Hn);
134828
+ xt.current.push(er), xt.current = xt.current.filter((hr) => hr !== Gn);
134822
134829
  });
134823
- xt.current.push(Hn), Ht.current = Ht.current.filter((er) => er !== Wn);
134830
+ xt.current.push(Gn), Ht.current = Ht.current.filter((er) => er !== Wn);
134824
134831
  }, rn);
134825
134832
  Ht.current.push(Wn);
134826
134833
  });
@@ -134900,12 +134907,12 @@ function ChatScreen() {
134900
134907
  try {
134901
134908
  const Wn = await loadChat(o, Ot);
134902
134909
  if ($t.current !== Ot) return;
134903
- const Hn = hasArtifaxDreamerCanvas(
134910
+ const Gn = hasArtifaxDreamerCanvas(
134904
134911
  Wn
134905
134912
  ), er = hasTechpackPane(
134906
134913
  Wn
134907
134914
  );
134908
- if (Hn ? oe(Ot, "loading") : Bo?.active || oe(Ot, null), er ? Ke("loading") : Ae?.active || Ke(null), E(
134915
+ if (Gn ? oe(Ot, "loading") : Bo?.active || oe(Ot, null), er ? Ke("loading") : Ae?.active || Ke(null), E(
134909
134916
  (hr) => mergeHydratedMessages(
134910
134917
  hr,
134911
134918
  Wn,
@@ -134955,14 +134962,14 @@ function ChatScreen() {
134955
134962
  } else
134956
134963
  Oe(null);
134957
134964
  if (rn.length === 0) return;
134958
- const Hn = [];
134965
+ const Gn = [];
134959
134966
  for (const er of rn) {
134960
134967
  const hr = uuidv7(), Tr = er.type.startsWith("image/");
134961
134968
  let La;
134962
- Tr && (La = URL.createObjectURL(er)), Hn.push({ id: hr, file: er, previewUrl: La, isImage: Tr, uploadStatus: "pending" });
134969
+ Tr && (La = URL.createObjectURL(er)), Gn.push({ id: hr, file: er, previewUrl: La, isImage: Tr, uploadStatus: "pending" });
134963
134970
  }
134964
- gt((er) => [...er, ...Hn]);
134965
- for (const er of Hn) {
134971
+ gt((er) => [...er, ...Gn]);
134972
+ for (const er of Gn) {
134966
134973
  if (!o) continue;
134967
134974
  gt((Tr) => Tr.map((La) => La.id === er.id ? { ...La, uploadStatus: "uploading" } : La));
134968
134975
  const hr = new FormData();
@@ -134991,26 +134998,26 @@ function ChatScreen() {
134991
134998
  if (!o || !s || !l || Zt) return;
134992
134999
  const rn = Ot.trim();
134993
135000
  if (!rn) return;
134994
- const Wn = Yt?.forceNewConversation ?? !1, Hn = Wn ? uuidv7() : Sn || uuidv7(), er = Wn || !Sn, hr = uuidv7();
134995
- er && (_e.current = { chatId: Hn }, po.current = !0);
135001
+ const Wn = Yt?.forceNewConversation ?? !1, Gn = Wn ? uuidv7() : Sn || uuidv7(), er = Wn || !Sn, hr = uuidv7();
135002
+ er && (_e.current = { chatId: Gn }, po.current = !0);
134996
135003
  const Tr = {
134997
135004
  id: `opt-${Date.now()}`,
134998
135005
  client_message_id: hr,
134999
135006
  role: "user",
135000
135007
  type: "message",
135001
135008
  content: rn,
135002
- chatId: Hn
135009
+ chatId: Gn
135003
135010
  };
135004
135011
  hn(!0);
135005
135012
  try {
135006
135013
  E((Ks) => [...Ks, Tr]), at.current = !0, pt.current = !0, yt.current = !1, ze(!1), requestAnimationFrame(() => {
135007
135014
  Rt.current(), ut.current?.scrollHeight, Ja("user-submit", { force: !0, delayMs: 150 });
135008
- }), Yt?.clearComposer && Kt(""), Yt?.clearPendingFiles && gt([]), ka(Hn), er && t(Hn), await Ga(Hn);
135015
+ }), Yt?.clearComposer && Kt(""), Yt?.clearPendingFiles && gt([]), ka(Gn), er && t(Gn), await Ga(Gn);
135009
135016
  const Xa = await (await sendMessageToAgent(
135010
135017
  o,
135011
135018
  s,
135012
135019
  l,
135013
- Hn,
135020
+ Gn,
135014
135021
  rn,
135015
135022
  !1,
135016
135023
  {
@@ -135021,7 +135028,7 @@ function ChatScreen() {
135021
135028
  widgetMode: h
135022
135029
  }
135023
135030
  )).clone().json().catch(() => null);
135024
- Xa?.request_id && (bl(Hn, hr, Xa.request_id), ka(Hn, Xa.request_id));
135031
+ Xa?.request_id && (bl(Gn, hr, Xa.request_id), ka(Gn, Xa.request_id));
135025
135032
  } catch (La) {
135026
135033
  console.error("sendMessageToAgent failed", La);
135027
135034
  } finally {
@@ -135045,12 +135052,12 @@ function ChatScreen() {
135045
135052
  bl
135046
135053
  ]), Ld = useCallback(async (Ot, Yt) => {
135047
135054
  const rn = Yt || Ot;
135048
- if (!(Gn.current || Zt)) {
135049
- Gn.current = rn, qn(rn);
135055
+ if (!(Hn.current || Zt)) {
135056
+ Hn.current = rn, qn(rn);
135050
135057
  try {
135051
135058
  await ts(Ot);
135052
135059
  } finally {
135053
- Gn.current = null, qn(null);
135060
+ Hn.current = null, qn(null);
135054
135061
  }
135055
135062
  }
135056
135063
  }, [Zt, ts]);
@@ -135142,12 +135149,12 @@ function ChatScreen() {
135142
135149
  vt(!1), _t("general"), Mt(!1), Ut(!1), Vs();
135143
135150
  }, [Vs]), ns = useMemo(() => {
135144
135151
  const Ot = b.filter(
135145
- (Hn) => (!Sn || !Hn.chatId || Hn.chatId === Sn) && !Hn.hidden && Hn.type !== "thinking"
135152
+ (Gn) => (!Sn || !Gn.chatId || Gn.chatId === Sn) && !Gn.hidden && Gn.type !== "thinking"
135146
135153
  ), Yt = dedupeMessagesByIdentity(Ot), Wn = [...Yt];
135147
135154
  if (ki) {
135148
- for (let Hn = Wn.length - 1; Hn >= 0 && Wn[Hn].role !== "user"; Hn--)
135149
- if (Wn[Hn].role === "assistant" && Wn[Hn].type === "message" && !Wn[Hn].additional_kwargs?.ui_components) {
135150
- Wn.splice(Hn, 1);
135155
+ for (let Gn = Wn.length - 1; Gn >= 0 && Wn[Gn].role !== "user"; Gn--)
135156
+ if (Wn[Gn].role === "assistant" && Wn[Gn].type === "message" && !Wn[Gn].additional_kwargs?.ui_components) {
135157
+ Wn.splice(Gn, 1);
135151
135158
  break;
135152
135159
  }
135153
135160
  }
@@ -135159,8 +135166,8 @@ function ChatScreen() {
135159
135166
  const Ot = [];
135160
135167
  let Yt = null;
135161
135168
  return ns.forEach((rn, Wn) => {
135162
- const Hn = getMessageRequestId(rn);
135163
- rn.role === "user" ? Yt = Hn ?? `optimistic:${String(rn.id ?? rn.message_db_id ?? Wn)}` : Hn ? Yt = Hn : Yt || (Yt = `turn:${Wn}`);
135169
+ const Gn = getMessageRequestId(rn);
135170
+ rn.role === "user" ? Yt = Gn ?? `optimistic:${String(rn.id ?? rn.message_db_id ?? Wn)}` : Gn ? Yt = Gn : Yt || (Yt = `turn:${Wn}`);
135164
135171
  const er = {
135165
135172
  ...rn,
135166
135173
  __turnKey: Yt
@@ -135181,8 +135188,8 @@ function ChatScreen() {
135181
135188
  for (const Wn of String(Yt.content ?? "").split(`
135182
135189
  `))
135183
135190
  try {
135184
- const Hn = JSON.parse(Wn.trim());
135185
- Hn?.event === "END" && (Hn.id || Hn.message) && rn.add(Hn.id ?? Hn.message);
135191
+ const Gn = JSON.parse(Wn.trim());
135192
+ Gn?.event === "END" && (Gn.id || Gn.message) && rn.add(Gn.id ?? Gn.message);
135186
135193
  } catch {
135187
135194
  }
135188
135195
  }
@@ -135190,13 +135197,13 @@ function ChatScreen() {
135190
135197
  }, [ia]), El = useMemo(() => {
135191
135198
  const Ot = /* @__PURE__ */ new Map(), Yt = /* @__PURE__ */ new Map();
135192
135199
  return ia.forEach((rn, Wn) => {
135193
- let Hn = Yt.get(rn.__turnKey);
135194
- if (Hn || (Hn = /* @__PURE__ */ new Set(), Yt.set(rn.__turnKey, Hn)), Ot.set(Wn, new Set(Hn)), rn.type === "reasoning")
135200
+ let Gn = Yt.get(rn.__turnKey);
135201
+ if (Gn || (Gn = /* @__PURE__ */ new Set(), Yt.set(rn.__turnKey, Gn)), Ot.set(Wn, new Set(Gn)), rn.type === "reasoning")
135195
135202
  for (const er of String(rn.content ?? "").split(`
135196
135203
  `))
135197
135204
  try {
135198
135205
  const hr = JSON.parse(er.trim());
135199
- hr?.event === "START" && (hr.id || hr.message) && Hn.add(hr.id ?? hr.message);
135206
+ hr?.event === "START" && (hr.id || hr.message) && Gn.add(hr.id ?? hr.message);
135200
135207
  } catch {
135201
135208
  }
135202
135209
  }), Ot;
@@ -135210,9 +135217,9 @@ function ChatScreen() {
135210
135217
  if (Ot.has(Wn)) continue;
135211
135218
  Ot.add(Wn);
135212
135219
  }
135213
- const Hn = getUIComponent(rn), er = Hn?.name;
135214
- if (!er || Hn?.submitted || Hn?.submitted_values) continue;
135215
- const hr = Hn?.props || {};
135220
+ const Gn = getUIComponent(rn), er = Gn?.name;
135221
+ if (!er || Gn?.submitted || Gn?.submitted_values) continue;
135222
+ const hr = Gn?.props || {};
135216
135223
  if (DISPLAY_ONLY_COMPONENTS.has(er) && hr.resume === !0 || !DISPLAY_ONLY_COMPONENTS.has(er) && INPUT_BLOCKING_COMPONENTS.has(er))
135217
135224
  return rn;
135218
135225
  }
@@ -135232,7 +135239,7 @@ function ChatScreen() {
135232
135239
  }, [ia]), eo = useMemo(() => {
135233
135240
  const Ot = [];
135234
135241
  return ia.forEach((Yt, rn) => {
135235
- const Wn = String(Yt.id ?? Yt.message_db_id ?? rn), Hn = getUIComponent(Yt), er = !!(Hn?.submitted || Hn?.submitted_values), hr = !!Hn && Yt !== Xr;
135242
+ const Wn = String(Yt.id ?? Yt.message_db_id ?? rn), Gn = getUIComponent(Yt), er = !!(Gn?.submitted || Gn?.submitted_values), hr = !!Gn && Yt !== Xr;
135236
135243
  if (Yt.type === "reasoning") {
135237
135244
  Ot.push({
135238
135245
  key: `${Wn}-reasoning`,
@@ -135259,7 +135266,7 @@ function ChatScreen() {
135259
135266
  message: Yt,
135260
135267
  sourceIndex: rn,
135261
135268
  turnKey: Yt.__turnKey
135262
- }), hr && er && !RECEIPT_BEARING_COMPONENTS.has(String(Hn?.name ?? "")) && Ot.push({
135269
+ }), hr && er && !RECEIPT_BEARING_COMPONENTS.has(String(Gn?.name ?? "")) && Ot.push({
135263
135270
  key: `${Wn}-submitted`,
135264
135271
  kind: "submitted",
135265
135272
  message: Yt,
@@ -135272,10 +135279,10 @@ function ChatScreen() {
135272
135279
  for (const Yt of ia) {
135273
135280
  const rn = getUIComponent(Yt), Wn = rn?.name;
135274
135281
  if (!Wn || !registry.isSidePaneComponent(Wn) || rn?.submitted || rn?.submitted_values) continue;
135275
- const Hn = String(Yt.message_db_id ?? Yt.id ?? "");
135276
- if (!Hn) continue;
135282
+ const Gn = String(Yt.message_db_id ?? Yt.id ?? "");
135283
+ if (!Gn) continue;
135277
135284
  const er = rn?.props || {}, hr = registry.lookup(Wn), Tr = typeof er.title == "string" && er.title.trim() || hr?.panelTitle || "Panel";
135278
- Ot.push({ messageId: Hn, name: Wn, title: Tr });
135285
+ Ot.push({ messageId: Gn, name: Wn, title: Tr });
135279
135286
  }
135280
135287
  return Ot;
135281
135288
  }, [ia]), z = useMemo(() => {
@@ -135284,7 +135291,7 @@ function ChatScreen() {
135284
135291
  if (!isAssistantMedia(Yt)) continue;
135285
135292
  const { items: rn } = collectMessageMedia(Yt);
135286
135293
  if (rn.length === 0) continue;
135287
- const Wn = rn.filter((Hn) => Hn.isImage || Hn.isVideo);
135294
+ const Wn = rn.filter((Gn) => Gn.isImage || Gn.isVideo);
135288
135295
  Wn.length !== 0 && Ot.push({
135289
135296
  messageId: mediaSourceId(Yt),
135290
135297
  items: rn,
@@ -135302,14 +135309,14 @@ function ChatScreen() {
135302
135309
  }, [ia]), Fe = useCallback(
135303
135310
  (Ot, Yt, rn) => {
135304
135311
  if (!Sn || Ot.length === 0) return;
135305
- const Wn = mediaPanelId(Yt), Hn = Ot.map((er, hr) => ({
135312
+ const Wn = mediaPanelId(Yt), Gn = Ot.map((er, hr) => ({
135306
135313
  id: er.id ?? `${Yt}-${hr}`,
135307
135314
  url: er.url,
135308
135315
  name: er.name
135309
135316
  }));
135310
135317
  nt((er) => {
135311
135318
  const hr = new Map(er);
135312
- return hr.set(Wn, { images: Hn, onRemoveImage: rn }), hr;
135319
+ return hr.set(Wn, { images: Gn, onRemoveImage: rn }), hr;
135313
135320
  });
135314
135321
  for (const er of useChatStore.getState().panels)
135315
135322
  er.kind === "media" && er.chatId === Sn && er.id !== Wn && (qe(er.id), nt((hr) => {
@@ -135363,12 +135370,12 @@ function ChatScreen() {
135363
135370
  (Ot) => {
135364
135371
  if (!Ot || !Sn) return;
135365
135372
  const Yt = z.find(
135366
- (Hn) => Hn.messageId === mediaSourceId(Ot)
135373
+ (Gn) => Gn.messageId === mediaSourceId(Ot)
135367
135374
  );
135368
135375
  if (!Yt) return;
135369
135376
  const rn = mediaPanelId(Yt.messageId);
135370
135377
  return {
135371
- showing: Me.some((Hn) => Hn.id === rn) && Ie === rn,
135378
+ showing: Me.some((Gn) => Gn.id === rn) && Ie === rn,
135372
135379
  onOpen: () => Fe(Yt.items, Yt.messageId),
135373
135380
  onClose: () => qe(rn)
135374
135381
  };
@@ -135599,8 +135606,8 @@ function ChatScreen() {
135599
135606
  Er
135600
135607
  ]), Ts = useRef(!1);
135601
135608
  useEffect(() => {
135602
- const Ot = Ts.current, Yt = !!Xr, rn = wt.current, Wn = typeof rn?.id == "string" ? rn.id : typeof rn?.message_db_id == "string" ? rn.message_db_id : void 0, Hn = typeof Xr?.id == "string" ? Xr.id : typeof Xr?.message_db_id == "string" ? Xr.message_db_id : void 0;
135603
- !Ot && Yt ? (bt.current = !1, At.current = null, ks("form-open")) : Ot && !Yt ? (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close")) : Ot && Yt && Wn !== Hn && (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close"), ks("form-open")), Ts.current = Yt, wt.current = Xr;
135609
+ const Ot = Ts.current, Yt = !!Xr, rn = wt.current, Wn = typeof rn?.id == "string" ? rn.id : typeof rn?.message_db_id == "string" ? rn.message_db_id : void 0, Gn = typeof Xr?.id == "string" ? Xr.id : typeof Xr?.message_db_id == "string" ? Xr.message_db_id : void 0;
135610
+ !Ot && Yt ? (bt.current = !1, At.current = null, ks("form-open")) : Ot && !Yt ? (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close")) : Ot && Yt && Wn !== Gn && (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close"), ks("form-open")), Ts.current = Yt, wt.current = Xr;
135604
135611
  }, [Xr, Sn, ka, ks]), useEffect(() => {
135605
135612
  if (xa) {
135606
135613
  At.current = null;
@@ -135619,9 +135626,9 @@ function ChatScreen() {
135619
135626
  bt.current = !1;
135620
135627
  const rn = window.requestAnimationFrame(() => {
135621
135628
  const Wn = window.requestAnimationFrame(() => {
135622
- Di("form-close", !0), xt.current = xt.current.filter((Hn) => Hn !== Wn);
135629
+ Di("form-close", !0), xt.current = xt.current.filter((Gn) => Gn !== Wn);
135623
135630
  });
135624
- xt.current.push(Wn), xt.current = xt.current.filter((Hn) => Hn !== rn);
135631
+ xt.current.push(Wn), xt.current = xt.current.filter((Gn) => Gn !== rn);
135625
135632
  });
135626
135633
  xt.current.push(rn);
135627
135634
  }, [
@@ -135657,8 +135664,8 @@ function ChatScreen() {
135657
135664
  Yt.style.height = "0px";
135658
135665
  return;
135659
135666
  }
135660
- const Hn = rn.scrollHeight - Yt.offsetHeight - Wn;
135661
- Yt.style.height = `${Math.max(0, Ot.clientHeight - Hn - 28)}px`;
135667
+ const Gn = rn.scrollHeight - Yt.offsetHeight - Wn;
135668
+ Yt.style.height = `${Math.max(0, Ot.clientHeight - Gn - 28)}px`;
135662
135669
  }, [qa]), Yr = useCallback(() => {
135663
135670
  const Ot = ut.current, Yt = Ze.current, rn = Ge.current;
135664
135671
  if (!Ot || !rn) return !0;
@@ -135674,8 +135681,8 @@ function ChatScreen() {
135674
135681
  if (!Ot) return;
135675
135682
  const rn = Ot.scrollHeight - Ot.scrollTop - Ot.clientHeight < 100;
135676
135683
  at.current = rn;
135677
- const Wn = qa(), Hn = Wn !== null && Math.abs(Ot.scrollTop - Wn) <= 14;
135678
- (rn || Hn) && (yt.current = !1, pt.current = !0), je.current();
135684
+ const Wn = qa(), Gn = Wn !== null && Math.abs(Ot.scrollTop - Wn) <= 14;
135685
+ (rn || Gn) && (yt.current = !1, pt.current = !0), je.current();
135679
135686
  }, [qa]), Ys = useCallback((Ot) => {
135680
135687
  const Yt = ut.current;
135681
135688
  if (!Yt || Yt.scrollHeight - Yt.clientHeight <= 8) return;
@@ -135853,7 +135860,7 @@ function ChatScreen() {
135853
135860
  className: `max-w-[1020px] mx-auto flex flex-col gap-10 ${Ea ? "hidden" : ""} ${Lt ? "pb-[56px]" : ""}`,
135854
135861
  children: [
135855
135862
  ii.map((Ot, Yt) => {
135856
- const rn = Ot.message, Wn = rn?.type, Hn = String(rn?.content ?? ""), er = !!gi && Ot.turnKey === gi, hr = !!Ot.message?.additional_kwargs?.ui_components, Tr = er ? hr ? !0 : "position" : !1, La = Yt > 0 ? getRowSpeaker(ii[Yt - 1].kind) : null, Xa = (() => {
135863
+ const rn = Ot.message, Wn = rn?.type, Gn = String(rn?.content ?? ""), er = !!gi && Ot.turnKey === gi, hr = !!Ot.message?.additional_kwargs?.ui_components, Tr = er ? hr ? !0 : "position" : !1, La = Yt > 0 ? getRowSpeaker(ii[Yt - 1].kind) : null, Xa = (() => {
135857
135864
  if (isUserSideRow(Ot.kind))
135858
135865
  return La !== getRowSpeaker(Ot.kind);
135859
135866
  for (let Jr = Yt + 1; Jr < ii.length; Jr++)
@@ -135870,7 +135877,7 @@ function ChatScreen() {
135870
135877
  (Jr) => Jr.kind === "reasoning" && Jr.turnKey === Ot.turnKey
135871
135878
  ), Id = Ot.kind === "reasoning" && hasDisplayOnlyUIComponent(rn);
135872
135879
  if (Ot.kind === "reasoning")
135873
- return !(la && Zs || traceHasContent(Hn, El.get(Ot.sourceIndex))) && !Id ? null : /* @__PURE__ */ jsx(
135880
+ return !(la && Zs || traceHasContent(Gn, El.get(Ot.sourceIndex))) && !Id ? null : /* @__PURE__ */ jsx(
135874
135881
  motion$1.div,
135875
135882
  {
135876
135883
  layout: Tr,
@@ -135880,7 +135887,7 @@ function ChatScreen() {
135880
135887
  /* @__PURE__ */ jsx(
135881
135888
  AgentSteps,
135882
135889
  {
135883
- content: Hn,
135890
+ content: Gn,
135884
135891
  isLoading: la && Zs,
135885
135892
  completedStepIds: uo.get(Ot.turnKey ?? ""),
135886
135893
  previouslyStartedIds: El.get(Ot.sourceIndex),
@@ -135929,7 +135936,7 @@ function ChatScreen() {
135929
135936
  /* @__PURE__ */ jsx(
135930
135937
  CopyContentButton,
135931
135938
  {
135932
- text: Hn,
135939
+ text: Gn,
135933
135940
  idleLabel: "Copy message",
135934
135941
  successLabel: "Message copied"
135935
135942
  }
@@ -136066,7 +136073,7 @@ function ChatScreen() {
136066
136073
  leadingAction: /* @__PURE__ */ jsx(
136067
136074
  CopyContentButton,
136068
136075
  {
136069
- text: Hn,
136076
+ text: Gn,
136070
136077
  idleLabel: "Copy markdown",
136071
136078
  successLabel: "Markdown copied"
136072
136079
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/agent",
3
- "version": "0.5.14",
3
+ "version": "0.5.15",
4
4
  "description": "Native (no-iframe) embeddable Streamoid agent chat panel. Host renders <AgentPanel adapters={…}/>. Prebuilt bundle — source + build live in the stream-agent repo.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",