@stackable-labs/embeddables 1.7.1 → 1.7.2

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/dist/react.js CHANGED
@@ -6,21 +6,22 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
6
6
  const o = ce.get(e.id);
7
7
  if (o) return o;
8
8
  const r = document.createElement("iframe");
9
- if (r.setAttribute("sandbox", "allow-scripts allow-same-origin"), r.style.display = "none", r.style.width = "0", r.style.height = "0", r.style.border = "none", e.bundleUrl.startsWith("http") && !e.bundleUrl.endsWith(".js"))
10
- r.src = e.bundleUrl;
11
- else {
9
+ if (r.setAttribute("sandbox", "allow-scripts allow-same-origin"), r.style.display = "none", r.style.width = "0", r.style.height = "0", r.style.border = "none", e.bundleUrl.startsWith("http") && !e.bundleUrl.endsWith(".js")) {
10
+ const i = new URL(e.bundleUrl);
11
+ i.searchParams.set("__extensionId", e.id), r.src = i.toString();
12
+ } else {
12
13
  let i = "";
13
14
  try {
14
15
  i = await (await fetch(e.bundleUrl)).text();
15
- } catch (d) {
16
- console.error(`[SandboxManager] Failed to fetch bundle for ${e.id}:`, d);
16
+ } catch (u) {
17
+ console.error(`[SandboxManager] Failed to fetch bundle for ${e.id}:`, u);
17
18
  }
18
19
  const l = `<!DOCTYPE html>
19
20
  <html>
20
21
  <head><meta charset="utf-8"></head>
21
22
  <body>
22
23
  <div id="extension-root"></div>
23
- <script>var process = { env: { NODE_ENV: "production" } };<\/script>
24
+ <script>var __STACKABLE_EXTENSION_ID__ = ${JSON.stringify(e.id)}; var process = { env: { NODE_ENV: "production" } };<\/script>
24
25
  <script>${i}<\/script>
25
26
  </body>
26
27
  </html>`;
@@ -34,9 +35,8 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
34
35
  ready: !1,
35
36
  messageHandlers: /* @__PURE__ */ new Set()
36
37
  }, a = (i) => {
37
- if (i.source !== r.contentWindow) return;
38
38
  const l = i.data;
39
- (l == null ? void 0 : l.type) === "extension-ready" && (s.ready = !0), s.messageHandlers.forEach((d) => d(l));
39
+ !l || typeof l != "object" || !("type" in l) || ("extensionId" in l ? l.extensionId : void 0) !== e.id || (l.type === "extension-ready" && (s.ready = !0), s.messageHandlers.forEach((d) => d(l)));
40
40
  };
41
41
  return window.addEventListener("message", a), ce.set(e.id, s), s;
42
42
  }, We = (e, t) => {
@@ -122,21 +122,21 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
122
122
  default:
123
123
  throw new Error(`Unknown capability: ${n.capability}`);
124
124
  }
125
- const d = {
125
+ const u = {
126
126
  type: "capability-response",
127
127
  id: n.id,
128
128
  success: !0,
129
129
  data: l
130
130
  };
131
- We(s, d);
131
+ We(s, u);
132
132
  } catch (l) {
133
- const d = {
133
+ const u = {
134
134
  type: "capability-response",
135
135
  id: n.id,
136
136
  success: !1,
137
137
  error: l instanceof Error ? l.message : "Unknown error"
138
138
  };
139
- We(s, d);
139
+ We(s, u);
140
140
  }
141
141
  };
142
142
  return window.addEventListener("message", t), () => {
@@ -157,19 +157,19 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
157
157
  if (!a.current) return;
158
158
  let l = !1;
159
159
  return (async () => {
160
- const u = a.current;
161
- if (u) {
160
+ const d = a.current;
161
+ if (d) {
162
162
  console.log("[ExtensionProvider] Initializing with", e.length, "extensions");
163
163
  for (const f of e)
164
- f.enabled && !l && (console.log("[ExtensionProvider] Creating sandbox for", f.id, "bundleUrl:", f.bundleUrl), await tr(f, u), console.log("[ExtensionProvider] Sandbox created for", f.id));
164
+ f.enabled && !l && (console.log("[ExtensionProvider] Creating sandbox for", f.id, "bundleUrl:", f.bundleUrl), await tr(f, d), console.log("[ExtensionProvider] Sandbox created for", f.id));
165
165
  i.current = sr(t), l || (console.log("[ExtensionProvider] Ready"), s(!0));
166
166
  }
167
167
  })(), () => {
168
- var u;
168
+ var d;
169
169
  l = !0;
170
170
  for (const f of e)
171
171
  or(f.id);
172
- (u = i.current) == null || u.call(i);
172
+ (d = i.current) == null || d.call(i);
173
173
  };
174
174
  }, [e, t]), /* @__PURE__ */ z(Ot.Provider, { value: { extensions: e, components: o, ready: n }, children: [
175
175
  /* @__PURE__ */ c("div", { ref: a, style: { display: "none" } }),
@@ -183,7 +183,7 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
183
183
  fallback: n = null,
184
184
  render: s
185
185
  }) => {
186
- const { extensions: a, components: i, ready: l } = ir(), [d, u] = U({}), f = ae(""), m = Mt(
186
+ const { extensions: a, components: i, ready: l } = ir(), [u, d] = U({}), f = ae(""), m = Mt(
187
187
  () => a.filter((h) => h.enabled && h.manifest.targets.includes(e)),
188
188
  // eslint-disable-next-line react-hooks/exhaustive-deps
189
189
  [a.map((h) => h.id).join(","), e]
@@ -228,7 +228,7 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
228
228
  );
229
229
  if (B(() => {
230
230
  const h = m.map((R) => R.id).join(",");
231
- if (f.current !== h && (f.current = h, u({})), !l || m.length === 0) return;
231
+ if (f.current !== h && (f.current = h, d({})), !l || m.length === 0) return;
232
232
  const y = (R) => {
233
233
  const C = R.data;
234
234
  if (!(!C || typeof C != "object" || !m.some((P) => {
@@ -242,7 +242,7 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
242
242
  });
243
243
  if (!P) return;
244
244
  const E = g(C.tree, R.source ?? null);
245
- u((_) => ({
245
+ d((_) => ({
246
246
  ..._,
247
247
  [P.id]: E
248
248
  }));
@@ -271,7 +271,7 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
271
271
  return null;
272
272
  if (m.length === 0)
273
273
  return n ? /* @__PURE__ */ c("div", { "data-extension-slot": e, title: e, className: o, children: n }) : null;
274
- const k = m.map((h) => ({ id: h.id, children: d[h.id] })).filter((h) => !!h.children), x = k.length > 0 ? k.flatMap((h, y, R) => {
274
+ const k = m.map((h) => ({ id: h.id, children: u[h.id] })).filter((h) => !!h.children), x = k.length > 0 ? k.flatMap((h, y, R) => {
275
275
  const C = s ? s({
276
276
  extensionId: h.id,
277
277
  children: h.children,
@@ -311,8 +311,8 @@ const ce = /* @__PURE__ */ new Map(), tr = async (e, t) => {
311
311
  for (const a of s) {
312
312
  const i = a.indexOf(":");
313
313
  if (i === -1) continue;
314
- const l = a.slice(0, i), d = a.slice(i + 1);
315
- l && d && cr(d) && r.push({ extensionId: l, bundleUrl: d });
314
+ const l = a.slice(0, i), u = a.slice(i + 1);
315
+ l && u && cr(u) && r.push({ extensionId: l, bundleUrl: u });
316
316
  }
317
317
  }
318
318
  return r;
@@ -419,7 +419,7 @@ const hr = Lt(
419
419
  ...i
420
420
  },
421
421
  [
422
- ...a.map(([d, u]) => _e(d, u)),
422
+ ...a.map(([u, d]) => _e(u, d)),
423
423
  ...Array.isArray(s) ? s : [s]
424
424
  ]
425
425
  )
@@ -809,8 +809,8 @@ const dn = (e, t) => {
809
809
  },
810
810
  getConflictingClassGroupIds: (a, i) => {
811
811
  if (i) {
812
- const l = r[a], d = o[a];
813
- return l ? d ? dn(d, l) : l : d || ht;
812
+ const l = r[a], u = o[a];
813
+ return l ? u ? dn(u, l) : l : u || ht;
814
814
  }
815
815
  return o[a] || ht;
816
816
  }
@@ -820,17 +820,17 @@ const dn = (e, t) => {
820
820
  return o.classGroupId;
821
821
  const n = e[t], s = o.nextPart.get(n);
822
822
  if (s) {
823
- const d = Gt(e, t + 1, s);
824
- if (d) return d;
823
+ const u = Gt(e, t + 1, s);
824
+ if (u) return u;
825
825
  }
826
826
  const a = o.validators;
827
827
  if (a === null)
828
828
  return;
829
829
  const i = t === 0 ? e.join(Ie) : e.slice(t).join(Ie), l = a.length;
830
- for (let d = 0; d < l; d++) {
831
- const u = a[d];
832
- if (u.validator(i))
833
- return u.classGroupId;
830
+ for (let u = 0; u < l; u++) {
831
+ const d = a[u];
832
+ if (d.validator(i))
833
+ return d.classGroupId;
834
834
  }
835
835
  }, pn = (e) => e.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
836
836
  const t = e.slice(1, -1), o = t.indexOf(":"), r = t.slice(0, o);
@@ -925,9 +925,9 @@ const dn = (e, t) => {
925
925
  } = e;
926
926
  let r = (n) => {
927
927
  const s = [];
928
- let a = 0, i = 0, l = 0, d;
929
- const u = n.length;
930
- for (let x = 0; x < u; x++) {
928
+ let a = 0, i = 0, l = 0, u;
929
+ const d = n.length;
930
+ for (let x = 0; x < d; x++) {
931
931
  const h = n[x];
932
932
  if (a === 0 && i === 0) {
933
933
  if (h === gt) {
@@ -935,7 +935,7 @@ const dn = (e, t) => {
935
935
  continue;
936
936
  }
937
937
  if (h === "/") {
938
- d = x;
938
+ u = x;
939
939
  continue;
940
940
  }
941
941
  }
@@ -950,7 +950,7 @@ const dn = (e, t) => {
950
950
  */
951
951
  f.startsWith(Xe) && (m = f.slice(1), g = !0)
952
952
  );
953
- const k = d && d > l ? d - l : void 0;
953
+ const k = u && u > l ? u - l : void 0;
954
954
  return bt(s, g, m, k);
955
955
  };
956
956
  if (t) {
@@ -991,26 +991,26 @@ const dn = (e, t) => {
991
991
  sortModifiers: s
992
992
  } = t, a = [], i = e.trim().split(An);
993
993
  let l = "";
994
- for (let d = i.length - 1; d >= 0; d -= 1) {
995
- const u = i[d], {
994
+ for (let u = i.length - 1; u >= 0; u -= 1) {
995
+ const d = i[u], {
996
996
  isExternal: f,
997
997
  modifiers: m,
998
998
  hasImportantModifier: g,
999
999
  baseClassName: k,
1000
1000
  maybePostfixModifierPosition: x
1001
- } = o(u);
1001
+ } = o(d);
1002
1002
  if (f) {
1003
- l = u + (l.length > 0 ? " " + l : l);
1003
+ l = d + (l.length > 0 ? " " + l : l);
1004
1004
  continue;
1005
1005
  }
1006
1006
  let h = !!x, y = r(h ? k.substring(0, x) : k);
1007
1007
  if (!y) {
1008
1008
  if (!h) {
1009
- l = u + (l.length > 0 ? " " + l : l);
1009
+ l = d + (l.length > 0 ? " " + l : l);
1010
1010
  continue;
1011
1011
  }
1012
1012
  if (y = r(k), !y) {
1013
- l = u + (l.length > 0 ? " " + l : l);
1013
+ l = d + (l.length > 0 ? " " + l : l);
1014
1014
  continue;
1015
1015
  }
1016
1016
  h = !1;
@@ -1024,7 +1024,7 @@ const dn = (e, t) => {
1024
1024
  const _ = P[E];
1025
1025
  a.push(C + _);
1026
1026
  }
1027
- l = u + (l.length > 0 ? " " + l : l);
1027
+ l = d + (l.length > 0 ? " " + l : l);
1028
1028
  }
1029
1029
  return l;
1030
1030
  }, _n = (...e) => {
@@ -1042,14 +1042,14 @@ const dn = (e, t) => {
1042
1042
  }, In = (e, ...t) => {
1043
1043
  let o, r, n, s;
1044
1044
  const a = (l) => {
1045
- const d = t.reduce((u, f) => f(u), e());
1046
- return o = Nn(d), r = o.cache.get, n = o.cache.set, s = i, i(l);
1045
+ const u = t.reduce((d, f) => f(d), e());
1046
+ return o = Nn(u), r = o.cache.get, n = o.cache.set, s = i, i(l);
1047
1047
  }, i = (l) => {
1048
- const d = r(l);
1049
- if (d)
1050
- return d;
1051
- const u = Rn(l, o);
1052
- return n(l, u), u;
1048
+ const u = r(l);
1049
+ if (u)
1050
+ return u;
1051
+ const d = Rn(l, o);
1052
+ return n(l, d), d;
1053
1053
  };
1054
1054
  return s = a, (...l) => s(_n(...l));
1055
1055
  }, Pn = [], F = (e) => {
@@ -1067,7 +1067,7 @@ const dn = (e, t) => {
1067
1067
  const r = Zt.exec(e);
1068
1068
  return r ? r[1] ? t(r[1]) : o : !1;
1069
1069
  }, Jt = (e) => e === "position" || e === "percentage", Qt = (e) => e === "image" || e === "url", eo = (e) => e === "length" || e === "size" || e === "bg-size", to = (e) => e === "length", Zn = (e) => e === "number", oo = (e) => e === "family-name", ro = (e) => e === "number" || e === "weight", no = (e) => e === "shadow", Kn = () => {
1070
- const e = F("color"), t = F("font"), o = F("text"), r = F("font-weight"), n = F("tracking"), s = F("leading"), a = F("breakpoint"), i = F("container"), l = F("spacing"), d = F("radius"), u = F("shadow"), f = F("inset-shadow"), m = F("text-shadow"), g = F("drop-shadow"), k = F("blur"), x = F("perspective"), h = F("aspect"), y = F("ease"), R = F("animate"), C = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], A = () => [
1070
+ const e = F("color"), t = F("font"), o = F("text"), r = F("font-weight"), n = F("tracking"), s = F("leading"), a = F("breakpoint"), i = F("container"), l = F("spacing"), u = F("radius"), d = F("shadow"), f = F("inset-shadow"), m = F("text-shadow"), g = F("drop-shadow"), k = F("blur"), x = F("perspective"), h = F("aspect"), y = F("ease"), R = F("animate"), C = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], A = () => [
1071
1071
  "center",
1072
1072
  "top",
1073
1073
  "bottom",
@@ -1098,7 +1098,7 @@ const dn = (e, t) => {
1098
1098
  "",
1099
1099
  "none",
1100
1100
  "full",
1101
- d,
1101
+ u,
1102
1102
  w,
1103
1103
  v
1104
1104
  ], V = () => ["", I, fe, se], we = () => ["solid", "dashed", "dotted", "double"], ft = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], D = () => [I, He, wt, xt], mt = () => [
@@ -2588,7 +2588,7 @@ const dn = (e, t) => {
2588
2588
  // Deprecated since Tailwind CSS v4.0.0
2589
2589
  "",
2590
2590
  "none",
2591
- u,
2591
+ d,
2592
2592
  Ne,
2593
2593
  Ee
2594
2594
  ]
@@ -3735,16 +3735,16 @@ function pe({ className: e, ...t }) {
3735
3735
  const yt = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, kt = jt, ot = (e, t) => (o) => {
3736
3736
  var r;
3737
3737
  if ((t == null ? void 0 : t.variants) == null) return kt(e, o == null ? void 0 : o.class, o == null ? void 0 : o.className);
3738
- const { variants: n, defaultVariants: s } = t, a = Object.keys(n).map((d) => {
3739
- const u = o == null ? void 0 : o[d], f = s == null ? void 0 : s[d];
3740
- if (u === null) return null;
3741
- const m = yt(u) || yt(f);
3742
- return n[d][m];
3743
- }), i = o && Object.entries(o).reduce((d, u) => {
3744
- let [f, m] = u;
3745
- return m === void 0 || (d[f] = m), d;
3746
- }, {}), l = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((d, u) => {
3747
- let { class: f, className: m, ...g } = u;
3738
+ const { variants: n, defaultVariants: s } = t, a = Object.keys(n).map((u) => {
3739
+ const d = o == null ? void 0 : o[u], f = s == null ? void 0 : s[u];
3740
+ if (d === null) return null;
3741
+ const m = yt(d) || yt(f);
3742
+ return n[u][m];
3743
+ }), i = o && Object.entries(o).reduce((u, d) => {
3744
+ let [f, m] = d;
3745
+ return m === void 0 || (u[f] = m), u;
3746
+ }, {}), l = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((u, d) => {
3747
+ let { class: f, className: m, ...g } = d;
3748
3748
  return Object.entries(g).every((k) => {
3749
3749
  let [x, h] = k;
3750
3750
  return Array.isArray(h) ? h.includes({
@@ -3755,10 +3755,10 @@ const yt = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, kt = jt, o
3755
3755
  ...i
3756
3756
  }[x] === h;
3757
3757
  }) ? [
3758
- ...d,
3758
+ ...u,
3759
3759
  f,
3760
3760
  m
3761
- ] : d;
3761
+ ] : u;
3762
3762
  }, []);
3763
3763
  return kt(e, a, l, o == null ? void 0 : o.class, o == null ? void 0 : o.className);
3764
3764
  };
@@ -3791,8 +3791,8 @@ function Pe(e) {
3791
3791
  const t = /* @__PURE__ */ es(e), o = p.forwardRef((r, n) => {
3792
3792
  const { children: s, ...a } = r, i = p.Children.toArray(s), l = i.find(os);
3793
3793
  if (l) {
3794
- const d = l.props.children, u = i.map((f) => f === l ? p.Children.count(d) > 1 ? p.Children.only(null) : p.isValidElement(d) ? d.props.children : null : f);
3795
- return /* @__PURE__ */ c(t, { ...a, ref: n, children: p.isValidElement(d) ? p.cloneElement(d, void 0, u) : null });
3794
+ const u = l.props.children, d = i.map((f) => f === l ? p.Children.count(u) > 1 ? p.Children.only(null) : p.isValidElement(u) ? u.props.children : null : f);
3795
+ return /* @__PURE__ */ c(t, { ...a, ref: n, children: p.isValidElement(u) ? p.cloneElement(u, void 0, d) : null });
3796
3796
  }
3797
3797
  return /* @__PURE__ */ c(t, { ...a, ref: n, children: s });
3798
3798
  });
@@ -3861,20 +3861,20 @@ function ge(e, t = []) {
3861
3861
  function r(s, a) {
3862
3862
  const i = p.createContext(a), l = o.length;
3863
3863
  o = [...o, a];
3864
- const d = (f) => {
3864
+ const u = (f) => {
3865
3865
  var y;
3866
3866
  const { scope: m, children: g, ...k } = f, x = ((y = m == null ? void 0 : m[e]) == null ? void 0 : y[l]) || i, h = p.useMemo(() => k, Object.values(k));
3867
3867
  return /* @__PURE__ */ c(x.Provider, { value: h, children: g });
3868
3868
  };
3869
- d.displayName = s + "Provider";
3870
- function u(f, m) {
3869
+ u.displayName = s + "Provider";
3870
+ function d(f, m) {
3871
3871
  var x;
3872
3872
  const g = ((x = m == null ? void 0 : m[e]) == null ? void 0 : x[l]) || i, k = p.useContext(g);
3873
3873
  if (k) return k;
3874
3874
  if (a !== void 0) return a;
3875
3875
  throw new Error(`\`${f}\` must be used within \`${s}\``);
3876
3876
  }
3877
- return [d, u];
3877
+ return [u, d];
3878
3878
  }
3879
3879
  const n = () => {
3880
3880
  const s = o.map((a) => p.createContext(a));
@@ -3897,8 +3897,8 @@ function as(...e) {
3897
3897
  scopeName: n.scopeName
3898
3898
  }));
3899
3899
  return function(s) {
3900
- const a = r.reduce((i, { useScope: l, scopeName: d }) => {
3901
- const f = l(s)[`__scope${d}`];
3900
+ const a = r.reduce((i, { useScope: l, scopeName: u }) => {
3901
+ const f = l(s)[`__scope${u}`];
3902
3902
  return { ...i, ...f };
3903
3903
  }, {});
3904
3904
  return p.useMemo(() => ({ [`__scope${t.scopeName}`]: a }), [a]);
@@ -3915,20 +3915,20 @@ function is(e) {
3915
3915
  return /* @__PURE__ */ c(n, { scope: h, itemMap: C, collectionRef: R, children: y });
3916
3916
  };
3917
3917
  a.displayName = t;
3918
- const i = e + "CollectionSlot", l = /* @__PURE__ */ Pe(i), d = G.forwardRef(
3918
+ const i = e + "CollectionSlot", l = /* @__PURE__ */ Pe(i), u = G.forwardRef(
3919
3919
  (x, h) => {
3920
3920
  const { scope: y, children: R } = x, C = s(i, y), A = Y(h, C.collectionRef);
3921
3921
  return /* @__PURE__ */ c(l, { ref: A, children: R });
3922
3922
  }
3923
3923
  );
3924
- d.displayName = i;
3925
- const u = e + "CollectionItemSlot", f = "data-radix-collection-item", m = /* @__PURE__ */ Pe(u), g = G.forwardRef(
3924
+ u.displayName = i;
3925
+ const d = e + "CollectionItemSlot", f = "data-radix-collection-item", m = /* @__PURE__ */ Pe(d), g = G.forwardRef(
3926
3926
  (x, h) => {
3927
- const { scope: y, children: R, ...C } = x, A = G.useRef(null), P = Y(h, A), E = s(u, y);
3927
+ const { scope: y, children: R, ...C } = x, A = G.useRef(null), P = Y(h, A), E = s(d, y);
3928
3928
  return G.useEffect(() => (E.itemMap.set(A, { ref: A, ...C }), () => void E.itemMap.delete(A))), /* @__PURE__ */ c(m, { [f]: "", ref: P, children: R });
3929
3929
  }
3930
3930
  );
3931
- g.displayName = u;
3931
+ g.displayName = d;
3932
3932
  function k(x) {
3933
3933
  const h = s(e + "CollectionConsumer", x);
3934
3934
  return G.useCallback(() => {
@@ -3941,7 +3941,7 @@ function is(e) {
3941
3941
  }, [h.collectionRef, h.itemMap]);
3942
3942
  }
3943
3943
  return [
3944
- { Provider: a, Slot: d, ItemSlot: g },
3944
+ { Provider: a, Slot: u, ItemSlot: g },
3945
3945
  k,
3946
3946
  r
3947
3947
  ];
@@ -3966,26 +3966,26 @@ function io({
3966
3966
  onChange: o
3967
3967
  }), i = e !== void 0, l = i ? e : n;
3968
3968
  {
3969
- const u = p.useRef(e !== void 0);
3969
+ const d = p.useRef(e !== void 0);
3970
3970
  p.useEffect(() => {
3971
- const f = u.current;
3971
+ const f = d.current;
3972
3972
  f !== i && console.warn(
3973
3973
  `${r} is changing from ${f ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
3974
- ), u.current = i;
3974
+ ), d.current = i;
3975
3975
  }, [i, r]);
3976
3976
  }
3977
- const d = p.useCallback(
3978
- (u) => {
3977
+ const u = p.useCallback(
3978
+ (d) => {
3979
3979
  var f;
3980
3980
  if (i) {
3981
- const m = ds(u) ? u(e) : u;
3981
+ const m = ds(d) ? d(e) : d;
3982
3982
  m !== e && ((f = a.current) == null || f.call(a, m));
3983
3983
  } else
3984
- s(u);
3984
+ s(d);
3985
3985
  },
3986
3986
  [i, e, s, a]
3987
3987
  );
3988
- return [l, d];
3988
+ return [l, u];
3989
3989
  }
3990
3990
  function cs({
3991
3991
  defaultProp: e,
@@ -4025,22 +4025,22 @@ function fs(e) {
4025
4025
  }
4026
4026
  });
4027
4027
  return p.useEffect(() => {
4028
- const d = Ae(r.current);
4029
- s.current = i === "mounted" ? d : "none";
4028
+ const u = Ae(r.current);
4029
+ s.current = i === "mounted" ? u : "none";
4030
4030
  }, [i]), oe(() => {
4031
- const d = r.current, u = n.current;
4032
- if (u !== e) {
4033
- const m = s.current, g = Ae(d);
4034
- e ? l("MOUNT") : g === "none" || (d == null ? void 0 : d.display) === "none" ? l("UNMOUNT") : l(u && m !== g ? "ANIMATION_OUT" : "UNMOUNT"), n.current = e;
4031
+ const u = r.current, d = n.current;
4032
+ if (d !== e) {
4033
+ const m = s.current, g = Ae(u);
4034
+ e ? l("MOUNT") : g === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(d && m !== g ? "ANIMATION_OUT" : "UNMOUNT"), n.current = e;
4035
4035
  }
4036
4036
  }, [e, l]), oe(() => {
4037
4037
  if (t) {
4038
- let d;
4039
- const u = t.ownerDocument.defaultView ?? window, f = (g) => {
4038
+ let u;
4039
+ const d = t.ownerDocument.defaultView ?? window, f = (g) => {
4040
4040
  const x = Ae(r.current).includes(CSS.escape(g.animationName));
4041
4041
  if (g.target === t && x && (l("ANIMATION_END"), !n.current)) {
4042
4042
  const h = t.style.animationFillMode;
4043
- t.style.animationFillMode = "forwards", d = u.setTimeout(() => {
4043
+ t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
4044
4044
  t.style.animationFillMode === "forwards" && (t.style.animationFillMode = h);
4045
4045
  });
4046
4046
  }
@@ -4048,14 +4048,14 @@ function fs(e) {
4048
4048
  g.target === t && (s.current = Ae(r.current));
4049
4049
  };
4050
4050
  return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
4051
- u.clearTimeout(d), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
4051
+ d.clearTimeout(u), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
4052
4052
  };
4053
4053
  } else
4054
4054
  l("ANIMATION_END");
4055
4055
  }, [t, l]), {
4056
4056
  isPresent: ["mounted", "unmountSuspended"].includes(i),
4057
- ref: p.useCallback((d) => {
4058
- r.current = d ? getComputedStyle(d) : null, o(d);
4057
+ ref: p.useCallback((u) => {
4058
+ r.current = u ? getComputedStyle(u) : null, o(u);
4059
4059
  }, [])
4060
4060
  };
4061
4061
  }
@@ -4134,11 +4134,11 @@ function bs() {
4134
4134
  return !0;
4135
4135
  }
4136
4136
  }
4137
- function d(f, m) {
4137
+ function u(f, m) {
4138
4138
  return m();
4139
4139
  }
4140
- var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : i;
4141
- return je.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u, je;
4140
+ var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : i;
4141
+ return je.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : d, je;
4142
4142
  }
4143
4143
  var Et;
4144
4144
  function vs() {
@@ -4174,8 +4174,8 @@ uo.displayName = nt;
4174
4174
  var fo = "AvatarImage", mo = p.forwardRef(
4175
4175
  (e, t) => {
4176
4176
  const { __scopeAvatar: o, src: r, onLoadingStatusChange: n = () => {
4177
- }, ...s } = e, a = co(fo, o), i = Cs(r, s), l = J((d) => {
4178
- n(d), a.onImageLoadingStatusChange(d);
4177
+ }, ...s } = e, a = co(fo, o), i = Cs(r, s), l = J((u) => {
4178
+ n(u), a.onImageLoadingStatusChange(u);
4179
4179
  });
4180
4180
  return oe(() => {
4181
4181
  i !== "idle" && l(i);
@@ -4209,9 +4209,9 @@ function Cs(e, { referrerPolicy: t, crossOrigin: o }) {
4209
4209
  i(f);
4210
4210
  };
4211
4211
  if (!s) return;
4212
- const d = l("loaded"), u = l("error");
4213
- return s.addEventListener("load", d), s.addEventListener("error", u), t && (s.referrerPolicy = t), typeof o == "string" && (s.crossOrigin = o), () => {
4214
- s.removeEventListener("load", d), s.removeEventListener("error", u);
4212
+ const u = l("loaded"), d = l("error");
4213
+ return s.addEventListener("load", u), s.addEventListener("error", d), t && (s.referrerPolicy = t), typeof o == "string" && (s.crossOrigin = o), () => {
4214
+ s.removeEventListener("load", u), s.removeEventListener("error", d);
4215
4215
  };
4216
4216
  }, [s, o, t]), a;
4217
4217
  }
@@ -4231,15 +4231,15 @@ var Ts = p.forwardRef((e, t) => {
4231
4231
  currentTabStopId: a,
4232
4232
  defaultCurrentTabStopId: i,
4233
4233
  onCurrentTabStopIdChange: l,
4234
- onEntryFocus: d,
4235
- preventScrollOnEntryFocus: u = !1,
4234
+ onEntryFocus: u,
4235
+ preventScrollOnEntryFocus: d = !1,
4236
4236
  ...f
4237
4237
  } = e, m = p.useRef(null), g = Y(t, m), k = rt(s), [x, h] = io({
4238
4238
  prop: a,
4239
4239
  defaultProp: i ?? null,
4240
4240
  onChange: l,
4241
4241
  caller: be
4242
- }), [y, R] = p.useState(!1), C = J(d), A = go(o), P = p.useRef(!1), [E, _] = p.useState(0);
4242
+ }), [y, R] = p.useState(!1), C = J(u), A = go(o), P = p.useRef(!1), [E, _] = p.useState(0);
4243
4243
  return p.useEffect(() => {
4244
4244
  const b = m.current;
4245
4245
  if (b)
@@ -4284,7 +4284,7 @@ var Ts = p.forwardRef((e, t) => {
4284
4284
  const O = A().filter(($) => $.focusable), Z = O.find(($) => $.active), ve = O.find(($) => $.id === x), Q = [Z, ve, ...O].filter(
4285
4285
  Boolean
4286
4286
  ).map(($) => $.ref.current);
4287
- yo(Q, u);
4287
+ yo(Q, d);
4288
4288
  }
4289
4289
  }
4290
4290
  P.current = !1;
@@ -4303,7 +4303,7 @@ var Ts = p.forwardRef((e, t) => {
4303
4303
  tabStopId: s,
4304
4304
  children: a,
4305
4305
  ...i
4306
- } = e, l = lo(), d = s || l, u = zs(xo, o), f = u.currentTabStopId === d, m = go(o), { onFocusableItemAdd: g, onFocusableItemRemove: k, currentTabStopId: x } = u;
4306
+ } = e, l = lo(), u = s || l, d = zs(xo, o), f = d.currentTabStopId === u, m = go(o), { onFocusableItemAdd: g, onFocusableItemRemove: k, currentTabStopId: x } = d;
4307
4307
  return p.useEffect(() => {
4308
4308
  if (r)
4309
4309
  return g(), () => k();
@@ -4311,27 +4311,27 @@ var Ts = p.forwardRef((e, t) => {
4311
4311
  Ze.ItemSlot,
4312
4312
  {
4313
4313
  scope: o,
4314
- id: d,
4314
+ id: u,
4315
4315
  focusable: r,
4316
4316
  active: n,
4317
4317
  children: /* @__PURE__ */ c(
4318
4318
  j.span,
4319
4319
  {
4320
4320
  tabIndex: f ? 0 : -1,
4321
- "data-orientation": u.orientation,
4321
+ "data-orientation": d.orientation,
4322
4322
  ...i,
4323
4323
  ref: t,
4324
4324
  onMouseDown: W(e.onMouseDown, (h) => {
4325
- r ? u.onItemFocus(d) : h.preventDefault();
4325
+ r ? d.onItemFocus(u) : h.preventDefault();
4326
4326
  }),
4327
- onFocus: W(e.onFocus, () => u.onItemFocus(d)),
4327
+ onFocus: W(e.onFocus, () => d.onItemFocus(u)),
4328
4328
  onKeyDown: W(e.onKeyDown, (h) => {
4329
4329
  if (h.key === "Tab" && h.shiftKey) {
4330
- u.onItemShiftTab();
4330
+ d.onItemShiftTab();
4331
4331
  return;
4332
4332
  }
4333
4333
  if (h.target !== h.currentTarget) return;
4334
- const y = Os(h, u.orientation, u.dir);
4334
+ const y = Os(h, d.orientation, d.dir);
4335
4335
  if (y !== void 0) {
4336
4336
  if (h.metaKey || h.ctrlKey || h.altKey || h.shiftKey) return;
4337
4337
  h.preventDefault();
@@ -4340,7 +4340,7 @@ var Ts = p.forwardRef((e, t) => {
4340
4340
  else if (y === "prev" || y === "next") {
4341
4341
  y === "prev" && C.reverse();
4342
4342
  const A = C.indexOf(h.currentTarget);
4343
- C = u.loop ? $s(C, A + 1) : C.slice(A + 1);
4343
+ C = d.loop ? $s(C, A + 1) : C.slice(A + 1);
4344
4344
  }
4345
4345
  setTimeout(() => yo(C));
4346
4346
  }
@@ -4394,7 +4394,7 @@ var st = "ScrollArea", [ko] = ge(st), [Hs, q] = ko(st), So = p.forwardRef(
4394
4394
  dir: n,
4395
4395
  scrollHideDelay: s = 600,
4396
4396
  ...a
4397
- } = e, [i, l] = p.useState(null), [d, u] = p.useState(null), [f, m] = p.useState(null), [g, k] = p.useState(null), [x, h] = p.useState(null), [y, R] = p.useState(0), [C, A] = p.useState(0), [P, E] = p.useState(!1), [_, b] = p.useState(!1), S = Y(t, (O) => l(O)), M = rt(n);
4397
+ } = e, [i, l] = p.useState(null), [u, d] = p.useState(null), [f, m] = p.useState(null), [g, k] = p.useState(null), [x, h] = p.useState(null), [y, R] = p.useState(0), [C, A] = p.useState(0), [P, E] = p.useState(!1), [_, b] = p.useState(!1), S = Y(t, (O) => l(O)), M = rt(n);
4398
4398
  return /* @__PURE__ */ c(
4399
4399
  Hs,
4400
4400
  {
@@ -4403,8 +4403,8 @@ var st = "ScrollArea", [ko] = ge(st), [Hs, q] = ko(st), So = p.forwardRef(
4403
4403
  dir: M,
4404
4404
  scrollHideDelay: s,
4405
4405
  scrollArea: i,
4406
- viewport: d,
4407
- onViewportChange: u,
4406
+ viewport: u,
4407
+ onViewportChange: d,
4408
4408
  content: f,
4409
4409
  onContentChange: m,
4410
4410
  scrollbarX: g,
@@ -4494,13 +4494,13 @@ var Vs = p.forwardRef((e, t) => {
4494
4494
  const i = n.scrollArea;
4495
4495
  let l = 0;
4496
4496
  if (i) {
4497
- const d = () => {
4497
+ const u = () => {
4498
4498
  window.clearTimeout(l), a(!0);
4499
- }, u = () => {
4499
+ }, d = () => {
4500
4500
  l = window.setTimeout(() => a(!1), n.scrollHideDelay);
4501
4501
  };
4502
- return i.addEventListener("pointerenter", d), i.addEventListener("pointerleave", u), () => {
4503
- window.clearTimeout(l), i.removeEventListener("pointerenter", d), i.removeEventListener("pointerleave", u);
4502
+ return i.addEventListener("pointerenter", u), i.addEventListener("pointerleave", d), () => {
4503
+ window.clearTimeout(l), i.removeEventListener("pointerenter", u), i.removeEventListener("pointerleave", d);
4504
4504
  };
4505
4505
  }
4506
4506
  }, [n.scrollArea, n.scrollHideDelay]), /* @__PURE__ */ c(ue, { present: o || s, children: /* @__PURE__ */ c(
@@ -4532,18 +4532,18 @@ var Vs = p.forwardRef((e, t) => {
4532
4532
  });
4533
4533
  return p.useEffect(() => {
4534
4534
  if (i === "idle") {
4535
- const d = window.setTimeout(() => l("HIDE"), n.scrollHideDelay);
4536
- return () => window.clearTimeout(d);
4535
+ const u = window.setTimeout(() => l("HIDE"), n.scrollHideDelay);
4536
+ return () => window.clearTimeout(u);
4537
4537
  }
4538
4538
  }, [i, n.scrollHideDelay, l]), p.useEffect(() => {
4539
- const d = n.viewport, u = s ? "scrollLeft" : "scrollTop";
4540
- if (d) {
4541
- let f = d[u];
4539
+ const u = n.viewport, d = s ? "scrollLeft" : "scrollTop";
4540
+ if (u) {
4541
+ let f = u[d];
4542
4542
  const m = () => {
4543
- const g = d[u];
4543
+ const g = u[d];
4544
4544
  f !== g && (l("SCROLL"), a()), f = g;
4545
4545
  };
4546
- return d.addEventListener("scroll", m), () => d.removeEventListener("scroll", m);
4546
+ return u.addEventListener("scroll", m), () => u.removeEventListener("scroll", m);
4547
4547
  }
4548
4548
  }, [n.viewport, s, l, a]), /* @__PURE__ */ c(ue, { present: o || i !== "hidden", children: /* @__PURE__ */ c(
4549
4549
  at,
@@ -4558,8 +4558,8 @@ var Vs = p.forwardRef((e, t) => {
4558
4558
  }), Ao = p.forwardRef((e, t) => {
4559
4559
  const o = q(X, e.__scopeScrollArea), { forceMount: r, ...n } = e, [s, a] = p.useState(!1), i = e.orientation === "horizontal", l = Le(() => {
4560
4560
  if (o.viewport) {
4561
- const d = o.viewport.offsetWidth < o.viewport.scrollWidth, u = o.viewport.offsetHeight < o.viewport.scrollHeight;
4562
- a(i ? d : u);
4561
+ const u = o.viewport.offsetWidth < o.viewport.scrollWidth, d = o.viewport.offsetHeight < o.viewport.scrollHeight;
4562
+ a(i ? u : d);
4563
4563
  }
4564
4564
  }, 10);
4565
4565
  return de(o.viewport, l), de(o.content, l), /* @__PURE__ */ c(ue, { present: r || s, children: /* @__PURE__ */ c(
@@ -4575,11 +4575,11 @@ var Vs = p.forwardRef((e, t) => {
4575
4575
  content: 0,
4576
4576
  viewport: 0,
4577
4577
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
4578
- }), d = zo(i.viewport, i.content), u = {
4578
+ }), u = zo(i.viewport, i.content), d = {
4579
4579
  ...r,
4580
4580
  sizes: i,
4581
4581
  onSizesChange: l,
4582
- hasThumb: d > 0 && d < 1,
4582
+ hasThumb: u > 0 && u < 1,
4583
4583
  onThumbChange: (m) => s.current = m,
4584
4584
  onThumbPointerUp: () => a.current = 0,
4585
4585
  onThumbPointerDown: (m) => a.current = m
@@ -4590,7 +4590,7 @@ var Vs = p.forwardRef((e, t) => {
4590
4590
  return o === "horizontal" ? /* @__PURE__ */ c(
4591
4591
  Bs,
4592
4592
  {
4593
- ...u,
4593
+ ...d,
4594
4594
  ref: t,
4595
4595
  onThumbPositionChange: () => {
4596
4596
  if (n.viewport && s.current) {
@@ -4608,7 +4608,7 @@ var Vs = p.forwardRef((e, t) => {
4608
4608
  ) : o === "vertical" ? /* @__PURE__ */ c(
4609
4609
  Gs,
4610
4610
  {
4611
- ...u,
4611
+ ...d,
4612
4612
  ref: t,
4613
4613
  onThumbPositionChange: () => {
4614
4614
  if (n.viewport && s.current) {
@@ -4625,7 +4625,7 @@ var Vs = p.forwardRef((e, t) => {
4625
4625
  }
4626
4626
  ) : null;
4627
4627
  }), Bs = p.forwardRef((e, t) => {
4628
- const { sizes: o, onSizesChange: r, ...n } = e, s = q(X, e.__scopeScrollArea), [a, i] = p.useState(), l = p.useRef(null), d = Y(t, l, s.onScrollbarXChange);
4628
+ const { sizes: o, onSizesChange: r, ...n } = e, s = q(X, e.__scopeScrollArea), [a, i] = p.useState(), l = p.useRef(null), u = Y(t, l, s.onScrollbarXChange);
4629
4629
  return p.useEffect(() => {
4630
4630
  l.current && i(getComputedStyle(l.current));
4631
4631
  }, [l]), /* @__PURE__ */ c(
@@ -4633,7 +4633,7 @@ var Vs = p.forwardRef((e, t) => {
4633
4633
  {
4634
4634
  "data-orientation": "horizontal",
4635
4635
  ...n,
4636
- ref: d,
4636
+ ref: u,
4637
4637
  sizes: o,
4638
4638
  style: {
4639
4639
  bottom: 0,
@@ -4642,12 +4642,12 @@ var Vs = p.forwardRef((e, t) => {
4642
4642
  "--radix-scroll-area-thumb-width": Me(o) + "px",
4643
4643
  ...e.style
4644
4644
  },
4645
- onThumbPointerDown: (u) => e.onThumbPointerDown(u.x),
4646
- onDragScroll: (u) => e.onDragScroll(u.x),
4647
- onWheelScroll: (u, f) => {
4645
+ onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
4646
+ onDragScroll: (d) => e.onDragScroll(d.x),
4647
+ onWheelScroll: (d, f) => {
4648
4648
  if (s.viewport) {
4649
- const m = s.viewport.scrollLeft + u.deltaX;
4650
- e.onWheelScroll(m), Mo(m, f) && u.preventDefault();
4649
+ const m = s.viewport.scrollLeft + d.deltaX;
4650
+ e.onWheelScroll(m), Mo(m, f) && d.preventDefault();
4651
4651
  }
4652
4652
  },
4653
4653
  onResize: () => {
@@ -4664,7 +4664,7 @@ var Vs = p.forwardRef((e, t) => {
4664
4664
  }
4665
4665
  );
4666
4666
  }), Gs = p.forwardRef((e, t) => {
4667
- const { sizes: o, onSizesChange: r, ...n } = e, s = q(X, e.__scopeScrollArea), [a, i] = p.useState(), l = p.useRef(null), d = Y(t, l, s.onScrollbarYChange);
4667
+ const { sizes: o, onSizesChange: r, ...n } = e, s = q(X, e.__scopeScrollArea), [a, i] = p.useState(), l = p.useRef(null), u = Y(t, l, s.onScrollbarYChange);
4668
4668
  return p.useEffect(() => {
4669
4669
  l.current && i(getComputedStyle(l.current));
4670
4670
  }, [l]), /* @__PURE__ */ c(
@@ -4672,7 +4672,7 @@ var Vs = p.forwardRef((e, t) => {
4672
4672
  {
4673
4673
  "data-orientation": "vertical",
4674
4674
  ...n,
4675
- ref: d,
4675
+ ref: u,
4676
4676
  sizes: o,
4677
4677
  style: {
4678
4678
  top: 0,
@@ -4682,12 +4682,12 @@ var Vs = p.forwardRef((e, t) => {
4682
4682
  "--radix-scroll-area-thumb-height": Me(o) + "px",
4683
4683
  ...e.style
4684
4684
  },
4685
- onThumbPointerDown: (u) => e.onThumbPointerDown(u.y),
4686
- onDragScroll: (u) => e.onDragScroll(u.y),
4687
- onWheelScroll: (u, f) => {
4685
+ onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
4686
+ onDragScroll: (d) => e.onDragScroll(d.y),
4687
+ onWheelScroll: (d, f) => {
4688
4688
  if (s.viewport) {
4689
- const m = s.viewport.scrollTop + u.deltaY;
4690
- e.onWheelScroll(m), Mo(m, f) && u.preventDefault();
4689
+ const m = s.viewport.scrollTop + d.deltaY;
4690
+ e.onWheelScroll(m), Mo(m, f) && d.preventDefault();
4691
4691
  }
4692
4692
  },
4693
4693
  onResize: () => {
@@ -4712,15 +4712,15 @@ var Vs = p.forwardRef((e, t) => {
4712
4712
  onThumbPointerUp: a,
4713
4713
  onThumbPointerDown: i,
4714
4714
  onThumbPositionChange: l,
4715
- onDragScroll: d,
4716
- onWheelScroll: u,
4715
+ onDragScroll: u,
4716
+ onWheelScroll: d,
4717
4717
  onResize: f,
4718
4718
  ...m
4719
- } = e, g = q(X, o), [k, x] = p.useState(null), h = Y(t, (S) => x(S)), y = p.useRef(null), R = p.useRef(""), C = g.viewport, A = r.content - r.viewport, P = J(u), E = J(l), _ = Le(f, 10);
4719
+ } = e, g = q(X, o), [k, x] = p.useState(null), h = Y(t, (S) => x(S)), y = p.useRef(null), R = p.useRef(""), C = g.viewport, A = r.content - r.viewport, P = J(d), E = J(l), _ = Le(f, 10);
4720
4720
  function b(S) {
4721
4721
  if (y.current) {
4722
4722
  const M = S.clientX - y.current.left, O = S.clientY - y.current.top;
4723
- d({ x: M, y: O });
4723
+ u({ x: M, y: O });
4724
4724
  }
4725
4725
  }
4726
4726
  return p.useEffect(() => {
@@ -4767,21 +4767,21 @@ var Vs = p.forwardRef((e, t) => {
4767
4767
  const { __scopeScrollArea: o, style: r, ...n } = e, s = q(ze, o), a = Ro(ze, o), { onThumbPositionChange: i } = a, l = Y(
4768
4768
  t,
4769
4769
  (f) => a.onThumbChange(f)
4770
- ), d = p.useRef(void 0), u = Le(() => {
4771
- d.current && (d.current(), d.current = void 0);
4770
+ ), u = p.useRef(void 0), d = Le(() => {
4771
+ u.current && (u.current(), u.current = void 0);
4772
4772
  }, 100);
4773
4773
  return p.useEffect(() => {
4774
4774
  const f = s.viewport;
4775
4775
  if (f) {
4776
4776
  const m = () => {
4777
- if (u(), !d.current) {
4777
+ if (d(), !u.current) {
4778
4778
  const g = Ks(f, i);
4779
- d.current = g, i();
4779
+ u.current = g, i();
4780
4780
  }
4781
4781
  };
4782
4782
  return i(), f.addEventListener("scroll", m), () => f.removeEventListener("scroll", m);
4783
4783
  }
4784
- }, [s.viewport, u, i]), /* @__PURE__ */ c(
4784
+ }, [s.viewport, d, i]), /* @__PURE__ */ c(
4785
4785
  j.div,
4786
4786
  {
4787
4787
  "data-state": a.hasThumb ? "visible" : "hidden",
@@ -4810,16 +4810,16 @@ var it = "ScrollAreaCorner", Po = p.forwardRef(
4810
4810
  );
4811
4811
  Po.displayName = it;
4812
4812
  var Xs = p.forwardRef((e, t) => {
4813
- const { __scopeScrollArea: o, ...r } = e, n = q(it, o), [s, a] = p.useState(0), [i, l] = p.useState(0), d = !!(s && i);
4813
+ const { __scopeScrollArea: o, ...r } = e, n = q(it, o), [s, a] = p.useState(0), [i, l] = p.useState(0), u = !!(s && i);
4814
4814
  return de(n.scrollbarX, () => {
4815
4815
  var f;
4816
- const u = ((f = n.scrollbarX) == null ? void 0 : f.offsetHeight) || 0;
4817
- n.onCornerHeightChange(u), l(u);
4816
+ const d = ((f = n.scrollbarX) == null ? void 0 : f.offsetHeight) || 0;
4817
+ n.onCornerHeightChange(d), l(d);
4818
4818
  }), de(n.scrollbarY, () => {
4819
4819
  var f;
4820
- const u = ((f = n.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
4821
- n.onCornerWidthChange(u), a(u);
4822
- }), d ? /* @__PURE__ */ c(
4820
+ const d = ((f = n.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
4821
+ n.onCornerWidthChange(d), a(d);
4822
+ }), u ? /* @__PURE__ */ c(
4823
4823
  j.div,
4824
4824
  {
4825
4825
  ...r,
@@ -4848,12 +4848,12 @@ function Me(e) {
4848
4848
  return Math.max(r, 18);
4849
4849
  }
4850
4850
  function Zs(e, t, o, r = "ltr") {
4851
- const n = Me(o), s = n / 2, a = t || s, i = n - a, l = o.scrollbar.paddingStart + a, d = o.scrollbar.size - o.scrollbar.paddingEnd - i, u = o.content - o.viewport, f = r === "ltr" ? [0, u] : [u * -1, 0];
4852
- return To([l, d], f)(e);
4851
+ const n = Me(o), s = n / 2, a = t || s, i = n - a, l = o.scrollbar.paddingStart + a, u = o.scrollbar.size - o.scrollbar.paddingEnd - i, d = o.content - o.viewport, f = r === "ltr" ? [0, d] : [d * -1, 0];
4852
+ return To([l, u], f)(e);
4853
4853
  }
4854
4854
  function At(e, t, o = "ltr") {
4855
- const r = Me(t), n = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - n, a = t.content - t.viewport, i = s - r, l = o === "ltr" ? [0, a] : [a * -1, 0], d = Us(e, l);
4856
- return To([0, a], [0, i])(d);
4855
+ const r = Me(t), n = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - n, a = t.content - t.viewport, i = s - r, l = o === "ltr" ? [0, a] : [a * -1, 0], u = Us(e, l);
4856
+ return To([0, a], [0, i])(u);
4857
4857
  }
4858
4858
  function To(e, t) {
4859
4859
  return (o) => {
@@ -4921,8 +4921,8 @@ var na = Lo, Oe = "Tabs", [sa] = ge(Oe, [
4921
4921
  orientation: a = "horizontal",
4922
4922
  dir: i,
4923
4923
  activationMode: l = "automatic",
4924
- ...d
4925
- } = e, u = rt(i), [f, m] = io({
4924
+ ...u
4925
+ } = e, d = rt(i), [f, m] = io({
4926
4926
  prop: r,
4927
4927
  onChange: n,
4928
4928
  defaultProp: s ?? "",
@@ -4936,14 +4936,14 @@ var na = Lo, Oe = "Tabs", [sa] = ge(Oe, [
4936
4936
  value: f,
4937
4937
  onValueChange: m,
4938
4938
  orientation: a,
4939
- dir: u,
4939
+ dir: d,
4940
4940
  activationMode: l,
4941
4941
  children: /* @__PURE__ */ c(
4942
4942
  j.div,
4943
4943
  {
4944
- dir: u,
4944
+ dir: d,
4945
4945
  "data-orientation": a,
4946
- ...d,
4946
+ ...u,
4947
4947
  ref: t
4948
4948
  }
4949
4949
  )
@@ -4979,22 +4979,22 @@ var Fo = "TabsList", Do = p.forwardRef(
4979
4979
  Do.displayName = Fo;
4980
4980
  var Uo = "TabsTrigger", Wo = p.forwardRef(
4981
4981
  (e, t) => {
4982
- const { __scopeTabs: o, value: r, disabled: n = !1, ...s } = e, a = lt(Uo, o), i = Oo(o), l = jo(a.baseId, r), d = Bo(a.baseId, r), u = r === a.value;
4982
+ const { __scopeTabs: o, value: r, disabled: n = !1, ...s } = e, a = lt(Uo, o), i = Oo(o), l = jo(a.baseId, r), u = Bo(a.baseId, r), d = r === a.value;
4983
4983
  return /* @__PURE__ */ c(
4984
4984
  Ds,
4985
4985
  {
4986
4986
  asChild: !0,
4987
4987
  ...i,
4988
4988
  focusable: !n,
4989
- active: u,
4989
+ active: d,
4990
4990
  children: /* @__PURE__ */ c(
4991
4991
  j.button,
4992
4992
  {
4993
4993
  type: "button",
4994
4994
  role: "tab",
4995
- "aria-selected": u,
4996
- "aria-controls": d,
4997
- "data-state": u ? "active" : "inactive",
4995
+ "aria-selected": d,
4996
+ "aria-controls": u,
4997
+ "data-state": d ? "active" : "inactive",
4998
4998
  "data-disabled": n ? "" : void 0,
4999
4999
  disabled: n,
5000
5000
  id: l,
@@ -5008,7 +5008,7 @@ var Uo = "TabsTrigger", Wo = p.forwardRef(
5008
5008
  }),
5009
5009
  onFocus: W(e.onFocus, () => {
5010
5010
  const f = a.activationMode !== "manual";
5011
- !u && !n && f && a.onValueChange(r);
5011
+ !d && !n && f && a.onValueChange(r);
5012
5012
  })
5013
5013
  }
5014
5014
  )
@@ -5019,19 +5019,19 @@ var Uo = "TabsTrigger", Wo = p.forwardRef(
5019
5019
  Wo.displayName = Uo;
5020
5020
  var Ho = "TabsContent", Vo = p.forwardRef(
5021
5021
  (e, t) => {
5022
- const { __scopeTabs: o, value: r, forceMount: n, children: s, ...a } = e, i = lt(Ho, o), l = jo(i.baseId, r), d = Bo(i.baseId, r), u = r === i.value, f = p.useRef(u);
5022
+ const { __scopeTabs: o, value: r, forceMount: n, children: s, ...a } = e, i = lt(Ho, o), l = jo(i.baseId, r), u = Bo(i.baseId, r), d = r === i.value, f = p.useRef(d);
5023
5023
  return p.useEffect(() => {
5024
5024
  const m = requestAnimationFrame(() => f.current = !1);
5025
5025
  return () => cancelAnimationFrame(m);
5026
- }, []), /* @__PURE__ */ c(ue, { present: n || u, children: ({ present: m }) => /* @__PURE__ */ c(
5026
+ }, []), /* @__PURE__ */ c(ue, { present: n || d, children: ({ present: m }) => /* @__PURE__ */ c(
5027
5027
  j.div,
5028
5028
  {
5029
- "data-state": u ? "active" : "inactive",
5029
+ "data-state": d ? "active" : "inactive",
5030
5030
  "data-orientation": i.orientation,
5031
5031
  role: "tabpanel",
5032
5032
  "aria-labelledby": l,
5033
5033
  hidden: !m,
5034
- id: d,
5034
+ id: u,
5035
5035
  tabIndex: 0,
5036
5036
  ...a,
5037
5037
  ref: t,
@@ -5515,17 +5515,17 @@ const qo = {
5515
5515
  Ya();
5516
5516
  }, []), B(() => {
5517
5517
  if (typeof window > "u") return;
5518
- const u = () => {
5518
+ const d = () => {
5519
5519
  const m = $t(window.location.search);
5520
5520
  r(m);
5521
5521
  };
5522
- u();
5523
- const f = () => u();
5522
+ d();
5523
+ const f = () => d();
5524
5524
  return window.addEventListener("popstate", f), () => window.removeEventListener("popstate", f);
5525
5525
  }, []), o.length === 0)
5526
5526
  return null;
5527
- const d = (u) => {
5528
- if (u.stopPropagation(), typeof window > "u") return;
5527
+ const u = (d) => {
5528
+ if (d.stopPropagation(), typeof window > "u") return;
5529
5529
  const f = new URL(window.location.href);
5530
5530
  f.searchParams.delete("_stackable_dev"), window.location.href = f.toString();
5531
5531
  };
@@ -5561,7 +5561,7 @@ const qo = {
5561
5561
  width: "420px",
5562
5562
  maxWidth: "90vw"
5563
5563
  },
5564
- children: o.map((u, f) => {
5564
+ children: o.map((d, f) => {
5565
5565
  var m;
5566
5566
  return /* @__PURE__ */ z(
5567
5567
  "div",
@@ -5583,7 +5583,7 @@ const qo = {
5583
5583
  overflow: "hidden",
5584
5584
  textOverflow: "ellipsis"
5585
5585
  },
5586
- children: ((m = t.find((g) => g.id === u.extensionId)) == null ? void 0 : m.manifest.name) || u.extensionId
5586
+ children: ((m = t.find((g) => g.id === d.extensionId)) == null ? void 0 : m.manifest.name) || d.extensionId
5587
5587
  }
5588
5588
  ),
5589
5589
  /* @__PURE__ */ z(
@@ -5598,16 +5598,16 @@ const qo = {
5598
5598
  overflow: "hidden",
5599
5599
  textOverflow: "ellipsis"
5600
5600
  },
5601
- title: u.bundleUrl,
5601
+ title: d.bundleUrl,
5602
5602
  children: [
5603
5603
  "→ ",
5604
- u.bundleUrl
5604
+ d.bundleUrl
5605
5605
  ]
5606
5606
  }
5607
5607
  )
5608
5608
  ]
5609
5609
  },
5610
- u.extensionId
5610
+ d.extensionId
5611
5611
  );
5612
5612
  })
5613
5613
  }
@@ -5654,7 +5654,7 @@ const qo = {
5654
5654
  /* @__PURE__ */ c(
5655
5655
  "button",
5656
5656
  {
5657
- onClick: d,
5657
+ onClick: u,
5658
5658
  style: {
5659
5659
  marginLeft: "4px",
5660
5660
  backgroundColor: "rgba(0, 0, 0, 0.15)",
@@ -5668,11 +5668,11 @@ const qo = {
5668
5668
  fontFamily: "inherit",
5669
5669
  transition: "background-color 0.1s ease"
5670
5670
  },
5671
- onMouseOver: (u) => {
5672
- u.currentTarget.style.backgroundColor = "rgba(0, 0, 0, 0.25)";
5671
+ onMouseOver: (d) => {
5672
+ d.currentTarget.style.backgroundColor = "rgba(0, 0, 0, 0.25)";
5673
5673
  },
5674
- onMouseOut: (u) => {
5675
- u.currentTarget.style.backgroundColor = "rgba(0, 0, 0, 0.15)";
5674
+ onMouseOut: (d) => {
5675
+ d.currentTarget.style.backgroundColor = "rgba(0, 0, 0, 0.15)";
5676
5676
  },
5677
5677
  children: "Clear"
5678
5678
  }
@@ -5692,22 +5692,22 @@ const qo = {
5692
5692
  customerId: s,
5693
5693
  customerEmail: a
5694
5694
  }) => {
5695
- const [i, l] = U([]), [d, u] = U(!1);
5695
+ const [i, l] = U([]), [u, d] = U(!1);
5696
5696
  B(() => {
5697
5697
  (async () => {
5698
5698
  const g = e;
5699
5699
  try {
5700
5700
  if (!g) {
5701
- console.warn("[ExtensionSetup] No instanceId provided; loading no extensions"), l([]), u(!0);
5701
+ console.warn("[ExtensionSetup] No instanceId provided; loading no extensions"), l([]), d(!0);
5702
5702
  return;
5703
5703
  }
5704
5704
  if (!t || !r) {
5705
- console.warn("[ExtensionSetup] apiBase and appId are required to load extensions"), l([]), u(!0);
5705
+ console.warn("[ExtensionSetup] apiBase and appId are required to load extensions"), l([]), d(!0);
5706
5706
  return;
5707
5707
  }
5708
5708
  const k = await fetch(zt(t, `/instances/${r}/${g}`));
5709
5709
  if (!k.ok) {
5710
- console.warn(`[ExtensionSetup] Instance not found or failed to load: ${g}`), l([]), u(!0);
5710
+ console.warn(`[ExtensionSetup] Instance not found or failed to load: ${g}`), l([]), d(!0);
5711
5711
  return;
5712
5712
  }
5713
5713
  const x = await k.json(), h = $t(typeof window < "u" ? window.location.search : ""), y = dr(x, h);
@@ -5715,7 +5715,7 @@ const qo = {
5715
5715
  } catch (k) {
5716
5716
  console.error("Failed to load extensions:", k);
5717
5717
  } finally {
5718
- u(!0);
5718
+ d(!0);
5719
5719
  }
5720
5720
  })();
5721
5721
  }, [e, r, t]);
@@ -5767,7 +5767,7 @@ const qo = {
5767
5767
  }),
5768
5768
  [t, r, o, s, a]
5769
5769
  );
5770
- return d ? /* @__PURE__ */ z(he, { children: [
5770
+ return u ? /* @__PURE__ */ z(he, { children: [
5771
5771
  /* @__PURE__ */ c(ar, { extensions: i, capabilityHandlers: f, components: Ga(), children: n }),
5772
5772
  /* @__PURE__ */ c(Xa, { extensions: i })
5773
5773
  ] }) : null;
@@ -5809,33 +5809,33 @@ const qo = {
5809
5809
  (async () => {
5810
5810
  s(!0), i(null);
5811
5811
  try {
5812
- const d = await Xo({
5812
+ const u = await Xo({
5813
5813
  action: "getCustomer",
5814
5814
  customerId: e
5815
5815
  }, t);
5816
- r(d);
5817
- } catch (d) {
5818
- i(d);
5816
+ r(u);
5817
+ } catch (u) {
5818
+ i(u);
5819
5819
  } finally {
5820
5820
  s(!1);
5821
5821
  }
5822
5822
  })();
5823
5823
  }, [e, t]), { customer: o, loading: n, error: a };
5824
5824
  }, Qa = ({ customerId: e, customerEmail: t, hostBase: o, children: r }) => {
5825
- var l, d;
5825
+ var l, u;
5826
5826
  const { customer: n, loading: s, error: a } = Ja(e, o);
5827
5827
  if (s)
5828
5828
  return /* @__PURE__ */ c(me, { className: "border-none shadow-none bg-transparent", children: /* @__PURE__ */ c(pe, { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ c(Ut, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) });
5829
5829
  if (a || !n) {
5830
- const u = t ? t.split("@")[0] : e ? `Customer ${e.slice(-4)}` : "Customer", f = u.split(/[\s._-]+/).map((m) => m[0]).join("").slice(0, 2).toUpperCase();
5830
+ const d = t ? t.split("@")[0] : e ? `Customer ${e.slice(-4)}` : "Customer", f = d.split(/[\s._-]+/).map((m) => m[0]).join("").slice(0, 2).toUpperCase();
5831
5831
  return /* @__PURE__ */ c(me, { className: "border-none px-0 py-0 mb-4 shadow-none bg-transparent", children: /* @__PURE__ */ z(pe, { className: "p-4 pb-0 pt-2", children: [
5832
5832
  /* @__PURE__ */ z("div", { className: "flex flex-col items-center", children: [
5833
5833
  /* @__PURE__ */ z(Ke, { className: "h-16 w-16 mb-2 ring-2 ring-background shadow-sm", children: [
5834
5834
  /* @__PURE__ */ c(
5835
5835
  Je,
5836
5836
  {
5837
- src: `https://ui-avatars.com/api/?name=${encodeURIComponent(u)}&background=7c3aed&color=fff&size=128`,
5838
- alt: u
5837
+ src: `https://ui-avatars.com/api/?name=${encodeURIComponent(d)}&background=7c3aed&color=fff&size=128`,
5838
+ alt: d
5839
5839
  }
5840
5840
  ),
5841
5841
  /* @__PURE__ */ c(Qe, { className: "text-lg", children: f })
@@ -5843,7 +5843,7 @@ const qo = {
5843
5843
  /* @__PURE__ */ z("div", { className: "text-center w-full space-y-1", children: [
5844
5844
  /* @__PURE__ */ z("div", { children: [
5845
5845
  /* @__PURE__ */ c("p", { className: "text-xs text-foreground/70 font-medium tracking-wide", children: "Welcome," }),
5846
- /* @__PURE__ */ c("h2", { className: "text-lg font-bold text-foreground leading-tight", children: u })
5846
+ /* @__PURE__ */ c("h2", { className: "text-lg font-bold text-foreground leading-tight", children: d })
5847
5847
  ] }),
5848
5848
  t && /* @__PURE__ */ c("div", { className: "pt-2 flex flex-col items-center gap-1", children: /* @__PURE__ */ z("div", { className: "flex items-center justify-center gap-1.5 text-xs font-semibold text-foreground/75", children: [
5849
5849
  /* @__PURE__ */ c(Ye, { className: "h-3 w-3", "aria-hidden": "true" }),
@@ -5855,7 +5855,7 @@ const qo = {
5855
5855
  /* @__PURE__ */ c("p", { className: "pt-2 text-center text-xs text-muted-foreground", children: "Using fallback profile (customer API returned no data)" })
5856
5856
  ] }) });
5857
5857
  }
5858
- const i = `${((l = n.first_name) == null ? void 0 : l[0]) || ""}${((d = n.last_name) == null ? void 0 : d[0]) || ""}`;
5858
+ const i = `${((l = n.first_name) == null ? void 0 : l[0]) || ""}${((u = n.last_name) == null ? void 0 : u[0]) || ""}`;
5859
5859
  return /* @__PURE__ */ c(me, { className: "border-none px-0 py-0 mb-4 shadow-none bg-transparent", children: /* @__PURE__ */ c(pe, { className: "p-4 pb-0 pt-2", children: /* @__PURE__ */ z("div", { className: "flex flex-col items-center", children: [
5860
5860
  /* @__PURE__ */ z(Ke, { className: "h-16 w-16 mb-2 ring-2 ring-background shadow-sm", children: [
5861
5861
  /* @__PURE__ */ c(
@@ -5930,7 +5930,7 @@ const qo = {
5930
5930
  const a = Math.max(
5931
5931
  Ge,
5932
5932
  Math.min(qe, s)
5933
- ), [i, l] = U("account"), [d, u] = U(a), [f, m] = U(!1), [g, k] = U(!1), [x, h] = U(!1), y = ae(null), R = Re(() => !window.zE || !document.getElementById("widget_conversations") || !document.getElementById("widget_messages") ? !1 : (window.zE("messenger", "render", {
5933
+ ), [i, l] = U("account"), [u, d] = U(a), [f, m] = U(!1), [g, k] = U(!1), [x, h] = U(!1), y = ae(null), R = Re(() => !window.zE || !document.getElementById("widget_conversations") || !document.getElementById("widget_messages") ? !1 : (window.zE("messenger", "render", {
5934
5934
  mode: "embedded",
5935
5935
  conversationList: { targetElement: "#widget_conversations" },
5936
5936
  messageLog: { targetElement: "#widget_messages" }
@@ -5970,7 +5970,7 @@ const qo = {
5970
5970
  Ge,
5971
5971
  Math.min(qe, O)
5972
5972
  );
5973
- u(Z);
5973
+ d(Z);
5974
5974
  }, _ = () => {
5975
5975
  h(!1), document.body.style.cursor = "", document.body.style.userSelect = "";
5976
5976
  };
@@ -5991,7 +5991,7 @@ const qo = {
5991
5991
  }, []);
5992
5992
  const A = Re((E) => {
5993
5993
  if (E.detail === 2) {
5994
- u(a);
5994
+ d(a);
5995
5995
  return;
5996
5996
  }
5997
5997
  E.preventDefault(), h(!0);
@@ -6007,7 +6007,7 @@ const qo = {
6007
6007
  {
6008
6008
  "data-id": "primary-panel",
6009
6009
  className: "min-h-0 min-w-0 flex-none overflow-hidden flex flex-col",
6010
- style: { flexBasis: `${d}%` },
6010
+ style: { flexBasis: `${u}%` },
6011
6011
  children: [
6012
6012
  /* @__PURE__ */ z("div", { className: "flex items-center justify-between px-4 py-3", children: [
6013
6013
  /* @__PURE__ */ c("h2", { className: "font-semibold text-sm text-foreground", children: i === "account" ? "My Account" : "My Conversations" }),
@@ -6076,7 +6076,7 @@ const qo = {
6076
6076
  {
6077
6077
  "data-id": "secondary-panel",
6078
6078
  className: "min-h-0 min-w-0 flex-none flex flex-col bg-white",
6079
- style: { flexBasis: `${100 - d}%` },
6079
+ style: { flexBasis: `${100 - u}%` },
6080
6080
  children: [
6081
6081
  /* @__PURE__ */ c("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ c(ti, {}) }),
6082
6082
  /* @__PURE__ */ z("div", { className: "flex flex-wrap items-center justify-end gap-1 py-1 mr-4 text-xs text-zinc-500", children: [
@@ -6116,14 +6116,14 @@ const qo = {
6116
6116
  "group/resize absolute z-20 flex items-center justify-center",
6117
6117
  f ? "top-0 bottom-0 w-3 -ml-2.5 cursor-col-resize" : "w-full h-3 -mt-2.5 cursor-row-resize"
6118
6118
  ),
6119
- style: f ? { left: `${d}%` } : { top: `${d}%` },
6119
+ style: f ? { left: `${u}%` } : { top: `${u}%` },
6120
6120
  onMouseDown: A,
6121
6121
  role: "separator",
6122
6122
  "aria-label": "Resize panels",
6123
6123
  "aria-orientation": f ? "vertical" : "horizontal",
6124
6124
  "aria-valuemin": Ge,
6125
6125
  "aria-valuemax": qe,
6126
- "aria-valuenow": Math.round(d),
6126
+ "aria-valuenow": Math.round(u),
6127
6127
  children: /* @__PURE__ */ c(
6128
6128
  "div",
6129
6129
  {