webim-adapter 2.7.7 → 2.7.8

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.
@@ -5782,114 +5782,201 @@ var Ki = (e) => String(e?.group ?? "").trim(), qi = (e) => {
5782
5782
  let i = Ki(e) || `#${r}`;
5783
5783
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
5784
5784
  }), t.flatMap((e) => n.get(e));
5785
- };
5786
- function Ji(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
5787
- let i = Gi(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
5788
- for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
5789
- d = qi(d);
5790
- for (let [e, t] of u) u.set(e, qi(t));
5791
- let f = (e, t) => o + (Ki(e) !== Ki(t) && (Ki(e) || Ki(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
5785
+ }, Ji = 20, Yi = 12, Xi = [
5786
+ "left",
5787
+ "center",
5788
+ "right"
5789
+ ], Zi = (e) => e.points.map((e, t) => `${t ? "L" : "M"} ${e.x} ${e.y}`).join(" ");
5790
+ function Qi(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top", columns: i = "off" } = {}) {
5791
+ let a = Gi(t), o = n ? a.h : a.w, s = n ? 16 : 20, c = (n ? a.w : a.h) + (n ? 56 : 48), l = Array.isArray(e) ? e.filter((e) => e && e.id) : [], u = new Set(l.map((e) => e.id)), d = /* @__PURE__ */ new Map(), f = [];
5792
+ for (let e of l) e.parent && u.has(e.parent) && e.parent !== e.id ? (d.has(e.parent) || d.set(e.parent, []), d.get(e.parent).push(e)) : f.push(e);
5793
+ f = qi(f);
5794
+ for (let [e, t] of d) d.set(e, qi(t));
5795
+ let p = !n && Xi.includes(i), m = (e) => Xi.includes(e?.columns) ? e.columns : i, h = (e) => {
5796
+ let t = d.get(e.id) ?? [];
5797
+ if (!p) return t.map((e) => ({ nodes: [e] }));
5798
+ let n = [], r = [], i = () => {
5799
+ r.length > 1 ? n.push({
5800
+ nodes: r,
5801
+ line: m(e)
5802
+ }) : r.forEach((e) => n.push({ nodes: [e] })), r = [];
5803
+ };
5804
+ for (let e of t) {
5805
+ let t = !(d.get(e.id) ?? []).length;
5806
+ r.length && (!t || Ki(r[0]) !== Ki(e)) && i(), t ? r.push(e) : n.push({ nodes: [e] });
5807
+ }
5808
+ return i(), n;
5809
+ }, g = (e, t) => s + (Ki(e) !== Ki(t) && (Ki(e) || Ki(t)) ? 24 : 0), _ = (e, t) => g(e.nodes.at(-1), t.nodes[0]), v = (e) => o + (e.line === "center" ? 0 : Ji), y = /* @__PURE__ */ new Map(), b = (e, t) => {
5792
5810
  if (t.has(e.id)) return 0;
5793
5811
  t.add(e.id);
5794
- let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
5795
- return p.set(e.id, i), i;
5812
+ let n = h(e), r = n.reduce((e, r, i) => {
5813
+ let a = r.line ? v(r) : b(r.nodes[0], t);
5814
+ return r.line && r.nodes.forEach((e) => t.add(e.id)), e + a + (i ? _(n[i - 1], r) : 0);
5815
+ }, 0), i = Math.max(o, r);
5816
+ return y.set(e.id, i), i;
5796
5817
  };
5797
- d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
5798
- let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
5799
- if (o.has(e.id)) return;
5800
- o.add(e.id);
5801
- let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
5802
- h.push({
5818
+ f.forEach((e) => b(e, /* @__PURE__ */ new Set()));
5819
+ let x = [], S = [], C = /* @__PURE__ */ new Map(), w = 0, T = (e, t, r) => {
5820
+ x.push({
5803
5821
  node: e,
5804
- x: m,
5805
- y: b
5822
+ x: t,
5823
+ y: r
5806
5824
  });
5807
- let x = Ki(e);
5808
- if (x) {
5809
- let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
5810
- _.has(t) || _.set(t, {
5811
- title: x,
5825
+ let i = Ki(e);
5826
+ if (i) {
5827
+ let n = `${e.parent && u.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${i}`;
5828
+ C.has(n) || C.set(n, {
5829
+ title: i,
5812
5830
  color: "",
5813
5831
  members: []
5814
5832
  });
5815
- let n = _.get(t);
5816
- !n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
5817
- x: m,
5818
- y: b
5833
+ let a = C.get(n);
5834
+ !a.color && e.groupColor && (a.color = e.groupColor), a.members.push({
5835
+ x: t,
5836
+ y: r
5819
5837
  });
5820
5838
  }
5821
- v = Math.max(v, d + (n ? i.w : i.h));
5822
- let S = t, C = u.get(e.id) ?? [];
5823
- C.forEach((e, t) => {
5824
- t && (S += f(C[t - 1], e));
5825
- let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
5826
- g.push(n ? {
5827
- from: {
5828
- x: d + i.w,
5829
- y: c + i.h / 2
5839
+ w = Math.max(w, n ? t + a.w : r + a.h);
5840
+ }, E = (e, t, n, r) => {
5841
+ let i = t + (e.line === "left" ? Ji : 0), o = n * c, s = r.y + (o - r.y) / 2, l = e.line === "left" ? i - Ji / 2 : i + a.w + Ji / 2;
5842
+ e.nodes.forEach((t, n) => {
5843
+ let c = o + n * (a.h + Yi), u = c + a.h / 2;
5844
+ if (T(t, i, c), e.line === "center") S.push(n ? { points: [{
5845
+ x: i + a.w / 2,
5846
+ y: c - Yi
5847
+ }, {
5848
+ x: i + a.w / 2,
5849
+ y: c
5850
+ }] } : { points: [
5851
+ r,
5852
+ {
5853
+ x: r.x,
5854
+ y: s
5830
5855
  },
5831
- to: {
5832
- x: u,
5833
- y: l
5856
+ {
5857
+ x: i + a.w / 2,
5858
+ y: s
5859
+ },
5860
+ {
5861
+ x: i + a.w / 2,
5862
+ y: c
5834
5863
  }
5835
- } : {
5836
- from: {
5837
- x: c + i.w / 2,
5838
- y: d + i.h
5864
+ ] });
5865
+ else {
5866
+ let t = e.line === "left" ? i : i + a.w;
5867
+ S.push({ points: [
5868
+ r,
5869
+ {
5870
+ x: r.x,
5871
+ y: s
5872
+ },
5873
+ {
5874
+ x: l,
5875
+ y: s
5876
+ },
5877
+ {
5878
+ x: l,
5879
+ y: u
5880
+ },
5881
+ {
5882
+ x: t,
5883
+ y: u
5884
+ }
5885
+ ] });
5886
+ }
5887
+ });
5888
+ }, D = (e, t, r, i) => {
5889
+ if (i.has(e.id)) return;
5890
+ i.add(e.id);
5891
+ let s = t + ((y.get(e.id) ?? o) - o) / 2, l = r * c;
5892
+ T(e, n ? l : s, n ? s : l);
5893
+ let u = t, d = h(e), f = n ? {
5894
+ x: l + a.w,
5895
+ y: s + a.h / 2
5896
+ } : {
5897
+ x: s + a.w / 2,
5898
+ y: l + a.h
5899
+ };
5900
+ d.forEach((e, t) => {
5901
+ if (t && (u += _(d[t - 1], e)), e.line) {
5902
+ E(e, u, r + 1, f), e.nodes.forEach((e) => i.add(e.id)), u += v(e);
5903
+ return;
5904
+ }
5905
+ let a = e.nodes[0], s = u + ((y.get(a.id) ?? o) - o) / 2 + o / 2, l = (r + 1) * c;
5906
+ S.push({ points: n ? [
5907
+ f,
5908
+ {
5909
+ x: (f.x + l) / 2,
5910
+ y: f.y
5911
+ },
5912
+ {
5913
+ x: (f.x + l) / 2,
5914
+ y: s
5839
5915
  },
5840
- to: {
5916
+ {
5841
5917
  x: l,
5842
- y: u
5918
+ y: s
5843
5919
  }
5844
- }), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
5920
+ ] : [
5921
+ f,
5922
+ {
5923
+ x: f.x,
5924
+ y: (f.y + l) / 2
5925
+ },
5926
+ {
5927
+ x: s,
5928
+ y: (f.y + l) / 2
5929
+ },
5930
+ {
5931
+ x: s,
5932
+ y: l
5933
+ }
5934
+ ] }), D(a, u, r + 1, i), u += y.get(a.id) ?? o;
5845
5935
  });
5846
- }, b = 0, x = /* @__PURE__ */ new Set();
5847
- d.forEach((e, t) => {
5848
- t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
5936
+ }, O = 0, k = /* @__PURE__ */ new Set();
5937
+ f.forEach((e, t) => {
5938
+ t && (O += g(f[t - 1], e)), D(e, O, 0, k), O += y.get(e.id) ?? o;
5849
5939
  });
5850
- let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
5851
- let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + i.w + 12, a = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : C), o = Math.max(...e.members.map((e) => e.y)) + i.h + 12 + (r === "bottom" ? C : 0);
5940
+ let A = Math.max(O, o), j = r === "hidden" ? 0 : 22, M = [...C.values()].map((e) => {
5941
+ let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + a.w + 12, i = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : j), o = Math.max(...e.members.map((e) => e.y)) + a.h + 12 + (r === "bottom" ? j : 0);
5852
5942
  return {
5853
5943
  x: t,
5854
- y: a,
5944
+ y: i,
5855
5945
  width: n - t,
5856
- height: o - a,
5946
+ height: o - i,
5857
5947
  title: e.title,
5858
5948
  color: e.color
5859
5949
  };
5860
- }), T = n ? Math.max(v, i.w) : S, E = n ? S : Math.max(v, i.h), D = Math.max(0, ...w.map((e) => -e.x)), O = Math.max(0, ...w.map((e) => -e.y));
5861
- if (w.length && (T = Math.max(T, ...w.map((e) => e.x + e.width)) + D, E = Math.max(E, ...w.map((e) => e.y + e.height)) + O, D || O)) {
5862
- for (let e of h) e.x += D, e.y += O;
5863
- for (let e of g) e.from = {
5864
- x: e.from.x + D,
5865
- y: e.from.y + O
5866
- }, e.to = {
5867
- x: e.to.x + D,
5868
- y: e.to.y + O
5869
- };
5870
- for (let e of w) e.x += D, e.y += O;
5950
+ }), N = n ? Math.max(w, a.w) : A, P = n ? A : Math.max(w, a.h), F = Math.max(0, ...M.map((e) => -e.x)), I = Math.max(0, ...M.map((e) => -e.y));
5951
+ if (M.length && (N = Math.max(N, ...M.map((e) => e.x + e.width)) + F, P = Math.max(P, ...M.map((e) => e.y + e.height)) + I, F || I)) {
5952
+ for (let e of x) e.x += F, e.y += I;
5953
+ for (let e of S) e.points = e.points.map((e) => ({
5954
+ x: e.x + F,
5955
+ y: e.y + I
5956
+ }));
5957
+ for (let e of M) e.x += F, e.y += I;
5871
5958
  }
5872
5959
  return {
5873
- boxes: h,
5874
- links: g,
5875
- groups: w,
5876
- width: T,
5877
- height: E,
5960
+ boxes: x,
5961
+ links: S,
5962
+ groups: M,
5963
+ width: N,
5964
+ height: P,
5878
5965
  horizontal: n
5879
5966
  };
5880
5967
  }
5881
- var Yi = (e, t) => {
5968
+ var $i = (e, t) => {
5882
5969
  let n = String(e ?? "");
5883
5970
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
5884
- }, Xi = (e) => {
5971
+ }, ea = (e) => {
5885
5972
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
5886
5973
  if (!t) return "#ffffff";
5887
5974
  let n = t[1];
5888
5975
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
5889
5976
  let r = parseInt(n, 16);
5890
5977
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
5891
- }, Zi = (e) => !!(e?.cv?.trim?.() || e?.photo);
5892
- function Qi(e, t = {}) {
5978
+ }, ta = (e) => !!(e?.cv?.trim?.() || e?.photo || e?.profilePhoto);
5979
+ function na(e, t = {}) {
5893
5980
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ln(e);
5894
5981
  return n.map((e) => {
5895
5982
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -5905,19 +5992,26 @@ function Qi(e, t = {}) {
5905
5992
  };
5906
5993
  });
5907
5994
  }
5908
- var $i = {
5995
+ var ra = /^(https?:\/\/[^\s"<>]+|mailto:[^\s"<>]+|tel:[+\d][\d\s().-]*|\/(?!\/)[^\s"<>]*)$/i, ia = (e) => {
5996
+ let t = String(e ?? "").trim();
5997
+ return ra.test(t) ? t : "";
5998
+ }, aa = (e) => {
5999
+ e.startsWith("/") ? window.location.assign(e) : window.open(e, "_blank", "noopener,noreferrer");
6000
+ }, oa = {
5909
6001
  size: 36,
5910
6002
  pad: 10
5911
6003
  };
5912
- function ea({ node: e, onClose: t }) {
5913
- return c(() => {
6004
+ function sa({ node: e, onClose: t }) {
6005
+ c(() => {
5914
6006
  let e = (e) => e.key === "Escape" && t();
5915
6007
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
5916
- }, [t]), /* @__PURE__ */ g("div", {
6008
+ }, [t]);
6009
+ let n = e.profilePhoto || e.photo, r = e.title || e.name, i = e.title && e.name ? e.name : "", a = !!(n && e.cv), o = ia(e.href);
6010
+ return /* @__PURE__ */ g("div", {
5917
6011
  onClick: t,
5918
6012
  role: "dialog",
5919
6013
  "aria-modal": "true",
5920
- "aria-label": e.name,
6014
+ "aria-label": r,
5921
6015
  style: {
5922
6016
  position: "fixed",
5923
6017
  inset: 0,
@@ -5937,117 +6031,138 @@ function ea({ node: e, onClose: t }) {
5937
6031
  color: "var(--page-text, #111827)",
5938
6032
  border: "1px solid rgba(148, 163, 184, 0.35)",
5939
6033
  borderRadius: 14,
5940
- maxWidth: 420,
6034
+ maxWidth: a ? 900 : 440,
5941
6035
  width: "100%",
5942
- maxHeight: "80vh",
5943
- overflowY: "auto",
5944
- padding: 24,
5945
- position: "relative",
6036
+ maxHeight: "85vh",
6037
+ display: "flex",
6038
+ flexDirection: "column",
6039
+ overflow: "hidden",
5946
6040
  boxShadow: "0 24px 64px rgba(2, 6, 23, 0.5)"
5947
6041
  },
5948
- children: [
5949
- /* @__PURE__ */ g("button", {
6042
+ children: [/* @__PURE__ */ _("div", {
6043
+ style: {
6044
+ display: "flex",
6045
+ alignItems: "flex-start",
6046
+ gap: 12,
6047
+ padding: "18px 20px 14px 24px",
6048
+ borderBottom: "1px solid rgba(148, 163, 184, 0.3)"
6049
+ },
6050
+ children: [/* @__PURE__ */ _("div", {
6051
+ style: {
6052
+ flex: 1,
6053
+ minWidth: 0
6054
+ },
6055
+ children: [/* @__PURE__ */ g("div", {
6056
+ style: {
6057
+ fontSize: 18,
6058
+ fontWeight: 700,
6059
+ lineHeight: 1.35
6060
+ },
6061
+ children: r
6062
+ }), i && /* @__PURE__ */ g("div", {
6063
+ style: {
6064
+ fontSize: 14,
6065
+ opacity: .7,
6066
+ marginTop: 2
6067
+ },
6068
+ children: i
6069
+ })]
6070
+ }), /* @__PURE__ */ g("button", {
5950
6071
  type: "button",
5951
6072
  "aria-label": "Close",
5952
6073
  onClick: t,
5953
6074
  style: {
5954
- position: "absolute",
5955
- top: 10,
5956
- right: 10,
5957
- width: 30,
5958
- height: 30,
6075
+ flexShrink: 0,
6076
+ width: 32,
6077
+ height: 32,
5959
6078
  border: 0,
5960
6079
  borderRadius: 8,
5961
6080
  background: "transparent",
5962
6081
  color: "inherit",
5963
- fontSize: 18,
6082
+ fontSize: 20,
5964
6083
  lineHeight: 1,
5965
6084
  cursor: "pointer",
5966
6085
  opacity: .6
5967
6086
  },
5968
6087
  children: "×"
5969
- }),
5970
- /* @__PURE__ */ _("div", {
6088
+ })]
6089
+ }), /* @__PURE__ */ _("div", {
6090
+ style: {
6091
+ overflowY: "auto",
6092
+ padding: 24,
6093
+ display: "flex",
6094
+ flexWrap: "wrap",
6095
+ gap: 24,
6096
+ alignItems: "flex-start"
6097
+ },
6098
+ children: [n && /* @__PURE__ */ g("img", {
6099
+ src: n,
6100
+ alt: e.name || r,
6101
+ style: a ? {
6102
+ flex: "1 1 220px",
6103
+ maxWidth: 340,
6104
+ width: "100%",
6105
+ height: "auto",
6106
+ borderRadius: 10,
6107
+ objectFit: "cover"
6108
+ } : {
6109
+ width: 96,
6110
+ height: 96,
6111
+ borderRadius: "50%",
6112
+ objectFit: "cover"
6113
+ }
6114
+ }), (e.cv || o) && /* @__PURE__ */ _("div", {
5971
6115
  style: {
5972
- display: "flex",
5973
- alignItems: "center",
5974
- gap: 14,
5975
- marginBottom: e.cv ? 14 : 0
6116
+ flex: "2 1 320px",
6117
+ minWidth: 0
5976
6118
  },
5977
- children: [e.photo && /* @__PURE__ */ g("img", {
5978
- src: e.photo,
5979
- alt: "",
6119
+ children: [e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ g("p", {
5980
6120
  style: {
5981
- width: 72,
5982
- height: 72,
5983
- borderRadius: "50%",
5984
- objectFit: "cover",
5985
- flexShrink: 0
5986
- }
5987
- }), /* @__PURE__ */ _("div", {
5988
- style: { minWidth: 0 },
5989
- children: [/* @__PURE__ */ g("div", {
5990
- style: {
5991
- fontSize: 18,
5992
- fontWeight: 700
5993
- },
5994
- children: e.name
5995
- }), e.title && /* @__PURE__ */ g("div", {
5996
- style: {
5997
- fontSize: 13,
5998
- opacity: .65
5999
- },
6000
- children: e.title
6001
- })]
6121
+ fontSize: 15,
6122
+ lineHeight: 1.65,
6123
+ margin: "0 0 12px"
6124
+ },
6125
+ children: e
6126
+ }, t)), o && /* @__PURE__ */ g("a", {
6127
+ href: o,
6128
+ target: "_blank",
6129
+ rel: "noopener noreferrer",
6130
+ style: {
6131
+ display: "inline-block",
6132
+ marginTop: 6,
6133
+ padding: "8px 14px",
6134
+ borderRadius: 8,
6135
+ fontSize: 13,
6136
+ fontWeight: 600,
6137
+ textDecoration: "none",
6138
+ background: "var(--page-accent, #4f46e5)",
6139
+ color: "var(--page-accent-text, #ffffff)"
6140
+ },
6141
+ children: "Open profile ↗"
6002
6142
  })]
6003
- }),
6004
- e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ g("p", {
6005
- style: {
6006
- fontSize: 14,
6007
- lineHeight: 1.6,
6008
- margin: "0 0 10px"
6009
- },
6010
- children: e
6011
- }, t)),
6012
- e.href && /* @__PURE__ */ g("a", {
6013
- href: e.href,
6014
- target: "_blank",
6015
- rel: "noopener noreferrer",
6016
- style: {
6017
- display: "inline-block",
6018
- marginTop: 6,
6019
- padding: "8px 14px",
6020
- borderRadius: 8,
6021
- fontSize: 13,
6022
- fontWeight: 600,
6023
- textDecoration: "none",
6024
- background: "var(--page-accent, #4f46e5)",
6025
- color: "var(--page-accent-text, #ffffff)"
6026
- },
6027
- children: "Open profile ↗"
6028
- })
6029
- ]
6143
+ })]
6144
+ })]
6030
6145
  })
6031
6146
  });
6032
6147
  }
6033
- function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: o, hrefField: u, groupField: d, groupTitles: p = "top", groupBg: m = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
6034
- let C = l(), [w, T] = f(null), { tenant: E, apiUrl: D } = s(Y), O = s(Jt)?.[t], [k, A] = f(null);
6148
+ function ca({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: o, hrefField: u, groupField: d, groupTitles: p = "top", groupBg: m = "", size: v = "medium", horizontal: y = !1, columns: b = "off", style: x, nodeRef: S, interactive: C = !0 }) {
6149
+ let w = l(), [T, E] = f(null), { tenant: D, apiUrl: O } = s(Y), k = s(Jt)?.[t], [A, j] = f(null);
6035
6150
  c(() => {
6036
- if (!t || O) return;
6151
+ if (!t || k) return;
6037
6152
  let e = !0;
6038
- return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
6153
+ return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
6039
6154
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
6040
- e && A(n);
6041
- }).catch(() => e && A([])), () => {
6155
+ e && j(n);
6156
+ }).catch(() => e && j([])), () => {
6042
6157
  e = !1;
6043
6158
  };
6044
6159
  }, [
6045
6160
  t,
6046
- E,
6047
6161
  D,
6048
- O
6162
+ O,
6163
+ k
6049
6164
  ]);
6050
- let j = t ? Qi(O ?? k ?? [], {
6165
+ let M = t ? na(k ?? A ?? [], {
6051
6166
  nameField: n,
6052
6167
  titleField: r,
6053
6168
  photoField: i,
@@ -6055,13 +6170,14 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6055
6170
  cvField: o,
6056
6171
  hrefField: u,
6057
6172
  groupField: d
6058
- }) : e, M = Gi(v), { boxes: N, links: P, groups: F, width: I, height: L } = Ji(j, {
6173
+ }) : e, N = Gi(v), { boxes: P, links: F, groups: I, width: L, height: R } = Qi(M, {
6059
6174
  size: v,
6060
6175
  horizontal: y,
6061
- groupTitles: p
6176
+ groupTitles: p,
6177
+ columns: b
6062
6178
  });
6063
- if (!N.length) return !S && t ? /* @__PURE__ */ _("div", {
6064
- ref: x,
6179
+ if (!P.length) return !C && t ? /* @__PURE__ */ _("div", {
6180
+ ref: S,
6065
6181
  style: {
6066
6182
  padding: 18,
6067
6183
  border: "1px dashed rgba(148, 163, 184, 0.6)",
@@ -6069,7 +6185,7 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6069
6185
  fontSize: 13,
6070
6186
  opacity: .7,
6071
6187
  textAlign: "center",
6072
- ...q(b)
6188
+ ...q(x)
6073
6189
  },
6074
6190
  children: [
6075
6191
  "Org Chart — no published entries in “",
@@ -6077,27 +6193,27 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6077
6193
  "” yet"
6078
6194
  ]
6079
6195
  }) : null;
6080
- let R = new Set(N.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
6196
+ let z = new Set(P.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
6081
6197
  return /* @__PURE__ */ _("div", {
6082
- ref: x,
6198
+ ref: S,
6083
6199
  style: {
6084
6200
  maxWidth: "100%",
6085
6201
  overflowX: "auto",
6086
- ...q(b)
6202
+ ...q(x)
6087
6203
  },
6088
6204
  children: [/* @__PURE__ */ _("svg", {
6089
- viewBox: `0 0 ${I} ${L}`,
6205
+ viewBox: `0 0 ${L} ${R}`,
6090
6206
  role: "img",
6091
6207
  "aria-label": "Organization chart",
6092
6208
  style: {
6093
6209
  display: "block",
6094
6210
  width: "100%",
6095
- maxWidth: I,
6211
+ maxWidth: L,
6096
6212
  height: "auto",
6097
6213
  margin: "0 auto"
6098
6214
  },
6099
6215
  children: [
6100
- F.map((e, t) => {
6216
+ I.map((e, t) => {
6101
6217
  let n = e.color || m || "rgba(148, 163, 184, 0.16)", r = !!(e.color || m);
6102
6218
  return /* @__PURE__ */ _("g", { children: [/* @__PURE__ */ g("rect", {
6103
6219
  x: e.x,
@@ -6110,29 +6226,33 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6110
6226
  x: e.x + e.width / 2,
6111
6227
  y: p === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
6112
6228
  textAnchor: "middle",
6113
- fontSize: M.title + 1,
6229
+ fontSize: N.title + 1,
6114
6230
  fontWeight: "600",
6115
6231
  opacity: "0.55",
6116
- fill: r ? Xi(e.color || m) : "var(--page-text, #111827)",
6117
- children: Yi(e.title, Math.floor(e.width / 7))
6232
+ fill: r ? ea(e.color || m) : "var(--page-text, #111827)",
6233
+ children: $i(e.title, Math.floor(e.width / 7))
6118
6234
  })] }, `group-${t}`);
6119
6235
  }),
6120
- P.map((e, t) => /* @__PURE__ */ g("path", {
6121
- d: y ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
6236
+ F.map((e, t) => /* @__PURE__ */ g("path", {
6237
+ d: Zi(e),
6122
6238
  fill: "none",
6123
6239
  stroke: "rgba(148, 163, 184, 0.7)",
6124
6240
  strokeWidth: "1.5"
6125
6241
  }, t)),
6126
- N.map(({ node: e, x: t, y: n }) => {
6127
- let r = R.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Xi(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Xi(e.color2) : s, l = S && (Zi(e) || e.href), u = () => Zi(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), d = e.photo ? t + $i.pad + M.avatar + 8 : t + M.w / 2, f = e.photo ? "start" : "middle", p = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), m = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
6242
+ P.map(({ node: e, x: t, y: n }) => {
6243
+ let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? ea(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? ea(e.color2) : s, l = ia(e.href), u = C && (l || ta(e)), d = () => l ? aa(l) : E(e), f = e.photo ? t + oa.pad + N.avatar + 8 : t + N.w / 2, p = e.photo ? "start" : "middle", m = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), v = N.h / 2, y = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
6128
6244
  return /* @__PURE__ */ _("g", {
6129
- onClick: l ? u : void 0,
6130
- style: l ? { cursor: "pointer" } : void 0,
6131
- role: l ? "button" : void 0,
6132
- "aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
6245
+ onClick: u ? d : void 0,
6246
+ onKeyDown: u ? (e) => {
6247
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
6248
+ } : void 0,
6249
+ tabIndex: u ? 0 : void 0,
6250
+ style: u ? { cursor: "pointer" } : void 0,
6251
+ role: u ? l ? "link" : "button" : void 0,
6252
+ "aria-label": u ? l ? `${e.name || e.title} — open link` : `Open ${e.name || e.title}'s profile` : void 0,
6133
6253
  children: [
6134
6254
  i && e.gradient ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("linearGradient", {
6135
- id: `${C}-${e.id}-grad`,
6255
+ id: `${w}-${e.id}-grad`,
6136
6256
  x1: "0",
6137
6257
  y1: "0",
6138
6258
  x2: "0",
@@ -6147,104 +6267,104 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6147
6267
  }), /* @__PURE__ */ g("rect", {
6148
6268
  x: t,
6149
6269
  y: n,
6150
- width: M.w,
6151
- height: M.h,
6270
+ width: N.w,
6271
+ height: N.h,
6152
6272
  rx: "10",
6153
- fill: `url(#${C}-${e.id}-grad)`
6273
+ fill: `url(#${w}-${e.id}-grad)`
6154
6274
  })] }) : i ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("clipPath", {
6155
- id: `${C}-${e.id}-box`,
6275
+ id: `${w}-${e.id}-box`,
6156
6276
  children: /* @__PURE__ */ g("rect", {
6157
6277
  x: t,
6158
6278
  y: n,
6159
- width: M.w,
6160
- height: M.h,
6279
+ width: N.w,
6280
+ height: N.h,
6161
6281
  rx: "10"
6162
6282
  })
6163
6283
  }), /* @__PURE__ */ _("g", {
6164
- clipPath: `url(#${C}-${e.id}-box)`,
6284
+ clipPath: `url(#${w}-${e.id}-box)`,
6165
6285
  children: [/* @__PURE__ */ g("rect", {
6166
6286
  x: t,
6167
6287
  y: n,
6168
- width: M.w,
6169
- height: m,
6288
+ width: N.w,
6289
+ height: v,
6170
6290
  fill: o
6171
6291
  }), /* @__PURE__ */ g("rect", {
6172
6292
  x: t,
6173
- y: n + m,
6174
- width: M.w,
6175
- height: M.h - m,
6293
+ y: n + v,
6294
+ width: N.w,
6295
+ height: N.h - v,
6176
6296
  fill: e.color2
6177
6297
  })]
6178
6298
  })] }) : /* @__PURE__ */ g("rect", {
6179
6299
  x: t,
6180
6300
  y: n,
6181
- width: M.w,
6182
- height: M.h,
6301
+ width: N.w,
6302
+ height: N.h,
6183
6303
  rx: "10",
6184
6304
  fill: o,
6185
6305
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
6186
6306
  strokeWidth: a ? 0 : 1.5
6187
6307
  }),
6188
6308
  e.photo && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("clipPath", {
6189
- id: `${C}-${e.id}`,
6309
+ id: `${w}-${e.id}`,
6190
6310
  children: /* @__PURE__ */ g("circle", {
6191
- cx: t + $i.pad + M.avatar / 2,
6192
- cy: n + M.h / 2,
6193
- r: M.avatar / 2
6311
+ cx: t + oa.pad + N.avatar / 2,
6312
+ cy: n + N.h / 2,
6313
+ r: N.avatar / 2
6194
6314
  })
6195
6315
  }), /* @__PURE__ */ g("image", {
6196
6316
  href: e.photo,
6197
- x: t + $i.pad,
6198
- y: n + (M.h - M.avatar) / 2,
6199
- width: M.avatar,
6200
- height: M.avatar,
6317
+ x: t + oa.pad,
6318
+ y: n + (N.h - N.avatar) / 2,
6319
+ width: N.avatar,
6320
+ height: N.avatar,
6201
6321
  preserveAspectRatio: "xMidYMid slice",
6202
- clipPath: `url(#${C}-${e.id})`
6322
+ clipPath: `url(#${w}-${e.id})`
6203
6323
  })] }),
6204
6324
  i && !e.gradient ? /* @__PURE__ */ _(h, { children: [e.title && /* @__PURE__ */ g("text", {
6205
- x: d,
6206
- y: n + m / 2 + M.title * .35,
6207
- textAnchor: f,
6208
- fontSize: M.title,
6325
+ x: f,
6326
+ y: n + v / 2 + N.title * .35,
6327
+ textAnchor: p,
6328
+ fontSize: N.title,
6209
6329
  fontWeight: "600",
6210
6330
  fill: s,
6211
- children: Yi(e.title, p + 4)
6331
+ children: $i(e.title, m + 4)
6212
6332
  }), e.name && /* @__PURE__ */ g("text", {
6213
- x: d,
6214
- y: n + m + m / 2 + M.name * .35,
6215
- textAnchor: f,
6216
- fontSize: M.name,
6333
+ x: f,
6334
+ y: n + v + v / 2 + N.name * .35,
6335
+ textAnchor: p,
6336
+ fontSize: N.name,
6217
6337
  fontWeight: "600",
6218
6338
  fill: c,
6219
- children: Yi(e.name, p)
6220
- })] }) : /* @__PURE__ */ _(h, { children: [v[0] && /* @__PURE__ */ g("text", {
6221
- x: d,
6222
- y: n + (v[1] ? M.h * .43 : M.h * .57),
6223
- textAnchor: f,
6224
- fontSize: M.name,
6339
+ children: $i(e.name, m)
6340
+ })] }) : /* @__PURE__ */ _(h, { children: [y[0] && /* @__PURE__ */ g("text", {
6341
+ x: f,
6342
+ y: n + (y[1] ? N.h * .43 : N.h * .57),
6343
+ textAnchor: p,
6344
+ fontSize: N.name,
6225
6345
  fontWeight: "600",
6226
6346
  fill: s,
6227
- children: Yi(v[0], p)
6228
- }), v[1] && /* @__PURE__ */ g("text", {
6229
- x: d,
6230
- y: n + M.h * .73,
6231
- textAnchor: f,
6232
- fontSize: M.title,
6347
+ children: $i(y[0], m)
6348
+ }), y[1] && /* @__PURE__ */ g("text", {
6349
+ x: f,
6350
+ y: n + N.h * .73,
6351
+ textAnchor: p,
6352
+ fontSize: N.title,
6233
6353
  opacity: "0.7",
6234
6354
  fill: s,
6235
- children: Yi(v[1], p + 4)
6355
+ children: $i(y[1], m + 4)
6236
6356
  })] })
6237
6357
  ]
6238
6358
  }, e.id);
6239
6359
  })
6240
6360
  ]
6241
- }), w && /* @__PURE__ */ g(ea, {
6242
- node: w,
6243
- onClose: () => T(null)
6361
+ }), T && /* @__PURE__ */ g(sa, {
6362
+ node: T,
6363
+ onClose: () => E(null)
6244
6364
  })]
6245
6365
  });
6246
6366
  }
6247
- function na({ value: e, onCommit: t, style: n, hint: r }) {
6367
+ function la({ value: e, onCommit: t, style: n, hint: r }) {
6248
6368
  let [i, a] = f(!1), o = d(null);
6249
6369
  return c(() => {
6250
6370
  if (!i || !o.current) return;
@@ -6274,7 +6394,7 @@ function na({ value: e, onCommit: t, style: n, hint: r }) {
6274
6394
  children: e ?? ""
6275
6395
  });
6276
6396
  }
6277
- var ra = 360, ia = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", aa = (e, t) => e && t ? `cell-${e}-${t}` : "", oa = (e) => {
6397
+ var ua = 360, da = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", fa = (e, t) => e && t ? `cell-${e}-${t}` : "", pa = (e) => {
6278
6398
  if (!e || typeof e != "object") return e ?? "";
6279
6399
  let t = String(e.text ?? "");
6280
6400
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ g("a", {
@@ -6285,7 +6405,7 @@ var ra = 360, ia = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
6285
6405
  children: t
6286
6406
  }) : t;
6287
6407
  };
6288
- function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: o, linked: l, source: u, limit: p = 10, header: m = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, caption: j = "", captionHidden: M = !1, rowHeaders: N = !1, style: P, nodeRef: F, edit: I }) {
6408
+ function ma({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: o, linked: l, source: u, limit: p = 10, header: m = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, caption: j = "", captionHidden: M = !1, rowHeaders: N = !1, style: P, nodeRef: F, edit: I }) {
6289
6409
  let L = d(null), R = d(null), [z, B] = f(null), [V, H] = f(null), U = (e, t) => () => B({
6290
6410
  r: e,
6291
6411
  c: t
@@ -6299,7 +6419,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6299
6419
  }
6300
6420
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
6301
6421
  top: r.bottom - n.top + 4,
6302
- left: Math.max(0, Math.min(r.left - n.left, n.width - ra))
6422
+ left: Math.max(0, Math.min(r.left - n.left, n.width - ua))
6303
6423
  };
6304
6424
  (V?.top !== i.top || V?.left !== i.left) && H(i);
6305
6425
  }), c(() => {
@@ -6355,7 +6475,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6355
6475
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
6356
6476
  }, Ce = /* @__PURE__ */ new Set();
6357
6477
  o && oe.forEach((t, n) => e.forEach((e, t) => {
6358
- let a = o[aa(r[n], i[t])];
6478
+ let a = o[fa(r[n], i[t])];
6359
6479
  if (!a) return;
6360
6480
  let s = Math.max(1, Number(a.c) || 1), c = Math.max(1, Number(a.r) || 1);
6361
6481
  for (let e = 0; e < c; e++) for (let r = 0; r < s; r++) (e || r) && Ce.add(`${n + e},${t + r}`);
@@ -6378,7 +6498,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6378
6498
  },
6379
6499
  onClick: n,
6380
6500
  children: e
6381
- }, t), J = z && z.r < oe.length && z.c < e.length ? z : null, Ee = (e, t) => I?.labels?.[e] ?? t, De = J ? o?.[aa(r[J.r], i[J.c])] : null, Oe = Math.max(1, Number(De?.c) || 1), ke = Math.max(1, Number(De?.r) || 1);
6501
+ }, t), J = z && z.r < oe.length && z.c < e.length ? z : null, Ee = (e, t) => I?.labels?.[e] ?? t, De = J ? o?.[fa(r[J.r], i[J.c])] : null, Oe = Math.max(1, Number(De?.c) || 1), ke = Math.max(1, Number(De?.r) || 1);
6382
6502
  return /* @__PURE__ */ _("div", {
6383
6503
  ref: (e) => {
6384
6504
  R.current = e, typeof F == "function" && F(e);
@@ -6389,7 +6509,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6389
6509
  ...be
6390
6510
  },
6391
6511
  children: [
6392
- I && /* @__PURE__ */ g("style", { children: ia }),
6512
+ I && /* @__PURE__ */ g("style", { children: da }),
6393
6513
  I && J && V && /* @__PURE__ */ _("div", {
6394
6514
  className: "wb-tedit-bar",
6395
6515
  style: {
@@ -6471,7 +6591,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6471
6591
  } : I ? { position: "relative" } : null,
6472
6592
  ...de
6473
6593
  },
6474
- children: I ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(na, {
6594
+ children: I ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(la, {
6475
6595
  value: t.label ?? t,
6476
6596
  onCommit: (e) => I.header(n, e),
6477
6597
  hint: Ee("editCell", "Double-click to edit"),
@@ -6502,7 +6622,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6502
6622
  },
6503
6623
  children: e.map((e, a) => {
6504
6624
  if (Ce.has(`${n},${a}`)) return null;
6505
- let s = aa(r[n], i[a]), c = l?.[s], u = o?.[s], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1), p = N && a === 0 ? "th" : "td";
6625
+ let s = fa(r[n], i[a]), c = l?.[s], u = o?.[s], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1), p = N && a === 0 ? "th" : "td";
6506
6626
  return /* @__PURE__ */ _(p, {
6507
6627
  ...X("cell", p === "th" && "row-header"),
6508
6628
  scope: p === "th" ? "row" : void 0,
@@ -6521,7 +6641,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6521
6641
  ...I ? { position: "relative" } : null,
6522
6642
  ...de
6523
6643
  },
6524
- children: [c ?? oa(t?.[a]), I && xe && /* @__PURE__ */ g("span", {
6644
+ children: [c ?? pa(t?.[a]), I && xe && /* @__PURE__ */ g("span", {
6525
6645
  className: "wb-tedit-rowgrip",
6526
6646
  title: Ee("rowHeight", "Drag to set the row height — double-click to fit the content"),
6527
6647
  onPointerDown: we(n),
@@ -6536,7 +6656,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6536
6656
  ]
6537
6657
  });
6538
6658
  }
6539
- var ca = {
6659
+ var ha = {
6540
6660
  small: {
6541
6661
  cell: 62,
6542
6662
  font: 10.5,
@@ -6561,8 +6681,8 @@ var ca = {
6561
6681
  pad: 8,
6562
6682
  gap: 4
6563
6683
  }
6564
- }, la = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, ua = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), da = 366;
6565
- function fa(e, t = {}) {
6684
+ }, ga = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, _a = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), va = 366;
6685
+ function ya(e, t = {}) {
6566
6686
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ln(e), a = (e) => {
6567
6687
  let t = i(r(e)), n = t ? new Date(t) : null;
6568
6688
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -6579,7 +6699,7 @@ function fa(e, t = {}) {
6579
6699
  } : null;
6580
6700
  }).filter(Boolean);
6581
6701
  }
6582
- function pa(e) {
6702
+ function ba(e) {
6583
6703
  return (Array.isArray(e) ? e : []).map((e, t) => {
6584
6704
  let n = e?.start ? new Date(e.start) : null;
6585
6705
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -6594,19 +6714,19 @@ function pa(e) {
6594
6714
  };
6595
6715
  }).filter(Boolean);
6596
6716
  }
6597
- function ma(e) {
6717
+ function xa(e) {
6598
6718
  let t = /* @__PURE__ */ new Map();
6599
6719
  for (let n of e) {
6600
- let e = ua(n.start), r = n.end ? ua(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), da);
6720
+ let e = _a(n.start), r = n.end ? _a(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), va);
6601
6721
  for (let r = 0; r <= i; r += 1) {
6602
- let i = la(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
6722
+ let i = ga(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
6603
6723
  t.has(i) || t.set(i, []), t.get(i).push(n);
6604
6724
  }
6605
6725
  }
6606
6726
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
6607
6727
  return t;
6608
6728
  }
6609
- function ha({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: o = "", variant: l = "month", size: u = "medium", accent: d = "", eventBg: p = "", eventText: m = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
6729
+ function Sa({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: o = "", variant: l = "month", size: u = "medium", accent: d = "", eventBg: p = "", eventText: m = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
6610
6730
  let { tenant: T, apiUrl: E, locale: D } = s(Y), O = s(Jt)?.[t], [k, A] = f(null), [j, M] = f(() => {
6611
6731
  let e = /* @__PURE__ */ new Date();
6612
6732
  return {
@@ -6629,13 +6749,13 @@ function ha({ events: e = [], source: t = "", titleField: n = "", startField: r
6629
6749
  E,
6630
6750
  O
6631
6751
  ]);
6632
- let N = ca[u] ?? ca.medium, P = d || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = m || "var(--page-accent-text, #ffffff)", R = t ? fa(O ?? k ?? [], {
6752
+ let N = ha[u] ?? ha.medium, P = d || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = m || "var(--page-accent-text, #ffffff)", R = t ? ya(O ?? k ?? [], {
6633
6753
  titleField: n,
6634
6754
  startField: r,
6635
6755
  endField: i,
6636
6756
  hrefField: a,
6637
6757
  colorField: o
6638
- }) : pa(e), z = ma(R), B = D || void 0, V = (e, t) => {
6758
+ }) : ba(e), z = xa(R), B = D || void 0, V = (e, t) => {
6639
6759
  let n = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
6640
6760
  ...X("event-dot"),
6641
6761
  style: {
@@ -6778,9 +6898,9 @@ function ha({ events: e = [], source: t = "", titleField: n = "", startField: r
6778
6898
  })]
6779
6899
  });
6780
6900
  }
6781
- let ee = new Date(j.year, j.month, 1), K = y === "sunday" ? 0 : 1, te = (ee.getDay() - K + 7) % 7, ne = new Date(j.year, j.month + 1, 0).getDate(), re = Math.ceil((te + ne) / 7), ie = la(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(B, { weekday: "short" }), oe = [];
6901
+ let ee = new Date(j.year, j.month, 1), K = y === "sunday" ? 0 : 1, te = (ee.getDay() - K + 7) % 7, ne = new Date(j.year, j.month + 1, 0).getDate(), re = Math.ceil((te + ne) / 7), ie = ga(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(B, { weekday: "short" }), oe = [];
6782
6902
  for (let e = 0; e < re * 7; e += 1) {
6783
- let t = e - te + 1, n = t >= 1 && t <= ne, r = la(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
6903
+ let t = e - te + 1, n = t >= 1 && t <= ne, r = ga(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
6784
6904
  oe.push(/* @__PURE__ */ _("div", {
6785
6905
  ...X("day", !n && "day-outside", o && "day-today"),
6786
6906
  style: {
@@ -6850,12 +6970,12 @@ function ha({ events: e = [], source: t = "", titleField: n = "", startField: r
6850
6970
  ]
6851
6971
  });
6852
6972
  }
6853
- var ga = {
6973
+ var Ca = {
6854
6974
  small: 36,
6855
6975
  medium: 56,
6856
6976
  large: 88
6857
6977
  };
6858
- function _a(e, t = {}) {
6978
+ function wa(e, t = {}) {
6859
6979
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ln(e);
6860
6980
  return n.map((e) => {
6861
6981
  let n = e.data ?? e, i = sn(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(sn(n, t.nameField)) : r(n.name);
@@ -6866,7 +6986,7 @@ function _a(e, t = {}) {
6866
6986
  };
6867
6987
  }).filter((e) => e.src);
6868
6988
  }
6869
- function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: o = "medium", perView: l = 5, gap: u = 48, hold: p = 3, slideMs: m = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
6989
+ function Ta({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: o = "medium", perView: l = 5, gap: u = 48, hold: p = 3, slideMs: m = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
6870
6990
  let { tenant: D, apiUrl: O, locale: k } = s(Y), A = $e(k), j = s(Jt)?.[t], [M, N] = f(null), P = d(null), F = d(null), [I, L] = f(0), [R, z] = f(0), [B, V] = f(0), [H, U] = f(!0), [W, G] = f(!1), [ee, K] = f(!1), [te, ne] = f(!1), [re, ie] = f(!1);
6871
6991
  c(() => {
6872
6992
  if (!t || j) return;
@@ -6906,11 +7026,11 @@ function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
6906
7026
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
6907
7027
  };
6908
7028
  });
6909
- let ae = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], oe = t ? _a(j ?? M ?? [], {
7029
+ let ae = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], oe = t ? wa(j ?? M ?? [], {
6910
7030
  imageField: n,
6911
7031
  nameField: r,
6912
7032
  hrefField: i
6913
- }) : ae, se = ga[o] ?? ga.medium, ce = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 48, le = a === "marquee" ? "step" : a, ue = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), de = Math.min(3e3, Math.max(100, Number(m) || 500)), fe = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), pe = (R || se * 3) + ce, me = I ? Math.max(1, Math.floor(I / pe)) : fe, he = Math.min(fe, me), ge = I ? Math.min(pe, I / he) : pe;
7033
+ }) : ae, se = Ca[o] ?? Ca.medium, ce = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 48, le = a === "marquee" ? "step" : a, ue = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), de = Math.min(3e3, Math.max(100, Number(m) || 500)), fe = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), pe = (R || se * 3) + ce, me = I ? Math.max(1, Math.floor(I / pe)) : fe, he = Math.min(fe, me), ge = I ? Math.min(pe, I / he) : pe;
6914
7034
  if (!oe.length) return /* @__PURE__ */ g("div", {
6915
7035
  ref: T,
6916
7036
  style: {
@@ -7127,7 +7247,7 @@ function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
7127
7247
  children: /* @__PURE__ */ g("path", { d: te ? "M8 5v14l11-7z" : "M7 5h4v14H7zM13 5h4v14h-4z" })
7128
7248
  })
7129
7249
  }),
7130
- /* @__PURE__ */ g(ya, {
7250
+ /* @__PURE__ */ g(Ea, {
7131
7251
  running: be,
7132
7252
  every: ue + de,
7133
7253
  slide: de,
@@ -7141,7 +7261,7 @@ function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
7141
7261
  ]
7142
7262
  });
7143
7263
  }
7144
- function ya({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: s, setAnimate: l }) {
7264
+ function Ea({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: s, setAnimate: l }) {
7145
7265
  c(() => {
7146
7266
  if (!e) return;
7147
7267
  let n = setInterval(() => {
@@ -7177,13 +7297,13 @@ function ya({ running: e, every: t, slide: n, step: r, index: i, total: a, home:
7177
7297
  l
7178
7298
  ]), null;
7179
7299
  }
7180
- var ba = {
7300
+ var Da = {
7181
7301
  tablet: 991,
7182
7302
  mobileLandscape: 767,
7183
7303
  mobile: 478
7184
- }, xa = "M4 6h16M4 12h16M4 18h16", Sa = (e) => e && Ar[e] ? Ar[e] : xa;
7185
- function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: a = "", icon: s = "", title: u = "", showClose: p = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
7186
- let [O, k] = f(!1), A = `wb-drw-${l().replace(/[^\w-]/g, "")}`, j = d(null), M = t === "always" ? "" : `(max-width: ${ba[t] ?? 991}px)`, N = o(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = d(null), [F, I] = f(null);
7304
+ }, Oa = "M4 6h16M4 12h16M4 18h16", ka = (e) => e && Ar[e] ? Ar[e] : Oa;
7305
+ function Aa({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: a = "", icon: s = "", title: u = "", showClose: p = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
7306
+ let [O, k] = f(!1), A = `wb-drw-${l().replace(/[^\w-]/g, "")}`, j = d(null), M = t === "always" ? "" : `(max-width: ${Da[t] ?? 991}px)`, N = o(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = d(null), [F, I] = f(null);
7187
7307
  c(() => {
7188
7308
  if (D || typeof window > "u") return;
7189
7309
  let e = () => {
@@ -7413,7 +7533,7 @@ function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
7413
7533
  strokeLinecap: "round",
7414
7534
  strokeLinejoin: "round",
7415
7535
  "aria-hidden": "true",
7416
- children: /* @__PURE__ */ g("path", { d: Sa(s) })
7536
+ children: /* @__PURE__ */ g("path", { d: ka(s) })
7417
7537
  }), a ? /* @__PURE__ */ g("span", { children: a }) : null]
7418
7538
  }),
7419
7539
  W && i !== "button" && !G && /* @__PURE__ */ _("div", {
@@ -7458,8 +7578,8 @@ function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
7458
7578
  ]
7459
7579
  });
7460
7580
  }
7461
- function wa({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
7462
- let c = `wb-dbt-${l().replace(/[^\w-]/g, "")}`, u = ba[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${c} { display: none !important; } }`, f = i === "inline";
7581
+ function ja({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
7582
+ let c = `wb-dbt-${l().replace(/[^\w-]/g, "")}`, u = Da[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${c} { display: none !important; } }`, f = i === "inline";
7463
7583
  return /* @__PURE__ */ _(h, { children: [d ? /* @__PURE__ */ g("style", { children: d }) : null, /* @__PURE__ */ _("button", {
7464
7584
  ref: o,
7465
7585
  type: "button",
@@ -7493,20 +7613,20 @@ function wa({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r =
7493
7613
  strokeLinecap: "round",
7494
7614
  strokeLinejoin: "round",
7495
7615
  "aria-hidden": "true",
7496
- children: /* @__PURE__ */ g("path", { d: Sa(r) })
7616
+ children: /* @__PURE__ */ g("path", { d: ka(r) })
7497
7617
  }), n ? /* @__PURE__ */ g("span", {
7498
7618
  ...X("label"),
7499
7619
  children: n
7500
7620
  }) : null]
7501
7621
  })] });
7502
7622
  }
7503
- var Ta = {
7623
+ var Ma = {
7504
7624
  small: 380,
7505
7625
  medium: 560,
7506
7626
  large: 820,
7507
7627
  full: "100%"
7508
7628
  };
7509
- function Ea({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: s = !0, backdropClose: l = !0, position: u = "center", actions: p = [], showCloseAction: m = !1, closeLabel: h = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
7629
+ function Na({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: s = !0, backdropClose: l = !0, position: u = "center", actions: p = [], showCloseAction: m = !1, closeLabel: h = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
7510
7630
  let [C, w] = f(!1), T = d(null);
7511
7631
  c(() => {
7512
7632
  if (S || !e) return;
@@ -7531,7 +7651,7 @@ function Ea({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
7531
7651
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
7532
7652
  };
7533
7653
  }, [S, C]);
7534
- let E = Ta[a] ?? Ta.medium, D = (e) => {
7654
+ let E = Ma[a] ?? Ma.medium, D = (e) => {
7535
7655
  let t = e.variant ?? "primary", n = {
7536
7656
  padding: "9px 16px",
7537
7657
  borderRadius: 6,
@@ -7709,7 +7829,7 @@ function Ea({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
7709
7829
  })]
7710
7830
  });
7711
7831
  }
7712
- function Da({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: s = !0, linked: l, style: u, nodeRef: p, inert: m = !1 }) {
7832
+ function Pa({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: s = !0, linked: l, style: u, nodeRef: p, inert: m = !1 }) {
7713
7833
  let [h, v] = f(!1), y = d(null), b = d(null), x = r !== "click", S = () => {
7714
7834
  b.current && clearTimeout(b.current), b.current = null;
7715
7835
  }, C = () => {
@@ -7812,15 +7932,15 @@ function Da({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
7812
7932
  }), E]
7813
7933
  });
7814
7934
  }
7815
- var Oa = {
7935
+ var Fa = {
7816
7936
  PageRoot: Cn,
7817
7937
  MarkdownBlock: Hn,
7818
- CalendarBlock: ha,
7819
- LogoCarousel: va,
7820
- DialogBlock: Ea,
7821
- DrawerBlock: Ca,
7822
- DrawerTrigger: wa,
7823
- DropdownBlock: Da,
7938
+ CalendarBlock: Sa,
7939
+ LogoCarousel: Ta,
7940
+ DialogBlock: Na,
7941
+ DrawerBlock: Aa,
7942
+ DrawerTrigger: ja,
7943
+ DropdownBlock: Pa,
7824
7944
  Section: wn,
7825
7945
  Container: Tn,
7826
7946
  LinkBlock: En,
@@ -7844,8 +7964,8 @@ var Oa = {
7844
7964
  ThemeModeBlock: ji,
7845
7965
  ScrollTopBlock: Bi,
7846
7966
  CounterBlock: zi,
7847
- OrgChartBlock: ta,
7848
- TableBlock: sa,
7967
+ OrgChartBlock: ca,
7968
+ TableBlock: ma,
7849
7969
  IconBlock: jr,
7850
7970
  MapBlock: kr,
7851
7971
  MasonryBlock: Nr,
@@ -7880,39 +8000,39 @@ var Oa = {
7880
8000
  FormFile: vi,
7881
8001
  FormRecaptcha: di,
7882
8002
  FormSubmit: bi
7883
- }, ka = {
8003
+ }, Ia = {
7884
8004
  id: "auth",
7885
8005
  label: "Accounts",
7886
8006
  category: "Apps",
7887
8007
  keys: ["SiteLoginForm", "SiteAccountMenu"],
7888
8008
  ssr: "shell",
7889
8009
  settings: ["site.authRedirect"]
7890
- }, Aa = r({
8010
+ }, La = r({
7891
8011
  user: null,
7892
8012
  status: "idle",
7893
8013
  ensure: () => {},
7894
8014
  refresh: () => {},
7895
8015
  signOut: () => {}
7896
8016
  });
7897
- function ja(e, t) {
8017
+ function Ra(e, t) {
7898
8018
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
7899
8019
  }
7900
- function Ma(e) {
8020
+ function za(e) {
7901
8021
  let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
7902
8022
  return {
7903
8023
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
7904
8024
  url: i,
7905
8025
  mePath: a,
7906
8026
  logoutPath: o,
7907
- meUrl: ja(i, a),
7908
- logoutUrl: ja(i, o),
8027
+ meUrl: Ra(i, a),
8028
+ logoutUrl: Ra(i, o),
7909
8029
  loginPage: r(n.loginPage),
7910
8030
  userPath: r(n.userPath),
7911
8031
  auth: n.auth === "bearer" ? "bearer" : "cookies",
7912
8032
  tokenKey: r(n.tokenKey) || "webim_session_token"
7913
8033
  };
7914
8034
  }
7915
- function Na(e, t) {
8035
+ function Ba(e, t) {
7916
8036
  if (!t) return e ?? null;
7917
8037
  let n = e;
7918
8038
  for (let e of t.split(".")) {
@@ -7921,26 +8041,26 @@ function Na(e, t) {
7921
8041
  }
7922
8042
  return n ?? null;
7923
8043
  }
7924
- function Pa(e) {
8044
+ function Va(e) {
7925
8045
  try {
7926
8046
  return window.localStorage.getItem(e) || "";
7927
8047
  } catch {
7928
8048
  return "";
7929
8049
  }
7930
8050
  }
7931
- function Fa(e) {
8051
+ function Ha(e) {
7932
8052
  try {
7933
8053
  window.localStorage.removeItem(e);
7934
8054
  } catch {}
7935
8055
  }
7936
- var Ia = () => {
7937
- let e = s(Aa);
8056
+ var Ua = () => {
8057
+ let e = s(La);
7938
8058
  return c(() => {
7939
8059
  e.ensure();
7940
8060
  }, [e]), e;
7941
8061
  };
7942
- function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
7943
- let a = s(Y), l = r || a?.apiUrl || "/api", p = i || a?.tenant || "", m = u(() => Ma(a?.settings), [a?.settings]), [h, _] = f(t ?? null), [v, y] = f(t ? "user" : n ? "guest" : "idle"), b = d(!1), x = o((e, t) => fetch(`${l}${e}`, {
8062
+ function Wa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
8063
+ let a = s(Y), l = r || a?.apiUrl || "/api", p = i || a?.tenant || "", m = u(() => za(a?.settings), [a?.settings]), [h, _] = f(t ?? null), [v, y] = f(t ? "user" : n ? "guest" : "idle"), b = d(!1), x = o((e, t) => fetch(`${l}${e}`, {
7944
8064
  ...t,
7945
8065
  credentials: "include",
7946
8066
  headers: {
@@ -7952,9 +8072,9 @@ function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
7952
8072
  if (n) return Promise.resolve(null);
7953
8073
  if (m.mode === "off") return Promise.resolve(S(null));
7954
8074
  if (m.mode === "custom") {
7955
- let e = m.auth === "bearer" ? Pa(m.tokenKey) : "";
8075
+ let e = m.auth === "bearer" ? Va(m.tokenKey) : "";
7956
8076
  return !m.meUrl || m.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(m.meUrl, { ...m.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
7957
- let t = Na(e, m.userPath);
8077
+ let t = Ba(e, m.userPath);
7958
8078
  return S(t && typeof t == "object" ? t : null);
7959
8079
  }).catch(() => S(null));
7960
8080
  }
@@ -7967,12 +8087,12 @@ function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
7967
8087
  ]), w = o(() => {
7968
8088
  if (m.mode === "off") return S(null), Promise.resolve();
7969
8089
  if (m.mode === "custom") {
7970
- let e = m.auth === "bearer" ? Pa(m.tokenKey) : "";
8090
+ let e = m.auth === "bearer" ? Va(m.tokenKey) : "";
7971
8091
  return (m.logoutUrl ? fetch(m.logoutUrl, {
7972
8092
  method: "post",
7973
8093
  ...m.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
7974
8094
  }).catch(() => {}) : Promise.resolve()).then(() => {
7975
- m.auth === "bearer" && Fa(m.tokenKey), S(null);
8095
+ m.auth === "bearer" && Ha(m.tokenKey), S(null);
7976
8096
  });
7977
8097
  }
7978
8098
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -8022,18 +8142,18 @@ function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
8022
8142
  m.loginPage,
8023
8143
  C,
8024
8144
  w
8025
- ]), /* @__PURE__ */ g(Aa.Provider, {
8145
+ ]), /* @__PURE__ */ g(La.Provider, {
8026
8146
  value: E,
8027
8147
  children: e
8028
8148
  });
8029
8149
  }
8030
- function Ra({ when: e, children: t }) {
8031
- let { status: n } = Ia();
8150
+ function Ga({ when: e, children: t }) {
8151
+ let { status: n } = Ua();
8032
8152
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
8033
8153
  }
8034
8154
  //#endregion
8035
8155
  //#region ../ui/src/components/builder/apps/auth/views.jsx
8036
- function za({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: o, nodeRef: c, inert: l, linked: u, show: d }) {
8156
+ function Ka({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: o, nodeRef: c, inert: l, linked: u, show: d }) {
8037
8157
  let { tenant: p, apiUrl: m, settings: h } = s(Y), [v, y] = f("form"), [b, x] = f(""), [S, C] = f(!1), w = e === "register", T = l ? d || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
8038
8158
  if (e.preventDefault(), l) return;
8039
8159
  let n = new FormData(e.currentTarget);
@@ -8166,8 +8286,8 @@ function za({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
8166
8286
  ]
8167
8287
  });
8168
8288
  }
8169
- function Ba({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
8170
- let { user: c, status: l, signOut: u } = Ia(), d = a ? s || "user" : l, f = a ? {
8289
+ function qa({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
8290
+ let { user: c, status: l, signOut: u } = Ua(), d = a ? s || "user" : l, f = a ? {
8171
8291
  name: "Ada Lovelace",
8172
8292
  email: "ada@example.com"
8173
8293
  } : c;
@@ -8235,40 +8355,40 @@ function Ba({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
8235
8355
  }
8236
8356
  //#endregion
8237
8357
  //#region ../ui/src/components/builder/apps/consent/manifest.js
8238
- var Va = {
8358
+ var Ja = {
8239
8359
  id: "consent",
8240
8360
  label: "Cookie consent",
8241
8361
  category: "Apps",
8242
8362
  keys: ["CookieConsent"],
8243
8363
  ssr: "shell",
8244
8364
  settings: []
8245
- }, Ha = "webim.cookie_consent";
8246
- function Ua() {
8365
+ }, Ya = "webim.cookie_consent";
8366
+ function Xa() {
8247
8367
  try {
8248
- let e = window.localStorage.getItem(Ha), t = e ? JSON.parse(e) : null;
8368
+ let e = window.localStorage.getItem(Ya), t = e ? JSON.parse(e) : null;
8249
8369
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
8250
8370
  } catch {
8251
8371
  return "";
8252
8372
  }
8253
8373
  }
8254
- function Wa(e) {
8374
+ function Za(e) {
8255
8375
  try {
8256
8376
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
8257
8377
  } catch {}
8258
8378
  }
8259
- function Ga(e) {
8379
+ function Qa(e) {
8260
8380
  try {
8261
- window.localStorage.setItem(Ha, JSON.stringify({
8381
+ window.localStorage.setItem(Ya, JSON.stringify({
8262
8382
  choice: e,
8263
8383
  at: (/* @__PURE__ */ new Date()).toISOString()
8264
8384
  }));
8265
8385
  } catch {}
8266
- Wa(e);
8386
+ Za(e);
8267
8387
  try {
8268
8388
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
8269
8389
  } catch {}
8270
8390
  }
8271
- var Ka = {
8391
+ var $a = {
8272
8392
  bottom: {
8273
8393
  left: 0,
8274
8394
  right: 0,
@@ -8290,18 +8410,18 @@ var Ka = {
8290
8410
  maxWidth: 400
8291
8411
  }
8292
8412
  };
8293
- function qa({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: s, style: l, nodeRef: u, inert: d }) {
8413
+ function eo({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: s, style: l, nodeRef: u, inert: d }) {
8294
8414
  let [p, m] = f(!!d), [v, y] = f(null), b = (e) => {
8295
8415
  y(e), typeof u == "function" && u(e);
8296
8416
  };
8297
8417
  if (c(() => {
8298
8418
  if (d) return;
8299
- let e = Ua();
8300
- e ? Wa(e) : m(!0);
8419
+ let e = Xa();
8420
+ e ? Za(e) : m(!0);
8301
8421
  }, [d, v]), !p) return null;
8302
8422
  let x = (e) => () => {
8303
- d || (Ga(e), m(!1));
8304
- }, S = Ka[o] ?? Ka.bottom, C = {
8423
+ d || (Qa(e), m(!1));
8424
+ }, S = $a[o] ?? $a.bottom, C = {
8305
8425
  appearance: "none",
8306
8426
  font: "inherit",
8307
8427
  fontSize: 14,
@@ -8386,37 +8506,37 @@ function qa({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
8386
8506
  }
8387
8507
  //#endregion
8388
8508
  //#region ../ui/src/components/builder/apps/language/manifest.js
8389
- var Ja = {
8509
+ var to = {
8390
8510
  id: "language",
8391
8511
  label: "Language",
8392
8512
  category: "Apps",
8393
8513
  keys: ["SiteLanguagePicker"],
8394
8514
  ssr: "prefetch",
8395
8515
  settings: ["locales"]
8396
- }, Ya = {
8516
+ }, no = {
8397
8517
  id: "search",
8398
8518
  label: "Search",
8399
8519
  category: "Apps",
8400
8520
  keys: ["SiteSearch"],
8401
8521
  ssr: "prefetch",
8402
8522
  settings: []
8403
- }, Xa = 50, Za = 2e3;
8404
- function Qa() {
8523
+ }, ro = 50, io = 2e3;
8524
+ function ao() {
8405
8525
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
8406
8526
  }
8407
- function $a(e, t) {
8527
+ function oo(e, t) {
8408
8528
  let n = e?.data ?? {}, r = [];
8409
8529
  for (let e of Object.values(n)) {
8410
8530
  let t = e == null ? "" : ln(e);
8411
- if (t && r.push(t), r.join(" ").length > Za) break;
8531
+ if (t && r.push(t), r.join(" ").length > io) break;
8412
8532
  }
8413
- return r.join(" ").slice(0, Za).toLocaleLowerCase(t || void 0);
8533
+ return r.join(" ").slice(0, io).toLocaleLowerCase(t || void 0);
8414
8534
  }
8415
- function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: a = "inline", includePages: o = !0, collections: l = [], limit: u = 10, emptyText: p = "Nothing found", hint: m = "", style: h, nodeRef: v, inert: y = !1, sample: b = !1 }) {
8416
- let { tenant: x, apiUrl: S, locale: C } = s(Y), [w, T] = f(() => Qa()), [E, D] = f(() => Qa()), [O, k] = f(null), [A, j] = f(!1), M = d(null), N = a === "popup";
8535
+ function so({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: a = "inline", includePages: o = !0, collections: l = [], limit: u = 10, emptyText: p = "Nothing found", hint: m = "", style: h, nodeRef: v, inert: y = !1, sample: b = !1 }) {
8536
+ let { tenant: x, apiUrl: S, locale: C } = s(Y), [w, T] = f(() => ao()), [E, D] = f(() => ao()), [O, k] = f(null), [A, j] = f(!1), M = d(null), N = a === "popup";
8417
8537
  c(() => {
8418
8538
  let e = () => {
8419
- let e = Qa();
8539
+ let e = ao();
8420
8540
  T(e), D(e);
8421
8541
  };
8422
8542
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -8467,7 +8587,7 @@ function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
8467
8587
  });
8468
8588
  }
8469
8589
  else for (let t of e.rows) {
8470
- if (!$a(t, C).includes(P)) continue;
8590
+ if (!oo(t, C).includes(P)) continue;
8471
8591
  let n = t?.data ?? {}, r = ln(n.name) || "Untitled", i = ln(n.slug);
8472
8592
  F.push({
8473
8593
  key: `entry:${t.id}`,
@@ -8476,7 +8596,7 @@ function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
8476
8596
  kind: "entry"
8477
8597
  });
8478
8598
  }
8479
- let I = F.slice(0, Math.min(Math.max(1, u), Xa)), L = (e) => {
8599
+ let I = F.slice(0, Math.min(Math.max(1, u), ro)), L = (e) => {
8480
8600
  if (y) {
8481
8601
  e.preventDefault(), T(E), j(!0);
8482
8602
  return;
@@ -8629,7 +8749,7 @@ function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
8629
8749
  }
8630
8750
  //#endregion
8631
8751
  //#region ../ui/src/components/builder/apps/shop/manifest.js
8632
- var to = {
8752
+ var co = {
8633
8753
  id: "shop",
8634
8754
  label: "Shop",
8635
8755
  category: "Shop",
@@ -8644,7 +8764,7 @@ var to = {
8644
8764
  ],
8645
8765
  ssr: "shell",
8646
8766
  settings: ["shop.enabled"]
8647
- }, no = "webim.cart.", ro = "webim.currency.", io = /* @__PURE__ */ new Map(), ao = {
8767
+ }, lo = "webim.cart.", uo = "webim.currency.", fo = /* @__PURE__ */ new Map(), po = {
8648
8768
  get(e) {
8649
8769
  try {
8650
8770
  return window.localStorage.getItem(e) ?? "";
@@ -8658,7 +8778,7 @@ var to = {
8658
8778
  } catch {}
8659
8779
  }
8660
8780
  };
8661
- function oo(e) {
8781
+ function mo(e) {
8662
8782
  if (typeof window > "u") return !1;
8663
8783
  try {
8664
8784
  return new URL(e, window.location.href).origin === window.location.origin;
@@ -8669,7 +8789,7 @@ function oo(e) {
8669
8789
  async function Q(e, t, n, { method: r = "GET", body: i } = {}) {
8670
8790
  let a = await fetch(`${e}${n}`, {
8671
8791
  method: r,
8672
- ...oo(e) ? { credentials: "include" } : {},
8792
+ ...mo(e) ? { credentials: "include" } : {},
8673
8793
  headers: {
8674
8794
  ...t ? { "x-tenant": t } : {},
8675
8795
  ...i ? { "content-type": "application/json" } : {}
@@ -8685,7 +8805,7 @@ async function Q(e, t, n, { method: r = "GET", body: i } = {}) {
8685
8805
  }
8686
8806
  return o.payload;
8687
8807
  }
8688
- var so = {
8808
+ var ho = {
8689
8809
  id: "",
8690
8810
  currency: "",
8691
8811
  lines: [],
@@ -8700,25 +8820,25 @@ var so = {
8700
8820
  shipping_total: 0,
8701
8821
  total: 0
8702
8822
  };
8703
- function co(e, t) {
8704
- let n = `${no}${t || "default"}`, r = `${ro}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
8705
- cart: so,
8823
+ function go(e, t) {
8824
+ let n = `${lo}${t || "default"}`, r = `${uo}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
8825
+ cart: ho,
8706
8826
  loading: !1,
8707
8827
  loaded: !1,
8708
8828
  error: null,
8709
- currency: ao.get(r)
8829
+ currency: po.get(r)
8710
8830
  }, o = null, s = () => i.forEach((e) => e()), c = (e) => {
8711
8831
  a = {
8712
8832
  ...a,
8713
8833
  ...e
8714
8834
  }, s();
8715
- }, l = (e) => (e && typeof e == "object" && (e.id && ao.set(n, e.id), c({
8835
+ }, l = (e) => (e && typeof e == "object" && (e.id && po.set(n, e.id), c({
8716
8836
  cart: e,
8717
8837
  loaded: !0,
8718
8838
  error: null
8719
8839
  })), e), u = () => {
8720
8840
  if (o) return o;
8721
- let r = ao.get(n), i = new URLSearchParams({
8841
+ let r = po.get(n), i = new URLSearchParams({
8722
8842
  ...r ? { id: r } : {},
8723
8843
  ...a.currency ? { currency: a.currency } : {}
8724
8844
  }).toString();
@@ -8734,7 +8854,7 @@ function co(e, t) {
8734
8854
  return l(await Q(e, t, "/store/cart", {
8735
8855
  method: "POST",
8736
8856
  body: {
8737
- cart_id: ao.get(n) || void 0,
8857
+ cart_id: po.get(n) || void 0,
8738
8858
  product_id: r,
8739
8859
  variant_id: i ?? null,
8740
8860
  quantity: o,
@@ -8746,7 +8866,7 @@ function co(e, t) {
8746
8866
  }
8747
8867
  };
8748
8868
  return typeof window < "u" && window.addEventListener("storage", (e) => {
8749
- e.key === r && c({ currency: ao.get(r) }), (e.key === n || e.key === r) && u();
8869
+ e.key === r && c({ currency: po.get(r) }), (e.key === n || e.key === r) && u();
8750
8870
  }), {
8751
8871
  getState: () => a,
8752
8872
  subscribe: (e) => (i.add(e), () => i.delete(e)),
@@ -8762,7 +8882,7 @@ function co(e, t) {
8762
8882
  return l(await Q(e, t, "/store/cart/coupon", {
8763
8883
  method: "POST",
8764
8884
  body: {
8765
- cart_id: ao.get(n),
8885
+ cart_id: po.get(n),
8766
8886
  code: r
8767
8887
  }
8768
8888
  }));
@@ -8770,64 +8890,64 @@ function co(e, t) {
8770
8890
  c({ loading: !1 });
8771
8891
  }
8772
8892
  },
8773
- setCountry: async (r, i) => ao.get(n) ? l(await Q(e, t, "/store/cart/country", {
8893
+ setCountry: async (r, i) => po.get(n) ? l(await Q(e, t, "/store/cart/country", {
8774
8894
  method: "POST",
8775
8895
  body: {
8776
- cart_id: ao.get(n),
8896
+ cart_id: po.get(n),
8777
8897
  country: r,
8778
8898
  ...i !== void 0 && { postal_code: i }
8779
8899
  }
8780
8900
  })) : a.cart,
8781
- setDelivery: async (r) => ao.get(n) ? l(await Q(e, t, "/store/cart/delivery", {
8901
+ setDelivery: async (r) => po.get(n) ? l(await Q(e, t, "/store/cart/delivery", {
8782
8902
  method: "POST",
8783
8903
  body: {
8784
- cart_id: ao.get(n),
8904
+ cart_id: po.get(n),
8785
8905
  delivery: r
8786
8906
  }
8787
8907
  })) : a.cart,
8788
8908
  setCurrency: async (i) => {
8789
- if (ao.set(r, i), c({ currency: i }), !ao.get(n)) return u();
8909
+ if (po.set(r, i), c({ currency: i }), !po.get(n)) return u();
8790
8910
  try {
8791
8911
  return l(await Q(e, t, "/store/cart/currency", {
8792
8912
  method: "POST",
8793
8913
  body: {
8794
- cart_id: ao.get(n),
8914
+ cart_id: po.get(n),
8795
8915
  currency: i
8796
8916
  }
8797
8917
  }));
8798
8918
  } catch {
8799
- return ao.set(r, ""), c({ currency: "" }), u();
8919
+ return po.set(r, ""), c({ currency: "" }), u();
8800
8920
  }
8801
8921
  },
8802
8922
  reset: () => {
8803
- ao.set(n, ""), c({ cart: so });
8923
+ po.set(n, ""), c({ cart: ho });
8804
8924
  },
8805
- cartId: () => ao.get(n)
8925
+ cartId: () => po.get(n)
8806
8926
  };
8807
8927
  }
8808
- function lo(e, t) {
8928
+ function _o(e, t) {
8809
8929
  let n = `${e}|${t}`;
8810
- return io.has(n) || io.set(n, co(e, t)), io.get(n);
8930
+ return fo.has(n) || fo.set(n, go(e, t)), fo.get(n);
8811
8931
  }
8812
- function uo(e, t) {
8932
+ function vo(e, t) {
8813
8933
  let n = Array.isArray(e?.currencies) ? e.currencies : [];
8814
8934
  return t && n.includes(t) ? t : e?.currency || "";
8815
8935
  }
8816
- var fo = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
8817
- function po(e, t = [], n = null) {
8936
+ var yo = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
8937
+ function bo(e, t = [], n = null) {
8818
8938
  let r;
8819
8939
  try {
8820
8940
  r = new Intl.DisplayNames([e || "en"], { type: "region" });
8821
8941
  } catch {
8822
8942
  r = { of: (e) => e };
8823
8943
  }
8824
- let i = (n ?? fo).map((e) => ({
8944
+ let i = (n ?? yo).map((e) => ({
8825
8945
  code: e,
8826
8946
  name: r.of(e) ?? e
8827
8947
  })), a = i.filter((e) => t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0)), o = i.filter((e) => !t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0));
8828
8948
  return [...a, ...o];
8829
8949
  }
8830
- function mo(e, t, n) {
8950
+ function xo(e, t, n) {
8831
8951
  let r = t || "USD";
8832
8952
  try {
8833
8953
  let t = new Intl.NumberFormat(n || void 0, {
@@ -8839,7 +8959,7 @@ function mo(e, t, n) {
8839
8959
  return `${(Number(e || 0) / 100).toFixed(2)} ${r}`;
8840
8960
  }
8841
8961
  }
8842
- var ho = {
8962
+ var So = {
8843
8963
  en: {
8844
8964
  add: "Add to cart",
8845
8965
  adding: "Adding…",
@@ -9171,24 +9291,24 @@ var ho = {
9171
9291
  no: "Hayır"
9172
9292
  }
9173
9293
  };
9174
- function go(e) {
9175
- let t = ho[String(e || "").toLowerCase().split("-")[0]] ?? ho.en, n = (e, n) => {
9176
- let r = t[e] ?? ho.en[e] ?? e;
9294
+ function Co(e) {
9295
+ let t = So[String(e || "").toLowerCase().split("-")[0]] ?? So.en, n = (e, n) => {
9296
+ let r = t[e] ?? So.en[e] ?? e;
9177
9297
  return n ? r.replace(/\{(\w+)\}/g, (e, t) => t in n ? String(n[t]) : e) : r;
9178
9298
  };
9179
- return n.has = (e) => e in ho.en, n;
9299
+ return n.has = (e) => e in So.en, n;
9180
9300
  }
9181
- var _o = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", vo = /* @__PURE__ */ new Map();
9182
- function yo(e, t) {
9301
+ var wo = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", To = /* @__PURE__ */ new Map();
9302
+ function Eo(e, t) {
9183
9303
  let n = `${e}|${t}`;
9184
- return vo.has(n) || vo.set(n, Q(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (vo.delete(n), []))), vo.get(n);
9304
+ return To.has(n) || To.set(n, Q(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (To.delete(n), []))), To.get(n);
9185
9305
  }
9186
- function bo(e) {
9306
+ function Do(e) {
9187
9307
  let t = /* @__PURE__ */ new Date(), n = Math.max(0, Math.round(Number(e) || 0));
9188
9308
  for (; n > 0;) t.setDate(t.getDate() + 1), t.getDay() !== 0 && t.getDay() !== 6 && --n;
9189
9309
  return t;
9190
9310
  }
9191
- function xo(e, t, n, r) {
9311
+ function Oo(e, t, n, r) {
9192
9312
  let i = (e) => e != null && Number.isFinite(Number(e));
9193
9313
  if (!i(n) && !i(r)) return "";
9194
9314
  let a;
@@ -9203,7 +9323,7 @@ function xo(e, t, n, r) {
9203
9323
  day: "numeric"
9204
9324
  });
9205
9325
  }
9206
- let o = a.format(bo(i(n) ? n : r)), s = a.format(bo(i(r) ? r : n));
9326
+ let o = a.format(Do(i(n) ? n : r)), s = a.format(Do(i(r) ? r : n));
9207
9327
  return o === s ? e("arrives", { date: o }) : e("arrivesRange", {
9208
9328
  from: o,
9209
9329
  to: s
@@ -9211,7 +9331,7 @@ function xo(e, t, n, r) {
9211
9331
  }
9212
9332
  //#endregion
9213
9333
  //#region ../ui/src/components/builder/apps/shop/engagement.jsx
9214
- var So = "var(--page-muted, rgba(100,116,139,1))", Co = "1px solid var(--page-border, #d1d5db)", wo = "var(--page-surface, #f2f2f2)", To = "#f59e0b", Eo = {
9334
+ var ko = "var(--page-muted, rgba(100,116,139,1))", Ao = "1px solid var(--page-border, #d1d5db)", jo = "var(--page-surface, #f2f2f2)", Mo = "#f59e0b", No = {
9215
9335
  ...vn,
9216
9336
  border: 0,
9217
9337
  borderRadius: "8px",
@@ -9219,14 +9339,14 @@ var So = "var(--page-muted, rgba(100,116,139,1))", Co = "1px solid var(--page-bo
9219
9339
  fontSize: "14px",
9220
9340
  fontWeight: 600,
9221
9341
  fontFamily: "inherit"
9222
- }, Do = {
9223
- ...Eo,
9342
+ }, Po = {
9343
+ ...No,
9224
9344
  backgroundColor: "transparent",
9225
9345
  color: "var(--page-text, #111827)",
9226
- border: Co
9346
+ border: Ao
9227
9347
  };
9228
- function Oo() {
9229
- let { tenant: e, apiUrl: t, locale: n, settings: r } = s(Y), i = u(() => go(n), [n]), a = (e) => r?.[e] !== !1;
9348
+ function Fo() {
9349
+ let { tenant: e, apiUrl: t, locale: n, settings: r } = s(Y), i = u(() => Co(n), [n]), a = (e) => r?.[e] !== !1;
9230
9350
  return {
9231
9351
  tenant: e,
9232
9352
  apiUrl: t || "/api",
@@ -9237,12 +9357,12 @@ function Oo() {
9237
9357
  favoritesOn: a("shop.favorites"),
9238
9358
  moderated: r?.["shop.reviewModeration"] !== "auto",
9239
9359
  loginHref: () => {
9240
- let e = Ma(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
9360
+ let e = za(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
9241
9361
  return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
9242
9362
  }
9243
9363
  };
9244
9364
  }
9245
- var ko = (e, t) => {
9365
+ var Io = (e, t) => {
9246
9366
  try {
9247
9367
  return new Intl.NumberFormat(t || void 0, {
9248
9368
  notation: "compact",
@@ -9251,7 +9371,7 @@ var ko = (e, t) => {
9251
9371
  } catch {
9252
9372
  return String(e);
9253
9373
  }
9254
- }, Ao = (e, t) => {
9374
+ }, Lo = (e, t) => {
9255
9375
  try {
9256
9376
  return new Intl.DateTimeFormat(t || void 0, {
9257
9377
  day: "numeric",
@@ -9261,8 +9381,8 @@ var ko = (e, t) => {
9261
9381
  } catch {
9262
9382
  return String(e).slice(0, 10);
9263
9383
  }
9264
- }, jo = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
9265
- function Mo({ fill: e = 0, size: t = 16, clipId: n }) {
9384
+ }, Ro = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
9385
+ function zo({ fill: e = 0, size: t = 16, clipId: n }) {
9266
9386
  return /* @__PURE__ */ _("svg", {
9267
9387
  width: t,
9268
9388
  height: t,
@@ -9280,18 +9400,18 @@ function Mo({ fill: e = 0, size: t = 16, clipId: n }) {
9280
9400
  })
9281
9401
  }) }),
9282
9402
  /* @__PURE__ */ g("path", {
9283
- d: jo,
9403
+ d: Ro,
9284
9404
  fill: "var(--page-border, #d1d5db)"
9285
9405
  }),
9286
9406
  e > 0 && /* @__PURE__ */ g("path", {
9287
- d: jo,
9288
- fill: To,
9407
+ d: Ro,
9408
+ fill: Mo,
9289
9409
  clipPath: `url(#${n})`
9290
9410
  })
9291
9411
  ]
9292
9412
  });
9293
9413
  }
9294
- function No({ value: e = 0, size: t = 16 }) {
9414
+ function Bo({ value: e = 0, size: t = 16 }) {
9295
9415
  let n = l().replace(/:/g, "");
9296
9416
  return /* @__PURE__ */ g("span", {
9297
9417
  role: "img",
@@ -9308,14 +9428,14 @@ function No({ value: e = 0, size: t = 16 }) {
9308
9428
  2,
9309
9429
  3,
9310
9430
  4
9311
- ].map((r) => /* @__PURE__ */ g(Mo, {
9431
+ ].map((r) => /* @__PURE__ */ g(zo, {
9312
9432
  fill: Math.max(0, Math.min(1, e - r)),
9313
9433
  size: t,
9314
9434
  clipId: `${n}-${r}`
9315
9435
  }, r))
9316
9436
  });
9317
9437
  }
9318
- function Po({ value: e, onChange: t, size: n = 28, label: r }) {
9438
+ function Vo({ value: e, onChange: t, size: n = 28, label: r }) {
9319
9439
  let i = l().replace(/:/g, ""), [a, o] = f(0), s = a || e;
9320
9440
  return /* @__PURE__ */ g("span", {
9321
9441
  role: "radiogroup",
@@ -9346,7 +9466,7 @@ function Po({ value: e, onChange: t, size: n = 28, label: r }) {
9346
9466
  cursor: "pointer",
9347
9467
  lineHeight: 0
9348
9468
  },
9349
- children: /* @__PURE__ */ g(Mo, {
9469
+ children: /* @__PURE__ */ g(zo, {
9350
9470
  fill: +(s >= r),
9351
9471
  size: n,
9352
9472
  clipId: `${i}-${r}`
@@ -9354,8 +9474,8 @@ function Po({ value: e, onChange: t, size: n = 28, label: r }) {
9354
9474
  }, r))
9355
9475
  });
9356
9476
  }
9357
- function Fo(e, { inert: t }) {
9358
- let { tenant: n, apiUrl: r, favoritesOn: i } = Oo(), [a, o] = f({
9477
+ function Ho(e, { inert: t }) {
9478
+ let { tenant: n, apiUrl: r, favoritesOn: i } = Fo(), [a, o] = f({
9359
9479
  favorited: !1,
9360
9480
  count: null
9361
9481
  });
@@ -9395,7 +9515,7 @@ function Fo(e, { inert: t }) {
9395
9515
  toggle: s
9396
9516
  };
9397
9517
  }
9398
- var Io = (e) => /* @__PURE__ */ g("svg", {
9518
+ var Uo = (e) => /* @__PURE__ */ g("svg", {
9399
9519
  width: "20",
9400
9520
  height: "20",
9401
9521
  viewBox: "0 0 24 24",
@@ -9408,8 +9528,8 @@ var Io = (e) => /* @__PURE__ */ g("svg", {
9408
9528
  strokeWidth: "1.8"
9409
9529
  })
9410
9530
  });
9411
- function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9412
- let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = Oo(), l = e?.sample ? "" : e?.slug || e?.id || "", u = Fo(l, { inert: t || !l }), [d, p] = f(""), m = n ? 29 : e?.rating_count ?? 0, h = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
9531
+ function Wo({ product: e, inert: t = !1, sample: n = !1 }) {
9532
+ let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = Fo(), l = e?.sample ? "" : e?.slug || e?.id || "", u = Ho(l, { inert: t || !l }), [d, p] = f(""), m = n ? 29 : e?.rating_count ?? 0, h = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
9413
9533
  n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
9414
9534
  behavior: "smooth",
9415
9535
  block: "start"
@@ -9418,7 +9538,7 @@ function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9418
9538
  if (!(t || !l)) try {
9419
9539
  await u.toggle();
9420
9540
  } catch (e) {
9421
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(_o(i, e));
9541
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(wo(i, e));
9422
9542
  }
9423
9543
  }, S = [];
9424
9544
  return a && m > 0 && S.push(/* @__PURE__ */ _("span", {
@@ -9436,13 +9556,13 @@ function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9436
9556
  maximumFractionDigits: 1
9437
9557
  })
9438
9558
  }),
9439
- /* @__PURE__ */ g(No, { value: h }),
9559
+ /* @__PURE__ */ g(Bo, { value: h }),
9440
9560
  /* @__PURE__ */ g("a", {
9441
9561
  href: "#reviews",
9442
9562
  onClick: b("reviews"),
9443
9563
  ...X("rating-link"),
9444
9564
  style: { color: "inherit" },
9445
- children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: ko(m, r) })
9565
+ children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: Io(m, r) })
9446
9566
  })
9447
9567
  ]
9448
9568
  }, "r")), o && v > 0 && S.push(/* @__PURE__ */ g("a", {
@@ -9450,7 +9570,7 @@ function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9450
9570
  onClick: b("questions"),
9451
9571
  ...X("qa-link"),
9452
9572
  style: { color: "inherit" },
9453
- children: i("qaCount", { n: ko(v, r) })
9573
+ children: i("qaCount", { n: Io(v, r) })
9454
9574
  }, "q")), !S.length && !s ? null : /* @__PURE__ */ _("div", {
9455
9575
  ...X("engagement"),
9456
9576
  style: {
@@ -9469,7 +9589,7 @@ function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9469
9589
  },
9470
9590
  children: S.flatMap((e, t) => t ? [/* @__PURE__ */ g("span", {
9471
9591
  ...X("separator"),
9472
- style: { color: So },
9592
+ style: { color: ko },
9473
9593
  children: "•"
9474
9594
  }, `s${t}`), e] : [e])
9475
9595
  }),
@@ -9487,22 +9607,22 @@ function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9487
9607
  "aria-label": u.favorited ? i("unfavorite") : i("favorite"),
9488
9608
  title: u.favorited ? i("unfavorite") : i("favorite"),
9489
9609
  style: {
9490
- ...Do,
9610
+ ...Po,
9491
9611
  padding: "7px",
9492
9612
  borderRadius: "999px",
9493
9613
  lineHeight: 0
9494
9614
  },
9495
- children: Io(u.favorited)
9615
+ children: Uo(u.favorited)
9496
9616
  }), y > 0 && /* @__PURE__ */ g("span", {
9497
9617
  ...X("favorites-count"),
9498
9618
  style: { fontWeight: 600 },
9499
- children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: ko(y, r) })
9619
+ children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: Io(y, r) })
9500
9620
  })]
9501
9621
  }),
9502
9622
  d && /* @__PURE__ */ g("span", {
9503
9623
  ...X("note"),
9504
9624
  style: {
9505
- color: So,
9625
+ color: ko,
9506
9626
  fontSize: "13px"
9507
9627
  },
9508
9628
  children: d
@@ -9510,7 +9630,7 @@ function Lo({ product: e, inert: t = !1, sample: n = !1 }) {
9510
9630
  ]
9511
9631
  });
9512
9632
  }
9513
- var Ro = {
9633
+ var Go = {
9514
9634
  data: [{
9515
9635
  id: "s1",
9516
9636
  author: "Ayşe Y.",
@@ -9546,8 +9666,8 @@ var Ro = {
9546
9666
  ]
9547
9667
  }
9548
9668
  };
9549
- function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9550
- let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: s, moderated: l, loginHref: u } = Oo(), d = Ia(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, h] = f(null), [v, y] = f("newest"), [b, x] = f(0), [S, C] = f(5), [w, T] = f(0), [E, D] = f({
9669
+ function Ko({ product: e, inert: t = !1, sample: n = !1 }) {
9670
+ let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: s, moderated: l, loginHref: u } = Fo(), d = Ua(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, h] = f(null), [v, y] = f("newest"), [b, x] = f(0), [S, C] = f(5), [w, T] = f(0), [E, D] = f({
9551
9671
  rating: 0,
9552
9672
  title: "",
9553
9673
  body: ""
@@ -9585,7 +9705,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9585
9705
  w,
9586
9706
  s
9587
9707
  ]), !s) return null;
9588
- let P = n || !p ? Ro : m, F = P?.summary ?? {
9708
+ let P = n || !p ? Go : m, F = P?.summary ?? {
9589
9709
  average: 0,
9590
9710
  count: 0,
9591
9711
  histogram: [
@@ -9623,7 +9743,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9623
9743
  body: E
9624
9744
  }), k(!1), N(o(l ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
9625
9745
  } catch (e) {
9626
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(_o(o, e));
9746
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(wo(o, e));
9627
9747
  } finally {
9628
9748
  j(!1);
9629
9749
  }
@@ -9675,14 +9795,14 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9675
9795
  maximumFractionDigits: 1
9676
9796
  }) : "–"
9677
9797
  }),
9678
- /* @__PURE__ */ g(No, {
9798
+ /* @__PURE__ */ g(Bo, {
9679
9799
  value: F.average,
9680
9800
  size: 18
9681
9801
  }),
9682
9802
  /* @__PURE__ */ g("span", {
9683
9803
  ...X("reviews-count"),
9684
9804
  style: {
9685
- color: So,
9805
+ color: ko,
9686
9806
  fontSize: "13px"
9687
9807
  },
9688
9808
  children: F.count === 1 ? o("reviewsOne") : o("reviewsCount", { n: F.count })
@@ -9734,7 +9854,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9734
9854
  style: {
9735
9855
  height: "8px",
9736
9856
  borderRadius: "4px",
9737
- background: wo,
9857
+ background: jo,
9738
9858
  overflow: "hidden"
9739
9859
  },
9740
9860
  children: /* @__PURE__ */ g("span", {
@@ -9743,13 +9863,13 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9743
9863
  display: "block",
9744
9864
  height: "100%",
9745
9865
  width: `${n / B * 100}%`,
9746
- background: To
9866
+ background: Mo
9747
9867
  }
9748
9868
  })
9749
9869
  }),
9750
9870
  /* @__PURE__ */ g("span", {
9751
9871
  style: {
9752
- color: So,
9872
+ color: ko,
9753
9873
  textAlign: "right"
9754
9874
  },
9755
9875
  children: n
@@ -9764,7 +9884,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9764
9884
  type: "button",
9765
9885
  onClick: R,
9766
9886
  ...X("review-button"),
9767
- style: Eo,
9887
+ style: No,
9768
9888
  children: o(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
9769
9889
  })
9770
9890
  })
@@ -9778,7 +9898,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9778
9898
  flexDirection: "column",
9779
9899
  gap: "10px",
9780
9900
  padding: "16px",
9781
- border: Co,
9901
+ border: Ao,
9782
9902
  borderRadius: "12px"
9783
9903
  },
9784
9904
  children: [
@@ -9790,7 +9910,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9790
9910
  gap: "12px",
9791
9911
  fontWeight: 600
9792
9912
  },
9793
- children: [o("yourRating"), /* @__PURE__ */ g(Po, {
9913
+ children: [o("yourRating"), /* @__PURE__ */ g(Vo, {
9794
9914
  value: E.rating,
9795
9915
  label: o("yourRating"),
9796
9916
  onChange: (e) => D((t) => ({
@@ -9835,13 +9955,13 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9835
9955
  type: "submit",
9836
9956
  disabled: A,
9837
9957
  ...X("submit-button"),
9838
- style: Eo,
9958
+ style: No,
9839
9959
  children: o("submitReview")
9840
9960
  }), /* @__PURE__ */ g("button", {
9841
9961
  type: "button",
9842
9962
  onClick: () => k(!1),
9843
9963
  ...X("cancel-button"),
9844
- style: Do,
9964
+ style: Po,
9845
9965
  children: "✕"
9846
9966
  })]
9847
9967
  })
@@ -9851,7 +9971,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9851
9971
  ...X("note"),
9852
9972
  style: {
9853
9973
  margin: 0,
9854
- color: So
9974
+ color: ko
9855
9975
  },
9856
9976
  children: M
9857
9977
  }),
@@ -9895,7 +10015,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9895
10015
  onClick: () => x(0),
9896
10016
  ...X("filter-chip"),
9897
10017
  style: {
9898
- ...Do,
10018
+ ...Po,
9899
10019
  padding: "6px 12px"
9900
10020
  },
9901
10021
  children: [o("starsN", { n: b }), " ✕"]
@@ -9905,7 +10025,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9905
10025
  ...X("empty"),
9906
10026
  style: {
9907
10027
  margin: 0,
9908
- color: So
10028
+ color: ko
9909
10029
  },
9910
10030
  children: o("noReviews")
9911
10031
  }),
@@ -9918,7 +10038,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9918
10038
  ...X("review"),
9919
10039
  style: {
9920
10040
  padding: "16px 0",
9921
- borderTop: Co,
10041
+ borderTop: Ao,
9922
10042
  display: "flex",
9923
10043
  flexDirection: "column",
9924
10044
  gap: "6px"
@@ -9932,7 +10052,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9932
10052
  flexWrap: "wrap"
9933
10053
  },
9934
10054
  children: [
9935
- /* @__PURE__ */ g(No, { value: e.rating }),
10055
+ /* @__PURE__ */ g(Bo, { value: e.rating }),
9936
10056
  e.title && /* @__PURE__ */ g("strong", {
9937
10057
  ...X("review-title"),
9938
10058
  children: e.title
@@ -9943,8 +10063,8 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9943
10063
  fontSize: "12px",
9944
10064
  padding: "2px 8px",
9945
10065
  borderRadius: "999px",
9946
- background: wo,
9947
- color: So
10066
+ background: jo,
10067
+ color: ko
9948
10068
  },
9949
10069
  children: o("awaitingApproval")
9950
10070
  })
@@ -9963,12 +10083,12 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9963
10083
  ...X("meta"),
9964
10084
  style: {
9965
10085
  fontSize: "13px",
9966
- color: So
10086
+ color: ko
9967
10087
  },
9968
10088
  children: [
9969
10089
  e.author || o("anonymous"),
9970
10090
  " · ",
9971
- Ao(e.created_at, a),
10091
+ Lo(e.created_at, a),
9972
10092
  e.verified && /* @__PURE__ */ _("span", {
9973
10093
  ...X("verified"),
9974
10094
  style: {
@@ -9985,7 +10105,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9985
10105
  marginTop: "4px",
9986
10106
  padding: "10px 12px",
9987
10107
  borderRadius: "8px",
9988
- background: wo,
10108
+ background: jo,
9989
10109
  fontSize: "14px"
9990
10110
  },
9991
10111
  children: [/* @__PURE__ */ g("strong", {
@@ -9993,7 +10113,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
9993
10113
  style: {
9994
10114
  display: "block",
9995
10115
  fontSize: "12px",
9996
- color: So,
10116
+ color: ko,
9997
10117
  marginBottom: "2px"
9998
10118
  },
9999
10119
  children: o("shopReply")
@@ -10010,7 +10130,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
10010
10130
  onClick: () => C((e) => e + 10),
10011
10131
  ...X("load-more"),
10012
10132
  style: {
10013
- ...Do,
10133
+ ...Po,
10014
10134
  alignSelf: "center"
10015
10135
  },
10016
10136
  children: o("loadMore")
@@ -10018,7 +10138,7 @@ function zo({ product: e, inert: t = !1, sample: n = !1 }) {
10018
10138
  ]
10019
10139
  });
10020
10140
  }
10021
- var Bo = {
10141
+ var qo = {
10022
10142
  data: [{
10023
10143
  id: "q1",
10024
10144
  author: "Can D.",
@@ -10031,8 +10151,8 @@ var Bo = {
10031
10151
  filtered: 1
10032
10152
  }
10033
10153
  };
10034
- function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10035
- let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: s, loginHref: l } = Oo(), u = Ia(), d = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = f(null), [h, v] = f(5), [y, b] = f(0), [x, S] = f(""), [C, w] = f(!1), [T, E] = f("");
10154
+ function Jo({ product: e, inert: t = !1, sample: n = !1 }) {
10155
+ let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: s, loginHref: l } = Fo(), u = Ua(), d = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = f(null), [h, v] = f(5), [y, b] = f(0), [x, S] = f(""), [C, w] = f(!1), [T, E] = f("");
10036
10156
  if (c(() => {
10037
10157
  if (!s || !d) return;
10038
10158
  let e = !0;
@@ -10053,7 +10173,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10053
10173
  y,
10054
10174
  s
10055
10175
  ]), !s) return null;
10056
- let D = n || !d ? Bo : p, O = u.status === "user", k = async (e) => {
10176
+ let D = n || !d ? qo : p, O = u.status === "user", k = async (e) => {
10057
10177
  if (e.preventDefault(), !(t || x.trim().length < 3)) {
10058
10178
  if (!O) {
10059
10179
  window.location.assign(l());
@@ -10066,7 +10186,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10066
10186
  body: { question: x.trim() }
10067
10187
  }), S(""), E(o("questionPending")), b((e) => e + 1);
10068
10188
  } catch (e) {
10069
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(_o(o, e));
10189
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(wo(o, e));
10070
10190
  } finally {
10071
10191
  w(!1);
10072
10192
  }
@@ -10112,7 +10232,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10112
10232
  type: "submit",
10113
10233
  disabled: C || x.trim().length < 3,
10114
10234
  ...X("submit-button"),
10115
- style: Eo,
10235
+ style: No,
10116
10236
  children: o("submitQuestion")
10117
10237
  })]
10118
10238
  }) : /* @__PURE__ */ g("p", {
@@ -10128,7 +10248,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10128
10248
  ...X("note"),
10129
10249
  style: {
10130
10250
  margin: 0,
10131
- color: So
10251
+ color: ko
10132
10252
  },
10133
10253
  children: T
10134
10254
  }),
@@ -10136,7 +10256,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10136
10256
  ...X("empty"),
10137
10257
  style: {
10138
10258
  margin: 0,
10139
- color: So
10259
+ color: ko
10140
10260
  },
10141
10261
  children: o("noQuestions")
10142
10262
  }),
@@ -10149,7 +10269,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10149
10269
  ...X("question"),
10150
10270
  style: {
10151
10271
  padding: "14px 0",
10152
- borderTop: Co,
10272
+ borderTop: Ao,
10153
10273
  display: "flex",
10154
10274
  flexDirection: "column",
10155
10275
  gap: "6px"
@@ -10190,7 +10310,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10190
10310
  ...X("badge"),
10191
10311
  style: {
10192
10312
  fontSize: "12px",
10193
- color: So
10313
+ color: ko
10194
10314
  },
10195
10315
  children: o("awaitingAnswer")
10196
10316
  }),
@@ -10198,12 +10318,12 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10198
10318
  ...X("meta"),
10199
10319
  style: {
10200
10320
  fontSize: "12px",
10201
- color: So
10321
+ color: ko
10202
10322
  },
10203
10323
  children: [
10204
10324
  e.author || o("anonymous"),
10205
10325
  " · ",
10206
- Ao(e.created_at, a)
10326
+ Lo(e.created_at, a)
10207
10327
  ]
10208
10328
  })
10209
10329
  ]
@@ -10214,7 +10334,7 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10214
10334
  onClick: () => v((e) => e + 10),
10215
10335
  ...X("load-more"),
10216
10336
  style: {
10217
- ...Do,
10337
+ ...Po,
10218
10338
  alignSelf: "center"
10219
10339
  },
10220
10340
  children: o("loadMore")
@@ -10224,8 +10344,8 @@ function Vo({ product: e, inert: t = !1, sample: n = !1 }) {
10224
10344
  }
10225
10345
  //#endregion
10226
10346
  //#region ../ui/src/components/builder/apps/shop/specs.jsx
10227
- var Ho = "1px solid var(--page-border, #d1d5db)", Uo = "var(--page-muted, rgba(100,116,139,1))", Wo = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
10228
- function Go(e, t, n, r) {
10347
+ var Yo = "1px solid var(--page-border, #d1d5db)", Xo = "var(--page-muted, rgba(100,116,139,1))", Zo = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
10348
+ function Qo(e, t, n, r) {
10229
10349
  let i = n || void 0;
10230
10350
  switch (e.type) {
10231
10351
  case "integer":
@@ -10248,7 +10368,7 @@ function Go(e, t, n, r) {
10248
10368
  gap: "6px"
10249
10369
  },
10250
10370
  children: [
10251
- n === 5 && /* @__PURE__ */ g(No, { value: Number(t) }),
10371
+ n === 5 && /* @__PURE__ */ g(Bo, { value: Number(t) }),
10252
10372
  Number(t).toLocaleString(i),
10253
10373
  " / ",
10254
10374
  n
@@ -10280,12 +10400,12 @@ function Go(e, t, n, r) {
10280
10400
  height: "14px",
10281
10401
  borderRadius: "4px",
10282
10402
  background: t,
10283
- border: Ho,
10403
+ border: Yo,
10284
10404
  display: "inline-block"
10285
10405
  } }), t]
10286
10406
  });
10287
10407
  case "link": {
10288
- let e = Wo(t);
10408
+ let e = Zo(t);
10289
10409
  return e ? /* @__PURE__ */ g("a", {
10290
10410
  href: e,
10291
10411
  target: "_blank",
@@ -10294,7 +10414,7 @@ function Go(e, t, n, r) {
10294
10414
  children: t
10295
10415
  }) : String(t);
10296
10416
  }
10297
- case "image": return Wo(t) ? /* @__PURE__ */ g("img", {
10417
+ case "image": return Zo(t) ? /* @__PURE__ */ g("img", {
10298
10418
  src: t,
10299
10419
  alt: e.name,
10300
10420
  style: {
@@ -10305,14 +10425,14 @@ function Go(e, t, n, r) {
10305
10425
  }
10306
10426
  }) : "";
10307
10427
  case "video":
10308
- case "file": return Wo(t) ? /* @__PURE__ */ g("a", {
10428
+ case "file": return Zo(t) ? /* @__PURE__ */ g("a", {
10309
10429
  href: t,
10310
10430
  target: "_blank",
10311
10431
  rel: "noopener noreferrer",
10312
10432
  style: { color: "var(--page-accent, #111827)" },
10313
10433
  children: String(t).split("/").pop()
10314
10434
  }) : "";
10315
- case "media": return (Array.isArray(t) ? t : [t]).filter(Wo).map((e, t) => /* @__PURE__ */ g("a", {
10435
+ case "media": return (Array.isArray(t) ? t : [t]).filter(Zo).map((e, t) => /* @__PURE__ */ g("a", {
10316
10436
  href: e,
10317
10437
  target: "_blank",
10318
10438
  rel: "noopener noreferrer",
@@ -10352,7 +10472,7 @@ function Go(e, t, n, r) {
10352
10472
  default: return String(t);
10353
10473
  }
10354
10474
  }
10355
- function Ko({ specs: e, locale: t, words: n }) {
10475
+ function $o({ specs: e, locale: t, words: n }) {
10356
10476
  return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ _("section", {
10357
10477
  ...X("specs"),
10358
10478
  style: {
@@ -10371,7 +10491,7 @@ function Ko({ specs: e, locale: t, words: n }) {
10371
10491
  role: "table",
10372
10492
  ...X("specs-table"),
10373
10493
  style: {
10374
- border: Ho,
10494
+ border: Yo,
10375
10495
  borderRadius: "10px",
10376
10496
  overflow: "hidden"
10377
10497
  },
@@ -10385,13 +10505,13 @@ function Ko({ specs: e, locale: t, words: n }) {
10385
10505
  gridTemplateColumns: "minmax(120px, 34%) 1fr",
10386
10506
  gap: "16px",
10387
10507
  padding: "10px 14px",
10388
- borderTop: r ? Ho : 0,
10508
+ borderTop: r ? Yo : 0,
10389
10509
  fontSize: "14px"
10390
10510
  },
10391
10511
  children: [/* @__PURE__ */ g("span", {
10392
10512
  role: "rowheader",
10393
10513
  ...X("spec-name"),
10394
- style: { color: Uo },
10514
+ style: { color: Xo },
10395
10515
  children: e.name
10396
10516
  }), /* @__PURE__ */ g("span", {
10397
10517
  role: "cell",
@@ -10402,7 +10522,7 @@ function Ko({ specs: e, locale: t, words: n }) {
10402
10522
  gap: "4px 10px",
10403
10523
  alignItems: "center"
10404
10524
  },
10405
- children: i.map((r, a) => /* @__PURE__ */ _("span", { children: [Go(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
10525
+ children: i.map((r, a) => /* @__PURE__ */ _("span", { children: [Qo(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
10406
10526
  })]
10407
10527
  }, e.key);
10408
10528
  })
@@ -10411,7 +10531,7 @@ function Ko({ specs: e, locale: t, words: n }) {
10411
10531
  }
10412
10532
  //#endregion
10413
10533
  //#region ../ui/src/components/builder/apps/shop/views.jsx
10414
- var $ = "var(--page-muted, rgba(100,116,139,1))", qo = "1px solid var(--page-border, #d1d5db)", Jo = "var(--page-surface, #f2f2f2)", Yo = {
10534
+ var $ = "var(--page-muted, rgba(100,116,139,1))", es = "1px solid var(--page-border, #d1d5db)", ts = "var(--page-surface, #f2f2f2)", ns = {
10415
10535
  ...vn,
10416
10536
  border: 0,
10417
10537
  borderRadius: "8px",
@@ -10420,14 +10540,14 @@ var $ = "var(--page-muted, rgba(100,116,139,1))", qo = "1px solid var(--page-bor
10420
10540
  fontWeight: 600,
10421
10541
  fontFamily: "inherit",
10422
10542
  textAlign: "center"
10423
- }, Xo = {
10424
- ...Yo,
10543
+ }, rs = {
10544
+ ...ns,
10425
10545
  backgroundColor: "transparent",
10426
10546
  color: "var(--page-text, #111827)",
10427
- border: qo
10547
+ border: es
10428
10548
  };
10429
- function Zo() {
10430
- let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = s(Y), a = u(() => go(n), [n]), c = i?.["shop.orderPrefix"], l = i?.["shop.orderSuffix"], d = o((e) => `${typeof c == "string" ? c : "#"}${e}${typeof l == "string" ? l : ""}`, [c, l]);
10549
+ function is() {
10550
+ let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = s(Y), a = u(() => Co(n), [n]), c = i?.["shop.orderPrefix"], l = i?.["shop.orderSuffix"], d = o((e) => `${typeof c == "string" ? c : "#"}${e}${typeof l == "string" ? l : ""}`, [c, l]);
10431
10551
  return {
10432
10552
  tenant: e,
10433
10553
  apiUrl: t || "/api",
@@ -10437,8 +10557,8 @@ function Zo() {
10437
10557
  orderId: d
10438
10558
  };
10439
10559
  }
10440
- function Qo(e, t, n = !0) {
10441
- let r = u(() => lo(e, t), [e, t]), i = p(r.subscribe, r.getState, r.getState);
10560
+ function as(e, t, n = !0) {
10561
+ let r = u(() => _o(e, t), [e, t]), i = p(r.subscribe, r.getState, r.getState);
10442
10562
  return c(() => {
10443
10563
  n && !i.loaded && !i.loading && r.load();
10444
10564
  }, [n, r]), {
@@ -10446,8 +10566,8 @@ function Qo(e, t, n = !0) {
10446
10566
  ...i
10447
10567
  };
10448
10568
  }
10449
- var $o = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
10450
- function es({ value: e, label: t, onCommit: n }) {
10569
+ var os = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
10570
+ function ss({ value: e, label: t, onCommit: n }) {
10451
10571
  let [r, i] = f(null), a = () => {
10452
10572
  if (r === null) return;
10453
10573
  let t = Math.max(1, Math.round(Number(r)) || 1);
@@ -10471,12 +10591,12 @@ function es({ value: e, label: t, onCommit: n }) {
10471
10591
  }
10472
10592
  });
10473
10593
  }
10474
- var ts = "/product/{slug}", ns = (e) => !e || e === "/product?product={slug}" ? ts : e, rs = (e, t) => String(ns(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
10475
- function is(e) {
10594
+ var cs = "/product/{slug}", ls = (e) => !e || e === "/product?product={slug}" ? cs : e, us = (e, t) => String(ls(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
10595
+ function ds(e) {
10476
10596
  let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
10477
10597
  return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
10478
10598
  }
10479
- function as({ product: e, variant: t, locale: n, size: r = 16 }) {
10599
+ function fs({ product: e, variant: t, locale: n, size: r = 16 }) {
10480
10600
  let i = e.currency, a = t?.price ?? e.price;
10481
10601
  return /* @__PURE__ */ _("span", {
10482
10602
  ...X("price"),
@@ -10489,7 +10609,7 @@ function as({ product: e, variant: t, locale: n, size: r = 16 }) {
10489
10609
  children: [/* @__PURE__ */ g("span", {
10490
10610
  ...X("price-current"),
10491
10611
  style: { fontWeight: 700 },
10492
- children: mo(a, i, n)
10612
+ children: xo(a, i, n)
10493
10613
  }), e.compare_at_price > a && /* @__PURE__ */ g("span", {
10494
10614
  ...X("price-old"),
10495
10615
  style: {
@@ -10497,11 +10617,11 @@ function as({ product: e, variant: t, locale: n, size: r = 16 }) {
10497
10617
  textDecoration: "line-through",
10498
10618
  fontSize: "0.85em"
10499
10619
  },
10500
- children: mo(e.compare_at_price, i, n)
10620
+ children: xo(e.compare_at_price, i, n)
10501
10621
  })]
10502
10622
  });
10503
10623
  }
10504
- var os = [
10624
+ var ps = [
10505
10625
  1,
10506
10626
  2,
10507
10627
  3
@@ -10517,8 +10637,8 @@ var os = [
10517
10637
  currency: "USD",
10518
10638
  sample: !0
10519
10639
  }));
10520
- function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: h = !1, noNavigate: v = !1 }) {
10521
- let { tenant: y, apiUrl: b, locale: x, words: S } = Zo(), C = Oo(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, j] = f({}), [M, N] = f(!1), { store: P, currency: F } = Qo(b, y, !m), I = l === "favorites";
10640
+ function ms({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: h = !1, noNavigate: v = !1 }) {
10641
+ let { tenant: y, apiUrl: b, locale: x, words: S } = is(), C = Fo(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, j] = f({}), [M, N] = f(!1), { store: P, currency: F } = as(b, y, !m), I = l === "favorites";
10522
10642
  c(() => {
10523
10643
  let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `&currency=${encodeURIComponent(F)}` : "";
10524
10644
  if (I && m) {
@@ -10527,7 +10647,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10527
10647
  }
10528
10648
  return N(!1), Promise.all([Q(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${s ? `&collection=${encodeURIComponent(s)}` : ""}`), Q(b, y, "/store/config")]).then(([t, n]) => {
10529
10649
  if (!e) return;
10530
- let r = uo(n, F);
10650
+ let r = vo(n, F);
10531
10651
  D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
10532
10652
  ...e,
10533
10653
  currency: r
@@ -10546,7 +10666,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10546
10666
  I,
10547
10667
  m
10548
10668
  ]);
10549
- let L = w?.length || !h ? w ?? [] : os, R = async (e) => {
10669
+ let L = w?.length || !h ? w ?? [] : ps, R = async (e) => {
10550
10670
  if (!(m || e.sample)) {
10551
10671
  k(e.id);
10552
10672
  try {
@@ -10557,7 +10677,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10557
10677
  } catch (t) {
10558
10678
  j((n) => ({
10559
10679
  ...n,
10560
- [e.id]: _o(S, t)
10680
+ [e.id]: wo(S, t)
10561
10681
  }));
10562
10682
  } finally {
10563
10683
  k("");
@@ -10602,7 +10722,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10602
10722
  gap: `${n}px`
10603
10723
  },
10604
10724
  children: L.map((e) => {
10605
- let t = is(e) === 0, n = rs(r, e);
10725
+ let t = ds(e) === 0, n = us(r, e);
10606
10726
  return /* @__PURE__ */ _("div", {
10607
10727
  ...X("card"),
10608
10728
  style: {
@@ -10625,7 +10745,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10625
10745
  aspectRatio: "1 / 1",
10626
10746
  borderRadius: "10px",
10627
10747
  overflow: "hidden",
10628
- background: Jo
10748
+ background: ts
10629
10749
  },
10630
10750
  children: e.images?.[0] && /* @__PURE__ */ g("img", {
10631
10751
  src: e.images[0],
@@ -10658,16 +10778,16 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10658
10778
  color: $
10659
10779
  },
10660
10780
  children: [
10661
- /* @__PURE__ */ g(No, {
10781
+ /* @__PURE__ */ g(Bo, {
10662
10782
  value: Number(e.rating_avg),
10663
10783
  size: 14
10664
10784
  }),
10665
10785
  "(",
10666
- ko(e.rating_count, x),
10786
+ Io(e.rating_count, x),
10667
10787
  ")"
10668
10788
  ]
10669
10789
  }),
10670
- /* @__PURE__ */ g(as, {
10790
+ /* @__PURE__ */ g(fs, {
10671
10791
  product: e,
10672
10792
  locale: x
10673
10793
  }),
@@ -10676,7 +10796,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10676
10796
  onClick: v ? (e) => e.preventDefault() : void 0,
10677
10797
  ...X("choose-button"),
10678
10798
  style: {
10679
- ...Xo,
10799
+ ...rs,
10680
10800
  display: "block"
10681
10801
  },
10682
10802
  children: S("choose")
@@ -10686,7 +10806,7 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10686
10806
  onClick: () => R(e),
10687
10807
  ...X("add-button", t && "add-button-sold-out"),
10688
10808
  style: {
10689
- ...Yo,
10809
+ ...ns,
10690
10810
  opacity: t ? .5 : 1
10691
10811
  },
10692
10812
  children: t ? S("soldOut") : O === e.id ? S("adding") : a || S("add")
@@ -10706,24 +10826,24 @@ function ss({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10706
10826
  ]
10707
10827
  });
10708
10828
  }
10709
- function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
10710
- let { tenant: d, apiUrl: p, locale: m, param: h, words: v } = Zo(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(0), [T, E] = f(""), [D, O] = f(1), [k, A] = f(!1), [j, M] = f(""), { store: N, currency: P } = Qo(p, d, !s), F = e || h || $o("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
10829
+ function hs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
10830
+ let { tenant: d, apiUrl: p, locale: m, param: h, words: v } = is(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(0), [T, E] = f(""), [D, O] = f(1), [k, A] = f(!1), [j, M] = f(""), { store: N, currency: P } = as(p, d, !s), F = e || h || os("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
10711
10831
  if (c(() => {
10712
10832
  let e = !0;
10713
10833
  return S(!1), (async () => {
10714
10834
  let t = await Q(p, d, "/store/config"), n = F ? await Q(p, d, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await Q(p, d, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
10715
10835
  if (e) {
10716
10836
  if (!n) {
10717
- S(!0), b(l ? os[0] : null);
10837
+ S(!0), b(l ? ps[0] : null);
10718
10838
  return;
10719
10839
  }
10720
10840
  b({
10721
10841
  ...n,
10722
- currency: uo(t, P)
10842
+ currency: vo(t, P)
10723
10843
  }), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
10724
10844
  }
10725
10845
  })().catch(() => {
10726
- e && (S(!0), b(l ? os[0] : null));
10846
+ e && (S(!0), b(l ? ps[0] : null));
10727
10847
  }), () => {
10728
10848
  e = !1;
10729
10849
  };
@@ -10750,7 +10870,7 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10750
10870
  try {
10751
10871
  await N.add(y.id, L?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
10752
10872
  } catch (e) {
10753
- M(_o(v, e));
10873
+ M(wo(v, e));
10754
10874
  } finally {
10755
10875
  A(!1);
10756
10876
  }
@@ -10785,7 +10905,7 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10785
10905
  aspectRatio: "1 / 1",
10786
10906
  borderRadius: "12px",
10787
10907
  overflow: "hidden",
10788
- background: Jo
10908
+ background: ts
10789
10909
  },
10790
10910
  children: y.images?.[C] && /* @__PURE__ */ g("img", {
10791
10911
  src: y.images[C],
@@ -10816,8 +10936,8 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10816
10936
  borderRadius: "8px",
10817
10937
  overflow: "hidden",
10818
10938
  cursor: "pointer",
10819
- border: t === C ? "2px solid var(--page-accent, #111827)" : qo,
10820
- background: Jo
10939
+ border: t === C ? "2px solid var(--page-accent, #111827)" : es,
10940
+ background: ts
10821
10941
  },
10822
10942
  children: /* @__PURE__ */ g("img", {
10823
10943
  src: e,
@@ -10848,12 +10968,12 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10848
10968
  },
10849
10969
  children: y.name
10850
10970
  }),
10851
- /* @__PURE__ */ g(Lo, {
10971
+ /* @__PURE__ */ g(Wo, {
10852
10972
  product: y,
10853
10973
  inert: s,
10854
10974
  sample: l && !!y.sample
10855
10975
  }),
10856
- /* @__PURE__ */ g(as, {
10976
+ /* @__PURE__ */ g(fs, {
10857
10977
  product: y,
10858
10978
  variant: L,
10859
10979
  locale: m,
@@ -10874,7 +10994,7 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10874
10994
  onClick: () => E(e.id),
10875
10995
  ...X("variant", e.id === T && "variant-selected", t && "variant-sold-out"),
10876
10996
  style: {
10877
- ...Xo,
10997
+ ...rs,
10878
10998
  padding: "8px 14px",
10879
10999
  opacity: t ? .45 : 1,
10880
11000
  textDecoration: t ? "line-through" : "none",
@@ -10909,7 +11029,7 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10909
11029
  onClick: B,
10910
11030
  ...X("add-button", z && "add-button-sold-out"),
10911
11031
  style: {
10912
- ...Yo,
11032
+ ...ns,
10913
11033
  flex: 1,
10914
11034
  opacity: z ? .5 : 1
10915
11035
  },
@@ -10940,17 +11060,17 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10940
11060
  ]
10941
11061
  })]
10942
11062
  }),
10943
- i && /* @__PURE__ */ g(Ko, {
11063
+ i && /* @__PURE__ */ g($o, {
10944
11064
  specs: y.specs,
10945
11065
  locale: m,
10946
11066
  words: v
10947
11067
  }),
10948
- n && /* @__PURE__ */ g(zo, {
11068
+ n && /* @__PURE__ */ g(Ko, {
10949
11069
  product: y,
10950
11070
  inert: s,
10951
11071
  sample: l && !!y.sample
10952
11072
  }),
10953
- r && /* @__PURE__ */ g(Vo, {
11073
+ r && /* @__PURE__ */ g(Jo, {
10954
11074
  product: y,
10955
11075
  inert: s,
10956
11076
  sample: l && !!y.sample
@@ -10958,13 +11078,13 @@ function cs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10958
11078
  ]
10959
11079
  });
10960
11080
  }
10961
- function ls(e) {
10962
- return /* @__PURE__ */ g(ss, {
11081
+ function gs(e) {
11082
+ return /* @__PURE__ */ g(ms, {
10963
11083
  ...e,
10964
11084
  source: "favorites"
10965
11085
  });
10966
11086
  }
10967
- var us = /* @__PURE__ */ _("svg", {
11087
+ var _s = /* @__PURE__ */ _("svg", {
10968
11088
  width: "20",
10969
11089
  height: "20",
10970
11090
  viewBox: "0 0 24 24",
@@ -10977,8 +11097,8 @@ var us = /* @__PURE__ */ _("svg", {
10977
11097
  ...X("icon"),
10978
11098
  children: [/* @__PURE__ */ g("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ g("path", { d: "M9 7a3 3 0 0 1 6 0" })]
10979
11099
  });
10980
- function ds({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
10981
- let { tenant: c, apiUrl: l, words: u } = Zo(), { cart: d } = Qo(l, c, !a), f = o && !d.count ? 2 : d.count;
11100
+ function vs({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
11101
+ let { tenant: c, apiUrl: l, words: u } = is(), { cart: d } = as(l, c, !a), f = o && !d.count ? 2 : d.count;
10982
11102
  return /* @__PURE__ */ _("a", {
10983
11103
  ref: i,
10984
11104
  href: e,
@@ -10995,7 +11115,7 @@ function ds({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
10995
11115
  ...q(r)
10996
11116
  },
10997
11117
  children: [
10998
- us,
11118
+ _s,
10999
11119
  n && /* @__PURE__ */ g("span", {
11000
11120
  ...X("label"),
11001
11121
  children: t || u("cart")
@@ -11023,7 +11143,7 @@ function ds({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
11023
11143
  ]
11024
11144
  });
11025
11145
  }
11026
- function fs(e, t, n) {
11146
+ function ys(e, t, n) {
11027
11147
  if (t === "code") return e;
11028
11148
  try {
11029
11149
  if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
@@ -11036,8 +11156,8 @@ function fs(e, t, n) {
11036
11156
  return e;
11037
11157
  }
11038
11158
  }
11039
- function ps({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
11040
- let { tenant: a, apiUrl: o, locale: s } = Zo(), { store: l, currency: u } = Qo(o, a, !i), [d, p] = f(null), m = {
11159
+ function bs({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
11160
+ let { tenant: a, apiUrl: o, locale: s } = is(), { store: l, currency: u } = as(o, a, !i), [d, p] = f(null), m = {
11041
11161
  display: "inline-flex",
11042
11162
  alignItems: "center",
11043
11163
  gap: 8,
@@ -11071,7 +11191,7 @@ function ps({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
11071
11191
  }) : null, /* @__PURE__ */ g("select", {
11072
11192
  "aria-label": t || "Currency",
11073
11193
  ...X("select"),
11074
- value: uo(d, u),
11194
+ value: vo(d, u),
11075
11195
  onChange: i ? void 0 : (e) => l.setCurrency(e.target.value === d.currency ? "" : e.target.value),
11076
11196
  onKeyDown: i ? (e) => e.preventDefault() : void 0,
11077
11197
  style: {
@@ -11085,24 +11205,24 @@ function ps({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
11085
11205
  },
11086
11206
  children: h.map((t) => /* @__PURE__ */ g("option", {
11087
11207
  value: t,
11088
- children: fs(t, e, s)
11208
+ children: ys(t, e, s)
11089
11209
  }, t))
11090
11210
  })]
11091
11211
  });
11092
11212
  }
11093
- var ms = {
11213
+ var xs = {
11094
11214
  display: "flex",
11095
11215
  flexDirection: "column",
11096
11216
  gap: "6px",
11097
11217
  fontSize: "13px"
11098
- }, hs = {
11218
+ }, Ss = {
11099
11219
  margin: "0 0 12px",
11100
11220
  fontSize: "18px"
11101
11221
  };
11102
- function gs({ label: e, required: t, children: n }) {
11222
+ function Cs({ label: e, required: t, children: n }) {
11103
11223
  return /* @__PURE__ */ _("label", {
11104
11224
  ...X("field"),
11105
- style: ms,
11225
+ style: xs,
11106
11226
  children: [/* @__PURE__ */ _("span", {
11107
11227
  ...X("field-label"),
11108
11228
  style: { fontWeight: 500 },
@@ -11114,7 +11234,7 @@ function gs({ label: e, required: t, children: n }) {
11114
11234
  }), n]
11115
11235
  });
11116
11236
  }
11117
- var _s = [{
11237
+ var ws = [{
11118
11238
  id: "ship:standard",
11119
11239
  type: "shipping",
11120
11240
  name: "Standard",
@@ -11130,7 +11250,7 @@ var _s = [{
11130
11250
  min_days: null,
11131
11251
  max_days: null,
11132
11252
  detail: "Main Street 1"
11133
- }], vs = {
11253
+ }], Ts = {
11134
11254
  name: "",
11135
11255
  email: "",
11136
11256
  phone: "",
@@ -11145,8 +11265,8 @@ var _s = [{
11145
11265
  recipient: "",
11146
11266
  gift_message: ""
11147
11267
  };
11148
- function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
11149
- let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = Zo(), { store: m, cart: h, loaded: v } = Qo(s, o, !r), [y, b] = f(null), [x, S] = f(vs), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && $o("cancelled") === "1", I = (e) => mo(e, h.currency || y?.currency, l);
11268
+ function Es({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
11269
+ let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = is(), { store: m, cart: h, loaded: v } = as(s, o, !r), [y, b] = f(null), [x, S] = f(Ts), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && os("cancelled") === "1", I = (e) => xo(e, h.currency || y?.currency, l);
11150
11270
  c(() => {
11151
11271
  Q(s, o, "/store/config").then((e) => {
11152
11272
  b(e), w((t) => t || e?.methods?.[0] || "");
@@ -11155,15 +11275,15 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11155
11275
  methods: []
11156
11276
  }));
11157
11277
  }, [s, o]), c(() => {
11158
- let e = $o("order");
11278
+ let e = os("order");
11159
11279
  r || !e || F || Q(s, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
11160
11280
  A(e), e?.payment_status === "paid" && m.reset();
11161
- }).catch((e) => O(_o(d, e)));
11281
+ }).catch((e) => O(wo(d, e)));
11162
11282
  }, [s, o]);
11163
11283
  let L = (e) => (t) => S((n) => ({
11164
11284
  ...n,
11165
11285
  [e]: t.target.value
11166
- })), R = u(() => po(l, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [l, y]);
11286
+ })), R = u(() => bo(l, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [l, y]);
11167
11287
  c(() => {
11168
11288
  h.country && !x.country && S((e) => ({
11169
11289
  ...e,
@@ -11176,7 +11296,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11176
11296
  try {
11177
11297
  await m.setCoupon(e), M("");
11178
11298
  } catch (e) {
11179
- O(_o(d, e));
11299
+ O(wo(d, e));
11180
11300
  } finally {
11181
11301
  P(!1);
11182
11302
  }
@@ -11233,13 +11353,13 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11233
11353
  }
11234
11354
  A(t?.order ?? null), m.reset();
11235
11355
  } catch (e) {
11236
- O(_o(d, e));
11356
+ O(wo(d, e));
11237
11357
  } finally {
11238
11358
  E(!1);
11239
11359
  }
11240
11360
  }
11241
- }, V = { ...q(t) }, H = r && i && !h.lines.length ? !0 : h.requires_shipping !== !1, U = Array.isArray(h.discounts) ? h.discounts : [], W = U.filter((e) => e.type !== "shipping"), G = U.find((e) => e.type === "shipping") ?? null, ee = r && i && !h.lines.length ? _s : Array.isArray(h.delivery_options) ? h.delivery_options : [], K = ee.find((e) => e.id === h.delivery) ?? (r && i ? ee[0] : null), te = K?.type === "pickup", ne = (e) => {
11242
- r || e === h.delivery || (O(""), m.setDelivery(e).catch((e) => O(_o(d, e))));
11361
+ }, V = { ...q(t) }, H = r && i && !h.lines.length ? !0 : h.requires_shipping !== !1, U = Array.isArray(h.discounts) ? h.discounts : [], W = U.filter((e) => e.type !== "shipping"), G = U.find((e) => e.type === "shipping") ?? null, ee = r && i && !h.lines.length ? ws : Array.isArray(h.delivery_options) ? h.delivery_options : [], K = ee.find((e) => e.id === h.delivery) ?? (r && i ? ee[0] : null), te = K?.type === "pickup", ne = (e) => {
11362
+ r || e === h.delivery || (O(""), m.setDelivery(e).catch((e) => O(wo(d, e))));
11243
11363
  };
11244
11364
  if (k) {
11245
11365
  let t = k.payment_status === "paid";
@@ -11267,7 +11387,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11267
11387
  style: {
11268
11388
  padding: "12px",
11269
11389
  borderRadius: "8px",
11270
- background: Jo
11390
+ background: ts
11271
11391
  },
11272
11392
  children: Bn(k.instructions_content)
11273
11393
  }) : k.instructions ? /* @__PURE__ */ g("pre", {
@@ -11276,7 +11396,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11276
11396
  margin: 0,
11277
11397
  padding: "12px",
11278
11398
  borderRadius: "8px",
11279
- background: Jo,
11399
+ background: ts,
11280
11400
  whiteSpace: "pre-wrap",
11281
11401
  fontFamily: "inherit"
11282
11402
  },
@@ -11287,7 +11407,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11287
11407
  style: {
11288
11408
  padding: "12px",
11289
11409
  borderRadius: "8px",
11290
- background: Jo
11410
+ background: ts
11291
11411
  },
11292
11412
  children: [
11293
11413
  /* @__PURE__ */ g("div", {
@@ -11311,13 +11431,13 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11311
11431
  /* @__PURE__ */ g("div", { children: d("pickupNote") })
11312
11432
  ]
11313
11433
  }),
11314
- !k.delivery.location && xo(d, l, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ g("div", {
11434
+ !k.delivery.location && Oo(d, l, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ g("div", {
11315
11435
  ...X("delivery-detail"),
11316
11436
  style: {
11317
11437
  fontSize: "14px",
11318
11438
  color: $
11319
11439
  },
11320
- children: xo(d, l, k.delivery.min_days, k.delivery.max_days)
11440
+ children: Oo(d, l, k.delivery.min_days, k.delivery.max_days)
11321
11441
  })
11322
11442
  ]
11323
11443
  }),
@@ -11330,14 +11450,14 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11330
11450
  children: [
11331
11451
  d("total"),
11332
11452
  ": ",
11333
- mo(k.total, k.currency, l)
11453
+ xo(k.total, k.currency, l)
11334
11454
  ]
11335
11455
  }),
11336
- !t && /* @__PURE__ */ g(ws, {
11456
+ !t && /* @__PURE__ */ g(js, {
11337
11457
  reference: k.transfer_reference,
11338
11458
  words: d
11339
11459
  }),
11340
- /* @__PURE__ */ g(Ts, {
11460
+ /* @__PURE__ */ g(Ms, {
11341
11461
  downloads: k.downloads,
11342
11462
  apiUrl: s,
11343
11463
  words: d,
@@ -11349,7 +11469,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11349
11469
  onClick: a ? (e) => e.preventDefault() : void 0,
11350
11470
  ...X("continue-button"),
11351
11471
  style: {
11352
- ...Xo,
11472
+ ...rs,
11353
11473
  alignSelf: "flex-start"
11354
11474
  },
11355
11475
  children: d("continue")
@@ -11357,7 +11477,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11357
11477
  ]
11358
11478
  });
11359
11479
  }
11360
- let re = r && i && !h.lines.length ? os.slice(0, 2).map((e) => ({
11480
+ let re = r && i && !h.lines.length ? ps.slice(0, 2).map((e) => ({
11361
11481
  ...e,
11362
11482
  product_id: e.id,
11363
11483
  variant_id: null,
@@ -11403,7 +11523,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11403
11523
  onClick: a ? (e) => e.preventDefault() : void 0,
11404
11524
  ...X("continue-button"),
11405
11525
  style: {
11406
- ...Xo,
11526
+ ...rs,
11407
11527
  alignSelf: "flex-start"
11408
11528
  },
11409
11529
  children: d("continue")
@@ -11441,7 +11561,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11441
11561
  ...X("section"),
11442
11562
  children: [/* @__PURE__ */ g("h3", {
11443
11563
  ...X("heading"),
11444
- style: hs,
11564
+ style: Ss,
11445
11565
  children: d("contact")
11446
11566
  }), /* @__PURE__ */ _("div", {
11447
11567
  ...X("fields"),
@@ -11449,7 +11569,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11449
11569
  display: "grid",
11450
11570
  gap: "12px"
11451
11571
  },
11452
- children: [/* @__PURE__ */ g(gs, {
11572
+ children: [/* @__PURE__ */ g(Cs, {
11453
11573
  label: d("name"),
11454
11574
  required: !0,
11455
11575
  children: /* @__PURE__ */ g("input", {
@@ -11466,7 +11586,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11466
11586
  gridTemplateColumns: "1fr 1fr",
11467
11587
  gap: "12px"
11468
11588
  },
11469
- children: [/* @__PURE__ */ g(gs, {
11589
+ children: [/* @__PURE__ */ g(Cs, {
11470
11590
  label: d("email"),
11471
11591
  required: !0,
11472
11592
  children: /* @__PURE__ */ g("input", {
@@ -11477,7 +11597,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11477
11597
  onChange: L("email"),
11478
11598
  autoComplete: "email"
11479
11599
  })
11480
- }), /* @__PURE__ */ g(gs, {
11600
+ }), /* @__PURE__ */ g(Cs, {
11481
11601
  label: d("phone"),
11482
11602
  children: /* @__PURE__ */ g("input", {
11483
11603
  type: "tel",
@@ -11496,7 +11616,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11496
11616
  children: [
11497
11617
  /* @__PURE__ */ g("h3", {
11498
11618
  ...X("heading"),
11499
- style: hs,
11619
+ style: Ss,
11500
11620
  children: d("delivery")
11501
11621
  }),
11502
11622
  /* @__PURE__ */ g("div", {
@@ -11508,17 +11628,17 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11508
11628
  gridTemplateColumns: "1fr 1fr",
11509
11629
  gap: "12px"
11510
11630
  },
11511
- children: [/* @__PURE__ */ g(gs, {
11631
+ children: [/* @__PURE__ */ g(Cs, {
11512
11632
  label: d("postal"),
11513
11633
  children: /* @__PURE__ */ g("input", {
11514
11634
  ...X("input"),
11515
11635
  style: Z,
11516
11636
  value: x.postal_code,
11517
11637
  onChange: L("postal_code"),
11518
- onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(_o(d, e))),
11638
+ onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(wo(d, e))),
11519
11639
  autoComplete: "postal-code"
11520
11640
  })
11521
- }), /* @__PURE__ */ g(gs, {
11641
+ }), /* @__PURE__ */ g(Cs, {
11522
11642
  label: d("country"),
11523
11643
  required: !te,
11524
11644
  children: /* @__PURE__ */ _("select", {
@@ -11531,7 +11651,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11531
11651
  S((e) => ({
11532
11652
  ...e,
11533
11653
  country: t
11534
- })), r || m.setCountry(t, x.postal_code).catch((e) => O(_o(d, e)));
11654
+ })), r || m.setCountry(t, x.postal_code).catch((e) => O(wo(d, e)));
11535
11655
  },
11536
11656
  children: [/* @__PURE__ */ g("option", {
11537
11657
  value: "",
@@ -11560,7 +11680,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11560
11680
  gap: "8px"
11561
11681
  },
11562
11682
  children: ee.map((e) => {
11563
- let t = xo(d, l, e.min_days, e.max_days);
11683
+ let t = Oo(d, l, e.min_days, e.max_days);
11564
11684
  return /* @__PURE__ */ _("label", {
11565
11685
  ...X("delivery-option", K?.id === e.id && "delivery-option-selected"),
11566
11686
  style: {
@@ -11569,7 +11689,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11569
11689
  gap: "10px",
11570
11690
  padding: "12px",
11571
11691
  borderRadius: "8px",
11572
- border: K?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : qo,
11692
+ border: K?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : es,
11573
11693
  cursor: "pointer"
11574
11694
  },
11575
11695
  children: [
@@ -11632,7 +11752,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11632
11752
  ...X("section"),
11633
11753
  children: [/* @__PURE__ */ g("h3", {
11634
11754
  ...X("heading"),
11635
- style: hs,
11755
+ style: Ss,
11636
11756
  children: d("address")
11637
11757
  }), /* @__PURE__ */ _("div", {
11638
11758
  ...X("fields"),
@@ -11641,7 +11761,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11641
11761
  gap: "12px"
11642
11762
  },
11643
11763
  children: [
11644
- /* @__PURE__ */ g(gs, {
11764
+ /* @__PURE__ */ g(Cs, {
11645
11765
  label: d("line1"),
11646
11766
  required: !0,
11647
11767
  children: /* @__PURE__ */ g("input", {
@@ -11652,7 +11772,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11652
11772
  autoComplete: "address-line1"
11653
11773
  })
11654
11774
  }),
11655
- /* @__PURE__ */ g(gs, {
11775
+ /* @__PURE__ */ g(Cs, {
11656
11776
  label: d("line2"),
11657
11777
  children: /* @__PURE__ */ g("input", {
11658
11778
  ...X("input"),
@@ -11669,7 +11789,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11669
11789
  gridTemplateColumns: "1fr 1fr",
11670
11790
  gap: "12px"
11671
11791
  },
11672
- children: [/* @__PURE__ */ g(gs, {
11792
+ children: [/* @__PURE__ */ g(Cs, {
11673
11793
  label: d("city"),
11674
11794
  required: !0,
11675
11795
  children: /* @__PURE__ */ g("input", {
@@ -11679,7 +11799,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11679
11799
  onChange: L("city"),
11680
11800
  autoComplete: "address-level2"
11681
11801
  })
11682
- }), /* @__PURE__ */ g(gs, {
11802
+ }), /* @__PURE__ */ g(Cs, {
11683
11803
  label: d("region"),
11684
11804
  children: /* @__PURE__ */ g("input", {
11685
11805
  ...X("input"),
@@ -11690,7 +11810,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11690
11810
  })
11691
11811
  })]
11692
11812
  }),
11693
- /* @__PURE__ */ g(gs, {
11813
+ /* @__PURE__ */ g(Cs, {
11694
11814
  label: d("note"),
11695
11815
  children: /* @__PURE__ */ g("textarea", {
11696
11816
  rows: 2,
@@ -11745,7 +11865,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11745
11865
  display: "grid",
11746
11866
  gap: "12px"
11747
11867
  },
11748
- children: [H && !te && /* @__PURE__ */ g(gs, {
11868
+ children: [H && !te && /* @__PURE__ */ g(Cs, {
11749
11869
  label: d("giftRecipient"),
11750
11870
  children: /* @__PURE__ */ g("input", {
11751
11871
  ...X("input"),
@@ -11755,7 +11875,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11755
11875
  maxLength: 200,
11756
11876
  autoComplete: "off"
11757
11877
  })
11758
- }), /* @__PURE__ */ g(gs, {
11878
+ }), /* @__PURE__ */ g(Cs, {
11759
11879
  label: d("giftMessage"),
11760
11880
  children: /* @__PURE__ */ g("textarea", {
11761
11881
  rows: 3,
@@ -11776,7 +11896,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11776
11896
  children: [
11777
11897
  /* @__PURE__ */ g("h3", {
11778
11898
  ...X("heading"),
11779
- style: hs,
11899
+ style: Ss,
11780
11900
  children: d("payment")
11781
11901
  }),
11782
11902
  !ae.length && !r && /* @__PURE__ */ g("p", {
@@ -11801,7 +11921,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11801
11921
  gap: "10px",
11802
11922
  padding: "12px",
11803
11923
  borderRadius: "8px",
11804
- border: qo,
11924
+ border: es,
11805
11925
  cursor: "pointer"
11806
11926
  },
11807
11927
  children: [/* @__PURE__ */ g("input", {
@@ -11828,13 +11948,13 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11828
11948
  gap: "14px",
11829
11949
  padding: "20px",
11830
11950
  borderRadius: "12px",
11831
- background: Jo
11951
+ background: ts
11832
11952
  },
11833
11953
  children: [
11834
11954
  /* @__PURE__ */ g("h3", {
11835
11955
  ...X("summary-title"),
11836
11956
  style: {
11837
- ...hs,
11957
+ ...Ss,
11838
11958
  margin: 0
11839
11959
  },
11840
11960
  children: d("cart")
@@ -11897,13 +12017,13 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11897
12017
  gap: "8px",
11898
12018
  marginTop: "4px"
11899
12019
  },
11900
- children: [/* @__PURE__ */ g(es, {
12020
+ children: [/* @__PURE__ */ g(ss, {
11901
12021
  value: e.quantity,
11902
12022
  label: d("quantity"),
11903
- onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(_o(d, e)))
12023
+ onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(wo(d, e)))
11904
12024
  }), /* @__PURE__ */ g("button", {
11905
12025
  type: "button",
11906
- onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(_o(d, e))),
12026
+ onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(wo(d, e))),
11907
12027
  ...X("remove-button"),
11908
12028
  style: {
11909
12029
  background: "none",
@@ -11953,7 +12073,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11953
12073
  style: {
11954
12074
  padding: "4px 10px",
11955
12075
  borderRadius: "999px",
11956
- border: qo,
12076
+ border: es,
11957
12077
  fontWeight: 600,
11958
12078
  letterSpacing: "0.04em"
11959
12079
  },
@@ -12001,7 +12121,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12001
12121
  onClick: () => z(j.trim()),
12002
12122
  ...X("coupon-button"),
12003
12123
  style: {
12004
- ...Xo,
12124
+ ...rs,
12005
12125
  padding: "8px 14px"
12006
12126
  },
12007
12127
  children: d("apply")
@@ -12018,7 +12138,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12018
12138
  /* @__PURE__ */ _("div", {
12019
12139
  ...X("totals"),
12020
12140
  style: {
12021
- borderTop: qo,
12141
+ borderTop: es,
12022
12142
  paddingTop: "12px",
12023
12143
  display: "grid",
12024
12144
  gap: "6px",
@@ -12133,13 +12253,13 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12133
12253
  ...X("submit-button"),
12134
12254
  disabled: T || !C || h.shipping_available === !1,
12135
12255
  style: {
12136
- ...Yo,
12256
+ ...ns,
12137
12257
  width: "100%",
12138
12258
  padding: "12px"
12139
12259
  },
12140
12260
  children: d(T ? "placing" : "placeOrder")
12141
12261
  }),
12142
- /* @__PURE__ */ g(xs, {
12262
+ /* @__PURE__ */ g(Os, {
12143
12263
  apiUrl: s,
12144
12264
  tenant: o,
12145
12265
  words: d,
@@ -12151,7 +12271,7 @@ function ys({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12151
12271
  })]
12152
12272
  });
12153
12273
  }
12154
- var bs = [
12274
+ var Ds = [
12155
12275
  "refund",
12156
12276
  "privacy",
12157
12277
  "terms",
@@ -12162,12 +12282,12 @@ var bs = [
12162
12282
  fields: {},
12163
12283
  updated_at: null
12164
12284
  }));
12165
- function xs({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
12166
- let [o, s] = f(i ? bs : []), [l, u] = f(null);
12285
+ function Os({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
12286
+ let [o, s] = f(i ? Ds : []), [l, u] = f(null);
12167
12287
  if (c(() => {
12168
12288
  if (i) return;
12169
12289
  let n = !0;
12170
- return yo(e, t).then((e) => n && s(e)), () => {
12290
+ return Eo(e, t).then((e) => n && s(e)), () => {
12171
12291
  n = !1;
12172
12292
  };
12173
12293
  }, [
@@ -12210,12 +12330,12 @@ function xs({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
12210
12330
  display: "flex",
12211
12331
  flexWrap: "wrap",
12212
12332
  gap: "6px 14px",
12213
- borderTop: qo,
12333
+ borderTop: es,
12214
12334
  paddingTop: "10px"
12215
12335
  },
12216
12336
  children: o.map(m)
12217
12337
  }),
12218
- l && /* @__PURE__ */ g(Ss, {
12338
+ l && /* @__PURE__ */ g(ks, {
12219
12339
  policy: l,
12220
12340
  words: n,
12221
12341
  locale: r,
@@ -12224,7 +12344,7 @@ function xs({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
12224
12344
  ]
12225
12345
  });
12226
12346
  }
12227
- function Ss({ policy: e, words: t, locale: n, onClose: r }) {
12347
+ function ks({ policy: e, words: t, locale: n, onClose: r }) {
12228
12348
  c(() => {
12229
12349
  let e = (e) => {
12230
12350
  e.key === "Escape" && r();
@@ -12262,7 +12382,7 @@ function Ss({ policy: e, words: t, locale: n, onClose: r }) {
12262
12382
  style: {
12263
12383
  background: "var(--page-bg, #fff)",
12264
12384
  color: "var(--page-text, #111827)",
12265
- border: qo,
12385
+ border: es,
12266
12386
  borderRadius: "12px",
12267
12387
  width: "min(720px, 100%)",
12268
12388
  maxHeight: "85vh",
@@ -12277,7 +12397,7 @@ function Ss({ policy: e, words: t, locale: n, onClose: r }) {
12277
12397
  alignItems: "center",
12278
12398
  gap: "12px",
12279
12399
  padding: "16px 20px",
12280
- borderBottom: qo
12400
+ borderBottom: es
12281
12401
  },
12282
12402
  children: [/* @__PURE__ */ g("strong", {
12283
12403
  ...X("modal-title"),
@@ -12292,7 +12412,7 @@ function Ss({ policy: e, words: t, locale: n, onClose: r }) {
12292
12412
  "aria-label": t("close"),
12293
12413
  ...X("modal-close"),
12294
12414
  style: {
12295
- ...Xo,
12415
+ ...rs,
12296
12416
  padding: "4px 10px"
12297
12417
  },
12298
12418
  children: "×"
@@ -12346,12 +12466,12 @@ function Ss({ policy: e, words: t, locale: n, onClose: r }) {
12346
12466
  })
12347
12467
  });
12348
12468
  }
12349
- var Cs = {
12469
+ var As = {
12350
12470
  year: "numeric",
12351
12471
  month: "short",
12352
12472
  day: "numeric"
12353
12473
  };
12354
- function ws({ reference: e, words: t }) {
12474
+ function js({ reference: e, words: t }) {
12355
12475
  let [n, r] = f(!1);
12356
12476
  if (!e) return null;
12357
12477
  let i = () => {
@@ -12399,7 +12519,7 @@ function ws({ reference: e, words: t }) {
12399
12519
  onClick: i,
12400
12520
  ...X("copy-button"),
12401
12521
  style: {
12402
- ...Xo,
12522
+ ...rs,
12403
12523
  padding: "6px 12px"
12404
12524
  },
12405
12525
  children: t(n ? "copied" : "copy")
@@ -12416,7 +12536,7 @@ function ws({ reference: e, words: t }) {
12416
12536
  ]
12417
12537
  });
12418
12538
  }
12419
- function Ts({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12539
+ function Ms({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12420
12540
  let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
12421
12541
  if (!a.length) return null;
12422
12542
  let o = (e) => {
@@ -12446,7 +12566,7 @@ function Ts({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12446
12566
  alignItems: "center",
12447
12567
  gap: "12px",
12448
12568
  padding: "10px 12px",
12449
- border: qo,
12569
+ border: es,
12450
12570
  borderRadius: "8px"
12451
12571
  },
12452
12572
  children: [/* @__PURE__ */ _("div", {
@@ -12476,7 +12596,7 @@ function Ts({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12476
12596
  onClick: i ? (e) => e.preventDefault() : void 0,
12477
12597
  ...X("download-button"),
12478
12598
  style: {
12479
- ...Yo,
12599
+ ...ns,
12480
12600
  padding: "6px 14px",
12481
12601
  textDecoration: "none",
12482
12602
  fontSize: "14px"
@@ -12494,7 +12614,7 @@ function Ts({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12494
12614
  })]
12495
12615
  });
12496
12616
  }
12497
- function Es({ tracking: e, words: t, noNavigate: n }) {
12617
+ function Ns({ tracking: e, words: t, noNavigate: n }) {
12498
12618
  let r = typeof e?.carrier == "string" ? e.carrier : "", i = typeof e?.number == "string" ? e.number : "", a = typeof e?.url == "string" && /^https?:\/\//i.test(e.url) ? e.url : "";
12499
12619
  return !r && !i && !a ? null : /* @__PURE__ */ _("div", {
12500
12620
  ...X("tracking"),
@@ -12529,8 +12649,8 @@ function Es({ tracking: e, words: t, noNavigate: n }) {
12529
12649
  ]
12530
12650
  });
12531
12651
  }
12532
- function Ds({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
12533
- let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } = Zo(), [m, h] = f(null), [v, y] = f(!1), [b, x] = f("");
12652
+ function Ps({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
12653
+ let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } = is(), [m, h] = f(null), [v, y] = f(!1), [b, x] = f("");
12534
12654
  c(() => {
12535
12655
  if (i) return;
12536
12656
  let e = !0;
@@ -12565,7 +12685,7 @@ function Ds({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12565
12685
  items: []
12566
12686
  }] : m ?? [], C = (e) => {
12567
12687
  try {
12568
- return new Intl.DateTimeFormat(u || void 0, Cs).format(new Date(e));
12688
+ return new Intl.DateTimeFormat(u || void 0, As).format(new Date(e));
12569
12689
  } catch {
12570
12690
  return String(e).slice(0, 10);
12571
12691
  }
@@ -12608,7 +12728,7 @@ function Ds({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12608
12728
  S.map((e) => /* @__PURE__ */ _("div", {
12609
12729
  ...X("order", b === e.id && "order-open"),
12610
12730
  style: {
12611
- border: qo,
12731
+ border: es,
12612
12732
  borderRadius: "10px",
12613
12733
  overflow: "hidden"
12614
12734
  },
@@ -12649,13 +12769,13 @@ function Ds({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12649
12769
  fontSize: "13px",
12650
12770
  padding: "2px 10px",
12651
12771
  borderRadius: "999px",
12652
- background: Jo
12772
+ background: ts
12653
12773
  },
12654
12774
  children: [d(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${d(`pay_${e.payment_status}`)}`]
12655
12775
  }),
12656
12776
  /* @__PURE__ */ g("strong", {
12657
12777
  ...X("order-total"),
12658
- children: mo(e.total, e.currency, u)
12778
+ children: xo(e.total, e.currency, u)
12659
12779
  })
12660
12780
  ]
12661
12781
  }), b === e.id && e.items?.length > 0 && /* @__PURE__ */ _("div", {
@@ -12685,19 +12805,19 @@ function Ds({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12685
12805
  })
12686
12806
  ] }), /* @__PURE__ */ g("span", {
12687
12807
  ...X("order-item-price"),
12688
- children: mo(t.total, e.currency, u)
12808
+ children: xo(t.total, e.currency, u)
12689
12809
  })]
12690
12810
  }, t.id)),
12691
- e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ g(ws, {
12811
+ e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ g(js, {
12692
12812
  reference: e.transfer_reference,
12693
12813
  words: d
12694
12814
  }),
12695
- /* @__PURE__ */ g(Es, {
12815
+ /* @__PURE__ */ g(Ns, {
12696
12816
  tracking: e.tracking,
12697
12817
  words: d,
12698
12818
  noNavigate: o
12699
12819
  }),
12700
- /* @__PURE__ */ g(Ts, {
12820
+ /* @__PURE__ */ g(Ms, {
12701
12821
  downloads: e.downloads,
12702
12822
  apiUrl: l,
12703
12823
  words: d,
@@ -12712,21 +12832,21 @@ function Ds({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12712
12832
  }
12713
12833
  //#endregion
12714
12834
  //#region ../ui/src/components/builder/apps/language/views.jsx
12715
- function Os(e) {
12835
+ function Fs(e) {
12716
12836
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
12717
12837
  return [...new Set(n.map((e) => e.trim()))];
12718
12838
  }
12719
- var ks = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
12720
- function As(e, t) {
12839
+ var Is = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
12840
+ function Ls(e, t) {
12721
12841
  let n = String(e ?? "").toUpperCase();
12722
12842
  if (t === "code") return n;
12723
12843
  let r = "";
12724
12844
  try {
12725
- r = ks(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
12845
+ r = Is(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
12726
12846
  } catch {}
12727
12847
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
12728
12848
  }
12729
- function js(e, t) {
12849
+ function Rs(e, t) {
12730
12850
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
12731
12851
  if (typeof window > "u") return n || "?";
12732
12852
  try {
@@ -12736,8 +12856,8 @@ function js(e, t) {
12736
12856
  return n || "/";
12737
12857
  }
12738
12858
  }
12739
- function Ms({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
12740
- let l = s(Y), u = Os(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
12859
+ function zs({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
12860
+ let l = s(Y), u = Fs(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
12741
12861
  display: "inline-flex",
12742
12862
  alignItems: "center",
12743
12863
  gap: 8,
@@ -12775,7 +12895,7 @@ function Ms({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
12775
12895
  children: n ?? "·"
12776
12896
  }), /* @__PURE__ */ g("a", {
12777
12897
  ...X("link", e === f && "link-current"),
12778
- href: js(e, e === d),
12898
+ href: Rs(e, e === d),
12779
12899
  hrefLang: e,
12780
12900
  "aria-current": e === f ? "true" : void 0,
12781
12901
  onClick: c ? (e) => e.preventDefault() : void 0,
@@ -12785,7 +12905,7 @@ function Ms({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
12785
12905
  textDecoration: "none",
12786
12906
  cursor: c ? "default" : "pointer"
12787
12907
  },
12788
- children: As(e, t)
12908
+ children: Ls(e, t)
12789
12909
  })]
12790
12910
  }, e))]
12791
12911
  }) : /* @__PURE__ */ _("div", {
@@ -12797,7 +12917,7 @@ function Ms({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
12797
12917
  value: f,
12798
12918
  onChange: c ? void 0 : (e) => {
12799
12919
  let t = e.target.value;
12800
- window.location.assign(js(t, t === d));
12920
+ window.location.assign(Rs(t, t === d));
12801
12921
  },
12802
12922
  onKeyDown: c ? (e) => e.preventDefault() : void 0,
12803
12923
  style: {
@@ -12813,54 +12933,54 @@ function Ms({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
12813
12933
  ...X("option", e === f && "option-current"),
12814
12934
  key: e,
12815
12935
  value: e
12816
- }, As(e, t)))
12936
+ }, Ls(e, t)))
12817
12937
  })]
12818
12938
  });
12819
12939
  }
12820
12940
  //#endregion
12821
12941
  //#region ../ui/src/components/builder/apps/index.js
12822
- var Ns = [
12823
- ka,
12942
+ var Bs = [
12943
+ Ia,
12944
+ to,
12824
12945
  Ja,
12825
- Va,
12826
- Ya,
12827
- to
12828
- ], Ps = {
12829
- SiteLoginForm: za,
12830
- SiteAccountMenu: Ba,
12831
- SiteLanguagePicker: Ms,
12832
- CookieConsent: qa,
12833
- SiteSearch: eo,
12834
- ShopProductGrid: ss,
12835
- ShopProduct: cs,
12836
- ShopCartButton: ds,
12837
- ShopCheckout: ys,
12838
- ShopOrderHistory: Ds,
12839
- ShopCurrencyPicker: ps,
12840
- ShopFavorites: ls
12946
+ no,
12947
+ co
12948
+ ], Vs = {
12949
+ SiteLoginForm: Ka,
12950
+ SiteAccountMenu: qa,
12951
+ SiteLanguagePicker: zs,
12952
+ CookieConsent: eo,
12953
+ SiteSearch: so,
12954
+ ShopProductGrid: ms,
12955
+ ShopProduct: hs,
12956
+ ShopCartButton: vs,
12957
+ ShopCheckout: Es,
12958
+ ShopOrderHistory: Ps,
12959
+ ShopCurrencyPicker: bs,
12960
+ ShopFavorites: gs
12841
12961
  };
12842
- new Set(Ns.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
12962
+ new Set(Bs.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
12843
12963
  //#endregion
12844
12964
  //#region ../ui/src/components/builder/three/runtime.js
12845
- var Fs = "0.185.1", Is = "4.2.0", Ls = "https://cdn.jsdelivr.net/npm", Rs = `${Ls}/three@${Fs}/+esm`, zs = `${Ls}/@google/model-viewer@${Is}/dist/model-viewer.min.js`, Bs = (e) => import(
12965
+ var Hs = "0.185.1", Us = "4.2.0", Ws = "https://cdn.jsdelivr.net/npm", Gs = `${Ws}/three@${Hs}/+esm`, Ks = `${Ws}/@google/model-viewer@${Us}/dist/model-viewer.min.js`, qs = (e) => import(
12846
12966
  /* @vite-ignore */
12847
12967
  /* webpackIgnore: true */
12848
12968
  e
12849
- ), Vs = /* @__PURE__ */ new Map();
12850
- function Hs(e) {
12851
- if (Vs.has(e)) return Vs.get(e);
12969
+ ), Js = /* @__PURE__ */ new Map();
12970
+ function Ys(e) {
12971
+ if (Js.has(e)) return Js.get(e);
12852
12972
  if (typeof window > "u") return new Promise(() => {});
12853
- let t = Bs(e).catch((t) => {
12854
- throw Vs.delete(e), t;
12973
+ let t = qs(e).catch((t) => {
12974
+ throw Js.delete(e), t;
12855
12975
  });
12856
- return Vs.set(e, t), t;
12976
+ return Js.set(e, t), t;
12857
12977
  }
12858
- var Us = () => Hs(Rs), Ws = (e) => Hs(`${Ls}/three@${Fs}/examples/jsm/${e}/+esm`);
12859
- function Gs() {
12860
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Hs(zs);
12978
+ var Xs = () => Ys(Gs), Zs = (e) => Ys(`${Ws}/three@${Hs}/examples/jsm/${e}/+esm`);
12979
+ function Qs() {
12980
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Ys(Ks);
12861
12981
  }
12862
- var Ks = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, qs = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
12863
- function Js(e, t) {
12982
+ var $s = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ec = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
12983
+ function tc(e, t) {
12864
12984
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
12865
12985
  n = requestAnimationFrame(o), i ||= e;
12866
12986
  let a = r ? (e - r) / 1e3 : 0;
@@ -12879,7 +12999,7 @@ function Js(e, t) {
12879
12999
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
12880
13000
  };
12881
13001
  }
12882
- function Ys(e, t, n = {}) {
13002
+ function nc(e, t, n = {}) {
12883
13003
  let r = {
12884
13004
  radius: n.distance ?? 4,
12885
13005
  polar: n.polar ?? Math.PI / 2.4,
@@ -12928,13 +13048,13 @@ function Ys(e, t, n = {}) {
12928
13048
  }
12929
13049
  //#endregion
12930
13050
  //#region ../ui/src/components/builder/three/views.jsx
12931
- var Xs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Zs = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Qs = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, $s = (e) => typeof e == "string" && !!e.trim();
12932
- function ec({ label: e, note: t, height: n, nodeRef: r, style: i }) {
13051
+ var rc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ic = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ac = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, oc = (e) => typeof e == "string" && !!e.trim();
13052
+ function sc({ label: e, note: t, height: n, nodeRef: r, style: i }) {
12933
13053
  return /* @__PURE__ */ _("div", {
12934
13054
  ref: r,
12935
13055
  style: {
12936
13056
  ...q(i),
12937
- minHeight: Xs(n, 320),
13057
+ minHeight: rc(n, 320),
12938
13058
  display: "flex",
12939
13059
  flexDirection: "column",
12940
13060
  alignItems: "center",
@@ -12962,24 +13082,24 @@ function ec({ label: e, note: t, height: n, nodeRef: r, style: i }) {
12962
13082
  }) : null]
12963
13083
  });
12964
13084
  }
12965
- function tc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: h, nodeRef: _, inert: v }) {
13085
+ function cc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: h, nodeRef: _, inert: v }) {
12966
13086
  let [y, b] = f(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = f(!1);
12967
13087
  c(() => {
12968
13088
  if (y || !e) return;
12969
13089
  let t = !0;
12970
- return Gs().then(() => t && b(!0), () => t && S(!0)), () => {
13090
+ return Qs().then(() => t && b(!0), () => t && S(!0)), () => {
12971
13091
  t = !1;
12972
13092
  };
12973
13093
  }, [y, e]);
12974
13094
  let C = {
12975
13095
  display: "block",
12976
13096
  width: "100%",
12977
- minHeight: Xs(r, 360),
12978
- height: Xs(r, 360),
13097
+ minHeight: rc(r, 360),
13098
+ height: rc(r, 360),
12979
13099
  backgroundColor: i || "transparent",
12980
13100
  ...q(h)
12981
13101
  };
12982
- if (!e) return v ? /* @__PURE__ */ g(ec, {
13102
+ if (!e) return v ? /* @__PURE__ */ g(sc, {
12983
13103
  nodeRef: _,
12984
13104
  style: h,
12985
13105
  height: r,
@@ -13014,13 +13134,13 @@ function tc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
13014
13134
  poster: t || void 0,
13015
13135
  style: C,
13016
13136
  "camera-controls": w(!v && s !== !1),
13017
- "auto-rotate": w(T && !Ks()),
13018
- "auto-rotate-delay": T ? String(Xs(o, 0)) : void 0,
13137
+ "auto-rotate": w(T && !$s()),
13138
+ "auto-rotate-delay": T ? String(rc(o, 0)) : void 0,
13019
13139
  "rotation-per-second": "18deg",
13020
13140
  ar: w(!v && l === !0),
13021
13141
  "ar-modes": "webxr scene-viewer quick-look",
13022
- "shadow-intensity": String(Zs(d, 100)),
13023
- exposure: String(Zs(u, 100)),
13142
+ "shadow-intensity": String(ic(d, 100)),
13143
+ exposure: String(ic(u, 100)),
13024
13144
  "field-of-view": p ? `${Number(p)}deg` : void 0,
13025
13145
  "environment-image": m && m !== "neutral" ? m : "neutral",
13026
13146
  "interaction-prompt": v ? "none" : void 0,
@@ -13038,7 +13158,7 @@ function tc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
13038
13158
  }) : null
13039
13159
  });
13040
13160
  }
13041
- var nc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), rc = [
13161
+ var lc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), uc = [
13042
13162
  "precision highp float;",
13043
13163
  "uniform vec2 u_res;",
13044
13164
  "uniform float u_time;",
@@ -13061,7 +13181,7 @@ var nc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
13061
13181
  " return v;",
13062
13182
  "}",
13063
13183
  ""
13064
- ].join("\n"), ic = {
13184
+ ].join("\n"), dc = {
13065
13185
  gradient: [
13066
13186
  "void main(){",
13067
13187
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -13113,7 +13233,7 @@ var nc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
13113
13233
  "}"
13114
13234
  ].join("\n")
13115
13235
  };
13116
- function ac(e, t) {
13236
+ function fc(e, t) {
13117
13237
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
13118
13238
  if (!n) return t;
13119
13239
  let r = parseInt(n[1], 16);
@@ -13123,7 +13243,7 @@ function ac(e, t) {
13123
13243
  (r & 255) / 255
13124
13244
  ];
13125
13245
  }
13126
- function oc(e, t, n) {
13246
+ function pc(e, t, n) {
13127
13247
  let r = e.createShader(t);
13128
13248
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
13129
13249
  let t = e.getShaderInfoLog(r);
@@ -13131,13 +13251,13 @@ function oc(e, t, n) {
13131
13251
  }
13132
13252
  return r;
13133
13253
  }
13134
- function sc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
13254
+ function mc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
13135
13255
  let h = d(null), v = d(null), y = d(null), [b, x] = f("");
13136
13256
  c(() => () => {
13137
13257
  let e = y.current;
13138
13258
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
13139
13259
  }, []);
13140
- let S = typeof t == "string" && t.trim() ? t : ic[e] ?? ic.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Zs(a, 100), D = Math.max(.05, Zs(o, 100));
13260
+ let S = typeof t == "string" && t.trim() ? t : dc[e] ?? dc.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = ic(a, 100), D = Math.max(.05, ic(o, 100));
13141
13261
  return c(() => {
13142
13262
  let e = h.current, t = v.current;
13143
13263
  if (!e || !t) return;
@@ -13152,7 +13272,7 @@ function sc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13152
13272
  }
13153
13273
  let r = null;
13154
13274
  try {
13155
- let e = oc(n, n.VERTEX_SHADER, nc), t = oc(n, n.FRAGMENT_SHADER, rc + S);
13275
+ let e = pc(n, n.VERTEX_SHADER, lc), t = pc(n, n.FRAGMENT_SHADER, uc + S);
13156
13276
  if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
13157
13277
  x("");
13158
13278
  } catch (e) {
@@ -13188,28 +13308,28 @@ function sc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13188
13308
  };
13189
13309
  l !== !1 && t.addEventListener("pointermove", u);
13190
13310
  let d = () => {
13191
- let r = qs(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
13311
+ let r = ec(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
13192
13312
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
13193
13313
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
13194
13314
  f?.observe(t), d();
13195
- let p = Ks(), m = {
13196
- a: ac(C, [
13315
+ let p = $s(), m = {
13316
+ a: fc(C, [
13197
13317
  .35,
13198
13318
  .4,
13199
13319
  .95
13200
13320
  ]),
13201
- b: ac(w, [
13321
+ b: fc(w, [
13202
13322
  .05,
13203
13323
  .06,
13204
13324
  .16
13205
13325
  ]),
13206
- c: ac(T, [
13326
+ c: fc(T, [
13207
13327
  .95,
13208
13328
  .35,
13209
13329
  .6
13210
13330
  ])
13211
13331
  }, g = {};
13212
- return g.stop = Js(t, (t, r) => {
13332
+ return g.stop = tc(t, (t, r) => {
13213
13333
  d(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (p ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), p && g.stop?.();
13214
13334
  }), () => {
13215
13335
  g.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
@@ -13228,7 +13348,7 @@ function sc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13228
13348
  },
13229
13349
  style: {
13230
13350
  position: "relative",
13231
- minHeight: Xs(s, 320),
13351
+ minHeight: rc(s, 320),
13232
13352
  overflow: "hidden",
13233
13353
  ...q(u)
13234
13354
  },
@@ -13260,7 +13380,7 @@ function sc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13260
13380
  }) : null]
13261
13381
  });
13262
13382
  }
13263
- function cc(e, t) {
13383
+ function hc(e, t) {
13264
13384
  let n = new e.Scene(), r = new e.BoxGeometry();
13265
13385
  r.deleteAttribute("uv");
13266
13386
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -13276,23 +13396,23 @@ function cc(e, t) {
13276
13396
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
13277
13397
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
13278
13398
  }
13279
- var lc = /* @__PURE__ */ new Map();
13280
- function uc(e) {
13281
- if (lc.has(e)) return lc.get(e);
13282
- let t = Ws("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
13399
+ var gc = /* @__PURE__ */ new Map();
13400
+ function _c(e) {
13401
+ if (gc.has(e)) return gc.get(e);
13402
+ let t = Zs("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
13283
13403
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
13284
13404
  })).catch((t) => {
13285
- throw lc.delete(e), t;
13405
+ throw gc.delete(e), t;
13286
13406
  });
13287
- return lc.set(e, t), t;
13407
+ return gc.set(e, t), t;
13288
13408
  }
13289
- function dc(e, t) {
13409
+ function vc(e, t) {
13290
13410
  let n = new e.Box3().setFromObject(t);
13291
13411
  if (n.isEmpty()) return t;
13292
13412
  let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
13293
13413
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
13294
13414
  }
13295
- var fc = {
13415
+ var yc = {
13296
13416
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
13297
13417
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
13298
13418
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -13301,50 +13421,50 @@ var fc = {
13301
13421
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
13302
13422
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
13303
13423
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
13304
- }, pc = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
13305
- function mc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
13306
- let h = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ks(), S = o !== !1 && !m;
13424
+ }, bc = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
13425
+ function xc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
13426
+ let h = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !$s(), S = o !== !1 && !m;
13307
13427
  return c(() => {
13308
13428
  let e = h.current;
13309
13429
  if (!e) return;
13310
13430
  let i = !0, o = null;
13311
- return Us().then((c) => {
13431
+ return Xs().then((c) => {
13312
13432
  if (!i || !e) return;
13313
13433
  let l = new c.WebGLRenderer({
13314
13434
  antialias: !0,
13315
13435
  alpha: !t
13316
13436
  });
13317
- l.setPixelRatio(qs()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
13437
+ l.setPixelRatio(ec()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
13318
13438
  let u = new c.Scene();
13319
- t && (u.background = new c.Color(t)), u.environment = cc(c, l);
13320
- let d = new c.PerspectiveCamera(pc(r, 45), 1, .1, 400), f = Ys(d, l.domElement, {
13321
- distance: pc(n, 5),
13439
+ t && (u.background = new c.Color(t)), u.environment = hc(c, l);
13440
+ let d = new c.PerspectiveCamera(bc(r, 45), 1, .1, 400), f = nc(d, l.domElement, {
13441
+ distance: bc(n, 5),
13322
13442
  enableZoom: S
13323
13443
  }), p = new c.DirectionalLight(16777215, 2.2);
13324
13444
  p.position.set(4, 7, 5), p.castShadow = s !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new c.AmbientLight(16777215, .35));
13325
13445
  let m = [], h = new c.Group(), g = (e, t) => {
13326
- let n = pc(t.scale, 1);
13327
- e.position.set(pc(t.x, 0), pc(t.y, 0), pc(t.z, 0)), e.rotation.set(Qs(t.rx), Qs(t.ry), Qs(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Qs(t.spin);
13446
+ let n = bc(t.scale, 1);
13447
+ e.position.set(bc(t.x, 0), bc(t.y, 0), bc(t.z, 0)), e.rotation.set(ac(t.rx), ac(t.ry), ac(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ac(t.spin);
13328
13448
  };
13329
13449
  for (let e of y) {
13330
13450
  if (e.shape === "model") {
13331
- if (!$s(e.src)) continue;
13451
+ if (!oc(e.src)) continue;
13332
13452
  let t = new c.Group();
13333
- g(t, e), h.add(t), uc(e.src).then((e) => {
13453
+ g(t, e), h.add(t), _c(e.src).then((e) => {
13334
13454
  if (!i) return;
13335
- let n = dc(c, e.clone(!0));
13455
+ let n = vc(c, e.clone(!0));
13336
13456
  n.traverse((e) => {
13337
13457
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
13338
13458
  }), t.add(n);
13339
13459
  }, () => {});
13340
13460
  continue;
13341
13461
  }
13342
- let t = (fc[e.shape] ?? fc.box)(c), n = new c.MeshStandardMaterial({
13462
+ let t = (yc[e.shape] ?? yc.box)(c), n = new c.MeshStandardMaterial({
13343
13463
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
13344
- metalness: Math.min(1, Math.max(0, Zs(e.metalness, 10))),
13345
- roughness: Math.min(1, Math.max(0, Zs(e.roughness, 35))),
13346
- transparent: Zs(e.opacity, 100) < 1,
13347
- opacity: Math.min(1, Math.max(0, Zs(e.opacity, 100))),
13464
+ metalness: Math.min(1, Math.max(0, ic(e.metalness, 10))),
13465
+ roughness: Math.min(1, Math.max(0, ic(e.roughness, 35))),
13466
+ transparent: ic(e.opacity, 100) < 1,
13467
+ opacity: Math.min(1, Math.max(0, ic(e.opacity, 100))),
13348
13468
  flatShading: e.flat === !0,
13349
13469
  wireframe: e.wireframe === !0,
13350
13470
  side: e.shape === "plane" ? c.DoubleSide : c.FrontSide
@@ -13355,14 +13475,14 @@ function mc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
13355
13475
  let _ = null;
13356
13476
  if (s !== !1) {
13357
13477
  let e = new c.ShadowMaterial({ opacity: .22 }), t = new c.PlaneGeometry(60, 60);
13358
- _ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = pc(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
13478
+ _ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = bc(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
13359
13479
  }
13360
13480
  let v = () => {
13361
13481
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
13362
13482
  l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
13363
13483
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
13364
13484
  b?.observe(e), v();
13365
- let C = Qs(Number.isFinite(Number(a)) ? a : 20), w = Js(e, (e) => {
13485
+ let C = ac(Number.isFinite(Number(a)) ? a : 20), w = tc(e, (e) => {
13366
13486
  f.autoSpin(x ? C : 0, e), f.update();
13367
13487
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
13368
13488
  l.render(u, d);
@@ -13386,7 +13506,7 @@ function mc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
13386
13506
  a,
13387
13507
  S,
13388
13508
  s
13389
- ]), _ && m ? /* @__PURE__ */ g(ec, {
13509
+ ]), _ && m ? /* @__PURE__ */ g(sc, {
13390
13510
  nodeRef: p,
13391
13511
  style: u,
13392
13512
  height: l,
@@ -13397,27 +13517,27 @@ function mc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
13397
13517
  h.current = e, typeof p == "function" && p(e);
13398
13518
  },
13399
13519
  style: {
13400
- minHeight: Xs(l, 380),
13401
- height: Xs(l, 380),
13520
+ minHeight: rc(l, 380),
13521
+ height: rc(l, 380),
13402
13522
  overflow: "hidden",
13403
13523
  touchAction: S ? "pan-y" : void 0,
13404
13524
  ...q(u)
13405
13525
  }
13406
13526
  });
13407
13527
  }
13408
- function hc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
13528
+ function Sc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
13409
13529
  let o = d(null), [s, l] = f("");
13410
13530
  return c(() => {
13411
13531
  let t = o.current;
13412
13532
  if (a || !t || typeof e != "string" || !e.trim()) return;
13413
13533
  let r = !0, i = null;
13414
- return Us().then((a) => {
13534
+ return Xs().then((a) => {
13415
13535
  if (!r || !t) return;
13416
13536
  let o = new a.WebGLRenderer({
13417
13537
  antialias: !0,
13418
13538
  alpha: !n
13419
13539
  });
13420
- o.setPixelRatio(qs()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
13540
+ o.setPixelRatio(ec()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
13421
13541
  let s = new a.Scene();
13422
13542
  n && (s.background = new a.Color(n));
13423
13543
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -13440,7 +13560,7 @@ function hc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13440
13560
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
13441
13561
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
13442
13562
  f?.observe(t), d();
13443
- let p = !1, m = Js(t, (e, t) => {
13563
+ let p = !1, m = tc(t, (e, t) => {
13444
13564
  if (!p && typeof u?.frame == "function") try {
13445
13565
  u.frame(e, t);
13446
13566
  } catch (e) {
@@ -13462,7 +13582,7 @@ function hc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13462
13582
  e,
13463
13583
  a,
13464
13584
  n
13465
- ]), a ? /* @__PURE__ */ g(ec, {
13585
+ ]), a ? /* @__PURE__ */ g(sc, {
13466
13586
  nodeRef: i,
13467
13587
  style: r,
13468
13588
  height: t,
@@ -13473,8 +13593,8 @@ function hc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13473
13593
  o.current = e, typeof i == "function" && i(e);
13474
13594
  },
13475
13595
  style: {
13476
- minHeight: Xs(t, 380),
13477
- height: Xs(t, 380),
13596
+ minHeight: rc(t, 380),
13597
+ height: rc(t, 380),
13478
13598
  overflow: "hidden",
13479
13599
  position: "relative",
13480
13600
  touchAction: "pan-y",
@@ -13497,30 +13617,30 @@ function hc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13497
13617
  }) : null
13498
13618
  });
13499
13619
  }
13500
- var gc = {
13501
- ModelViewerBlock: tc,
13502
- ShaderBlock: sc,
13503
- SceneBlock: mc,
13504
- ThreeCanvasBlock: hc
13505
- }, _c = "2.44.0", vc = "https://cdn.jsdelivr.net/npm", yc = `${vc}/@rive-app/canvas@${_c}/+esm`, bc = `${vc}/@rive-app/canvas@${_c}/rive.wasm`, xc = (e) => import(
13620
+ var Cc = {
13621
+ ModelViewerBlock: cc,
13622
+ ShaderBlock: mc,
13623
+ SceneBlock: xc,
13624
+ ThreeCanvasBlock: Sc
13625
+ }, wc = "2.44.0", Tc = "https://cdn.jsdelivr.net/npm", Ec = `${Tc}/@rive-app/canvas@${wc}/+esm`, Dc = `${Tc}/@rive-app/canvas@${wc}/rive.wasm`, Oc = (e) => import(
13506
13626
  /* @vite-ignore */
13507
13627
  /* webpackIgnore: true */
13508
13628
  e
13509
- ), Sc = null;
13510
- function Cc() {
13511
- return typeof window > "u" ? new Promise(() => {}) : Sc || (Sc = xc(yc).then((e) => {
13629
+ ), kc = null;
13630
+ function Ac() {
13631
+ return typeof window > "u" ? new Promise(() => {}) : kc || (kc = Oc(Ec).then((e) => {
13512
13632
  let t = e?.default ?? e;
13513
- return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(bc), t;
13633
+ return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(Dc), t;
13514
13634
  }).catch((e) => {
13515
- throw Sc = null, e;
13516
- }), Sc);
13635
+ throw kc = null, e;
13636
+ }), kc);
13517
13637
  }
13518
- var wc = /* @__PURE__ */ new Map(), Tc = {
13638
+ var jc = /* @__PURE__ */ new Map(), Mc = {
13519
13639
  56: "number",
13520
13640
  58: "trigger",
13521
13641
  59: "boolean"
13522
- }, Ec = /* @__PURE__ */ new Set();
13523
- function Dc(e, t) {
13642
+ }, Nc = /* @__PURE__ */ new Set();
13643
+ function Pc(e, t) {
13524
13644
  if (!e || !t) return;
13525
13645
  let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
13526
13646
  name: String(e?.name ?? ""),
@@ -13529,15 +13649,15 @@ function Dc(e, t) {
13529
13649
  name: String(e?.name ?? ""),
13530
13650
  inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
13531
13651
  name: String(e?.name ?? ""),
13532
- type: Tc[e?.type] ?? "unknown"
13652
+ type: Mc[e?.type] ?? "unknown"
13533
13653
  }))
13534
13654
  }))
13535
13655
  }));
13536
- wc.set(e, { artboards: n }), Ec.forEach((t) => t(e));
13656
+ jc.set(e, { artboards: n }), Nc.forEach((t) => t(e));
13537
13657
  }
13538
13658
  //#endregion
13539
13659
  //#region ../ui/src/components/builder/rive/views.jsx
13540
- var Oc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, kc = [
13660
+ var Fc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ic = [
13541
13661
  "contain",
13542
13662
  "cover",
13543
13663
  "fill",
@@ -13546,7 +13666,7 @@ var Oc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
13546
13666
  "scaleDown",
13547
13667
  "none",
13548
13668
  "layout"
13549
- ], Ac = [
13669
+ ], Lc = [
13550
13670
  "center",
13551
13671
  "topLeft",
13552
13672
  "topCenter",
@@ -13556,8 +13676,8 @@ var Oc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
13556
13676
  "bottomLeft",
13557
13677
  "bottomCenter",
13558
13678
  "bottomRight"
13559
- ], jc = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Mc = 131;
13560
- function Nc(e, t, n, r) {
13679
+ ], Rc = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, zc = 131;
13680
+ function Bc(e, t, n, r) {
13561
13681
  if (!e || !t || !n) return;
13562
13682
  let i = [];
13563
13683
  try {
@@ -13568,15 +13688,15 @@ function Nc(e, t, n, r) {
13568
13688
  let a = i.find((e) => e?.name === n);
13569
13689
  a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
13570
13690
  }
13571
- function Pc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: h, clickInput: v, style: y, nodeRef: b, inert: x }) {
13691
+ function Vc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: h, clickInput: v, style: y, nodeRef: b, inert: x }) {
13572
13692
  let S = d(null), C = d(null), w = d(null), T = d(""), [E, D] = f(!1), [O, k] = f(!1);
13573
13693
  c(() => {
13574
13694
  let t = C.current, n = S.current;
13575
13695
  if (D(!1), k(!1), !e || !t) return;
13576
13696
  let r = !0, i = null, c = null, d = null;
13577
- return Cc().then((f) => {
13697
+ return Ac().then((f) => {
13578
13698
  if (!r) return;
13579
- let h = o !== "animation", g = m !== !1 && !jc();
13699
+ let h = o !== "animation", g = m !== !1 && !Rc();
13580
13700
  try {
13581
13701
  i = new f.Rive({
13582
13702
  src: e,
@@ -13586,8 +13706,8 @@ function Pc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13586
13706
  animations: !h && l ? l : void 0,
13587
13707
  autoplay: g,
13588
13708
  layout: new f.Layout({
13589
- fit: kc.includes(u) ? u : "contain",
13590
- alignment: Ac.includes(p) ? p : "center"
13709
+ fit: Ic.includes(u) ? u : "contain",
13710
+ alignment: Lc.includes(p) ? p : "center"
13591
13711
  }),
13592
13712
  shouldDisableRiveListeners: !!x,
13593
13713
  isTouchScrollEnabled: !0,
@@ -13595,7 +13715,7 @@ function Pc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13595
13715
  if (!r) return;
13596
13716
  i.resizeDrawingSurfaceToCanvas();
13597
13717
  let t = i.contents;
13598
- if (Dc(e, t), h) {
13718
+ if (Pc(e, t), h) {
13599
13719
  let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
13600
13720
  if (T.current = s || e, !s && e) try {
13601
13721
  i.play(e), g || i.pause(e);
@@ -13611,7 +13731,7 @@ function Pc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13611
13731
  }
13612
13732
  w.current = i, n && (n.rive = i), i.on(f.EventType.RiveEvent, (e) => {
13613
13733
  let t = e?.data;
13614
- x || t?.type !== Mc || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
13734
+ x || t?.type !== zc || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
13615
13735
  }), n && typeof ResizeObserver < "u" && (c = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), c.observe(n)), n && typeof IntersectionObserver < "u" && (d = new IntersectionObserver(([e]) => {
13616
13736
  i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
13617
13737
  }), d.observe(n));
@@ -13632,11 +13752,11 @@ function Pc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13632
13752
  m,
13633
13753
  x
13634
13754
  ]);
13635
- let A = !x && E, j = (e, t) => A && Nc(w.current, T.current, e, t), M = {
13755
+ let A = !x && E, j = (e, t) => A && Bc(w.current, T.current, e, t), M = {
13636
13756
  position: "relative",
13637
13757
  display: "block",
13638
13758
  width: "100%",
13639
- height: Oc(r, 360),
13759
+ height: Fc(r, 360),
13640
13760
  backgroundColor: i || "transparent",
13641
13761
  overflow: "hidden",
13642
13762
  ...q(y)
@@ -13698,35 +13818,35 @@ function Pc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13698
13818
  }), /* @__PURE__ */ g("span", { children: "Pick a .riv file in the Settings panel." })]
13699
13819
  }) : null;
13700
13820
  }
13701
- var Fc = { RiveBlock: Pc }, Ic = /* @__PURE__ */ new Map();
13702
- function Lc(e) {
13703
- if (Ic.has(e)) return Ic.get(e);
13821
+ var Hc = { RiveBlock: Vc }, Uc = /* @__PURE__ */ new Map();
13822
+ function Wc(e) {
13823
+ if (Uc.has(e)) return Uc.get(e);
13704
13824
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
13705
13825
  /* @vite-ignore */
13706
13826
  /* webpackIgnore: true */
13707
13827
  t
13708
13828
  ).finally(() => URL.revokeObjectURL(t));
13709
- return Ic.set(e, n), n;
13829
+ return Uc.set(e, n), n;
13710
13830
  }
13711
- function Rc(e) {
13831
+ function Gc(e) {
13712
13832
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
13713
13833
  return n && typeof n == "object" ? n : {};
13714
13834
  }
13715
13835
  //#endregion
13716
13836
  //#region ../ui/src/components/builder/plugins/view.jsx
13717
- async function zc(e, t) {
13718
- let n = await Lc(e);
13837
+ async function Kc(e, t) {
13838
+ let n = await Wc(e);
13719
13839
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
13720
13840
  }
13721
- var Bc = {
13841
+ var qc = {
13722
13842
  padding: "10px 12px",
13723
13843
  border: "1px dashed rgba(148, 163, 184, 0.5)",
13724
13844
  borderRadius: 8,
13725
13845
  fontSize: 12,
13726
13846
  opacity: .6
13727
13847
  };
13728
- function Vc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13729
- let a = s(Y), o = Rc(a?.settings)[e], l = d(null), u = d(null), f = {
13848
+ function Jc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13849
+ let a = s(Y), o = Gc(a?.settings)[e], l = d(null), u = d(null), f = {
13730
13850
  tenant: a?.tenant ?? "",
13731
13851
  apiUrl: a?.apiUrl ?? "/api",
13732
13852
  locale: a?.locale ?? "",
@@ -13738,7 +13858,7 @@ function Vc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13738
13858
  let e = l.current;
13739
13859
  if (!o?.code || !e) return;
13740
13860
  let n = !0;
13741
- return zc(o.code, t).then((e) => {
13861
+ return Kc(o.code, t).then((e) => {
13742
13862
  if (!(!n || !e || !l.current)) {
13743
13863
  u.current = e;
13744
13864
  try {
@@ -13768,7 +13888,7 @@ function Vc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13768
13888
  }) : /* @__PURE__ */ _("div", {
13769
13889
  ref: i,
13770
13890
  style: {
13771
- ...Bc,
13891
+ ...qc,
13772
13892
  ...q(r)
13773
13893
  },
13774
13894
  children: [
@@ -13780,7 +13900,7 @@ function Vc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13780
13900
  }
13781
13901
  //#endregion
13782
13902
  //#region ../ui/src/components/builder/render.jsx
13783
- function Hc(e, t, n) {
13903
+ function Yc(e, t, n) {
13784
13904
  let r = { "data-wb": e };
13785
13905
  t.htmlId && (r.id = t.htmlId), n && n.id === e && (r.id = t.htmlId || n.htmlId, r.tabIndex = -1);
13786
13906
  let i = ae(t.classNames);
@@ -13794,7 +13914,7 @@ function Hc(e, t, n) {
13794
13914
  classes: i
13795
13915
  };
13796
13916
  }
13797
- function Uc({ View: e, markup: t, ...r }) {
13917
+ function Xc({ View: e, markup: t, ...r }) {
13798
13918
  let i = e(r);
13799
13919
  if (!a(i) || typeof i.type != "string") return i;
13800
13920
  let o = [i.props.className, ...t.classes].filter(Boolean).join(" ");
@@ -13803,62 +13923,62 @@ function Uc({ View: e, markup: t, ...r }) {
13803
13923
  ...o ? { className: o } : {}
13804
13924
  });
13805
13925
  }
13806
- var Wc = /* @__PURE__ */ new Set([
13926
+ var Zc = /* @__PURE__ */ new Set([
13807
13927
  "FormInput",
13808
13928
  "FormTextarea",
13809
13929
  "FormSelect"
13810
13930
  ]);
13811
- function Gc(e, t, n, r) {
13931
+ function Qc(e, t, n, r) {
13812
13932
  if (t.forNode === "__none") return "";
13813
13933
  let i = t.forNode ? n[t.forNode] : null;
13814
13934
  if (!t.forNode) {
13815
13935
  let t = n[r]?.nodes ?? [];
13816
13936
  i = n[t[t.indexOf(e) + 1]] ?? null;
13817
13937
  }
13818
- return !i || !Wc.has(i.type?.resolvedName) ? "" : i.props?.htmlId || fi(i.props?.name) || "";
13819
- }
13820
- var Kc = "slot-", qc = {
13821
- ...Oa,
13822
- ...Ps,
13823
- ...gc,
13824
- ...Fc,
13825
- PluginBlock: Vc
13938
+ return !i || !Zc.has(i.type?.resolvedName) ? "" : i.props?.htmlId || fi(i.props?.name) || "";
13939
+ }
13940
+ var $c = "slot-", el = {
13941
+ ...Fa,
13942
+ ...Vs,
13943
+ ...Cc,
13944
+ ...Hc,
13945
+ PluginBlock: Jc
13826
13946
  };
13827
- function Jc(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
13947
+ function tl(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
13828
13948
  let o = n[e];
13829
13949
  if (!o || o.hidden) return null;
13830
13950
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
13831
13951
  if (s === "ComponentInstance") {
13832
13952
  let s = o.props?.componentId, l = r?.[s];
13833
13953
  if (!l?.template || i.has(s)) return null;
13834
- let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(Kc)).map(([e, t]) => [e.slice(5), Jc(t, n, r, i, a)]));
13835
- return /* @__PURE__ */ g(t, { children: Jc(l.template.rootId, l.template.nodes, r, u, {
13954
+ let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith($c)).map(([e, t]) => [e.slice(5), tl(t, n, r, i, a)]));
13955
+ return /* @__PURE__ */ g(t, { children: tl(l.template.rootId, l.template.nodes, r, u, {
13836
13956
  ...pt(c.values, a),
13837
13957
  slots: d
13838
13958
  }) }, e);
13839
13959
  }
13840
- let l = qc[s];
13960
+ let l = el[s];
13841
13961
  if (!l) return null;
13842
- let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => Jc(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, Jc(t, n, r, i, a)])) : void 0, h = /* @__PURE__ */ g(typeof l == "function" ? Uc : l, {
13962
+ let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => tl(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, tl(t, n, r, i, a)])) : void 0, h = /* @__PURE__ */ g(typeof l == "function" ? Xc : l, {
13843
13963
  ...typeof l == "function" ? {
13844
13964
  View: l,
13845
- markup: Hc(e, c, a?.skipTarget)
13965
+ markup: Yc(e, c, a?.skipTarget)
13846
13966
  } : null,
13847
13967
  ...c,
13848
13968
  ...s === "CollectionList" ? {
13849
13969
  templateId: o.linkedNodes?.card,
13850
- renderTemplate: o.linkedNodes?.card ? (e) => Jc(o.linkedNodes.card, n, r, i, {
13970
+ renderTemplate: o.linkedNodes?.card ? (e) => tl(o.linkedNodes.card, n, r, i, {
13851
13971
  ...a,
13852
13972
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
13853
13973
  }) : void 0
13854
13974
  } : null,
13855
- ...s === "FormLabel" ? { htmlFor: Gc(e, c, n, o.parent) } : null,
13975
+ ...s === "FormLabel" ? { htmlFor: Qc(e, c, n, o.parent) } : null,
13856
13976
  linked: m,
13857
13977
  nodeRef: (t) => {
13858
13978
  t && (t.setAttribute("data-wb", e), pe(t, c), a?.skipTarget?.id === e && (t.id = c.htmlId || a.skipTarget.htmlId, t.tabIndex = -1), fe(t, a?.events === !1 ? [] : c.events));
13859
13979
  },
13860
13980
  children: f.length ? f : void 0
13861
- }, e), _ = c.when && c.when !== "always" ? /* @__PURE__ */ g(Ra, {
13981
+ }, e), _ = c.when && c.when !== "always" ? /* @__PURE__ */ g(Ga, {
13862
13982
  when: c.when,
13863
13983
  children: h
13864
13984
  }, e) : h;
@@ -13869,9 +13989,9 @@ function Jc(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
13869
13989
  }
13870
13990
  //#endregion
13871
13991
  //#region ../ui/src/components/builder/PageRenderer.jsx
13872
- var Yc = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Xc = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ze(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
13992
+ var nl = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), rl = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ze(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
13873
13993
  .webim-page[data-webim-mode="dark"] { ${Object.entries(ze(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
13874
- function Zc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: d, locale: f, direction: p, settings: m, siteUser: v, param: y }) {
13994
+ function il({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: d, locale: f, direction: p, settings: m, siteUser: v, param: y }) {
13875
13995
  let x = a?.js?.trim(), S = m && m["site.code"] && typeof m["site.code"] == "object" ? m["site.code"] : null, C = typeof S?.js == "string" ? S.js.trim() : "", w = typeof S?.css == "string" ? S.css.trim() : "";
13876
13996
  if (c(() => {
13877
13997
  if (!C) return;
@@ -13889,15 +14009,15 @@ function Zc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13889
14009
  minHeight: "100%",
13890
14010
  display: "flex",
13891
14011
  flexDirection: "column"
13892
- }, A = ct(e, n), j = Jc("ROOT", e, n, void 0, A ? { skipTarget: A } : void 0), M = A ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: nt }), /* @__PURE__ */ g("a", {
14012
+ }, A = ct(e, n), j = tl("ROOT", e, n, void 0, A ? { skipTarget: A } : void 0), M = A ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: nt }), /* @__PURE__ */ g("a", {
13893
14013
  className: "webim-skip",
13894
14014
  href: `#${A.htmlId}`,
13895
14015
  children: $e(f || m?.locales?.default)("skip")
13896
- })] }) : null, N = u(() => ({ render: (t, r) => Jc(t, e, n, void 0, { mapProps: r }) }), [e, n]), P = De(e, n), F = Ee(e, n), I = a?.css?.trim(), L = G(o), R = Re(t), z = [R.font, R.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Fe[e]), B = [.../* @__PURE__ */ new Set([...O(e, n), ...z])].map((e) => /* @__PURE__ */ g("link", {
14016
+ })] }) : null, N = u(() => ({ render: (t, r) => tl(t, e, n, void 0, { mapProps: r }) }), [e, n]), P = De(e, n), F = Ee(e, n), I = a?.css?.trim(), L = G(o), R = Re(t), z = [R.font, R.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Fe[e]), B = [.../* @__PURE__ */ new Set([...O(e, n), ...z])].map((e) => /* @__PURE__ */ g("link", {
13897
14017
  rel: "stylesheet",
13898
14018
  precedence: "default",
13899
14019
  href: T(e)
13900
- }, e)), V = Xc(R), H = We(t);
14020
+ }, e)), V = rl(R), H = We(t);
13901
14021
  return r === "auto" ? /* @__PURE__ */ g(Y.Provider, {
13902
14022
  value: {
13903
14023
  tenant: s || "",
@@ -13906,7 +14026,7 @@ function Zc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13906
14026
  settings: m ?? null,
13907
14027
  param: y || ""
13908
14028
  },
13909
- children: /* @__PURE__ */ g(La, {
14029
+ children: /* @__PURE__ */ g(Wa, {
13910
14030
  initialUser: v,
13911
14031
  children: /* @__PURE__ */ g(Jt.Provider, {
13912
14032
  value: d ?? null,
@@ -13922,8 +14042,8 @@ function Zc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13922
14042
  },
13923
14043
  children: [
13924
14044
  M,
13925
- /* @__PURE__ */ g("style", { children: `.webim-page { ${Yc(ze(R.light))} }
13926
- @media (prefers-color-scheme: dark) { .webim-page { ${Yc(ze(R.dark))} } }` }),
14045
+ /* @__PURE__ */ g("style", { children: `.webim-page { ${nl(ze(R.light))} }
14046
+ @media (prefers-color-scheme: dark) { .webim-page { ${nl(ze(R.dark))} } }` }),
13927
14047
  /* @__PURE__ */ g("style", { children: V }),
13928
14048
  B,
13929
14049
  /* @__PURE__ */ g("style", { children: D }),
@@ -13947,7 +14067,7 @@ function Zc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13947
14067
  settings: m ?? null,
13948
14068
  param: y || ""
13949
14069
  },
13950
- children: /* @__PURE__ */ g(La, {
14070
+ children: /* @__PURE__ */ g(Wa, {
13951
14071
  initialUser: v,
13952
14072
  children: /* @__PURE__ */ g(Jt.Provider, {
13953
14073
  value: d ?? null,
@@ -13982,8 +14102,8 @@ function Zc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13982
14102
  }
13983
14103
  //#endregion
13984
14104
  //#region src/WebimContent.jsx
13985
- function Qc({ bundle: e, mode: t = "auto", style: n }) {
13986
- return e?.blocks?.ROOT ? /* @__PURE__ */ g(Zc, {
14105
+ function al({ bundle: e, mode: t = "auto", style: n }) {
14106
+ return e?.blocks?.ROOT ? /* @__PURE__ */ g(il, {
13987
14107
  blocks: e.blocks,
13988
14108
  theme: e.theme,
13989
14109
  components: e.components,
@@ -14002,24 +14122,24 @@ function Qc({ bundle: e, mode: t = "auto", style: n }) {
14002
14122
  }
14003
14123
  //#endregion
14004
14124
  //#region src/fetchPage.js
14005
- var $c = async (e) => {
14125
+ var ol = async (e) => {
14006
14126
  let t = await e.json().catch(() => null);
14007
14127
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
14008
14128
  return t?.payload ?? t;
14009
14129
  };
14010
- async function el({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
14130
+ async function sl({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
14011
14131
  if (!e) throw Error("fetchPage: apiUrl is required");
14012
14132
  if (!n) throw Error("fetchPage: slug is required");
14013
14133
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
14014
14134
  ...t ? { "x-tenant": t } : {},
14015
14135
  ...a ? { authorization: `Bearer ${a}` } : {}
14016
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then($c), c(`${l}/settings/public`, { headers: u }).then($c)]), p = Xe({
14136
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ol), c(`${l}/settings/public`, { headers: u }).then(ol)]), p = Xe({
14017
14137
  page: d,
14018
14138
  settings: f,
14019
14139
  tenant: t,
14020
14140
  apiUrl: l,
14021
14141
  locale: r
14022
- }), m = [...new Set(tl(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
14142
+ }), m = [...new Set(cl(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
14023
14143
  "TableBlock",
14024
14144
  "OrgChartBlock",
14025
14145
  "NavbarBlock",
@@ -14029,7 +14149,7 @@ async function el({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
14029
14149
  "LogoCarousel"
14030
14150
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
14031
14151
  if (m.length) {
14032
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then($c).then((e) => {
14152
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(ol).then((e) => {
14033
14153
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
14034
14154
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
14035
14155
  }).catch(() => [[t, []]])));
@@ -14041,7 +14161,7 @@ async function el({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
14041
14161
  __page: Math.floor(h)
14042
14162
  }), p;
14043
14163
  }
14044
- function tl(e, t) {
14164
+ function cl(e, t) {
14045
14165
  let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
14046
14166
  Object.values(e ?? {}).forEach((e) => {
14047
14167
  n.push(e);
@@ -14053,41 +14173,41 @@ function tl(e, t) {
14053
14173
  }
14054
14174
  //#endregion
14055
14175
  //#region src/ssr.jsx
14056
- var nl = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
14176
+ var ll = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
14057
14177
  "&": "&amp;",
14058
14178
  "<": "&lt;",
14059
14179
  ">": "&gt;",
14060
14180
  "\"": "&quot;"
14061
14181
  })[e]);
14062
- function rl(t, { mode: n = "auto", style: r } = {}) {
14063
- return e(/* @__PURE__ */ g(Qc, {
14182
+ function ul(t, { mode: n = "auto", style: r } = {}) {
14183
+ return e(/* @__PURE__ */ g(al, {
14064
14184
  bundle: t,
14065
14185
  mode: n,
14066
14186
  style: r
14067
14187
  }));
14068
14188
  }
14069
- function il(e, { mode: t = "auto", lang: n } = {}) {
14189
+ function dl(e, { mode: t = "auto", lang: n } = {}) {
14070
14190
  let r = e.seo ?? {}, i = n || e.locale || "en", a = b(e.direction, i), o = Ze(e) || "Page", s = e.custom?.js?.trim(), c = e.settings?.["site.code"], l = typeof c?.js == "string" ? c.js.trim() : "", u = (e) => `<script>${e.replaceAll("<\/script", "<\\/script")}<\/script>`, d = [
14071
14191
  "<meta charset=\"utf-8\"/>",
14072
14192
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
14073
- `<title>${nl(o)}</title>`,
14074
- r.description && `<meta name="description" content="${nl(r.description)}"/>`,
14075
- `<meta property="og:title" content="${nl(o)}"/>`,
14076
- r.image && `<meta property="og:image" content="${nl(r.image)}"/>`,
14193
+ `<title>${ll(o)}</title>`,
14194
+ r.description && `<meta name="description" content="${ll(r.description)}"/>`,
14195
+ `<meta property="og:title" content="${ll(o)}"/>`,
14196
+ r.image && `<meta property="og:image" content="${ll(r.image)}"/>`,
14077
14197
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
14078
14198
  "<style>html,body{margin:0;height:100%}</style>"
14079
14199
  ].filter(Boolean).join("\n");
14080
14200
  return `<!doctype html>
14081
- <html lang="${nl(i)}"${a ? ` dir="${a}"` : ""}>
14201
+ <html lang="${ll(i)}"${a ? ` dir="${a}"` : ""}>
14082
14202
  <head>
14083
14203
  ${d}
14084
14204
  </head>
14085
14205
  <body>
14086
- ${rl(e, { mode: t })}
14206
+ ${ul(e, { mode: t })}
14087
14207
  ${l ? u(l) : ""}
14088
14208
  ${s ? u(s) : ""}
14089
14209
  </body>
14090
14210
  </html>`;
14091
14211
  }
14092
14212
  //#endregion
14093
- export { Xe as assembleBundle, Ze as documentTitle, el as fetchPage, rl as renderBundleHtml, il as renderPageDocument };
14213
+ export { Xe as assembleBundle, Ze as documentTitle, sl as fetchPage, ul as renderBundleHtml, dl as renderPageDocument };