@rulecms/widget-vue 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,32 +1,32 @@
1
- var kt = Object.defineProperty;
2
- var Tt = (e, t, n) => t in e ? kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Pe = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as A, reactive as It, watch as Be, provide as Pt, renderSlot as pe, computed as g, openBlock as f, createElementBlock as b, normalizeStyle as I, normalizeClass as G, createBlock as C, resolveDynamicComponent as P, withCtx as T, createTextVNode as R, toDisplayString as L, createCommentVNode as k, Fragment as E, normalizeProps as oe, guardReactiveProps as De, mergeProps as Dt, resolveComponent as $t, createVNode as $, renderList as F, createElementVNode as V, ref as Y, onMounted as Lt, onBeforeUnmount as Ke, inject as xt, unref as j } from "vue";
5
- const X = "default";
6
- function ze(e, t) {
7
- return !(e != null && e.length) || e === X ? t : `${e}/${t}`;
8
- }
9
- const Rt = `RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-vue README.`;
10
- function $e(e) {
1
+ var Yt = Object.defineProperty;
2
+ var Xt = (e, t, n) => t in e ? Yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var We = (e, t, n) => Xt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as S, reactive as Jt, watch as st, provide as qt, renderSlot as Ie, computed as y, openBlock as f, createElementBlock as w, normalizeStyle as D, normalizeClass as ie, createBlock as v, resolveDynamicComponent as x, withCtx as P, createTextVNode as j, toDisplayString as M, createCommentVNode as T, Fragment as k, normalizeProps as ge, guardReactiveProps as Ve, mergeProps as Zt, resolveComponent as Qt, createVNode as R, renderList as G, createElementVNode as z, ref as H, onMounted as en, onBeforeUnmount as it, inject as tn, unref as F } from "vue";
5
+ const re = "default";
6
+ function rt(e, t) {
7
+ return !(e != null && e.length) || e === re ? t : `${e}/${t}`;
8
+ }
9
+ const nn = `RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-vue README.`;
10
+ function Fe(e) {
11
11
  if (!e || typeof e != "object")
12
12
  return !1;
13
13
  const t = e;
14
14
  return !!t.manifest && typeof t.manifest == "object" && !!t.components && typeof t.components == "object" && !Array.isArray(t.components);
15
15
  }
16
- function Ot(e) {
17
- if ($e(e))
16
+ function on(e) {
17
+ if (Fe(e))
18
18
  return e;
19
19
  const t = e;
20
- return $e(t == null ? void 0 : t.default) ? t.default : null;
20
+ return Fe(t == null ? void 0 : t.default) ? t.default : null;
21
21
  }
22
- function se(e) {
23
- return e.usesDefaultLibrary ? [X, ...e.libraryIds] : [...e.libraryIds];
22
+ function be(e) {
23
+ return e.usesDefaultLibrary ? [re, ...e.libraryIds] : [...e.libraryIds];
24
24
  }
25
- function Le({ registrations: e, referenced: t }) {
26
- if (t.usesDefaultLibrary && !(e != null && e[X]))
27
- throw new Error(Rt);
25
+ function Be({ registrations: e, referenced: t }) {
26
+ if (t.usesDefaultLibrary && !(e != null && e[re]))
27
+ throw new Error(nn);
28
28
  }
29
- function _t(e) {
29
+ function sn(e) {
30
30
  const t = [], n = /* @__PURE__ */ new Set();
31
31
  for (const o of e.values()) {
32
32
  if (typeof o.stylesheet != "string")
@@ -36,64 +36,64 @@ function _t(e) {
36
36
  }
37
37
  return t.length > 0 ? t : void 0;
38
38
  }
39
- function jt(e) {
39
+ function rn(e) {
40
40
  const t = {};
41
41
  for (const [o, s] of e) {
42
- const i = o === X;
43
- for (const [r, l] of Object.entries(s.components))
44
- t[i ? r : `${o}/${r}`] = l;
42
+ const i = o === re;
43
+ for (const [l, r] of Object.entries(s.components))
44
+ t[i ? l : `${o}/${l}`] = r;
45
45
  }
46
- const n = _t(e);
46
+ const n = sn(e);
47
47
  return n ? { components: t, stylesheets: n } : { components: t };
48
48
  }
49
- function te() {
49
+ function pe() {
50
50
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
51
51
  let s = 0;
52
- function i(c, a) {
52
+ function i(a, c) {
53
53
  var p;
54
- e.get(c) !== a && ((p = a.manifest) != null && p.id && a.manifest.id !== c && console.warn(
55
- `RuleCMS widget: component library registered as "${c}" declares manifest id "${a.manifest.id}". The registered id wins for resolution.`
56
- ), e.set(c, a), s += 1);
54
+ e.get(a) !== c && ((p = c.manifest) != null && p.id && c.manifest.id !== a && console.warn(
55
+ `RuleCMS widget: component library registered as "${a}" declares manifest id "${c.manifest.id}". The registered id wins for resolution.`
56
+ ), e.set(a, c), s += 1);
57
57
  }
58
- function r(c) {
59
- const a = se(c), p = [...a].sort().join("|"), y = o.get(p);
60
- if (y && y.loadedVersion === s)
61
- return y.plugin;
58
+ function l(a) {
59
+ const c = be(a), p = [...c].sort().join("|"), m = o.get(p);
60
+ if (m && m.loadedVersion === s)
61
+ return m.plugin;
62
62
  const d = /* @__PURE__ */ new Map();
63
- for (const m of a) {
64
- const S = e.get(m);
65
- S && d.set(m, S);
63
+ for (const b of c) {
64
+ const C = e.get(b);
65
+ C && d.set(b, C);
66
66
  }
67
- const h = jt(d);
67
+ const h = rn(d);
68
68
  return o.set(p, { loadedVersion: s, plugin: h }), h;
69
69
  }
70
- function l(c) {
71
- Le(c);
72
- const { registrations: a, referenced: p } = c;
73
- for (const y of se(p)) {
74
- if (e.has(y) || n.has(y))
70
+ function r(a) {
71
+ Be(a);
72
+ const { registrations: c, referenced: p } = a;
73
+ for (const m of be(p)) {
74
+ if (e.has(m) || n.has(m))
75
75
  continue;
76
- const d = a == null ? void 0 : a[y];
76
+ const d = c == null ? void 0 : c[m];
77
77
  if (!d) {
78
78
  console.error(
79
- `RuleCMS widget: no component library registered for libraryId "${y}"; its components will not render.`
80
- ), n.set(y, new Error(`No registration for libraryId "${y}"`));
79
+ `RuleCMS widget: no component library registered for libraryId "${m}"; its components will not render.`
80
+ ), n.set(m, new Error(`No registration for libraryId "${m}"`));
81
81
  continue;
82
82
  }
83
83
  if (typeof d == "function")
84
84
  return null;
85
- i(y, d);
85
+ i(m, d);
86
86
  }
87
- return r(p);
87
+ return l(p);
88
88
  }
89
- async function u(c) {
90
- Le(c);
91
- const { registrations: a, referenced: p } = c, y = se(p);
89
+ async function u(a) {
90
+ Be(a);
91
+ const { registrations: c, referenced: p } = a, m = be(p);
92
92
  return await Promise.all(
93
- y.map(async (d) => {
93
+ m.map(async (d) => {
94
94
  if (e.has(d) || n.has(d))
95
95
  return;
96
- const h = a == null ? void 0 : a[d];
96
+ const h = c == null ? void 0 : c[d];
97
97
  if (!h) {
98
98
  console.error(
99
99
  `RuleCMS widget: no component library registered for libraryId "${d}"; its components will not render.`
@@ -104,41 +104,41 @@ function te() {
104
104
  i(d, h);
105
105
  return;
106
106
  }
107
- let m = t.get(d);
108
- m || (m = h().then((S) => {
109
- const w = Ot(S);
110
- if (!w)
107
+ let b = t.get(d);
108
+ b || (b = h().then((C) => {
109
+ const g = on(C);
110
+ if (!g)
111
111
  throw new Error(
112
112
  `Registration for libraryId "${d}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
113
113
  );
114
- i(d, w);
115
- }).catch((S) => {
116
- n.set(d, S), console.error(
114
+ i(d, g);
115
+ }).catch((C) => {
116
+ n.set(d, C), console.error(
117
117
  `RuleCMS widget: failed to load component library "${d}":`,
118
- S
118
+ C
119
119
  );
120
120
  }).finally(() => {
121
121
  t.delete(d);
122
- }), t.set(d, m)), await m;
122
+ }), t.set(d, b)), await b;
123
123
  })
124
- ), r(p);
124
+ ), l(p);
125
125
  }
126
- return { resolveSync: l, resolve: u };
126
+ return { resolveSync: r, resolve: u };
127
127
  }
128
- const nr = {
128
+ const Ke = {
129
129
  Preview: "Preview",
130
130
  Compose: "Compose",
131
131
  RenderedPage: "RenderedPage"
132
- }, fe = {
132
+ }, Pe = {
133
133
  DroppableBox: "droppable-box"
134
- }, xe = {
134
+ }, Ue = {
135
135
  FlexStart: "flex-start",
136
136
  FlexEnd: "flex-end",
137
137
  Center: "center",
138
138
  SpaceBetween: "space-between",
139
139
  SpaceAround: "space-around",
140
140
  SpaceEvenly: "space-evenly"
141
- }, or = {
141
+ }, jr = {
142
142
  FlexStart: "flex-start",
143
143
  FlexEnd: "flex-end",
144
144
  Center: "center",
@@ -146,49 +146,56 @@ const nr = {
146
146
  SpaceAround: "space-around",
147
147
  SpaceEvenly: "space-evenly",
148
148
  Stretch: "stretch"
149
- }, ce = "cssAttrArray", sr = {
149
+ }, Ae = "cssAttrArray", Nr = {
150
150
  Phone: "phone",
151
151
  Tablet: "tablet",
152
152
  Desktop: "desktop"
153
- }, He = {
153
+ }, lt = {
154
154
  ComposerComponent: "ComposerWidget",
155
155
  Collection: "Collection",
156
156
  MoveComponentHandle: "MoveWidgetHandle"
157
- }, Ue = `${He.Collection}_`, Mt = "dev.", Nt = "https://rulecms.com", Wt = "https://widget-cache.rulecms.com", Vt = "/api/v1/c/widget/get", Ft = "/api/v1/c/dev/widget/get";
157
+ }, ct = `${lt.Collection}_`, ln = "dev.", cn = "https://rulecms.com", an = "https://widget-cache.rulecms.com", un = "/api/v1/c/widget/get", dn = "/api/v1/c/dev/widget/get", pn = "/api/v1/c/widget/resolve", fn = "/api/v1/c/dev/widget/resolve";
158
158
  function K(e) {
159
- return typeof e == "string" && e.startsWith(Mt);
159
+ return typeof e == "string" && e.startsWith(ln);
160
160
  }
161
- function Bt(e, t) {
162
- return t ? t.replace(/\/$/, "") : K(e) ? Nt : Wt;
161
+ function at(e, t) {
162
+ return t ? t.replace(/\/$/, "") : K(e) ? cn : an;
163
163
  }
164
- function Ye({
164
+ function ut({
165
165
  publishedKey: e,
166
166
  token: t,
167
167
  endpoint: n
168
168
  }) {
169
- const o = K(t), s = o ? Ft : Vt, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
170
- return `${Bt(t, n)}${s}?${i.toString()}`;
169
+ const o = K(t), s = o ? dn : un, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
170
+ return `${at(t, n)}${s}?${i.toString()}`;
171
+ }
172
+ function dt({
173
+ token: e,
174
+ endpoint: t
175
+ }) {
176
+ const n = K(e) ? fn : pn;
177
+ return `${at(e, t)}${n}`;
171
178
  }
172
- const ir = ({ id: e, prefix: t }) => `${t}_${e}`, Kt = (e) => {
179
+ const Wr = ({ id: e, prefix: t }) => `${t}_${e}`, yn = (e) => {
173
180
  if (!(e != null && e.length) || !e.includes("_")) {
174
181
  console.error(`Invalid drag item id: ${e}. Type does not exist.`);
175
182
  return;
176
183
  }
177
- return zt(e);
178
- }, Ge = (e) => e.includes("_"), zt = (e) => {
184
+ return mn(e);
185
+ }, pt = (e) => e.includes("_"), mn = (e) => {
179
186
  const t = e.indexOf("_"), n = e.substring(0, t), o = e.substring(t + 1);
180
187
  return {
181
188
  prefix: n,
182
189
  id: o
183
190
  };
184
- }, Xe = (e) => {
185
- if (!Ge(e))
191
+ }, ft = (e) => {
192
+ if (!pt(e))
186
193
  return;
187
- const n = Kt(e);
188
- return (n == null ? void 0 : n.prefix) === He.Collection || console.error(
194
+ const n = yn(e);
195
+ return (n == null ? void 0 : n.prefix) === lt.Collection || console.error(
189
196
  "getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."
190
197
  ), n == null ? void 0 : n.id;
191
- }, rr = (e) => {
198
+ }, Vr = (e) => {
192
199
  if (!(e != null && e.length)) {
193
200
  console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");
194
201
  return;
@@ -203,47 +210,47 @@ const ir = ({ id: e, prefix: t }) => `${t}_${e}`, Kt = (e) => {
203
210
  return { name: n, instanceId: t[1] };
204
211
  const s = t[1].split("@");
205
212
  return { name: n, instanceId: s[0], parentId: s[1] };
206
- }, lr = (e) => {
213
+ }, Fr = (e) => {
207
214
  if (!(e != null && e.length))
208
215
  return { errorMessage: "getNameFromWidgetKey: Missing widget key" };
209
216
  const t = e.split("$");
210
217
  return t.length < 2 ? { errorMessage: "getNameFromWidgetKey: Invalid widget key format" } : { name: t[0] };
211
- }, Ht = (e) => {
212
- var s, i, r, l;
218
+ }, hn = (e) => {
219
+ var s, i, l, r;
213
220
  if (!e)
214
221
  return { error: "getWidgetKeyForCollection: Missing collection" };
215
222
  if (!((s = e.name) != null && s.length))
216
223
  return { error: "getWidgetKeyForCollection: Missing collection name" };
217
224
  const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
218
- if (!((r = e.id) != null && r.length))
225
+ if (!((l = e.id) != null && l.length))
219
226
  return { error: "getWidgetKeyForCollection: Missing collection id" };
220
- const o = ((l = e.parentId) == null ? void 0 : l.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
227
+ const o = ((r = e.parentId) == null ? void 0 : r.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
221
228
  return { data: `${t}$${o}` };
222
- }, Ut = (e) => {
223
- var s, i, r, l;
229
+ }, gn = (e) => {
230
+ var s, i, l, r;
224
231
  if (!e)
225
232
  return { error: "getWidgetKeyForPublishedCollection: Missing collection" };
226
233
  if (!((s = e.name) != null && s.length))
227
234
  return { error: "getWidgetKeyForPublishedCollection: Missing collection name" };
228
235
  const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
229
- if (!((r = e.publishedKey) != null && r.length))
236
+ if (!((l = e.publishedKey) != null && l.length))
230
237
  return { error: "getWidgetKeyForPublishedCollection: Missing collection publishedKey" };
231
- const o = ((l = e.parentId) == null ? void 0 : l.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
238
+ const o = ((r = e.parentId) == null ? void 0 : r.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
232
239
  return { data: `${t}$${o}` };
233
- }, cr = (e) => {
234
- const t = Ht(e);
235
- return `${Ue}${t.data}`;
236
- }, ar = (e) => {
237
- const t = Ut(e);
238
- return `${Ue}${t.data}`;
239
- }, Yt = "---", Gt = "___";
240
- function Xt(e, t) {
241
- return `${e}${Yt}${t}`;
242
- }
243
- function ur(e, t, n) {
244
- return `${Xt(e, t)}${Gt}${n}`;
245
- }
246
- function dr(e) {
240
+ }, Br = (e) => {
241
+ const t = hn(e);
242
+ return `${ct}${t.data}`;
243
+ }, Kr = (e) => {
244
+ const t = gn(e);
245
+ return `${ct}${t.data}`;
246
+ }, Ee = "---", bn = "___";
247
+ function Cn(e, t) {
248
+ return `${e}${Ee}${t}`;
249
+ }
250
+ function Ur(e, t, n) {
251
+ return `${Cn(e, t)}${bn}${n}`;
252
+ }
253
+ function zr(e) {
247
254
  const t = e.split(".");
248
255
  if (t.length !== 3)
249
256
  throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);
@@ -252,19 +259,19 @@ function dr(e) {
252
259
  throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);
253
260
  return `${n}.${o}.${s + 1}`;
254
261
  }
255
- function ye({
262
+ function De({
256
263
  displayItemList: e,
257
264
  widgetCollections: t
258
265
  }) {
259
266
  const n = /* @__PURE__ */ new Set();
260
267
  let o = !1;
261
268
  const s = (i) => {
262
- var r, l, u;
263
- if ((r = i == null ? void 0 : i.rows) != null && r.length) {
264
- for (const c of i.rows)
265
- if ((l = c == null ? void 0 : c.columns) != null && l.length)
266
- for (const a of c.columns)
267
- a.collection && s(a.collection.collectionRows), !(!a.type || a.type === fe.DroppableBox) && (Ge(a.type) || (!((u = a.libraryId) != null && u.length) || a.libraryId === X ? o = !0 : n.add(a.libraryId)));
269
+ var l, r, u;
270
+ if ((l = i == null ? void 0 : i.rows) != null && l.length) {
271
+ for (const a of i.rows)
272
+ if ((r = a == null ? void 0 : a.columns) != null && r.length)
273
+ for (const c of a.columns)
274
+ c.collection && s(c.collection.collectionRows), !(!c.type || c.type === Pe.DroppableBox) && (pt(c.type) || (!((u = c.libraryId) != null && u.length) || c.libraryId === re ? o = !0 : n.add(c.libraryId)));
268
275
  }
269
276
  };
270
277
  s(e);
@@ -272,16 +279,16 @@ function ye({
272
279
  s(i == null ? void 0 : i.collectionRows);
273
280
  return { libraryIds: Array.from(n), usesDefaultLibrary: o };
274
281
  }
275
- const Je = Symbol("rulecms-widget-context");
276
- function Jt() {
282
+ const yt = Symbol("rulecms-widget-context");
283
+ function wn() {
277
284
  return {
278
285
  token: "",
279
286
  endpoint: void 0,
280
287
  libraries: void 0,
281
- libraryRegistry: te()
288
+ libraryRegistry: pe()
282
289
  };
283
290
  }
284
- const pr = /* @__PURE__ */ A({
291
+ const Hr = /* @__PURE__ */ S({
285
292
  __name: "RuleCMSWidgetProvider",
286
293
  props: {
287
294
  token: {},
@@ -289,97 +296,97 @@ const pr = /* @__PURE__ */ A({
289
296
  libraries: {}
290
297
  },
291
298
  setup(e) {
292
- const t = e, n = It(Jt());
293
- return Be(
299
+ const t = e, n = Jt(wn());
300
+ return st(
294
301
  () => [t.token, t.endpoint, t.libraries],
295
302
  () => {
296
303
  n.token = t.token, n.endpoint = t.endpoint, n.libraries = t.libraries;
297
304
  },
298
305
  { immediate: !0 }
299
- ), Pt(Je, n), (o, s) => pe(o.$slots, "default");
306
+ ), qt(yt, n), (o, s) => Ie(o.$slots, "default");
300
307
  }
301
- }), Zt = "1200px", Ze = "500px", qe = "820px", fr = Zt, qt = "rulecms", Qt = 1920, en = {
308
+ }), vn = "1200px", mt = "500px", ht = "820px", Gr = vn, An = "rulecms", En = 1920, Sn = {
302
309
  f: "auto",
303
310
  q: "auto",
304
311
  c: "limit"
305
- }, tn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, nn = 300, on = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, sn = 100, rn = /^https:\/\/[^\s"'()\\<>]+$/, ln = 2e3, cn = /^[A-Za-z0-9_,.:\-/]*$/, an = 300, un = (e) => typeof e == "string" && e.length <= nn && tn.test(e), dn = (e) => typeof e == "string" && e.length <= sn && on.test(e), pn = (e) => typeof e == "string" && e.length <= ln && rn.test(e), fn = (e) => typeof e == "string" && e.length <= an && cn.test(e), yn = (e) => Object.entries(e).map(([t, n]) => `${t}_${n}`).join(","), mn = (e) => {
312
+ }, kn = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, Tn = 300, In = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, Pn = 100, Dn = /^https:\/\/[^\s"'()\\<>]+$/, xn = 2e3, $n = /^[A-Za-z0-9_,.:\-/]*$/, Ln = 300, Rn = (e) => typeof e == "string" && e.length <= Tn && kn.test(e), _n = (e) => typeof e == "string" && e.length <= Pn && In.test(e), On = (e) => typeof e == "string" && e.length <= xn && Dn.test(e), Mn = (e) => typeof e == "string" && e.length <= Ln && $n.test(e), jn = (e) => Object.entries(e).map(([t, n]) => `${t}_${n}`).join(","), Nn = (e) => {
306
313
  const t = {};
307
314
  for (const n of e.split(",")) {
308
315
  const o = n.trim(), s = o.indexOf("_");
309
316
  s <= 0 || (t[o.slice(0, s)] = o.slice(s + 1));
310
317
  }
311
318
  return t;
312
- }, hn = ({
319
+ }, Wn = ({
313
320
  publicId: e,
314
- cloudName: t = qt,
321
+ cloudName: t = An,
315
322
  transformations: n,
316
- width: o = Qt
323
+ width: o = En
317
324
  }) => {
318
- const s = typeof n == "string" ? mn(n) : n, i = {
319
- ...en,
325
+ const s = typeof n == "string" ? Nn(n) : n, i = {
326
+ ...Sn,
320
327
  ...s,
321
328
  w: o
322
329
  };
323
330
  return encodeURI(
324
- `https://res.cloudinary.com/${t}/image/upload/${yn(i)}/${e}`
331
+ `https://res.cloudinary.com/${t}/image/upload/${jn(i)}/${e}`
325
332
  );
326
- }, gn = /^--[A-Za-z0-9_-]+$/, bn = 200, U = (e) => {
333
+ }, Vn = /^--[A-Za-z0-9_-]+$/, Fn = 200, Q = (e) => {
327
334
  if (typeof e != "string")
328
335
  return !1;
329
336
  const t = e.trim();
330
- return t.length <= bn && gn.test(t);
331
- }, _ = (e) => `var(${e.trim()})`, v = (e) => {
337
+ return t.length <= Fn && Vn.test(t);
338
+ }, W = (e) => `var(${e.trim()})`, E = (e) => {
332
339
  if (typeof e != "object" || e === null || Array.isArray(e))
333
340
  return;
334
341
  const t = e.cssVariable;
335
342
  if (t != null)
336
- return U(t) ? t.trim() : void 0;
337
- }, M = (e) => {
343
+ return Q(t) ? t.trim() : void 0;
344
+ }, B = (e) => {
338
345
  if (typeof e != "object" || e === null || Array.isArray(e))
339
346
  return !1;
340
347
  const t = e.cssVariable;
341
- return t == null ? !1 : !U(t);
342
- }, yr = (e, t) => {
343
- const n = v(e);
344
- return n ? { [t]: _(n) } : void 0;
345
- }, Cn = (e) => {
346
- if (typeof e != "object" || e === null || Array.isArray(e) || M(e))
348
+ return t == null ? !1 : !Q(t);
349
+ }, Yr = (e, t) => {
350
+ const n = E(e);
351
+ return n ? { [t]: W(n) } : void 0;
352
+ }, Bn = (e) => {
353
+ if (typeof e != "object" || e === null || Array.isArray(e) || B(e))
347
354
  return !1;
348
- if (v(e))
355
+ if (E(e))
349
356
  return !0;
350
357
  const t = e;
351
- return t.source === "none" ? !0 : t.source === "url" ? pn(t.url) : t.source === "cloudinary" ? !un(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !dn(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || fn(t.transformations) : !1;
352
- }, wn = ["px", "%", "em", "rem", "vh", "vw"], me = ["inherit", "unset"], vn = ["allSides", "top", "right", "bottom", "left"], z = (e, t = {}) => {
358
+ return t.source === "none" ? !0 : t.source === "url" ? On(t.url) : t.source === "cloudinary" ? !Rn(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !_n(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || Mn(t.transformations) : !1;
359
+ }, Kn = ["px", "%", "em", "rem", "vh", "vw"], xe = ["inherit", "unset"], Un = ["allSides", "top", "right", "bottom", "left"], q = (e, t = {}) => {
353
360
  if (typeof e != "object" || e === null || Array.isArray(e))
354
361
  return !1;
355
362
  const n = e;
356
- return M(e) ? !1 : v(e) ? !0 : n.unit === "auto" ? t.allowAuto !== !1 : n.unit === "keyword" ? t.allowKeywords !== !1 && me.includes(n.keyword) : wn.includes(n.unit) ? typeof n.value != "number" || !Number.isFinite(n.value) ? !1 : t.allowNegative !== !1 || n.value >= 0 : !1;
357
- }, An = (e, t = {}) => {
363
+ return B(e) ? !1 : E(e) ? !0 : n.unit === "auto" ? t.allowAuto !== !1 : n.unit === "keyword" ? t.allowKeywords !== !1 && xe.includes(n.keyword) : Kn.includes(n.unit) ? typeof n.value != "number" || !Number.isFinite(n.value) ? !1 : t.allowNegative !== !1 || n.value >= 0 : !1;
364
+ }, zn = (e, t = {}) => {
358
365
  if (typeof e != "object" || e === null || Array.isArray(e))
359
366
  return !1;
360
367
  const n = e;
361
- for (const o of vn) {
368
+ for (const o of Un) {
362
369
  const s = n[o];
363
- if (s != null && !z(s, t))
370
+ if (s != null && !q(s, t))
364
371
  return !1;
365
372
  }
366
373
  return !0;
367
- }, Sn = [...me, "transparent", "currentColor"], En = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, he = (e) => {
374
+ }, Hn = [...xe, "transparent", "currentColor"], Gn = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, $e = (e) => {
368
375
  if (typeof e != "object" || e === null || Array.isArray(e))
369
376
  return !1;
370
377
  const t = e;
371
- return M(e) ? !1 : v(e) ? !0 : t.unit === "keyword" ? Sn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && En.test(t.value.trim()) : !1;
372
- }, ge = (e) => {
373
- const t = v(e);
374
- return t ? _(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
375
- }, kn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !M(e) && !!v(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : me.includes(e), Tn = [
378
+ return B(e) ? !1 : E(e) ? !0 : t.unit === "keyword" ? Hn.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && Gn.test(t.value.trim()) : !1;
379
+ }, Le = (e) => {
380
+ const t = E(e);
381
+ return t ? W(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
382
+ }, Yn = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !B(e) && !!E(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : xe.includes(e), Xn = [
376
383
  'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
377
384
  'Georgia, "Times New Roman", Times, serif',
378
385
  "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
379
386
  "Arial, Helvetica, sans-serif",
380
387
  '"Helvetica Neue", Helvetica, Arial, sans-serif',
381
388
  "Verdana, Geneva, sans-serif"
382
- ], In = [
389
+ ], Jn = [
383
390
  "normal",
384
391
  "bold",
385
392
  "100",
@@ -391,43 +398,43 @@ const pr = /* @__PURE__ */ A({
391
398
  "700",
392
399
  "800",
393
400
  "900"
394
- ], Pn = ["normal", "italic", "oblique"], Dn = [
401
+ ], qn = ["normal", "italic", "oblique"], Zn = [
395
402
  "left",
396
403
  "center",
397
404
  "right",
398
405
  "justify",
399
406
  "start",
400
407
  "end"
401
- ], $n = [
408
+ ], Qn = [
402
409
  "none",
403
410
  "underline",
404
411
  "line-through",
405
412
  "overline"
406
- ], Ln = [
413
+ ], eo = [
407
414
  "none",
408
415
  "uppercase",
409
416
  "lowercase",
410
417
  "capitalize"
411
- ], ie = [
418
+ ], Ce = [
412
419
  "visible",
413
420
  "hidden",
414
421
  "scroll",
415
422
  "auto",
416
423
  "clip"
417
- ], xn = ["auto", "none"], Rn = [
424
+ ], to = ["auto", "none"], no = [
418
425
  "flex-start",
419
426
  "flex-end",
420
427
  "center",
421
428
  "space-between",
422
429
  "space-around",
423
430
  "space-evenly"
424
- ], On = [
431
+ ], oo = [
425
432
  "flex-start",
426
433
  "flex-end",
427
434
  "center",
428
435
  "baseline",
429
436
  "stretch"
430
- ], _n = ["wrap", "nowrap"], jn = [
437
+ ], so = ["wrap", "nowrap"], io = [
431
438
  "flex-start",
432
439
  "flex-end",
433
440
  "center",
@@ -435,12 +442,12 @@ const pr = /* @__PURE__ */ A({
435
442
  "space-around",
436
443
  "space-evenly",
437
444
  "stretch"
438
- ], Mn = [
445
+ ], ro = [
439
446
  "row",
440
447
  "row-reverse",
441
448
  "column",
442
449
  "column-reverse"
443
- ], Nn = ["cover", "contain", "auto"], Wn = [
450
+ ], lo = ["cover", "contain", "auto"], co = [
444
451
  "center center",
445
452
  "center top",
446
453
  "center bottom",
@@ -450,20 +457,20 @@ const pr = /* @__PURE__ */ A({
450
457
  "right center",
451
458
  "right top",
452
459
  "right bottom"
453
- ], Vn = [
460
+ ], ao = [
454
461
  "no-repeat",
455
462
  "repeat",
456
463
  "repeat-x",
457
464
  "repeat-y",
458
465
  "space",
459
466
  "round"
460
- ], Fn = [
467
+ ], uo = [
461
468
  "justifyContent",
462
469
  "alignItems",
463
470
  "flexWrap",
464
471
  "alignContent",
465
472
  "flexDirection"
466
- ], Bn = [
473
+ ], po = [
467
474
  "none",
468
475
  "solid",
469
476
  "dashed",
@@ -473,107 +480,107 @@ const pr = /* @__PURE__ */ A({
473
480
  "ridge",
474
481
  "inset",
475
482
  "outset"
476
- ], Kn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !M(e) && !!v(e) : Bn.includes(e), zn = (e) => {
483
+ ], fo = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !B(e) && !!E(e) : po.includes(e), yo = (e) => {
477
484
  if (typeof e != "object" || e === null || Array.isArray(e))
478
485
  return !1;
479
486
  const t = e;
480
- return M(e) ? !1 : v(e) ? !0 : !(t.width !== void 0 && t.width !== null && !z(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !Kn(t.style) || t.color !== void 0 && t.color !== null && !he(t.color));
481
- }, Hn = {
487
+ return B(e) ? !1 : E(e) ? !0 : !(t.width !== void 0 && t.width !== null && !q(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !fo(t.style) || t.color !== void 0 && t.color !== null && !$e(t.color));
488
+ }, mo = {
482
489
  allowAuto: !1,
483
490
  allowKeywords: !1,
484
491
  allowNegative: !0
485
- }, Un = {
492
+ }, ho = {
486
493
  allowAuto: !1,
487
494
  allowKeywords: !1,
488
495
  allowNegative: !1
489
- }, Yn = (e) => {
496
+ }, go = (e) => {
490
497
  if (typeof e != "object" || e === null || Array.isArray(e))
491
498
  return !1;
492
499
  const t = e;
493
- if (M(e))
500
+ if (B(e))
494
501
  return !1;
495
- if (v(e))
502
+ if (E(e))
496
503
  return !0;
497
504
  for (const n of ["offsetX", "offsetY", "spread"]) {
498
505
  const o = t[n];
499
- if (o != null && !z(o, Hn))
506
+ if (o != null && !q(o, mo))
500
507
  return !1;
501
508
  }
502
- return !(t.blur !== void 0 && t.blur !== null && !z(t.blur, Un) || t.color !== void 0 && t.color !== null && !he(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
503
- }, Gn = (e) => e ? e.cssVariable !== void 0 && e.cssVariable !== null || e.offsetX !== void 0 || e.offsetY !== void 0 || e.blur !== void 0 || e.spread !== void 0 || e.color !== void 0 : !1, Xn = (e) => {
509
+ return !(t.blur !== void 0 && t.blur !== null && !q(t.blur, ho) || t.color !== void 0 && t.color !== null && !$e(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
510
+ }, bo = (e) => e ? e.cssVariable !== void 0 && e.cssVariable !== null || e.offsetX !== void 0 || e.offsetY !== void 0 || e.blur !== void 0 || e.spread !== void 0 || e.color !== void 0 : !1, Co = (e) => {
504
511
  if (typeof e != "object" || e === null || Array.isArray(e))
505
512
  return !1;
506
513
  const t = e;
507
- return M(e) ? !1 : v(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : z(e, { allowAuto: !1, allowNegative: !1 });
508
- }, Jn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !M(e) && !!v(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, Zn = (e) => {
509
- if (!Cn(e))
514
+ return B(e) ? !1 : E(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : q(e, { allowAuto: !1, allowNegative: !1 });
515
+ }, wo = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !B(e) && !!E(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, vo = (e) => {
516
+ if (!Bn(e))
510
517
  return {};
511
- const t = v(e);
518
+ const t = E(e);
512
519
  if (t)
513
- return { backgroundImage: _(t) };
520
+ return { backgroundImage: W(t) };
514
521
  const n = e;
515
522
  return n.source === "none" ? { backgroundImage: "none" } : n.source === "url" ? { backgroundImage: `url("${n.url}")` } : {
516
- backgroundImage: `url("${hn({
523
+ backgroundImage: `url("${Wn({
517
524
  publicId: n.publicId,
518
525
  cloudName: n.cloudName,
519
526
  transformations: n.transformations
520
527
  })}")`
521
528
  };
522
- }, H = (e) => {
523
- const t = v(e);
524
- return t ? _(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
525
- }, qn = (e) => {
526
- if (!zn(e))
529
+ }, Z = (e) => {
530
+ const t = E(e);
531
+ return t ? W(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
532
+ }, Ao = (e) => {
533
+ if (!yo(e))
527
534
  return {};
528
- const t = v(e);
535
+ const t = E(e);
529
536
  if (t)
530
- return { border: _(t) };
537
+ return { border: W(t) };
531
538
  const n = {};
532
- if (e.width && (n.borderWidth = H(e.width)), e.style) {
533
- const o = v(e.style);
534
- n.borderStyle = o ? _(o) : e.style;
539
+ if (e.width && (n.borderWidth = Z(e.width)), e.style) {
540
+ const o = E(e.style);
541
+ n.borderStyle = o ? W(o) : e.style;
535
542
  }
536
- return e.color && (n.borderColor = ge(e.color)), n;
537
- }, Z = (e) => e ? H(e) : "0px", Qn = (e) => {
538
- if (!Yn(e) || !Gn(e))
543
+ return e.color && (n.borderColor = Le(e.color)), n;
544
+ }, ce = (e) => e ? Z(e) : "0px", Eo = (e) => {
545
+ if (!go(e) || !bo(e))
539
546
  return {};
540
- const t = v(e);
547
+ const t = E(e);
541
548
  if (t)
542
- return { boxShadow: _(t) };
549
+ return { boxShadow: W(t) };
543
550
  const n = [
544
- Z(e.offsetX),
545
- Z(e.offsetY),
546
- Z(e.blur),
547
- Z(e.spread)
551
+ ce(e.offsetX),
552
+ ce(e.offsetY),
553
+ ce(e.blur),
554
+ ce(e.spread)
548
555
  ];
549
- return e.color && n.push(ge(e.color)), e.inset && n.unshift("inset"), { boxShadow: n.join(" ") };
550
- }, eo = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, to = (e, t) => {
551
- if (!An(e))
556
+ return e.color && n.push(Le(e.color)), e.inset && n.unshift("inset"), { boxShadow: n.join(" ") };
557
+ }, So = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, ko = (e, t) => {
558
+ if (!zn(e))
552
559
  return {};
553
560
  if (e.allSides)
554
- return { [t]: H(e.allSides) };
561
+ return { [t]: Z(e.allSides) };
555
562
  const n = {};
556
563
  for (const o of ["top", "right", "bottom", "left"]) {
557
564
  const s = e[o];
558
- s && (n[`${t}${eo(o)}`] = H(s));
565
+ s && (n[`${t}${So(o)}`] = Z(s));
559
566
  }
560
567
  return n;
561
- }, no = (e, t) => he(e) ? { [t]: ge(e) } : {}, oo = (e, t, n) => {
562
- if (!kn(e, n))
568
+ }, To = (e, t) => $e(e) ? { [t]: Le(e) } : {}, Io = (e, t, n) => {
569
+ if (!Yn(e, n))
563
570
  return {};
564
- const o = v(e);
565
- return o ? { [t]: _(o) } : { [t]: e };
566
- }, so = (e, t, n = {}) => z(e, n) ? { [t]: H(e) } : {}, io = (e) => {
567
- if (!Xn(e))
571
+ const o = E(e);
572
+ return o ? { [t]: W(o) } : { [t]: e };
573
+ }, Po = (e, t, n = {}) => q(e, n) ? { [t]: Z(e) } : {}, Do = (e) => {
574
+ if (!Co(e))
568
575
  return {};
569
- const t = v(e);
570
- return t ? { lineHeight: _(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: H(e) };
571
- }, ro = (e) => {
572
- if (!Jn(e))
576
+ const t = E(e);
577
+ return t ? { lineHeight: W(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: Z(e) };
578
+ }, xo = (e) => {
579
+ if (!wo(e))
573
580
  return {};
574
- const t = v(e);
575
- return t ? { opacity: _(t) } : { opacity: e };
576
- }, be = {
581
+ const t = E(e);
582
+ return t ? { opacity: W(t) } : { opacity: e };
583
+ }, Re = {
577
584
  // Box spacing (4-sided)
578
585
  "margin-3-resolutions": { kind: "boxSpacing", cssProperty: "margin" },
579
586
  "padding-3-resolutions": { kind: "boxSpacing", cssProperty: "padding" },
@@ -627,44 +634,44 @@ const pr = /* @__PURE__ */ A({
627
634
  "justify-content-3-resolutions": {
628
635
  kind: "enum",
629
636
  cssProperty: "justifyContent",
630
- allowedValues: Rn
637
+ allowedValues: no
631
638
  },
632
639
  "align-items-3-resolutions": {
633
640
  kind: "enum",
634
641
  cssProperty: "alignItems",
635
- allowedValues: On
642
+ allowedValues: oo
636
643
  },
637
644
  "flex-wrap-3-resolutions": {
638
645
  kind: "enum",
639
646
  cssProperty: "flexWrap",
640
- allowedValues: _n
647
+ allowedValues: so
641
648
  },
642
649
  "align-content-3-resolutions": {
643
650
  kind: "enum",
644
651
  cssProperty: "alignContent",
645
- allowedValues: jn
652
+ allowedValues: io
646
653
  },
647
654
  "flex-direction-3-resolutions": {
648
655
  kind: "enum",
649
656
  cssProperty: "flexDirection",
650
- allowedValues: Mn
657
+ allowedValues: ro
651
658
  },
652
659
  // Overflow — shorthand and longhands are independent attributes; when
653
660
  // both are set, the browser's cascade decides the effective overflow.
654
661
  "overflow-3-resolutions": {
655
662
  kind: "enum",
656
663
  cssProperty: "overflow",
657
- allowedValues: ie
664
+ allowedValues: Ce
658
665
  },
659
666
  "overflow-x-3-resolutions": {
660
667
  kind: "enum",
661
668
  cssProperty: "overflowX",
662
- allowedValues: ie
669
+ allowedValues: Ce
663
670
  },
664
671
  "overflow-y-3-resolutions": {
665
672
  kind: "enum",
666
673
  cssProperty: "overflowY",
667
- allowedValues: ie
674
+ allowedValues: Ce
668
675
  },
669
676
  // Color
670
677
  // Pointer input. On an overlay layer this is lifted onto the absolutely
@@ -672,7 +679,7 @@ const pr = /* @__PURE__ */ A({
672
679
  "pointer-events-3-resolutions": {
673
680
  kind: "enum",
674
681
  cssProperty: "pointerEvents",
675
- allowedValues: xn
682
+ allowedValues: to
676
683
  },
677
684
  "background-color-3-resolutions": { kind: "color", cssProperty: "backgroundColor" },
678
685
  "color-3-resolutions": { kind: "color", cssProperty: "color" },
@@ -683,17 +690,17 @@ const pr = /* @__PURE__ */ A({
683
690
  "background-size-3-resolutions": {
684
691
  kind: "enum",
685
692
  cssProperty: "backgroundSize",
686
- allowedValues: Nn
693
+ allowedValues: lo
687
694
  },
688
695
  "background-position-3-resolutions": {
689
696
  kind: "enum",
690
697
  cssProperty: "backgroundPosition",
691
- allowedValues: Wn
698
+ allowedValues: co
692
699
  },
693
700
  "background-repeat-3-resolutions": {
694
701
  kind: "enum",
695
702
  cssProperty: "backgroundRepeat",
696
- allowedValues: Vn
703
+ allowedValues: ao
697
704
  },
698
705
  // Opacity (0–1 number)
699
706
  "opacity-3-resolutions": { kind: "opacity" },
@@ -701,7 +708,7 @@ const pr = /* @__PURE__ */ A({
701
708
  "font-family-3-resolutions": {
702
709
  kind: "enum",
703
710
  cssProperty: "fontFamily",
704
- allowedValues: Tn
711
+ allowedValues: Xn
705
712
  },
706
713
  "font-size-3-resolutions": {
707
714
  kind: "length",
@@ -711,12 +718,12 @@ const pr = /* @__PURE__ */ A({
711
718
  "font-weight-3-resolutions": {
712
719
  kind: "enum",
713
720
  cssProperty: "fontWeight",
714
- allowedValues: In
721
+ allowedValues: Jn
715
722
  },
716
723
  "font-style-3-resolutions": {
717
724
  kind: "enum",
718
725
  cssProperty: "fontStyle",
719
- allowedValues: Pn
726
+ allowedValues: qn
720
727
  },
721
728
  "line-height-3-resolutions": { kind: "lineHeight" },
722
729
  "letter-spacing-3-resolutions": {
@@ -727,68 +734,68 @@ const pr = /* @__PURE__ */ A({
727
734
  "text-align-3-resolutions": {
728
735
  kind: "enum",
729
736
  cssProperty: "textAlign",
730
- allowedValues: Dn
737
+ allowedValues: Zn
731
738
  },
732
739
  "text-decoration-3-resolutions": {
733
740
  kind: "enum",
734
741
  cssProperty: "textDecoration",
735
- allowedValues: $n
742
+ allowedValues: Qn
736
743
  },
737
744
  "text-transform-3-resolutions": {
738
745
  kind: "enum",
739
746
  cssProperty: "textTransform",
740
- allowedValues: Ln
747
+ allowedValues: eo
741
748
  }
742
- }, lo = (e, t) => {
743
- const n = be[e];
749
+ }, $o = (e, t) => {
750
+ const n = Re[e];
744
751
  if (!n)
745
752
  return {};
746
753
  switch (n.kind) {
747
754
  case "boxSpacing":
748
- return to(t, n.cssProperty);
755
+ return ko(t, n.cssProperty);
749
756
  case "length":
750
- return so(t, n.cssProperty, n.capabilities);
757
+ return Po(t, n.cssProperty, n.capabilities);
751
758
  case "border":
752
- return qn(t);
759
+ return Ao(t);
753
760
  case "boxShadow":
754
- return Qn(t);
761
+ return Eo(t);
755
762
  case "color":
756
- return no(t, n.cssProperty);
763
+ return To(t, n.cssProperty);
757
764
  case "opacity":
758
- return ro(t);
765
+ return xo(t);
759
766
  case "enum":
760
- return oo(t, n.cssProperty, n.allowedValues);
767
+ return Io(t, n.cssProperty, n.allowedValues);
761
768
  case "lineHeight":
762
- return io(t);
769
+ return Do(t);
763
770
  case "backgroundImage":
764
- return Zn(t);
771
+ return vo(t);
765
772
  default:
766
773
  return {};
767
774
  }
768
- }, mr = Object.fromEntries(
769
- Object.entries(be).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
775
+ }, Xr = Object.fromEntries(
776
+ Object.entries(Re).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
770
777
  e,
771
778
  t.cssProperty
772
779
  ])
773
- ), co = (e) => e != null && e !== "", ao = (e) => e ? !Fn.some(
774
- (n) => co(e[n])
775
- ) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, uo = ({
780
+ ), Lo = (e) => e != null && e !== "", Ro = (e) => e ? !uo.some(
781
+ (n) => Lo(e[n])
782
+ ) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, _o = ({
776
783
  dbEntryType: e,
777
784
  libraryId: t,
778
785
  sourceComponentsPlugin: n
779
786
  }) => {
780
787
  if (!(e != null && e.length))
781
788
  return;
782
- const o = n.components[ze(t, e)];
789
+ const o = n.components[rt(t, e)];
783
790
  if (!o || !("defaultAttributeValues" in o))
784
791
  return;
785
792
  const i = o.defaultAttributeValues;
786
793
  if (i != null && i.length)
787
- return i.reduce((r, l) => ({
788
- ...r,
789
- [l.name]: l.defaultValues
794
+ return i.reduce((l, r) => ({
795
+ ...l,
796
+ [r.name]: r.defaultValues
790
797
  }), {});
791
- }, N = ({
798
+ }, U = ({
792
799
  deviceDisplayType: e,
793
800
  componentAttributes: t
794
801
  }) => {
@@ -800,8 +807,8 @@ const pr = /* @__PURE__ */ A({
800
807
  )) {
801
808
  if (!s.includes("3-resolutions") || !i)
802
809
  continue;
803
- const r = i.all, l = r ?? i[e.toLowerCase()];
804
- o[s] = l, be[s] && Object.assign(n, lo(s, l));
810
+ const l = i.all, r = l ?? i[e.toLowerCase()];
811
+ o[s] = r, Re[s] && Object.assign(n, $o(s, r));
805
812
  }
806
813
  return Object.keys(n).length || Object.keys(o).length ? {
807
814
  styles: Object.keys(n).length ? n : void 0,
@@ -809,53 +816,53 @@ const pr = /* @__PURE__ */ A({
809
816
  o
810
817
  ).length ? o : void 0
811
818
  } : void 0;
812
- }, po = ({
819
+ }, Oo = ({
813
820
  defaultAttributes: e,
814
821
  userModifiedAttributes: t
815
822
  }) => e ? t ? { ...e, ...t } : e : t;
816
- function ee(e) {
823
+ function ue(e) {
817
824
  return e.componentAttributes ?? e.widgetAttributes;
818
825
  }
819
- function Re({
826
+ function ze({
820
827
  col: e,
821
828
  deviceDisplayType: t,
822
829
  isComposeMode: n,
823
830
  sourceComponentsPlugin: o
824
831
  }) {
825
- const s = ee(e), i = uo({
832
+ const s = ue(e), i = _o({
826
833
  dbEntryType: e.type,
827
834
  libraryId: e.libraryId,
828
835
  sourceComponentsPlugin: o
829
- }) || [], r = po({
836
+ }) || [], l = Oo({
830
837
  defaultAttributes: i,
831
838
  userModifiedAttributes: s
832
- }), { styles: l, componentAttributesSpecificToDeviceType: u } = N({
839
+ }), { styles: r, componentAttributesSpecificToDeviceType: u } = U({
833
840
  deviceDisplayType: t,
834
- componentAttributes: r
841
+ componentAttributes: l
835
842
  }) || {
836
843
  styles: void 0,
837
844
  componentAttributesSpecificToDeviceType: void 0
838
845
  };
839
- let c = {};
840
- const a = {};
841
- if (l)
842
- for (const [d, h] of Object.entries(l))
843
- n && a[d] || (c = {
844
- ...c,
846
+ let a = {};
847
+ const c = {};
848
+ if (r)
849
+ for (const [d, h] of Object.entries(r))
850
+ n && c[d] || (a = {
851
+ ...a,
845
852
  [d]: h
846
853
  });
847
- let p = ee(e);
854
+ let p = ue(e);
848
855
  for (const d in u)
849
856
  if (d.includes("3-resolutions")) {
850
857
  p = {
851
- ...ee(e) || {},
858
+ ...ue(e) || {},
852
859
  ...u || {}
853
860
  };
854
861
  break;
855
862
  }
856
- const y = ao(c);
857
- if (n && y.pointerEvents !== void 0) {
858
- const d = { ...y };
863
+ const m = Ro(a);
864
+ if (n && m.pointerEvents !== void 0) {
865
+ const d = { ...m };
859
866
  return delete d.pointerEvents, {
860
867
  componentAttributesBasedOnDevice: p,
861
868
  componentStyles: d
@@ -863,40 +870,40 @@ function Re({
863
870
  }
864
871
  return {
865
872
  componentAttributesBasedOnDevice: p,
866
- componentStyles: y
873
+ componentStyles: m
867
874
  };
868
875
  }
869
- const fo = (e) => {
876
+ const Mo = (e) => {
870
877
  const t = (e == null ? void 0 : e.rows) || [];
871
878
  for (const n of t)
872
879
  if (((n == null ? void 0 : n.columns) || []).length > 0)
873
880
  return !0;
874
881
  return (e == null ? void 0 : e.containerAttributes) && Object.keys(e.containerAttributes).length > 0;
875
- }, yo = "var(--sl-spacing-x-small)";
876
- function mo(e) {
882
+ }, jo = "var(--sl-spacing-x-small)";
883
+ function No(e) {
877
884
  return e != null && e.horizontalAlignment || e != null && e.verticalAlignment || e != null && e.flexWrap || e != null && e.gap || e != null && e.alignContent ? !0 : !!(e != null && e.rowAttributes && Object.keys(e.rowAttributes).length > 0);
878
885
  }
879
- function ho({
886
+ function Wo({
880
887
  row: e,
881
888
  deviceDisplayType: t
882
889
  }) {
883
890
  var o;
884
- const n = N({
891
+ const n = U({
885
892
  deviceDisplayType: t,
886
893
  componentAttributes: e.rowAttributes
887
894
  });
888
895
  return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o["hide-component-3-resolutions"]) === "true";
889
896
  }
890
- function go({
897
+ function Vo({
891
898
  row: e,
892
899
  deviceDisplayType: t,
893
900
  isComposeMode: n
894
901
  }) {
895
902
  var d;
896
- const o = ((d = N({
903
+ const o = ((d = U({
897
904
  deviceDisplayType: t,
898
905
  componentAttributes: e.rowAttributes
899
- })) == null ? void 0 : d.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? xe.Center, i = o.alignItems ?? e.verticalAlignment ?? xe.Center, r = o.flexDirection ?? "row", l = o.gap ?? e.gap ?? yo, u = n ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", c = o.alignContent ?? e.alignContent ?? void 0, a = /* @__PURE__ */ new Set([
906
+ })) == null ? void 0 : d.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? Ue.Center, i = o.alignItems ?? e.verticalAlignment ?? Ue.Center, l = o.flexDirection ?? "row", r = o.gap ?? e.gap ?? jo, u = n ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", a = o.alignContent ?? e.alignContent ?? void 0, c = /* @__PURE__ */ new Set([
900
907
  "justifyContent",
901
908
  "alignItems",
902
909
  "flexDirection",
@@ -905,25 +912,25 @@ function go({
905
912
  "alignContent",
906
913
  "display"
907
914
  ]), p = {};
908
- for (const [h, m] of Object.entries(o))
909
- a.has(h) || (p[h] = m);
910
- const y = {
915
+ for (const [h, b] of Object.entries(o))
916
+ c.has(h) || (p[h] = b);
917
+ const m = {
911
918
  display: "flex",
912
- flexDirection: r,
913
- gap: l,
919
+ flexDirection: l,
920
+ gap: r,
914
921
  flexWrap: u,
915
922
  justifyContent: s,
916
923
  alignItems: i,
917
924
  ...p
918
925
  };
919
- return c !== void 0 && (y.alignContent = c), y;
926
+ return a !== void 0 && (m.alignContent = a), m;
920
927
  }
921
- const Ce = "css-classes-3-resolutions", bo = 500, Co = /[\x00-\x1f\x7f]/g, we = (e) => {
928
+ const _e = "css-classes-3-resolutions", Fo = 500, Bo = /[\x00-\x1f\x7f]/g, Oe = (e) => {
922
929
  if (typeof e != "string")
923
930
  return;
924
931
  const t = /* @__PURE__ */ new Set(), n = [];
925
932
  for (const s of e.split(/\s+/)) {
926
- const i = s.replace(Co, "");
933
+ const i = s.replace(Bo, "");
927
934
  i && (t.has(i) || (t.add(i), n.push(i)));
928
935
  }
929
936
  if (!n.length)
@@ -931,12 +938,12 @@ const Ce = "css-classes-3-resolutions", bo = 500, Co = /[\x00-\x1f\x7f]/g, we =
931
938
  let o = "";
932
939
  for (const s of n) {
933
940
  const i = o ? `${o} ${s}` : s;
934
- if (i.length > bo)
941
+ if (i.length > Fo)
935
942
  break;
936
943
  o = i;
937
944
  }
938
945
  return o.length ? o : void 0;
939
- }, Qe = "hide-component-3-resolutions", wo = "pointer-events-3-resolutions", vo = [
946
+ }, gt = "hide-component-3-resolutions", Ko = "pointer-events-3-resolutions", Uo = [
940
947
  "width-3-resolutions",
941
948
  "min-width-3-resolutions",
942
949
  "max-width-3-resolutions",
@@ -951,23 +958,23 @@ const Ce = "css-classes-3-resolutions", bo = 500, Co = /[\x00-\x1f\x7f]/g, we =
951
958
  "overflow-3-resolutions",
952
959
  "overflow-x-3-resolutions",
953
960
  "overflow-y-3-resolutions",
954
- Qe,
955
- wo
956
- ], Ao = new Set(
957
- vo
961
+ gt,
962
+ Ko
963
+ ], zo = new Set(
964
+ Uo
958
965
  );
959
- function ve({
966
+ function Me({
960
967
  containerAttributes: e,
961
968
  deviceDisplayType: t
962
969
  }) {
963
970
  var o;
964
- const n = N({
971
+ const n = U({
965
972
  deviceDisplayType: t,
966
973
  componentAttributes: e
967
974
  });
968
- return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o[Qe]) === "true";
975
+ return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o[gt]) === "true";
969
976
  }
970
- function et({
977
+ function bt({
971
978
  containerAttributes: e,
972
979
  deviceDisplayType: t,
973
980
  isComposeMode: n
@@ -977,44 +984,44 @@ function et({
977
984
  return { styles: {} };
978
985
  const o = n ? Object.fromEntries(
979
986
  Object.entries(e).filter(
980
- ([r]) => !Ao.has(r)
987
+ ([l]) => !zo.has(l)
981
988
  )
982
- ) : e, s = N({
989
+ ) : e, s = U({
983
990
  deviceDisplayType: t,
984
991
  componentAttributes: o
985
992
  });
986
993
  return {
987
994
  styles: (s == null ? void 0 : s.styles) ?? {},
988
- cssClasses: we(
989
- (i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[Ce]
995
+ cssClasses: Oe(
996
+ (i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[_e]
990
997
  )
991
998
  };
992
999
  }
993
- function So(e) {
1000
+ function Ho(e) {
994
1001
  return Object.keys(e.styles).length > 0 || !!e.cssClasses;
995
1002
  }
996
- function tt({
1003
+ function Ct({
997
1004
  containerAttributes: e,
998
1005
  widgetContainerStyles: t
999
1006
  }) {
1000
- return ((e == null ? void 0 : e[ce]) || []).some(
1007
+ return ((e == null ? void 0 : e[Ae]) || []).some(
1001
1008
  (o) => o.toLowerCase().startsWith("height:")
1002
1009
  ) || t.styles.height !== void 0;
1003
1010
  }
1004
- const Eo = "z-index-3-resolutions", nt = 0;
1005
- function ko(e) {
1011
+ const Go = "z-index-3-resolutions", wt = 0;
1012
+ function Yo(e) {
1006
1013
  var t, n;
1007
1014
  return !!((n = (t = e == null ? void 0 : e.overlayLayers) == null ? void 0 : t.layers) != null && n.length);
1008
1015
  }
1009
- function Oe({
1016
+ function He({
1010
1017
  containerAttributes: e,
1011
1018
  deviceDisplayType: t
1012
1019
  }) {
1013
1020
  var s;
1014
- const n = N({
1021
+ const n = U({
1015
1022
  deviceDisplayType: t,
1016
1023
  componentAttributes: e
1017
- }), o = (s = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Eo];
1024
+ }), o = (s = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : s[Go];
1018
1025
  if (typeof o == "number" && Number.isFinite(o))
1019
1026
  return o;
1020
1027
  if (typeof o == "string" && o.trim().length) {
@@ -1022,33 +1029,33 @@ function Oe({
1022
1029
  if (Number.isFinite(i))
1023
1030
  return i;
1024
1031
  }
1025
- return nt;
1032
+ return wt;
1026
1033
  }
1027
- function To(e, t) {
1034
+ function Xo(e, t) {
1028
1035
  return e + t + 1;
1029
1036
  }
1030
- function Io({
1037
+ function Jo({
1031
1038
  containerAttributes: e,
1032
1039
  deviceDisplayType: t
1033
1040
  }) {
1034
1041
  var s;
1035
- const n = N({
1042
+ const n = U({
1036
1043
  deviceDisplayType: t,
1037
1044
  componentAttributes: e
1038
1045
  }), o = (s = n == null ? void 0 : n.styles) == null ? void 0 : s.pointerEvents;
1039
1046
  return typeof o == "string" ? o : void 0;
1040
1047
  }
1041
- function Po({
1048
+ function qo({
1042
1049
  layer: e,
1043
1050
  deviceDisplayType: t
1044
1051
  }) {
1045
1052
  var n;
1046
- return (n = e == null ? void 0 : e.rows) != null && n.length ? ve({
1053
+ return (n = e == null ? void 0 : e.rows) != null && n.length ? Me({
1047
1054
  containerAttributes: e.containerAttributes,
1048
1055
  deviceDisplayType: t
1049
1056
  }) : !0;
1050
1057
  }
1051
- function Do({
1058
+ function Zo({
1052
1059
  isWithinCollection: e,
1053
1060
  baseDeclaresOwnHeight: t,
1054
1061
  baseZIndex: n
@@ -1059,10 +1066,10 @@ function Do({
1059
1066
  display: "flex",
1060
1067
  flexDirection: "column",
1061
1068
  ...t ? {} : { height: e ? "auto" : "100%" },
1062
- ...n === nt ? {} : { zIndex: n }
1069
+ ...n === wt ? {} : { zIndex: n }
1063
1070
  };
1064
1071
  }
1065
- function $o({
1072
+ function Qo({
1066
1073
  zIndex: e,
1067
1074
  pointerEvents: t
1068
1075
  }) {
@@ -1077,8 +1084,8 @@ function $o({
1077
1084
  ...t ? { pointerEvents: t } : {}
1078
1085
  };
1079
1086
  }
1080
- const Ae = "/";
1081
- function Lo({
1087
+ const fe = "/";
1088
+ function es({
1082
1089
  componentProps: e,
1083
1090
  ancestorColumnIds: t,
1084
1091
  columnId: n
@@ -1087,40 +1094,50 @@ function Lo({
1087
1094
  return;
1088
1095
  const o = [...t ?? [], n];
1089
1096
  for (let s = 0; s < o.length; s += 1) {
1090
- const i = o.slice(s).join(Ae), r = e[i];
1091
- if (r)
1092
- return r;
1097
+ const i = o.slice(s).join(fe), l = e[i];
1098
+ if (l)
1099
+ return l;
1093
1100
  }
1094
1101
  }
1095
- function xo({
1102
+ const Ge = "placeholderValues";
1103
+ function ts({
1104
+ widgetInstanceProps: e,
1105
+ placeholderValues: t
1106
+ }) {
1107
+ return t === void 0 || e != null && Object.prototype.hasOwnProperty.call(e, Ge) ? e : {
1108
+ ...e,
1109
+ [Ge]: t
1110
+ };
1111
+ }
1112
+ function ns({
1096
1113
  displayItemList: e,
1097
1114
  widgetCollections: t
1098
1115
  }) {
1099
1116
  const n = [], o = (s, i) => {
1100
- var r;
1101
- if ((r = s == null ? void 0 : s.rows) != null && r.length)
1102
- for (const l of s.rows)
1103
- for (const u of l.columns) {
1104
- if (!u.id || u.type === fe.DroppableBox)
1117
+ var l;
1118
+ if ((l = s == null ? void 0 : s.rows) != null && l.length)
1119
+ for (const r of s.rows)
1120
+ for (const u of r.columns) {
1121
+ if (!u.id || u.type === Pe.DroppableBox)
1105
1122
  continue;
1106
- const c = Xe(u.type);
1107
- if (c != null && c.length) {
1108
- const a = u.collection ?? (t == null ? void 0 : t[c]);
1109
- a && !i.includes(u.id) && o(a.collectionRows, [...i, u.id]);
1123
+ const a = ft(u.type);
1124
+ if (a != null && a.length) {
1125
+ const c = u.collection ?? (t == null ? void 0 : t[a]);
1126
+ c && !i.includes(u.id) && o(c.collectionRows, [...i, u.id]);
1110
1127
  continue;
1111
1128
  }
1112
1129
  n.push(
1113
- [...i, u.id].join(Ae)
1130
+ [...i, u.id].join(fe)
1114
1131
  );
1115
1132
  }
1116
1133
  };
1117
1134
  return o(e, []), n;
1118
1135
  }
1119
- function Ro(e, t) {
1120
- const n = `${Ae}${e}`;
1136
+ function os(e, t) {
1137
+ const n = `${fe}${e}`;
1121
1138
  return t.some((o) => o === e || o.endsWith(n));
1122
1139
  }
1123
- function Oo({
1140
+ function ss({
1124
1141
  componentProps: e,
1125
1142
  displayItemList: t,
1126
1143
  widgetCollections: n
@@ -1128,13 +1145,13 @@ function Oo({
1128
1145
  const o = e ? Object.keys(e) : [];
1129
1146
  if (!o.length)
1130
1147
  return [];
1131
- const s = xo({
1148
+ const s = ns({
1132
1149
  displayItemList: t,
1133
1150
  widgetCollections: n
1134
1151
  });
1135
- return o.filter((i) => !Ro(i, s));
1152
+ return o.filter((i) => !os(i, s));
1136
1153
  }
1137
- function _o({
1154
+ function is({
1138
1155
  componentProps: e,
1139
1156
  displayItemList: t,
1140
1157
  widgetCollections: n,
@@ -1142,7 +1159,7 @@ function _o({
1142
1159
  }) {
1143
1160
  if (process.env.NODE_ENV === "production")
1144
1161
  return;
1145
- const s = Oo({
1162
+ const s = ss({
1146
1163
  componentProps: e,
1147
1164
  displayItemList: t,
1148
1165
  widgetCollections: n
@@ -1151,68 +1168,68 @@ function _o({
1151
1168
  `RuleCMSWidget "${o}": componentProps ${s.map((i) => `"${i}"`).join(", ")} ${s.length === 1 ? "matches" : "match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`
1152
1169
  );
1153
1170
  }
1154
- function jo(e) {
1171
+ function rs(e) {
1155
1172
  return typeof e == "object" && e !== null && !Array.isArray(e);
1156
1173
  }
1157
- function Mo(e) {
1174
+ function ls(e) {
1158
1175
  if (e.all !== void 0 && e.all !== null)
1159
1176
  return !1;
1160
1177
  const t = e.phone, n = e.tablet, o = e.desktop;
1161
1178
  return t !== n || t !== o || n !== o;
1162
1179
  }
1163
- function ae(e) {
1180
+ function Se(e) {
1164
1181
  var t, n;
1165
1182
  if (!((t = e == null ? void 0 : e.rows) != null && t.length))
1166
1183
  return !1;
1167
- if (re(e.containerAttributes))
1184
+ if (we(e.containerAttributes))
1168
1185
  return !0;
1169
1186
  for (const o of e.rows) {
1170
- if (re(o.rowAttributes))
1187
+ if (we(o.rowAttributes))
1171
1188
  return !0;
1172
1189
  for (const s of o.columns)
1173
- if (re(ee(s)))
1190
+ if (we(ue(s)))
1174
1191
  return !0;
1175
1192
  }
1176
1193
  for (const o of ((n = e.overlayLayers) == null ? void 0 : n.layers) ?? [])
1177
- if (ae(o))
1194
+ if (Se(o))
1178
1195
  return !0;
1179
1196
  return !1;
1180
1197
  }
1181
- function re(e) {
1198
+ function we(e) {
1182
1199
  if (!e)
1183
1200
  return !1;
1184
1201
  for (const [t, n] of Object.entries(e))
1185
- if (!(!t.includes("3-resolutions") || !jo(n))) {
1202
+ if (!(!t.includes("3-resolutions") || !rs(n))) {
1186
1203
  if (t === "hide-component-3-resolutions") {
1187
1204
  const o = n, s = (i) => i === "true" || i === !0;
1188
1205
  if (s(o.phone) !== s(o.tablet) || s(o.phone) !== s(o.desktop))
1189
1206
  return !0;
1190
1207
  continue;
1191
1208
  }
1192
- if (Mo(n))
1209
+ if (ls(n))
1193
1210
  return !0;
1194
1211
  }
1195
1212
  return !1;
1196
1213
  }
1197
- function No(e, t) {
1198
- if (ae(e))
1214
+ function cs(e, t) {
1215
+ if (Se(e))
1199
1216
  return !0;
1200
1217
  for (const n of Object.values(t))
1201
- if (ae(n.collectionRows))
1218
+ if (Se(n.collectionRows))
1202
1219
  return !0;
1203
1220
  return !1;
1204
1221
  }
1205
- const ot = parseInt(Ze, 10), st = parseInt(qe, 10), Wo = ot + 1, Vo = st + 1;
1206
- function Fo(e) {
1222
+ const vt = parseInt(mt, 10), At = parseInt(ht, 10), as = vt + 1, us = At + 1;
1223
+ function ds(e) {
1207
1224
  const t = `.${e}-phone`, n = `.${e}-tablet`, o = `.${e}-desktop`;
1208
1225
  return `
1209
1226
  ${t}, ${n}, ${o} { display: none; }
1210
- @media (max-width: ${ot}px) { ${t} { display: block; } }
1211
- @media (min-width: ${Wo}px) and (max-width: ${st}px) { ${n} { display: block; } }
1212
- @media (min-width: ${Vo}px) { ${o} { display: block; } }
1227
+ @media (max-width: ${vt}px) { ${t} { display: block; } }
1228
+ @media (min-width: ${as}px) and (max-width: ${At}px) { ${n} { display: block; } }
1229
+ @media (min-width: ${us}px) { ${o} { display: block; } }
1213
1230
  `.trim();
1214
1231
  }
1215
- function le(e) {
1232
+ function ve(e) {
1216
1233
  if (!e)
1217
1234
  throw new Error("Source components plugin is required, but no plugins were provided");
1218
1235
  const t = e.sourceComponents;
@@ -1226,7 +1243,7 @@ function le(e) {
1226
1243
  );
1227
1244
  return t;
1228
1245
  }
1229
- const Bo = ["hidden"], _e = /* @__PURE__ */ A({
1246
+ const ps = ["hidden"], Ye = /* @__PURE__ */ S({
1230
1247
  __name: "EmbedInVerticalContainer",
1231
1248
  props: {
1232
1249
  displayItemList: {},
@@ -1239,59 +1256,59 @@ const Bo = ["hidden"], _e = /* @__PURE__ */ A({
1239
1256
  const t = e;
1240
1257
  let n = 0;
1241
1258
  const o = `rulecms-vc-${++n}`;
1242
- function s(h, m, S) {
1243
- const w = h && !S ? 3 : 1;
1244
- return !!(m != null && m.length) && m.length > w;
1259
+ function s(h, b, C) {
1260
+ const g = h && !C ? 3 : 1;
1261
+ return !!(b != null && b.length) && b.length > g;
1245
1262
  }
1246
- const i = g(() => {
1247
- var m;
1248
- return (((m = t.displayItemList.containerAttributes) == null ? void 0 : m[ce]) || []).join(`;
1263
+ const i = y(() => {
1264
+ var b;
1265
+ return (((b = t.displayItemList.containerAttributes) == null ? void 0 : b[Ae]) || []).join(`;
1249
1266
  `);
1250
- }), r = g(
1267
+ }), l = y(
1251
1268
  () => i.value ? `.${o} {
1252
1269
  ${i.value}
1253
1270
  }` : ""
1254
- ), l = g(
1255
- () => !t.isComposeMode && ve({
1271
+ ), r = y(
1272
+ () => !t.isComposeMode && Me({
1256
1273
  containerAttributes: t.displayItemList.containerAttributes,
1257
1274
  deviceDisplayType: t.deviceDisplayType
1258
1275
  })
1259
- ), u = g(
1260
- () => et({
1276
+ ), u = y(
1277
+ () => bt({
1261
1278
  containerAttributes: t.displayItemList.containerAttributes,
1262
1279
  deviceDisplayType: t.deviceDisplayType,
1263
1280
  isComposeMode: t.isComposeMode
1264
1281
  })
1265
- ), c = g(() => {
1266
- var S;
1267
- const h = ((S = t.displayItemList.containerAttributes) == null ? void 0 : S[ce]) || [], m = So(u.value);
1268
- return t.isComposeMode && !t.isWithinCollection || t.showDropContainers || h.length > 0 || m || s(t.isComposeMode, t.displayItemList.rows, t.isWithinCollection);
1269
- }), a = g(
1282
+ ), a = y(() => {
1283
+ var C;
1284
+ const h = ((C = t.displayItemList.containerAttributes) == null ? void 0 : C[Ae]) || [], b = Ho(u.value);
1285
+ return t.isComposeMode && !t.isWithinCollection || t.showDropContainers || h.length > 0 || b || s(t.isComposeMode, t.displayItemList.rows, t.isWithinCollection);
1286
+ }), c = y(
1270
1287
  () => [i.value ? o : void 0, u.value.cssClasses].filter(Boolean).join(" ")
1271
- ), p = g(() => ({
1272
- ...tt({
1288
+ ), p = y(() => ({
1289
+ ...Ct({
1273
1290
  containerAttributes: t.displayItemList.containerAttributes,
1274
1291
  widgetContainerStyles: u.value
1275
1292
  }) ? {} : { height: t.isWithinCollection ? "auto" : "100%" },
1276
1293
  display: "flex",
1277
1294
  flexDirection: "column",
1278
1295
  ...u.value.styles
1279
- })), y = g(() => c.value ? a.value : ""), d = g(() => l.value ? { display: "none" } : c.value ? p.value : { display: "contents" });
1280
- return (h, m) => (f(), b("div", {
1281
- hidden: l.value || void 0,
1282
- class: G(y.value || void 0),
1283
- style: I(d.value)
1296
+ })), m = y(() => a.value ? c.value : ""), d = y(() => r.value ? { display: "none" } : a.value ? p.value : { display: "contents" });
1297
+ return (h, b) => (f(), w("div", {
1298
+ hidden: r.value || void 0,
1299
+ class: ie(m.value || void 0),
1300
+ style: D(d.value)
1284
1301
  }, [
1285
- i.value ? (f(), C(P("style"), { key: 0 }, {
1286
- default: T(() => [
1287
- R(L(r.value), 1)
1302
+ i.value ? (f(), v(x("style"), { key: 0 }, {
1303
+ default: P(() => [
1304
+ j(M(l.value), 1)
1288
1305
  ]),
1289
1306
  _: 1
1290
- })) : k("", !0),
1291
- pe(h.$slots, "default")
1292
- ], 14, Bo));
1307
+ })) : T("", !0),
1308
+ Ie(h.$slots, "default")
1309
+ ], 14, ps));
1293
1310
  }
1294
- }), Ko = ["hidden"], je = /* @__PURE__ */ A({
1311
+ }), fs = ["hidden"], Xe = /* @__PURE__ */ S({
1295
1312
  __name: "EmbedInRow",
1296
1313
  props: {
1297
1314
  row: {},
@@ -1302,40 +1319,40 @@ ${i.value}
1302
1319
  },
1303
1320
  setup(e) {
1304
1321
  const t = e;
1305
- function n(c, a, p) {
1322
+ function n(a, c, p) {
1306
1323
  var d;
1307
- const y = c && !p ? 3 : 1;
1308
- return !!((d = a == null ? void 0 : a.columns) != null && d.length) && a.columns.length > y;
1324
+ const m = a && !p ? 3 : 1;
1325
+ return !!((d = c == null ? void 0 : c.columns) != null && d.length) && c.columns.length > m;
1309
1326
  }
1310
- const o = g(
1311
- () => !t.isComposeMode && ho({ row: t.row, deviceDisplayType: t.deviceDisplayType })
1312
- ), s = g(
1313
- () => t.showDropContainers || mo(t.row) || n(t.isComposeMode, t.row, t.isWithinCollection)
1314
- ), i = g(
1315
- () => go({
1327
+ const o = y(
1328
+ () => !t.isComposeMode && Wo({ row: t.row, deviceDisplayType: t.deviceDisplayType })
1329
+ ), s = y(
1330
+ () => t.showDropContainers || No(t.row) || n(t.isComposeMode, t.row, t.isWithinCollection)
1331
+ ), i = y(
1332
+ () => Vo({
1316
1333
  row: t.row,
1317
1334
  deviceDisplayType: t.deviceDisplayType,
1318
1335
  isComposeMode: t.isComposeMode
1319
1336
  })
1320
- ), r = g(() => {
1321
- var a;
1322
- const c = N({
1337
+ ), l = y(() => {
1338
+ var c;
1339
+ const a = U({
1323
1340
  deviceDisplayType: t.deviceDisplayType,
1324
1341
  componentAttributes: t.row.rowAttributes
1325
1342
  });
1326
- return we(
1327
- (a = c == null ? void 0 : c.componentAttributesSpecificToDeviceType) == null ? void 0 : a[Ce]
1343
+ return Oe(
1344
+ (c = a == null ? void 0 : a.componentAttributesSpecificToDeviceType) == null ? void 0 : c[_e]
1328
1345
  ) ?? "";
1329
- }), l = g(() => s.value ? r.value : ""), u = g(() => o.value ? { display: "none" } : s.value ? i.value : { display: "contents" });
1330
- return (c, a) => (f(), b("div", {
1346
+ }), r = y(() => s.value ? l.value : ""), u = y(() => o.value ? { display: "none" } : s.value ? i.value : { display: "contents" });
1347
+ return (a, c) => (f(), w("div", {
1331
1348
  hidden: o.value || void 0,
1332
- class: G(l.value || void 0),
1333
- style: I(u.value)
1349
+ class: ie(r.value || void 0),
1350
+ style: D(u.value)
1334
1351
  }, [
1335
- pe(c.$slots, "default")
1336
- ], 14, Ko));
1352
+ Ie(a.$slots, "default")
1353
+ ], 14, fs));
1337
1354
  }
1338
- }), it = [
1355
+ }), Et = [
1339
1356
  "minWidth",
1340
1357
  "maxWidth",
1341
1358
  "minHeight",
@@ -1387,20 +1404,20 @@ ${i.value}
1387
1404
  "textAlign",
1388
1405
  "textDecoration",
1389
1406
  "textTransform"
1390
- ], zo = (e) => e != null && e !== "", Ho = (e) => e ? it.reduce(
1407
+ ], ys = (e) => e != null && e !== "", ms = (e) => e ? Et.reduce(
1391
1408
  (t, n) => {
1392
1409
  const o = e[n];
1393
- return zo(o) && (t[n] = o), t;
1410
+ return ys(o) && (t[n] = o), t;
1394
1411
  },
1395
1412
  {}
1396
- ) : {}, Uo = (e) => {
1413
+ ) : {}, hs = (e) => {
1397
1414
  if (!e)
1398
1415
  return;
1399
1416
  const t = { ...e };
1400
- for (const n of it)
1417
+ for (const n of Et)
1401
1418
  delete t[n];
1402
1419
  return Object.keys(t).length ? t : void 0;
1403
- }, Yo = (e) => Object.keys(e).length > 0, Go = (e, t) => {
1420
+ }, gs = (e) => Object.keys(e).length > 0, bs = (e, t) => {
1404
1421
  const n = (e == null ? void 0 : e.noContainer) ?? !1, o = e == null ? void 0 : e.resolveNoContainer;
1405
1422
  if (typeof o != "function")
1406
1423
  return n;
@@ -1418,7 +1435,7 @@ ${i.value}
1418
1435
  );
1419
1436
  }
1420
1437
  return n;
1421
- }, Xo = (e, t) => {
1438
+ }, Cs = (e, t) => {
1422
1439
  const n = e == null ? void 0 : e.resolveRendersOwnElement;
1423
1440
  if (typeof n != "function")
1424
1441
  return !1;
@@ -1436,7 +1453,7 @@ ${i.value}
1436
1453
  );
1437
1454
  }
1438
1455
  return !1;
1439
- }, Me = /* @__PURE__ */ A({
1456
+ }, Je = /* @__PURE__ */ S({
1440
1457
  __name: "DisplayComponent",
1441
1458
  props: {
1442
1459
  componentType: {},
@@ -1445,54 +1462,58 @@ ${i.value}
1445
1462
  components: {},
1446
1463
  styleProps: {},
1447
1464
  widgetInstanceProps: {},
1465
+ pageViewType: {},
1466
+ columnPath: {},
1448
1467
  mounts: {}
1449
1468
  },
1450
1469
  setup(e) {
1451
- const t = e, n = g(() => t.components[ze(t.libraryId, t.componentType)]), o = g(() => {
1470
+ const t = e, n = y(() => t.components[rt(t.libraryId, t.componentType)]), o = y(() => {
1452
1471
  var h;
1453
1472
  const d = (h = n.value) == null ? void 0 : h.card;
1454
1473
  return d || (console.error(
1455
1474
  `DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`
1456
1475
  ), null);
1457
- }), s = g(() => ({
1476
+ }), s = y(() => ({
1458
1477
  componentAttributes: t.componentAttributes,
1459
1478
  styleProps: t.styleProps
1460
- })), i = g(
1461
- () => n.value ? Go(n.value, s.value) : !1
1462
- ), r = g(() => Ho(t.styleProps)), l = g(
1463
- () => i.value ? Uo(t.styleProps) : t.styleProps
1464
- ), u = g(
1479
+ })), i = y(
1480
+ () => n.value ? bs(n.value, s.value) : !1
1481
+ ), l = y(() => ms(t.styleProps)), r = y(
1482
+ () => i.value ? hs(t.styleProps) : t.styleProps
1483
+ ), u = y(
1465
1484
  () => {
1466
1485
  var d;
1467
- return we((d = t.componentAttributes) == null ? void 0 : d[Ce]);
1486
+ return Oe((d = t.componentAttributes) == null ? void 0 : d[_e]);
1468
1487
  }
1469
- ), c = g(() => i.value && Yo(r.value)), a = g(
1470
- () => !i.value || (n.value ? Xo(n.value, s.value) : !1)
1471
- ), p = g(
1472
- () => !c.value && a.value ? u.value : void 0
1473
- ), y = g(() => ({
1488
+ ), a = y(() => i.value && gs(l.value)), c = y(
1489
+ () => !i.value || (n.value ? Cs(n.value, s.value) : !1)
1490
+ ), p = y(
1491
+ () => !a.value && c.value ? u.value : void 0
1492
+ ), m = y(() => ({
1474
1493
  componentAttributes: t.componentAttributes,
1475
- styleProps: l.value,
1494
+ styleProps: r.value,
1476
1495
  className: p.value,
1477
1496
  widgetInstanceProps: t.widgetInstanceProps,
1497
+ pageViewType: t.pageViewType,
1498
+ columnPath: t.columnPath,
1478
1499
  mounts: t.mounts
1479
1500
  }));
1480
- return (d, h) => o.value ? (f(), b(E, { key: 0 }, [
1481
- c.value ? (f(), b("div", {
1501
+ return (d, h) => o.value ? (f(), w(k, { key: 0 }, [
1502
+ a.value ? (f(), w("div", {
1482
1503
  key: 0,
1483
- class: G(u.value || void 0),
1484
- style: I(r.value)
1504
+ class: ie(u.value || void 0),
1505
+ style: D(l.value)
1485
1506
  }, [
1486
- (f(), C(P(o.value), oe(De(y.value)), null, 16))
1487
- ], 6)) : !a.value && u.value ? (f(), b("div", {
1507
+ (f(), v(x(o.value), ge(Ve(m.value)), null, 16))
1508
+ ], 6)) : !c.value && u.value ? (f(), w("div", {
1488
1509
  key: 1,
1489
- class: G(u.value)
1510
+ class: ie(u.value)
1490
1511
  }, [
1491
- (f(), C(P(o.value), oe(De(y.value)), null, 16))
1492
- ], 2)) : (f(), C(P(o.value), oe(Dt({ key: 2 }, y.value)), null, 16))
1493
- ], 64)) : k("", !0);
1512
+ (f(), v(x(o.value), ge(Ve(m.value)), null, 16))
1513
+ ], 2)) : (f(), v(x(o.value), ge(Zt({ key: 2 }, m.value)), null, 16))
1514
+ ], 64)) : T("", !0);
1494
1515
  }
1495
- }), Jo = ["data-rulecms-overlay-layer"], Zo = /* @__PURE__ */ A({
1516
+ }), ws = ["data-rulecms-overlay-layer"], vs = /* @__PURE__ */ S({
1496
1517
  __name: "RenderComponentsInner",
1497
1518
  props: {
1498
1519
  displayItemList: {},
@@ -1505,125 +1526,136 @@ ${i.value}
1505
1526
  deviceDisplayType: {},
1506
1527
  componentProps: {},
1507
1528
  mounts: {},
1529
+ placeholderValues: {},
1508
1530
  ancestorColumnIds: {}
1509
1531
  },
1510
1532
  setup(e) {
1511
- const t = e, n = () => le(t.plugins).components, o = g(
1512
- () => !t.isComposeMode && ko(t.displayItemList) && !ve({
1533
+ const t = e, n = () => ve(t.plugins).components, o = y(
1534
+ () => !t.isComposeMode && Yo(t.displayItemList) && !Me({
1513
1535
  containerAttributes: t.displayItemList.containerAttributes,
1514
1536
  deviceDisplayType: t.deviceDisplayType
1515
1537
  })
1516
- ), s = g(() => {
1517
- const p = Oe({
1538
+ ), s = y(() => {
1539
+ const d = He({
1518
1540
  containerAttributes: t.displayItemList.containerAttributes,
1519
1541
  deviceDisplayType: t.deviceDisplayType
1520
1542
  });
1521
- return Do({
1543
+ return Zo({
1522
1544
  isWithinCollection: t.isWithinCollection,
1523
- baseDeclaresOwnHeight: tt({
1545
+ baseDeclaresOwnHeight: Ct({
1524
1546
  containerAttributes: t.displayItemList.containerAttributes,
1525
- widgetContainerStyles: et({
1547
+ widgetContainerStyles: bt({
1526
1548
  containerAttributes: t.displayItemList.containerAttributes,
1527
1549
  deviceDisplayType: t.deviceDisplayType,
1528
1550
  isComposeMode: t.isComposeMode
1529
1551
  })
1530
1552
  }),
1531
- baseZIndex: p
1553
+ baseZIndex: d
1532
1554
  });
1533
- }), i = g(() => {
1534
- var d;
1535
- const p = ((d = t.displayItemList.overlayLayers) == null ? void 0 : d.layers) ?? [], y = Oe({
1555
+ }), i = y(() => {
1556
+ var b;
1557
+ const d = ((b = t.displayItemList.overlayLayers) == null ? void 0 : b.layers) ?? [], h = He({
1536
1558
  containerAttributes: t.displayItemList.containerAttributes,
1537
1559
  deviceDisplayType: t.deviceDisplayType
1538
1560
  });
1539
- return p.flatMap((h, m) => Po({ layer: h, deviceDisplayType: t.deviceDisplayType }) ? [] : [
1561
+ return d.flatMap((C, g) => qo({ layer: C, deviceDisplayType: t.deviceDisplayType }) ? [] : [
1540
1562
  {
1541
- index: m,
1542
- layer: h,
1543
- boxStyles: $o({
1544
- zIndex: To(y, m),
1545
- pointerEvents: Io({
1546
- containerAttributes: h.containerAttributes,
1563
+ index: g,
1564
+ layer: C,
1565
+ boxStyles: Qo({
1566
+ zIndex: Xo(h, g),
1567
+ pointerEvents: Jo({
1568
+ containerAttributes: C.containerAttributes,
1547
1569
  deviceDisplayType: t.deviceDisplayType
1548
1570
  })
1549
1571
  })
1550
1572
  }
1551
1573
  ]);
1552
1574
  });
1553
- function r(p) {
1554
- if (t.isComposeMode && p.type === fe.DroppableBox)
1575
+ function l(d) {
1576
+ if (t.isComposeMode && d.type === Pe.DroppableBox)
1555
1577
  return !1;
1556
- const { componentAttributesBasedOnDevice: y } = Re({
1557
- col: p,
1578
+ const { componentAttributesBasedOnDevice: h } = ze({
1579
+ col: d,
1558
1580
  deviceDisplayType: t.deviceDisplayType,
1559
1581
  isComposeMode: t.isComposeMode,
1560
- sourceComponentsPlugin: le(t.plugins)
1561
- }), d = !!y && y["hide-component-3-resolutions"] === "true";
1562
- return !(!t.isComposeMode && d);
1582
+ sourceComponentsPlugin: ve(t.plugins)
1583
+ }), b = !!h && h["hide-component-3-resolutions"] === "true";
1584
+ return !(!t.isComposeMode && b);
1563
1585
  }
1564
- function l(p) {
1565
- const { componentAttributesBasedOnDevice: y, componentStyles: d } = Re({
1566
- col: p,
1586
+ function r(d) {
1587
+ const { componentAttributesBasedOnDevice: h, componentStyles: b } = ze({
1588
+ col: d,
1567
1589
  deviceDisplayType: t.deviceDisplayType,
1568
1590
  isComposeMode: t.isComposeMode,
1569
- sourceComponentsPlugin: le(t.plugins)
1591
+ sourceComponentsPlugin: ve(t.plugins)
1570
1592
  });
1571
1593
  return {
1572
- componentAttributes: y,
1573
- styleProps: d
1594
+ componentAttributes: h,
1595
+ styleProps: b
1574
1596
  };
1575
1597
  }
1576
- function u(p) {
1577
- const y = Xe(p.type);
1578
- if (!(y != null && y.length))
1598
+ function u(d) {
1599
+ const h = ft(d.type);
1600
+ if (!(h != null && h.length))
1579
1601
  return null;
1580
- const d = p.collection ?? t.widgetCollections[y];
1581
- if (!d)
1602
+ const b = d.collection ?? t.widgetCollections[h];
1603
+ if (!b)
1582
1604
  throw new Error(
1583
- `DisplayCollection - Collection with ID ${y} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`
1605
+ `DisplayCollection - Collection with ID ${h} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`
1584
1606
  );
1585
- return !d.collectionRows || !fo(d.collectionRows) ? null : d.collectionRows;
1607
+ return !b.collectionRows || !Mo(b.collectionRows) ? null : b.collectionRows;
1586
1608
  }
1587
- function c(p) {
1588
- return [...t.ancestorColumnIds ?? [], p];
1609
+ function a(d) {
1610
+ return [...t.ancestorColumnIds ?? [], d];
1589
1611
  }
1590
- function a(p) {
1591
- return Lo({
1592
- componentProps: t.componentProps,
1593
- ancestorColumnIds: t.ancestorColumnIds,
1594
- columnId: p
1612
+ function c() {
1613
+ return t.isComposeMode ? Ke.Compose : Ke.RenderedPage;
1614
+ }
1615
+ function p(d) {
1616
+ if (!(t.isComposeMode || !d))
1617
+ return [...t.ancestorColumnIds ?? [], d].join(fe);
1618
+ }
1619
+ function m(d) {
1620
+ return ts({
1621
+ widgetInstanceProps: es({
1622
+ componentProps: t.componentProps,
1623
+ ancestorColumnIds: t.ancestorColumnIds,
1624
+ columnId: d
1625
+ }),
1626
+ placeholderValues: t.isComposeMode ? void 0 : t.placeholderValues
1595
1627
  });
1596
1628
  }
1597
- return (p, y) => {
1598
- const d = $t("RenderComponentsInner", !0);
1599
- return o.value ? (f(), b("div", {
1629
+ return (d, h) => {
1630
+ const b = Qt("RenderComponentsInner", !0);
1631
+ return o.value ? (f(), w("div", {
1600
1632
  key: 0,
1601
- style: I(s.value)
1633
+ style: D(s.value)
1602
1634
  }, [
1603
- $(_e, {
1635
+ R(Ye, {
1604
1636
  "display-item-list": e.displayItemList,
1605
1637
  "is-compose-mode": e.isComposeMode,
1606
1638
  "show-drop-containers": e.showDropContainers,
1607
1639
  "is-within-collection": e.isWithinCollection,
1608
1640
  "device-display-type": e.deviceDisplayType
1609
1641
  }, {
1610
- default: T(() => [
1611
- (f(!0), b(E, null, F(e.displayItemList.rows, (h) => (f(), C(je, {
1612
- key: h.id,
1613
- row: h,
1642
+ default: P(() => [
1643
+ (f(!0), w(k, null, G(e.displayItemList.rows, (C) => (f(), v(Xe, {
1644
+ key: C.id,
1645
+ row: C,
1614
1646
  "is-compose-mode": e.isComposeMode,
1615
1647
  "show-drop-containers": e.showDropContainers,
1616
1648
  "is-within-collection": e.isWithinCollection,
1617
1649
  "device-display-type": e.deviceDisplayType
1618
1650
  }, {
1619
- default: T(() => [
1620
- (f(!0), b(E, null, F(h.columns, (m) => (f(), b(E, {
1621
- key: m.id
1651
+ default: P(() => [
1652
+ (f(!0), w(k, null, G(C.columns, (g) => (f(), w(k, {
1653
+ key: g.id
1622
1654
  }, [
1623
- r(m) ? (f(), b(E, { key: 0 }, [
1624
- u(m) ? (f(), C(d, {
1655
+ l(g) ? (f(), w(k, { key: 0 }, [
1656
+ u(g) ? (f(), v(b, {
1625
1657
  key: 0,
1626
- "display-item-list": u(m),
1658
+ "display-item-list": u(g),
1627
1659
  "is-compose-mode": e.isComposeMode,
1628
1660
  "is-within-collection": !0,
1629
1661
  "widget-collections": e.widgetCollections,
@@ -1633,18 +1665,21 @@ ${i.value}
1633
1665
  "device-display-type": e.deviceDisplayType,
1634
1666
  "component-props": e.componentProps,
1635
1667
  mounts: e.mounts,
1636
- "ancestor-column-ids": c(m.id)
1637
- }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : (f(), C(Me, {
1668
+ "placeholder-values": e.placeholderValues,
1669
+ "ancestor-column-ids": a(g.id)
1670
+ }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])) : (f(), v(Je, {
1638
1671
  key: 1,
1639
- "component-type": m.type,
1640
- "library-id": m.libraryId,
1641
- "component-attributes": l(m).componentAttributes,
1672
+ "component-type": g.type,
1673
+ "library-id": g.libraryId,
1674
+ "component-attributes": r(g).componentAttributes,
1642
1675
  components: n(),
1643
- "style-props": l(m).styleProps,
1644
- "widget-instance-props": a(m.id),
1676
+ "style-props": r(g).styleProps,
1677
+ "widget-instance-props": m(g.id),
1678
+ "page-view-type": c(),
1679
+ "column-path": p(g.id),
1645
1680
  mounts: e.mounts
1646
- }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "mounts"]))
1647
- ], 64)) : k("", !0)
1681
+ }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "page-view-type", "column-path", "mounts"]))
1682
+ ], 64)) : T("", !0)
1648
1683
  ], 64))), 128))
1649
1684
  ]),
1650
1685
  _: 2
@@ -1652,13 +1687,13 @@ ${i.value}
1652
1687
  ]),
1653
1688
  _: 1
1654
1689
  }, 8, ["display-item-list", "is-compose-mode", "show-drop-containers", "is-within-collection", "device-display-type"]),
1655
- (f(!0), b(E, null, F(i.value, (h) => (f(), b("div", {
1656
- key: h.index,
1657
- "data-rulecms-overlay-layer": h.index,
1658
- style: I(h.boxStyles)
1690
+ (f(!0), w(k, null, G(i.value, (C) => (f(), w("div", {
1691
+ key: C.index,
1692
+ "data-rulecms-overlay-layer": C.index,
1693
+ style: D(C.boxStyles)
1659
1694
  }, [
1660
- $(d, {
1661
- "display-item-list": h.layer,
1695
+ R(b, {
1696
+ "display-item-list": C.layer,
1662
1697
  "is-compose-mode": e.isComposeMode,
1663
1698
  "is-within-collection": !1,
1664
1699
  "widget-collections": e.widgetCollections,
@@ -1668,10 +1703,11 @@ ${i.value}
1668
1703
  "device-display-type": e.deviceDisplayType,
1669
1704
  "component-props": e.componentProps,
1670
1705
  mounts: e.mounts,
1706
+ "placeholder-values": e.placeholderValues,
1671
1707
  "ancestor-column-ids": e.ancestorColumnIds
1672
- }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])
1673
- ], 12, Jo))), 128))
1674
- ], 4)) : (f(), C(_e, {
1708
+ }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])
1709
+ ], 12, ws))), 128))
1710
+ ], 4)) : (f(), v(Ye, {
1675
1711
  key: 1,
1676
1712
  "display-item-list": e.displayItemList,
1677
1713
  "is-compose-mode": e.isComposeMode,
@@ -1679,23 +1715,23 @@ ${i.value}
1679
1715
  "is-within-collection": e.isWithinCollection,
1680
1716
  "device-display-type": e.deviceDisplayType
1681
1717
  }, {
1682
- default: T(() => [
1683
- (f(!0), b(E, null, F(e.displayItemList.rows, (h) => (f(), C(je, {
1684
- key: h.id,
1685
- row: h,
1718
+ default: P(() => [
1719
+ (f(!0), w(k, null, G(e.displayItemList.rows, (C) => (f(), v(Xe, {
1720
+ key: C.id,
1721
+ row: C,
1686
1722
  "is-compose-mode": e.isComposeMode,
1687
1723
  "show-drop-containers": e.showDropContainers,
1688
1724
  "is-within-collection": e.isWithinCollection,
1689
1725
  "device-display-type": e.deviceDisplayType
1690
1726
  }, {
1691
- default: T(() => [
1692
- (f(!0), b(E, null, F(h.columns, (m) => (f(), b(E, {
1693
- key: m.id
1727
+ default: P(() => [
1728
+ (f(!0), w(k, null, G(C.columns, (g) => (f(), w(k, {
1729
+ key: g.id
1694
1730
  }, [
1695
- r(m) ? (f(), b(E, { key: 0 }, [
1696
- u(m) ? (f(), C(d, {
1731
+ l(g) ? (f(), w(k, { key: 0 }, [
1732
+ u(g) ? (f(), v(b, {
1697
1733
  key: 0,
1698
- "display-item-list": u(m),
1734
+ "display-item-list": u(g),
1699
1735
  "is-compose-mode": e.isComposeMode,
1700
1736
  "is-within-collection": !0,
1701
1737
  "widget-collections": e.widgetCollections,
@@ -1705,18 +1741,21 @@ ${i.value}
1705
1741
  "device-display-type": e.deviceDisplayType,
1706
1742
  "component-props": e.componentProps,
1707
1743
  mounts: e.mounts,
1708
- "ancestor-column-ids": c(m.id)
1709
- }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : (f(), C(Me, {
1744
+ "placeholder-values": e.placeholderValues,
1745
+ "ancestor-column-ids": a(g.id)
1746
+ }, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])) : (f(), v(Je, {
1710
1747
  key: 1,
1711
- "component-type": m.type,
1712
- "library-id": m.libraryId,
1713
- "component-attributes": l(m).componentAttributes,
1748
+ "component-type": g.type,
1749
+ "library-id": g.libraryId,
1750
+ "component-attributes": r(g).componentAttributes,
1714
1751
  components: n(),
1715
- "style-props": l(m).styleProps,
1716
- "widget-instance-props": a(m.id),
1752
+ "style-props": r(g).styleProps,
1753
+ "widget-instance-props": m(g.id),
1754
+ "page-view-type": c(),
1755
+ "column-path": p(g.id),
1717
1756
  mounts: e.mounts
1718
- }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "mounts"]))
1719
- ], 64)) : k("", !0)
1757
+ }, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "page-view-type", "column-path", "mounts"]))
1758
+ ], 64)) : T("", !0)
1720
1759
  ], 64))), 128))
1721
1760
  ]),
1722
1761
  _: 2
@@ -1726,7 +1765,7 @@ ${i.value}
1726
1765
  }, 8, ["display-item-list", "is-compose-mode", "show-drop-containers", "is-within-collection", "device-display-type"]));
1727
1766
  };
1728
1767
  }
1729
- }), ue = /* @__PURE__ */ A({
1768
+ }), ke = /* @__PURE__ */ S({
1730
1769
  __name: "RenderComponentsForDevice",
1731
1770
  props: {
1732
1771
  displayItemList: {},
@@ -1739,12 +1778,13 @@ ${i.value}
1739
1778
  plugins: {},
1740
1779
  componentProps: {},
1741
1780
  mounts: {},
1781
+ placeholderValues: {},
1742
1782
  ancestorColumnIds: {}
1743
1783
  },
1744
1784
  setup(e) {
1745
1785
  return (t, n) => {
1746
1786
  var o, s;
1747
- return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (f(), C(Zo, {
1787
+ return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (f(), v(vs, {
1748
1788
  key: 0,
1749
1789
  "display-item-list": e.displayItemList,
1750
1790
  "is-compose-mode": e.isComposeMode,
@@ -1756,27 +1796,28 @@ ${i.value}
1756
1796
  "device-display-type": e.deviceDisplayType,
1757
1797
  "component-props": e.componentProps,
1758
1798
  mounts: e.mounts,
1799
+ "placeholder-values": e.placeholderValues,
1759
1800
  "ancestor-column-ids": e.ancestorColumnIds
1760
- }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : k("", !0);
1801
+ }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "placeholder-values", "ancestor-column-ids"])) : T("", !0);
1761
1802
  };
1762
1803
  }
1763
- }), rt = /* @__PURE__ */ A({
1804
+ }), St = /* @__PURE__ */ S({
1764
1805
  __name: "LibraryStylesheets",
1765
1806
  props: {
1766
1807
  stylesheets: {}
1767
1808
  },
1768
1809
  setup(e) {
1769
- return (t, n) => (f(!0), b(E, null, F(e.stylesheets ?? [], (o) => (f(), C(P("style"), {
1770
- key: o,
1810
+ return (t, n) => (f(!0), w(k, null, G(e.stylesheets ?? [], (o, s) => (f(), v(x("style"), {
1811
+ key: s,
1771
1812
  "data-rulecms-library-stylesheet": ""
1772
1813
  }, {
1773
- default: T(() => [
1774
- R(L(o), 1)
1814
+ default: P(() => [
1815
+ j(M(o), 1)
1775
1816
  ]),
1776
1817
  _: 2
1777
1818
  }, 1024))), 128));
1778
1819
  }
1779
- }), qo = /* @__PURE__ */ A({
1820
+ }), As = /* @__PURE__ */ S({
1780
1821
  __name: "BreakpointVariantRender",
1781
1822
  props: {
1782
1823
  displayItemList: {},
@@ -1784,32 +1825,33 @@ ${i.value}
1784
1825
  plugins: {},
1785
1826
  componentProps: {},
1786
1827
  mounts: {},
1828
+ placeholderValues: {},
1787
1829
  scopeIdInput: {}
1788
1830
  },
1789
1831
  setup(e) {
1790
1832
  const t = ["Phone", "Tablet", "Desktop"];
1791
1833
  let n = 0;
1792
- const o = e, s = `rulecms-bp-${++n}`, i = g(() => o.scopeIdInput ?? s), r = g(
1793
- () => No(o.displayItemList, o.widgetCollections)
1794
- ), l = g(() => Fo(i.value));
1795
- return (u, c) => {
1796
- var a;
1797
- return f(), b(E, null, [
1798
- $(rt, {
1799
- stylesheets: (a = e.plugins.sourceComponents) == null ? void 0 : a.stylesheets
1834
+ const o = e, s = `rulecms-bp-${++n}`, i = y(() => o.scopeIdInput ?? s), l = y(
1835
+ () => cs(o.displayItemList, o.widgetCollections)
1836
+ ), r = y(() => ds(i.value));
1837
+ return (u, a) => {
1838
+ var c;
1839
+ return f(), w(k, null, [
1840
+ R(St, {
1841
+ stylesheets: (c = e.plugins.sourceComponents) == null ? void 0 : c.stylesheets
1800
1842
  }, null, 8, ["stylesheets"]),
1801
- r.value ? (f(), b(E, { key: 1 }, [
1802
- (f(), C(P("style"), null, {
1803
- default: T(() => [
1804
- R(L(l.value), 1)
1843
+ l.value ? (f(), w(k, { key: 1 }, [
1844
+ (f(), v(x("style"), null, {
1845
+ default: P(() => [
1846
+ j(M(r.value), 1)
1805
1847
  ]),
1806
1848
  _: 1
1807
1849
  })),
1808
- (f(), b(E, null, F(t, (p) => V("div", {
1850
+ (f(), w(k, null, G(t, (p) => z("div", {
1809
1851
  key: p,
1810
- class: G(`${i.value}-${p.toLowerCase()}`)
1852
+ class: ie(`${i.value}-${p.toLowerCase()}`)
1811
1853
  }, [
1812
- $(ue, {
1854
+ R(ke, {
1813
1855
  "display-item-list": e.displayItemList,
1814
1856
  "is-compose-mode": !1,
1815
1857
  "is-within-collection": !1,
@@ -1819,10 +1861,11 @@ ${i.value}
1819
1861
  "device-display-type": p,
1820
1862
  plugins: e.plugins,
1821
1863
  "component-props": e.componentProps,
1822
- mounts: e.mounts
1823
- }, null, 8, ["display-item-list", "widget-collections", "device-display-type", "plugins", "component-props", "mounts"])
1864
+ mounts: e.mounts,
1865
+ "placeholder-values": e.placeholderValues
1866
+ }, null, 8, ["display-item-list", "widget-collections", "device-display-type", "plugins", "component-props", "mounts", "placeholder-values"])
1824
1867
  ], 2)), 64))
1825
- ], 64)) : (f(), C(ue, {
1868
+ ], 64)) : (f(), v(ke, {
1826
1869
  key: 0,
1827
1870
  "display-item-list": e.displayItemList,
1828
1871
  "is-compose-mode": !1,
@@ -1833,13 +1876,14 @@ ${i.value}
1833
1876
  "device-display-type": "Desktop",
1834
1877
  plugins: e.plugins,
1835
1878
  "component-props": e.componentProps,
1836
- mounts: e.mounts
1837
- }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"]))
1879
+ mounts: e.mounts,
1880
+ "placeholder-values": e.placeholderValues
1881
+ }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts", "placeholder-values"]))
1838
1882
  ], 64);
1839
1883
  };
1840
1884
  }
1841
1885
  });
1842
- function Qo(e, t, n) {
1886
+ function Es(e, t, n) {
1843
1887
  if (e)
1844
1888
  return "Phone";
1845
1889
  if (t)
@@ -1847,7 +1891,7 @@ function Qo(e, t, n) {
1847
1891
  const o = (n == null ? void 0 : n.toLowerCase()) || "desktop";
1848
1892
  return o === "phone" ? "Phone" : o === "tablet" ? "Tablet" : "Desktop";
1849
1893
  }
1850
- const es = `(max-width: ${Ze})`, ts = `(max-width: ${qe})`, ns = /* @__PURE__ */ A({
1894
+ const Ss = `(max-width: ${mt})`, ks = `(max-width: ${ht})`, Ts = /* @__PURE__ */ S({
1851
1895
  __name: "RenderComponents",
1852
1896
  props: {
1853
1897
  displayItemList: {},
@@ -1858,30 +1902,31 @@ const es = `(max-width: ${Ze})`, ts = `(max-width: ${qe})`, ns = /* @__PURE__ */
1858
1902
  reduxDeviceDisplayType: {},
1859
1903
  plugins: {},
1860
1904
  componentProps: {},
1861
- mounts: {}
1905
+ mounts: {},
1906
+ placeholderValues: {}
1862
1907
  },
1863
1908
  setup(e) {
1864
- const t = e, n = Y("Desktop");
1909
+ const t = e, n = H("Desktop");
1865
1910
  let o, s;
1866
1911
  function i() {
1867
- n.value = Qo(
1912
+ n.value = Es(
1868
1913
  (o == null ? void 0 : o.matches) ?? !1,
1869
1914
  (s == null ? void 0 : s.matches) ?? !1,
1870
1915
  t.reduxDeviceDisplayType
1871
1916
  );
1872
1917
  }
1873
- return Lt(() => {
1874
- typeof matchMedia == "function" && (o = matchMedia(es), s = matchMedia(ts), o.addEventListener("change", i), s.addEventListener("change", i)), i();
1875
- }), Ke(() => {
1918
+ return en(() => {
1919
+ typeof matchMedia == "function" && (o = matchMedia(Ss), s = matchMedia(ks), o.addEventListener("change", i), s.addEventListener("change", i)), i();
1920
+ }), it(() => {
1876
1921
  o == null || o.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
1877
- }), (r, l) => {
1922
+ }), (l, r) => {
1878
1923
  var u;
1879
- return f(), b(E, null, [
1880
- e.isWithinCollection ? k("", !0) : (f(), C(rt, {
1924
+ return f(), w(k, null, [
1925
+ e.isWithinCollection ? T("", !0) : (f(), v(St, {
1881
1926
  key: 0,
1882
1927
  stylesheets: (u = e.plugins.sourceComponents) == null ? void 0 : u.stylesheets
1883
1928
  }, null, 8, ["stylesheets"])),
1884
- $(ue, {
1929
+ R(ke, {
1885
1930
  "display-item-list": e.displayItemList,
1886
1931
  "is-compose-mode": e.isComposeMode,
1887
1932
  "is-within-collection": e.isWithinCollection,
@@ -1891,20 +1936,21 @@ const es = `(max-width: ${Ze})`, ts = `(max-width: ${qe})`, ns = /* @__PURE__ */
1891
1936
  "device-display-type": n.value,
1892
1937
  plugins: e.plugins,
1893
1938
  "component-props": e.componentProps,
1894
- mounts: e.mounts
1895
- }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "device-display-type", "plugins", "component-props", "mounts"])
1939
+ mounts: e.mounts,
1940
+ "placeholder-values": e.placeholderValues
1941
+ }, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "device-display-type", "plugins", "component-props", "mounts", "placeholder-values"])
1896
1942
  ], 64);
1897
1943
  };
1898
1944
  }
1899
1945
  });
1900
- function lt(e) {
1946
+ function kt(e) {
1901
1947
  return e !== !1;
1902
1948
  }
1903
- const os = ["utilities", "components"], ss = new Set(os), ct = (e) => typeof e == "string" && ss.has(e), is = (e) => e.split(`
1949
+ const Is = ["utilities", "components"], Ps = new Set(Is), Tt = (e) => typeof e == "string" && Ps.has(e), Ds = (e) => e.split(`
1904
1950
  `).map((t) => t.length > 0 ? ` ${t}` : t).join(`
1905
- `), rs = (e, t) => e ? ct(t) ? `@layer ${t} {
1906
- ${is(e)}
1907
- }` : e : null, ls = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), cs = (e) => e.replace(/[^A-Za-z0-9_-]/g, (t) => `\\${t}`), as = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], us = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, ds = /[\s{};"]/, ps = /^[A-Za-z0-9_:%./[\]%-]+$/, fs = (e) => {
1951
+ `), xs = (e, t) => e ? Tt(t) ? `@layer ${t} {
1952
+ ${Ds(e)}
1953
+ }` : e : null, $s = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Ls = (e) => e.replace(/[^A-Za-z0-9_-]/g, (t) => `\\${t}`), Rs = ["</", "<script", "@import", "javascript:", "vbscript:", "expression("], _s = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Os = /[\s{};"]/, Ms = /^[A-Za-z0-9_:%./[\]%-]+$/, js = (e) => {
1908
1954
  let t = 0;
1909
1955
  for (const n of e)
1910
1956
  if (n === "{")
@@ -1912,43 +1958,43 @@ ${is(e)}
1912
1958
  else if (n === "}" && (t -= 1, t < 0))
1913
1959
  return !1;
1914
1960
  return t === 0;
1915
- }, ys = (e) => {
1961
+ }, Ns = (e) => {
1916
1962
  const t = e.startsWith(".") ? e.slice(1) : e;
1917
- return !t || t.length > 200 || t.startsWith(".") || ds.test(t) ? !1 : ps.test(t);
1918
- }, ms = (e) => {
1963
+ return !t || t.length > 200 || t.startsWith(".") || Os.test(t) ? !1 : Ms.test(t);
1964
+ }, Ws = (e) => {
1919
1965
  const t = e.trim();
1920
- if (!t || t.length > 4e3 || us.test(t) || !fs(t))
1966
+ if (!t || t.length > 4e3 || _s.test(t) || !js(t))
1921
1967
  return !1;
1922
1968
  const n = t.toLowerCase();
1923
- return !as.some((o) => n.includes(o));
1924
- }, hs = (e) => {
1969
+ return !Rs.some((o) => n.includes(o));
1970
+ }, Vs = (e) => {
1925
1971
  if (!e)
1926
1972
  return {};
1927
1973
  const t = {};
1928
1974
  for (const [n, o] of Object.entries(e)) {
1929
1975
  const s = n.startsWith(".") ? n.slice(1) : n.trim();
1930
- if (!ys(s) || typeof o != "string")
1976
+ if (!Ns(s) || typeof o != "string")
1931
1977
  continue;
1932
1978
  const i = o.trim();
1933
- ms(i) && (t[s] = i);
1979
+ Ws(i) && (t[s] = i);
1934
1980
  }
1935
1981
  return t;
1936
- }, gs = (e) => e.split(`
1982
+ }, Fs = (e) => e.split(`
1937
1983
  `).map((t) => ` ${t}`).join(`
1938
- `), bs = (e, t, n, o) => {
1939
- if (!lt(n))
1984
+ `), Bs = (e, t, n, o) => {
1985
+ if (!kt(n))
1940
1986
  return null;
1941
- const s = hs(t), i = Object.keys(s);
1987
+ const s = Vs(t), i = Object.keys(s);
1942
1988
  if (i.length === 0 || !e)
1943
1989
  return null;
1944
- const r = `[data-rulecms-published-key="${ls(e)}"]`, l = i.sort((u, c) => u.localeCompare(c)).map(
1945
- (u) => `${r} .${cs(u)} {
1946
- ${gs(s[u])}
1990
+ const l = `[data-rulecms-published-key="${$s(e)}"]`, r = i.sort((u, a) => u.localeCompare(a)).map(
1991
+ (u) => `${l} .${Ls(u)} {
1992
+ ${Fs(s[u])}
1947
1993
  }`
1948
1994
  ).join(`
1949
1995
  `);
1950
- return rs(l, o);
1951
- }, Cs = /* @__PURE__ */ A({
1996
+ return xs(r, o);
1997
+ }, Ks = /* @__PURE__ */ S({
1952
1998
  __name: "ProjectCssClassesStylesheet",
1953
1999
  props: {
1954
2000
  publishedKey: {},
@@ -1956,29 +2002,29 @@ ${gs(s[u])}
1956
2002
  classLayer: {}
1957
2003
  },
1958
2004
  setup(e) {
1959
- const t = e, n = g(
1960
- () => bs(
2005
+ const t = e, n = y(
2006
+ () => Bs(
1961
2007
  t.publishedKey,
1962
2008
  t.classes,
1963
2009
  void 0,
1964
2010
  t.classLayer
1965
2011
  )
1966
2012
  );
1967
- return (o, s) => n.value ? (f(), C(P("style"), {
2013
+ return (o, s) => n.value ? (f(), v(x("style"), {
1968
2014
  key: 0,
1969
2015
  "data-rulecms-project-class-definitions": ""
1970
2016
  }, {
1971
- default: T(() => [
1972
- R(L(n.value), 1)
2017
+ default: P(() => [
2018
+ j(M(n.value), 1)
1973
2019
  ]),
1974
2020
  _: 1
1975
- })) : k("", !0);
2021
+ })) : T("", !0);
1976
2022
  }
1977
2023
  });
1978
- function Se(e) {
2024
+ function je(e) {
1979
2025
  return e !== !1;
1980
2026
  }
1981
- const at = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), ws = /* @__PURE__ */ new Set([
2027
+ const It = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), Us = /* @__PURE__ */ new Set([
1982
2028
  "serif",
1983
2029
  "sans-serif",
1984
2030
  "monospace",
@@ -1992,84 +2038,84 @@ const at = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), ws = /* @__PURE
1992
2038
  "emoji",
1993
2039
  "math",
1994
2040
  "fangsong"
1995
- ]), vs = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, As = /url\(|@|[{};\\<>]|javascript:/i, Ss = /url\(|@|[{};\\<>]|javascript:|expression\(/i, Es = /^--[A-Za-z_][\w-]*$/, ks = /^[A-Za-z0-9 ]+$/, Ts = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), Is = 4, Ps = 8, Ds = 255, de = (e) => ws.has(e.toLowerCase()) || vs.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, Ne = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !As.test(e), $s = (e) => typeof e == "string" && Es.test(e.trim()) && e.trim().length <= 80, Ls = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Ss.test(e), xs = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > Ds ? null : e, Rs = (e, t, n) => {
2041
+ ]), zs = /^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/, Hs = /url\(|@|[{};\\<>]|javascript:/i, Gs = /url\(|@|[{};\\<>]|javascript:|expression\(/i, Ys = /^--[A-Za-z_][\w-]*$/, Xs = /^[A-Za-z0-9 ]+$/, Js = /* @__PURE__ */ new Set([100, 200, 300, 400, 500, 600, 700, 800, 900]), qs = 4, Zs = 8, Qs = 255, Te = (e) => Us.has(e.toLowerCase()) || zs.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, qe = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 80 && !e.includes(",") && !Hs.test(e), ei = (e) => typeof e == "string" && Ys.test(e.trim()) && e.trim().length <= 80, ti = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Gs.test(e), ni = (e) => typeof e != "number" || !Number.isInteger(e) || e < 0 || e > Qs ? null : e, oi = (e, t, n) => {
1996
2042
  if (!Array.isArray(e))
1997
2043
  return [];
1998
2044
  const o = [];
1999
2045
  for (const s of e) {
2000
- if (!s || typeof s != "object" || o.length >= Is)
2046
+ if (!s || typeof s != "object" || o.length >= qs)
2001
2047
  continue;
2002
2048
  const i = s;
2003
- if (!$s(i.name))
2049
+ if (!ei(i.name))
2004
2050
  continue;
2005
- const r = i.name.trim();
2006
- if (t.has(r))
2051
+ const l = i.name.trim();
2052
+ if (t.has(l))
2007
2053
  continue;
2008
- const l = [], u = /* @__PURE__ */ new Set();
2009
- for (const a of i.overrideColors ?? []) {
2010
- if (l.length >= Ps)
2054
+ const r = [], u = /* @__PURE__ */ new Set();
2055
+ for (const c of i.overrideColors ?? []) {
2056
+ if (r.length >= Zs)
2011
2057
  break;
2012
- const p = xs(a == null ? void 0 : a.index);
2013
- p === null || u.has(p) || !Ls(a == null ? void 0 : a.color) || (u.add(p), l.push({ index: p, color: a.color.trim() }));
2058
+ const p = ni(c == null ? void 0 : c.index);
2059
+ p === null || u.has(p) || !ti(c == null ? void 0 : c.color) || (u.add(p), r.push({ index: p, color: c.color.trim() }));
2014
2060
  }
2015
- l.sort((a, p) => a.index - p.index);
2016
- const c = i.applyToWidget === !0 && !n.current;
2017
- c && (n.current = !0), t.add(r), o.push({
2018
- name: r,
2019
- ...l.length > 0 ? { overrideColors: l } : {},
2020
- ...c ? { applyToWidget: !0 } : {}
2061
+ r.sort((c, p) => c.index - p.index);
2062
+ const a = i.applyToWidget === !0 && !n.current;
2063
+ a && (n.current = !0), t.add(l), o.push({
2064
+ name: l,
2065
+ ...r.length > 0 ? { overrideColors: r } : {},
2066
+ ...a ? { applyToWidget: !0 } : {}
2021
2067
  });
2022
2068
  }
2023
2069
  return o;
2024
- }, ne = (e) => {
2025
- var r;
2070
+ }, ye = (e) => {
2071
+ var l;
2026
2072
  if (!Array.isArray(e))
2027
2073
  return [];
2028
2074
  const t = [], n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = { current: !1 };
2029
2075
  let i = !1;
2030
- for (const l of e) {
2031
- if (!l || !Ne(l.family))
2076
+ for (const r of e) {
2077
+ if (!r || !qe(r.family))
2032
2078
  continue;
2033
- const u = l.family.trim(), c = u.toLowerCase();
2034
- if (n.has(c) || t.length >= 12)
2079
+ const u = r.family.trim(), a = u.toLowerCase();
2080
+ if (n.has(a) || t.length >= 12)
2035
2081
  continue;
2036
- const a = (l.fallbacks ?? []).filter(Ne).slice(0, 8), p = typeof l.cssVariable == "string" && U(l.cssVariable.trim()) ? l.cssVariable.trim() : void 0;
2037
- let y = { kind: "stack-only" };
2038
- if (((r = l.source) == null ? void 0 : r.kind) === "google") {
2039
- if (!ks.test(u))
2082
+ const c = (r.fallbacks ?? []).filter(qe).slice(0, 8), p = typeof r.cssVariable == "string" && Q(r.cssVariable.trim()) ? r.cssVariable.trim() : void 0;
2083
+ let m = { kind: "stack-only" };
2084
+ if (((l = r.source) == null ? void 0 : l.kind) === "google") {
2085
+ if (!Xs.test(u))
2040
2086
  continue;
2041
- const S = (Array.isArray(l.source.weights) ? l.source.weights : []).filter((w) => typeof w == "number" && Ts.has(w)).filter((w, D, O) => O.indexOf(w) === D).sort((w, D) => w - D);
2042
- if (S.length === 0)
2087
+ const C = (Array.isArray(r.source.weights) ? r.source.weights : []).filter((g) => typeof g == "number" && Js.has(g)).filter((g, ee, me) => me.indexOf(g) === ee).sort((g, ee) => g - ee);
2088
+ if (C.length === 0)
2043
2089
  continue;
2044
- y = { kind: "google", weights: S };
2090
+ m = { kind: "google", weights: C };
2045
2091
  }
2046
- n.add(c);
2047
- const d = l.applyToWidget === !0 && !i;
2092
+ n.add(a);
2093
+ const d = r.applyToWidget === !0 && !i;
2048
2094
  d && (i = !0);
2049
- const h = Rs(l.palettes, o, s);
2095
+ const h = oi(r.palettes, o, s);
2050
2096
  t.push({
2051
2097
  family: u,
2052
2098
  ...p ? { cssVariable: p } : {},
2053
- fallbacks: a,
2099
+ fallbacks: c,
2054
2100
  applyToWidget: d,
2055
- source: y,
2101
+ source: m,
2056
2102
  ...h.length > 0 ? { palettes: h } : {}
2057
2103
  });
2058
2104
  }
2059
2105
  return t;
2060
- }, Os = (e) => {
2061
- const t = ne(e).filter((n) => n.source.kind === "google").map((n) => {
2106
+ }, si = (e) => {
2107
+ const t = ye(e).filter((n) => n.source.kind === "google").map((n) => {
2062
2108
  const o = n.source.kind === "google" ? n.source.weights.join(";") : "400";
2063
2109
  return `family=${n.family.replace(/ /g, "+")}:wght@${o}`;
2064
2110
  });
2065
2111
  return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`;
2066
- }, _s = (e) => [de(e.family), ...(e.fallbacks ?? []).map(de)].join(", "), js = (e) => {
2112
+ }, ii = (e) => [Te(e.family), ...(e.fallbacks ?? []).map(Te)].join(", "), ri = (e) => {
2067
2113
  const t = [];
2068
2114
  for (const n of e)
2069
2115
  for (const o of n.palettes ?? []) {
2070
- const s = [` font-family: ${de(n.family)};`];
2116
+ const s = [` font-family: ${Te(n.family)};`];
2071
2117
  if (o.overrideColors && o.overrideColors.length > 0) {
2072
- const i = o.overrideColors.map((r) => `${r.index} ${r.color}`).join(", ");
2118
+ const i = o.overrideColors.map((l) => `${l.index} ${l.color}`).join(", ");
2073
2119
  s.push(` override-colors: ${i};`);
2074
2120
  }
2075
2121
  t.push(`@font-palette-values ${o.name} {
@@ -2080,31 +2126,31 @@ ${s.join(`
2080
2126
  return t.length > 0 ? t.join(`
2081
2127
 
2082
2128
  `) : null;
2083
- }, Ms = (e) => {
2129
+ }, li = (e) => {
2084
2130
  for (const t of e)
2085
2131
  for (const n of t.palettes ?? [])
2086
2132
  if (n.applyToWidget)
2087
2133
  return n.name;
2088
- }, Ns = (e, t, n) => {
2089
- if (!Se(n) || !e)
2134
+ }, ci = (e, t, n) => {
2135
+ if (!je(n) || !e)
2090
2136
  return null;
2091
- const o = ne(t), s = [];
2092
- for (const c of o) {
2093
- const a = _s(c);
2094
- c.cssVariable && s.push(` ${c.cssVariable}: ${a};`), c.applyToWidget && s.push(
2095
- ` font-family: ${c.cssVariable ? `var(${c.cssVariable})` : a};`
2137
+ const o = ye(t), s = [];
2138
+ for (const a of o) {
2139
+ const c = ii(a);
2140
+ a.cssVariable && s.push(` ${a.cssVariable}: ${c};`), a.applyToWidget && s.push(
2141
+ ` font-family: ${a.cssVariable ? `var(${a.cssVariable})` : c};`
2096
2142
  );
2097
2143
  }
2098
- const i = Ms(o);
2144
+ const i = li(o);
2099
2145
  i && s.push(` font-palette: ${i};`);
2100
- const r = js(o), l = `[data-rulecms-published-key="${at(e)}"] > *`, u = s.length > 0 ? `${l} {
2146
+ const l = ri(o), r = `[data-rulecms-published-key="${It(e)}"] > *`, u = s.length > 0 ? `${r} {
2101
2147
  ${s.join(`
2102
2148
  `)}
2103
2149
  }` : null;
2104
- return !r && !u ? null : r ? u ? `${r}
2150
+ return !l && !u ? null : l ? u ? `${l}
2105
2151
 
2106
- ${u}` : r : u;
2107
- }, Ws = ["href"], Vs = /* @__PURE__ */ A({
2152
+ ${u}` : l : u;
2153
+ }, ai = ["href"], ui = /* @__PURE__ */ S({
2108
2154
  __name: "ProjectCssFontsStylesheet",
2109
2155
  props: {
2110
2156
  publishedKey: {},
@@ -2112,34 +2158,34 @@ ${u}` : r : u;
2112
2158
  includeFontFaces: { type: [Boolean, null] }
2113
2159
  },
2114
2160
  setup(e) {
2115
- const t = e, n = g(() => ne(t.fonts)), o = g(
2116
- () => Se(t.includeFontFaces) ? Os(n.value) : null
2117
- ), s = g(
2118
- () => Ns(t.publishedKey, n.value, t.includeFontFaces)
2161
+ const t = e, n = y(() => ye(t.fonts)), o = y(
2162
+ () => je(t.includeFontFaces) ? si(n.value) : null
2163
+ ), s = y(
2164
+ () => ci(t.publishedKey, n.value, t.includeFontFaces)
2119
2165
  );
2120
- return (i, r) => (f(), b(E, null, [
2121
- o.value ? (f(), b("link", {
2166
+ return (i, l) => (f(), w(k, null, [
2167
+ o.value ? (f(), w("link", {
2122
2168
  key: 0,
2123
2169
  rel: "stylesheet",
2124
2170
  href: o.value,
2125
2171
  "data-rulecms-project-fonts": ""
2126
- }, null, 8, Ws)) : k("", !0),
2127
- s.value ? (f(), C(P("style"), {
2172
+ }, null, 8, ai)) : T("", !0),
2173
+ s.value ? (f(), v(x("style"), {
2128
2174
  key: 1,
2129
2175
  "data-rulecms-project-fonts": ""
2130
2176
  }, {
2131
- default: T(() => [
2132
- R(L(s.value), 1)
2177
+ default: P(() => [
2178
+ j(M(s.value), 1)
2133
2179
  ]),
2134
2180
  _: 1
2135
- })) : k("", !0)
2181
+ })) : T("", !0)
2136
2182
  ], 64));
2137
2183
  }
2138
2184
  });
2139
- function ut(e) {
2185
+ function Pt(e) {
2140
2186
  return e !== !1;
2141
2187
  }
2142
- const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2188
+ const di = 80, pi = 4e3, fi = 32, Dt = [
2143
2189
  "url(",
2144
2190
  "@import",
2145
2191
  "@font-face",
@@ -2150,7 +2196,7 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2150
2196
  "javascript:",
2151
2197
  "expression(",
2152
2198
  "behavior:"
2153
- ], zs = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Hs = /^[A-Za-z_][\w-]*$/, Us = (e) => {
2199
+ ], yi = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, mi = /^[A-Za-z_][\w-]*$/, hi = (e) => {
2154
2200
  let t = 0;
2155
2201
  for (const n of e)
2156
2202
  if (n === "{")
@@ -2158,12 +2204,12 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2158
2204
  else if (n === "}" && (t -= 1, t < 0))
2159
2205
  return !1;
2160
2206
  return t === 0;
2161
- }, Ys = (e) => {
2162
- if (!e || e.length > Fs || e.includes("@") || e.includes(".") || /\s/.test(e))
2207
+ }, gi = (e) => {
2208
+ if (!e || e.length > di || e.includes("@") || e.includes(".") || /\s/.test(e))
2163
2209
  return !1;
2164
2210
  const t = e.toLowerCase();
2165
- return dt.some((n) => t.includes(n)) ? !1 : Hs.test(e);
2166
- }, Gs = (e) => {
2211
+ return Dt.some((n) => t.includes(n)) ? !1 : mi.test(e);
2212
+ }, bi = (e) => {
2167
2213
  const t = e.trim();
2168
2214
  if (t === "")
2169
2215
  return !1;
@@ -2175,7 +2221,7 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2175
2221
  return !1;
2176
2222
  const s = Number(o[1]);
2177
2223
  return s >= 0 && s <= 100;
2178
- }, Xs = (e) => {
2224
+ }, Ci = (e) => {
2179
2225
  let t = 0;
2180
2226
  const n = e.length;
2181
2227
  let o = 0;
@@ -2185,137 +2231,137 @@ const Fs = 80, Bs = 4e3, Ks = 32, dt = [
2185
2231
  };
2186
2232
  for (s(); t < n; ) {
2187
2233
  const i = e.indexOf("{", t);
2188
- if (i === -1 || !e.slice(t, i).trim().split(",").every((c) => Gs(c)))
2234
+ if (i === -1 || !e.slice(t, i).trim().split(",").every((a) => bi(a)))
2189
2235
  return !1;
2190
2236
  t = i + 1;
2191
- const l = e.indexOf("}", t);
2192
- if (l === -1)
2237
+ const r = e.indexOf("}", t);
2238
+ if (r === -1)
2193
2239
  return !1;
2194
- const u = e.slice(t, l);
2240
+ const u = e.slice(t, r);
2195
2241
  if (u.includes("{") || u.includes("}") || u.includes("@"))
2196
2242
  return !1;
2197
- t = l + 1, o += 1, s();
2243
+ t = r + 1, o += 1, s();
2198
2244
  }
2199
2245
  return o > 0;
2200
- }, Js = (e) => {
2246
+ }, wi = (e) => {
2201
2247
  const t = e.trim();
2202
- if (!t || t.length > Bs || zs.test(t) || !Us(t))
2248
+ if (!t || t.length > pi || yi.test(t) || !hi(t))
2203
2249
  return !1;
2204
2250
  const n = t.toLowerCase();
2205
- return dt.some((o) => n.includes(o)) || t.includes("@") ? !1 : Xs(t);
2206
- }, pt = (e) => {
2251
+ return Dt.some((o) => n.includes(o)) || t.includes("@") ? !1 : Ci(t);
2252
+ }, xt = (e) => {
2207
2253
  if (!e)
2208
2254
  return {};
2209
2255
  const t = {};
2210
2256
  for (const [n, o] of Object.entries(e)) {
2211
2257
  const s = n.trim();
2212
- if (!Ys(s) || t[s] !== void 0 || typeof o != "string")
2258
+ if (!gi(s) || t[s] !== void 0 || typeof o != "string")
2213
2259
  continue;
2214
2260
  const i = o.trim();
2215
- if (Js(i) && (t[s] = i, Object.keys(t).length === Ks))
2261
+ if (wi(i) && (t[s] = i, Object.keys(t).length === fi))
2216
2262
  break;
2217
2263
  }
2218
2264
  return Object.fromEntries(
2219
2265
  Object.entries(t).sort(([n], [o]) => n.localeCompare(o))
2220
2266
  );
2221
- }, Zs = (e) => e.split(`
2267
+ }, vi = (e) => e.split(`
2222
2268
  `).map((t) => ` ${t}`).join(`
2223
- `), qs = (e, t, n) => {
2224
- if (!ut(n))
2269
+ `), Ai = (e, t, n) => {
2270
+ if (!Pt(n))
2225
2271
  return null;
2226
- const o = pt(t), s = Object.keys(o);
2272
+ const o = xt(t), s = Object.keys(o);
2227
2273
  return s.length === 0 ? null : s.map((i) => `@keyframes ${i} {
2228
- ${Zs(o[i])}
2274
+ ${vi(o[i])}
2229
2275
  }`).join(`
2230
2276
 
2231
2277
  `);
2232
- }, Qs = /* @__PURE__ */ A({
2278
+ }, Ei = /* @__PURE__ */ S({
2233
2279
  __name: "ProjectCssKeyframesStylesheet",
2234
2280
  props: {
2235
2281
  publishedKey: {},
2236
2282
  keyframes: {}
2237
2283
  },
2238
2284
  setup(e) {
2239
- const t = e, n = g(
2240
- () => qs(t.publishedKey, t.keyframes)
2285
+ const t = e, n = y(
2286
+ () => Ai(t.publishedKey, t.keyframes)
2241
2287
  );
2242
- return (o, s) => n.value ? (f(), C(P("style"), {
2288
+ return (o, s) => n.value ? (f(), v(x("style"), {
2243
2289
  key: 0,
2244
2290
  "data-rulecms-project-keyframes": ""
2245
2291
  }, {
2246
- default: T(() => [
2247
- R(L(n.value), 1)
2292
+ default: P(() => [
2293
+ j(M(n.value), 1)
2248
2294
  ]),
2249
2295
  _: 1
2250
- })) : k("", !0);
2296
+ })) : T("", !0);
2251
2297
  }
2252
- }), ft = (e) => e !== !1, ei = 80, ti = 2e3, ni = 16, yt = ["url(", "@", "</", "<script", "javascript:", "expression("], oi = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, si = /^--[A-Za-z_][\w-]*$/, ii = (e) => {
2298
+ }), $t = (e) => e !== !1, Si = 80, ki = 2e3, Ti = 16, Lt = ["url(", "@", "</", "<script", "javascript:", "expression("], Ii = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/, Pi = /^--[A-Za-z_][\w-]*$/, Di = (e) => {
2253
2299
  for (const t of e)
2254
2300
  if (t === "{" || t === "}")
2255
2301
  return !1;
2256
2302
  return !0;
2257
- }, ri = (e) => {
2258
- if (!e || e.length > ei || e.includes("@") || e.includes(".") || /\s/.test(e))
2303
+ }, xi = (e) => {
2304
+ if (!e || e.length > Si || e.includes("@") || e.includes(".") || /\s/.test(e))
2259
2305
  return !1;
2260
2306
  const t = e.toLowerCase();
2261
- return yt.some((n) => t.includes(n)) ? !1 : si.test(e);
2262
- }, li = (e) => {
2307
+ return Lt.some((n) => t.includes(n)) ? !1 : Pi.test(e);
2308
+ }, $i = (e) => {
2263
2309
  const t = e.trim();
2264
- if (!t || t.length > ti || oi.test(t) || !ii(t))
2310
+ if (!t || t.length > ki || Ii.test(t) || !Di(t))
2265
2311
  return !1;
2266
2312
  const n = t.toLowerCase();
2267
- return !yt.some((o) => n.includes(o));
2268
- }, mt = (e) => {
2313
+ return !Lt.some((o) => n.includes(o));
2314
+ }, Rt = (e) => {
2269
2315
  if (!e)
2270
2316
  return {};
2271
2317
  const t = {};
2272
2318
  for (const [n, o] of Object.entries(e)) {
2273
2319
  const s = n.trim();
2274
- if (!ri(s) || t[s] !== void 0 || typeof o != "string")
2320
+ if (!xi(s) || t[s] !== void 0 || typeof o != "string")
2275
2321
  continue;
2276
2322
  const i = o.trim();
2277
- if (li(i) && (t[s] = i, Object.keys(t).length === ni))
2323
+ if ($i(i) && (t[s] = i, Object.keys(t).length === Ti))
2278
2324
  break;
2279
2325
  }
2280
2326
  return Object.fromEntries(
2281
2327
  Object.entries(t).sort(([n], [o]) => n.localeCompare(o))
2282
2328
  );
2283
- }, ci = (e) => e.split(`
2329
+ }, Li = (e) => e.split(`
2284
2330
  `).map((t) => ` ${t}`).join(`
2285
- `), ai = (e, t, n) => {
2286
- if (!ft(n))
2331
+ `), Ri = (e, t, n) => {
2332
+ if (!$t(n))
2287
2333
  return null;
2288
- const o = mt(t), s = Object.keys(o);
2334
+ const o = Rt(t), s = Object.keys(o);
2289
2335
  return s.length === 0 ? null : s.map((i) => `@position-try ${i} {
2290
- ${ci(o[i])}
2336
+ ${Li(o[i])}
2291
2337
  }`).join(`
2292
2338
 
2293
2339
  `);
2294
- }, ui = /* @__PURE__ */ A({
2340
+ }, _i = /* @__PURE__ */ S({
2295
2341
  __name: "ProjectCssPositionTryStylesheet",
2296
2342
  props: {
2297
2343
  publishedKey: {},
2298
2344
  positionTry: {}
2299
2345
  },
2300
2346
  setup(e) {
2301
- const t = e, n = g(
2302
- () => ai(t.publishedKey, t.positionTry)
2347
+ const t = e, n = y(
2348
+ () => Ri(t.publishedKey, t.positionTry)
2303
2349
  );
2304
- return (o, s) => n.value ? (f(), C(P("style"), {
2350
+ return (o, s) => n.value ? (f(), v(x("style"), {
2305
2351
  key: 0,
2306
2352
  "data-rulecms-project-position-try": ""
2307
2353
  }, {
2308
- default: T(() => [
2309
- R(L(n.value), 1)
2354
+ default: P(() => [
2355
+ j(M(n.value), 1)
2310
2356
  ]),
2311
2357
  _: 1
2312
- })) : k("", !0);
2358
+ })) : T("", !0);
2313
2359
  }
2314
2360
  });
2315
- function ht(e) {
2361
+ function _t(e) {
2316
2362
  return e !== !1;
2317
2363
  }
2318
- const di = [
2364
+ const Oi = [
2319
2365
  "*",
2320
2366
  "<number>",
2321
2367
  "<integer>",
@@ -2327,18 +2373,18 @@ const di = [
2327
2373
  "<time>",
2328
2374
  "<transform-function>",
2329
2375
  "<transform-list>"
2330
- ], pi = new Set(di), fi = /[{};]/, yi = 40, mi = 200, hi = (e) => typeof e == "string" && pi.has(e), gi = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > mi || fi.test(e) || e.includes("url(") || e.includes("@")), gt = (e) => {
2376
+ ], Mi = new Set(Oi), ji = /[{};]/, Ni = 40, Wi = 200, Vi = (e) => typeof e == "string" && Mi.has(e), Fi = (e, t) => t !== "*" && e === "" ? !1 : t === "*" && e === "" ? !0 : !(e.length > Wi || ji.test(e) || e.includes("url(") || e.includes("@")), Ot = (e) => {
2331
2377
  if (!Array.isArray(e))
2332
2378
  return [];
2333
2379
  const t = [], n = /* @__PURE__ */ new Set();
2334
2380
  for (const o of e) {
2335
- if (!o || typeof o.name != "string" || !U(o.name.trim()))
2381
+ if (!o || typeof o.name != "string" || !Q(o.name.trim()))
2336
2382
  continue;
2337
2383
  const s = o.name.trim();
2338
- if (n.has(s) || t.length >= yi || !hi(o.syntax) || typeof o.inherits != "boolean")
2384
+ if (n.has(s) || t.length >= Ni || !Vi(o.syntax) || typeof o.inherits != "boolean")
2339
2385
  continue;
2340
2386
  const i = typeof o.initialValue == "string" ? o.initialValue.trim() : "";
2341
- gi(i, o.syntax) && (n.add(s), t.push({
2387
+ Fi(i, o.syntax) && (n.add(s), t.push({
2342
2388
  name: s,
2343
2389
  syntax: o.syntax,
2344
2390
  inherits: o.inherits,
@@ -2346,7 +2392,7 @@ const di = [
2346
2392
  }));
2347
2393
  }
2348
2394
  return t;
2349
- }, bi = (e) => {
2395
+ }, Bi = (e) => {
2350
2396
  const t = [
2351
2397
  `@property ${e.name} {`,
2352
2398
  ` syntax: "${e.syntax}";`,
@@ -2354,311 +2400,400 @@ const di = [
2354
2400
  ];
2355
2401
  return e.initialValue !== "" && t.push(` initial-value: ${e.initialValue};`), t.push("}"), t.join(`
2356
2402
  `);
2357
- }, Ci = (e, t, n) => {
2358
- if (!ht(n))
2403
+ }, Ki = (e, t, n) => {
2404
+ if (!_t(n))
2359
2405
  return null;
2360
- const o = gt(t);
2361
- return o.length === 0 ? null : o.map(bi).join(`
2406
+ const o = Ot(t);
2407
+ return o.length === 0 ? null : o.map(Bi).join(`
2362
2408
 
2363
2409
  `);
2364
- }, wi = /* @__PURE__ */ A({
2410
+ }, Ui = /* @__PURE__ */ S({
2365
2411
  __name: "ProjectCssPropertiesStylesheet",
2366
2412
  props: {
2367
2413
  publishedKey: {},
2368
2414
  cssProperties: {}
2369
2415
  },
2370
2416
  setup(e) {
2371
- const t = e, n = g(
2372
- () => Ci(t.publishedKey, t.cssProperties)
2417
+ const t = e, n = y(
2418
+ () => Ki(t.publishedKey, t.cssProperties)
2373
2419
  );
2374
- return (o, s) => n.value ? (f(), C(P("style"), {
2420
+ return (o, s) => n.value ? (f(), v(x("style"), {
2375
2421
  key: 0,
2376
2422
  "data-rulecms-project-css-properties": ""
2377
2423
  }, {
2378
- default: T(() => [
2379
- R(L(n.value), 1)
2424
+ default: P(() => [
2425
+ j(M(n.value), 1)
2380
2426
  ]),
2381
2427
  _: 1
2382
- })) : k("", !0);
2428
+ })) : T("", !0);
2383
2429
  }
2384
2430
  });
2385
- function bt(e) {
2431
+ function Mt(e) {
2386
2432
  return e !== !1;
2387
2433
  }
2388
- const Ct = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), vi = /[{};]/, Ai = (e) => {
2434
+ const jt = (e) => e.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), zi = /[{};]/, Hi = (e) => {
2389
2435
  if (!e)
2390
2436
  return {};
2391
2437
  const t = {};
2392
2438
  for (const [n, o] of Object.entries(e)) {
2393
- if (!U(n) || typeof o != "string")
2439
+ if (!Q(n) || typeof o != "string")
2394
2440
  continue;
2395
2441
  const s = o.trim();
2396
- s === "" || vi.test(s) || (t[n.trim()] = s);
2442
+ s === "" || zi.test(s) || (t[n.trim()] = s);
2397
2443
  }
2398
2444
  return t;
2399
- }, Si = (e, t, n) => {
2400
- if (!bt(n))
2445
+ }, Gi = (e, t, n) => {
2446
+ if (!Mt(n))
2401
2447
  return null;
2402
- const o = Ai(t), s = Object.keys(o);
2448
+ const o = Hi(t), s = Object.keys(o);
2403
2449
  if (s.length === 0 || !e)
2404
2450
  return null;
2405
- const i = `[data-rulecms-published-key="${Ct(e)}"] > *`, r = s.sort((l, u) => l.localeCompare(u)).map((l) => ` ${l}: ${o[l]};`).join(`
2451
+ const i = `[data-rulecms-published-key="${jt(e)}"] > *`, l = s.sort((r, u) => r.localeCompare(u)).map((r) => ` ${r}: ${o[r]};`).join(`
2406
2452
  `);
2407
2453
  return `${i} {
2408
- ${r}
2454
+ ${l}
2409
2455
  }`;
2410
2456
  };
2411
- function wt(e) {
2457
+ function Nt(e) {
2412
2458
  return e !== !1;
2413
2459
  }
2414
- const Ei = 5, ki = 200, Ti = [
2460
+ const Yi = 5, Xi = 200, Ji = [
2415
2461
  { kind: "prefers-color-scheme", value: "dark" },
2416
2462
  { kind: "prefers-color-scheme", value: "light" },
2417
2463
  { kind: "html-class", value: "dark" },
2418
2464
  { kind: "data-theme", value: "dark" },
2419
2465
  { kind: "data-theme", value: "light" }
2420
- ], Ii = /[{};]/, Pi = (e) => {
2466
+ ], qi = /[{};]/, Zi = (e) => {
2421
2467
  if (typeof e != "object" || e === null || Array.isArray(e))
2422
2468
  return !1;
2423
2469
  const t = e;
2424
- return Ti.some(
2470
+ return Ji.some(
2425
2471
  (n) => n.kind === t.kind && n.value === t.value
2426
2472
  );
2427
- }, Di = (e) => {
2473
+ }, Qi = (e) => {
2428
2474
  if (!e || typeof e != "object" || Array.isArray(e))
2429
2475
  return {};
2430
2476
  const t = {};
2431
2477
  for (const [n, o] of Object.entries(e)) {
2432
- if (!U(n) || typeof o != "string")
2478
+ if (!Q(n) || typeof o != "string")
2433
2479
  continue;
2434
2480
  const s = o.trim();
2435
- s === "" || Ii.test(s) || s.includes("url(") || s.includes("@") || (t[n.trim()] = s);
2481
+ s === "" || qi.test(s) || s.includes("url(") || s.includes("@") || (t[n.trim()] = s);
2436
2482
  }
2437
2483
  return Object.fromEntries(
2438
2484
  Object.entries(t).sort(([n], [o]) => n.localeCompare(o))
2439
2485
  );
2440
- }, vt = (e) => {
2486
+ }, Wt = (e) => {
2441
2487
  if (!Array.isArray(e))
2442
2488
  return [];
2443
2489
  const t = [], n = /* @__PURE__ */ new Set();
2444
2490
  let o = 0;
2445
2491
  for (const s of e) {
2446
- if (!s || !Pi(s.condition))
2492
+ if (!s || !Zi(s.condition))
2447
2493
  continue;
2448
2494
  const i = `${s.condition.kind}:${s.condition.value}`;
2449
2495
  if (n.has(i))
2450
2496
  continue;
2451
- const r = Di(s.variables), l = o + Object.keys(r).length;
2452
- if (!(Object.keys(r).length === 0 || l > ki) && (n.add(i), o = l, t.push({ condition: s.condition, variables: r }), t.length === Ei))
2497
+ const l = Qi(s.variables), r = o + Object.keys(l).length;
2498
+ if (!(Object.keys(l).length === 0 || r > Xi) && (n.add(i), o = r, t.push({ condition: s.condition, variables: l }), t.length === Yi))
2453
2499
  break;
2454
2500
  }
2455
2501
  return t;
2456
- }, $i = (e, t) => {
2502
+ }, er = (e, t) => {
2457
2503
  const n = Object.entries(e).map(([o, s]) => ` ${o}: ${s};`);
2458
2504
  return `${t} {
2459
2505
  ${n.join(`
2460
2506
  `)}
2461
2507
  }`;
2462
- }, Li = (e) => e.split(`
2508
+ }, tr = (e) => e.split(`
2463
2509
  `).map((t) => ` ${t}`).join(`
2464
- `), xi = (e, t) => {
2465
- const n = $i(e.variables, t), { kind: o, value: s } = e.condition;
2510
+ `), nr = (e, t) => {
2511
+ const n = er(e.variables, t), { kind: o, value: s } = e.condition;
2466
2512
  return o === "prefers-color-scheme" ? `@media (prefers-color-scheme: ${s}) {
2467
- ${Li(n)}
2513
+ ${tr(n)}
2468
2514
  }` : o === "html-class" ? `html.${s} ${n}` : `[data-theme="${s}"] ${n}`;
2469
- }, Ri = (e, t, n) => {
2470
- if (!wt(n) || !e)
2515
+ }, or = (e, t, n) => {
2516
+ if (!Nt(n) || !e)
2471
2517
  return null;
2472
- const o = vt(t);
2518
+ const o = Wt(t);
2473
2519
  if (o.length === 0)
2474
2520
  return null;
2475
- const s = `[data-rulecms-published-key="${Ct(e)}"] > *`;
2476
- return o.map((i) => xi(i, s)).join(`
2521
+ const s = `[data-rulecms-published-key="${jt(e)}"] > *`;
2522
+ return o.map((i) => nr(i, s)).join(`
2477
2523
 
2478
2524
  `);
2479
- }, Oi = /* @__PURE__ */ A({
2525
+ }, sr = /* @__PURE__ */ S({
2480
2526
  __name: "ProjectCssThemesStylesheet",
2481
2527
  props: {
2482
2528
  publishedKey: {},
2483
2529
  themes: {}
2484
2530
  },
2485
2531
  setup(e) {
2486
- const t = e, n = g(
2487
- () => Ri(t.publishedKey, t.themes)
2532
+ const t = e, n = y(
2533
+ () => or(t.publishedKey, t.themes)
2488
2534
  );
2489
- return (o, s) => n.value ? (f(), C(P("style"), {
2535
+ return (o, s) => n.value ? (f(), v(x("style"), {
2490
2536
  key: 0,
2491
2537
  "data-rulecms-project-themes": ""
2492
2538
  }, {
2493
- default: T(() => [
2494
- R(L(n.value), 1)
2539
+ default: P(() => [
2540
+ j(M(n.value), 1)
2495
2541
  ]),
2496
2542
  _: 1
2497
- })) : k("", !0);
2543
+ })) : T("", !0);
2498
2544
  }
2499
- }), _i = /* @__PURE__ */ A({
2545
+ }), ir = /* @__PURE__ */ S({
2500
2546
  __name: "ProjectCssVariablesStylesheet",
2501
2547
  props: {
2502
2548
  publishedKey: {},
2503
2549
  variables: {}
2504
2550
  },
2505
2551
  setup(e) {
2506
- const t = e, n = g(
2507
- () => Si(t.publishedKey, t.variables)
2552
+ const t = e, n = y(
2553
+ () => Gi(t.publishedKey, t.variables)
2508
2554
  );
2509
- return (o, s) => n.value ? (f(), C(P("style"), {
2555
+ return (o, s) => n.value ? (f(), v(x("style"), {
2510
2556
  key: 0,
2511
2557
  "data-rulecms-project-css-variables": ""
2512
2558
  }, {
2513
- default: T(() => [
2514
- R(L(n.value), 1)
2559
+ default: P(() => [
2560
+ j(M(n.value), 1)
2515
2561
  ]),
2516
2562
  _: 1
2517
- })) : k("", !0);
2563
+ })) : T("", !0);
2518
2564
  }
2519
2565
  });
2520
- function At(e) {
2566
+ function Vt(e) {
2521
2567
  return e !== !1;
2522
2568
  }
2523
- const ji = [
2569
+ const rr = [
2524
2570
  "light",
2525
2571
  "dark",
2526
2572
  "light dark"
2527
- ], Mi = ["auto", "thin", "none"], Ni = new Set(ji), Wi = new Set(Mi), Vi = /[{};]|url\(|@/i, Fi = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !Vi.test(e), q = (e) => Fi(e) ? e.trim() : void 0, St = (e) => {
2573
+ ], lr = ["auto", "thin", "none"], cr = new Set(rr), ar = new Set(lr), ur = /[{};]|url\(|@/i, dr = (e) => typeof e == "string" && e.trim() !== "" && e.trim().length <= 400 && !ur.test(e), ae = (e) => dr(e) ? e.trim() : void 0, Ft = (e) => {
2528
2574
  if (!e || typeof e != "object" || Array.isArray(e))
2529
2575
  return null;
2530
- const t = q(e.selectionBackground), n = q(e.selectionColor), o = q(e.caretColor), s = q(e.scrollbarColor), i = {
2531
- ...typeof e.colorScheme == "string" && Ni.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
2576
+ const t = ae(e.selectionBackground), n = ae(e.selectionColor), o = ae(e.caretColor), s = ae(e.scrollbarColor), i = {
2577
+ ...typeof e.colorScheme == "string" && cr.has(e.colorScheme) ? { colorScheme: e.colorScheme } : {},
2532
2578
  ...t ? { selectionBackground: t } : {},
2533
2579
  ...n ? { selectionColor: n } : {},
2534
2580
  ...o ? { caretColor: o } : {},
2535
2581
  ...s ? { scrollbarColor: s } : {},
2536
- ...typeof e.scrollbarWidth == "string" && Wi.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
2582
+ ...typeof e.scrollbarWidth == "string" && ar.has(e.scrollbarWidth) ? { scrollbarWidth: e.scrollbarWidth } : {}
2537
2583
  };
2538
2584
  return Object.keys(i).length > 0 ? i : null;
2539
- }, Bi = (e, t, n) => {
2540
- if (!At(n) || !e)
2585
+ }, pr = (e, t, n) => {
2586
+ if (!Vt(n) || !e)
2541
2587
  return null;
2542
- const o = St(t);
2588
+ const o = Ft(t);
2543
2589
  if (!o)
2544
2590
  return null;
2545
- const s = `[data-rulecms-published-key="${at(e)}"]`, i = [];
2591
+ const s = `[data-rulecms-published-key="${It(e)}"]`, i = [];
2546
2592
  o.colorScheme && i.push(` color-scheme: ${o.colorScheme};`), o.caretColor && i.push(` caret-color: ${o.caretColor};`), o.scrollbarWidth && i.push(` scrollbar-width: ${o.scrollbarWidth};`), o.scrollbarColor && i.push(` scrollbar-color: ${o.scrollbarColor};`);
2547
- const r = [];
2548
- o.selectionBackground && r.push(` background: ${o.selectionBackground};`), o.selectionColor && r.push(` color: ${o.selectionColor};`);
2549
2593
  const l = [];
2550
- return i.length > 0 && l.push(`${s} > * {
2594
+ o.selectionBackground && l.push(` background: ${o.selectionBackground};`), o.selectionColor && l.push(` color: ${o.selectionColor};`);
2595
+ const r = [];
2596
+ return i.length > 0 && r.push(`${s} > * {
2551
2597
  ${i.join(`
2552
2598
  `)}
2553
- }`), r.length > 0 && l.push(`${s} > * ::selection {
2554
- ${r.join(`
2599
+ }`), l.length > 0 && r.push(`${s} > * ::selection {
2600
+ ${l.join(`
2555
2601
  `)}
2556
- }`), l.length > 0 ? l.join(`
2602
+ }`), r.length > 0 ? r.join(`
2557
2603
  `) : null;
2558
- }, Ki = /* @__PURE__ */ A({
2604
+ }, fr = /* @__PURE__ */ S({
2559
2605
  __name: "ProjectCssWidgetChromeStylesheet",
2560
2606
  props: {
2561
2607
  publishedKey: {},
2562
2608
  widgetChrome: {}
2563
2609
  },
2564
2610
  setup(e) {
2565
- const t = e, n = g(
2566
- () => Bi(t.publishedKey, t.widgetChrome)
2611
+ const t = e, n = y(
2612
+ () => pr(t.publishedKey, t.widgetChrome)
2567
2613
  );
2568
- return (o, s) => n.value ? (f(), C(P("style"), {
2614
+ return (o, s) => n.value ? (f(), v(x("style"), {
2569
2615
  key: 0,
2570
2616
  "data-rulecms-project-widget-chrome": ""
2571
2617
  }, {
2572
- default: T(() => [
2573
- R(L(n.value), 1)
2618
+ default: P(() => [
2619
+ j(M(n.value), 1)
2574
2620
  ]),
2575
2621
  _: 1
2576
- })) : k("", !0);
2622
+ })) : T("", !0);
2577
2623
  }
2578
2624
  });
2579
- function zi(e) {
2625
+ function yr(e) {
2580
2626
  return e !== !1;
2581
2627
  }
2582
- function Hi(e) {
2628
+ function mr(e) {
2583
2629
  const t = {};
2584
2630
  return Object.entries(e).forEach(([n, o]) => {
2585
2631
  const s = { ...o };
2586
2632
  if (s.itemList)
2587
2633
  try {
2588
2634
  s.collectionRows = typeof s.itemList == "string" ? JSON.parse(s.itemList) : s.itemList;
2589
- } catch (r) {
2590
- console.error(`Failed to parse itemList for collection ${n}:`, r), s.collectionRows = { rows: [] };
2635
+ } catch (l) {
2636
+ console.error(`Failed to parse itemList for collection ${n}:`, l), s.collectionRows = { rows: [] };
2591
2637
  }
2592
2638
  let i = `${s.name}$${n}`;
2593
2639
  s.parentId && (i = `${i}@${s.parentId}`), t[i] = s;
2594
2640
  }), t;
2595
2641
  }
2596
- function Ui(e) {
2642
+ function hr(e) {
2597
2643
  return typeof e.itemList == "string" ? JSON.parse(e.itemList) : e.itemList;
2598
2644
  }
2599
- function Et(e) {
2600
- const t = ne(e.fontFaces), n = pt(e.keyframes), o = vt(e.themes), s = gt(e.cssProperties), i = St(e.widgetChrome), r = mt(e.positionTry), l = zi(e.includeClassLayer) && ct(e.classLayer) ? e.classLayer : void 0;
2645
+ function Ne(e) {
2646
+ const t = ye(e.fontFaces), n = xt(e.keyframes), o = Wt(e.themes), s = Ot(e.cssProperties), i = Ft(e.widgetChrome), l = Rt(e.positionTry), r = yr(e.includeClassLayer) && Tt(e.classLayer) ? e.classLayer : void 0;
2601
2647
  return {
2602
- displayItemList: Ui(e.widget),
2603
- widgetCollections: Hi(e.childCollections),
2648
+ displayItemList: hr(e.widget),
2649
+ widgetCollections: mr(e.childCollections),
2604
2650
  ...e.libraries ? { libraries: e.libraries } : {},
2605
- ...bt(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
2606
- ...lt(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
2607
- ...Se(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
2608
- ...ut(e.includeKeyframes) && Object.keys(n).length > 0 ? { keyframes: n } : {},
2609
- ...wt(e.includeThemes) && o.length > 0 ? { themes: o } : {},
2610
- ...ht(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
2611
- ...At(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
2612
- ...l ? { classLayer: l } : {},
2613
- ...ft(e.includePositionTry) && Object.keys(r).length > 0 ? { positionTry: r } : {}
2651
+ ...Mt(e.includeCssVariables) && e.cssVariables && Object.keys(e.cssVariables).length > 0 ? { cssVariables: e.cssVariables } : {},
2652
+ ...kt(e.includeClassDefinitions) && e.classDefinitions && Object.keys(e.classDefinitions).length > 0 ? { classDefinitions: e.classDefinitions } : {},
2653
+ ...je(e.includeFontFaces) && t.length > 0 ? { fontFaces: t } : {},
2654
+ ...Pt(e.includeKeyframes) && Object.keys(n).length > 0 ? { keyframes: n } : {},
2655
+ ...Nt(e.includeThemes) && o.length > 0 ? { themes: o } : {},
2656
+ ..._t(e.includeCssProperties) && s.length > 0 ? { cssProperties: s } : {},
2657
+ ...Vt(e.includeWidgetChrome) && i ? { widgetChrome: i } : {},
2658
+ ...r ? { classLayer: r } : {},
2659
+ ...$t(e.includePositionTry) && Object.keys(l).length > 0 ? { positionTry: l } : {}
2614
2660
  };
2615
2661
  }
2616
- function Yi(e) {
2617
- const t = e.registry ?? te(), n = ye({
2662
+ function gr(e) {
2663
+ const t = e.registry ?? pe(), n = De({
2618
2664
  displayItemList: e.displayItemList,
2619
2665
  widgetCollections: e.widgetCollections
2620
2666
  });
2621
2667
  return t.resolveSync({ registrations: e.libraries, referenced: n });
2622
2668
  }
2623
- function Gi(e) {
2624
- const t = e.registry ?? te(), n = ye({
2669
+ function br(e) {
2670
+ const t = e.registry ?? pe(), n = De({
2625
2671
  displayItemList: e.displayItemList,
2626
2672
  widgetCollections: e.widgetCollections
2627
2673
  });
2628
2674
  return t.resolve({ registrations: e.libraries, referenced: n });
2629
2675
  }
2630
- const Xi = {
2676
+ function Cr(e) {
2677
+ const t = e.lastIndexOf(Ee);
2678
+ return t === -1 ? e : e.slice(t + Ee.length);
2679
+ }
2680
+ const wr = "text/plain";
2681
+ function vr({
2682
+ token: e,
2683
+ rulesetPublishedKey: t,
2684
+ params: n
2685
+ }) {
2686
+ return K(e) ? {
2687
+ token: e,
2688
+ rulesetKey: Cr(t),
2689
+ ...n ? { params: n } : {}
2690
+ } : {
2691
+ token: e,
2692
+ rulesetPublishedKey: t,
2693
+ ...n ? { params: n } : {},
2694
+ mode: "payload"
2695
+ };
2696
+ }
2697
+ function Bt({
2698
+ contentType: e = wr,
2699
+ ...t
2700
+ }) {
2701
+ return {
2702
+ method: "POST",
2703
+ headers: { "Content-Type": e },
2704
+ body: JSON.stringify(vr(t))
2705
+ };
2706
+ }
2707
+ const Ze = "rulecms_anon_id";
2708
+ function Qe() {
2709
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
2710
+ const t = Math.random() * 16 | 0;
2711
+ return (e === "x" ? t : t & 3 | 8).toString(16);
2712
+ });
2713
+ }
2714
+ function Ar() {
2715
+ if (!(typeof window > "u"))
2716
+ try {
2717
+ const e = window.localStorage.getItem(Ze);
2718
+ if (e)
2719
+ return e;
2720
+ const t = Qe();
2721
+ return window.localStorage.setItem(Ze, t), t;
2722
+ } catch {
2723
+ return Qe();
2724
+ }
2725
+ }
2726
+ function Kt(e) {
2727
+ return e >= 500;
2728
+ }
2729
+ function Er(e) {
2730
+ if (!(e != null && e.success) || !e.data)
2731
+ return null;
2732
+ const { selection: t, ...n } = e.data;
2733
+ return { raw: n, selection: t };
2734
+ }
2735
+ function Sr(e, t) {
2736
+ if (!(e != null && e.resolution) || !e.widget)
2737
+ return null;
2738
+ const { resolution: n, ...o } = e, s = {
2739
+ rulesetPublishedKey: t,
2740
+ outcome: n.outcome,
2741
+ ruleId: n.ruleId ?? null,
2742
+ variantId: n.variantId ?? null,
2743
+ widgetKey: n.widgetKey,
2744
+ widgetPublishedKey: n.widgetPublishedKey
2745
+ };
2746
+ return { raw: o, selection: s };
2747
+ }
2748
+ function Ut({
2749
+ token: e,
2750
+ rulesetPublishedKey: t,
2751
+ body: n
2752
+ }) {
2753
+ return K(e) ? Sr(n, t) : Er(n);
2754
+ }
2755
+ function kr(e) {
2756
+ return JSON.stringify(e, (t, n) => {
2757
+ if (n === null || typeof n != "object" || Array.isArray(n))
2758
+ return n;
2759
+ const o = {};
2760
+ for (const s of Object.keys(n).sort())
2761
+ o[s] = n[s];
2762
+ return o;
2763
+ });
2764
+ }
2765
+ const Tr = {
2631
2766
  display: "flex",
2632
2767
  justifyContent: "center",
2633
2768
  alignItems: "center",
2634
2769
  padding: "3rem",
2635
2770
  color: "#e2e8f0"
2636
- }, Ji = {
2771
+ }, Ir = {
2637
2772
  display: "flex",
2638
2773
  alignItems: "center",
2639
2774
  gap: "1rem"
2640
- }, Zi = {
2775
+ }, Pr = {
2641
2776
  width: "40px",
2642
2777
  height: "40px",
2643
2778
  border: "4px solid #4a5568",
2644
2779
  borderTopColor: "#63b3ed",
2645
2780
  borderRadius: "50%",
2646
2781
  animation: "spin 1s linear infinite"
2647
- }, We = {
2782
+ }, et = {
2648
2783
  padding: "1.5rem",
2649
2784
  backgroundColor: "#742a2a",
2650
2785
  border: "1px solid #9b2c2c",
2651
2786
  borderRadius: "8px",
2652
2787
  color: "#fed7d7"
2653
- }, Ve = {
2788
+ }, tt = {
2654
2789
  fontSize: "16px",
2655
2790
  fontWeight: "600",
2656
2791
  marginBottom: "0.5rem",
2657
2792
  color: "#feb2b2"
2658
- }, Fe = {
2793
+ }, nt = {
2659
2794
  fontSize: "14px",
2660
2795
  color: "#fed7d7"
2661
- }, qi = `
2796
+ }, Dr = `
2662
2797
  @keyframes spin {
2663
2798
  from {
2664
2799
  transform: rotate(0deg);
@@ -2667,109 +2802,176 @@ const Xi = {
2667
2802
  transform: rotate(360deg);
2668
2803
  }
2669
2804
  }
2670
- `, hr = "data-rulecms-published-key", Qi = ["data-rulecms-published-key"], gr = /* @__PURE__ */ A({
2805
+ `, Jr = "data-rulecms-published-key", xr = ["data-rulecms-published-key"], qr = /* @__PURE__ */ S({
2671
2806
  __name: "RuleCMSWidget",
2672
2807
  props: {
2673
2808
  publishedKey: {},
2809
+ rulesetPublishedKey: {},
2810
+ params: {},
2811
+ anonymousId: { type: [String, Boolean] },
2812
+ fallbackPublishedKey: {},
2813
+ contentType: {},
2674
2814
  token: {},
2675
2815
  endpoint: {},
2676
2816
  mode: { default: "client-fetch" },
2677
2817
  initialData: {},
2678
2818
  libraries: {},
2679
2819
  componentProps: {},
2680
- mounts: {}
2820
+ mounts: {},
2821
+ placeholderValues: {},
2822
+ onSelection: {}
2681
2823
  },
2682
2824
  setup(e) {
2683
- const t = e, n = xt(Je, null), o = Y(!1), s = Y(null), i = Y(null), r = Y(null), l = g(() => t.mode === "pre-fetched"), u = g(() => ({
2684
- sourceComponents: r.value ?? void 0
2685
- }));
2686
- let c = null, a = null, p = !1;
2687
- function y() {
2825
+ const t = e, n = tn(yt, null), o = H(!0), s = H(null), i = H(null), l = H(null), r = H(null), u = H(""), a = y(() => t.mode === "pre-fetched"), c = y(() => ({
2826
+ sourceComponents: l.value ?? void 0
2827
+ })), p = y(() => t.publishedKey || u.value);
2828
+ let m = null, d = null, h = !1, b = 0;
2829
+ function C() {
2688
2830
  if (!i.value) {
2689
- r.value = null;
2831
+ l.value = null;
2690
2832
  return;
2691
2833
  }
2692
- const w = t.libraries ?? (n == null ? void 0 : n.libraries), D = n == null ? void 0 : n.libraryRegistry, O = Yi({
2834
+ const I = t.libraries ?? (n == null ? void 0 : n.libraries), $ = n == null ? void 0 : n.libraryRegistry, V = gr({
2693
2835
  displayItemList: i.value.displayItemList,
2694
2836
  widgetCollections: i.value.widgetCollections,
2695
- libraries: w,
2696
- registry: D
2837
+ libraries: I,
2838
+ registry: $
2697
2839
  });
2698
- if (O) {
2699
- r.value = O;
2840
+ if (V) {
2841
+ l.value = V;
2700
2842
  return;
2701
2843
  }
2702
- Gi({
2844
+ br({
2703
2845
  displayItemList: i.value.displayItemList,
2704
2846
  widgetCollections: i.value.widgetCollections,
2705
- libraries: w,
2706
- registry: D
2707
- }).then((B) => {
2708
- r.value = B;
2847
+ libraries: I,
2848
+ registry: $
2849
+ }).then((_) => {
2850
+ l.value = _;
2709
2851
  });
2710
2852
  }
2711
- function d() {
2712
- i.value && _o({
2853
+ function g() {
2854
+ i.value && is({
2713
2855
  componentProps: t.componentProps,
2714
2856
  displayItemList: i.value.displayItemList,
2715
2857
  widgetCollections: i.value.widgetCollections,
2716
- publishedKey: t.publishedKey
2858
+ publishedKey: p.value
2717
2859
  });
2718
2860
  }
2719
- function h() {
2720
- if (p || typeof document > "u")
2861
+ function ee() {
2862
+ if (h || typeof document > "u")
2721
2863
  return;
2722
- const w = "rulecms-widget-spinner-styles";
2723
- if (!document.getElementById(w)) {
2724
- const D = document.createElement("style");
2725
- D.id = w, D.textContent = qi, document.head.appendChild(D);
2864
+ const I = "rulecms-widget-spinner-styles";
2865
+ if (!document.getElementById(I)) {
2866
+ const $ = document.createElement("style");
2867
+ $.id = I, $.textContent = Dr, document.head.appendChild($);
2726
2868
  }
2727
- p = !0;
2869
+ h = !0;
2728
2870
  }
2729
- function m() {
2730
- const w = t.token ?? (n == null ? void 0 : n.token), D = t.endpoint ?? (n == null ? void 0 : n.endpoint);
2731
- if (!t.publishedKey || !w) {
2732
- s.value = t.publishedKey ? "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider." : K(w) ? "Widget key is required" : "Published key is required", i.value = null;
2871
+ function me() {
2872
+ const I = t.token ?? (n == null ? void 0 : n.token), $ = t.endpoint ?? (n == null ? void 0 : n.endpoint), V = K(I), _ = t.rulesetPublishedKey;
2873
+ if (!t.publishedKey && !_ || !I) {
2874
+ !t.publishedKey && !_ ? s.value = _ !== void 0 ? V ? "Ruleset key is required" : "Ruleset published key is required" : V ? "Widget key is required" : "Published key is required" : s.value = "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider.", i.value = null, o.value = !1;
2733
2875
  return;
2734
2876
  }
2735
- const O = `${t.publishedKey}|${w}`;
2736
- if (a === O && i.value) {
2737
- y();
2877
+ const X = kr(t.params), ne = JSON.stringify({
2878
+ publishedKey: t.publishedKey,
2879
+ rulesetPublishedKey: _,
2880
+ token: I,
2881
+ endpoint: $,
2882
+ paramsKey: X,
2883
+ anonymousId: t.anonymousId,
2884
+ fallbackPublishedKey: t.fallbackPublishedKey,
2885
+ contentType: t.contentType
2886
+ });
2887
+ if (d === ne && i.value) {
2888
+ o.value = !1, C();
2738
2889
  return;
2739
2890
  }
2740
- c == null || c.abort(), c = new AbortController();
2741
- const B = c.signal;
2742
- a = O, o.value = !0, s.value = null;
2743
- const J = Ye({ publishedKey: t.publishedKey, token: w, endpoint: D });
2744
- fetch(J, {
2745
- method: "GET",
2746
- headers: { "Content-Type": "application/json" },
2747
- ...K(w) ? { cache: "no-store" } : {},
2748
- signal: B
2749
- }).then(async (x) => {
2750
- if (x.ok) {
2751
- const W = await x.json();
2752
- W.success ? (i.value = Et(W.data), s.value = null, y(), d()) : (s.value = "Failed to fetch widget data", i.value = null);
2753
- } else {
2754
- const W = await x.json().catch(() => ({ error: "Unknown error" }));
2755
- s.value = W.error || `Request failed with status ${x.status}`, i.value = null;
2891
+ m == null || m.abort(), m = new AbortController();
2892
+ const oe = m.signal;
2893
+ d = ne, o.value = !0, s.value = null;
2894
+ const le = ++b, se = async (A) => (await A.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${A.status}`, J = async (A) => {
2895
+ const O = ut({ publishedKey: A, token: I, endpoint: $ }), N = await fetch(O, {
2896
+ method: "GET",
2897
+ ...V ? { cache: "no-store" } : {},
2898
+ signal: oe
2899
+ });
2900
+ if (!N.ok)
2901
+ throw new te(await se(N));
2902
+ const L = await N.json();
2903
+ if (!L.success)
2904
+ throw new te("Failed to fetch widget data");
2905
+ return L.data;
2906
+ };
2907
+ (_ ? (async () => {
2908
+ const A = X ? JSON.parse(X) : {};
2909
+ if (t.anonymousId !== !1) {
2910
+ if (typeof t.anonymousId == "string")
2911
+ A.anonId = A.anonId ?? t.anonymousId;
2912
+ else if (A.anonId == null) {
2913
+ const L = Ar();
2914
+ L && (A.anonId = L);
2915
+ }
2756
2916
  }
2757
- }).catch((x) => {
2758
- x instanceof DOMException && x.name === "AbortError" || (console.error("Error fetching widget:", x), s.value = "Failed to fetch widget", i.value = null);
2917
+ let O;
2918
+ try {
2919
+ O = await fetch(dt({ token: I, endpoint: $ }), {
2920
+ ...Bt({
2921
+ token: I,
2922
+ rulesetPublishedKey: _,
2923
+ params: A,
2924
+ contentType: t.contentType
2925
+ }),
2926
+ signal: oe
2927
+ });
2928
+ } catch (L) {
2929
+ if (L instanceof DOMException && L.name === "AbortError")
2930
+ throw L;
2931
+ if (t.fallbackPublishedKey)
2932
+ return { raw: await J(t.fallbackPublishedKey), selection: null };
2933
+ throw L;
2934
+ }
2935
+ if (!O.ok) {
2936
+ if (t.fallbackPublishedKey && Kt(O.status))
2937
+ return { raw: await J(t.fallbackPublishedKey), selection: null };
2938
+ throw new te(await se(O));
2939
+ }
2940
+ const N = Ut({
2941
+ token: I,
2942
+ rulesetPublishedKey: _,
2943
+ body: await O.json()
2944
+ });
2945
+ if (!N)
2946
+ throw new te("Failed to fetch widget data");
2947
+ return { raw: N.raw, selection: N.selection };
2948
+ })() : J(t.publishedKey).then((A) => ({
2949
+ raw: A,
2950
+ selection: null
2951
+ }))).then(({ raw: A, selection: O }) => {
2952
+ var N, L;
2953
+ i.value = Ne(A), u.value = ((N = A.widget) == null ? void 0 : N.publishedKey) ?? "", r.value = O, s.value = null, C(), g(), O && ((L = t.onSelection) == null || L.call(t, O));
2954
+ }).catch((A) => {
2955
+ A instanceof DOMException && A.name === "AbortError" || (console.error("Error fetching widget:", A), s.value = A instanceof te ? A.message : "Failed to fetch widget", i.value = null, r.value = null);
2759
2956
  }).finally(() => {
2760
- o.value = !1;
2957
+ b === le && (o.value = !1);
2761
2958
  });
2762
2959
  }
2763
- function S() {
2960
+ function Gt() {
2764
2961
  if (t.mode === "pre-fetched") {
2765
- i.value = t.initialData ?? null, o.value = !1, s.value = null, y(), d();
2962
+ i.value = t.initialData ?? null, o.value = !1, s.value = null, C(), g();
2766
2963
  return;
2767
2964
  }
2768
- h(), m();
2965
+ ee(), me();
2769
2966
  }
2770
- return Be(
2967
+ st(
2771
2968
  () => [
2772
2969
  t.publishedKey,
2970
+ t.rulesetPublishedKey,
2971
+ t.params,
2972
+ t.anonymousId,
2973
+ t.fallbackPublishedKey,
2974
+ t.contentType,
2773
2975
  t.token,
2774
2976
  t.endpoint,
2775
2977
  t.mode,
@@ -2778,90 +2980,97 @@ const Xi = {
2778
2980
  t.componentProps
2779
2981
  ],
2780
2982
  () => {
2781
- S();
2983
+ Gt();
2782
2984
  },
2783
2985
  { immediate: !0 }
2784
- ), Ke(() => {
2785
- c == null || c.abort();
2786
- }), (w, D) => {
2787
- var O, B, J, x, W, Ee, ke, Te, Ie;
2788
- return f(), b("span", {
2789
- "data-rulecms-published-key": e.publishedKey,
2986
+ ), it(() => {
2987
+ m == null || m.abort();
2988
+ });
2989
+ class te extends Error {
2990
+ constructor($) {
2991
+ super($), this.name = "FetchWidgetMessage";
2992
+ }
2993
+ }
2994
+ return (I, $) => {
2995
+ var V, _, X, ne, oe, le, se, J, he;
2996
+ return f(), w("span", {
2997
+ "data-rulecms-published-key": p.value,
2790
2998
  style: { display: "contents" }
2791
2999
  }, [
2792
- $(Vs, {
2793
- "published-key": e.publishedKey,
2794
- fonts: (O = i.value) == null ? void 0 : O.fontFaces
3000
+ R(ui, {
3001
+ "published-key": p.value,
3002
+ fonts: (V = i.value) == null ? void 0 : V.fontFaces
2795
3003
  }, null, 8, ["published-key", "fonts"]),
2796
- $(Qs, {
2797
- "published-key": e.publishedKey,
2798
- keyframes: (B = i.value) == null ? void 0 : B.keyframes
3004
+ R(Ei, {
3005
+ "published-key": p.value,
3006
+ keyframes: (_ = i.value) == null ? void 0 : _.keyframes
2799
3007
  }, null, 8, ["published-key", "keyframes"]),
2800
- $(Oi, {
2801
- "published-key": e.publishedKey,
2802
- themes: (J = i.value) == null ? void 0 : J.themes
3008
+ R(sr, {
3009
+ "published-key": p.value,
3010
+ themes: (X = i.value) == null ? void 0 : X.themes
2803
3011
  }, null, 8, ["published-key", "themes"]),
2804
- $(wi, {
2805
- "published-key": e.publishedKey,
2806
- "css-properties": (x = i.value) == null ? void 0 : x.cssProperties
3012
+ R(Ui, {
3013
+ "published-key": p.value,
3014
+ "css-properties": (ne = i.value) == null ? void 0 : ne.cssProperties
2807
3015
  }, null, 8, ["published-key", "css-properties"]),
2808
- $(Ki, {
2809
- "published-key": e.publishedKey,
2810
- "widget-chrome": (W = i.value) == null ? void 0 : W.widgetChrome
3016
+ R(fr, {
3017
+ "published-key": p.value,
3018
+ "widget-chrome": (oe = i.value) == null ? void 0 : oe.widgetChrome
2811
3019
  }, null, 8, ["published-key", "widget-chrome"]),
2812
- $(ui, {
2813
- "published-key": e.publishedKey,
2814
- "position-try": (Ee = i.value) == null ? void 0 : Ee.positionTry
3020
+ R(_i, {
3021
+ "published-key": p.value,
3022
+ "position-try": (le = i.value) == null ? void 0 : le.positionTry
2815
3023
  }, null, 8, ["published-key", "position-try"]),
2816
- $(_i, {
2817
- "published-key": e.publishedKey,
2818
- variables: (ke = i.value) == null ? void 0 : ke.cssVariables
3024
+ R(ir, {
3025
+ "published-key": p.value,
3026
+ variables: (se = i.value) == null ? void 0 : se.cssVariables
2819
3027
  }, null, 8, ["published-key", "variables"]),
2820
- $(Cs, {
2821
- "published-key": e.publishedKey,
2822
- classes: (Te = i.value) == null ? void 0 : Te.classDefinitions,
2823
- "class-layer": (Ie = i.value) == null ? void 0 : Ie.classLayer
3028
+ R(Ks, {
3029
+ "published-key": p.value,
3030
+ classes: (J = i.value) == null ? void 0 : J.classDefinitions,
3031
+ "class-layer": (he = i.value) == null ? void 0 : he.classLayer
2824
3032
  }, null, 8, ["published-key", "classes", "class-layer"]),
2825
- e.mode !== "pre-fetched" && o.value ? (f(), b("div", {
3033
+ e.mode !== "pre-fetched" && o.value ? (f(), w("div", {
2826
3034
  key: 0,
2827
- style: I(j(Xi))
3035
+ style: D(F(Tr))
2828
3036
  }, [
2829
- V("div", {
2830
- style: I(j(Ji))
3037
+ z("div", {
3038
+ style: D(F(Ir))
2831
3039
  }, [
2832
- V("div", {
2833
- style: I(j(Zi))
3040
+ z("div", {
3041
+ style: D(F(Pr))
2834
3042
  }, null, 4)
2835
3043
  ], 4)
2836
- ], 4)) : e.mode !== "pre-fetched" && s.value ? (f(), b("div", {
3044
+ ], 4)) : e.mode !== "pre-fetched" && s.value ? (f(), w("div", {
2837
3045
  key: 1,
2838
- style: I(j(We))
3046
+ style: D(F(et))
2839
3047
  }, [
2840
- V("div", {
2841
- style: I(j(Ve))
3048
+ z("div", {
3049
+ style: D(F(tt))
2842
3050
  }, "Error Loading Widget", 4),
2843
- V("div", {
2844
- style: I(j(Fe))
2845
- }, L(s.value), 5)
2846
- ], 4)) : e.mode !== "pre-fetched" && !i.value ? (f(), b("div", {
3051
+ z("div", {
3052
+ style: D(F(nt))
3053
+ }, M(s.value), 5)
3054
+ ], 4)) : e.mode !== "pre-fetched" && !i.value ? (f(), w("div", {
2847
3055
  key: 2,
2848
- style: I(j(We))
3056
+ style: D(F(et))
2849
3057
  }, [
2850
- V("div", {
2851
- style: I(j(Ve))
3058
+ z("div", {
3059
+ style: D(F(tt))
2852
3060
  }, "No Widget Data", 4),
2853
- V("div", {
2854
- style: I(j(Fe))
3061
+ z("div", {
3062
+ style: D(F(nt))
2855
3063
  }, "No widget data available", 4)
2856
- ], 4)) : r.value && i.value ? (f(), b(E, { key: 3 }, [
2857
- l.value ? (f(), C(qo, {
3064
+ ], 4)) : l.value && i.value ? (f(), w(k, { key: 3 }, [
3065
+ a.value ? (f(), v(As, {
2858
3066
  key: 0,
2859
3067
  "display-item-list": i.value.displayItemList,
2860
3068
  "widget-collections": i.value.widgetCollections,
2861
- plugins: u.value,
3069
+ plugins: c.value,
2862
3070
  "component-props": e.componentProps,
2863
- mounts: e.mounts
2864
- }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"])) : (f(), C(ns, {
3071
+ mounts: e.mounts,
3072
+ "placeholder-values": e.placeholderValues
3073
+ }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts", "placeholder-values"])) : (f(), v(Ts, {
2865
3074
  key: 1,
2866
3075
  "display-item-list": i.value.displayItemList,
2867
3076
  "is-compose-mode": !1,
@@ -2869,203 +3078,288 @@ const Xi = {
2869
3078
  "widget-collections": i.value.widgetCollections,
2870
3079
  "show-drop-containers": !1,
2871
3080
  "redux-device-display-type": "desktop",
2872
- plugins: u.value,
3081
+ plugins: c.value,
2873
3082
  "component-props": e.componentProps,
2874
- mounts: e.mounts
2875
- }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"]))
2876
- ], 64)) : k("", !0)
2877
- ], 8, Qi);
3083
+ mounts: e.mounts,
3084
+ "placeholder-values": e.placeholderValues
3085
+ }, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts", "placeholder-values"]))
3086
+ ], 64)) : T("", !0)
3087
+ ], 8, xr);
2878
3088
  };
2879
3089
  }
2880
- });
2881
- class Q extends Error {
3090
+ }), $r = 6e4;
3091
+ class Y extends Error {
2882
3092
  constructor(n, o) {
2883
3093
  super(n);
2884
- Pe(this, "status");
3094
+ We(this, "status");
2885
3095
  this.name = "FetchRuleCMSWidgetError", this.status = o;
2886
3096
  }
2887
3097
  }
2888
- async function br(e) {
2889
- const { publishedKey: t, token: n, endpoint: o, fetchOptions: s } = e;
2890
- if (!t)
2891
- throw new Q(
2892
- K(n) ? "Widget key is required" : "Published key is required"
2893
- );
2894
- if (!n)
2895
- throw new Q("Token is required");
2896
- const i = Ye({ publishedKey: t, token: n, endpoint: o }), r = await fetch(i, {
3098
+ const de = /* @__PURE__ */ new Map();
3099
+ function Zr() {
3100
+ de.clear();
3101
+ }
3102
+ function ot(e) {
3103
+ const t = e == null ? void 0 : e.cache;
3104
+ return t === "no-store" || t === "reload" || t === "no-cache";
3105
+ }
3106
+ function Lr(e, t) {
3107
+ const n = de.get(e);
3108
+ if (n) {
3109
+ if (n.expiresAt <= t) {
3110
+ de.delete(e);
3111
+ return;
3112
+ }
3113
+ return n.data;
3114
+ }
3115
+ }
3116
+ async function zt(e) {
3117
+ return (await e.json().catch(() => ({ error: "Unknown error" }))).error || `Request failed with status ${e.status}`;
3118
+ }
3119
+ async function Ht({
3120
+ publishedKey: e,
3121
+ token: t,
3122
+ endpoint: n,
3123
+ fetchOptions: o
3124
+ }) {
3125
+ const s = ut({ publishedKey: e, token: t, endpoint: n }), i = K(t), l = Date.now();
3126
+ if (!i && !ot(o)) {
3127
+ const c = Lr(s, l);
3128
+ if (c)
3129
+ return c;
3130
+ }
3131
+ const r = await fetch(s, {
2897
3132
  method: "GET",
2898
- headers: { "Content-Type": "application/json" },
2899
- ...K(n) ? { cache: "no-store" } : {},
2900
- ...s
3133
+ ...i ? { cache: "no-store" } : {},
3134
+ ...o
3135
+ });
3136
+ if (!r.ok)
3137
+ throw new Y(await zt(r), r.status);
3138
+ const u = await r.json();
3139
+ if (!u.success)
3140
+ throw new Y("Failed to fetch widget data");
3141
+ const a = Ne(u.data);
3142
+ return !i && !ot(o) && de.set(s, {
3143
+ expiresAt: l + $r,
3144
+ data: a
3145
+ }), a;
3146
+ }
3147
+ async function Rr(e) {
3148
+ const { rulesetPublishedKey: t, params: n, fallbackPublishedKey: o, contentType: s, token: i, endpoint: l, fetchOptions: r } = e, u = () => Ht({
3149
+ publishedKey: o,
3150
+ token: i,
3151
+ endpoint: l,
3152
+ fetchOptions: r
2901
3153
  });
2902
- if (!r.ok) {
2903
- const u = await r.json().catch(() => ({ error: "Unknown error" }));
2904
- throw new Q(
2905
- u.error || `Request failed with status ${r.status}`,
2906
- r.status
3154
+ let a;
3155
+ try {
3156
+ a = await fetch(dt({ token: i, endpoint: l }), {
3157
+ ...Bt({
3158
+ token: i,
3159
+ rulesetPublishedKey: t,
3160
+ params: n,
3161
+ contentType: s
3162
+ }),
3163
+ ...r
3164
+ });
3165
+ } catch (p) {
3166
+ if (o)
3167
+ return u();
3168
+ throw p;
3169
+ }
3170
+ if (!a.ok) {
3171
+ if (o && Kt(a.status))
3172
+ return u();
3173
+ throw new Y(await zt(a), a.status);
3174
+ }
3175
+ const c = Ut({
3176
+ token: i,
3177
+ rulesetPublishedKey: t,
3178
+ body: await a.json()
3179
+ });
3180
+ if (!c)
3181
+ throw new Y("Failed to fetch widget data");
3182
+ return { ...Ne(c.raw), selection: c.selection };
3183
+ }
3184
+ async function Qr(e) {
3185
+ const { publishedKey: t, rulesetPublishedKey: n, token: o } = e;
3186
+ if (!t && !n) {
3187
+ const s = K(o);
3188
+ throw n !== void 0 ? new Y(
3189
+ s ? "Ruleset key is required" : "Ruleset published key is required"
3190
+ ) : new Y(
3191
+ s ? "Widget key is required" : "Published key is required"
2907
3192
  );
2908
3193
  }
2909
- const l = await r.json();
2910
- if (!l.success)
2911
- throw new Q("Failed to fetch widget data");
2912
- return Et(l.data);
3194
+ if (!o)
3195
+ throw new Y("Token is required");
3196
+ return e.rulesetPublishedKey ? Rr(e) : Ht(e);
2913
3197
  }
2914
- async function Cr(e) {
2915
- const { data: t, libraries: n } = e, o = ye({
3198
+ async function el(e) {
3199
+ const { data: t, libraries: n } = e, o = De({
2916
3200
  displayItemList: t.displayItemList,
2917
3201
  widgetCollections: t.widgetCollections
2918
3202
  });
2919
- return te().resolve({ registrations: n, referenced: o });
3203
+ return pe().resolve({ registrations: n, referenced: o });
2920
3204
  }
2921
3205
  export {
2922
- or as AlignContentTypes,
2923
- qo as BreakpointVariantRender,
2924
- Ue as COLLECTION_TYPE_PREFIX,
2925
- Ae as COMPONENT_PROPS_PATH_SEPARATOR,
2926
- Ce as CSS_CLASSES_ATTRIBUTE_NAME,
2927
- bn as CSS_VARIABLE_NAME_MAX_LENGTH,
2928
- gn as CSS_VARIABLE_NAME_PATTERN,
2929
- nt as DEFAULT_BASE_Z_INDEX,
2930
- qt as DEFAULT_CLOUDINARY_CLOUD_NAME,
2931
- X as DEFAULT_LIBRARY_ID,
2932
- yo as DEFAULT_ROW_GAP,
2933
- Mt as DEV_CLIENT_TOKEN_PREFIX,
2934
- Ft as DEV_WIDGET_API_PATH,
2935
- sr as DeviceDisplayTypes,
2936
- Me as DisplayComponent,
2937
- fe as DisplayItemTypes,
2938
- He as DragItemIdPrefixTypes,
2939
- Gt as EMBEDDED_KEY_SEPARATOR,
2940
- Fn as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
2941
- Q as FetchRuleCMSWidgetError,
2942
- Qe as HIDE_WIDGET_ATTRIBUTE_NAME,
2943
- xe as JustifyContentTypes,
2944
- wo as POINTER_EVENTS_ATTRIBUTE_NAME,
2945
- Yt as PUBLISHED_KEY_SEPARATOR,
2946
- Vt as PUBLISHED_WIDGET_API_PATH,
2947
- nr as PageViewTypes,
2948
- Nt as RULECMS_API_ORIGIN,
2949
- hr as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
2950
- Je as RULECMS_WIDGET_CONTEXT_KEY,
2951
- ns as RenderComponents,
2952
- ue as RenderComponentsForDevice,
2953
- Zo as RenderComponentsInner,
2954
- gr as RuleCMSWidget,
2955
- pr as RuleCMSWidgetProvider,
2956
- vo as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
2957
- Wt as WIDGET_CACHE_API_ORIGIN,
2958
- Eo as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
2959
- jn as alignContentAllowlist,
2960
- On as alignItemsAllowlist,
2961
- Wn as backgroundPositionAllowlist,
2962
- Vn as backgroundRepeatAllowlist,
2963
- Nn as backgroundSizeAllowlist,
2964
- Bn as borderStyleKeywords,
2965
- vn as boxSpacingSideKeys,
2966
- mr as boxSpacingStyleAttributeEntries,
2967
- hn as buildCloudinaryBackgroundUrl,
2968
- $o as buildOverlayLayerBoxStyles,
2969
- Do as buildOverlayStackStyles,
2970
- Ye as buildWidgetFetchUrl,
2971
- xo as collectComponentInstancePaths,
2972
- ye as collectReferencedLibraryIds,
2973
- jt as composeSourceComponentsPlugin,
2974
- te as createComponentLibraryRegistry,
2975
- ce as cssAttrArrayKey,
2976
- Zt as defaultPageWidth,
2977
- ao as deriveDisplayFlexIfNeeded,
2978
- fr as desktopModeWidth,
2979
- br as fetchRuleCMSWidget,
2980
- Oo as findUnmatchedComponentPropsKeys,
2981
- Mn as flexDirectionAllowlist,
2982
- _n as flexWrapAllowlist,
2983
- Tn as fontFamilyAllowlist,
2984
- Pn as fontStyleAllowlist,
2985
- In as fontWeightAllowlist,
2986
- Zn as formatBackgroundImageStyles,
2987
- qn as formatBorderStyles,
2988
- Qn as formatBoxShadowStyles,
2989
- to as formatBoxSpacingStyles,
2990
- no as formatCssColorStyles,
2991
- ge as formatCssColorValue,
2992
- oo as formatCssEnumStyles,
2993
- so as formatCssLengthStyles,
2994
- _ as formatCssVariable,
2995
- yr as formatCssVariableStyles,
2996
- io as formatLineHeightStyles,
2997
- lo as formatObjectStyleAttribute,
2998
- ro as formatOpacityStyles,
2999
- H as formatSpacingSideValue,
3000
- Xt as generatePublishedKey,
3001
- ur as generatePublishedKeyForEmbedded,
3002
- Xe as getCollectionIdForCollectionType,
3003
- ee as getColumnAttributes,
3004
- Re as getComponentAttributesAndStyles,
3005
- le as getComponentsPluginFromPlugins,
3006
- v as getCssVariableFromLeaf,
3007
- uo as getDefaultDimensionAttributes,
3008
- N as getDeviceTypeBasedAttributes,
3009
- ir as getDragItemId,
3010
- Kt as getDragItemPrefixAndId,
3011
- zt as getIdAndPrefix,
3012
- po as getMergedAttributes,
3013
- rr as getNameAndInstanceIdFromWidgetKey,
3014
- lr as getNameFromWidgetKey,
3015
- To as getOverlayLayerZIndex,
3016
- Ht as getWidgetKeyForCollection,
3017
- cr as getWidgetKeyForCollectionWithPrefix,
3018
- Ut as getWidgetKeyForPublishedCollection,
3019
- ar as getWidgetKeyForPublishedCollectionWithPrefix,
3020
- Gn as hasBoxShadowLeaf,
3021
- No as hasDeviceDivergentValues,
3022
- M as hasInvalidCssVariable,
3023
- fo as hasItems,
3024
- ko as hasOverlayLayers,
3025
- dr as incrementVersion,
3026
- Cn as isBackgroundImageValue,
3027
- Kn as isBorderStyleValue,
3028
- zn as isBorderValue,
3029
- Yn as isBoxShadowValue,
3030
- An as isBoxSpacingValue,
3031
- dn as isCloudinaryCloudName,
3032
- un as isCloudinaryPublicId,
3033
- fn as isCloudinaryTransformationString,
3034
- he as isCssColorValue,
3035
- kn as isCssEnumValue,
3036
- U as isCssVariableName,
3206
+ jr as AlignContentTypes,
3207
+ As as BreakpointVariantRender,
3208
+ ct as COLLECTION_TYPE_PREFIX,
3209
+ fe as COMPONENT_PROPS_PATH_SEPARATOR,
3210
+ _e as CSS_CLASSES_ATTRIBUTE_NAME,
3211
+ Fn as CSS_VARIABLE_NAME_MAX_LENGTH,
3212
+ Vn as CSS_VARIABLE_NAME_PATTERN,
3213
+ wt as DEFAULT_BASE_Z_INDEX,
3214
+ An as DEFAULT_CLOUDINARY_CLOUD_NAME,
3215
+ re as DEFAULT_LIBRARY_ID,
3216
+ $r as DEFAULT_PUBLISHED_WIDGET_CACHE_MS,
3217
+ jo as DEFAULT_ROW_GAP,
3218
+ ln as DEV_CLIENT_TOKEN_PREFIX,
3219
+ dn as DEV_WIDGET_API_PATH,
3220
+ fn as DEV_WIDGET_RESOLVE_API_PATH,
3221
+ Nr as DeviceDisplayTypes,
3222
+ Je as DisplayComponent,
3223
+ Pe as DisplayItemTypes,
3224
+ lt as DragItemIdPrefixTypes,
3225
+ bn as EMBEDDED_KEY_SEPARATOR,
3226
+ uo as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
3227
+ Y as FetchRuleCMSWidgetError,
3228
+ gt as HIDE_WIDGET_ATTRIBUTE_NAME,
3229
+ Ue as JustifyContentTypes,
3230
+ Ko as POINTER_EVENTS_ATTRIBUTE_NAME,
3231
+ Ee as PUBLISHED_KEY_SEPARATOR,
3232
+ un as PUBLISHED_WIDGET_API_PATH,
3233
+ pn as PUBLISHED_WIDGET_RESOLVE_API_PATH,
3234
+ Ke as PageViewTypes,
3235
+ Ze as RULECMS_ANONYMOUS_ID_STORAGE_KEY,
3236
+ cn as RULECMS_API_ORIGIN,
3237
+ Jr as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
3238
+ yt as RULECMS_WIDGET_CONTEXT_KEY,
3239
+ Ts as RenderComponents,
3240
+ ke as RenderComponentsForDevice,
3241
+ vs as RenderComponentsInner,
3242
+ qr as RuleCMSWidget,
3243
+ Hr as RuleCMSWidgetProvider,
3244
+ Uo as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
3245
+ an as WIDGET_CACHE_API_ORIGIN,
3246
+ Ge as WIDGET_PLACEHOLDER_VALUES_KEY,
3247
+ Go as Z_INDEX_WIDGET_ATTRIBUTE_NAME,
3248
+ io as alignContentAllowlist,
3249
+ oo as alignItemsAllowlist,
3250
+ co as backgroundPositionAllowlist,
3251
+ ao as backgroundRepeatAllowlist,
3252
+ lo as backgroundSizeAllowlist,
3253
+ po as borderStyleKeywords,
3254
+ Un as boxSpacingSideKeys,
3255
+ Xr as boxSpacingStyleAttributeEntries,
3256
+ Wn as buildCloudinaryBackgroundUrl,
3257
+ Qo as buildOverlayLayerBoxStyles,
3258
+ Zo as buildOverlayStackStyles,
3259
+ ut as buildWidgetFetchUrl,
3260
+ dt as buildWidgetResolveUrl,
3261
+ Zr as clearPublishedWidgetFetchCache,
3262
+ ns as collectComponentInstancePaths,
3263
+ De as collectReferencedLibraryIds,
3264
+ rn as composeSourceComponentsPlugin,
3265
+ pe as createComponentLibraryRegistry,
3266
+ Ae as cssAttrArrayKey,
3267
+ vn as defaultPageWidth,
3268
+ Ro as deriveDisplayFlexIfNeeded,
3269
+ Gr as desktopModeWidth,
3270
+ Qr as fetchRuleCMSWidget,
3271
+ ss as findUnmatchedComponentPropsKeys,
3272
+ ro as flexDirectionAllowlist,
3273
+ so as flexWrapAllowlist,
3274
+ Xn as fontFamilyAllowlist,
3275
+ qn as fontStyleAllowlist,
3276
+ Jn as fontWeightAllowlist,
3277
+ vo as formatBackgroundImageStyles,
3278
+ Ao as formatBorderStyles,
3279
+ Eo as formatBoxShadowStyles,
3280
+ ko as formatBoxSpacingStyles,
3281
+ To as formatCssColorStyles,
3282
+ Le as formatCssColorValue,
3283
+ Io as formatCssEnumStyles,
3284
+ Po as formatCssLengthStyles,
3285
+ W as formatCssVariable,
3286
+ Yr as formatCssVariableStyles,
3287
+ Do as formatLineHeightStyles,
3288
+ $o as formatObjectStyleAttribute,
3289
+ xo as formatOpacityStyles,
3290
+ Z as formatSpacingSideValue,
3291
+ Cn as generatePublishedKey,
3292
+ Ur as generatePublishedKeyForEmbedded,
3293
+ ft as getCollectionIdForCollectionType,
3294
+ ue as getColumnAttributes,
3295
+ ze as getComponentAttributesAndStyles,
3296
+ ve as getComponentsPluginFromPlugins,
3297
+ E as getCssVariableFromLeaf,
3298
+ _o as getDefaultDimensionAttributes,
3299
+ U as getDeviceTypeBasedAttributes,
3300
+ Wr as getDragItemId,
3301
+ yn as getDragItemPrefixAndId,
3302
+ mn as getIdAndPrefix,
3303
+ Oo as getMergedAttributes,
3304
+ Vr as getNameAndInstanceIdFromWidgetKey,
3305
+ Fr as getNameFromWidgetKey,
3306
+ Ar as getOrCreateAnonymousId,
3307
+ Xo as getOverlayLayerZIndex,
3308
+ hn as getWidgetKeyForCollection,
3309
+ Br as getWidgetKeyForCollectionWithPrefix,
3310
+ gn as getWidgetKeyForPublishedCollection,
3311
+ Kr as getWidgetKeyForPublishedCollectionWithPrefix,
3312
+ bo as hasBoxShadowLeaf,
3313
+ cs as hasDeviceDivergentValues,
3314
+ B as hasInvalidCssVariable,
3315
+ Mo as hasItems,
3316
+ Yo as hasOverlayLayers,
3317
+ zr as incrementVersion,
3318
+ Bn as isBackgroundImageValue,
3319
+ fo as isBorderStyleValue,
3320
+ yo as isBorderValue,
3321
+ go as isBoxShadowValue,
3322
+ zn as isBoxSpacingValue,
3323
+ _n as isCloudinaryCloudName,
3324
+ Rn as isCloudinaryPublicId,
3325
+ Mn as isCloudinaryTransformationString,
3326
+ $e as isCssColorValue,
3327
+ Yn as isCssEnumValue,
3328
+ Q as isCssVariableName,
3037
3329
  K as isDevClientToken,
3038
- Xn as isLineHeightValue,
3039
- Jn as isOpacityValue,
3040
- Po as isOverlayLayerEmptyForDevice,
3041
- ho as isRowHiddenForDevice,
3042
- pn as isSafeImageUrl,
3043
- z as isSpacingSideValue,
3044
- ve as isWidgetHiddenForDevice,
3045
- Rn as justifyContentAllowlist,
3046
- we as normalizeCssClasses,
3047
- be as objectStyleAttributeRegistry,
3048
- ie as overflowAllowlist,
3049
- Ze as phoneModeWidth,
3050
- xn as pointerEventsAllowlist,
3051
- Et as prepareRuleCMSWidgetData,
3052
- Oe as resolveBaseZIndex,
3053
- ze as resolveKey,
3054
- Io as resolveOverlayLayerPointerEvents,
3055
- go as resolveRowStyles,
3056
- Bt as resolveWidgetApiOrigin,
3057
- et as resolveWidgetContainerStyles,
3058
- Lo as resolveWidgetInstanceProps,
3059
- Cr as resolveWidgetLibraries,
3060
- mo as rowBasedPropertiesAreAssigned,
3061
- me as spacingKeywords,
3062
- wn as spacingLengthUnits,
3063
- qe as tabletModeWidth,
3064
- Dn as textAlignAllowlist,
3065
- $n as textDecorationAllowlist,
3066
- Ln as textTransformAllowlist,
3067
- Ge as typeHasPrefix,
3068
- _o as warnUnmatchedComponentProps,
3069
- So as widgetBasedPropertiesAreAssigned,
3070
- tt as widgetDeclaresOwnHeight
3330
+ Co as isLineHeightValue,
3331
+ wo as isOpacityValue,
3332
+ qo as isOverlayLayerEmptyForDevice,
3333
+ Wo as isRowHiddenForDevice,
3334
+ On as isSafeImageUrl,
3335
+ q as isSpacingSideValue,
3336
+ Me as isWidgetHiddenForDevice,
3337
+ no as justifyContentAllowlist,
3338
+ Oe as normalizeCssClasses,
3339
+ Re as objectStyleAttributeRegistry,
3340
+ Ce as overflowAllowlist,
3341
+ mt as phoneModeWidth,
3342
+ to as pointerEventsAllowlist,
3343
+ Ne as prepareRuleCMSWidgetData,
3344
+ He as resolveBaseZIndex,
3345
+ rt as resolveKey,
3346
+ Jo as resolveOverlayLayerPointerEvents,
3347
+ Vo as resolveRowStyles,
3348
+ at as resolveWidgetApiOrigin,
3349
+ bt as resolveWidgetContainerStyles,
3350
+ es as resolveWidgetInstanceProps,
3351
+ el as resolveWidgetLibraries,
3352
+ No as rowBasedPropertiesAreAssigned,
3353
+ xe as spacingKeywords,
3354
+ Kn as spacingLengthUnits,
3355
+ kr as stableJsonStringify,
3356
+ ht as tabletModeWidth,
3357
+ Zn as textAlignAllowlist,
3358
+ Qn as textDecorationAllowlist,
3359
+ eo as textTransformAllowlist,
3360
+ pt as typeHasPrefix,
3361
+ is as warnUnmatchedComponentProps,
3362
+ Ho as widgetBasedPropertiesAreAssigned,
3363
+ Ct as widgetDeclaresOwnHeight,
3364
+ ts as withWidgetPlaceholderValues
3071
3365
  };