@charisol/plexo-sdk 2.0.20 → 2.0.21

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.
@@ -14136,40 +14136,59 @@ function lo(e, t) {
14136
14136
  }
14137
14137
  //#endregion
14138
14138
  //#region src/v2/sol/describe.ts
14139
- var uo = (e, t = 60) => e.length > t ? `${e.slice(0, t - 1).trimEnd()}…` : e;
14140
- function fo(e, t = 0) {
14139
+ var uo = 60, fo = (e, t = 60) => e.length > t ? `${e.slice(0, t - 1).trimEnd()}…` : e;
14140
+ function po(e, t = 0) {
14141
14141
  if (typeof e.content == "string" && e.content.trim()) return e.content.trim();
14142
14142
  if (t > 6) return "";
14143
14143
  for (let n of e.children ?? []) {
14144
- let e = fo(n, t + 1);
14144
+ let e = po(n, t + 1);
14145
14145
  if (e) return e;
14146
14146
  }
14147
14147
  return "";
14148
14148
  }
14149
- function po(e) {
14149
+ function mo(e) {
14150
14150
  let t = H(e);
14151
14151
  if (!t) return "";
14152
14152
  let n = ji(t.kind) ? V(t.kind).fields : [];
14153
14153
  for (let e of n) {
14154
14154
  let n = t.content?.[e.key];
14155
- if ((e.type === "text" || e.type === "longtext") && typeof n == "string" && n.trim()) return uo(n.trim());
14155
+ if ((e.type === "text" || e.type === "longtext") && typeof n == "string" && n.trim()) return fo(n.trim());
14156
14156
  }
14157
14157
  return "";
14158
14158
  }
14159
- function mo(e) {
14159
+ function ho(e) {
14160
+ let t = [], n = (r, i) => {
14161
+ if (!(t.length >= uo || i > 12)) {
14162
+ if (r !== e) {
14163
+ let e = typeof r.content == "string" && r.content.trim() ? fo(r.content.trim(), 200) : void 0, n = typeof r.props?.href == "string" && r.props.href ? r.props.href : void 0, i = typeof r.props?.alt == "string" && r.props.alt ? fo(r.props.alt, 80) : void 0;
14164
+ (e || r.type === "image" && (i || r.id)) && t.push({
14165
+ id: r.id,
14166
+ type: r.type,
14167
+ ...e ? { text: e } : {},
14168
+ ...n ? { href: n } : {},
14169
+ ...i ? { alt: i } : {}
14170
+ });
14171
+ }
14172
+ for (let e of r.children ?? []) n(e, i + 1);
14173
+ }
14174
+ };
14175
+ return n(e, 0), t;
14176
+ }
14177
+ function go(e) {
14160
14178
  let t = H(e);
14161
14179
  return t ? {
14162
14180
  id: e.id,
14163
14181
  kind: t.kind,
14164
14182
  variant: t.variant,
14165
- preview: po(e)
14183
+ preview: mo(e)
14166
14184
  } : {
14167
14185
  id: e.id,
14168
- preview: uo(fo(e) || e.name || ""),
14169
- freeForm: !0
14186
+ preview: fo(po(e) || e.name || ""),
14187
+ freeForm: !0,
14188
+ elements: ho(e)
14170
14189
  };
14171
14190
  }
14172
- function ho(e, t) {
14191
+ function _o(e, t) {
14173
14192
  let n = (e) => {
14174
14193
  let n = ee(t, e);
14175
14194
  return n ? v(n) : void 0;
@@ -14180,7 +14199,7 @@ function ho(e, t) {
14180
14199
  name: e.name,
14181
14200
  slug: e.slug,
14182
14201
  ...e.isHome ? { isHome: !0 } : {},
14183
- sections: ve(e.rootNode).filter((e) => e.type === "section").map(mo)
14202
+ sections: ve(e.rootNode).filter((e) => e.type === "section").map(go)
14184
14203
  })),
14185
14204
  brand: {
14186
14205
  primaryColor: ee(t, "--color-brand-primary-500"),
@@ -14194,7 +14213,7 @@ function ho(e, t) {
14194
14213
  }
14195
14214
  //#endregion
14196
14215
  //#region src/v2/data/blankPage.ts
14197
- function go() {
14216
+ function vo() {
14198
14217
  let e = {
14199
14218
  id: k("page"),
14200
14219
  type: "page",
@@ -14227,7 +14246,7 @@ function go() {
14227
14246
  }
14228
14247
  //#endregion
14229
14248
  //#region src/v2/sol/schema.ts
14230
- var _o = a({
14249
+ var yo = a({
14231
14250
  background: u([
14232
14251
  "canvas",
14233
14252
  "surface",
@@ -14245,26 +14264,51 @@ var _o = a({
14245
14264
  "airy"
14246
14265
  ]).optional(),
14247
14266
  pinned: i().optional()
14248
- }).strict(), vo = d(n(), s()), yo = {
14267
+ }).strict(), bo = d(n(), s()), xo = {
14249
14268
  index: t().int().min(0).optional(),
14250
14269
  afterSectionId: n().optional()
14251
- }, bo = e("op", [
14252
- a({
14253
- op: l("addSection"),
14254
- pageId: n(),
14255
- kind: n(),
14256
- variant: n().optional(),
14257
- content: vo.optional(),
14258
- style: _o.optional(),
14259
- id: n().optional(),
14260
- ...yo
14261
- }),
14270
+ }, So = a({
14271
+ op: l("addSection"),
14272
+ pageId: n(),
14273
+ kind: n(),
14274
+ variant: n().optional(),
14275
+ content: bo.optional(),
14276
+ style: yo.optional(),
14277
+ id: n().optional(),
14278
+ ...xo
14279
+ }), Co = a({
14280
+ op: l("updateSection"),
14281
+ sectionId: n(),
14282
+ content: bo.optional(),
14283
+ variant: n().optional(),
14284
+ style: yo.optional()
14285
+ }), wo = a({
14286
+ fontSize: n().regex(/^\d+(\.\d+)?(px|rem|em|vw|%)$/).optional(),
14287
+ fontWeight: n().regex(/^[1-9]00$/).optional(),
14288
+ textAlign: u([
14289
+ "left",
14290
+ "center",
14291
+ "right"
14292
+ ]).optional(),
14293
+ textColor: n().max(80).optional(),
14294
+ lineHeight: n().regex(/^\d+(\.\d+)?(px|rem|em|%)?$/).optional(),
14295
+ letterSpacing: n().regex(/^-?\d+(\.\d+)?(px|em|rem)$/).optional(),
14296
+ textTransform: u([
14297
+ "none",
14298
+ "uppercase",
14299
+ "lowercase",
14300
+ "capitalize"
14301
+ ]).optional()
14302
+ }).strict(), To = e("op", [
14303
+ So,
14304
+ Co,
14262
14305
  a({
14263
- op: l("updateSection"),
14264
- sectionId: n(),
14265
- content: vo.optional(),
14266
- variant: n().optional(),
14267
- style: _o.optional()
14306
+ op: l("updateElement"),
14307
+ nodeId: n(),
14308
+ text: n().max(2e3).optional(),
14309
+ href: n().max(2e3).optional(),
14310
+ alt: n().max(500).optional(),
14311
+ style: wo.optional()
14268
14312
  }),
14269
14313
  a({
14270
14314
  op: l("removeSection"),
@@ -14273,7 +14317,7 @@ var _o = a({
14273
14317
  a({
14274
14318
  op: l("moveSection"),
14275
14319
  sectionId: n(),
14276
- ...yo
14320
+ ...xo
14277
14321
  }),
14278
14322
  a({
14279
14323
  op: l("duplicateSection"),
@@ -14293,52 +14337,52 @@ var _o = a({
14293
14337
  pageId: n(),
14294
14338
  name: n().min(1)
14295
14339
  })
14296
- ]), xo = (e) => Sa.some((t) => t.id === e) ? Aa(e, { seed: k("tpl") }) : null;
14297
- function So(e) {
14298
- xo = e;
14340
+ ]), Eo = (e) => Sa.some((t) => t.id === e) ? Aa(e, { seed: k("tpl") }) : null;
14341
+ function Do(e) {
14342
+ Eo = e;
14299
14343
  }
14300
14344
  var U = (e) => ({
14301
14345
  ok: !1,
14302
14346
  message: e
14303
- }), Co = (e, t) => ({
14347
+ }), Oo = (e, t) => ({
14304
14348
  ok: !0,
14305
14349
  message: e,
14306
14350
  ...t ? { sectionId: t } : {}
14307
- }), wo = () => ki.map((e) => e.kind).join(", "), To = (e) => e.type === "section", Eo = (e, t) => e.find((e) => e.id === t) ?? e.find((e) => e.name.trim().toLowerCase() === t.trim().toLowerCase()), Do = (e, t) => {
14351
+ }), ko = () => ki.map((e) => e.kind).join(", "), Ao = (e) => e.type === "section", jo = (e, t) => e.find((e) => e.id === t) ?? e.find((e) => e.name.trim().toLowerCase() === t.trim().toLowerCase()), Mo = (e, t) => {
14308
14352
  for (let n of e) {
14309
- let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t && To(e));
14353
+ let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t && Ao(e));
14310
14354
  if (e >= 0) return {
14311
14355
  page: n,
14312
14356
  index: e
14313
14357
  };
14314
14358
  }
14315
14359
  return null;
14316
- }, Oo = (e, t, n) => e.map((e) => e.id === t ? {
14360
+ }, No = (e, t, n) => e.map((e) => e.id === t ? {
14317
14361
  ...e,
14318
14362
  rootNode: {
14319
14363
  ...e.rootNode,
14320
14364
  children: n
14321
14365
  }
14322
- } : e), ko = (e) => e.rootNode.children ?? [], Ao = (e) => U(`I couldn't find a section called "${e}". It may have been removed already.`), jo = (e) => {
14366
+ } : e), W = (e) => e.rootNode.children ?? [], Po = (e) => U(`I couldn't find a section called "${e}". It may have been removed already.`), Fo = (e) => {
14323
14367
  let t = H(e);
14324
14368
  return t && ji(t.kind) ? V(t.kind).label : e.name || "section";
14325
14369
  };
14326
- function Mo(e, t, n) {
14370
+ function Io(e, t, n) {
14327
14371
  if (t.afterSectionId !== void 0) {
14328
14372
  let n = e.findIndex((e) => e.id === t.afterSectionId);
14329
14373
  return n < 0 ? { error: `I couldn't find the section to place it after ("${t.afterSectionId}").` } : { index: n + 1 };
14330
14374
  }
14331
14375
  return t.index === void 0 ? { index: n } : { index: Math.min(t.index, e.length) };
14332
14376
  }
14333
- var No = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
14334
- function Po(e) {
14377
+ var Lo = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
14378
+ function Ro(e) {
14335
14379
  return {
14336
14380
  ...e,
14337
14381
  id: k("node"),
14338
- children: e.children?.map(Po)
14382
+ children: e.children?.map(Ro)
14339
14383
  };
14340
14384
  }
14341
- var Fo = (e, t) => {
14385
+ var zo = (e, t) => {
14342
14386
  let [n, ...r] = t, i = e.find((e) => e.key === n);
14343
14387
  return i ? r.length ? i.type === "list" && /^\d+$/.test(r[0]) ? r.length === 1 ? {
14344
14388
  ...i,
@@ -14348,9 +14392,9 @@ var Fo = (e, t) => {
14348
14392
  itemName: i.itemName,
14349
14393
  label: i.itemName ?? i.label,
14350
14394
  limit: -1
14351
- } : Fo(i.item ?? [], r.slice(1)) : null : i : null;
14352
- }, Io = (e) => !!e && typeof e == "object" && !Array.isArray(e);
14353
- function Lo(e, t, n) {
14395
+ } : zo(i.item ?? [], r.slice(1)) : null : i : null;
14396
+ }, Bo = (e) => !!e && typeof e == "object" && !Array.isArray(e);
14397
+ function Vo(e, t, n) {
14354
14398
  switch (e.type) {
14355
14399
  case "text":
14356
14400
  case "longtext":
@@ -14363,53 +14407,53 @@ function Lo(e, t, n) {
14363
14407
  return typeof t == "string" && (!r.length || r.includes(t)) ? null : `"${n}" should be one of: ${r.join(", ")}.`;
14364
14408
  }
14365
14409
  case "button":
14366
- if (!Io(t)) return `"${n}" should be a button with a label and a link.`;
14410
+ if (!Bo(t)) return `"${n}" should be a button with a label and a link.`;
14367
14411
  for (let [e, r] of Object.entries(t)) if (!["label", "href"].includes(e) || typeof r != "string") return `"${n}" can only have a label and a link, both text.`;
14368
14412
  return null;
14369
14413
  case "list":
14370
14414
  if (!Array.isArray(t)) return `"${n}" should be a list.`;
14371
14415
  if (e.limit && e.limit > 0 && t.length > e.limit) return `"${n}" can have at most ${e.limit} ${e.itemName ?? "item"}s.`;
14372
14416
  for (let [r, i] of t.entries()) {
14373
- let t = Ro(e.item ?? [], i, `${n} ${r + 1}`);
14417
+ let t = Ho(e.item ?? [], i, `${n} ${r + 1}`);
14374
14418
  if (t) return t;
14375
14419
  }
14376
14420
  return null;
14377
14421
  }
14378
14422
  }
14379
- function Ro(e, t, n) {
14380
- if (!Io(t)) return `${n} should be a group of fields.`;
14423
+ function Ho(e, t, n) {
14424
+ if (!Bo(t)) return `${n} should be a group of fields.`;
14381
14425
  for (let [r, i] of Object.entries(t)) {
14382
14426
  let t = e.find((e) => e.key === r);
14383
14427
  if (!t) return `${n} has a field "${r}" that doesn't exist. Available: ${e.map((e) => e.key).join(", ")}.`;
14384
- let a = Lo(t, i, `${n} ${t.label.toLowerCase()}`);
14428
+ let a = Vo(t, i, `${n} ${t.label.toLowerCase()}`);
14385
14429
  if (a) return a;
14386
14430
  }
14387
14431
  return null;
14388
14432
  }
14389
- function zo(e, t) {
14433
+ function Uo(e, t) {
14390
14434
  let n = V(e);
14391
14435
  for (let [e, r] of Object.entries(t)) {
14392
- let t = Fo(n.fields, e.split(".").filter(Boolean));
14436
+ let t = zo(n.fields, e.split(".").filter(Boolean));
14393
14437
  if (!t) return `A ${n.label.toLowerCase()} section has no "${e}" field. The fields are: ${n.fields.map((e) => e.key).join(", ")}.`;
14394
14438
  if (t.limit === -1) {
14395
- let e = Ro(t.item ?? [], r, t.label);
14439
+ let e = Ho(t.item ?? [], r, t.label);
14396
14440
  if (e) return e;
14397
14441
  continue;
14398
14442
  }
14399
- let i = Lo(t, r, t.label);
14443
+ let i = Vo(t, r, t.label);
14400
14444
  if (i) return i;
14401
14445
  }
14402
14446
  return null;
14403
14447
  }
14404
- var Bo = (e, t) => Object.entries(t).reduce((e, [t, n]) => Zi(e, t, n), e), Vo = [
14448
+ var Wo = (e, t) => Object.entries(t).reduce((e, [t, n]) => Zi(e, t, n), e), Go = [
14405
14449
  "primaryColor",
14406
14450
  "secondaryColor",
14407
14451
  "headingFont",
14408
14452
  "bodyFont",
14409
14453
  "neutrals",
14410
14454
  "roundness"
14411
- ], Ho = (e) => new Set(re(e).map((e) => `${e.kind}:${e.key}`));
14412
- function Uo(e, t) {
14455
+ ], Ko = (e) => new Set(re(e).map((e) => `${e.kind}:${e.key}`));
14456
+ function qo(e, t) {
14413
14457
  let n = e, r = [];
14414
14458
  for (let [i, a] of Object.entries(t)) {
14415
14459
  let t = String(a).trim();
@@ -14457,7 +14501,7 @@ function Uo(e, t) {
14457
14501
  default: {
14458
14502
  if (!i.startsWith("--")) return {
14459
14503
  ds: e,
14460
- result: U(`I don't know the brand setting "${i}". I can change: ${Vo.join(", ")}.`)
14504
+ result: U(`I don't know the brand setting "${i}". I can change: ${Go.join(", ")}.`)
14461
14505
  };
14462
14506
  let a = ne(n, i);
14463
14507
  if (!a) return {
@@ -14472,16 +14516,50 @@ function Uo(e, t) {
14472
14516
  ds: e,
14473
14517
  result: U("There was nothing to change in the brand.")
14474
14518
  };
14475
- let i = Ho(e), a = re(n).filter((e) => !i.has(`${e.kind}:${e.key}`));
14519
+ let i = Ko(e), a = re(n).filter((e) => !i.has(`${e.kind}:${e.key}`));
14476
14520
  return a.length ? {
14477
14521
  ds: e,
14478
14522
  result: U(`That brand change wouldn't work: ${a[0].message}`)
14479
14523
  } : {
14480
14524
  ds: te(n),
14481
- result: Co(`Updated the brand (${r.join(", ")}).`)
14525
+ result: Oo(`Updated the brand (${r.join(", ")}).`)
14482
14526
  };
14483
14527
  }
14484
- function Wo(e, t, n, r) {
14528
+ var Jo = /* @__PURE__ */ new Set([
14529
+ "heading",
14530
+ "paragraph",
14531
+ "button",
14532
+ "badge"
14533
+ ]), Yo = (e, t, n) => e.id === t ? n(e) : e.children ? {
14534
+ ...e,
14535
+ children: e.children.map((e) => Yo(e, t, n))
14536
+ } : e, Xo = (e, t) => e.id === t || (e.children ?? []).some((e) => Xo(e, t));
14537
+ function Zo(e, t) {
14538
+ for (let n of e) {
14539
+ let e = W(n);
14540
+ for (let r = 0; r < e.length; r++) if (e[r].id !== t && Xo(e[r], t)) {
14541
+ let i = null;
14542
+ return Yo(e[r], t, (e) => (i = e, e)), {
14543
+ page: n,
14544
+ index: r,
14545
+ node: i
14546
+ };
14547
+ }
14548
+ }
14549
+ return null;
14550
+ }
14551
+ var Qo = (e) => {
14552
+ let t = (e.content ?? e.props?.alt ?? "").toString().trim();
14553
+ return t ? `"${t.length > 40 ? `${t.slice(0, 39).trimEnd()}…` : t}"` : `the ${e.type}`;
14554
+ };
14555
+ function $o(e, t) {
14556
+ let n = Zo(e, t);
14557
+ return n ? {
14558
+ label: Qo(n.node),
14559
+ page: n.page.name
14560
+ } : { label: "an element" };
14561
+ }
14562
+ function es(e, t, n, r) {
14485
14563
  let i = (n) => ({
14486
14564
  pages: e,
14487
14565
  ds: t,
@@ -14489,23 +14567,23 @@ function Wo(e, t, n, r) {
14489
14567
  });
14490
14568
  switch (n.op) {
14491
14569
  case "addSection": {
14492
- let r = Eo(e, n.pageId);
14570
+ let r = jo(e, n.pageId);
14493
14571
  if (!r) return i(U(`I couldn't find a page called "${n.pageId}".`));
14494
- if (!ji(n.kind)) return i(U(`I don't know a "${n.kind}" section. The ones I can add are: ${wo()}.`));
14572
+ if (!ji(n.kind)) return i(U(`I don't know a "${n.kind}" section. The ones I can add are: ${ko()}.`));
14495
14573
  let a = V(n.kind);
14496
14574
  if (n.variant && !a.variants.some((e) => e.id === n.variant)) return i(U(`A ${a.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${a.variants.map((e) => e.id).join(", ")}.`));
14497
14575
  if (n.content) {
14498
- let e = zo(n.kind, n.content);
14576
+ let e = Uo(n.kind, n.content);
14499
14577
  if (e) return i(U(e));
14500
14578
  }
14501
14579
  let o = Fi(n.kind, n.variant), s = {
14502
14580
  ...o,
14503
- content: n.content ? Bo(o.content, n.content) : o.content,
14581
+ content: n.content ? Wo(o.content, n.content) : o.content,
14504
14582
  style: {
14505
14583
  ...o.style,
14506
14584
  ...n.style
14507
14585
  }
14508
- }, c = ko(r), l = new Set(e.flatMap((e) => ko(e).map((e) => e.id))), u = n.id && /^[A-Za-z0-9_-]{1,40}$/.test(n.id) && !l.has(n.id) ? n.id : k("section"), d = Mo(c, n, n.kind === "header" ? 0 : n.kind !== "footer" && c[c.length - 1] && H(c[c.length - 1])?.kind === "footer" ? c.length - 1 : c.length);
14586
+ }, c = W(r), l = new Set(e.flatMap((e) => W(e).map((e) => e.id))), u = n.id && /^[A-Za-z0-9_-]{1,40}$/.test(n.id) && !l.has(n.id) ? n.id : k("section"), d = Io(c, n, n.kind === "header" ? 0 : n.kind !== "footer" && c[c.length - 1] && H(c[c.length - 1])?.kind === "footer" ? c.length - 1 : c.length);
14509
14587
  if ("error" in d) return i(U(d.error));
14510
14588
  let f = [
14511
14589
  ...c.slice(0, d.index),
@@ -14513,21 +14591,21 @@ function Wo(e, t, n, r) {
14513
14591
  ...c.slice(d.index)
14514
14592
  ];
14515
14593
  return {
14516
- pages: Oo(e, r.id, f),
14594
+ pages: No(e, r.id, f),
14517
14595
  ds: t,
14518
- result: Co(`Added a ${a.label.toLowerCase()} section to ${r.name}.`, u)
14596
+ result: Oo(`Added a ${a.label.toLowerCase()} section to ${r.name}.`, u)
14519
14597
  };
14520
14598
  }
14521
14599
  case "updateSection": {
14522
- let r = Do(e, n.sectionId);
14523
- if (!r) return i(Ao(n.sectionId));
14524
- let a = ko(r.page)[r.index], o = H(a);
14525
- if (!o) return i(U("That section was designed by hand, so I can't change its words safely. You can edit it directly, or I can add a new section instead."));
14600
+ let r = Mo(e, n.sectionId);
14601
+ if (!r) return i(Po(n.sectionId));
14602
+ let a = W(r.page)[r.index], o = H(a);
14603
+ if (!o) return i(U("That section was designed by hand, so its words aren't fields: change the elements inside it one at a time instead."));
14526
14604
  if (n.content === void 0 && n.variant === void 0 && n.style === void 0) return i(U("There was nothing to change in that section."));
14527
14605
  let s = V(o.kind);
14528
14606
  if (n.variant && !s.variants.some((e) => e.id === n.variant)) return i(U(`A ${s.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${s.variants.map((e) => e.id).join(", ")}.`));
14529
14607
  if (n.content) {
14530
- let e = zo(o.kind, n.content);
14608
+ let e = Uo(o.kind, n.content);
14531
14609
  if (e) return i(U(e));
14532
14610
  }
14533
14611
  let c = a;
@@ -14535,34 +14613,68 @@ function Wo(e, t, n, r) {
14535
14613
  let e = H(c);
14536
14614
  c = Qi(c, {
14537
14615
  ...e,
14538
- content: Bo(e.content, n.content)
14616
+ content: Wo(e.content, n.content)
14539
14617
  });
14540
14618
  }
14541
14619
  n.style && (c = na(c, n.style));
14542
- let l = ko(r.page).map((e, t) => t === r.index ? c : e);
14620
+ let l = W(r.page).map((e, t) => t === r.index ? c : e);
14621
+ return {
14622
+ pages: No(e, r.page.id, l),
14623
+ ds: t,
14624
+ result: Oo(`Updated the ${s.label.toLowerCase()} section on ${r.page.name}.`, a.id)
14625
+ };
14626
+ }
14627
+ case "updateElement": {
14628
+ let r = Zo(e, n.nodeId);
14629
+ if (!r) return i(U(`I couldn't find an element called "${n.nodeId}" on the site. It may have been removed already.`));
14630
+ let a = W(r.page)[r.index];
14631
+ if (H(a)) return i(U("That element belongs to a ready-made section, so change it through the section (its wording and layout) instead."));
14632
+ if (n.text === void 0 && n.href === void 0 && n.alt === void 0 && n.style === void 0) return i(U("There was nothing to change in that element."));
14633
+ let o = r.node;
14634
+ if (n.text !== void 0 && !Jo.has(o.type) && typeof o.content != "string") return i(U(`That ${o.type} has no words to change.`));
14635
+ if (n.href !== void 0 && /^\s*(javascript|data|vbscript):/i.test(n.href)) return i(U("That link isn't one I can use. Use a page address like /about or a full https:// address."));
14636
+ if (n.alt !== void 0 && o.type !== "image") return i(U("Only a picture has a picture description."));
14637
+ let s = Qo(o), c = Yo(a, n.nodeId, (e) => ({
14638
+ ...e,
14639
+ ...n.text === void 0 ? {} : { content: n.text },
14640
+ ...n.href !== void 0 || n.alt !== void 0 ? { props: {
14641
+ ...e.props,
14642
+ ...n.href === void 0 ? {} : { href: n.href },
14643
+ ...n.alt === void 0 ? {} : { alt: n.alt }
14644
+ } } : {},
14645
+ ...n.style ? { styles: {
14646
+ ...e.styles,
14647
+ ...n.style
14648
+ } } : {}
14649
+ })), l = W(r.page).map((e, t) => t === r.index ? c : e), u = [
14650
+ n.text !== void 0 && "wording",
14651
+ n.href !== void 0 && "link",
14652
+ n.alt !== void 0 && "picture description",
14653
+ n.style && "look"
14654
+ ].filter(Boolean).join(" and ");
14543
14655
  return {
14544
- pages: Oo(e, r.page.id, l),
14656
+ pages: No(e, r.page.id, l),
14545
14657
  ds: t,
14546
- result: Co(`Updated the ${s.label.toLowerCase()} section on ${r.page.name}.`, a.id)
14658
+ result: Oo(`Changed the ${u} of ${s} on ${r.page.name}.`, a.id)
14547
14659
  };
14548
14660
  }
14549
14661
  case "removeSection": {
14550
- let r = Do(e, n.sectionId);
14551
- if (!r) return i(Ao(n.sectionId));
14552
- let a = ko(r.page)[r.index];
14662
+ let r = Mo(e, n.sectionId);
14663
+ if (!r) return i(Po(n.sectionId));
14664
+ let a = W(r.page)[r.index];
14553
14665
  return {
14554
- pages: Oo(e, r.page.id, ko(r.page).filter((e, t) => t !== r.index)),
14666
+ pages: No(e, r.page.id, W(r.page).filter((e, t) => t !== r.index)),
14555
14667
  ds: t,
14556
- result: Co(`Removed the ${jo(a).toLowerCase()} section from ${r.page.name}.`)
14668
+ result: Oo(`Removed the ${Fo(a).toLowerCase()} section from ${r.page.name}.`)
14557
14669
  };
14558
14670
  }
14559
14671
  case "moveSection": {
14560
- let r = Do(e, n.sectionId);
14561
- if (!r) return i(Ao(n.sectionId));
14672
+ let r = Mo(e, n.sectionId);
14673
+ if (!r) return i(Po(n.sectionId));
14562
14674
  if (n.index === void 0 && n.afterSectionId === void 0) return i(U("I need to know where to move it to."));
14563
- let a = ko(r.page)[r.index];
14675
+ let a = W(r.page)[r.index];
14564
14676
  if (n.afterSectionId === n.sectionId) return i(U("A section can't be moved after itself."));
14565
- let o = ko(r.page).filter((e, t) => t !== r.index), s = Mo(o, n, o.length);
14677
+ let o = W(r.page).filter((e, t) => t !== r.index), s = Io(o, n, o.length);
14566
14678
  if ("error" in s) return i(U(s.error));
14567
14679
  let c = [
14568
14680
  ...o.slice(0, s.index),
@@ -14570,30 +14682,30 @@ function Wo(e, t, n, r) {
14570
14682
  ...o.slice(s.index)
14571
14683
  ];
14572
14684
  return {
14573
- pages: Oo(e, r.page.id, c),
14685
+ pages: No(e, r.page.id, c),
14574
14686
  ds: t,
14575
- result: Co(`Moved the ${jo(a).toLowerCase()} section on ${r.page.name}.`, a.id)
14687
+ result: Oo(`Moved the ${Fo(a).toLowerCase()} section on ${r.page.name}.`, a.id)
14576
14688
  };
14577
14689
  }
14578
14690
  case "duplicateSection": {
14579
- let r = Do(e, n.sectionId);
14580
- if (!r) return i(Ao(n.sectionId));
14581
- let a = ko(r.page), o = a[r.index], s = k("section"), c = H(o), l = c ? Ji(c, s) : {
14582
- ...Po(o),
14691
+ let r = Mo(e, n.sectionId);
14692
+ if (!r) return i(Po(n.sectionId));
14693
+ let a = W(r.page), o = a[r.index], s = k("section"), c = H(o), l = c ? Ji(c, s) : {
14694
+ ...Ro(o),
14583
14695
  id: s
14584
14696
  };
14585
14697
  return {
14586
- pages: Oo(e, r.page.id, [
14698
+ pages: No(e, r.page.id, [
14587
14699
  ...a.slice(0, r.index + 1),
14588
14700
  l,
14589
14701
  ...a.slice(r.index + 1)
14590
14702
  ]),
14591
14703
  ds: t,
14592
- result: Co(`Copied the ${jo(o).toLowerCase()} section on ${r.page.name}.`, s)
14704
+ result: Oo(`Copied the ${Fo(o).toLowerCase()} section on ${r.page.name}.`, s)
14593
14705
  };
14594
14706
  }
14595
14707
  case "setBrand": {
14596
- let r = Uo(t, n.tokens);
14708
+ let r = qo(t, n.tokens);
14597
14709
  return {
14598
14710
  pages: e,
14599
14711
  ds: r.ds,
@@ -14608,15 +14720,15 @@ function Wo(e, t, n, r) {
14608
14720
  if (n.templateId) {
14609
14721
  let e = null;
14610
14722
  try {
14611
- e = (r.templates ?? xo)?.(n.templateId) ?? null;
14723
+ e = (r.templates ?? Eo)?.(n.templateId) ?? null;
14612
14724
  } catch {
14613
14725
  e = null;
14614
14726
  }
14615
14727
  e ? o = e : s = ` (I couldn't find the "${n.templateId}" starting layout, so it's blank.)`;
14616
14728
  }
14617
- let c = new Set(e.map((e) => e.slug)), l = No(a), u = l;
14729
+ let c = new Set(e.map((e) => e.slug)), l = Lo(a), u = l;
14618
14730
  for (let e = 2; c.has(u); e++) u = `${l}-${e}`;
14619
- let d = go()[0], f = {
14731
+ let d = vo()[0], f = {
14620
14732
  id: k("page"),
14621
14733
  name: a,
14622
14734
  slug: u,
@@ -14629,11 +14741,11 @@ function Wo(e, t, n, r) {
14629
14741
  return {
14630
14742
  pages: [...e, f],
14631
14743
  ds: t,
14632
- result: Co(`Added a new page called ${a}.${s}`)
14744
+ result: Oo(`Added a new page called ${a}.${s}`)
14633
14745
  };
14634
14746
  }
14635
14747
  case "renamePage": {
14636
- let r = Eo(e, n.pageId);
14748
+ let r = jo(e, n.pageId);
14637
14749
  if (!r) return i(U(`I couldn't find a page called "${n.pageId}".`));
14638
14750
  let a = n.name.trim();
14639
14751
  return e.some((e) => e.id !== r.id && e.name.trim().toLowerCase() === a.toLowerCase()) ? i(U(`There's already a page called "${a}".`)) : {
@@ -14642,22 +14754,22 @@ function Wo(e, t, n, r) {
14642
14754
  name: a
14643
14755
  } : e),
14644
14756
  ds: t,
14645
- result: Co(`Renamed ${r.name} to ${a}.`)
14757
+ result: Oo(`Renamed ${r.name} to ${a}.`)
14646
14758
  };
14647
14759
  }
14648
14760
  }
14649
14761
  }
14650
- function Go(e, t, n, r = {}) {
14762
+ function ts(e, t, n, r = {}) {
14651
14763
  let i = e, a = t, o = [];
14652
14764
  for (let e of Array.isArray(n) ? n : []) {
14653
- let t = bo.safeParse(e);
14765
+ let t = To.safeParse(e);
14654
14766
  if (!t.success) {
14655
- let t = Io(e) && typeof e.op == "string" ? e.op : "";
14767
+ let t = Bo(e) && typeof e.op == "string" ? e.op : "";
14656
14768
  o.push(U(t ? `I didn't understand one of the "${t}" changes, so I skipped it.` : "I didn't understand one of the changes, so I skipped it."));
14657
14769
  continue;
14658
14770
  }
14659
14771
  try {
14660
- let e = Wo(i, a, t.data, r);
14772
+ let e = es(i, a, t.data, r);
14661
14773
  i = e.pages, a = e.ds, o.push(e.result);
14662
14774
  } catch {
14663
14775
  o.push(U("Something went wrong with one of the changes, so I skipped it."));
@@ -14671,8 +14783,8 @@ function Go(e, t, n, r = {}) {
14671
14783
  }
14672
14784
  //#endregion
14673
14785
  //#region src/v2/sol/parse.ts
14674
- var Ko = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*?)```/i, qo = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*)$/i;
14675
- function Jo(e) {
14786
+ var ns = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*?)```/i, rs = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*)$/i;
14787
+ function is(e) {
14676
14788
  let t = "", n = !1;
14677
14789
  for (let r = 0; r < e.length; r++) {
14678
14790
  let i = e[r];
@@ -14697,15 +14809,15 @@ function Jo(e) {
14697
14809
  }
14698
14810
  return t;
14699
14811
  }
14700
- function Yo(e) {
14701
- let t = Ko.exec(e), n = t ? null : qo.exec(e), r = t ?? n;
14812
+ function as(e) {
14813
+ let t = ns.exec(e), n = t ? null : rs.exec(e), r = t ?? n;
14702
14814
  if (!r) return {
14703
14815
  text: e.trim(),
14704
14816
  commands: null
14705
14817
  };
14706
14818
  let i = e.replace(r[0], "").replace(/\n{3,}/g, "\n\n").trim(), a;
14707
14819
  try {
14708
- a = JSON.parse(Jo(r[1].trim()));
14820
+ a = JSON.parse(is(r[1].trim()));
14709
14821
  } catch {
14710
14822
  return {
14711
14823
  text: i,
@@ -14721,7 +14833,7 @@ function Yo(e) {
14721
14833
  };
14722
14834
  let s = [];
14723
14835
  for (let e of o) {
14724
- let t = bo.safeParse(e);
14836
+ let t = To.safeParse(e);
14725
14837
  t.success && s.push(t.data);
14726
14838
  }
14727
14839
  let c = o.length - s.length;
@@ -14735,18 +14847,18 @@ function Yo(e) {
14735
14847
  error: o.length ? "I couldn't understand the changes SOL suggested. Try asking again." : void 0
14736
14848
  };
14737
14849
  }
14738
- var Xo = /```[ \t]*plexo-commands[ \t]*\r?\n/i, Zo = "```plexo-commands";
14739
- function Qo(e) {
14850
+ var os = /```[ \t]*plexo-commands[ \t]*\r?\n/i, ss = "```plexo-commands";
14851
+ function cs(e) {
14740
14852
  for (let t = Math.min(19, e.length); t >= 3; t--) {
14741
14853
  let n = e.slice(-t);
14742
- if (n[0] === "`" && Zo.startsWith(n.trimEnd().toLowerCase())) return e.slice(0, -t);
14854
+ if (n[0] === "`" && ss.startsWith(n.trimEnd().toLowerCase())) return e.slice(0, -t);
14743
14855
  }
14744
14856
  return e;
14745
14857
  }
14746
- function $o(e) {
14747
- let t = Xo.exec(e);
14858
+ function ls(e) {
14859
+ let t = os.exec(e);
14748
14860
  if (!t) return {
14749
- text: Qo(e).trim(),
14861
+ text: cs(e).trim(),
14750
14862
  commands: [],
14751
14863
  writing: !1
14752
14864
  };
@@ -14765,11 +14877,11 @@ function $o(e) {
14765
14877
  if (e--, e === 1 && n !== -1) {
14766
14878
  let e;
14767
14879
  try {
14768
- e = JSON.parse(Jo(a.slice(n, r + 1)));
14880
+ e = JSON.parse(is(a.slice(n, r + 1)));
14769
14881
  } catch {
14770
14882
  e = void 0;
14771
14883
  }
14772
- let t = bo.safeParse(e);
14884
+ let t = To.safeParse(e);
14773
14885
  s.push(t.success ? t.data : null), n = -1;
14774
14886
  }
14775
14887
  } else i === "[" ? e++ : i === "]" && e--;
@@ -14783,7 +14895,7 @@ function $o(e) {
14783
14895
  }
14784
14896
  //#endregion
14785
14897
  //#region src/v2/sol/summarize.ts
14786
- var es = {
14898
+ var us = {
14787
14899
  primaryColor: "main colour",
14788
14900
  secondaryColor: "second colour",
14789
14901
  headingFont: "heading font",
@@ -14791,7 +14903,7 @@ var es = {
14791
14903
  neutrals: "background feel",
14792
14904
  roundness: "corner roundness"
14793
14905
  };
14794
- function ts(e, t) {
14906
+ function ds(e, t) {
14795
14907
  let n = (e) => t.find((t) => t.id === e || t.name.toLowerCase() === e.toLowerCase()), r = (e) => {
14796
14908
  for (let n of t) {
14797
14909
  let t = (n.rootNode.children ?? []).find((t) => t.id === e);
@@ -14815,25 +14927,34 @@ function ts(e, t) {
14815
14927
  e.variant && "the layout",
14816
14928
  e.style && "the look"
14817
14929
  ].filter(Boolean).join(" and ") || "it"} of ${i(e.sectionId)}${a(e.sectionId)}`;
14930
+ case "updateElement": {
14931
+ let n = $o(t, e.nodeId);
14932
+ return `Change ${[
14933
+ e.text !== void 0 && "the wording",
14934
+ e.href !== void 0 && "the link",
14935
+ e.alt !== void 0 && "the picture description",
14936
+ e.style && "the look"
14937
+ ].filter(Boolean).join(" and ") || "it"} of ${n.label}${n.page ? ` on ${n.page}` : ""}`;
14938
+ }
14818
14939
  case "removeSection": return `Remove ${i(e.sectionId)}${a(e.sectionId)}`;
14819
14940
  case "moveSection": return `Move ${i(e.sectionId)}${a(e.sectionId)}`;
14820
14941
  case "duplicateSection": return `Make a copy of ${i(e.sectionId)}${a(e.sectionId)}`;
14821
- case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => es[e] ?? "a brand setting").join(", ")})`;
14942
+ case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => us[e] ?? "a brand setting").join(", ")})`;
14822
14943
  case "addPage": return `Add a new page called "${e.name}"`;
14823
14944
  case "renamePage": return `Rename ${n(e.pageId)?.name ?? "a page"} to "${e.name}"`;
14824
14945
  }
14825
14946
  }
14826
14947
  //#endregion
14827
14948
  //#region src/v2/sol/prompt.ts
14828
- var ns = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm in \"design\" were designed by hand: you may move, copy or remove them but not edit their content. Add a new section instead.\n- If you only need to answer a question or give advice, reply in plain text with no block.", rs = 16;
14829
- function is(e, t, n = 0) {
14949
+ var fs = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"updateElement\", \"nodeId\": \"<element id>\", \"text\": \"...\", \"href\": \"/about\", \"alt\": \"...\", \"style\": {\"fontSize\": \"56px\", \"fontWeight\": \"700\", \"textAlign\": \"center\", \"textColor\": \"#111111\", \"lineHeight\": \"1.1\", \"letterSpacing\": \"-0.02em\", \"textTransform\": \"none\"}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm in \"design\" were designed by hand, so they have no fields: change what is inside them with updateElement, using the element ids listed in that section's \"elements\" (headlines, paragraphs, buttons, pictures). \"text\" replaces its words, \"href\" its link, \"alt\" a picture's description, and \"style\" only the keys shown above. Each updateElement changes one element; send one per element. For a managed section (one with a kind) always use updateSection instead.\n- When the owner has selected an element, \"Asking about\" gives its id: edit that element, not a different one. Make real, specific changes: a punchier headline is new words, not a restyle.\n- If you only need to answer a question or give advice, reply in plain text with no block.", ps = 16;
14950
+ function ms(e, t, n = 0) {
14830
14951
  return n > 12 ? e : e.replace(/var\(\s*(--[A-Za-z0-9_-]+)\s*(?:,\s*((?:[^()]|\([^()]*\))*))?\)/g, (e, r, i) => {
14831
14952
  let a = t.get(r);
14832
- return a ? is(O(a), t, n + 1) : i === void 0 ? "NaN" : is(i.trim(), t, n + 1);
14953
+ return a ? ms(O(a), t, n + 1) : i === void 0 ? "NaN" : ms(i.trim(), t, n + 1);
14833
14954
  });
14834
14955
  }
14835
- function as(e, t) {
14836
- let n = is(e.trim(), t.tokens ?? /* @__PURE__ */ new Map()), r = 0, i = () => {
14956
+ function hs(e, t) {
14957
+ let n = ms(e.trim(), t.tokens ?? /* @__PURE__ */ new Map()), r = 0, i = () => {
14837
14958
  for (; r < n.length && /\s/.test(n[r]);) r += 1;
14838
14959
  }, a = () => {
14839
14960
  throw Error("bad");
@@ -14922,57 +15043,57 @@ function as(e, t) {
14922
15043
  return null;
14923
15044
  }
14924
15045
  }
14925
- var os = {
15046
+ var gs = {
14926
15047
  tablet: .8,
14927
15048
  mobile: .6
14928
- }, ss = 40;
14929
- function cs(e, t) {
15049
+ }, _s = 40;
15050
+ function vs(e, t) {
14930
15051
  return t === "desktop" || e.responsive?.tablet?.fontSize !== void 0 ? !1 : t === "tablet" || e.responsive?.mobile?.fontSize === void 0;
14931
15052
  }
14932
- function ls(e, t) {
14933
- return e <= ss ? e : Math.max(ss, e * os[t]);
15053
+ function ys(e, t) {
15054
+ return e <= _s ? e : Math.max(_s, e * gs[t]);
14934
15055
  }
14935
- function us(e, t) {
15056
+ function bs(e, t) {
14936
15057
  let n = e.trim(), r = /^(\d*\.?\d+)(px|rem)$/i.exec(n);
14937
15058
  if (r) {
14938
15059
  let e = parseFloat(r[1]) * (r[2].toLowerCase() === "rem" ? 16 : 1);
14939
- if (e <= ss) return n;
14940
- let i = ls(e, t);
15060
+ if (e <= _s) return n;
15061
+ let i = ys(e, t);
14941
15062
  return r[2].toLowerCase() === "rem" ? `${Math.round(i / 16 * 1e3) / 1e3}rem` : `${Math.round(i * 10) / 10}px`;
14942
15063
  }
14943
- return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${ss}px), calc(${n} * ${os[t]}))` : n;
15064
+ return /^(?:var|calc|clamp|min|max)\(/i.test(n) && n.length < 300 ? `max(min(${n}, ${_s}px), calc(${n} * ${gs[t]}))` : n;
14944
15065
  }
14945
- var ds = (e, t = 10) => Math.round(e * t) / t;
14946
- function fs(e, t) {
15066
+ var xs = (e, t = 10) => Math.round(e * t) / t;
15067
+ function Ss(e, t) {
14947
15068
  return je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null;
14948
15069
  }
14949
- function ps(e, t) {
14950
- return e ? as(/^-?[\d.]+$/.test(e.trim()) ? `${e.trim()}px` : e, {
15070
+ function Cs(e, t) {
15071
+ return e ? hs(/^-?[\d.]+$/.test(e.trim()) ? `${e.trim()}px` : e, {
14951
15072
  ...t,
14952
15073
  tokens: t.tokens
14953
15074
  }) : null;
14954
15075
  }
14955
- function ms(e, t, n, r) {
14956
- let i = E(n), a = fe[r], o = fs(e, t), s = o ? Me(o) : null, c = {
15076
+ function ws(e, t, n, r) {
15077
+ let i = E(n), a = fe[r], o = Ss(e, t), s = o ? Me(o) : null, c = {
14957
15078
  tokens: i,
14958
15079
  width: a,
14959
15080
  fontPx: 16
14960
- }, l = ps(t.fontSize, c), u = l !== null && cs(e, r) ? ls(l, r) : l, d = s ? as(s.size[r], c) : null, f = u ?? d ?? 16, p = {
15081
+ }, l = Cs(t.fontSize, c), u = l !== null && vs(e, r) ? ys(l, r) : l, d = s ? hs(s.size[r], c) : null, f = u ?? d ?? 16, p = {
14961
15082
  ...c,
14962
15083
  fontPx: f
14963
15084
  }, m = null, h = !1;
14964
15085
  if (t.lineHeight) {
14965
15086
  let e = String(t.lineHeight).trim(), n = /^-?[\d.]+$/.test(e) ? parseFloat(e) : /%$/.test(e) ? parseFloat(e) / 100 : (() => {
14966
- let t = as(e, p);
15087
+ let t = hs(e, p);
14967
15088
  return t === null ? null : t / f;
14968
15089
  })();
14969
15090
  n !== null && Number.isFinite(n) && n > 0 && (m = n, h = !0);
14970
15091
  }
14971
- m === null && (m = s ? as(s.line, p) : null), m === null && (m = 1.5);
14972
- let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ? as(s.weight, p) : 400)), _ = t.fontFamily ?? is(s && s.family === "heading" ? "var(--semantic-font-family-heading, var(--font-family-sans))" : "var(--semantic-font-family-body, var(--font-family-sans))", i);
15092
+ m === null && (m = s ? hs(s.line, p) : null), m === null && (m = 1.5);
15093
+ let g = t.isBold ? 700 : Number(t.fontWeight ?? (s ? hs(s.weight, p) : 400)), _ = t.fontFamily ?? ms(s && s.family === "heading" ? "var(--semantic-font-family-heading, var(--font-family-sans))" : "var(--semantic-font-family-body, var(--font-family-sans))", i);
14973
15094
  return {
14974
- fontSize: ds(f),
14975
- lineHeight: ds(m, 100),
15095
+ fontSize: xs(f),
15096
+ lineHeight: xs(m, 100),
14976
15097
  fontWeight: Number.isFinite(g) ? g : 400,
14977
15098
  fontFamily: v(_),
14978
15099
  textStyle: o,
@@ -14986,7 +15107,7 @@ function ms(e, t, n, r) {
14986
15107
  }
14987
15108
  //#endregion
14988
15109
  //#region src/v2/design/css.ts
14989
- var hs = {
15110
+ var Ts = {
14990
15111
  compact: {
14991
15112
  desktop: {
14992
15113
  y: "3.5rem",
@@ -15039,11 +15160,11 @@ var hs = {
15039
15160
  }
15040
15161
  }
15041
15162
  };
15042
- function gs(e) {
15163
+ function Es(e) {
15043
15164
  return Object.fromEntries(e.tokens.map((e) => [e.key, O(e)]));
15044
15165
  }
15045
- function _s(e, t) {
15046
- let n = hs[e.options?.density ?? "comfortable"][t], r = E(e), i = r.get("--color-action-primary-bg"), a = r.get("--color-action-primary-text"), o = i && Ha(ie(r, O(i)), a ? ie(r, O(a)) : void 0) || "#FFFFFF";
15166
+ function Ds(e, t) {
15167
+ let n = Ts[e.options?.density ?? "comfortable"][t], r = E(e), i = r.get("--color-action-primary-bg"), a = r.get("--color-action-primary-text"), o = i && Ha(ie(r, O(i)), a ? ie(r, O(a)) : void 0) || "#FFFFFF";
15047
15168
  return {
15048
15169
  ...Pe(t),
15049
15170
  "--plx-on-accent": o,
@@ -15054,39 +15175,39 @@ function _s(e, t) {
15054
15175
  "--plx-accent": "var(--color-action-primary-bg)"
15055
15176
  };
15056
15177
  }
15057
- function vs(e, t) {
15178
+ function Os(e, t) {
15058
15179
  return {
15059
- ...gs(e),
15060
- ..._s(e, t)
15180
+ ...Es(e),
15181
+ ...Ds(e, t)
15061
15182
  };
15062
15183
  }
15063
- var ys = /var\(\s*(--[A-Za-z0-9_-]+)/g, bs = (e) => [...e.matchAll(ys)].map((e) => e[1]);
15064
- function xs(e, t) {
15065
- let n = E(e), r = _s(e, "desktop"), i = _s(e, "tablet"), a = _s(e, "mobile"), o = (e) => {
15184
+ var ks = /var\(\s*(--[A-Za-z0-9_-]+)/g, As = (e) => [...e.matchAll(ks)].map((e) => e[1]);
15185
+ function js(e, t) {
15186
+ let n = E(e), r = Ds(e, "desktop"), i = Ds(e, "tablet"), a = Ds(e, "mobile"), o = (e) => {
15066
15187
  if (e in r) return r[e];
15067
15188
  let t = n.get(e);
15068
15189
  return t ? O(t) : void 0;
15069
- }, s = /* @__PURE__ */ new Set(), c = {}, l = bs(t);
15190
+ }, s = /* @__PURE__ */ new Set(), c = {}, l = As(t);
15070
15191
  for (; l.length;) {
15071
15192
  let e = l.pop();
15072
15193
  if (s.has(e)) continue;
15073
15194
  let t = o(e);
15074
- t !== void 0 && (s.add(e), c[e] = t, l.push(...bs(t)), e in i && l.push(...bs(i[e])), e in a && l.push(...bs(a[e])));
15195
+ t !== void 0 && (s.add(e), c[e] = t, l.push(...As(t)), e in i && l.push(...As(i[e])), e in a && l.push(...As(a[e])));
15075
15196
  }
15076
15197
  return {
15077
15198
  needed: s,
15078
15199
  vars: c
15079
15200
  };
15080
15201
  }
15081
- function Ss(e, t, n) {
15082
- let { vars: r } = xs(e, `${n} var(--color-brand-primary-500) var(--color-text-primary) var(--color-text-muted) var(--color-border-default) var(--color-bg-surface) var(--color-bg-canvas) var(--radius-lg) var(--font-family-body)`);
15202
+ function Ms(e, t, n) {
15203
+ let { vars: r } = js(e, `${n} var(--color-brand-primary-500) var(--color-text-primary) var(--color-text-muted) var(--color-border-default) var(--color-bg-surface) var(--color-bg-canvas) var(--radius-lg) var(--font-family-body)`);
15083
15204
  return {
15084
15205
  ...r,
15085
- ..._s(e, t)
15206
+ ...Ds(e, t)
15086
15207
  };
15087
15208
  }
15088
- function Cs(e, t) {
15089
- let { needed: n } = xs(e, t), r = E(e), i = /* @__PURE__ */ new Set();
15209
+ function Ns(e, t) {
15210
+ let { needed: n } = js(e, t), r = E(e), i = /* @__PURE__ */ new Set();
15090
15211
  for (let e of n) {
15091
15212
  let t = r.get(e);
15092
15213
  if (!t || t.type !== "font family") continue;
@@ -15095,17 +15216,17 @@ function Cs(e, t) {
15095
15216
  }
15096
15217
  return [...i];
15097
15218
  }
15098
- function ws(e, t) {
15099
- let { needed: n, vars: r } = xs(e, t), i = (e, t) => e.map((e) => `${e}:${t[e]}`).join(";"), a = [`.plx-page{${i([...n], r)}}`];
15219
+ function Ps(e, t) {
15220
+ let { needed: n, vars: r } = js(e, t), i = (e, t) => e.map((e) => `${e}:${t[e]}`).join(";"), a = [`.plx-page{${i([...n], r)}}`];
15100
15221
  for (let [t, r] of [["tablet", "(max-width: 1023px)"], ["mobile", "(max-width: 599px)"]]) {
15101
- let o = _s(e, t), s = _s(e, t === "tablet" ? "desktop" : "tablet"), c = Object.keys(o).filter((e) => n.has(e) && o[e] !== s[e]);
15222
+ let o = Ds(e, t), s = Ds(e, t === "tablet" ? "desktop" : "tablet"), c = Object.keys(o).filter((e) => n.has(e) && o[e] !== s[e]);
15102
15223
  c.length && a.push(`@container plx-page ${r}{.plx-page>*{${i(c, o)}}}`);
15103
15224
  }
15104
15225
  return a.join("\n");
15105
15226
  }
15106
15227
  //#endregion
15107
15228
  //#region src/v2/design/audit.ts
15108
- var Ts = [
15229
+ var Fs = [
15109
15230
  "color",
15110
15231
  "font",
15111
15232
  "fontSize",
@@ -15113,7 +15234,7 @@ var Ts = [
15113
15234
  "radius",
15114
15235
  "shadow",
15115
15236
  "spacing"
15116
- ], Es = {
15237
+ ], Is = {
15117
15238
  color: {
15118
15239
  one: "colour",
15119
15240
  many: "colours",
@@ -15149,14 +15270,14 @@ var Ts = [
15149
15270
  many: "spacings",
15150
15271
  nearest: "brand spacing"
15151
15272
  }
15152
- }, Ds = [
15273
+ }, Ls = [
15153
15274
  "textColor",
15154
15275
  "backgroundColor",
15155
15276
  "darkModeBackgroundColor",
15156
15277
  "borderColor",
15157
15278
  "linkColor",
15158
15279
  "linkHoverColor"
15159
- ], Os = [
15280
+ ], Rs = [
15160
15281
  "padding",
15161
15282
  "paddingTop",
15162
15283
  "paddingBottom",
@@ -15169,56 +15290,56 @@ var Ts = [
15169
15290
  "marginRight",
15170
15291
  "gap",
15171
15292
  "gridGap"
15172
- ], ks = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, As = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, js = /^(\d*\.?\d+)(px|rem)$/i, Ms = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, Ns = (e) => {
15173
- let t = js.exec(e.trim());
15293
+ ], zs = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, Bs = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, Vs = /^(\d*\.?\d+)(px|rem)$/i, Hs = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, Us = (e) => {
15294
+ let t = Vs.exec(e.trim());
15174
15295
  if (!t) return null;
15175
15296
  let n = parseFloat(t[1]);
15176
15297
  return t[2].toLowerCase() === "rem" ? n * 16 : n;
15177
- }, Ps = (e) => ks.test(e.trim()) && (f(e)?.a ?? 0) > 0, Fs = (e) => {
15298
+ }, Ws = (e) => zs.test(e.trim()) && (f(e)?.a ?? 0) > 0, Gs = (e) => {
15178
15299
  let t = f(e);
15179
15300
  return !t || t.a <= 0 ? null : m({
15180
15301
  ...t,
15181
- a: Ms(t.a, 2)
15302
+ a: Hs(t.a, 2)
15182
15303
  }).toLowerCase();
15183
- }, Is = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
15184
- function Ls(e, t) {
15304
+ }, Ks = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
15305
+ function qs(e, t) {
15185
15306
  switch (e) {
15186
- case "color": return Fs(t);
15307
+ case "color": return Gs(t);
15187
15308
  case "font": return v(t).toLowerCase() || null;
15188
15309
  case "fontSize":
15189
15310
  case "radius":
15190
15311
  case "spacing": {
15191
- let e = Ns(t);
15192
- return e === null || e <= 0 ? null : `${Ms(e)}px`;
15312
+ let e = Us(t);
15313
+ return e === null || e <= 0 ? null : `${Hs(e)}px`;
15193
15314
  }
15194
15315
  case "lineHeight": {
15195
15316
  let e = parseFloat(t);
15196
- return Number.isFinite(e) && e > 0 ? String(Ms(e)) : null;
15317
+ return Number.isFinite(e) && e > 0 ? String(Hs(e)) : null;
15197
15318
  }
15198
- case "shadow": return Is(t) || null;
15319
+ case "shadow": return Ks(t) || null;
15199
15320
  }
15200
15321
  }
15201
- function Rs(e, t) {
15322
+ function Js(e, t) {
15202
15323
  if (!e) return e;
15203
15324
  let n = null, r = e, i = (e, t) => {
15204
15325
  t !== r[e] && (n ??= { ...r }, n[e] = t);
15205
15326
  }, a = (e) => typeof r[e] == "string" && !r[e].includes("var(") ? r[e].trim() : null;
15206
- for (let e of Ds) {
15327
+ for (let e of Ls) {
15207
15328
  let n = a(e);
15208
- if (n && Ps(n)) {
15329
+ if (n && Ws(n)) {
15209
15330
  let r = t("color", n);
15210
15331
  r !== void 0 && i(e, r);
15211
15332
  }
15212
15333
  }
15213
15334
  let o = typeof r.backgroundGradient == "string" ? r.backgroundGradient : null;
15214
- o && i("backgroundGradient", o.replace(As, (e) => Ps(e) ? t("color", e) ?? e : e));
15335
+ o && i("backgroundGradient", o.replace(Bs, (e) => Ws(e) ? t("color", e) ?? e : e));
15215
15336
  let s = a("fontFamily");
15216
15337
  if (s && !/^(inherit|initial|unset)$/i.test(s)) {
15217
15338
  let e = t("font", s);
15218
15339
  e !== void 0 && i("fontFamily", e);
15219
15340
  }
15220
15341
  let c = a("fontSize");
15221
- if (c && js.test(c)) {
15342
+ if (c && Vs.test(c)) {
15222
15343
  let e = t("fontSize", c);
15223
15344
  e !== void 0 && i("fontSize", e);
15224
15345
  }
@@ -15235,21 +15356,21 @@ function Rs(e, t) {
15235
15356
  let d = (e, n) => {
15236
15357
  let r = a(e);
15237
15358
  if (!r || r.includes("(")) return;
15238
- let o = r.split(/\s+/).map((e) => js.test(e) && (Ns(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
15359
+ let o = r.split(/\s+/).map((e) => Vs.test(e) && (Us(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
15239
15360
  i(e, o);
15240
15361
  };
15241
15362
  d("borderRadius", "radius");
15242
- for (let e of Os) d(e, "spacing");
15363
+ for (let e of Rs) d(e, "spacing");
15243
15364
  return n ?? e;
15244
15365
  }
15245
- var zs = (e) => {
15366
+ var Ys = (e) => {
15246
15367
  let t = e.type === "section" ? e.props?.block : void 0;
15247
15368
  return t && typeof t == "object" && typeof t.kind == "string" ? t : null;
15248
- }, Bs = "__", Vs = (e, t) => t === e ? "@section" : t.startsWith(`${e}${Bs}`) ? t.slice(e.length + 2) : t;
15249
- function Hs(e, t) {
15369
+ }, Xs = "__", Zs = (e, t) => t === e ? "@section" : t.startsWith(`${e}${Xs}`) ? t.slice(e.length + 2) : t;
15370
+ function Qs(e, t) {
15250
15371
  if (!e.overrides) return e;
15251
15372
  let n = !1, r = Object.fromEntries(Object.entries(e.overrides).map(([e, r]) => {
15252
- let i = Rs(r.styles, t), a = Rs(r.responsive?.tablet, t), o = Rs(r.responsive?.mobile, t);
15373
+ let i = Js(r.styles, t), a = Js(r.responsive?.tablet, t), o = Js(r.responsive?.mobile, t);
15253
15374
  return i === r.styles && a === r.responsive?.tablet && o === r.responsive?.mobile ? [e, r] : (n = !0, [e, {
15254
15375
  ...r,
15255
15376
  styles: i,
@@ -15265,13 +15386,13 @@ function Hs(e, t) {
15265
15386
  overrides: r
15266
15387
  } : e;
15267
15388
  }
15268
- function Us(e, t, n) {
15269
- let r = zs(e);
15389
+ function $s(e, t, n) {
15390
+ let r = Ys(e);
15270
15391
  if (r) {
15271
- let i = Hs(r, t);
15392
+ let i = Qs(r, t);
15272
15393
  if (!n || i === r) return e;
15273
15394
  let a = i.overrides ?? {};
15274
- return Ws({
15395
+ return ec({
15275
15396
  ...e,
15276
15397
  props: {
15277
15398
  ...e.props,
@@ -15279,7 +15400,7 @@ function Us(e, t, n) {
15279
15400
  }
15280
15401
  }, e.id, a);
15281
15402
  }
15282
- let i = Rs(e.styles, t), a = Rs(e.responsive?.tablet, t), o = Rs(e.responsive?.mobile, t), s = e.children?.map((e) => Us(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
15403
+ let i = Js(e.styles, t), a = Js(e.responsive?.tablet, t), o = Js(e.responsive?.mobile, t), s = e.children?.map((e) => $s(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
15283
15404
  return i === e.styles && a === e.responsive?.tablet && o === e.responsive?.mobile && c ? e : {
15284
15405
  ...e,
15285
15406
  styles: i,
@@ -15291,9 +15412,9 @@ function Us(e, t, n) {
15291
15412
  ...s ? { children: s } : {}
15292
15413
  };
15293
15414
  }
15294
- function Ws(e, t, n) {
15415
+ function ec(e, t, n) {
15295
15416
  let r = (e) => {
15296
- let i = n[Vs(t, e.id)], a = e.children?.map(r);
15417
+ let i = n[Zs(t, e.id)], a = e.children?.map(r);
15297
15418
  return i ? {
15298
15419
  ...e,
15299
15420
  ...a ? { children: a } : {},
@@ -15318,7 +15439,7 @@ function Ws(e, t, n) {
15318
15439
  };
15319
15440
  return r(e);
15320
15441
  }
15321
- var Gs = {
15442
+ var tc = {
15322
15443
  font: "--font-family-",
15323
15444
  fontSize: "--font-size-",
15324
15445
  lineHeight: "--line-height-",
@@ -15326,27 +15447,27 @@ var Gs = {
15326
15447
  shadow: "--shadow-",
15327
15448
  spacing: "--space-"
15328
15449
  };
15329
- function Ks(e) {
15450
+ function nc(e) {
15330
15451
  let t = (e.name && !e.name.startsWith("--") ? e.name : e.key.replace(/^--/, "").replace(/-/g, " ")).replace(/^(Color|Semantic) /i, "");
15331
15452
  return t = t.replace(/^Brand (Primary|Secondary) 500$/i, "$1").replace(/^Brand /i, ""), t;
15332
15453
  }
15333
- function qs(e, t) {
15334
- let n = [], r = Gs[t];
15454
+ function rc(e, t) {
15455
+ let n = [], r = tc[t];
15335
15456
  for (let i of e.tokens) {
15336
15457
  if (t === "color" ? !(i.type === "color" && i.layer !== "component") : !(r && i.key.startsWith(r))) continue;
15337
15458
  let a = T(e, i.key);
15338
15459
  if (a === void 0) continue;
15339
- let o = Ls(t, a);
15460
+ let o = qs(t, a);
15340
15461
  o && n.push({
15341
15462
  key: i.key,
15342
- name: Ks(i),
15463
+ name: nc(i),
15343
15464
  norm: o,
15344
15465
  layer: i.layer
15345
15466
  });
15346
15467
  }
15347
15468
  return n;
15348
15469
  }
15349
- function Js(e) {
15470
+ function ic(e) {
15350
15471
  let t = f(e), n = (e) => {
15351
15472
  let t = e / 255;
15352
15473
  return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
@@ -15361,16 +15482,16 @@ function Js(e) {
15361
15482
  200 * (l(s) - l(c))
15362
15483
  ];
15363
15484
  }
15364
- var Ys = (e) => f(e)?.a ?? 1;
15365
- function Xs(e, t) {
15366
- let n = Math.abs(Ys(e) - Ys(t));
15485
+ var ac = (e) => f(e)?.a ?? 1;
15486
+ function oc(e, t) {
15487
+ let n = Math.abs(ac(e) - ac(t));
15367
15488
  if (n > .06) return Infinity;
15368
- let [r, i, a] = Js(e), [o, s, c] = Js(t);
15489
+ let [r, i, a] = ic(e), [o, s, c] = ic(t);
15369
15490
  return Math.sqrt((r - o) ** 2 + (i - s) ** 2 + (a - c) ** 2) + n * 100;
15370
15491
  }
15371
- function Zs(e, t, n) {
15492
+ function sc(e, t, n) {
15372
15493
  switch (e) {
15373
- case "color": return Xs(t, n);
15494
+ case "color": return oc(t, n);
15374
15495
  case "fontSize":
15375
15496
  case "radius":
15376
15497
  case "spacing": return Math.abs(parseFloat(t) - parseFloat(n));
@@ -15378,8 +15499,8 @@ function Zs(e, t, n) {
15378
15499
  default: return t === n ? 0 : Infinity;
15379
15500
  }
15380
15501
  }
15381
- var Qs = (e) => e === "color" ? 1.5 : e === "lineHeight" ? .02 : .5;
15382
- function $s(e, t, n, r) {
15502
+ var cc = (e) => e === "color" ? 1.5 : e === "lineHeight" ? .02 : .5;
15503
+ function lc(e, t, n, r) {
15383
15504
  return e === "color" ? {
15384
15505
  ok: t <= 10,
15385
15506
  level: t <= 3 ? "almost identical" : t <= 6 ? "very close" : "close"
@@ -15397,15 +15518,15 @@ function $s(e, t, n, r) {
15397
15518
  level: "almost identical"
15398
15519
  };
15399
15520
  }
15400
- var ec = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), tc = (e) => {
15521
+ var uc = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""), dc = (e) => {
15401
15522
  let t = f(e);
15402
15523
  return Math.max(t.r, t.g, t.b) - Math.min(t.r, t.g, t.b) < 24;
15403
15524
  };
15404
- function nc(e, t, n, r) {
15525
+ function fc(e, t, n, r) {
15405
15526
  let i;
15406
15527
  switch (e) {
15407
15528
  case "color":
15408
- i = tc(t) ? {
15529
+ i = dc(t) ? {
15409
15530
  key: "--color-neutral-custom",
15410
15531
  name: "Neutral",
15411
15532
  numbered: !0
@@ -15417,10 +15538,10 @@ function nc(e, t, n, r) {
15417
15538
  break;
15418
15539
  case "font": {
15419
15540
  let e = v(n);
15420
- return rc(`--font-family-${ec(e) || "custom"}`, e, !1, r);
15541
+ return pc(`--font-family-${uc(e) || "custom"}`, e, !1, r);
15421
15542
  }
15422
15543
  case "fontSize":
15423
- i = (Ns(t) ?? 0) >= 28 ? {
15544
+ i = (Us(t) ?? 0) >= 28 ? {
15424
15545
  key: "--font-size-heading",
15425
15546
  name: "Heading size",
15426
15547
  numbered: !0
@@ -15459,9 +15580,9 @@ function nc(e, t, n, r) {
15459
15580
  };
15460
15581
  break;
15461
15582
  }
15462
- return rc(i.key, i.name, !0, r);
15583
+ return pc(i.key, i.name, !0, r);
15463
15584
  }
15464
- function rc(e, t, n, r) {
15585
+ function pc(e, t, n, r) {
15465
15586
  if (!n) {
15466
15587
  let n = e, i = 2;
15467
15588
  for (; r.has(n);) n = `${e}-${i++}`;
@@ -15477,10 +15598,10 @@ function rc(e, t, n, r) {
15477
15598
  name: `${t} ${i}`
15478
15599
  };
15479
15600
  }
15480
- function ic(e) {
15601
+ function mc(e) {
15481
15602
  let t = /* @__PURE__ */ new Map();
15482
- for (let n of e) Us(n.rootNode, (e, r) => {
15483
- let i = Ls(e, r);
15603
+ for (let n of e) $s(n.rootNode, (e, r) => {
15604
+ let i = qs(e, r);
15484
15605
  if (!i) return;
15485
15606
  let a = `${e}:${i}`, o = t.get(a);
15486
15607
  o || t.set(a, o = {
@@ -15493,25 +15614,25 @@ function ic(e) {
15493
15614
  }, !1);
15494
15615
  return t;
15495
15616
  }
15496
- var ac = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
15497
- function oc(e, t, n = {}) {
15498
- let r = n.minorBelow ?? 2, i = ic(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
15499
- for (let e of Ts) {
15500
- let n = qs(t, e), s = new Set(n.map((e) => e.norm)), c = [...i.values()].filter((t) => t.kind === e && !s.has(t.norm)).sort((e, t) => t.uses - e.uses || e.norm.localeCompare(t.norm)), l = [];
15617
+ var hc = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
15618
+ function gc(e, t, n = {}) {
15619
+ let r = n.minorBelow ?? 2, i = mc(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
15620
+ for (let e of Fs) {
15621
+ let n = rc(t, e), s = new Set(n.map((e) => e.norm)), c = [...i.values()].filter((t) => t.kind === e && !s.has(t.norm)).sort((e, t) => t.uses - e.uses || e.norm.localeCompare(t.norm)), l = [];
15501
15622
  for (let t of c) {
15502
- let n = l.find((n) => Zs(e, n.rep.norm, t.norm) <= Qs(e));
15623
+ let n = l.find((n) => sc(e, n.rep.norm, t.norm) <= cc(e));
15503
15624
  n ? n.members.push(t) : l.push({
15504
15625
  rep: t,
15505
15626
  members: [t]
15506
15627
  });
15507
15628
  }
15508
15629
  for (let { rep: t, members: i } of l) {
15509
- let s = i.reduce((e, t) => e + t.uses, 0), c = ac(t.raws), l = [...new Set(i.flatMap((e) => [...e.pages]))], u = [...new Set(i.flatMap((e) => [...e.raws.keys()]))], d, f = Infinity;
15630
+ let s = i.reduce((e, t) => e + t.uses, 0), c = hc(t.raws), l = [...new Set(i.flatMap((e) => [...e.pages]))], u = [...new Set(i.flatMap((e) => [...e.raws.keys()]))], d, f = Infinity;
15510
15631
  for (let r of n) {
15511
- if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" && Ys(r.norm) === 0) continue;
15512
- let i = Zs(e, t.norm, r.norm);
15632
+ if (e !== "color" && e !== "font" && e !== "shadow" && parseFloat(r.norm) === 0 || e === "color" && ac(r.norm) === 0) continue;
15633
+ let i = sc(e, t.norm, r.norm);
15513
15634
  if (i < f || i === f && d && r.layer === "brand" && n.find((e) => e.key === d.tokenKey)?.layer !== "brand") {
15514
- let n = $s(e, i, t.norm, r.norm);
15635
+ let n = lc(e, i, t.norm, r.norm);
15515
15636
  n.ok && (f = i, d = {
15516
15637
  tokenKey: r.key,
15517
15638
  name: r.name,
@@ -15519,9 +15640,9 @@ function oc(e, t, n = {}) {
15519
15640
  });
15520
15641
  }
15521
15642
  }
15522
- let p = nc(e, t.norm, c, a);
15643
+ let p = fc(e, t.norm, c, a);
15523
15644
  a.add(p.key);
15524
- let m = Es[e];
15645
+ let m = Is[e];
15525
15646
  o.push({
15526
15647
  id: `${e}:${t.norm}`,
15527
15648
  kind: e,
@@ -15543,23 +15664,23 @@ function oc(e, t, n = {}) {
15543
15664
  }
15544
15665
  }
15545
15666
  o.sort((e, t) => t.uses - e.uses || e.id.localeCompare(t.id));
15546
- let s = Object.fromEntries(Ts.map((e) => [e, o.filter((t) => t.kind === e)]));
15667
+ let s = Object.fromEntries(Fs.map((e) => [e, o.filter((t) => t.kind === e)]));
15547
15668
  return {
15548
15669
  findings: o,
15549
15670
  byKind: s,
15550
- counts: Object.fromEntries(Ts.map((e) => [e, s[e].length])),
15671
+ counts: Object.fromEntries(Fs.map((e) => [e, s[e].length])),
15551
15672
  total: o.length,
15552
15673
  minorCount: o.filter((e) => e.minor).length
15553
15674
  };
15554
15675
  }
15555
- function sc(e) {
15556
- let t = Ts.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Es[t].one : Es[t].many}`);
15676
+ function _c(e) {
15677
+ let t = Fs.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Is[t].one : Is[t].many}`);
15557
15678
  return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
15558
15679
  }
15559
- function cc(e) {
15680
+ function vc(e) {
15560
15681
  return Object.fromEntries(e.findings.map((e) => [e.id, e.minor ? "keep" : e.suggestion.action]));
15561
15682
  }
15562
- function lc(e, t) {
15683
+ function yc(e, t) {
15563
15684
  let n = e.value;
15564
15685
  if (e.kind === "color") {
15565
15686
  let r = f(n);
@@ -15588,7 +15709,7 @@ function lc(e, t) {
15588
15709
  layer: "brand",
15589
15710
  comment: "Added from your pages"
15590
15711
  });
15591
- let r = js.exec(n.trim());
15712
+ let r = Vs.exec(n.trim());
15592
15713
  return C(t, e.add.key, String(parseFloat(r[1])), {
15593
15714
  name: e.add.name,
15594
15715
  type: "dimension",
@@ -15597,21 +15718,21 @@ function lc(e, t) {
15597
15718
  comment: "Added from your pages"
15598
15719
  });
15599
15720
  }
15600
- function uc(e, t, n, r = {}) {
15601
- let i = oc(e, t, r), a = t, o = /* @__PURE__ */ new Map(), s = ic(e);
15721
+ function bc(e, t, n, r = {}) {
15722
+ let i = gc(e, t, r), a = t, o = /* @__PURE__ */ new Map(), s = mc(e);
15602
15723
  for (let e of i.findings) {
15603
15724
  let t = n[e.id] ?? "keep", r;
15604
- if (t === "add" ? (a = lc(e, a), r = e.add.key) : t === "match" && e.match && (r = e.match.tokenKey), r) for (let t of s.values()) t.kind === e.kind && (t.norm === e.id.slice(e.kind.length + 1) || Zs(e.kind, e.id.slice(e.kind.length + 1), t.norm) <= Qs(e.kind)) && o.set(`${t.kind}:${t.norm}`, `var(${r})`);
15725
+ if (t === "add" ? (a = yc(e, a), r = e.add.key) : t === "match" && e.match && (r = e.match.tokenKey), r) for (let t of s.values()) t.kind === e.kind && (t.norm === e.id.slice(e.kind.length + 1) || sc(e.kind, e.id.slice(e.kind.length + 1), t.norm) <= cc(e.kind)) && o.set(`${t.kind}:${t.norm}`, `var(${r})`);
15605
15726
  }
15606
15727
  if (!o.size) return {
15607
15728
  pages: e,
15608
15729
  designSystem: t
15609
15730
  };
15610
15731
  let c = (e, t) => {
15611
- let n = Ls(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
15732
+ let n = qs(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
15612
15733
  if (r) return r;
15613
15734
  }, l = e.map((e) => {
15614
- let t = Us(e.rootNode, c, !0);
15735
+ let t = $s(e.rootNode, c, !0);
15615
15736
  return t === e.rootNode ? e : {
15616
15737
  ...e,
15617
15738
  rootNode: t
@@ -15625,21 +15746,21 @@ function uc(e, t, n, r = {}) {
15625
15746
  designSystem: u
15626
15747
  };
15627
15748
  }
15628
- function dc(e, t) {
15749
+ function xc(e, t) {
15629
15750
  let n = /* @__PURE__ */ new Map();
15630
15751
  for (let e of ["color", "font"]) {
15631
- let r = qs(t, e).sort((e, t) => Number(t.layer === "brand") - Number(e.layer === "brand"));
15752
+ let r = rc(t, e).sort((e, t) => Number(t.layer === "brand") - Number(e.layer === "brand"));
15632
15753
  for (let t of r) {
15633
- if (e === "color" && Ys(t.norm) === 0) continue;
15754
+ if (e === "color" && ac(t.norm) === 0) continue;
15634
15755
  let r = `${e}:${t.norm}`;
15635
15756
  n.has(r) || n.set(r, `var(${t.key})`);
15636
15757
  }
15637
15758
  }
15638
15759
  let r = (e, t) => {
15639
- let r = Ls(e, t);
15760
+ let r = qs(e, t);
15640
15761
  return r ? n.get(`${e}:${r}`) : void 0;
15641
15762
  }, i = !1, a = e.map((e) => {
15642
- let t = Us(e.rootNode, r, !0);
15763
+ let t = $s(e.rootNode, r, !0);
15643
15764
  return t === e.rootNode ? e : (i = !0, {
15644
15765
  ...e,
15645
15766
  rootNode: t
@@ -15647,7 +15768,7 @@ function dc(e, t) {
15647
15768
  });
15648
15769
  return i ? a : e;
15649
15770
  }
15650
- var fc = (e) => {
15771
+ var Sc = (e) => {
15651
15772
  let t = f(e);
15652
15773
  if (!t) return null;
15653
15774
  let n = t.r / 255, r = t.g / 255, i = t.b / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = (a + o) / 2, c = a - o;
@@ -15664,31 +15785,31 @@ var fc = (e) => {
15664
15785
  l: s,
15665
15786
  a: t.a ?? 1
15666
15787
  };
15667
- }, pc = (e, t) => {
15788
+ }, Cc = (e, t) => {
15668
15789
  let n = Math.abs(e - t) % 360;
15669
15790
  return n > 180 ? 360 - n : n;
15670
15791
  };
15671
- function mc(e, t) {
15792
+ function wc(e, t) {
15672
15793
  let n = new Set(t.tokens.map((e) => e.key));
15673
15794
  if (!n.has("--color-brand-primary-500")) return e;
15674
- let r = [...ic(e).values()].filter((e) => e.kind === "color").map((e) => ({
15795
+ let r = [...mc(e).values()].filter((e) => e.kind === "color").map((e) => ({
15675
15796
  e,
15676
- c: fc(e.norm)
15797
+ c: Sc(e.norm)
15677
15798
  })).filter((e) => !!e.c && e.c.a > .99 && e.c.s >= .3 && e.c.l >= .1 && e.c.l <= .92).sort((e, t) => t.e.uses - e.e.uses);
15678
15799
  if (!r.length) return e;
15679
15800
  let i = [], a = /* @__PURE__ */ new Map();
15680
15801
  for (let { e, c: t } of r) {
15681
- let r = i.findIndex((e) => pc(e, t.h) <= 28);
15802
+ let r = i.findIndex((e) => Cc(e, t.h) <= 28);
15682
15803
  if (r === -1 && i.length < 2 && (i.push(t.h), r = i.length - 1), r === -1) continue;
15683
15804
  let o = t.l < .35 ? "700" : t.l > .68 ? "300" : "500", s = r === 0 ? `--color-brand-primary-${o}` : n.has("--color-brand-secondary-500") ? "--color-brand-secondary-500" : null;
15684
15805
  s && n.has(s) && a.set(`color:${e.norm}`, `var(${s})`);
15685
15806
  }
15686
15807
  if (!a.size) return e;
15687
15808
  let o = (e, t) => {
15688
- let n = Ls(e, t);
15809
+ let n = qs(e, t);
15689
15810
  return n ? a.get(`${e}:${n}`) : void 0;
15690
15811
  }, s = !1, c = e.map((e) => {
15691
- let t = Us(e.rootNode, o, !0);
15812
+ let t = $s(e.rootNode, o, !0);
15692
15813
  return t === e.rootNode ? e : (s = !0, {
15693
15814
  ...e,
15694
15815
  rootNode: t
@@ -15698,7 +15819,7 @@ function mc(e, t) {
15698
15819
  }
15699
15820
  //#endregion
15700
15821
  //#region src/v2/render/runtime.ts
15701
- function hc(e) {
15822
+ function Tc(e) {
15702
15823
  let t = [], n = (t) => Array.prototype.slice.call(e.querySelectorAll(t)), r = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, i = n(".plx-in");
15703
15824
  if (i.length && !r && typeof IntersectionObserver == "function") {
15704
15825
  let n = e.querySelector(".plx-page") || e;
@@ -15803,23 +15924,23 @@ function hc(e) {
15803
15924
  e.addEventListener("submit", n), t.push(() => e.removeEventListener("submit", n));
15804
15925
  }), () => t.forEach((e) => e());
15805
15926
  }
15806
- var gc = `(function(){var __name=function(f){return f};return ${hc.toString()}})()`, _c = 1e5, vc = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.trim()) ? e.trim() : null, yc = (e) => vc(e.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[^A-Za-z]+/, "").slice(0, 64)) ?? "";
15807
- function bc(e) {
15927
+ var Ec = `(function(){var __name=function(f){return f};return ${Tc.toString()}})()`, Dc = 1e5, Oc = (e) => typeof e == "string" && /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e.trim()) ? e.trim() : null, kc = (e) => Oc(e.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^[^A-Za-z]+/, "").slice(0, 64)) ?? "";
15928
+ function Ac(e) {
15808
15929
  if (typeof e != "string") return { code: "" };
15809
15930
  let t = e.trim();
15810
15931
  return t ? t.length > 1e5 ? {
15811
15932
  code: "",
15812
- warning: `The site's custom code is too long (over ${_c.toLocaleString("en-US")} characters), so it was left out. Shorten it or load it from a file instead.`
15933
+ warning: `The site's custom code is too long (over ${Dc.toLocaleString("en-US")} characters), so it was left out. Shorten it or load it from a file instead.`
15813
15934
  } : { code: t.replace(/<\/(script)/gi, "<\\/$1").replace(/<!--/g, "<\\!--") } : { code: "" };
15814
15935
  }
15815
15936
  //#endregion
15816
15937
  //#region src/v2/utils/css.ts
15817
- function xc(e) {
15938
+ function jc(e) {
15818
15939
  return `url("${e.replace(/["\\\n\r\f]/g, (e) => `\\${e.charCodeAt(0).toString(16)} `)}")`;
15819
15940
  }
15820
15941
  //#endregion
15821
15942
  //#region src/v2/render/nodeStyle.ts
15822
- var Sc = [
15943
+ var Mc = [
15823
15944
  "flex-start",
15824
15945
  "center",
15825
15946
  "flex-end",
@@ -15827,25 +15948,25 @@ var Sc = [
15827
15948
  "start",
15828
15949
  "end",
15829
15950
  "baseline"
15830
- ], Cc = [
15951
+ ], Nc = [
15831
15952
  "hidden",
15832
15953
  "visible",
15833
15954
  "auto",
15834
15955
  "clip"
15835
- ], wc = ["normal", "nowrap"], Tc = [
15956
+ ], Pc = ["normal", "nowrap"], Fc = [
15836
15957
  "auto",
15837
15958
  "pointer",
15838
15959
  "default",
15839
15960
  "text",
15840
15961
  "grab",
15841
15962
  "not-allowed"
15842
- ], Ec = [
15963
+ ], Ic = [
15843
15964
  "ease",
15844
15965
  "linear",
15845
15966
  "ease-in",
15846
15967
  "ease-out",
15847
15968
  "ease-in-out"
15848
- ], Dc = {
15969
+ ], Lc = {
15849
15970
  all: ["all"],
15850
15971
  opacity: ["opacity"],
15851
15972
  transform: ["transform"],
@@ -15855,7 +15976,7 @@ var Sc = [
15855
15976
  "border-color",
15856
15977
  "box-shadow"
15857
15978
  ]
15858
- }, Oc = (e, t) => typeof e == "string" && t.includes(e) ? e : void 0, kc = (e) => typeof e == "string" && /^(?:(?:left|right|top|bottom|center|-?\d{1,3}(?:\.\d+)?%)(?: |$)){1,2}$/.test(e.trim() + " ") ? e.trim() : void 0, Ac = (e) => {
15979
+ }, Rc = (e, t) => typeof e == "string" && t.includes(e) ? e : void 0, zc = (e) => typeof e == "string" && /^(?:(?:left|right|top|bottom|center|-?\d{1,3}(?:\.\d+)?%)(?: |$)){1,2}$/.test(e.trim() + " ") ? e.trim() : void 0, Bc = (e) => {
15859
15980
  let t = typeof e == "number" ? e : typeof e == "string" ? parseFloat(e) : NaN;
15860
15981
  if (!Number.isFinite(t) || t <= 0) return {};
15861
15982
  let n = `blur(${Math.round(Math.min(40, t) * 10) / 10}px)`;
@@ -15864,18 +15985,18 @@ var Sc = [
15864
15985
  WebkitBackdropFilter: n
15865
15986
  };
15866
15987
  };
15867
- function jc(e) {
15868
- let t = Oc(e.transitionProperty, Object.keys(Dc));
15988
+ function Vc(e) {
15989
+ let t = Rc(e.transitionProperty, Object.keys(Lc));
15869
15990
  if (!t) return;
15870
- let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i = Oc(e.transitionEasing, Ec) ?? "ease";
15871
- return Dc[t].map((e) => `${e} ${r}ms ${i}`).join(", ");
15991
+ let n = typeof e.transitionDuration == "number" ? e.transitionDuration : 200, r = Math.round(Math.min(2e3, Math.max(0, Number.isFinite(n) ? n : 200))), i = Rc(e.transitionEasing, Ic) ?? "ease";
15992
+ return Lc[t].map((e) => `${e} ${r}ms ${i}`).join(", ");
15872
15993
  }
15873
- var Mc = [
15994
+ var Hc = [
15874
15995
  "lift",
15875
15996
  "grow",
15876
15997
  "fade",
15877
15998
  "glow"
15878
- ], Nc = {
15999
+ ], Uc = {
15879
16000
  lift: {
15880
16001
  translate: "0 -6px",
15881
16002
  boxShadow: "0 16px 32px rgba(0,0,0,0.18)"
@@ -15884,19 +16005,19 @@ var Mc = [
15884
16005
  fade: { opacity: .8 },
15885
16006
  glow: { boxShadow: "0 10px 30px rgba(0,0,0,0.28)" }
15886
16007
  };
15887
- function Pc(e) {
15888
- let t = Oc(e.hoverEffect, Mc);
15889
- return t ? Nc[t] : void 0;
16008
+ function Wc(e) {
16009
+ let t = Rc(e.hoverEffect, Hc);
16010
+ return t ? Uc[t] : void 0;
15890
16011
  }
15891
- var Fc = [
16012
+ var Gc = [
15892
16013
  "fade",
15893
16014
  "slide-up",
15894
16015
  "slide-left",
15895
16016
  "slide-right",
15896
16017
  "zoom"
15897
16018
  ];
15898
- function Ic(e) {
15899
- let t = Oc(e.entrance, Fc);
16019
+ function Kc(e) {
16020
+ let t = Rc(e.entrance, Gc);
15900
16021
  if (!t) return;
15901
16022
  let n = typeof e.entranceDelay == "number" && Number.isFinite(e.entranceDelay) ? e.entranceDelay : 0;
15902
16023
  return {
@@ -15904,7 +16025,7 @@ function Ic(e) {
15904
16025
  delay: Math.round(Math.min(1500, Math.max(0, n)))
15905
16026
  };
15906
16027
  }
15907
- function Lc(e, t, n) {
16028
+ function qc(e, t, n) {
15908
16029
  let { viewport: r } = n, i = je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null, a = i ? Fe(i) : {}, o = t.position !== "static" && (typeof t.x == "number" || typeof t.y == "number" || t.position === "absolute"), s = t.flexDirection;
15909
16030
  r === "mobile" && t.stackOnMobile && t.display === "flex" && (s = "column");
15910
16031
  let c = t.isFullWidth ? "100%" : t.customWidth || t.width, l = t.maxWidth;
@@ -15955,9 +16076,9 @@ function Lc(e, t, n) {
15955
16076
  gridRow: n.isGridChild && t.gridRowSpan ? `span ${t.gridRowSpan}` : void 0,
15956
16077
  flexDirection: s,
15957
16078
  justifyContent: t.justifyContent,
15958
- alignItems: Oc(t.alignItems, Sc),
15959
- alignSelf: Oc(t.alignSelf, Sc),
15960
- alignContent: Oc(t.alignContent, [
16079
+ alignItems: Rc(t.alignItems, Mc),
16080
+ alignSelf: Rc(t.alignSelf, Mc),
16081
+ alignContent: Rc(t.alignContent, [
15961
16082
  "start",
15962
16083
  "center",
15963
16084
  "end",
@@ -16005,7 +16126,7 @@ function Lc(e, t, n) {
16005
16126
  color: t.textColor,
16006
16127
  textAlign: t.textAlign,
16007
16128
  backgroundColor: t.backgroundColor,
16008
- backgroundImage: S ? "none" : C ? xc(C) : t.backgroundGradient || void 0,
16129
+ backgroundImage: S ? "none" : C ? jc(C) : t.backgroundGradient || void 0,
16009
16130
  aspectRatio: t.aspectRatio,
16010
16131
  backgroundSize: t.backgroundSize,
16011
16132
  backgroundPosition: t.backgroundPosition,
@@ -16015,13 +16136,13 @@ function Lc(e, t, n) {
16015
16136
  borderStyle: t.borderStyle,
16016
16137
  borderColor: t.borderColor,
16017
16138
  boxShadow: t.boxShadow,
16018
- overflow: Oc(t.overflow, Cc),
16019
- whiteSpace: Oc(t.whiteSpace, wc),
16020
- objectPosition: kc(t.objectPosition),
16021
- ...Ac(t.backdropFilter),
16139
+ overflow: Rc(t.overflow, Nc),
16140
+ whiteSpace: Rc(t.whiteSpace, Pc),
16141
+ objectPosition: zc(t.objectPosition),
16142
+ ...Bc(t.backdropFilter),
16022
16143
  pointerEvents: t.pointerEvents
16023
16144
  };
16024
- n.forPublish && (w.cursor = Oc(t.cursor, Tc), w.transition = jc(t) ?? (Pc(t) ? "translate 200ms ease, scale 200ms ease, opacity 200ms ease, box-shadow 200ms ease" : void 0)), typeof w.fontSize == "string" && t.fontSize !== void 0 && cs(e, r) && (w.fontSize = us(w.fontSize, r)), e.type === "columns" && !f && (w.display = "grid", w.gridTemplateColumns = `repeat(${r === "mobile" ? 1 : r === "tablet" ? 2 : t.gridColumns || 3}, minmax(0, 1fr))`), n.isRootPage && (w.maxWidth = t.maxWidth || void 0, w.marginLeft = t.horizontalAlign === "left" ? "0px" : t.horizontalAlign === "right" ? "auto" : t.marginLeft || "auto", w.marginRight = t.horizontalAlign === "left" ? "auto" : t.horizontalAlign === "right" ? "0px" : t.marginRight || "auto"), e.type === "section" && t.pinned && (w.position = "sticky", w.top = "0px", w.zIndex = 40);
16145
+ n.forPublish && (w.cursor = Rc(t.cursor, Fc), w.transition = Vc(t) ?? (Wc(t) ? "translate 200ms ease, scale 200ms ease, opacity 200ms ease, box-shadow 200ms ease" : void 0)), typeof w.fontSize == "string" && t.fontSize !== void 0 && vs(e, r) && (w.fontSize = bs(w.fontSize, r)), e.type === "columns" && !f && (w.display = "grid", w.gridTemplateColumns = `repeat(${r === "mobile" ? 1 : r === "tablet" ? 2 : t.gridColumns || 3}, minmax(0, 1fr))`), n.isRootPage && (w.maxWidth = t.maxWidth || void 0, w.marginLeft = t.horizontalAlign === "left" ? "0px" : t.horizontalAlign === "right" ? "auto" : t.marginLeft || "auto", w.marginRight = t.horizontalAlign === "left" ? "auto" : t.horizontalAlign === "right" ? "0px" : t.marginRight || "auto"), e.type === "section" && t.pinned && (w.position = "sticky", w.top = "0px", w.zIndex = 40);
16025
16146
  for (let e of Object.keys(w)) w[e] === void 0 && delete w[e];
16026
16147
  return {
16027
16148
  css: w,
@@ -16035,7 +16156,7 @@ function Lc(e, t, n) {
16035
16156
  }
16036
16157
  //#endregion
16037
16158
  //#region src/v2/render/iconSet.ts
16038
- var Rc = {
16159
+ var Jc = {
16039
16160
  star: [["path", { d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" }]],
16040
16161
  heart: [["path", { d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" }]],
16041
16162
  check: [["path", { d: "M20 6 9 17l-5-5" }]],
@@ -17705,7 +17826,7 @@ var Rc = {
17705
17826
  ["path", { d: "m13 14 8-2" }],
17706
17827
  ["path", { d: "m13 19 8-2" }]
17707
17828
  ]
17708
- }, zc = {
17829
+ }, Yc = {
17709
17830
  Popular: [
17710
17831
  "star",
17711
17832
  "heart",
@@ -17911,20 +18032,20 @@ var Rc = {
17911
18032
  "spray-can"
17912
18033
  ]
17913
18034
  };
17914
- Object.keys(Rc);
17915
- var Bc = [["circle", {
18035
+ Object.keys(Jc);
18036
+ var Xc = [["circle", {
17916
18037
  cx: "12",
17917
18038
  cy: "12",
17918
18039
  r: "9"
17919
18040
  }]];
17920
- function Vc(e) {
17921
- return typeof e != "string" || !e.trim() ? Rc.star : Object.prototype.hasOwnProperty.call(Rc, e) ? Rc[e] : Bc;
18041
+ function Zc(e) {
18042
+ return typeof e != "string" || !e.trim() ? Jc.star : Object.prototype.hasOwnProperty.call(Jc, e) ? Jc[e] : Xc;
17922
18043
  }
17923
18044
  //#endregion
17924
18045
  //#region src/v2/render/elements.ts
17925
- var Hc = "_hp_field", Uc = (e) => e.props ?? {}, Wc = (e) => M("div", { class: "plx-empty" }, e);
17926
- function Gc(e) {
17927
- let t = Uc(e), n = Vc(t.iconName), r = F(t.label, 200).trim();
18046
+ var Qc = "_hp_field", $c = (e) => e.props ?? {}, el = (e) => M("div", { class: "plx-empty" }, e);
18047
+ function tl(e) {
18048
+ let t = $c(e), n = Zc(t.iconName), r = F(t.label, 200).trim();
17928
18049
  return M("span", {
17929
18050
  class: "plx-el plx-icon",
17930
18051
  ...r ? {
@@ -17941,9 +18062,9 @@ function Gc(e) {
17941
18062
  "aria-hidden": "true"
17942
18063
  }, n.map(([e, t]) => M(e, t))));
17943
18064
  }
17944
- function Kc(e, t) {
17945
- let n = Uc(e), r = Et(n.slides, 30);
17946
- if (!r.length) return M("div", { class: "plx-el plx-carousel" }, Wc("Add a slide to start your carousel"));
18065
+ function nl(e, t) {
18066
+ let n = $c(e), r = Et(n.slides, 30);
18067
+ if (!r.length) return M("div", { class: "plx-el plx-carousel" }, el("Add a slide to start your carousel"));
17947
18068
  let i = r.map((e, n) => `${t.uid}-s${n + 1}`), a = r.length, o = r.map((e, t) => {
17948
18069
  let n = vt(e.src), r = F(e.caption, 300), o = [n ? M("img", {
17949
18070
  src: n,
@@ -18002,13 +18123,13 @@ function Kc(e, t) {
18002
18123
  "aria-label": `Go to slide ${t + 1}`
18003
18124
  }))));
18004
18125
  }
18005
- var qc = {
18126
+ var rl = {
18006
18127
  "16:9": "16 / 9",
18007
18128
  "4:3": "4 / 3",
18008
18129
  "1:1": "1 / 1",
18009
18130
  "9:16": "9 / 16"
18010
18131
  };
18011
- function Jc(e) {
18132
+ function il(e) {
18012
18133
  let t = e.trim();
18013
18134
  if (!/^https?:\/\//i.test(t)) return null;
18014
18135
  let n;
@@ -18034,12 +18155,12 @@ function Jc(e) {
18034
18155
  src: t
18035
18156
  } : null;
18036
18157
  }
18037
- function Yc(e, t) {
18038
- let n = Uc(e), r = Jc(F(n.url, 2e3)), i = qc[n.ratio ?? "16:9"] ?? qc["16:9"], a = (e) => ({
18158
+ function al(e, t) {
18159
+ let n = $c(e), r = il(F(n.url, 2e3)), i = rl[n.ratio ?? "16:9"] ?? rl["16:9"], a = (e) => ({
18039
18160
  ...M("div", { class: "plx-el plx-video" }, e),
18040
18161
  style: { "aspect-ratio": i }
18041
18162
  });
18042
- if (!r) return a(Wc("Paste a YouTube, Vimeo or video file link"));
18163
+ if (!r) return a(el("Paste a YouTube, Vimeo or video file link"));
18043
18164
  if (r.kind === "file") {
18044
18165
  let e = vt(n.poster);
18045
18166
  return a(M("video", {
@@ -18064,8 +18185,8 @@ function Yc(e, t) {
18064
18185
  referrerpolicy: "strict-origin-when-cross-origin"
18065
18186
  }));
18066
18187
  }
18067
- function Xc(e) {
18068
- let t = Uc(e), n = Et(t.links, 20).filter((e) => e && e.network in Xt), r = Tt(t.size, 20, 96, 40), i = t.shape === "square" || t.shape === "plain" ? t.shape : "circle", a = t.colorMode === "mono";
18188
+ function ol(e) {
18189
+ let t = $c(e), n = Et(t.links, 20).filter((e) => e && e.network in Xt), r = Tt(t.size, 20, 96, 40), i = t.shape === "square" || t.shape === "plain" ? t.shape : "circle", a = t.colorMode === "mono";
18069
18190
  return n.length ? {
18070
18191
  ...M("nav", {
18071
18192
  class: `plx-el plx-social plx-social--${i}`,
@@ -18095,11 +18216,11 @@ function Xc(e) {
18095
18216
  };
18096
18217
  })),
18097
18218
  style: { "--plx-size": `${r}px` }
18098
- } : M("div", { class: "plx-el plx-social" }, Wc("Add your social links"));
18219
+ } : M("div", { class: "plx-el plx-social" }, el("Add your social links"));
18099
18220
  }
18100
- function Zc(e) {
18101
- let t = Uc(e), n = Et(t.links, 40);
18102
- if (!n.length) return M("nav", { class: "plx-el plx-menu" }, Wc("Add menu links"));
18221
+ function sl(e) {
18222
+ let t = $c(e), n = Et(t.links, 40);
18223
+ if (!n.length) return M("nav", { class: "plx-el plx-menu" }, el("Add menu links"));
18103
18224
  let r = n.map((e) => M("li", null, M("a", { href: P(e.href) }, F(e.label, 120) || "Link"))), i = t.layout === "vertical", a = !i && (n.length > 4 || n.reduce((e, t) => e + F(t.label, 120).length, 0) > 36);
18104
18225
  return M("nav", {
18105
18226
  class: `plx-el plx-menu${i ? " plx-menu--vertical" : ""}${a ? " plx-menu--long" : ""}${t.mobile === "expanded" ? " plx-menu--expanded" : ""}`,
@@ -18115,19 +18236,19 @@ function Zc(e) {
18115
18236
  "stroke-linecap": "round"
18116
18237
  }))), M("ul", null, r)));
18117
18238
  }
18118
- function Qc(e, t) {
18119
- let n = Uc(e), r = F(n.code, 1e5);
18239
+ function cl(e, t) {
18240
+ let n = $c(e), r = F(n.code, 1e5);
18120
18241
  return r.trim() ? M("div", { class: "plx-el plx-html" }, M("iframe", {
18121
18242
  srcdoc: r,
18122
18243
  sandbox: `allow-popups allow-popups-to-escape-sandbox allow-forms${t.allowEmbedScripts ? " allow-scripts" : ""}`,
18123
18244
  title: F(n.title, 120) || "Embedded content",
18124
18245
  loading: "lazy",
18125
18246
  referrerpolicy: "no-referrer"
18126
- })) : M("div", { class: "plx-el plx-html" }, Wc("Paste your embed code in the settings"));
18247
+ })) : M("div", { class: "plx-el plx-html" }, el("Paste your embed code in the settings"));
18127
18248
  }
18128
- function $c(e) {
18129
- let t = Uc(e), n = Et(t.rows, 200).map((e) => Et(e, 30).map((e) => F(e, 500)));
18130
- if (!n.length) return M("div", { class: "plx-el plx-table-wrap" }, Wc("Add rows to your table"));
18249
+ function ll(e) {
18250
+ let t = $c(e), n = Et(t.rows, 200).map((e) => Et(e, 30).map((e) => F(e, 500)));
18251
+ if (!n.length) return M("div", { class: "plx-el plx-table-wrap" }, el("Add rows to your table"));
18131
18252
  let r = t.headerRow !== !1, i = Math.max(...n.map((e) => e.length)), a = (e) => Array.from({ length: i }, (t, n) => e[n] ?? "");
18132
18253
  return M("div", {
18133
18254
  class: "plx-el plx-table-wrap",
@@ -18136,8 +18257,8 @@ function $c(e) {
18136
18257
  "aria-label": "Table"
18137
18258
  }, M("table", { class: `plx-table${t.striped === !1 ? "" : " plx-striped"}` }, r && M("thead", null, M("tr", null, a(n[0]).map((e) => M("th", { scope: "col" }, e)))), M("tbody", null, n.slice(+!!r).map((e) => M("tr", null, a(e).map((e) => M("td", null, e)))))));
18138
18259
  }
18139
- var el = (e) => String(Math.max(0, e)).padStart(2, "0");
18140
- function tl(e, t) {
18260
+ var ul = (e) => String(Math.max(0, e)).padStart(2, "0");
18261
+ function dl(e, t) {
18141
18262
  let n = Date.parse(e);
18142
18263
  if (!Number.isFinite(n)) return {
18143
18264
  done: !0,
@@ -18163,11 +18284,11 @@ function tl(e, t) {
18163
18284
  s: i % 60
18164
18285
  };
18165
18286
  }
18166
- function nl(e, t) {
18167
- let n = Uc(e), r = F(n.target, 40), i = tl(r, t.now), a = (e, t, r) => M("div", { class: "plx-unit" }, M("span", {
18287
+ function fl(e, t) {
18288
+ let n = $c(e), r = F(n.target, 40), i = dl(r, t.now), a = (e, t, r) => M("div", { class: "plx-unit" }, M("span", {
18168
18289
  class: "plx-num",
18169
18290
  "data-plx-unit": e
18170
- }, el(t)), n.showLabels !== !1 && M("span", { class: "plx-lbl" }, r));
18291
+ }, ul(t)), n.showLabels !== !1 && M("span", { class: "plx-lbl" }, r));
18171
18292
  return M("div", {
18172
18293
  class: "plx-el plx-timer",
18173
18294
  role: "timer",
@@ -18180,7 +18301,7 @@ function nl(e, t) {
18180
18301
  a("s", i.s, "Seconds")
18181
18302
  ]);
18182
18303
  }
18183
- function rl(e, t) {
18304
+ function pl(e, t) {
18184
18305
  let n = wt(e.id, "field"), r = n, i = F(e.label, 200) || n, a = e.required ? !0 : void 0, o = F(e.placeholder, 200) || void 0, s = e.required ? M("span", {
18185
18306
  class: "plx-req",
18186
18307
  "aria-hidden": "true"
@@ -18208,24 +18329,24 @@ function rl(e, t) {
18208
18329
  });
18209
18330
  return M("label", { class: "plx-field" }, M("span", { class: "plx-label" }, i, s), c);
18210
18331
  }
18211
- function il(e) {
18332
+ function ml(e) {
18212
18333
  let t = xt(e.buttonColor), n = xt(e.buttonTextColor) ?? (t && !t.startsWith("var(") ? Ha(t) ?? void 0 : void 0), r = St(e.buttonRadius), i = {};
18213
18334
  return t && (i["--plx-btn-bg"] = t), n && (i["--plx-btn-fg"] = n), r && (i["--plx-btn-radius"] = r), Object.keys(i).length ? i : void 0;
18214
18335
  }
18215
- function al(e, t) {
18216
- let n = Uc(e), r = Et(n.fields, 40);
18336
+ function hl(e, t) {
18337
+ let n = $c(e), r = Et(n.fields, 40);
18217
18338
  return r.length ? M("form", {
18218
18339
  class: "plx-el plx-form",
18219
18340
  method: "post",
18220
18341
  action: (n.action && P(n.action) !== "#" ? P(n.action) : "") || t.formAction?.(e.id) || void 0,
18221
18342
  "data-plx-form": t.uid,
18222
18343
  "data-plx-success": F(n.successMessage, 300) || "Thanks! We got your message."
18223
- }, r.map((e) => rl(e, t.uid)), M("div", {
18344
+ }, r.map((e) => pl(e, t.uid)), M("div", {
18224
18345
  class: "plx-hp",
18225
18346
  "aria-hidden": "true"
18226
18347
  }, M("label", null, "Leave this field blank", M("input", {
18227
18348
  type: "text",
18228
- name: Hc,
18349
+ name: Qc,
18229
18350
  tabindex: "-1",
18230
18351
  autocomplete: "off"
18231
18352
  }))), {
@@ -18233,11 +18354,11 @@ function al(e, t) {
18233
18354
  type: "submit",
18234
18355
  class: "plx-submit"
18235
18356
  }, F(n.submitLabel, 80) || "Submit"),
18236
- ...il(n) ? { style: il(n) } : {}
18237
- }) : M("div", { class: "plx-el plx-form" }, Wc("Add a field to your form"));
18357
+ ...ml(n) ? { style: ml(n) } : {}
18358
+ }) : M("div", { class: "plx-el plx-form" }, el("Add a field to your form"));
18238
18359
  }
18239
- function ol(e, t) {
18240
- let n = Uc(e), r = Et(n.items, 50);
18360
+ function gl(e, t) {
18361
+ let n = $c(e), r = Et(n.items, 50);
18241
18362
  return r.length ? M("div", { class: "plx-el plx-accordion" }, r.map((e, r) => M("details", {
18242
18363
  ...n.allowMultiple ? {} : { name: t.uid },
18243
18364
  open: n.openFirst !== !1 && r === 0 || void 0
@@ -18252,30 +18373,30 @@ function ol(e, t) {
18252
18373
  "stroke-width": 2.2,
18253
18374
  "stroke-linecap": "round",
18254
18375
  "stroke-linejoin": "round"
18255
- }))), M("div", { class: "plx-body" }, F(e.content, 5e3).split(/\n{2,}/).map((e) => M("p", null, e)))))) : M("div", { class: "plx-el plx-accordion" }, Wc("Add a question to start"));
18376
+ }))), M("div", { class: "plx-body" }, F(e.content, 5e3).split(/\n{2,}/).map((e) => M("p", null, e)))))) : M("div", { class: "plx-el plx-accordion" }, el("Add a question to start"));
18256
18377
  }
18257
- function sl(e, t) {
18378
+ function _l(e, t) {
18258
18379
  if (Ot(e.type)) return Gt(e, t);
18259
18380
  switch (e.type) {
18260
- case "icon": return Gc(e);
18261
- case "carousel": return Kc(e, t);
18262
- case "video": return Yc(e, t);
18263
- case "social": return Xc(e);
18264
- case "menu": return Zc(e);
18265
- case "html": return Qc(e, t);
18266
- case "table": return $c(e);
18267
- case "timer": return nl(e, t);
18268
- case "form": return al(e, t);
18269
- case "accordion": return ol(e, t);
18381
+ case "icon": return tl(e);
18382
+ case "carousel": return nl(e, t);
18383
+ case "video": return al(e, t);
18384
+ case "social": return ol(e);
18385
+ case "menu": return sl(e);
18386
+ case "html": return cl(e, t);
18387
+ case "table": return ll(e);
18388
+ case "timer": return fl(e, t);
18389
+ case "form": return hl(e, t);
18390
+ case "accordion": return gl(e, t);
18270
18391
  default: return null;
18271
18392
  }
18272
18393
  }
18273
18394
  //#endregion
18274
18395
  //#region src/v2/render/elementCss.ts
18275
- var cl = ".plx-el{box-sizing:border-box;width:100%;height:100%;min-width:0;color:inherit;font:inherit;text-align:left}\n.plx-el *,.plx-el *::before,.plx-el *::after{box-sizing:border-box}\n.plx-el ul,.plx-el ol{list-style:none!important;padding-left:0!important;margin:0}\n.plx-el li{display:block!important}\n.plx-empty{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:72px;padding:16px;border:1.5px dashed currentColor;border-radius:10px;opacity:.5;font-size:13px;text-align:center}\n.plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}\n\n.plx-icon{display:inline-flex;width:auto;height:auto;line-height:1;font-size:inherit}\n.plx-icon svg{display:block;width:1em;height:1em}\n\n.plx-carousel{position:relative;overflow:hidden;border-radius:inherit}\n.plx-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}\n.plx-track::-webkit-scrollbar{display:none}\n.plx-slide{position:relative;flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;overflow:hidden}\n.plx-slide a{display:block;width:100%;height:100%;color:inherit;text-decoration:none}\n.plx-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}\n.plx-slide figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 20px 16px;color:#fff;font-size:15px;background:linear-gradient(transparent,rgba(0,0,0,.6))}\n.plx-arrow{display:none;position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;text-decoration:none;backdrop-filter:blur(4px);transition:background .15s}\n[data-plx-ready] .plx-arrow{display:flex;align-items:center;justify-content:center}\n.plx-arrow:hover{background:rgba(0,0,0,.7)}\n.plx-arrow svg{width:20px;height:20px}\n.plx-prev{left:12px}.plx-next{right:12px}\n.plx-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;pointer-events:none}\n.plx-dots a{pointer-events:auto;width:9px;height:9px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.2);transition:transform .15s,background .15s}\n.plx-dots a[aria-current=\"true\"]{background:#fff;transform:scale(1.25)}\n\n.plx-video{position:relative;width:100%;height:auto;overflow:hidden;border-radius:inherit;background:#000}\n.plx-video iframe,.plx-video video{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}\n.plx-video .plx-empty{position:absolute;inset:0;background:#111;color:#e5e7eb;opacity:1;border-color:rgba(255,255,255,.3)}\n\n.plx-social{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:auto;height:auto}\n.plx-social a{display:inline-flex;align-items:center;justify-content:center;width:var(--plx-size,40px);height:var(--plx-size,40px);color:inherit;text-decoration:none;transition:transform .15s,opacity .15s}\n.plx-social a:hover{transform:translateY(-2px);opacity:.85}\n.plx-social svg{width:52%;height:52%}\n.plx-social--circle a,.plx-social--square a{background:var(--plx-brand,currentColor);color:#fff}\n.plx-social--circle a{border-radius:999px}\n.plx-social--square a{border-radius:10px}\n.plx-social--plain a svg{width:70%;height:70%}\n\n.plx-menu{width:auto;height:auto}\n.plx-menu ul{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}\n.plx-menu--vertical ul{flex-direction:column;gap:12px}\n.plx-menu a{color:inherit;text-decoration:none;font-weight:500}\n.plx-menu a:hover{text-decoration:underline;text-underline-offset:4px}\n.plx-menu-m{display:none;position:relative}\n.plx-menu-m summary{display:flex;width:40px;height:40px;align-items:center;justify-content:center;list-style:none;cursor:pointer;border-radius:8px}\n.plx-menu-m summary::-webkit-details-marker{display:none}\n.plx-menu-m summary svg{width:24px;height:24px}\n/* Fixed (not absolute) so the header's own clipping can't cut it off, and inset from both screen edges so it never runs off the side. */\n.plx-menu-m ul{position:fixed;z-index:50;left:12px;right:12px;top:auto;margin-top:6px;max-height:70vh;overflow-y:auto;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:#fff;color:#111;box-shadow:0 12px 32px rgba(0,0,0,.18)}\n.plx-menu-m li a{display:block;padding:10px 12px;border-radius:8px}\n.plx-menu-m li a:hover{background:rgba(0,0,0,.06);text-decoration:none}\n@container plx-page (max-width: 599px){\n .plx-menu:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n/* A long row of links doesn't fit beside a logo and button on a tablet, and wrapping onto a second row looks broken — so it folds into the menu button from tablet width. */\n@container plx-page (max-width: 1023px){\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n\n.plx-html{overflow:hidden;border-radius:inherit}\n.plx-html iframe{display:block;width:100%;height:100%;min-height:200px;border:0;background:transparent}\n\n.plx-table-wrap{width:100%;height:auto;overflow-x:auto;border-radius:inherit}\n.plx-table{width:100%;border-collapse:collapse;font-size:15px}\n.plx-table th,.plx-table td{padding:12px 16px;text-align:left;border-bottom:1px solid rgba(128,128,128,.28)}\n.plx-table th{font-weight:600;border-bottom:2px solid rgba(128,128,128,.5)}\n.plx-striped tbody tr:nth-child(even){background:rgba(128,128,128,.08)}\n\n.plx-timer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:auto;height:auto}\n.plx-unit{display:flex;flex-direction:column;align-items:center;min-width:72px;padding:14px 12px;border-radius:12px;background:rgba(128,128,128,.14)}\n.plx-num{font-size:34px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}\n.plx-lbl{margin-top:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.65}\n.plx-expired{font-size:18px;font-weight:600}\n\n.plx-form{display:flex;flex-direction:column;gap:14px;height:auto}\n.plx-field{display:flex;flex-direction:column;gap:6px}\n.plx-label,.plx-check{font-size:14px;font-weight:500}\n.plx-req{color:#e11d48}\n.plx-form input[type=text],.plx-form input[type=email],.plx-form input[type=tel],.plx-form textarea,.plx-form select{width:100%;padding:11px 13px;border:1px solid var(--color-border-default,rgba(128,128,128,.45));border-radius:var(--radius-lg,10px);background:var(--color-bg-surface,rgba(255,255,255,.92));color:var(--color-text-primary,#111);font:inherit;font-size:15px}\n.plx-form ::placeholder{color:var(--color-text-muted,#9ca3af);opacity:1}\n.plx-form textarea{resize:vertical;min-height:96px}\n.plx-form input:focus,.plx-form textarea:focus,.plx-form select:focus{outline:2px solid var(--plx-accent,#2563eb);outline-offset:1px}\n.plx-check{display:flex;align-items:center;gap:10px}\n.plx-check input{width:18px;height:18px}\n.plx-submit{align-self:flex-start;padding:12px 22px;border:0;border-radius:var(--plx-btn-radius,10px);background:var(--plx-btn-bg,var(--plx-accent,#111827));color:var(--plx-btn-fg,var(--plx-on-accent,#fff));font:inherit;font-weight:600;cursor:pointer;transition:opacity .15s}\n.plx-submit:hover{opacity:.9}\n.plx-submit:disabled{opacity:.6;cursor:default}\n.plx-hp{position:absolute;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none}\n.plx-form-note{padding:12px 14px;border-radius:10px;background:rgba(34,197,94,.14);font-weight:500}\n.plx-form-note[data-error]{background:rgba(225,29,72,.14)}\n\n.plx-accordion{display:flex;flex-direction:column;gap:10px;height:auto}\n.plx-accordion details{border:1px solid rgba(128,128,128,.32);border-radius:12px;overflow:hidden}\n.plx-accordion summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;list-style:none;cursor:pointer;font-weight:600}\n.plx-accordion summary::-webkit-details-marker{display:none}\n.plx-chev{flex:none;width:20px;height:20px;transition:transform .2s}\n.plx-accordion details[open] .plx-chev{transform:rotate(180deg)}\n.plx-body{padding:0 18px 16px;opacity:.85;line-height:1.6}\n.plx-body p+p{margin-top:.75em}\n.plx-dyn{display:flex;flex-direction:column;gap:12px;height:auto;min-height:72px;padding:18px;border:1.5px dashed rgba(128,128,128,.55);border-radius:12px;background:rgba(128,128,128,.07)}\n.plx-dyn-head{display:flex;align-items:center;gap:8px;font-size:14px}\n.plx-dyn-tag{padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.22);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}\n.plx-dyn-note{font-size:12px;opacity:.65}\n.plx-dyn-body{display:flex;flex-direction:column;gap:10px}\n.plx-dyn-bar{display:block;height:10px;border-radius:999px;background:rgba(128,128,128,.28)}\n.plx-dyn-bar--thick{height:16px}\n.plx-dyn-img{display:block;width:100%;border-radius:8px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.34))}\n.plx-dyn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:center}\n.plx-dyn-row--tight{grid-template-columns:56px minmax(0,1fr)}\n.plx-dyn-stack{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-grid{display:grid;gap:12px}\n.plx-dyn-card{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-line{display:flex;justify-content:space-between;gap:12px}\n.plx-dyn-line .plx-dyn-bar{flex:0 1 40%}\n.plx-dyn-text{font-size:14px;opacity:.8}\n.plx-dyn-field{display:flex;flex-direction:column;gap:4px}\n.plx-dyn-lbl{font-size:12px;opacity:.7}\n.plx-dyn-input{display:block;height:36px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:rgba(128,128,128,.08)}\n.plx-dyn-btn{align-self:flex-start;padding:9px 18px;border-radius:8px;background:rgba(128,128,128,.4);font-size:13px;font-weight:600}\n.plx-dyn-chips{display:flex;flex-wrap:wrap;gap:8px}\n.plx-dyn-chip{padding:6px 12px;border:1px solid rgba(128,128,128,.45);border-radius:999px;font-size:12px}\n.plx-dyn-tick{display:flex;width:44px;height:44px;align-items:center;justify-content:center;border-radius:999px;background:rgba(34,197,94,.25);font-size:22px}";
18396
+ var vl = ".plx-el{box-sizing:border-box;width:100%;height:100%;min-width:0;color:inherit;font:inherit;text-align:left}\n.plx-el *,.plx-el *::before,.plx-el *::after{box-sizing:border-box}\n.plx-el ul,.plx-el ol{list-style:none!important;padding-left:0!important;margin:0}\n.plx-el li{display:block!important}\n.plx-empty{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:72px;padding:16px;border:1.5px dashed currentColor;border-radius:10px;opacity:.5;font-size:13px;text-align:center}\n.plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}\n\n.plx-icon{display:inline-flex;width:auto;height:auto;line-height:1;font-size:inherit}\n.plx-icon svg{display:block;width:1em;height:1em}\n\n.plx-carousel{position:relative;overflow:hidden;border-radius:inherit}\n.plx-track{display:flex;width:100%;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;-webkit-overflow-scrolling:touch}\n.plx-track::-webkit-scrollbar{display:none}\n.plx-slide{position:relative;flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;overflow:hidden}\n.plx-slide a{display:block;width:100%;height:100%;color:inherit;text-decoration:none}\n.plx-slide img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}\n.plx-slide figcaption{position:absolute;left:0;right:0;bottom:0;padding:28px 20px 16px;color:#fff;font-size:15px;background:linear-gradient(transparent,rgba(0,0,0,.6))}\n.plx-arrow{display:none;position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;align-items:center;justify-content:center;border-radius:999px;background:rgba(0,0,0,.45);color:#fff;text-decoration:none;backdrop-filter:blur(4px);transition:background .15s}\n[data-plx-ready] .plx-arrow{display:flex;align-items:center;justify-content:center}\n.plx-arrow:hover{background:rgba(0,0,0,.7)}\n.plx-arrow svg{width:20px;height:20px}\n.plx-prev{left:12px}.plx-next{right:12px}\n.plx-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;pointer-events:none}\n.plx-dots a{pointer-events:auto;width:9px;height:9px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:0 0 0 1px rgba(0,0,0,.2);transition:transform .15s,background .15s}\n.plx-dots a[aria-current=\"true\"]{background:#fff;transform:scale(1.25)}\n\n.plx-video{position:relative;width:100%;height:auto;overflow:hidden;border-radius:inherit;background:#000}\n.plx-video iframe,.plx-video video{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}\n.plx-video .plx-empty{position:absolute;inset:0;background:#111;color:#e5e7eb;opacity:1;border-color:rgba(255,255,255,.3)}\n\n.plx-social{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:auto;height:auto}\n.plx-social a{display:inline-flex;align-items:center;justify-content:center;width:var(--plx-size,40px);height:var(--plx-size,40px);color:inherit;text-decoration:none;transition:transform .15s,opacity .15s}\n.plx-social a:hover{transform:translateY(-2px);opacity:.85}\n.plx-social svg{width:52%;height:52%}\n.plx-social--circle a,.plx-social--square a{background:var(--plx-brand,currentColor);color:#fff}\n.plx-social--circle a{border-radius:999px}\n.plx-social--square a{border-radius:10px}\n.plx-social--plain a svg{width:70%;height:70%}\n\n.plx-menu{width:auto;height:auto}\n.plx-menu ul{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}\n.plx-menu--vertical ul{flex-direction:column;gap:12px}\n.plx-menu a{color:inherit;text-decoration:none;font-weight:500}\n.plx-menu a:hover{text-decoration:underline;text-underline-offset:4px}\n.plx-menu-m{display:none;position:relative}\n.plx-menu-m summary{display:flex;width:40px;height:40px;align-items:center;justify-content:center;list-style:none;cursor:pointer;border-radius:8px}\n.plx-menu-m summary::-webkit-details-marker{display:none}\n.plx-menu-m summary svg{width:24px;height:24px}\n/* Fixed (not absolute) so the header's own clipping can't cut it off, and inset from both screen edges so it never runs off the side. */\n.plx-menu-m ul{position:fixed;z-index:50;left:12px;right:12px;top:auto;margin-top:6px;max-height:70vh;overflow-y:auto;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:#fff;color:#111;box-shadow:0 12px 32px rgba(0,0,0,.18)}\n.plx-menu-m li a{display:block;padding:10px 12px;border-radius:8px}\n.plx-menu-m li a:hover{background:rgba(0,0,0,.06);text-decoration:none}\n@container plx-page (max-width: 599px){\n .plx-menu:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n/* A long row of links doesn't fit beside a logo and button on a tablet, and wrapping onto a second row looks broken — so it folds into the menu button from tablet width. */\n@container plx-page (max-width: 1023px){\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-list{display:none}\n .plx-menu--long:not(.plx-menu--expanded) .plx-menu-m{display:block}\n}\n\n.plx-html{overflow:hidden;border-radius:inherit}\n.plx-html iframe{display:block;width:100%;height:100%;min-height:200px;border:0;background:transparent}\n\n.plx-table-wrap{width:100%;height:auto;overflow-x:auto;border-radius:inherit}\n.plx-table{width:100%;border-collapse:collapse;font-size:15px}\n.plx-table th,.plx-table td{padding:12px 16px;text-align:left;border-bottom:1px solid rgba(128,128,128,.28)}\n.plx-table th{font-weight:600;border-bottom:2px solid rgba(128,128,128,.5)}\n.plx-striped tbody tr:nth-child(even){background:rgba(128,128,128,.08)}\n\n.plx-timer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;width:auto;height:auto}\n.plx-unit{display:flex;flex-direction:column;align-items:center;min-width:72px;padding:14px 12px;border-radius:12px;background:rgba(128,128,128,.14)}\n.plx-num{font-size:34px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}\n.plx-lbl{margin-top:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.65}\n.plx-expired{font-size:18px;font-weight:600}\n\n.plx-form{display:flex;flex-direction:column;gap:14px;height:auto}\n.plx-field{display:flex;flex-direction:column;gap:6px}\n.plx-label,.plx-check{font-size:14px;font-weight:500}\n.plx-req{color:#e11d48}\n.plx-form input[type=text],.plx-form input[type=email],.plx-form input[type=tel],.plx-form textarea,.plx-form select{width:100%;padding:11px 13px;border:1px solid var(--color-border-default,rgba(128,128,128,.45));border-radius:var(--radius-lg,10px);background:var(--color-bg-surface,rgba(255,255,255,.92));color:var(--color-text-primary,#111);font:inherit;font-size:15px}\n.plx-form ::placeholder{color:var(--color-text-muted,#9ca3af);opacity:1}\n.plx-form textarea{resize:vertical;min-height:96px}\n.plx-form input:focus,.plx-form textarea:focus,.plx-form select:focus{outline:2px solid var(--plx-accent,#2563eb);outline-offset:1px}\n.plx-check{display:flex;align-items:center;gap:10px}\n.plx-check input{width:18px;height:18px}\n.plx-submit{align-self:flex-start;padding:12px 22px;border:0;border-radius:var(--plx-btn-radius,10px);background:var(--plx-btn-bg,var(--plx-accent,#111827));color:var(--plx-btn-fg,var(--plx-on-accent,#fff));font:inherit;font-weight:600;cursor:pointer;transition:opacity .15s}\n.plx-submit:hover{opacity:.9}\n.plx-submit:disabled{opacity:.6;cursor:default}\n.plx-hp{position:absolute;width:0;height:0;overflow:hidden;opacity:0;pointer-events:none}\n.plx-form-note{padding:12px 14px;border-radius:10px;background:rgba(34,197,94,.14);font-weight:500}\n.plx-form-note[data-error]{background:rgba(225,29,72,.14)}\n\n.plx-accordion{display:flex;flex-direction:column;gap:10px;height:auto}\n.plx-accordion details{border:1px solid rgba(128,128,128,.32);border-radius:12px;overflow:hidden}\n.plx-accordion summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;list-style:none;cursor:pointer;font-weight:600}\n.plx-accordion summary::-webkit-details-marker{display:none}\n.plx-chev{flex:none;width:20px;height:20px;transition:transform .2s}\n.plx-accordion details[open] .plx-chev{transform:rotate(180deg)}\n.plx-body{padding:0 18px 16px;opacity:.85;line-height:1.6}\n.plx-body p+p{margin-top:.75em}\n.plx-dyn{display:flex;flex-direction:column;gap:12px;height:auto;min-height:72px;padding:18px;border:1.5px dashed rgba(128,128,128,.55);border-radius:12px;background:rgba(128,128,128,.07)}\n.plx-dyn-head{display:flex;align-items:center;gap:8px;font-size:14px}\n.plx-dyn-tag{padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.22);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}\n.plx-dyn-note{font-size:12px;opacity:.65}\n.plx-dyn-body{display:flex;flex-direction:column;gap:10px}\n.plx-dyn-bar{display:block;height:10px;border-radius:999px;background:rgba(128,128,128,.28)}\n.plx-dyn-bar--thick{height:16px}\n.plx-dyn-img{display:block;width:100%;border-radius:8px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.34))}\n.plx-dyn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:14px;align-items:center}\n.plx-dyn-row--tight{grid-template-columns:56px minmax(0,1fr)}\n.plx-dyn-stack{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-grid{display:grid;gap:12px}\n.plx-dyn-card{display:flex;flex-direction:column;gap:8px}\n.plx-dyn-line{display:flex;justify-content:space-between;gap:12px}\n.plx-dyn-line .plx-dyn-bar{flex:0 1 40%}\n.plx-dyn-text{font-size:14px;opacity:.8}\n.plx-dyn-field{display:flex;flex-direction:column;gap:4px}\n.plx-dyn-lbl{font-size:12px;opacity:.7}\n.plx-dyn-input{display:block;height:36px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:rgba(128,128,128,.08)}\n.plx-dyn-btn{align-self:flex-start;padding:9px 18px;border-radius:8px;background:rgba(128,128,128,.4);font-size:13px;font-weight:600}\n.plx-dyn-chips{display:flex;flex-wrap:wrap;gap:8px}\n.plx-dyn-chip{padding:6px 12px;border:1px solid rgba(128,128,128,.45);border-radius:999px;font-size:12px}\n.plx-dyn-tick{display:flex;width:44px;height:44px;align-items:center;justify-content:center;border-radius:999px;background:rgba(34,197,94,.25);font-size:22px}";
18276
18397
  //#endregion
18277
18398
  //#region src/v2/render/formAction.ts
18278
- function ll(e, t, n) {
18399
+ function yl(e, t, n) {
18279
18400
  let r = e?.trim();
18280
18401
  if (r) return {
18281
18402
  kind: "custom",
@@ -18290,14 +18411,14 @@ function ll(e, t, n) {
18290
18411
  url: `/api/public/forms/${encodeURIComponent(n.templateId)}/submit?form=${encodeURIComponent(t)}`
18291
18412
  } : { kind: "none" };
18292
18413
  }
18293
- var ul = (e) => (t) => {
18294
- let n = ll(void 0, t, e);
18414
+ var bl = (e) => (t) => {
18415
+ let n = yl(void 0, t, e);
18295
18416
  return n.kind === "none" ? void 0 : n.url;
18296
- }, dl = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
18297
- function fl(e) {
18417
+ }, xl = (e) => e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
18418
+ function Sl(e) {
18298
18419
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = (e) => {
18299
18420
  if (e.type === "section") {
18300
- let r = wt((typeof e.props?.anchor == "string" ? dl(e.props.anchor) : "") || dl(e.name || "") || "section", "section"), i = r;
18421
+ let r = wt((typeof e.props?.anchor == "string" ? xl(e.props.anchor) : "") || xl(e.name || "") || "section", "section"), i = r;
18301
18422
  for (let e = 2; n.has(i); e++) i = `${r}-${e}`;
18302
18423
  n.add(i), t.set(e.id, i);
18303
18424
  }
@@ -18307,23 +18428,23 @@ function fl(e) {
18307
18428
  }
18308
18429
  //#endregion
18309
18430
  //#region src/v2/render/boxTags.ts
18310
- var pl = [
18431
+ var Cl = [
18311
18432
  "header",
18312
18433
  "nav",
18313
18434
  "main",
18314
18435
  "footer",
18315
18436
  "aside",
18316
18437
  "article"
18317
- ], ml = {
18438
+ ], wl = {
18318
18439
  section: [
18319
18440
  "section",
18320
- ...pl,
18441
+ ...Cl,
18321
18442
  "div"
18322
18443
  ],
18323
18444
  container: [
18324
18445
  "div",
18325
18446
  "section",
18326
- ...pl
18447
+ ...Cl
18327
18448
  ],
18328
18449
  card: [
18329
18450
  "div",
@@ -18334,52 +18455,52 @@ var pl = [
18334
18455
  columns: [
18335
18456
  "div",
18336
18457
  "section",
18337
- ...pl
18458
+ ...Cl
18338
18459
  ],
18339
18460
  column: [
18340
18461
  "div",
18341
18462
  "section",
18342
- ...pl
18463
+ ...Cl
18343
18464
  ]
18344
- }, hl = {
18465
+ }, Tl = {
18345
18466
  section: "section",
18346
18467
  container: "div",
18347
18468
  card: "div",
18348
18469
  columns: "div",
18349
18470
  column: "div"
18350
- }, gl = null, _l = () => gl ??= ue(), vl = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
18351
- function yl(e) {
18471
+ }, El = null, Dl = () => El ??= ue(), Ol = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
18472
+ function kl(e) {
18352
18473
  if (!/^(?:repeating-)?(?:linear|radial|conic)-gradient\(/i.test(e) || e.length > 600 || !/^[A-Za-z0-9\s.,#%()\-+*/]+$/.test(e) || /url\s*\(|expression|javascript|image-set|\/\*/i.test(e)) return !1;
18353
18474
  let t = 0;
18354
18475
  for (let n of e) if (n === "(") t += 1;
18355
18476
  else if (n === ")" && --t < 0) return !1;
18356
18477
  return t === 0 && e.endsWith(")");
18357
18478
  }
18358
- function bl(e, t) {
18479
+ function Al(e, t) {
18359
18480
  if (typeof t == "number") return Number.isFinite(t) ? String(t) : null;
18360
18481
  let n = t.trim();
18361
- return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) || yl(n) ? n : null : /[;{}<>\\]|\/\*|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding|url\s*\(/i.test(n) ? null : n : null;
18482
+ return n ? e === "backgroundImage" ? n === "none" || /^url\("(?:[^"\\\n]|\\[0-9a-f]{1,6} )*"\)$/i.test(n) || kl(n) ? n : null : /[;{}<>\\]|\/\*|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding|url\s*\(/i.test(n) ? null : n : null;
18362
18483
  }
18363
- function xl(e) {
18484
+ function jl(e) {
18364
18485
  let t = [];
18365
18486
  for (let [n, r] of Object.entries(e)) {
18366
18487
  if (r === void 0) continue;
18367
- let e = bl(n, r);
18368
- e !== null && t.push(`${vl(n)}:${e}`);
18488
+ let e = Al(n, r);
18489
+ e !== null && t.push(`${Ol(n)}:${e}`);
18369
18490
  }
18370
18491
  return t.join(";");
18371
18492
  }
18372
- function Sl(e, t) {
18493
+ function Ml(e, t) {
18373
18494
  let n = {};
18374
18495
  for (let r of Object.keys(t)) e[r] !== t[r] && (n[r] = t[r]);
18375
18496
  for (let r of Object.keys(e)) r in t || (n[r] = r === "display" ? "revert" : "unset");
18376
18497
  return n;
18377
18498
  }
18378
- var Cl = (e) => {
18499
+ var Nl = (e) => {
18379
18500
  let t = e?.split(",")[0]?.trim().replace(/^['"]|['"]$/g, "");
18380
18501
  return t && x(t) ? t : null;
18381
18502
  };
18382
- function wl(e, t) {
18503
+ function Pl(e, t) {
18383
18504
  if (t && e.includes(t)) {
18384
18505
  let [n, ...r] = e.split(t);
18385
18506
  return [
@@ -18390,7 +18511,7 @@ function wl(e, t) {
18390
18511
  }
18391
18512
  return [e];
18392
18513
  }
18393
- function Tl(e, t = {}) {
18514
+ function Fl(e, t = {}) {
18394
18515
  let n = Se(ba(e)), r = {
18395
18516
  desktop: De(n.rootNode, "desktop"),
18396
18517
  tablet: De(n.rootNode, "tablet"),
@@ -18399,7 +18520,7 @@ function Tl(e, t = {}) {
18399
18520
  apiKey: t.apiKey,
18400
18521
  templateId: t.templateId,
18401
18522
  formAction: t.formAction
18402
- }, m = fl(n.rootNode), h = (e, n) => {
18523
+ }, m = Sl(n.rootNode), h = (e, n) => {
18403
18524
  if (e.hidden) return null;
18404
18525
  let l = e.type === "page", h = {
18405
18526
  desktop: !0,
@@ -18414,14 +18535,14 @@ function Tl(e, t = {}) {
18414
18535
  _[t] = { display: "none" };
18415
18536
  continue;
18416
18537
  }
18417
- let r = de(e, t), i = Lc(e, r, {
18538
+ let r = de(e, t), i = qc(e, r, {
18418
18539
  viewport: t,
18419
18540
  isGridChild: (n ? de(n, t).layoutMode : void 0) === "grid",
18420
18541
  isRootPage: l,
18421
18542
  forPublish: !0
18422
18543
  }).css;
18423
18544
  e.type === "section" && (i.overflow = "hidden"), e.props?.isFlowSpacer && (i.visibility = "hidden"), _[t] = i;
18424
- let s = Cl(r.fontFamily);
18545
+ let s = Nl(r.fontFamily);
18425
18546
  s && a.add(s);
18426
18547
  let c = r.isBold ? 700 : Number(r.fontWeight);
18427
18548
  Number.isInteger(c) && c >= 100 && c <= 900 && o.add(c);
@@ -18430,22 +18551,22 @@ function Tl(e, t = {}) {
18430
18551
  cls: g,
18431
18552
  rule: _
18432
18553
  });
18433
- let y = Pc(de(e, "desktop"));
18554
+ let y = Wc(de(e, "desktop"));
18434
18555
  y && u.push({
18435
18556
  cls: g,
18436
18557
  css: y
18437
18558
  });
18438
18559
  let b = [g, Ct(de(e, "desktop").customClasses)].filter(Boolean).join(" "), x = () => (e.children ?? []).map((t) => v(t, e)).filter((e) => e !== null);
18439
18560
  if (qt(e.type)) {
18440
- let n = sl(e, {
18561
+ let n = _l(e, {
18441
18562
  uid: wt(e.id),
18442
18563
  editing: !1,
18443
18564
  allowEmbedScripts: t.allowEmbedScripts !== !1,
18444
- formAction: ul(p),
18565
+ formAction: bl(p),
18445
18566
  now: f,
18446
18567
  templateId: t.templateId
18447
18568
  });
18448
- return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (c = !0), e.type === "form" && ll((e.props ?? {}).action, e.id, p).kind === "none" && s.push(`The form "${e.name}" has nowhere to send messages. Give it an address, or set one for the whole site.`), e.type === "signupForm" && !n.attrs?.["data-plexo-template-id"] && s.push(`The sign-up form "${e.name}" isn't connected to a funnel yet, so visitors can't sign up.`), {
18569
+ return n ? ((e.type === "carousel" || e.type === "timer" || e.type === "form") && (c = !0), e.type === "form" && yl((e.props ?? {}).action, e.id, p).kind === "none" && s.push(`The form "${e.name}" has nowhere to send messages. Give it an address, or set one for the whole site.`), e.type === "signupForm" && !n.attrs?.["data-plexo-template-id"] && s.push(`The sign-up form "${e.name}" isn't connected to a funnel yet, so visitors can't sign up.`), {
18449
18570
  ...n,
18450
18571
  attrs: {
18451
18572
  ...n.attrs,
@@ -18459,10 +18580,10 @@ function Tl(e, t = {}) {
18459
18580
  class: b,
18460
18581
  id: m.get(e.id)
18461
18582
  }, x());
18462
- case "heading": return M(`h${Tt(e.props?.level, 1, 6, 2)}`, { class: b }, wl(e.content ?? "", e.props?.highlightText));
18463
- case "paragraph": return M("p", { class: b }, wl(e.content ?? "", e.props?.highlightText));
18583
+ case "heading": return M(`h${Tt(e.props?.level, 1, 6, 2)}`, { class: b }, Pl(e.content ?? "", e.props?.highlightText));
18584
+ case "paragraph": return M("p", { class: b }, Pl(e.content ?? "", e.props?.highlightText));
18464
18585
  case "button": {
18465
- let t = e.props?.href ? P(e.props.href) : "", n = wl(e.content ?? "", e.props?.highlightText);
18586
+ let t = e.props?.href ? P(e.props.href) : "", n = Pl(e.content ?? "", e.props?.highlightText);
18466
18587
  return t && t !== "#" ? M("a", {
18467
18588
  class: `${b} plx-btn`,
18468
18589
  href: t
@@ -18471,7 +18592,7 @@ function Tl(e, t = {}) {
18471
18592
  type: "button"
18472
18593
  }, n);
18473
18594
  }
18474
- case "badge": return M("div", { class: b }, wl(e.content ?? "", e.props?.highlightText));
18595
+ case "badge": return M("div", { class: b }, Pl(e.content ?? "", e.props?.highlightText));
18475
18596
  case "image": {
18476
18597
  let t = vt(e.props?.src);
18477
18598
  return M("div", { class: `${b} plx-image` }, t ? {
@@ -18499,10 +18620,10 @@ function Tl(e, t = {}) {
18499
18620
  if (!n) return n;
18500
18621
  let r = {}, i = typeof e.props?.ariaLabel == "string" ? e.props.ariaLabel.trim().slice(0, 200) : "";
18501
18622
  i && (r["aria-label"] = i), e.props?.ariaHidden === !0 && (r["aria-hidden"] = "true");
18502
- let a = ml[e.type] && typeof e.props?.htmlTag == "string" && ml[e.type].includes(e.props.htmlTag) ? e.props.htmlTag : null, o = a ? {
18623
+ let a = wl[e.type] && typeof e.props?.htmlTag == "string" && wl[e.type].includes(e.props.htmlTag) ? e.props.htmlTag : null, o = a ? {
18503
18624
  ...n,
18504
18625
  tag: a
18505
- } : n, s = e.type === "page" ? void 0 : Ic(de(e, "desktop"));
18626
+ } : n, s = e.type === "page" ? void 0 : Kc(de(e, "desktop"));
18506
18627
  s && (c = !0, l = !0, r.class = `${o.attrs?.class ?? ""} plx-in plx-in-${s.kind}`.trim());
18507
18628
  let u = Object.keys(r).length ? {
18508
18629
  ...o,
@@ -18514,7 +18635,7 @@ function Tl(e, t = {}) {
18514
18635
  ...o.style,
18515
18636
  "--plx-delay": `${s.delay}ms`
18516
18637
  } } : {}
18517
- } : o, d = e.type === "section" ? null : vc(e.props?.htmlId);
18638
+ } : o, d = e.type === "section" ? null : Oc(e.props?.htmlId);
18518
18639
  if (!d) return u;
18519
18640
  let f = d;
18520
18641
  for (let e = 2; g.has(f); e++) f = `${d}-${e}`;
@@ -18531,7 +18652,7 @@ function Tl(e, t = {}) {
18531
18652
  for (let [n, i] of r[e]) i === "outside" && r.desktop.get(n) !== "outside" && (t += 1);
18532
18653
  t && s.push(`On ${e}, ${t === 1 ? "1 element is" : `${t} elements are`} outside the screen and won't appear. Open the ${e} view and choose "Fit to this screen".`);
18533
18654
  }
18534
- let y = t.designSystem ? te(t.designSystem) : _l(), x = v(n.rootNode, null) ?? M("div", { class: "plx-page" }), S = RegExp(`"type":"(${Kt.join("|")})"`).test(JSON.stringify(n.rootNode)), C = [
18655
+ let y = t.designSystem ? te(t.designSystem) : Dl(), x = v(n.rootNode, null) ?? M("div", { class: "plx-page" }), S = RegExp(`"type":"(${Kt.join("|")})"`).test(JSON.stringify(n.rootNode)), C = [
18535
18656
  ":where(.plx-page,.plx-page *,.plx-page *::before,.plx-page *::after){box-sizing:border-box}",
18536
18657
  ":where(.plx-page *){margin:0;padding:0;border:0 solid}",
18537
18658
  ".plx-page{position:relative;overflow-x:clip;container-type:inline-size;container-name:plx-page;-webkit-text-size-adjust:100%;font-family:var(--semantic-font-family-body, var(--font-family-sans))}",
@@ -18547,29 +18668,29 @@ function Tl(e, t = {}) {
18547
18668
  ".plx-hl{color:#FBBF24;font-style:italic;font-family:serif;font-weight:400}",
18548
18669
  ".plx-ph{width:100%;height:100%;min-height:60px;background:linear-gradient(135deg,rgba(128,128,128,.18),rgba(128,128,128,.32))}"
18549
18670
  ];
18550
- S && C.push(cl);
18671
+ S && C.push(vl);
18551
18672
  for (let { cls: e, rule: t } of i) {
18552
- let n = t.desktop ? xl(t.desktop) : "";
18673
+ let n = t.desktop ? jl(t.desktop) : "";
18553
18674
  n && C.push(`.${e}{${n}}`);
18554
18675
  }
18555
- u.length && C.push(`@media (hover:hover){${u.map((e) => `.${e.cls}:hover{${xl(e.css)}}`).join("")}}`), l && C.push("@media (prefers-reduced-motion:no-preference){.plx-anim .plx-in{opacity:0;transition:opacity .6s ease-out var(--plx-delay,0ms),translate .6s ease-out var(--plx-delay,0ms),scale .6s ease-out var(--plx-delay,0ms)}.plx-anim .plx-in.plx-in-slide-up{translate:0 28px}.plx-anim .plx-in.plx-in-slide-left{translate:-36px 0}.plx-anim .plx-in.plx-in-slide-right{translate:36px 0}.plx-anim .plx-in.plx-in-zoom{scale:.92}.plx-anim .plx-in.plx-in-on{opacity:1;translate:none;scale:none}}");
18676
+ u.length && C.push(`@media (hover:hover){${u.map((e) => `.${e.cls}:hover{${jl(e.css)}}`).join("")}}`), l && C.push("@media (prefers-reduced-motion:no-preference){.plx-anim .plx-in{opacity:0;transition:opacity .6s ease-out var(--plx-delay,0ms),translate .6s ease-out var(--plx-delay,0ms),scale .6s ease-out var(--plx-delay,0ms)}.plx-anim .plx-in.plx-in-slide-up{translate:0 28px}.plx-anim .plx-in.plx-in-slide-left{translate:-36px 0}.plx-anim .plx-in.plx-in-slide-right{translate:36px 0}.plx-anim .plx-in.plx-in-zoom{scale:.92}.plx-anim .plx-in.plx-in-on{opacity:1;translate:none;scale:none}}");
18556
18677
  for (let e of ["tablet", "mobile"]) {
18557
18678
  let t = e === "tablet" ? "desktop" : "tablet", n = [];
18558
18679
  for (let { cls: r, rule: a } of i) {
18559
- let i = xl(Sl(a[t] ?? {}, a[e] ?? {}));
18680
+ let i = jl(Ml(a[t] ?? {}, a[e] ?? {}));
18560
18681
  i && n.push(`.${r}{${i}}`);
18561
18682
  }
18562
18683
  n.length && C.push(`@container plx-page ${pe[e]}{${n.join("")}}`);
18563
18684
  }
18564
18685
  let w = C.join("\n");
18565
- for (let e of Cs(y, w)) a.add(e);
18686
+ for (let e of Ns(y, w)) a.add(e);
18566
18687
  let ee = [...a], T = new Set(ee.filter((e) => _(y.fonts, e)).map((e) => e.toLowerCase())), E = ae(y.fonts, T), D = b(ee.filter((e) => !T.has(e.toLowerCase())).map((e) => ({
18567
18688
  family: e,
18568
18689
  weights: [...o]
18569
18690
  })));
18570
18691
  return {
18571
18692
  tree: x,
18572
- css: `${E ? `${E}\n` : ""}${ws(y, w)}\n${w}`,
18693
+ css: `${E ? `${E}\n` : ""}${Ps(y, w)}\n${w}`,
18573
18694
  usesRuntime: c,
18574
18695
  fonts: ee,
18575
18696
  fontLinks: D,
@@ -18578,7 +18699,7 @@ function Tl(e, t = {}) {
18578
18699
  }
18579
18700
  //#endregion
18580
18701
  //#region src/v2/compile/html.ts
18581
- var El = (e) => {
18702
+ var Il = (e) => {
18582
18703
  let t = "";
18583
18704
  for (let [n, r] of Object.entries(e.attrs ?? {})) r === void 0 || r === !1 || (t += r === !0 ? ` ${n}` : ` ${n}="${N(String(r))}"`);
18584
18705
  if (e.style) {
@@ -18587,13 +18708,13 @@ var El = (e) => {
18587
18708
  }
18588
18709
  return t;
18589
18710
  };
18590
- function Dl(e) {
18711
+ function Ll(e) {
18591
18712
  if (typeof e == "string") return ht(e);
18592
- let t = `<${e.tag}${El(e)}>`;
18593
- return ct.has(e.tag) ? t : `${t}${(e.children ?? []).map(Dl).join("")}</${e.tag}>`;
18713
+ let t = `<${e.tag}${Il(e)}>`;
18714
+ return ct.has(e.tag) ? t : `${t}${(e.children ?? []).map(Ll).join("")}</${e.tag}>`;
18594
18715
  }
18595
- function Ol(e, t = {}) {
18596
- let n = Tl(e, t), r = Dl(n.tree), i = t.runtime === "none" || !n.usesRuntime ? "" : `(${gc})(document);`.replace(/<\/script/gi, "<\\/script"), a = bc(t.customJs);
18716
+ function Rl(e, t = {}) {
18717
+ let n = Fl(e, t), r = Ll(n.tree), i = t.runtime === "none" || !n.usesRuntime ? "" : `(${Ec})(document);`.replace(/<\/script/gi, "<\\/script"), a = Ac(t.customJs);
18597
18718
  a.warning && n.warnings.push(a.warning);
18598
18719
  let o = a.code ? `${i}${i ? "\n" : ""}${a.code}` : i, s = n.fontLinks.length ? `<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>${n.fontLinks.map((e) => `<link rel="stylesheet" href="${N(e)}">`).join("")}` : "", c = `<!doctype html>
18599
18720
  <html lang="${N(t.lang ?? "en")}">
@@ -18619,14 +18740,14 @@ ${i ? `<script>${i}<\/script>\n` : ""}${a.code ? `<script>\n${a.code}\n<\/script
18619
18740
  }
18620
18741
  //#endregion
18621
18742
  //#region src/v2/email/support.ts
18622
- var kl = /* @__PURE__ */ new Set([
18743
+ var zl = /* @__PURE__ */ new Set([
18623
18744
  "page",
18624
18745
  "section",
18625
18746
  "container",
18626
18747
  "columns",
18627
18748
  "column",
18628
18749
  "card"
18629
- ]), Al = /* @__PURE__ */ new Set([
18750
+ ]), Bl = /* @__PURE__ */ new Set([
18630
18751
  "heading",
18631
18752
  "paragraph",
18632
18753
  "button",
@@ -18634,18 +18755,18 @@ var kl = /* @__PURE__ */ new Set([
18634
18755
  "divider",
18635
18756
  "spacer",
18636
18757
  "badge"
18637
- ]), jl = (e) => kl.has(e) || Al.has(e), Ml = 600, Nl = (e, t, n = null) => {
18638
- t(e, n), e.children?.forEach((n) => Nl(n, t, e));
18758
+ ]), Vl = (e) => zl.has(e) || Bl.has(e), Hl = 600, Ul = (e, t, n = null) => {
18759
+ t(e, n), e.children?.forEach((n) => Ul(n, t, e));
18639
18760
  };
18640
- function Pl(e) {
18761
+ function Wl(e) {
18641
18762
  let t = [];
18642
- return Nl(e.rootNode, (e) => {
18763
+ return Ul(e.rootNode, (e) => {
18643
18764
  let n = (n) => t.push({
18644
18765
  nodeId: e.id,
18645
18766
  name: e.name,
18646
18767
  message: n
18647
18768
  });
18648
- if (!jl(e.type)) {
18769
+ if (!Vl(e.type)) {
18649
18770
  n(`“${e.name}” is a ${e.type}, which email apps can't show, so it is left out.`);
18650
18771
  return;
18651
18772
  }
@@ -18655,7 +18776,7 @@ function Pl(e) {
18655
18776
  }
18656
18777
  //#endregion
18657
18778
  //#region src/v2/email/compile.ts
18658
- var Fl = (e) => {
18779
+ var Gl = (e) => {
18659
18780
  let t = f(e);
18660
18781
  return t && t.a > .05 ? [
18661
18782
  t.r,
@@ -18663,7 +18784,7 @@ var Fl = (e) => {
18663
18784
  t.b
18664
18785
  ] : null;
18665
18786
  };
18666
- function Il([e, t, n]) {
18787
+ function Kl([e, t, n]) {
18667
18788
  let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = (o + s) / 2;
18668
18789
  if (o === s) return [
18669
18790
  0,
@@ -18677,7 +18798,7 @@ function Il([e, t, n]) {
18677
18798
  c
18678
18799
  ];
18679
18800
  }
18680
- var Ll = (e, t, n) => {
18801
+ var ql = (e, t, n) => {
18681
18802
  let { r, g: i, b: a } = p(e, Math.max(0, Math.min(1, t)) * 100, Math.max(0, Math.min(1, n)) * 100);
18682
18803
  return m({
18683
18804
  r,
@@ -18686,14 +18807,14 @@ var Ll = (e, t, n) => {
18686
18807
  a: 1
18687
18808
  });
18688
18809
  };
18689
- function Rl(e, t) {
18690
- let n = Fl(t);
18810
+ function Jl(e, t) {
18811
+ let n = Gl(t);
18691
18812
  if (!n) return null;
18692
- let [r, i, a] = Il(n);
18693
- return e === "bg" ? a >= .55 ? Ll(r, Math.min(i, .35) * .6, .045 + (a - .55) * .2) : null : e === "text" || e === "border" ? a >= .5 ? null : i > .25 ? Ll(r, Math.min(i, .7), Math.max(a, .64)) : e === "border" ? Ll(r, i, Math.max(a, .55)) : Ll(r, i * .8, Math.min(.93, .93 - a * .5)) : e === "btnbg" ? a < .2 && i < .25 ? Ll(r, i * .3, .92) : a < .34 ? Ll(r, i, .44) : null : e === "btntext" ? a > .8 ? Ll(r, Math.min(i, .3), .1) : null : a > .6 ? Ll(r, i * .5, .2 + (a - .6) * .15) : null;
18813
+ let [r, i, a] = Kl(n);
18814
+ return e === "bg" ? a >= .55 ? ql(r, Math.min(i, .35) * .6, .045 + (a - .55) * .2) : null : e === "text" || e === "border" ? a >= .5 ? null : i > .25 ? ql(r, Math.min(i, .7), Math.max(a, .64)) : e === "border" ? ql(r, i, Math.max(a, .55)) : ql(r, i * .8, Math.min(.93, .93 - a * .5)) : e === "btnbg" ? a < .2 && i < .25 ? ql(r, i * .3, .92) : a < .34 ? ql(r, i, .44) : null : e === "btntext" ? a > .8 ? ql(r, Math.min(i, .3), .1) : null : a > .6 ? ql(r, i * .5, .2 + (a - .6) * .15) : null;
18694
18815
  }
18695
- var zl = "Arial, Helvetica, sans-serif", W = (e) => `${Math.round(e * 100) / 100}px`;
18696
- function Bl(e) {
18816
+ var Yl = "Arial, Helvetica, sans-serif", G = (e) => `${Math.round(e * 100) / 100}px`;
18817
+ function Xl(e) {
18697
18818
  if (typeof e == "number" && Number.isFinite(e)) return e;
18698
18819
  if (typeof e != "string") return;
18699
18820
  let t = /^\s*(-?\d+(?:\.\d+)?)\s*(px|rem|em)?\s*$/.exec(e);
@@ -18701,11 +18822,11 @@ function Bl(e) {
18701
18822
  let n = parseFloat(t[1]);
18702
18823
  return t[2] === "rem" || t[2] === "em" ? n * 16 : n;
18703
18824
  }
18704
- var Vl = (e) => {
18825
+ var Zl = (e) => {
18705
18826
  let t = typeof e == "string" ? /^\s*(\d+(?:\.\d+)?)\s*%\s*$/.exec(e) : null;
18706
18827
  return t ? parseFloat(t[1]) : void 0;
18707
18828
  };
18708
- function Hl(e, t, n, r, i) {
18829
+ function Ql(e, t, n, r, i) {
18709
18830
  let a = [
18710
18831
  0,
18711
18832
  0,
@@ -18713,7 +18834,7 @@ function Hl(e, t, n, r, i) {
18713
18834
  0
18714
18835
  ];
18715
18836
  if (typeof e == "string" || typeof e == "number") {
18716
- let t = String(e).trim().split(/\s+/).map((e) => Bl(e) ?? 0);
18837
+ let t = String(e).trim().split(/\s+/).map((e) => Xl(e) ?? 0);
18717
18838
  t.length === 1 ? a = [
18718
18839
  t[0],
18719
18840
  t[0],
@@ -18736,7 +18857,7 @@ function Hl(e, t, n, r, i) {
18736
18857
  n,
18737
18858
  r,
18738
18859
  i
18739
- ].map((e) => Bl(e));
18860
+ ].map((e) => Xl(e));
18740
18861
  return [
18741
18862
  o[0] ?? a[0],
18742
18863
  o[1] ?? a[1],
@@ -18744,9 +18865,9 @@ function Hl(e, t, n, r, i) {
18744
18865
  o[3] ?? a[3]
18745
18866
  ];
18746
18867
  }
18747
- function Ul(e, t = {}) {
18748
- let n = Se(e), r = E(t.designSystem ? te(t.designSystem) : ue()), i = Math.min(800, Math.max(320, t.width ?? 600)), a = Pl(n).map((e) => e.message), o = [], s = /* @__PURE__ */ new Map(), c = (e, n) => {
18749
- if (!n || t.dark === "off" || !Rl(e, n)) return "";
18868
+ function $l(e, t = {}) {
18869
+ let n = Se(e), r = E(t.designSystem ? te(t.designSystem) : ue()), i = Math.min(800, Math.max(320, t.width ?? 600)), a = Wl(n).map((e) => e.message), o = [], s = /* @__PURE__ */ new Map(), c = (e, n) => {
18870
+ if (!n || t.dark === "off" || !Jl(e, n)) return "";
18750
18871
  let r = `${e}:${n.toLowerCase()}`, i = s.get(r);
18751
18872
  return i || (i = {
18752
18873
  cls: `plx-${e[0]}${s.size}`,
@@ -18759,7 +18880,7 @@ function Ul(e, t = {}) {
18759
18880
  return /^var\(/.test(t) ? void 0 : bt(t);
18760
18881
  }, d = (e) => {
18761
18882
  try {
18762
- return as(e, {
18883
+ return hs(e, {
18763
18884
  width: i,
18764
18885
  fontPx: 16,
18765
18886
  tokens: r
@@ -18767,12 +18888,12 @@ function Ul(e, t = {}) {
18767
18888
  } catch {
18768
18889
  return;
18769
18890
  }
18770
- }, f = (e) => typeof e == "string" ? Bl(e) ?? (/var\(|calc\(/.test(e) ? d(e) : void 0) : Bl(e), p = (() => {
18891
+ }, f = (e) => typeof e == "string" ? Xl(e) ?? (/var\(|calc\(/.test(e) ? d(e) : void 0) : Xl(e), p = (() => {
18771
18892
  let e = ie(r, "var(--semantic-font-family-body, var(--font-family-sans))");
18772
- return e && !/^var\(/.test(e) ? e : zl;
18893
+ return e && !/^var\(/.test(e) ? e : Yl;
18773
18894
  })(), m = /* @__PURE__ */ new Map(), h = (e) => {
18774
18895
  let t = (typeof e == "string" ? ie(r, e.trim()) : "").split(",")[0]?.replace(/["']/g, "").trim();
18775
- return !t || /^var\(/.test(t) || !/^[\w\s-]{1,60}$/.test(t) ? p.includes(",") ? p : `${p}, ${zl}` : (m.has(t) || m.set(t, /* @__PURE__ */ new Set()), `'${t}', ${/(serif|georgia|times|garamond|playfair|fraunces|lora|merriweather|cormorant|libre baskerville|dm serif|crimson|spectral|newsreader|source serif)/i.test(t) && !/sans/i.test(t) ? "Georgia, 'Times New Roman', serif" : zl}`);
18896
+ return !t || /^var\(/.test(t) || !/^[\w\s-]{1,60}$/.test(t) ? p.includes(",") ? p : `${p}, ${Yl}` : (m.has(t) || m.set(t, /* @__PURE__ */ new Set()), `'${t}', ${/(serif|georgia|times|garamond|playfair|fraunces|lora|merriweather|cormorant|libre baskerville|dm serif|crimson|spectral|newsreader|source serif)/i.test(t) && !/sans/i.test(t) ? "Georgia, 'Times New Roman', serif" : Yl}`);
18776
18897
  }, g = (e, t) => {
18777
18898
  let n = je(t.textStyle) ? t.textStyle : e.type === "heading" ? Ie(e.props?.level) : null;
18778
18899
  return n ? Me(n) : null;
@@ -18784,12 +18905,12 @@ function Ul(e, t = {}) {
18784
18905
  lh: p,
18785
18906
  family: _
18786
18907
  };
18787
- }, v = (e) => ht(e).replace(/\r?\n/g, "<br>"), y = (e) => e.replace(/\s+/g, " ").trim(), x = (e) => Hl(e.padding, e.paddingTop, e.paddingRight, e.paddingBottom, e.paddingLeft), S = (e) => e === "center" ? "center" : e === "right" || e === "flex-end" ? "right" : e === "left" || e === "flex-start" ? "left" : void 0, C = (e) => {
18908
+ }, v = (e) => ht(e).replace(/\r?\n/g, "<br>"), y = (e) => e.replace(/\s+/g, " ").trim(), x = (e) => Ql(e.padding, e.paddingTop, e.paddingRight, e.paddingBottom, e.paddingLeft), S = (e) => e === "center" ? "center" : e === "right" || e === "flex-end" ? "right" : e === "left" || e === "flex-start" ? "left" : void 0, C = (e) => {
18788
18909
  let t = f(e.borderWidth), n = u(e.borderColor), r = e.borderStyle && e.borderStyle !== "none" ? e.borderStyle : void 0;
18789
- return t && n && r ? `border:${W(t)} ${r} ${n};` : "";
18910
+ return t && n && r ? `border:${G(t)} ${r} ${n};` : "";
18790
18911
  }, w = (e) => {
18791
18912
  let t = f(e.borderRadius);
18792
- return t ? `border-radius:${W(Math.min(t, 999))};` : "";
18913
+ return t ? `border-radius:${G(Math.min(t, 999))};` : "";
18793
18914
  }, ee = (e) => f(e.gap) ?? 0, T = (e) => {
18794
18915
  if (typeof e.backgroundGradient != "string") return "";
18795
18916
  let t = /^\s*linear-gradient\(\s*((?:\d{1,3}deg)|(?:to (?:top|bottom|left|right)(?: (?:left|right|top|bottom))?))\s*,(.+)\)\s*$/i.exec(e.backgroundGradient);
@@ -18803,7 +18924,7 @@ function Ul(e, t = {}) {
18803
18924
  return r.length >= 2 && r.length <= 5 ? `background-image:linear-gradient(${t[1]},${r.join(",")});` : "";
18804
18925
  };
18805
18926
  function D(e, n) {
18806
- if (!jl(e.type)) return "";
18927
+ if (!Vl(e.type)) return "";
18807
18928
  let r = e.styles ?? {};
18808
18929
  if (r.display === "none") return "";
18809
18930
  switch (e.type) {
@@ -18812,10 +18933,10 @@ function Ul(e, t = {}) {
18812
18933
  case "badge": {
18813
18934
  let t = _(e, r), n = u(r.textColor) ?? u("var(--color-text-primary)") ?? "#111827", i = e.type === "heading" ? `h${Math.min(6, Math.max(1, Math.round(Number(e.props?.level) || 2)))}` : "p", a = typeof e.content == "string" ? e.content : "";
18814
18935
  o.push(y(a));
18815
- let s = S(r.textAlign) ?? "left", d = f(r.letterSpacing), p = `margin:0;padding:0;font-family:${t.family};font-size:${W(t.size)};line-height:${W(t.lh)};font-weight:${t.weight};color:${n};text-align:${s};${r.isItalic ? "font-style:italic;" : ""}${r.isUnderline ? "text-decoration:underline;" : ""}${r.textTransform && r.textTransform !== "none" ? `text-transform:${r.textTransform};` : ""}${d ? `letter-spacing:${W(d)};` : ""}`, m = u(r.backgroundColor), h = `<${i}${l(c("text", n))} style="${N(p)}">${v(a)}</${i}>`;
18936
+ let s = S(r.textAlign) ?? "left", d = f(r.letterSpacing), p = `margin:0;padding:0;font-family:${t.family};font-size:${G(t.size)};line-height:${G(t.lh)};font-weight:${t.weight};color:${n};text-align:${s};${r.isItalic ? "font-style:italic;" : ""}${r.isUnderline ? "text-decoration:underline;" : ""}${r.textTransform && r.textTransform !== "none" ? `text-transform:${r.textTransform};` : ""}${d ? `letter-spacing:${G(d)};` : ""}`, m = u(r.backgroundColor), h = `<${i}${l(c("text", n))} style="${N(p)}">${v(a)}</${i}>`;
18816
18937
  if (e.type === "badge" || m) {
18817
18938
  let [e, t, n, i] = x(r);
18818
- return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${s === "left" ? "" : ` align="${s}"`}><tr><td${m ? ` bgcolor="${m}"` : ""}${l(c("bg", m))} style="${N(`${m ? `background-color:${m};` : ""}padding:${W(e)} ${W(t)} ${W(n)} ${W(i)};${w(r)}${C(r)}`)}">${h}</td></tr></table>`;
18939
+ return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${s === "left" ? "" : ` align="${s}"`}><tr><td${m ? ` bgcolor="${m}"` : ""}${l(c("bg", m))} style="${N(`${m ? `background-color:${m};` : ""}padding:${G(e)} ${G(t)} ${G(n)} ${G(i)};${w(r)}${C(r)}`)}">${h}</td></tr></table>`;
18819
18940
  }
18820
18941
  return h;
18821
18942
  }
@@ -18827,49 +18948,49 @@ function Ul(e, t = {}) {
18827
18948
  f || 28,
18828
18949
  p || 14,
18829
18950
  m || 28
18830
- ], ee = S(r.textAlign) ?? S(r.alignSelf) ?? "left", T = r.backgroundColor === "transparent", E = w(r) || "border-radius:8px;", te = C(r), D = `${T ? "" : `background-color:${a};`}${E}${te}`, O = T ? null : Rl("btnbg", a), ne = O ? Fl(O) : null, re = !!ne && Il(ne)[2] > .8 && !!Rl("btntext", s), ie = r.widthSizing === "fill" || r.width === "100%" || r.isFullWidth;
18831
- return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${ie ? " width=\"100%\"" : ""} align="${ee}"><tr><td${T ? "" : ` bgcolor="${a}"`}${l([T ? "" : c("btnbg", a), te && u(r.borderColor) ? c("border", u(r.borderColor)) : ""].filter(Boolean).join(" "))} align="center" style="${N(D)}"><a href="${N(i)}" target="_blank"${l(T ? c("text", u(r.textColor) ?? a) : re ? c("btntext", s) : "")} style="${N(`display:${ie ? "block" : "inline-block"};padding:${W(h)} ${W(g)} ${W(v)} ${W(b)};font-family:${t.family};font-size:${W(t.size)};line-height:${W(Math.round(t.size * 1.2))};font-weight:${t.weight === "400" ? "600" : t.weight};color:${T ? u(r.textColor) ?? a : s};text-decoration:none;white-space:nowrap;${E}`)}">${ht(n)}</a></td></tr></table>`;
18951
+ ], ee = S(r.textAlign) ?? S(r.alignSelf) ?? "left", T = r.backgroundColor === "transparent", E = w(r) || "border-radius:8px;", te = C(r), D = `${T ? "" : `background-color:${a};`}${E}${te}`, O = T ? null : Jl("btnbg", a), ne = O ? Gl(O) : null, re = !!ne && Kl(ne)[2] > .8 && !!Jl("btntext", s), ie = r.widthSizing === "fill" || r.width === "100%" || r.isFullWidth;
18952
+ return `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${ie ? " width=\"100%\"" : ""} align="${ee}"><tr><td${T ? "" : ` bgcolor="${a}"`}${l([T ? "" : c("btnbg", a), te && u(r.borderColor) ? c("border", u(r.borderColor)) : ""].filter(Boolean).join(" "))} align="center" style="${N(D)}"><a href="${N(i)}" target="_blank"${l(T ? c("text", u(r.textColor) ?? a) : re ? c("btntext", s) : "")} style="${N(`display:${ie ? "block" : "inline-block"};padding:${G(h)} ${G(g)} ${G(v)} ${G(b)};font-family:${t.family};font-size:${G(t.size)};line-height:${G(Math.round(t.size * 1.2))};font-weight:${t.weight === "400" ? "600" : t.weight};color:${T ? u(r.textColor) ?? a : s};text-decoration:none;white-space:nowrap;${E}`)}">${ht(n)}</a></td></tr></table>`;
18832
18953
  }
18833
18954
  case "image": {
18834
18955
  let i = vt(e.props?.src);
18835
18956
  if (!i) return "";
18836
- let a = typeof e.props?.alt == "string" ? e.props.alt : "", o = f(r.customWidth ?? r.width), s = Vl(r.customWidth ?? r.width), c = Math.round(Math.min(n, o ?? (s ? n * s / 100 : n))), l = S(r.alignSelf) ?? S(r.textAlign), u = `display:block;border:0;outline:none;text-decoration:none;width:${W(c)};max-width:100%;height:auto;${w(r)}`, d = t.dark === "off" ? "" : vt(e.props?.srcDark), p = d ? `<img class="plx-light" src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}"><img class="plx-dark" src="${N(d)}" alt="${N(a)}" width="${c}" style="${N(`${u}display:none;max-height:0;overflow:hidden;`)}">` : `<img src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}">`;
18957
+ let a = typeof e.props?.alt == "string" ? e.props.alt : "", o = f(r.customWidth ?? r.width), s = Zl(r.customWidth ?? r.width), c = Math.round(Math.min(n, o ?? (s ? n * s / 100 : n))), l = S(r.alignSelf) ?? S(r.textAlign), u = `display:block;border:0;outline:none;text-decoration:none;width:${G(c)};max-width:100%;height:auto;${w(r)}`, d = t.dark === "off" ? "" : vt(e.props?.srcDark), p = d ? `<img class="plx-light" src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}"><img class="plx-dark" src="${N(d)}" alt="${N(a)}" width="${c}" style="${N(`${u}display:none;max-height:0;overflow:hidden;`)}">` : `<img src="${N(i)}" alt="${N(a)}" width="${c}" style="${N(u)}">`;
18837
18958
  return l && l !== "left" ? `<table role="presentation" cellpadding="0" cellspacing="0" border="0" align="${l}"><tr><td>${p}</td></tr></table>` : p;
18838
18959
  }
18839
18960
  case "divider": {
18840
- let e = u(r.borderColor) ?? u("var(--color-border-default)") ?? "#e5e7eb", t = f(r.borderWidth?.toString().split(/\s+/).find((e) => Bl(e))) ?? 1;
18841
- return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${t}"${l(c("line", e))} style="font-size:1px;line-height:1px;border-top:${W(t)} solid ${e};">&nbsp;</td></tr></table>`;
18961
+ let e = u(r.borderColor) ?? u("var(--color-border-default)") ?? "#e5e7eb", t = f(r.borderWidth?.toString().split(/\s+/).find((e) => Xl(e))) ?? 1;
18962
+ return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${t}"${l(c("line", e))} style="font-size:1px;line-height:1px;border-top:${G(t)} solid ${e};">&nbsp;</td></tr></table>`;
18842
18963
  }
18843
18964
  case "spacer": {
18844
18965
  let e = Math.min(400, Math.max(1, f(r.height) ?? f(r.minHeight) ?? 24));
18845
- return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${e}" style="height:${W(e)};font-size:1px;line-height:${W(e)};">&nbsp;</td></tr></table>`;
18966
+ return `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${e}" style="height:${G(e)};font-size:1px;line-height:${G(e)};">&nbsp;</td></tr></table>`;
18846
18967
  }
18847
18968
  default: return O(e, n);
18848
18969
  }
18849
18970
  }
18850
18971
  function O(e, t, n = !1) {
18851
- let r = e.styles ?? {}, i = (e.children ?? []).filter((e) => jl(e.type) && (e.styles ?? {}).display !== "none"), [a, o, s, d] = x(r), p = u(r.backgroundColor), m = f(r.customWidth ?? r.width) ?? f(r.maxWidth), h = Math.max(40, Math.min(t, m ?? t)), g = h - d - o, _ = ee(r), v = e.type === "columns" || r.layoutMode !== "grid" && r.flexDirection === "row" && e.type !== "section" && e.type !== "page", y = S(r.alignItems), b = r.alignItems === "center" ? "middle" : r.alignItems === "flex-end" ? "bottom" : "top", E = "";
18972
+ let r = e.styles ?? {}, i = (e.children ?? []).filter((e) => Vl(e.type) && (e.styles ?? {}).display !== "none"), [a, o, s, d] = x(r), p = u(r.backgroundColor), m = f(r.customWidth ?? r.width) ?? f(r.maxWidth), h = Math.max(40, Math.min(t, m ?? t)), g = h - d - o, _ = ee(r), v = e.type === "columns" || r.layoutMode !== "grid" && r.flexDirection === "row" && e.type !== "section" && e.type !== "page", y = S(r.alignItems), b = r.alignItems === "center" ? "middle" : r.alignItems === "flex-end" ? "bottom" : "top", E = "";
18852
18973
  if (i.length) if (v) {
18853
18974
  let e = i.map((e) => {
18854
- let t = e.styles ?? {}, n = f(t.customWidth ?? t.width), r = Vl(t.customWidth ?? t.width);
18975
+ let t = e.styles ?? {}, n = f(t.customWidth ?? t.width), r = Zl(t.customWidth ?? t.width);
18855
18976
  return n === void 0 ? r !== void 0 && r < 99 ? g * r / 100 : void 0 : n;
18856
18977
  }), t = e.reduce((e, t) => e + (t ?? 0), 0), n = e.filter((e) => e === void 0).length, c = n ? Math.max(40, (g - t - _ * (i.length - 1)) / n) : 0, l = i.map((t, n) => {
18857
18978
  let a = Math.floor(e[n] ?? c), o = n === i.length - 1, s = D(t, a);
18858
- return `<td${r.stackOnMobile === !1 ? "" : " class=\"plx-col\""} width="${a}" valign="${b}" style="${N(`width:${W(a)};${o ? "" : `padding-right:${W(_)};`}vertical-align:${b};`)}">${s}</td>`;
18979
+ return `<td${r.stackOnMobile === !1 ? "" : " class=\"plx-col\""} width="${a}" valign="${b}" style="${N(`width:${G(a)};${o ? "" : `padding-right:${G(_)};`}vertical-align:${b};`)}">${s}</td>`;
18859
18980
  });
18860
- E = `<tr><td style="${N(`padding:${W(a)} ${W(o)} ${W(s)} ${W(d)};`)}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>${l.join("")}</tr></table></td></tr>`;
18981
+ E = `<tr><td style="${N(`padding:${G(a)} ${G(o)} ${G(s)} ${G(d)};`)}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>${l.join("")}</tr></table></td></tr>`;
18861
18982
  } else E = i.map((e, t) => {
18862
18983
  let n = e.styles ?? {}, r = S(n.alignSelf) ?? y ?? (e.type === "button" || e.type, void 0), c = r === "center" || n.marginLeft === "auto" && n.marginRight === "auto" || n.margin === "0 auto" ? " align=\"center\"" : r === "right" || n.marginLeft === "auto" ? " align=\"right\"" : "", l = D(e, g);
18863
18984
  if (!l) return "";
18864
- let u = t === 0 ? a : _, [f, , p] = Hl(n.margin, n.marginTop, n.marginRight, n.marginBottom, n.marginLeft);
18865
- return `<tr><td${c} style="${N(`padding:${W(u + f)} ${W(o)} ${W(t === i.length - 1 ? s + p : p)} ${W(d)};`)}">${l}</td></tr>`;
18985
+ let u = t === 0 ? a : _, [f, , p] = Ql(n.margin, n.marginTop, n.marginRight, n.marginBottom, n.marginLeft);
18986
+ return `<tr><td${c} style="${N(`padding:${G(u + f)} ${G(o)} ${G(t === i.length - 1 ? s + p : p)} ${G(d)};`)}">${l}</td></tr>`;
18866
18987
  }).join("");
18867
- else a + s > 0 && (E = `<tr><td height="${a + s}" style="font-size:1px;line-height:${W(a + s)};">&nbsp;</td></tr>`);
18868
- let te = `${p ? `background-color:${p};` : ""}${T(r)}${w(r)}${C(r)}`, O = n ? " width=\"100%\"" : ` width="${Math.round(h)}"`, ne = n ? "" : `max-width:${W(h)};width:100%;`;
18988
+ else a + s > 0 && (E = `<tr><td height="${a + s}" style="font-size:1px;line-height:${G(a + s)};">&nbsp;</td></tr>`);
18989
+ let te = `${p ? `background-color:${p};` : ""}${T(r)}${w(r)}${C(r)}`, O = n ? " width=\"100%\"" : ` width="${Math.round(h)}"`, ne = n ? "" : `max-width:${G(h)};width:100%;`;
18869
18990
  return `<table role="presentation"${O}${p ? ` bgcolor="${p}"` : ""}${l(c("bg", p))} cellpadding="0" cellspacing="0" border="0" style="${N(`${ne}${te}`)}">${E}</table>`;
18870
18991
  }
18871
- let ne = n.rootNode, re = u((ne.styles ?? {}).backgroundColor) ?? u("var(--color-bg-canvas)") ?? "#ffffff", ae = (ne.children ?? []).filter((e) => jl(e.type)).map((e) => {
18872
- let t = e.styles ?? {}, n = u(t.backgroundColor), r = kl.has(e.type) ? O(e, i) : D(e, i);
18992
+ let ne = n.rootNode, re = u((ne.styles ?? {}).backgroundColor) ?? u("var(--color-bg-canvas)") ?? "#ffffff", ae = (ne.children ?? []).filter((e) => Vl(e.type)).map((e) => {
18993
+ let t = e.styles ?? {}, n = u(t.backgroundColor), r = zl.has(e.type) ? O(e, i) : D(e, i);
18873
18994
  return r ? `<tr><td align="center"${n ? ` bgcolor="${n}"` : ""}${l(c("bg", n))} style="${N(`${n ? `background-color:${n};` : ""}${T(t)}`)}">${r}</td></tr>` : "";
18874
18995
  }).join(""), oe = t.title ?? n.name, k = b([...m].map(([e, t]) => ({
18875
18996
  family: e,
@@ -18879,7 +19000,7 @@ function Ul(e, t = {}) {
18879
19000
  700
18880
19001
  ]
18881
19002
  }))).map((e) => `<link href="${N(e)}" rel="stylesheet">\n`).join(""), se = t.preheader ? `<div style="display:none;max-height:0;overflow:hidden;opacity:0;color:transparent;mso-hide:all;">${ht(t.preheader)}${"&nbsp;&zwnj;".repeat(40)}</div>` : "", ce = c("bg", re), le = t.dark !== "off", de = (e) => {
18882
- let t = Rl(e.kind, e.color);
19003
+ let t = Jl(e.kind, e.color);
18883
19004
  if (!t) return [];
18884
19005
  let n = e.kind === "bg" || e.kind === "btnbg", r = n ? "background-color" : e.kind === "text" || e.kind === "btntext" ? "color" : e.kind === "border" ? "border-color" : "border-top-color", i = n ? "ogsb" : "ogsc";
18885
19006
  return [`.${e.cls}{${r}:${t}!important}`, `[data-${i}] .${e.cls}{${r}:${t}!important}`];
@@ -18914,7 +19035,7 @@ ${se}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" bor
18914
19035
  }
18915
19036
  //#endregion
18916
19037
  //#region src/v2/email/blank.ts
18917
- var Wl = (e) => ({
19038
+ var eu = (e) => ({
18918
19039
  id: k("page"),
18919
19040
  type: "page",
18920
19041
  name: "Email",
@@ -18928,22 +19049,22 @@ var Wl = (e) => ({
18928
19049
  },
18929
19050
  children: e
18930
19051
  });
18931
- function Gl() {
19052
+ function tu() {
18932
19053
  return [{
18933
19054
  id: k("page"),
18934
19055
  name: "Email",
18935
19056
  slug: "email",
18936
19057
  isHome: !0,
18937
- rootNode: Wl([Ji(Fi("emailText", "plain"))])
19058
+ rootNode: eu([Ji(Fi("emailText", "plain"))])
18938
19059
  }];
18939
19060
  }
18940
- function Kl() {
19061
+ function nu() {
18941
19062
  return [{
18942
19063
  id: k("page"),
18943
19064
  name: "Email",
18944
19065
  slug: "email",
18945
19066
  isHome: !0,
18946
- rootNode: Wl([
19067
+ rootNode: eu([
18947
19068
  ["emailHeader", "centered"],
18948
19069
  ["emailHero", "centered"],
18949
19070
  ["emailFeatures", "columns"],
@@ -18954,48 +19075,48 @@ function Kl() {
18954
19075
  }
18955
19076
  //#endregion
18956
19077
  //#region src/v2/migrate/legacy.ts
18957
- var ql = 1400, Jl = (e) => {
19078
+ var ru = 1400, iu = (e) => {
18958
19079
  let t = e;
18959
19080
  return !!t && typeof t == "object" && !!t.nodes && typeof t.nodes == "object" && !Array.isArray(t.nodes) && Array.isArray(t.pageOrder);
18960
- }, Yl = {
19081
+ }, au = {
18961
19082
  sm: "0 1px 3px rgba(15,23,42,0.14)",
18962
19083
  md: "0 6px 16px rgba(15,23,42,0.18)",
18963
19084
  lg: "0 16px 40px rgba(15,23,42,0.24)"
18964
- }, G = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, K = (e) => typeof e == "string" && e ? e : void 0, Xl = (e) => `${Math.round(e * 100) / 100}px`, Zl = [
19085
+ }, K = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, q = (e) => typeof e == "string" && e ? e : void 0, ou = (e) => `${Math.round(e * 100) / 100}px`, su = [
18965
19086
  {
18966
19087
  name: "desktop",
18967
- k: fe.desktop / ql,
19088
+ k: fe.desktop / ru,
18968
19089
  minFont: 0
18969
19090
  },
18970
19091
  {
18971
19092
  name: "tablet",
18972
- k: fe.tablet / ql,
19093
+ k: fe.tablet / ru,
18973
19094
  minFont: 12
18974
19095
  },
18975
19096
  {
18976
19097
  name: "mobile",
18977
- k: fe.mobile / ql,
19098
+ k: fe.mobile / ru,
18978
19099
  minFont: 11
18979
19100
  }
18980
19101
  ];
18981
- function Ql(e, t, n) {
19102
+ function cu(e, t, n) {
18982
19103
  let r = {};
18983
- return n && (e.x !== void 0 && (r.x = Math.round(e.x * t.k)), e.y !== void 0 && (r.y = Math.round(e.y * t.k))), e.width !== void 0 && (r.width = Xl(e.width * t.k), r.customWidth = r.width), e.height !== void 0 && (r.height = Xl(e.height * t.k)), e.minHeight !== void 0 && (r.minHeight = Xl(e.minHeight * t.k)), e.fontSize !== void 0 && (r.fontSize = Xl(Math.max(e.fontSize * t.k, t.minFont))), e.gap !== void 0 && (r.gap = Xl(e.gap * t.k)), r;
19104
+ return n && (e.x !== void 0 && (r.x = Math.round(e.x * t.k)), e.y !== void 0 && (r.y = Math.round(e.y * t.k))), e.width !== void 0 && (r.width = ou(e.width * t.k), r.customWidth = r.width), e.height !== void 0 && (r.height = ou(e.height * t.k)), e.minHeight !== void 0 && (r.minHeight = ou(e.minHeight * t.k)), e.fontSize !== void 0 && (r.fontSize = ou(Math.max(e.fontSize * t.k, t.minFont))), e.gap !== void 0 && (r.gap = ou(e.gap * t.k)), r;
18984
19105
  }
18985
- function $l(e, t) {
19106
+ function lu(e, t) {
18986
19107
  let { nodes: n } = e, r = /* @__PURE__ */ new Set(), i = (e) => {
18987
- let t = {}, n = G(e.borderWidth);
18988
- n && n > 0 && (t.borderWidth = Xl(n), t.borderStyle = [
19108
+ let t = {}, n = K(e.borderWidth);
19109
+ n && n > 0 && (t.borderWidth = ou(n), t.borderStyle = [
18989
19110
  "solid",
18990
19111
  "dashed",
18991
19112
  "dotted"
18992
- ].includes(String(e.borderStyle)) ? e.borderStyle : "solid", t.borderColor = K(e.borderColor) ?? "#0f172a");
18993
- let r = G(e.borderRadius);
18994
- r !== void 0 && (t.borderRadius = Xl(r));
18995
- let i = Yl[String(e.boxShadowPreset)];
19113
+ ].includes(String(e.borderStyle)) ? e.borderStyle : "solid", t.borderColor = q(e.borderColor) ?? "#0f172a");
19114
+ let r = K(e.borderRadius);
19115
+ r !== void 0 && (t.borderRadius = ou(r));
19116
+ let i = au[String(e.boxShadowPreset)];
18996
19117
  return i && (t.boxShadow = i), t;
18997
19118
  }, a = (e, t, n) => {
18998
- let [r, i, a] = Zl.map((n) => Ql(e, n, t)), o = (e, t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e[t] !== n));
19119
+ let [r, i, a] = su.map((n) => cu(e, n, t)), o = (e, t) => Object.fromEntries(Object.entries(t).filter(([t, n]) => e[t] !== n));
18999
19120
  return {
19000
19121
  styles: {
19001
19122
  ...n,
@@ -19007,11 +19128,11 @@ function $l(e, t) {
19007
19128
  }
19008
19129
  };
19009
19130
  }, o = (e) => ({
19010
- x: G(e.x),
19011
- y: G(e.y),
19012
- width: G(e.width),
19013
- height: G(e.height),
19014
- fontSize: G(e.fontSize)
19131
+ x: K(e.x),
19132
+ y: K(e.y),
19133
+ width: K(e.width),
19134
+ height: K(e.height),
19135
+ fontSize: K(e.fontSize)
19015
19136
  }), s = (e) => {
19016
19137
  let t = e.id;
19017
19138
  for (; r.has(t);) t = `${t}-x`;
@@ -19050,7 +19171,7 @@ function $l(e, t) {
19050
19171
  return {
19051
19172
  id: s(e),
19052
19173
  type: t,
19053
- name: K(e.props.name) ?? e.type,
19174
+ name: q(e.props.name) ?? e.type,
19054
19175
  ...c
19055
19176
  };
19056
19177
  };
@@ -19059,7 +19180,7 @@ function $l(e, t) {
19059
19180
  let t = /^h[1-6]$/.test(String(r.htmlTag)) ? Number(String(r.htmlTag)[1]) : null;
19060
19181
  return {
19061
19182
  ...u(t ? "heading" : "paragraph", {
19062
- textColor: K(r.color),
19183
+ textColor: q(r.color),
19063
19184
  textAlign: [
19064
19185
  "left",
19065
19186
  "center",
@@ -19081,8 +19202,8 @@ function $l(e, t) {
19081
19202
  };
19082
19203
  case "Button": return {
19083
19204
  ...u("button", {
19084
- backgroundColor: K(r.backgroundColor),
19085
- textColor: K(r.color),
19205
+ backgroundColor: q(r.backgroundColor),
19206
+ textColor: q(r.color),
19086
19207
  fontWeight: String(r.fontWeight ?? 600),
19087
19208
  display: "flex",
19088
19209
  alignItems: "center",
@@ -19096,7 +19217,7 @@ function $l(e, t) {
19096
19217
  display: "flex",
19097
19218
  flexDirection: "row",
19098
19219
  layoutMode: "flow",
19099
- backgroundColor: K(r.backgroundColor),
19220
+ backgroundColor: q(r.backgroundColor),
19100
19221
  ...c ? {
19101
19222
  position: "absolute",
19102
19223
  x: 0,
@@ -19110,7 +19231,7 @@ function $l(e, t) {
19110
19231
  width: void 0
19111
19232
  } : o.geo, f = a({
19112
19233
  ...d,
19113
- gap: G(r.gap)
19234
+ gap: K(r.gap)
19114
19235
  }, c ? !0 : o.free, {
19115
19236
  ...o.base,
19116
19237
  ...i(r),
@@ -19128,7 +19249,7 @@ function $l(e, t) {
19128
19249
  ...u("video"),
19129
19250
  props: {
19130
19251
  url: String(e.props.url ?? ""),
19131
- poster: K(e.props.coverImage),
19252
+ poster: q(e.props.coverImage),
19132
19253
  ratio: "16:9"
19133
19254
  }
19134
19255
  } : {
@@ -19140,7 +19261,7 @@ function $l(e, t) {
19140
19261
  };
19141
19262
  case "Menu": return {
19142
19263
  ...u("menu", {
19143
- textColor: K(r.color),
19264
+ textColor: q(r.color),
19144
19265
  fontSize: void 0
19145
19266
  }),
19146
19267
  props: {
@@ -19157,7 +19278,7 @@ function $l(e, t) {
19157
19278
  }, u = (e, t) => {
19158
19279
  let n = t.filter((e) => e.type === "Input");
19159
19280
  if (!n.length) return null;
19160
- let r = n.slice().sort((e, t) => (G(e.styles.y) ?? 0) - (G(t.styles.y) ?? 0) || (G(e.styles.x) ?? 0) - (G(t.styles.x) ?? 0)), i = r.map((e) => o(e.styles)), c = Math.max(...i.map((e) => (e.y ?? 0) + (e.height ?? 0))), l = t.find((e) => e.type === "Button" && (G(e.styles.y) ?? 0) >= c - 6), u = [...i, ...l ? [o(l.styles)] : []], d = Math.min(...u.map((e) => e.x ?? 0)), f = Math.min(...u.map((e) => e.y ?? 0)), p = Math.max(...u.map((e) => (e.x ?? 0) + (e.width ?? 0))) - d, m = r[0], h = r.map((e, t) => ({
19281
+ let r = n.slice().sort((e, t) => (K(e.styles.y) ?? 0) - (K(t.styles.y) ?? 0) || (K(e.styles.x) ?? 0) - (K(t.styles.x) ?? 0)), i = r.map((e) => o(e.styles)), c = Math.max(...i.map((e) => (e.y ?? 0) + (e.height ?? 0))), l = t.find((e) => e.type === "Button" && (K(e.styles.y) ?? 0) >= c - 6), u = [...i, ...l ? [o(l.styles)] : []], d = Math.min(...u.map((e) => e.x ?? 0)), f = Math.min(...u.map((e) => e.y ?? 0)), p = Math.max(...u.map((e) => (e.x ?? 0) + (e.width ?? 0))) - d, m = r[0], h = r.map((e, t) => ({
19161
19282
  id: `${String(e.props.label ?? "field").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "field"}-${t + 1}`,
19162
19283
  label: String(e.props.label ?? "Field"),
19163
19284
  type: [
@@ -19166,7 +19287,7 @@ function $l(e, t) {
19166
19287
  "tel",
19167
19288
  "textarea"
19168
19289
  ].includes(String(e.props.fieldType)) ? e.props.fieldType : "text",
19169
- placeholder: K(e.props.placeholder),
19290
+ placeholder: q(e.props.placeholder),
19170
19291
  required: !!e.props.required
19171
19292
  })), g = a({
19172
19293
  x: d,
@@ -19176,7 +19297,7 @@ function $l(e, t) {
19176
19297
  position: "absolute",
19177
19298
  horizontalConstraint: "left",
19178
19299
  verticalConstraint: "top",
19179
- textColor: K(m.styles.color),
19300
+ textColor: q(m.styles.color),
19180
19301
  padding: "0px"
19181
19302
  });
19182
19303
  return {
@@ -19196,18 +19317,18 @@ function $l(e, t) {
19196
19317
  }, d = e.pageOrder.map((e) => n[e]).filter((e) => !!e && e.type === "Section").map((e) => {
19197
19318
  let t = e.styles, r = e.children.map((e) => n[e]).filter(Boolean), i = u(e, r), o = r.filter((e) => !i?.consumed.has(e.id)).map((t) => l(t, e)).filter((e) => !!e);
19198
19319
  i && o.push(i.node);
19199
- let c = G(t.height) ?? 400, d = a({ minHeight: c }, !1, {
19320
+ let c = K(t.height) ?? 400, d = a({ minHeight: c }, !1, {
19200
19321
  layoutMode: "free",
19201
- backgroundColor: K(t.backgroundColor),
19322
+ backgroundColor: q(t.backgroundColor),
19202
19323
  ...t.pinned === "true" ? { pinned: !0 } : {},
19203
- backgroundImage: K(t.backgroundImage),
19324
+ backgroundImage: q(t.backgroundImage),
19204
19325
  backgroundSize: t.backgroundImage ? "cover" : void 0,
19205
19326
  backgroundPosition: t.backgroundImage ? "center" : void 0
19206
19327
  });
19207
19328
  return {
19208
19329
  id: s(e),
19209
19330
  type: "section",
19210
- name: K(e.props.name) ?? "Section",
19331
+ name: q(e.props.name) ?? "Section",
19211
19332
  ...d,
19212
19333
  children: o
19213
19334
  };
@@ -19231,7 +19352,7 @@ function $l(e, t) {
19231
19352
  }
19232
19353
  //#endregion
19233
19354
  //#region src/v2/compile/sanitizeHtml.ts
19234
- var eu = new Map(Object.entries({
19355
+ var uu = new Map(Object.entries({
19235
19356
  amp: "&",
19236
19357
  lt: "<",
19237
19358
  gt: ">",
@@ -19263,9 +19384,9 @@ var eu = new Map(Object.entries({
19263
19384
  hyphen: "-",
19264
19385
  dash: "-"
19265
19386
  }).map(([e, t]) => [e.toLowerCase(), t]));
19266
- function tu(e) {
19387
+ function du(e) {
19267
19388
  return e.replace(/&(?:#[xX]([0-9a-fA-F]{1,8})|#(\d{1,10})|([A-Za-z][A-Za-z0-9]{1,31}));?/g, (e, t, n, r) => {
19268
- if (r !== void 0) return eu.get(r.toLowerCase()) ?? e;
19389
+ if (r !== void 0) return uu.get(r.toLowerCase()) ?? e;
19269
19390
  let i = t === void 0 ? parseInt(n, 10) : parseInt(t, 16);
19270
19391
  if (!Number.isFinite(i) || i <= 0 || i > 1114111) return "�";
19271
19392
  try {
@@ -19275,40 +19396,40 @@ function tu(e) {
19275
19396
  }
19276
19397
  });
19277
19398
  }
19278
- var nu = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ru = /[\u0000-\u0020\u007f-\u009f\u200b-\u200f\u2028\u2029\ufeff]/g, iu = (e) => /^(\/(?!\/)|\.{0,2}\/|#|\?)/.test(e) || !/^[a-z][a-z0-9+.-]*:/i.test(e) && !e.startsWith("//");
19279
- function au(e) {
19280
- let t = e.replace(ru, "");
19281
- return !t || /^(https?|mailto|tel|sms):/i.test(t) || iu(t);
19399
+ var fu = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), pu = /[\u0000-\u0020\u007f-\u009f\u200b-\u200f\u2028\u2029\ufeff]/g, mu = (e) => /^(\/(?!\/)|\.{0,2}\/|#|\?)/.test(e) || !/^[a-z][a-z0-9+.-]*:/i.test(e) && !e.startsWith("//");
19400
+ function hu(e) {
19401
+ let t = e.replace(pu, "");
19402
+ return !t || /^(https?|mailto|tel|sms):/i.test(t) || mu(t);
19282
19403
  }
19283
- var ou = /^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml)[;,]/i;
19284
- function su(e) {
19285
- let t = e.replace(ru, "");
19286
- return !t || ou.test(t) || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
19404
+ var gu = /^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml)[;,]/i;
19405
+ function _u(e) {
19406
+ let t = e.replace(pu, "");
19407
+ return !t || gu.test(t) || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
19287
19408
  }
19288
- var cu = (e) => {
19289
- let t = e.replace(ru, "");
19409
+ var vu = (e) => {
19410
+ let t = e.replace(pu, "");
19290
19411
  return !t || /^https?:\/\//i.test(t) || /^(\/(?!\/)|\.{0,2}\/)/.test(t) || !/^[a-z][a-z0-9+.-]*:/i.test(t) && !t.startsWith("//");
19291
19412
  };
19292
- function lu(e) {
19413
+ function yu(e) {
19293
19414
  let t;
19294
19415
  try {
19295
- t = new URL(e.replace(ru, ""));
19416
+ t = new URL(e.replace(pu, ""));
19296
19417
  } catch {
19297
19418
  return !1;
19298
19419
  }
19299
19420
  return t.protocol !== "https:" || t.username || t.password || t.port ? !1 : t.hostname === "www.youtube-nocookie.com" || t.hostname === "youtube-nocookie.com" ? /^\/embed\/[\w-]{6,20}\/?$/.test(t.pathname) : t.hostname === "player.vimeo.com" && /^\/video\/\d{6,}\/?$/.test(t.pathname);
19300
19421
  }
19301
- function uu(e) {
19422
+ function bu(e) {
19302
19423
  return e.replace(/\/\*[\s\S]*?(?:\*\/|$)/g, "").replace(/\\([0-9a-fA-F]{1,6})[ \t\n\r\f]?/g, (e, t) => {
19303
19424
  let n = parseInt(t, 16);
19304
19425
  return n > 0 && n <= 1114111 ? String.fromCodePoint(n) : "�";
19305
19426
  }).replace(/\\([\s\S])/g, "$1").toLowerCase();
19306
19427
  }
19307
- var du = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|octet-stream));base64,[a-z0-9+/=]+$/i;
19308
- function fu(e, t) {
19309
- let n = e.replace(ru, "");
19428
+ var xu = /^data:(?:font\/(?:woff2?|ttf|otf|sfnt)|application\/(?:font-woff2?|x-font-(?:woff2?|ttf|otf|truetype|opentype)|octet-stream));base64,[a-z0-9+/=]+$/i;
19429
+ function Su(e, t) {
19430
+ let n = e.replace(pu, "");
19310
19431
  if (!n) return !1;
19311
- if (du.test(n)) return !0;
19432
+ if (xu.test(n)) return !0;
19312
19433
  if (/^https:\/\//i.test(n)) {
19313
19434
  let e;
19314
19435
  try {
@@ -19320,19 +19441,19 @@ function fu(e, t) {
19320
19441
  }
19321
19442
  return /^\/(?!\/)/.test(n);
19322
19443
  }
19323
- function pu(e, t) {
19444
+ function Cu(e, t) {
19324
19445
  let n = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/g, r;
19325
19446
  for (; r = n.exec(e);) {
19326
19447
  let e = (r[1] ?? r[2] ?? r[3] ?? "").trim();
19327
- if (!e.startsWith("#") && (t ? !fu(e, t.fontOrigins) : !su(e))) return !1;
19448
+ if (!e.startsWith("#") && (t ? !Su(e, t.fontOrigins) : !_u(e))) return !1;
19328
19449
  }
19329
19450
  return (e.match(/url\(/g) ?? []).length === (e.match(n) ?? []).length;
19330
19451
  }
19331
- function mu(e, t) {
19332
- let n = uu(e).replace(/\s+/g, " ");
19333
- return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) && pu(n, t);
19452
+ function wu(e, t) {
19453
+ let n = bu(e).replace(/\s+/g, " ");
19454
+ return !/expression\s*\(|javascript:|vbscript:|livescript:|(?:^|[^a-z-])behavior\s*:|-moz-binding|@import|image-set\s*\(|\bsrc\s*\(|<\/?script|<!--/.test(n) && Cu(n, t);
19334
19455
  }
19335
- var hu = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("<") && mu(e, t), gu = /* @__PURE__ */ new Set([
19456
+ var Tu = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("<") && wu(e, t), Eu = /* @__PURE__ */ new Set([
19336
19457
  "media",
19337
19458
  "container",
19338
19459
  "supports",
@@ -19343,7 +19464,7 @@ var hu = (e, t) => !e.trim().startsWith("@") && e.includes(":") && !e.includes("
19343
19464
  "page",
19344
19465
  "property"
19345
19466
  ]);
19346
- function _u(e, t = {}) {
19467
+ function Du(e, t = {}) {
19347
19468
  let n = (t.fontOrigins ?? []).map((e) => e.trim().replace(/\/+$/, "").toLowerCase()), r = 0, i = e.length, a = (t) => {
19348
19469
  let n = e[t];
19349
19470
  if (n === "\"" || n === "'") {
@@ -19384,22 +19505,22 @@ function _u(e, t = {}) {
19384
19505
  r += 1;
19385
19506
  }
19386
19507
  let f = e.slice(l, Math.min(r, i));
19387
- if (d === ";") r += 1, hu(f, s) ? c += `${f};` : /^\s*$/.test(f) && (c += f + ";");
19508
+ if (d === ";") r += 1, Tu(f, s) ? c += `${f};` : /^\s*$/.test(f) && (c += f + ";");
19388
19509
  else if (d === "{") {
19389
19510
  r += 1;
19390
- let t = uu(f).trim(), i = r, a = o(!0, /^@font-face\b/.test(t) ? { fontOrigins: n } : void 0), s = e.slice(i, r).trim() !== "";
19511
+ let t = bu(f).trim(), i = r, a = o(!0, /^@font-face\b/.test(t) ? { fontOrigins: n } : void 0), s = e.slice(i, r).trim() !== "";
19391
19512
  if (e[r] === "}" && (r += 1), s && a.trim() === "") continue;
19392
19513
  if (t.startsWith("@")) {
19393
19514
  let e = /^@([a-z-]+)/.exec(t)?.[1] ?? "";
19394
- gu.has(e) && mu(f) && (c += `${f}{${a}}`);
19395
- } else mu(f) && !/[<]/.test(f) && (c += `${f}{${a}}`);
19396
- } else (/^\s*$/.test(f) || hu(f, s)) && (c += f);
19515
+ Eu.has(e) && wu(f) && (c += `${f}{${a}}`);
19516
+ } else wu(f) && !/[<]/.test(f) && (c += `${f}{${a}}`);
19517
+ } else (/^\s*$/.test(f) || Tu(f, s)) && (c += f);
19397
19518
  }
19398
19519
  return c;
19399
19520
  };
19400
19521
  return o(!1);
19401
19522
  }
19402
- var vu = /* @__PURE__ */ new Set([
19523
+ var Ou = /* @__PURE__ */ new Set([
19403
19524
  "script",
19404
19525
  "style",
19405
19526
  "textarea",
@@ -19410,8 +19531,8 @@ var vu = /* @__PURE__ */ new Set([
19410
19531
  "noframes",
19411
19532
  "noscript",
19412
19533
  "plaintext"
19413
- ]), yu = (e, t) => Object.prototype.hasOwnProperty.call(e, t), bu = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f", xu = (e) => !!e && /[A-Za-z]/.test(e);
19414
- function Su(e) {
19534
+ ]), ku = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Au = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f", ju = (e) => !!e && /[A-Za-z]/.test(e);
19535
+ function Mu(e) {
19415
19536
  let t = [], n = e.length, r = 0, i = "", a = () => {
19416
19537
  i &&= (t.push({
19417
19538
  k: "text",
@@ -19443,10 +19564,10 @@ function Su(e) {
19443
19564
  continue;
19444
19565
  }
19445
19566
  if (o === "/") {
19446
- if (xu(e[r + 2])) {
19567
+ if (ju(e[r + 2])) {
19447
19568
  a();
19448
19569
  let i = r + 2;
19449
- for (; i < n && !bu(e[i]) && e[i] !== "/" && e[i] !== ">";) i += 1;
19570
+ for (; i < n && !Au(e[i]) && e[i] !== "/" && e[i] !== ">";) i += 1;
19450
19571
  let o = e.slice(r + 2, i).toLowerCase(), s = e.indexOf(">", i);
19451
19572
  t.push({
19452
19573
  k: "end",
@@ -19459,27 +19580,27 @@ function Su(e) {
19459
19580
  }
19460
19581
  continue;
19461
19582
  }
19462
- if (!xu(o)) {
19583
+ if (!ju(o)) {
19463
19584
  i += "&lt;", r += 1;
19464
19585
  continue;
19465
19586
  }
19466
19587
  let s = r + 1;
19467
- for (; s < n && !bu(e[s]) && e[s] !== "/" && e[s] !== ">";) s += 1;
19588
+ for (; s < n && !Au(e[s]) && e[s] !== "/" && e[s] !== ">";) s += 1;
19468
19589
  let c = e.slice(r + 1, s).toLowerCase(), l = [], u = !1, d = !1;
19469
19590
  for (; s < n;) {
19470
- for (; s < n && (bu(e[s]) || e[s] === "/");) e[s] === "/" && e[s + 1] === ">" && (u = !0), s += 1;
19591
+ for (; s < n && (Au(e[s]) || e[s] === "/");) e[s] === "/" && e[s + 1] === ">" && (u = !0), s += 1;
19471
19592
  if (e[s] === ">") {
19472
19593
  d = !0, s += 1;
19473
19594
  break;
19474
19595
  }
19475
19596
  if (s >= n) break;
19476
19597
  let t = s;
19477
- for (s += 1; s < n && !bu(e[s]) && e[s] !== "/" && e[s] !== ">" && e[s] !== "=";) s += 1;
19598
+ for (s += 1; s < n && !Au(e[s]) && e[s] !== "/" && e[s] !== ">" && e[s] !== "=";) s += 1;
19478
19599
  let r = e.slice(t, s).toLowerCase();
19479
- for (; s < n && bu(e[s]);) s += 1;
19600
+ for (; s < n && Au(e[s]);) s += 1;
19480
19601
  let i = null;
19481
19602
  if (e[s] === "=") {
19482
- for (s += 1; s < n && bu(e[s]);) s += 1;
19603
+ for (s += 1; s < n && Au(e[s]);) s += 1;
19483
19604
  let t = e[s];
19484
19605
  if (t === "\"" || t === "'") {
19485
19606
  let r = e.indexOf(t, s + 1);
@@ -19490,7 +19611,7 @@ function Su(e) {
19490
19611
  i = e.slice(s + 1, r), s = r + 1;
19491
19612
  } else {
19492
19613
  let t = s;
19493
- for (; s < n && !bu(e[s]) && e[s] !== ">";) s += 1;
19614
+ for (; s < n && !Au(e[s]) && e[s] !== ">";) s += 1;
19494
19615
  i = e.slice(t, s);
19495
19616
  }
19496
19617
  }
@@ -19504,7 +19625,7 @@ function Su(e) {
19504
19625
  r = n;
19505
19626
  break;
19506
19627
  }
19507
- if (r = s, vu.has(c)) {
19628
+ if (r = s, Ou.has(c)) {
19508
19629
  if (c === "plaintext") {
19509
19630
  t.push({
19510
19631
  k: "raw",
@@ -19536,7 +19657,7 @@ function Su(e) {
19536
19657
  }
19537
19658
  return a(), t;
19538
19659
  }
19539
- var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.section.article.aside.header.footer.main.nav.h1.h2.h3.h4.h5.h6.p.a.button.img.hr.br.wbr.ul.ol.li.figure.figcaption.details.summary.table.thead.tbody.tfoot.tr.th.td.caption.colgroup.col.form.label.input.textarea.select.option.optgroup.fieldset.legend.video.strong.em.b.i.u.s.small.sub.sup.code.pre.blockquote.mark.abbr.time.dl.dt.dd.address.cite.q.span".split(".")), wu = /* @__PURE__ */ new Set([
19660
+ var Nu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.section.article.aside.header.footer.main.nav.h1.h2.h3.h4.h5.h6.p.a.button.img.hr.br.wbr.ul.ol.li.figure.figcaption.details.summary.table.thead.tbody.tfoot.tr.th.td.caption.colgroup.col.form.label.input.textarea.select.option.optgroup.fieldset.legend.video.strong.em.b.i.u.s.small.sub.sup.code.pre.blockquote.mark.abbr.time.dl.dt.dd.address.cite.q.span".split(".")), Pu = /* @__PURE__ */ new Set([
19540
19661
  "img",
19541
19662
  "hr",
19542
19663
  "br",
@@ -19545,7 +19666,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19545
19666
  "col",
19546
19667
  "meta",
19547
19668
  "link"
19548
- ]), Tu = /* @__PURE__ */ new Set([
19669
+ ]), Fu = /* @__PURE__ */ new Set([
19549
19670
  "svg",
19550
19671
  "g",
19551
19672
  "path",
@@ -19555,7 +19676,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19555
19676
  "polyline",
19556
19677
  "polygon",
19557
19678
  "ellipse"
19558
- ]), Eu = /* @__PURE__ */ new Set([
19679
+ ]), Iu = /* @__PURE__ */ new Set([
19559
19680
  "open",
19560
19681
  "required",
19561
19682
  "disabled",
@@ -19571,7 +19692,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19571
19692
  "allowfullscreen",
19572
19693
  "hidden",
19573
19694
  "novalidate"
19574
- ]), Du = {
19695
+ ]), Lu = {
19575
19696
  id: /^[\w:.[\]-]{1,200}$/,
19576
19697
  role: /^[a-z-]{1,30}$/,
19577
19698
  tabindex: /^-?\d{1,3}$/,
@@ -19579,11 +19700,11 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19579
19700
  dir: /^(ltr|rtl|auto)$/i,
19580
19701
  draggable: /^(true|false)$/,
19581
19702
  translate: /^(yes|no)$/
19582
- }, Ou = /* @__PURE__ */ new Set([
19703
+ }, Ru = /* @__PURE__ */ new Set([
19583
19704
  "class",
19584
19705
  "title",
19585
19706
  "hidden"
19586
- ]), q = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/, ku = /^[\w:.[\]-]{1,200}$/, Au = /* @__PURE__ */ new Set([
19707
+ ]), J = /^\d{1,5}(?:\.\d+)?(?:px|%|em|rem)?$/, zu = /^[\w:.[\]-]{1,200}$/, Bu = /* @__PURE__ */ new Set([
19587
19708
  "text",
19588
19709
  "email",
19589
19710
  "tel",
@@ -19602,7 +19723,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19602
19723
  "file",
19603
19724
  "color",
19604
19725
  "range"
19605
- ]), ju = /^(#[0-9a-f]{3,8}|[a-z]{3,20}|rgba?\(\s*[\d.\s,%]+\))$/i, Mu = {
19726
+ ]), Vu = /^(#[0-9a-f]{3,8}|[a-z]{3,20}|rgba?\(\s*[\d.\s,%]+\))$/i, Hu = {
19606
19727
  a: {
19607
19728
  href: "href",
19608
19729
  target: /^(_blank|_self)$/,
@@ -19613,8 +19734,8 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19613
19734
  alt: "plain",
19614
19735
  loading: /^(lazy|eager)$/,
19615
19736
  decoding: /^(async|sync|auto)$/,
19616
- width: q,
19617
- height: q
19737
+ width: J,
19738
+ height: J
19618
19739
  },
19619
19740
  video: {
19620
19741
  src: "media",
@@ -19625,13 +19746,13 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19625
19746
  loop: "bool",
19626
19747
  autoplay: "bool",
19627
19748
  muted: "bool",
19628
- width: q,
19629
- height: q
19749
+ width: J,
19750
+ height: J
19630
19751
  },
19631
19752
  button: {
19632
19753
  type: /^(submit|button|reset)$/,
19633
19754
  disabled: "bool",
19634
- name: ku,
19755
+ name: zu,
19635
19756
  value: "plain"
19636
19757
  },
19637
19758
  form: {
@@ -19642,7 +19763,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19642
19763
  enctype: /^(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)$/
19643
19764
  },
19644
19765
  input: {
19645
- name: ku,
19766
+ name: zu,
19646
19767
  value: "plain",
19647
19768
  placeholder: "plain",
19648
19769
  required: "bool",
@@ -19660,7 +19781,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19660
19781
  size: /^\d{1,3}$/
19661
19782
  },
19662
19783
  textarea: {
19663
- name: ku,
19784
+ name: zu,
19664
19785
  rows: /^\d{1,3}$/,
19665
19786
  cols: /^\d{1,3}$/,
19666
19787
  placeholder: "plain",
@@ -19672,7 +19793,7 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19672
19793
  autocomplete: /^[\w\s-]{1,60}$/
19673
19794
  },
19674
19795
  select: {
19675
- name: ku,
19796
+ name: zu,
19676
19797
  required: "bool",
19677
19798
  multiple: "bool",
19678
19799
  disabled: "bool",
@@ -19688,121 +19809,121 @@ var Cu = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
19688
19809
  label: "plain",
19689
19810
  disabled: "bool"
19690
19811
  },
19691
- label: { for: ku },
19812
+ label: { for: zu },
19692
19813
  details: {
19693
19814
  open: "bool",
19694
- name: ku
19815
+ name: zu
19695
19816
  },
19696
19817
  table: {
19697
- width: q,
19698
- height: q,
19818
+ width: J,
19819
+ height: J,
19699
19820
  align: /^(left|center|right)$/,
19700
19821
  cellpadding: /^\d{1,3}$/,
19701
19822
  cellspacing: /^\d{1,3}$/,
19702
19823
  border: /^\d{1,2}$/,
19703
- bgcolor: ju
19824
+ bgcolor: Vu
19704
19825
  },
19705
19826
  th: {
19706
19827
  scope: /^(col|row|colgroup|rowgroup)$/,
19707
19828
  colspan: /^\d{1,3}$/,
19708
19829
  rowspan: /^\d{1,3}$/,
19709
- width: q,
19710
- height: q,
19830
+ width: J,
19831
+ height: J,
19711
19832
  align: /^(left|center|right)$/,
19712
19833
  valign: /^(top|middle|bottom|baseline)$/,
19713
- bgcolor: ju
19834
+ bgcolor: Vu
19714
19835
  },
19715
19836
  td: {
19716
19837
  colspan: /^\d{1,3}$/,
19717
19838
  rowspan: /^\d{1,3}$/,
19718
- width: q,
19719
- height: q,
19839
+ width: J,
19840
+ height: J,
19720
19841
  align: /^(left|center|right)$/,
19721
19842
  valign: /^(top|middle|bottom|baseline)$/,
19722
- bgcolor: ju
19843
+ bgcolor: Vu
19723
19844
  },
19724
19845
  col: { span: /^\d{1,3}$/ },
19725
19846
  time: { datetime: "plain" },
19726
19847
  html: {},
19727
19848
  body: {}
19728
- }, Nu = /* @__PURE__ */ new Set(/* @__PURE__ */ "viewbox.fill.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.d.cx.cy.r.rx.ry.x.y.x1.y1.x2.y2.points.width.height.transform.xmlns.preserveaspectratio.focusable.vector-effect".split(".")), Pu = {
19849
+ }, Uu = /* @__PURE__ */ new Set(/* @__PURE__ */ "viewbox.fill.stroke.stroke-width.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-dasharray.stroke-dashoffset.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.d.cx.cy.r.rx.ry.x.y.x1.y1.x2.y2.points.width.height.transform.xmlns.preserveaspectratio.focusable.vector-effect".split(".")), Wu = {
19729
19850
  viewbox: "viewBox",
19730
19851
  preserveaspectratio: "preserveAspectRatio"
19731
- }, Fu = /^[\w\s.,#%()+\-:/]*$/, Iu = /* @__PURE__ */ new Set([
19852
+ }, Gu = /^[\w\s.,#%()+\-:/]*$/, Ku = /* @__PURE__ */ new Set([
19732
19853
  "allow-popups",
19733
19854
  "allow-popups-to-escape-sandbox",
19734
19855
  "allow-forms",
19735
19856
  "allow-scripts",
19736
19857
  "allow-presentation"
19737
- ]), Lu = /^[\w\s;*-]{0,200}$/, Ru = `(${gc})(document);`.replace(/<\/script/gi, "<\\/script");
19738
- function zu(e, t) {
19739
- let n = e.raw, r = n === null ? "" : tu(n), i = n === null ? "" : `="${n.replace(/"/g, "&quot;")}"`;
19740
- return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? au(r) ? i : e.name === "href" ? ((e) => `="${nu(e)}"`)("#") : null : t === "image" ? su(r) ? i : null : t === "media" ? cu(r) ? i : null : t.test(r) ? i : null;
19858
+ ]), qu = /^[\w\s;*-]{0,200}$/, Ju = `(${Ec})(document);`.replace(/<\/script/gi, "<\\/script");
19859
+ function Yu(e, t) {
19860
+ let n = e.raw, r = n === null ? "" : du(n), i = n === null ? "" : `="${n.replace(/"/g, "&quot;")}"`;
19861
+ return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? hu(r) ? i : e.name === "href" ? ((e) => `="${fu(e)}"`)("#") : null : t === "image" ? _u(r) ? i : null : t === "media" ? vu(r) ? i : null : t.test(r) ? i : null;
19741
19862
  }
19742
- function Bu(e) {
19863
+ function Xu(e) {
19743
19864
  if (e.raw === null) return null;
19744
- let t = tu(e.raw), n = _u(t);
19745
- return n === t ? `="${e.raw.replace(/"/g, "&quot;")}"` : n.trim() ? `="${nu(n)}"` : null;
19865
+ let t = du(e.raw), n = Du(t);
19866
+ return n === t ? `="${e.raw.replace(/"/g, "&quot;")}"` : n.trim() ? `="${fu(n)}"` : null;
19746
19867
  }
19747
- function Vu(e, t, n) {
19748
- let r = "", i = yu(Mu, e) ? Mu[e] : {};
19868
+ function Zu(e, t, n) {
19869
+ let r = "", i = ku(Hu, e) ? Hu[e] : {};
19749
19870
  for (let e of t) {
19750
19871
  let t = e.name;
19751
19872
  if (!/^[a-z][a-z0-9:_.-]*$/.test(t) || t.startsWith("on")) continue;
19752
19873
  let a = null;
19753
- if (t === "style") a = Bu(e);
19874
+ if (t === "style") a = Xu(e);
19754
19875
  else if (n) {
19755
- if (Nu.has(t) || t === "class" || /^aria-[a-z-]+$/.test(t) || t === "role" || t === "id") {
19756
- let n = e.raw === null ? "" : tu(e.raw);
19757
- a = t === "class" || t === "id" || t === "role" ? zu(e, yu(Du, t) ? Du[t] : "plain") : Fu.test(n) && !/javascript:|data:/i.test(n) ? e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : null;
19876
+ if (Uu.has(t) || t === "class" || /^aria-[a-z-]+$/.test(t) || t === "role" || t === "id") {
19877
+ let n = e.raw === null ? "" : du(e.raw);
19878
+ a = t === "class" || t === "id" || t === "role" ? Yu(e, ku(Lu, t) ? Lu[t] : "plain") : Gu.test(n) && !/javascript:|data:/i.test(n) ? e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : null;
19758
19879
  }
19759
- } else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : yu(i, t) ? a = zu(e, i[t]) : yu(Du, t) ? a = zu(e, Du[t]) : Ou.has(t) && (a = t === "hidden" ? zu(e, "bool") : zu(e, "plain"));
19880
+ } else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(t) || /^aria-[a-z-]+$/.test(t) ? a = e.raw === null ? "" : `="${e.raw.replace(/"/g, "&quot;")}"` : ku(i, t) ? a = Yu(e, i[t]) : ku(Lu, t) ? a = Yu(e, Lu[t]) : Ru.has(t) && (a = t === "hidden" ? Yu(e, "bool") : Yu(e, "plain"));
19760
19881
  if (a === null) continue;
19761
19882
  let o = /^data-(plx|plexo)-/.test(t) && e.written && e.written.toLowerCase() === t ? e.written : t;
19762
- r += ` ${/^data-/.test(t) ? o : n && yu(Pu, t) ? Pu[t] : t}${Eu.has(t) && a === "" ? "" : a}`;
19883
+ r += ` ${/^data-/.test(t) ? o : n && ku(Wu, t) ? Wu[t] : t}${Iu.has(t) && a === "" ? "" : a}`;
19763
19884
  }
19764
19885
  return r;
19765
19886
  }
19766
- function Hu(e, t) {
19887
+ function Qu(e, t) {
19767
19888
  if (e === "input") {
19768
19889
  let e = "";
19769
19890
  for (let n of t) if (n.name === "type") {
19770
- let t = n.raw === null ? "text" : tu(n.raw).trim().toLowerCase();
19771
- e += ` type="${Au.has(t) ? nu(t) : "text"}"`;
19772
- } else e += Vu("input", [n], !1);
19891
+ let t = n.raw === null ? "text" : du(n.raw).trim().toLowerCase();
19892
+ e += ` type="${Bu.has(t) ? fu(t) : "text"}"`;
19893
+ } else e += Zu("input", [n], !1);
19773
19894
  return e;
19774
19895
  }
19775
- return Vu(e, t, !1);
19896
+ return Zu(e, t, !1);
19776
19897
  }
19777
- function Uu(e, t) {
19898
+ function $u(e, t) {
19778
19899
  let n = (t) => e.find((e) => e.name === t), r = n("src"), i = n("srcdoc"), a = () => {
19779
19900
  let t = "";
19780
19901
  for (let n of e) {
19781
- let e = n.raw === null ? "" : tu(n.raw);
19902
+ let e = n.raw === null ? "" : du(n.raw);
19782
19903
  if (n.name === "title" || n.name === "loading" || n.name === "referrerpolicy" || n.name === "allowfullscreen") {
19783
- let e = zu(n, n.name === "loading" ? /^(lazy|eager)$/ : n.name === "referrerpolicy" ? /^[a-z-]{1,40}$/ : n.name === "allowfullscreen" ? "bool" : "plain");
19904
+ let e = Yu(n, n.name === "loading" ? /^(lazy|eager)$/ : n.name === "referrerpolicy" ? /^[a-z-]{1,40}$/ : n.name === "allowfullscreen" ? "bool" : "plain");
19784
19905
  e !== null && (t += ` ${n.name}${e}`);
19785
- } else if (n.name === "allow" && Lu.test(e)) t += ` allow${zu(n, "plain")}`;
19786
- else if (n.name === "width" || n.name === "height") q.test(e) && (t += ` ${n.name}="${nu(e)}"`);
19787
- else if (n.name === "class") t += ` class${zu(n, "plain")}`;
19906
+ } else if (n.name === "allow" && qu.test(e)) t += ` allow${Yu(n, "plain")}`;
19907
+ else if (n.name === "width" || n.name === "height") J.test(e) && (t += ` ${n.name}="${fu(e)}"`);
19908
+ else if (n.name === "class") t += ` class${Yu(n, "plain")}`;
19788
19909
  else if (n.name === "style") {
19789
- let e = Bu(n);
19910
+ let e = Xu(n);
19790
19911
  e !== null && (t += ` style${e}`);
19791
19912
  } else /^data-(plx|plexo)-[a-z0-9_-]+$/.test(n.name) && (t += ` ${n.name}${n.raw === null ? "" : `="${n.raw.replace(/"/g, "&quot;")}"`}`);
19792
19913
  }
19793
19914
  return t;
19794
19915
  };
19795
- if (r && r.raw !== null && lu(tu(r.raw))) return ` src="${r.raw.replace(/"/g, "&quot;")}"${a()}`;
19916
+ if (r && r.raw !== null && yu(du(r.raw))) return ` src="${r.raw.replace(/"/g, "&quot;")}"${a()}`;
19796
19917
  let o = n("sandbox");
19797
19918
  if (i && o) {
19798
- let n = (o.raw === null ? "" : tu(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) => Iu.has(e.toLowerCase()) && (t.allowEmbedScripts !== !1 || e.toLowerCase() !== "allow-scripts")).map((e) => e.toLowerCase()).join(" "), i = n.join(" "), s = "";
19799
- for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, "&quot;")}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, "&quot;") : nu(r)}"`);
19919
+ let n = (o.raw === null ? "" : du(o.raw)).split(/\s+/).filter(Boolean), r = n.filter((e) => Ku.has(e.toLowerCase()) && (t.allowEmbedScripts !== !1 || e.toLowerCase() !== "allow-scripts")).map((e) => e.toLowerCase()).join(" "), i = n.join(" "), s = "";
19920
+ for (let t of e) t.name === "srcdoc" ? s += ` srcdoc="${(t.raw ?? "").replace(/"/g, "&quot;")}"` : t.name === "sandbox" && (s += ` sandbox="${r === i ? (t.raw ?? "").replace(/"/g, "&quot;") : fu(r)}"`);
19800
19921
  return `${s}${a()}`;
19801
19922
  }
19802
19923
  return null;
19803
19924
  }
19804
- function Wu(e, t = {}) {
19805
- let n = /* @__PURE__ */ new Set([Ru, ...t.allowedScripts ?? []]), r = Su(typeof e == "string" ? e : ""), i = "", a = 0;
19925
+ function ed(e, t = {}) {
19926
+ let n = /* @__PURE__ */ new Set([Ju, ...t.allowedScripts ?? []]), r = Mu(typeof e == "string" ? e : ""), i = "", a = 0;
19806
19927
  for (let e of r) switch (e.k) {
19807
19928
  case "text":
19808
19929
  i += e.v;
@@ -19813,43 +19934,43 @@ function Wu(e, t = {}) {
19813
19934
  case "raw":
19814
19935
  if (a > 0) break;
19815
19936
  if (e.name === "script") e.attrs.length === 0 && n.has(e.content) && (i += `<script>${e.content}<\/script>`);
19816
- else if (e.name === "style") i += `<style>${_u(e.content, t)}</style>`;
19817
- else if (e.name === "textarea") i += `<textarea${Vu("textarea", e.attrs, !1)}>${e.content.replace(/</g, "&lt;")}</textarea>`;
19937
+ else if (e.name === "style") i += `<style>${Du(e.content, t)}</style>`;
19938
+ else if (e.name === "textarea") i += `<textarea${Zu("textarea", e.attrs, !1)}>${e.content.replace(/</g, "&lt;")}</textarea>`;
19818
19939
  else if (e.name === "title") i += `<title>${e.content.replace(/</g, "&lt;")}</title>`;
19819
19940
  else if (e.name === "iframe") {
19820
- let n = Uu(e.attrs, t);
19941
+ let n = $u(e.attrs, t);
19821
19942
  n !== null && (i += `<iframe${n}></iframe>`);
19822
19943
  }
19823
19944
  break;
19824
19945
  case "start": {
19825
19946
  let { name: t } = e;
19826
19947
  if (t === "svg") {
19827
- i += `<svg${Vu("svg", e.attrs, !0)}${e.selfClose ? "/" : ""}>`, e.selfClose || (a += 1);
19948
+ i += `<svg${Zu("svg", e.attrs, !0)}${e.selfClose ? "/" : ""}>`, e.selfClose || (a += 1);
19828
19949
  break;
19829
19950
  }
19830
19951
  if (a > 0) {
19831
- Tu.has(t) && (i += `<${t}${Vu(t, e.attrs, !0)}${e.selfClose ? "/" : ""}>`);
19952
+ Fu.has(t) && (i += `<${t}${Zu(t, e.attrs, !0)}${e.selfClose ? "/" : ""}>`);
19832
19953
  break;
19833
19954
  }
19834
- if (Cu.has(t)) i += `<${t}${Hu(t, e.attrs)}>`;
19955
+ if (Nu.has(t)) i += `<${t}${Qu(t, e.attrs)}>`;
19835
19956
  else if (t === "meta") {
19836
19957
  let t = (t) => e.attrs.find((e) => e.name === t), n = t("charset"), r = t("name"), a = t("content");
19837
19958
  n && n.raw !== null && /^utf-8$/i.test(n.raw) ? i += `<meta charset="${n.raw}">` : r && r.raw?.toLowerCase() === "viewport" && a && a.raw !== null && /^[\w=,.\s-]{1,120}$/.test(a.raw) && (i += `<meta name="viewport" content="${a.raw}">`);
19838
19959
  } else if (t === "link") {
19839
19960
  let t = (t) => e.attrs.find((e) => e.name === t), n = t("rel"), r = t("href"), a = "";
19840
19961
  try {
19841
- a = r && r.raw !== null ? new URL(tu(r.raw)).hostname : "";
19962
+ a = r && r.raw !== null ? new URL(du(r.raw)).hostname : "";
19842
19963
  } catch {
19843
19964
  a = "";
19844
19965
  }
19845
- let o = r && r.raw !== null && /^https:\/\//i.test(tu(r.raw).trim());
19966
+ let o = r && r.raw !== null && /^https:\/\//i.test(du(r.raw).trim());
19846
19967
  n && n.raw !== null && /^(stylesheet|preconnect|dns-prefetch)$/i.test(n.raw) && o && (a === "fonts.googleapis.com" || a === "fonts.gstatic.com") && (i += `<link rel="${n.raw.toLowerCase()}" href="${r.raw.replace(/"/g, "&quot;")}"${t("crossorigin") ? " crossorigin" : ""}>`);
19847
19968
  }
19848
19969
  break;
19849
19970
  }
19850
19971
  case "end": {
19851
19972
  let { name: t } = e;
19852
- t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ? Tu.has(t) && (i += `</${t}>`) : Cu.has(t) && !wu.has(t) && (i += `</${t}>`);
19973
+ t === "svg" ? a > 0 && (--a, i += "</svg>") : a > 0 ? Fu.has(t) && (i += `</${t}>`) : Nu.has(t) && !Pu.has(t) && (i += `</${t}>`);
19853
19974
  break;
19854
19975
  }
19855
19976
  }
@@ -19858,7 +19979,7 @@ function Wu(e, t = {}) {
19858
19979
  }
19859
19980
  //#endregion
19860
19981
  //#region src/v2/compile/schema.ts
19861
- var Gu = 5e3, Ku = 40, qu = /* @__PURE__ */ "page.section.container.columns.column.heading.paragraph.button.image.badge.divider.spacer.card.icon.carousel.video.social.menu.html.table.timer.form.accordion.blogTitle.blogContent.blogFeaturedImage.blogDate.blogAuthor.blogCategories.blogComments.blogPostList.shopGrid.product.booking.cart.checkout.orderConfirmation.orderTracking.signupForm".split("."), Ju = [
19982
+ var td = 5e3, nd = 40, rd = /* @__PURE__ */ "page.section.container.columns.column.heading.paragraph.button.image.badge.divider.spacer.card.icon.carousel.video.social.menu.html.table.timer.form.accordion.blogTitle.blogContent.blogFeaturedImage.blogDate.blogAuthor.blogCategories.blogComments.blogPostList.shopGrid.product.booking.cart.checkout.orderConfirmation.orderTracking.signupForm".split("."), id = [
19862
19983
  "blogTitle",
19863
19984
  "blogContent",
19864
19985
  "blogFeaturedImage",
@@ -19875,70 +19996,70 @@ var Gu = 5e3, Ku = 40, qu = /* @__PURE__ */ "page.section.container.columns.colu
19875
19996
  "orderConfirmation",
19876
19997
  "orderTracking",
19877
19998
  "signupForm"
19878
- ], Yu = r([t().int().min(1).max(96), n().max(4)]), Xu = a({
19999
+ ], ad = r([t().int().min(1).max(96), n().max(4)]), od = a({
19879
20000
  prefix: n().max(80),
19880
20001
  productId: n().max(100),
19881
20002
  serviceId: n().max(100),
19882
20003
  mode: n().max(40),
19883
20004
  storeMode: i(),
19884
- limit: Yu,
20005
+ limit: ad,
19885
20006
  category: n().max(100),
19886
20007
  sort: n().max(100),
19887
- itemsPerRow: Yu,
19888
- itemsPerPage: Yu,
20008
+ itemsPerRow: ad,
20009
+ itemsPerPage: ad,
19889
20010
  paginated: i(),
19890
20011
  templateId: n().max(100)
19891
- }).partial().passthrough(), Zu = r([
20012
+ }).partial().passthrough(), sd = r([
19892
20013
  n().max(2e3),
19893
20014
  t(),
19894
20015
  i()
19895
- ]), Qu = d(n(), Zu.optional()), $u = o(() => a({
20016
+ ]), cd = d(n(), sd.optional()), ld = o(() => a({
19896
20017
  id: n().min(1).max(200),
19897
- type: u(qu),
20018
+ type: u(rd),
19898
20019
  name: n().max(300),
19899
20020
  content: n().max(1e5).optional(),
19900
20021
  props: d(n(), s()).optional(),
19901
- styles: Qu,
20022
+ styles: cd,
19902
20023
  responsive: a({
19903
- tablet: Qu.optional(),
19904
- mobile: Qu.optional()
20024
+ tablet: cd.optional(),
20025
+ mobile: cd.optional()
19905
20026
  }).optional(),
19906
20027
  responsiveVisibility: a({
19907
20028
  hideOnDesktop: i().optional(),
19908
20029
  hideOnTablet: i().optional(),
19909
20030
  hideOnMobile: i().optional()
19910
20031
  }).optional(),
19911
- children: c($u).optional(),
20032
+ children: c(ld).optional(),
19912
20033
  locked: i().optional(),
19913
20034
  hidden: i().optional()
19914
20035
  }).superRefine((e, t) => {
19915
- if (!Ju.includes(e.type) || !e.props) return;
19916
- let n = Xu.safeParse(e.props);
20036
+ if (!id.includes(e.type) || !e.props) return;
20037
+ let n = od.safeParse(e.props);
19917
20038
  n.success || t.addIssue({
19918
20039
  code: "custom",
19919
20040
  path: ["props", ...n.error.issues[0].path],
19920
20041
  message: `The settings of "${e.name}" aren't valid (${n.error.issues[0].path.join(" › ") || "settings"}: ${n.error.issues[0].message})`
19921
20042
  });
19922
- })), ed = a({
20043
+ })), ud = a({
19923
20044
  id: n().min(1).max(200),
19924
20045
  name: n().max(300),
19925
20046
  slug: n().max(300),
19926
20047
  isHome: i().optional(),
19927
- rootNode: $u
20048
+ rootNode: ld
19928
20049
  });
19929
- function td(e, t, n) {
19930
- if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${Gu} elements).`;
20050
+ function dd(e, t, n) {
20051
+ if (n.n += 1, n.n > 5e3) return `This design is too large (more than ${td} elements).`;
19931
20052
  if (t > 40) return "This design is nested too deeply.";
19932
20053
  if (n.ids.has(e.id)) return `Two elements share the same id ("${e.id}"). Each element needs its own.`;
19933
20054
  n.ids.add(e.id);
19934
20055
  for (let r of e.children ?? []) {
19935
- let e = td(r, t + 1, n);
20056
+ let e = dd(r, t + 1, n);
19936
20057
  if (e) return e;
19937
20058
  }
19938
20059
  return null;
19939
20060
  }
19940
- function nd(e) {
19941
- let t = c(ed).min(1, "A design needs at least one page.").safeParse(e);
20061
+ function fd(e) {
20062
+ let t = c(ud).min(1, "A design needs at least one page.").safeParse(e);
19942
20063
  if (!t.success) {
19943
20064
  let e = t.error.issues[0], n = e.path.length ? ` (at ${e.path.filter((e) => typeof e == "string" && e !== "children" && e !== "rootNode").join(" › ") || "the design"})` : "";
19944
20065
  return {
@@ -19948,7 +20069,7 @@ function nd(e) {
19948
20069
  }
19949
20070
  let n = t.data;
19950
20071
  for (let e of n) {
19951
- let t = td(e.rootNode, 0, {
20072
+ let t = dd(e.rootNode, 0, {
19952
20073
  n: 0,
19953
20074
  ids: /* @__PURE__ */ new Set()
19954
20075
  });
@@ -19964,7 +20085,7 @@ function nd(e) {
19964
20085
  }
19965
20086
  //#endregion
19966
20087
  //#region src/v2/migrate/v1.ts
19967
- var rd = {
20088
+ var pd = {
19968
20089
  blog_title: "blogTitle",
19969
20090
  blog_content: "blogContent",
19970
20091
  blog_featured_image: "blogFeaturedImage",
@@ -19981,7 +20102,7 @@ var rd = {
19981
20102
  order_tracking: "orderTracking",
19982
20103
  booking: "booking",
19983
20104
  maildrip_form: null
19984
- }, id = !0, ad = [
20105
+ }, md = !0, hd = [
19985
20106
  "prefix",
19986
20107
  "productId",
19987
20108
  "serviceId",
@@ -19993,7 +20114,7 @@ var rd = {
19993
20114
  "itemsPerRow",
19994
20115
  "itemsPerPage",
19995
20116
  "paginated"
19996
- ], od = {
20117
+ ], gd = {
19997
20118
  blog_title: "blog title",
19998
20119
  blog_content: "blog post text",
19999
20120
  blog_featured_image: "blog picture",
@@ -20009,7 +20130,7 @@ var rd = {
20009
20130
  checkout_flow: "checkout",
20010
20131
  order_confirmation: "order confirmation",
20011
20132
  order_tracking: "order tracking"
20012
- }, sd = (e) => !!e && typeof e == "object" && !Array.isArray(e), J = (e) => sd(e) ? e : {}, Y = (e, t = 500) => Array.isArray(e) ? e.slice(0, t) : [], X = (e) => typeof e == "string" ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : "", cd = {
20133
+ }, _d = (e) => !!e && typeof e == "object" && !Array.isArray(e), Y = (e) => _d(e) ? e : {}, X = (e, t = 500) => Array.isArray(e) ? e.slice(0, t) : [], Z = (e) => typeof e == "string" ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : "", vd = {
20013
20134
  amp: "&",
20014
20135
  lt: "<",
20015
20136
  gt: ">",
@@ -20024,7 +20145,7 @@ var rd = {
20024
20145
  ndash: "–",
20025
20146
  hellip: "…",
20026
20147
  copy: "©"
20027
- }, ld = (e) => e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (e, t) => {
20148
+ }, yd = (e) => e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (e, t) => {
20028
20149
  if (t[0] === "#") {
20029
20150
  let e = t[1].toLowerCase() === "x" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
20030
20151
  try {
@@ -20033,37 +20154,37 @@ var rd = {
20033
20154
  return "";
20034
20155
  }
20035
20156
  }
20036
- return cd[t.toLowerCase()] ?? e;
20157
+ return vd[t.toLowerCase()] ?? e;
20037
20158
  });
20038
- function Z(e) {
20159
+ function bd(e) {
20039
20160
  let t = /<(a|b|strong|i|em|u|s|span|font|ul|ol|li|img|sup|sub|mark|code)\b/i.test(e);
20040
20161
  return {
20041
- text: ld(e.replace(/<\s*br\s*\/?>/gi, "\n").replace(/<\/(p|div|li|h[1-6])\s*>/gi, "\n").replace(/<[^>]*>/g, "")).replace(/[ \t\f\v]+/g, " ").replace(/ ?\n ?/g, "\n").replace(/\n{3,}/g, "\n\n").trim().slice(0, 2e4),
20162
+ text: yd(e.replace(/<\s*br\s*\/?>/gi, "\n").replace(/<\/(p|div|li|h[1-6])\s*>/gi, "\n").replace(/<[^>]*>/g, "")).replace(/[ \t\f\v]+/g, " ").replace(/ ?\n ?/g, "\n").replace(/\n{3,}/g, "\n\n").trim().slice(0, 2e4),
20042
20163
  rich: t
20043
20164
  };
20044
20165
  }
20045
- var ud = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-binding/i, dd = (e) => {
20046
- let t = X(e).trim();
20047
- return t && t.length <= 300 && !ud.test(t) ? t : void 0;
20048
- }, fd = /* @__PURE__ */ new Set([
20166
+ var xd = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-binding/i, Sd = (e) => {
20167
+ let t = Z(e).trim();
20168
+ return t && t.length <= 300 && !xd.test(t) ? t : void 0;
20169
+ }, Cd = /* @__PURE__ */ new Set([
20049
20170
  "left",
20050
20171
  "center",
20051
20172
  "right",
20052
20173
  "justify"
20053
- ]), pd = /* @__PURE__ */ new Set([
20174
+ ]), wd = /* @__PURE__ */ new Set([
20054
20175
  "solid",
20055
20176
  "dashed",
20056
20177
  "dotted",
20057
20178
  "none"
20058
- ]), md = /* @__PURE__ */ new Set([
20179
+ ]), Td = /* @__PURE__ */ new Set([
20059
20180
  "none",
20060
20181
  "uppercase",
20061
20182
  "lowercase",
20062
20183
  "capitalize"
20063
- ]), hd = (e) => {
20184
+ ]), Ed = (e) => {
20064
20185
  let t = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/i.exec(e), n = (t?.[1] ?? t?.[2] ?? t?.[3] ?? "").trim();
20065
20186
  return n && vt(n) || void 0;
20066
- }, gd = /* @__PURE__ */ new Set([
20187
+ }, Dd = /* @__PURE__ */ new Set([
20067
20188
  "autoHeight",
20068
20189
  "autoWidth",
20069
20190
  "position",
@@ -20081,13 +20202,13 @@ var ud = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-b
20081
20202
  "verticalAlign",
20082
20203
  "float"
20083
20204
  ]);
20084
- function _d(e) {
20085
- let t = J(e), n = {}, r = [], i = (e, t) => {
20205
+ function Od(e) {
20206
+ let t = Y(e), n = {}, r = [], i = (e, t) => {
20086
20207
  t !== void 0 && (n[e] = t);
20087
20208
  };
20088
20209
  for (let [e, a] of Object.entries(t)) {
20089
- if (a == null || a === "" || gd.has(e)) continue;
20090
- let t = dd(a);
20210
+ if (a == null || a === "" || Dd.has(e)) continue;
20211
+ let t = Sd(a);
20091
20212
  switch (e) {
20092
20213
  case "color":
20093
20214
  i("textColor", t);
@@ -20108,7 +20229,7 @@ function _d(e) {
20108
20229
  i("letterSpacing", t);
20109
20230
  break;
20110
20231
  case "textTransform":
20111
- t && md.has(t) && (n.textTransform = t);
20232
+ t && Td.has(t) && (n.textTransform = t);
20112
20233
  break;
20113
20234
  case "fontStyle":
20114
20235
  t === "italic" && (n.isItalic = !0);
@@ -20117,7 +20238,7 @@ function _d(e) {
20117
20238
  t && /underline/.test(t) && (n.isUnderline = !0);
20118
20239
  break;
20119
20240
  case "textAlign":
20120
- t && fd.has(t) && (n.textAlign = t);
20241
+ t && Cd.has(t) && (n.textAlign = t);
20121
20242
  break;
20122
20243
  case "backgroundColor":
20123
20244
  i("backgroundColor", t);
@@ -20126,7 +20247,7 @@ function _d(e) {
20126
20247
  case "backgroundImage":
20127
20248
  if (t && /gradient\(/i.test(t)) n.backgroundGradient = t;
20128
20249
  else if (t && /url\(/i.test(t)) {
20129
- let i = hd(t);
20250
+ let i = Ed(t);
20130
20251
  i ? (n.backgroundImage = i, n.backgroundSize ??= "cover", n.backgroundPosition ??= "center") : r.push(e);
20131
20252
  } else e === "background" ? i("backgroundColor", t) : t && r.push(e);
20132
20253
  break;
@@ -20164,7 +20285,7 @@ function _d(e) {
20164
20285
  i("gap", t);
20165
20286
  break;
20166
20287
  case "borderStyle":
20167
- t && pd.has(t) && (n.borderStyle = t);
20288
+ t && wd.has(t) && (n.borderStyle = t);
20168
20289
  break;
20169
20290
  case "border": {
20170
20291
  let i = t ? /^([\d.]+(?:px|rem|em)?)\s+(solid|dashed|dotted|none)\s*(.*)$/i.exec(t) : null;
@@ -20187,11 +20308,11 @@ function _d(e) {
20187
20308
  unmapped: r
20188
20309
  };
20189
20310
  }
20190
- var vd = (e, ...t) => t.some((t) => X(e[t]).trim() !== ""), Q = (e, t) => {
20311
+ var kd = (e, ...t) => t.some((t) => Z(e[t]).trim() !== ""), Q = (e, t) => {
20191
20312
  e.seen.has(t) || (e.seen.add(t), e.warnings.push(t));
20192
- }, yd = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
20193
- function bd(e, t, n) {
20194
- let r = _d(t.style), i = _d(t.styleTablet), a = _d(t.styleMobile), o = [.../* @__PURE__ */ new Set([
20313
+ }, Ad = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
20314
+ function jd(e, t, n) {
20315
+ let r = Od(t.style), i = Od(t.styleTablet), a = Od(t.styleMobile), o = [.../* @__PURE__ */ new Set([
20195
20316
  ...r.unmapped,
20196
20317
  ...i.unmapped,
20197
20318
  ...a.unmapped
@@ -20203,7 +20324,7 @@ function bd(e, t, n) {
20203
20324
  responsive: Object.keys(s).length ? s : void 0
20204
20325
  };
20205
20326
  }
20206
- function xd(e, t) {
20327
+ function Md(e, t) {
20207
20328
  t !== "center" && t !== "right" || (!e.width && !e.widthSizing && (e.widthSizing = "hug"), e.marginLeft ||= "auto", !e.marginRight && t === "center" && (e.marginRight = "auto"));
20208
20329
  }
20209
20330
  var $ = (e, t, n, r, i = {}) => ({
@@ -20212,12 +20333,12 @@ var $ = (e, t, n, r, i = {}) => ({
20212
20333
  name: n,
20213
20334
  styles: r,
20214
20335
  ...i
20215
- }), Sd = {
20336
+ }), Nd = {
20216
20337
  layoutMode: "flow",
20217
20338
  display: "flex",
20218
20339
  flexDirection: "column",
20219
20340
  width: "100%"
20220
- }, Cd = {
20341
+ }, Pd = {
20221
20342
  1: "32px",
20222
20343
  2: "24px",
20223
20344
  3: "19px",
@@ -20225,45 +20346,45 @@ var $ = (e, t, n, r, i = {}) => ({
20225
20346
  5: "13px",
20226
20347
  6: "11px"
20227
20348
  };
20228
- function wd(e, t, n) {
20229
- let r = X(t.type), i = J(t.attributes), { styles: a, responsive: o } = bd(e, t, `${od[r] ?? r.replace(/_/g, " ")} block`), s = a.textAlign, c = (e, t, r = {}, i = a) => $(n, e, t, i, {
20349
+ function Fd(e, t, n) {
20350
+ let r = Z(t.type), i = Y(t.attributes), { styles: a, responsive: o } = jd(e, t, `${gd[r] ?? r.replace(/_/g, " ")} block`), s = a.textAlign, c = (e, t, r = {}, i = a) => $(n, e, t, i, {
20230
20351
  ...o ? { responsive: o } : {},
20231
20352
  ...r
20232
20353
  });
20233
20354
  switch (r) {
20234
20355
  case "heading": {
20235
- let { text: n, rich: r } = Z(X(i.text) || "Heading");
20356
+ let { text: n, rich: r } = bd(Z(i.text) || "Heading");
20236
20357
  r && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
20237
- let o = /^h([1-6])$/i.exec(X(i.headingType)), s = o ? Number(o[1]) : 2, l = { ...a };
20238
- return l.fontSize ??= Cd[s], l.fontWeight ??= "700", vd(J(t.style), "margin", "marginBottom") || (l.marginBottom = "8px"), [c("heading", n.slice(0, 40) || "Heading", {
20358
+ let o = /^h([1-6])$/i.exec(Z(i.headingType)), s = o ? Number(o[1]) : 2, l = { ...a };
20359
+ return l.fontSize ??= Pd[s], l.fontWeight ??= "700", kd(Y(t.style), "margin", "marginBottom") || (l.marginBottom = "8px"), [c("heading", n.slice(0, 40) || "Heading", {
20239
20360
  content: n,
20240
20361
  props: { level: s }
20241
20362
  }, l)];
20242
20363
  }
20243
20364
  case "paragraph":
20244
20365
  case "text": {
20245
- let s = X(i.text) || (r === "paragraph" ? "Paragraph text content." : ""), { rich: l } = Z(s);
20366
+ let s = Z(i.text) || (r === "paragraph" ? "Paragraph text content." : ""), { rich: l } = bd(s);
20246
20367
  l && (e.approx = !0, Q(e, "Bold, italic and links inside text are simplified to plain text."));
20247
- let u = s.split(/<\/p\s*>|(?:<br\s*\/?>\s*){2,}/i).map((e) => Z(e).text).filter(Boolean), d = u.length ? u : [""], f = { ...a };
20248
- return r === "paragraph" && !vd(J(t.style), "margin", "marginBottom") && (f.marginBottom = "12px"), d.map((e, t) => t === 0 ? c("paragraph", e.slice(0, 40) || "Text", { content: e }, f) : $(`${n}-p${t + 1}`, "paragraph", e.slice(0, 40) || "Text", f, {
20368
+ let u = s.split(/<\/p\s*>|(?:<br\s*\/?>\s*){2,}/i).map((e) => bd(e).text).filter(Boolean), d = u.length ? u : [""], f = { ...a };
20369
+ return r === "paragraph" && !kd(Y(t.style), "margin", "marginBottom") && (f.marginBottom = "12px"), d.map((e, t) => t === 0 ? c("paragraph", e.slice(0, 40) || "Text", { content: e }, f) : $(`${n}-p${t + 1}`, "paragraph", e.slice(0, 40) || "Text", f, {
20249
20370
  content: e,
20250
20371
  ...o ? { responsive: o } : {}
20251
20372
  }));
20252
20373
  }
20253
20374
  case "button": {
20254
20375
  let t = { ...a };
20255
- xd(t, s), !t.widthSizing && !t.width && (t.widthSizing = "hug");
20256
- let n = X(i.href).trim();
20376
+ Md(t, s), !t.widthSizing && !t.width && (t.widthSizing = "hug");
20377
+ let n = Z(i.href).trim();
20257
20378
  return i.openInNewTab && (e.approx = !0, Q(e, "Buttons can't open in a new tab yet, so they open in the same one.")), [c("button", "Button", {
20258
- content: Z(X(i.text) || "Button").text,
20379
+ content: bd(Z(i.text) || "Button").text,
20259
20380
  props: { href: n ? P(n) : "#" }
20260
20381
  }, t)];
20261
20382
  }
20262
20383
  case "image": {
20263
20384
  let e = { ...a };
20264
- return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", xd(e, s), [c("image", X(i.alt).slice(0, 40) || "Image", { props: {
20385
+ return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", Md(e, s), [c("image", Z(i.alt).slice(0, 40) || "Image", { props: {
20265
20386
  src: vt(i.src),
20266
- alt: X(i.alt)
20387
+ alt: Z(i.alt)
20267
20388
  } }, e)];
20268
20389
  }
20269
20390
  case "divider": return [c("divider", "Divider", {}, {
@@ -20275,84 +20396,84 @@ function wd(e, t, n) {
20275
20396
  case "spacer": return [c("spacer", "Spacer", {}, { height: a.height ?? "24px" })];
20276
20397
  case "card": {
20277
20398
  let e = {
20278
- ...Sd,
20399
+ ...Nd,
20279
20400
  gap: "8px",
20280
20401
  ...a
20281
20402
  };
20282
- return [c("card", X(i.title).slice(0, 40) || "Card", { children: [$(`${n}-title`, "heading", "Card title", {
20403
+ return [c("card", Z(i.title).slice(0, 40) || "Card", { children: [$(`${n}-title`, "heading", "Card title", {
20283
20404
  fontSize: "19px",
20284
20405
  fontWeight: "700",
20285
20406
  textColor: "#ffffff"
20286
20407
  }, {
20287
- content: Z(X(i.title) || "Card Title").text,
20408
+ content: bd(Z(i.title) || "Card Title").text,
20288
20409
  props: { level: 3 }
20289
20410
  }), $(`${n}-text`, "paragraph", "Card text", {
20290
20411
  fontSize: "14px",
20291
20412
  textColor: "#94a3b8"
20292
- }, { content: Z(X(i.description) || "Card description.").text })] }, e)];
20413
+ }, { content: bd(Z(i.description) || "Card description.").text })] }, e)];
20293
20414
  }
20294
20415
  case "icon": {
20295
- let t = yd(X(i.iconName)), n = t in Rc;
20296
- n || (e.approx = !0, Q(e, `The icon "${X(i.iconName) || "unnamed"}" isn't in the V2 icon set, so a star stands in for it.`)), X(i.href).trim() && (e.approx = !0, Q(e, "Icons can't be links yet; the icon is kept without its link."));
20416
+ let t = Ad(Z(i.iconName)), n = t in Jc;
20417
+ n || (e.approx = !0, Q(e, `The icon "${Z(i.iconName) || "unnamed"}" isn't in the V2 icon set, so a star stands in for it.`)), Z(i.href).trim() && (e.approx = !0, Q(e, "Icons can't be links yet; the icon is kept without its link."));
20297
20418
  let r = { ...a };
20298
- return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", xd(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
20419
+ return r.fontSize ??= `${parseInt(Z(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", Md(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
20299
20420
  iconName: n ? t : "star",
20300
20421
  strokeWidth: 2,
20301
- label: X(i.alt) || X(i.label)
20422
+ label: Z(i.alt) || Z(i.label)
20302
20423
  } }, r)];
20303
20424
  }
20304
20425
  case "carousel": return [c("carousel", "Carousel", { props: {
20305
- slides: Y(i.images, 30).map((e) => J(e)).map((e) => ({
20426
+ slides: X(i.images, 30).map((e) => Y(e)).map((e) => ({
20306
20427
  src: vt(e.src),
20307
- alt: X(e.alt),
20308
- caption: X(e.caption)
20428
+ alt: Z(e.alt),
20429
+ caption: Z(e.caption)
20309
20430
  })),
20310
20431
  showArrows: i.showArrows !== !1,
20311
20432
  showDots: i.showDots !== !1,
20312
20433
  autoplay: !0,
20313
20434
  interval: 5
20314
20435
  } })];
20315
- case "video": return X(i.videoUrl).trim() ? [c("video", "Video", { props: {
20316
- url: X(i.videoUrl),
20436
+ case "video": return Z(i.videoUrl).trim() ? [c("video", "Video", { props: {
20437
+ url: Z(i.videoUrl),
20317
20438
  ratio: "16:9"
20318
20439
  } })] : (e.lost = !0, Q(e, "A video block had no video address, so it was left out."), []);
20319
20440
  case "social": {
20320
- let n = Y(i.links, 20).map(J), r = n.map((e) => ({
20321
- network: X(e.provider) === "twitter" ? "x" : X(e.provider),
20322
- url: P(X(e.url))
20441
+ let n = X(i.links, 20).map(Y), r = n.map((e) => ({
20442
+ network: Z(e.provider) === "twitter" ? "x" : Z(e.provider),
20443
+ url: P(Z(e.url))
20323
20444
  })).filter((e) => e.network in Xt);
20324
20445
  r.length < n.length && (e.approx = !0, Q(e, "A social link to a network V2 has no icon for was left out."));
20325
- let o = parseInt(X(J(n[0]).size) || X(J(t.style).iconSize), 10), l = { ...a };
20326
- return xd(l, s), [c("social", "Social links", { props: {
20446
+ let o = parseInt(Z(Y(n[0]).size) || Z(Y(t.style).iconSize), 10), l = { ...a };
20447
+ return Md(l, s), [c("social", "Social links", { props: {
20327
20448
  links: r,
20328
20449
  size: Number.isFinite(o) ? Math.min(96, Math.max(20, o)) : 40,
20329
- shape: X(i.iconType ?? J(n[0]).iconType) === "square" ? "square" : "circle",
20450
+ shape: Z(i.iconType ?? Y(n[0]).iconType) === "square" ? "square" : "circle",
20330
20451
  colorMode: i.colorMode === "branded" ? "brand" : "mono"
20331
20452
  } }, l)];
20332
20453
  }
20333
20454
  case "menu": {
20334
- let e = Y(i.links, 40).map(J).map((e) => ({
20335
- label: X(e.label).trim() || "Link",
20336
- href: P(X(e.href) || "#")
20455
+ let e = X(i.links, 40).map(Y).map((e) => ({
20456
+ label: Z(e.label).trim() || "Link",
20457
+ href: P(Z(e.href) || "#")
20337
20458
  })), t = { ...a };
20338
- return (s === "center" || s === "right") && xd(t, s), [c("menu", "Menu", { props: {
20459
+ return (s === "center" || s === "right") && Md(t, s), [c("menu", "Menu", { props: {
20339
20460
  links: e,
20340
20461
  layout: "horizontal",
20341
20462
  mobile: "hamburger"
20342
20463
  } }, t)];
20343
20464
  }
20344
20465
  case "html": {
20345
- let t = X(i.htmlContent);
20466
+ let t = Z(i.htmlContent);
20346
20467
  return t.trim() ? (e.approx = !0, Q(e, "HTML blocks now sit in their own box on the page, so they no longer pick up the site’s styles. Check each one."), [c("html", "Embed", { props: {
20347
20468
  code: t,
20348
- title: X(i.title) || "Embedded content"
20469
+ title: Z(i.title) || "Embedded content"
20349
20470
  } }, {
20350
20471
  ...a,
20351
20472
  height: a.height ?? "300px"
20352
20473
  })]) : (e.lost = !0, Q(e, "An empty HTML block was left out."), []);
20353
20474
  }
20354
20475
  case "table": {
20355
- let t = Math.max(1, Math.min(200, Number(i.rowCount) || 2)), n = Math.max(1, Math.min(30, Number(i.colCount) || 2)), r = Y(i.cells, 200).map((e) => Y(e, 30)), a = Array.from({ length: t }, (e, t) => Array.from({ length: n }, (e, n) => Z(X(r[t]?.[n])).text));
20476
+ let t = Math.max(1, Math.min(200, Number(i.rowCount) || 2)), n = Math.max(1, Math.min(30, Number(i.colCount) || 2)), r = X(i.cells, 200).map((e) => X(e, 30)), a = Array.from({ length: t }, (e, t) => Array.from({ length: n }, (e, n) => bd(Z(r[t]?.[n])).text));
20356
20477
  return i.enableFooter && (e.approx = !0, Q(e, "A table footer row is now an ordinary row.")), [c("table", "Table", { props: {
20357
20478
  rows: a,
20358
20479
  headerRow: i.enableHeader !== !1,
@@ -20360,35 +20481,35 @@ function wd(e, t, n) {
20360
20481
  } })];
20361
20482
  }
20362
20483
  case "timer": {
20363
- let t = Date.parse(X(i.targetDate));
20364
- return Number.isFinite(t) ? (X(i.timezone) && !/^(utc|gmt)?$/i.test(X(i.timezone)) && (e.approx = !0, Q(e, "Countdown times now use the date as written, in the visitor’s own time zone. Check the end time.")), [c("timer", "Countdown", { props: {
20484
+ let t = Date.parse(Z(i.targetDate));
20485
+ return Number.isFinite(t) ? (Z(i.timezone) && !/^(utc|gmt)?$/i.test(Z(i.timezone)) && (e.approx = !0, Q(e, "Countdown times now use the date as written, in the visitor’s own time zone. Check the end time.")), [c("timer", "Countdown", { props: {
20365
20486
  target: new Date(t).toISOString(),
20366
- expiredMessage: X(i.expiredMessage) || "This offer has ended",
20487
+ expiredMessage: Z(i.expiredMessage) || "This offer has ended",
20367
20488
  showLabels: i.showLabels !== !1
20368
20489
  } })]) : (e.lost = !0, Q(e, "A countdown timer had no valid end date, so it was left out."), []);
20369
20490
  }
20370
20491
  case "accordion": {
20371
- let t = Y(i.items, 50).map(J);
20372
- t.some((e) => Y(e.children).length) && (e.approx = !0, Q(e, "Questions nested inside other questions were left out of an accordion."));
20492
+ let t = X(i.items, 50).map(Y);
20493
+ t.some((e) => X(e.children).length) && (e.approx = !0, Q(e, "Questions nested inside other questions were left out of an accordion."));
20373
20494
  let n = t.findIndex((e) => !!e.defaultOpen);
20374
20495
  return n > 0 && (e.approx = !0, Q(e, "An accordion opens its first question by default now, not the one it used to.")), [c("accordion", "Accordion", { props: {
20375
20496
  items: t.map((e, t) => ({
20376
- title: Z(X(e.title) || `Item ${t + 1}`).text,
20377
- content: Z(X(e.content)).text
20497
+ title: bd(Z(e.title) || `Item ${t + 1}`).text,
20498
+ content: bd(Z(e.content)).text
20378
20499
  })),
20379
20500
  allowMultiple: i.mode === "multi",
20380
20501
  openFirst: n === 0
20381
20502
  } })];
20382
20503
  }
20383
- case "form_container": return X(i.provider) === "maildrip" ? Td(e, "maildrip_form", "a MailDrip sign-up form", n, i) : [Dd(e, n, i, Y(i.fields, 40).map(J), a, o)];
20384
- default: return r in rd ? Td(e, r, od[r] ?? r, n, i, a, o) : (e.lost = !0, Q(e, `A "${r || "unknown"}" block isn't supported in the new editor and was left out.`), []);
20504
+ case "form_container": return Z(i.provider) === "maildrip" ? Id(e, "maildrip_form", "a MailDrip sign-up form", n, i) : [Rd(e, n, i, X(i.fields, 40).map(Y), a, o)];
20505
+ default: return r in pd ? Id(e, r, gd[r] ?? r, n, i, a, o) : (e.lost = !0, Q(e, `A "${r || "unknown"}" block isn't supported in the new editor and was left out.`), []);
20385
20506
  }
20386
20507
  }
20387
- function Td(e, t, n, r, i, a = {}, o) {
20388
- let s = rd[t];
20508
+ function Id(e, t, n, r, i, a = {}, o) {
20509
+ let s = pd[t];
20389
20510
  if (s) {
20390
20511
  let e = {};
20391
- for (let t of ad) {
20512
+ for (let t of hd) {
20392
20513
  let n = i[t];
20393
20514
  (typeof n == "string" || typeof n == "boolean" || typeof n == "number" && Number.isFinite(n)) && (e[t] = n);
20394
20515
  }
@@ -20401,11 +20522,11 @@ function Td(e, t, n, r, i, a = {}, o) {
20401
20522
  })];
20402
20523
  }
20403
20524
  return e.lost = !0, Q(e, `The ${n} can't be carried over automatically and was left out. Add it again from the new editor's Add panel.`), [$(r, "container", `Needs attention: ${n}`, {
20404
- ...Sd,
20525
+ ...Nd,
20405
20526
  minHeight: "40px"
20406
20527
  }, { hidden: !0 })];
20407
20528
  }
20408
- var Ed = {
20529
+ var Ld = {
20409
20530
  text: "text",
20410
20531
  email: "email",
20411
20532
  tel: "tel",
@@ -20417,34 +20538,34 @@ var Ed = {
20417
20538
  number: "text",
20418
20539
  date: "text"
20419
20540
  };
20420
- function Dd(e, t, n, r, i, a) {
20541
+ function Rd(e, t, n, r, i, a) {
20421
20542
  let o = /* @__PURE__ */ new Set(), s = [];
20422
20543
  for (let t of r) {
20423
- let n = X(t.kind) || X(t.type) || X(t.inputType) || "text", r = Ed[n] ?? "text";
20424
- (n === "radio" || n === "number" || n === "date" || !(n in Ed)) && (e.approx = !0, Q(e, `A "${n}" form field is now a ${r === "select" ? "drop-down" : "text"} field.`));
20425
- let i = Z(X(t.label) || X(t.placeholder) || X(t.name) || "Field").text, a = (X(t.name) || X(t.fieldName) || i).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "field", c = a;
20544
+ let n = Z(t.kind) || Z(t.type) || Z(t.inputType) || "text", r = Ld[n] ?? "text";
20545
+ (n === "radio" || n === "number" || n === "date" || !(n in Ld)) && (e.approx = !0, Q(e, `A "${n}" form field is now a ${r === "select" ? "drop-down" : "text"} field.`));
20546
+ let i = bd(Z(t.label) || Z(t.placeholder) || Z(t.name) || "Field").text, a = (Z(t.name) || Z(t.fieldName) || i).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "field", c = a;
20426
20547
  for (let e = 2; o.has(a); e++) a = `${c}-${e}`;
20427
20548
  o.add(a);
20428
- let l = Y(t.options, 50).map((e) => sd(e) ? X(e.label) || X(e.value) : X(e)).filter(Boolean);
20549
+ let l = X(t.options, 50).map((e) => _d(e) ? Z(e.label) || Z(e.value) : Z(e)).filter(Boolean);
20429
20550
  s.push({
20430
20551
  id: a,
20431
20552
  label: i,
20432
20553
  type: r,
20433
- ...X(t.placeholder) ? { placeholder: X(t.placeholder) } : {},
20554
+ ...Z(t.placeholder) ? { placeholder: Z(t.placeholder) } : {},
20434
20555
  ...t.required ? { required: !0 } : {},
20435
20556
  ...r === "select" ? { options: l } : {}
20436
20557
  });
20437
20558
  }
20438
20559
  e.approx = !0, Q(e, "Forms use the new form style, so field and button colours need a quick check.");
20439
- let c = X(n.actionUrl) || X(n.action), l = {
20560
+ let c = Z(n.actionUrl) || Z(n.action), l = {
20440
20561
  fields: s.length ? s : [{
20441
20562
  id: "email",
20442
20563
  label: "Email",
20443
20564
  type: "email",
20444
20565
  required: !0
20445
20566
  }],
20446
- submitLabel: X(n.submitLabel) || "Submit",
20447
- successMessage: X(n.successMessage) || "Thanks! We got your message."
20567
+ submitLabel: Z(n.submitLabel) || "Submit",
20568
+ successMessage: Z(n.successMessage) || "Thanks! We got your message."
20448
20569
  };
20449
20570
  c && P(c) !== "#" && (l.action = P(c)), s.length || (e.approx = !0, Q(e, "A form had no fields, so it starts with an email field."));
20450
20571
  let u = { ...i };
@@ -20453,35 +20574,35 @@ function Dd(e, t, n, r, i, a) {
20453
20574
  ...a ? { responsive: a } : {}
20454
20575
  });
20455
20576
  }
20456
- var Od = /* @__PURE__ */ new Set([
20577
+ var zd = /* @__PURE__ */ new Set([
20457
20578
  "input",
20458
20579
  "textarea",
20459
20580
  "select"
20460
20581
  ]);
20461
- function kd(e) {
20462
- let t = J(e.attributes), n = X(e.type);
20582
+ function Bd(e) {
20583
+ let t = Y(e.attributes), n = Z(e.type);
20463
20584
  return {
20464
- kind: n === "input" ? X(t.inputType) || X(t.type) || "text" : n,
20465
- name: X(t.name) || X(t.fieldName),
20466
- label: X(t.label) || X(t.placeholder),
20467
- placeholder: X(t.placeholder),
20585
+ kind: n === "input" ? Z(t.inputType) || Z(t.type) || "text" : n,
20586
+ name: Z(t.name) || Z(t.fieldName),
20587
+ label: Z(t.label) || Z(t.placeholder),
20588
+ placeholder: Z(t.placeholder),
20468
20589
  required: t.required,
20469
20590
  options: t.options
20470
20591
  };
20471
20592
  }
20472
- function Ad(e) {
20473
- let t = Y(e.elements, 200).filter(sd), n = Y(e.nestedRows, 50).filter(sd), r = /* @__PURE__ */ new Map();
20474
- for (let e of t) r.set(X(e.id), {
20593
+ function Vd(e) {
20594
+ let t = X(e.elements, 200).filter(_d), n = X(e.nestedRows, 50).filter(_d), r = /* @__PURE__ */ new Map();
20595
+ for (let e of t) r.set(Z(e.id), {
20475
20596
  kind: "el",
20476
20597
  item: e
20477
20598
  });
20478
- for (let e of n) r.set(X(e.id), {
20599
+ for (let e of n) r.set(Z(e.id), {
20479
20600
  kind: "row",
20480
20601
  item: e
20481
20602
  });
20482
20603
  let i = [], a = /* @__PURE__ */ new Set();
20483
- for (let t of Y(e.childOrder, 250)) {
20484
- let e = r.get(X(t));
20604
+ for (let t of X(e.childOrder, 250)) {
20605
+ let e = r.get(Z(t));
20485
20606
  e && !a.has(e.item) && (i.push(e), a.add(e.item));
20486
20607
  }
20487
20608
  for (let e of t) a.has(e) || i.push({
@@ -20494,11 +20615,11 @@ function Ad(e) {
20494
20615
  });
20495
20616
  return i;
20496
20617
  }
20497
- function jd(e, t = 1) {
20618
+ function Hd(e, t = 1) {
20498
20619
  return e.nodes + t > 4980 ? (e.capped || (e.capped = !0, e.lost = !0, Q(e, "This design is very large, so the last part of it was left out.")), !1) : (e.nodes += t, !0);
20499
20620
  }
20500
- function Md(e, t, n, r) {
20501
- let i = [], a = Ad(t), o = 0;
20621
+ function Ud(e, t, n, r) {
20622
+ let i = [], a = Vd(t), o = 0;
20502
20623
  for (let t = 0; t < a.length; t++) {
20503
20624
  let s = a[t];
20504
20625
  if (o += 1, s.kind === "row") {
@@ -20506,35 +20627,35 @@ function Md(e, t, n, r) {
20506
20627
  e.lost = !0, Q(e, "Rows nested very deeply were left out.");
20507
20628
  continue;
20508
20629
  }
20509
- let t = Pd(e, s.item, `${n}-r${o}`, r + 1, !1);
20630
+ let t = Gd(e, s.item, `${n}-r${o}`, r + 1, !1);
20510
20631
  t && i.push(t);
20511
20632
  continue;
20512
20633
  }
20513
- if (Od.has(X(s.item.type))) {
20634
+ if (zd.has(Z(s.item.type))) {
20514
20635
  let r = [s.item];
20515
- for (; t + 1 < a.length && a[t + 1].kind === "el" && Od.has(X(a[t + 1].item.type));) r.push(a[t + 1].item), t += 1;
20516
- if (!jd(e)) continue;
20517
- e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(Dd(e, `${n}-e${o}`, {}, r.map(kd), bd(e, r[0], "form field").styles, void 0));
20636
+ for (; t + 1 < a.length && a[t + 1].kind === "el" && zd.has(Z(a[t + 1].item.type));) r.push(a[t + 1].item), t += 1;
20637
+ if (!Hd(e)) continue;
20638
+ e.approx = !0, Q(e, "Separate form fields were grouped into one form. Check its button and where it sends messages."), i.push(Rd(e, `${n}-e${o}`, {}, r.map(Bd), jd(e, r[0], "form field").styles, void 0));
20518
20639
  continue;
20519
20640
  }
20520
- jd(e, 2) && i.push(...wd(e, s.item, `${n}-e${o}`));
20641
+ Hd(e, 2) && i.push(...Fd(e, s.item, `${n}-e${o}`));
20521
20642
  }
20522
20643
  return i;
20523
20644
  }
20524
- var Nd = (e) => {
20525
- let t = parseFloat(X(e));
20645
+ var Wd = (e) => {
20646
+ let t = parseFloat(Z(e));
20526
20647
  return Number.isFinite(t) && t > 0 ? t : 0;
20527
20648
  };
20528
- function Pd(e, t, n, r, i) {
20529
- if (!jd(e, 3)) return null;
20530
- let { styles: a, responsive: o } = bd(e, {
20649
+ function Gd(e, t, n, r, i) {
20650
+ if (!Hd(e, 3)) return null;
20651
+ let { styles: a, responsive: o } = jd(e, {
20531
20652
  style: t.style,
20532
20653
  styleTablet: t.styleTablet,
20533
20654
  styleMobile: t.styleMobile
20534
- }, "row"), s = Y(t.columns, 12).filter(sd), c = a.gap ?? (s.length > 1 ? "16px" : void 0);
20655
+ }, "row"), s = X(t.columns, 12).filter(_d), c = a.gap ?? (s.length > 1 ? "16px" : void 0);
20535
20656
  delete a.gap;
20536
20657
  let l = s.map((t, i) => {
20537
- let a = `${n}-c${i + 1}`, { styles: o, responsive: s } = bd(e, {
20658
+ let a = `${n}-c${i + 1}`, { styles: o, responsive: s } = jd(e, {
20538
20659
  style: t.styles,
20539
20660
  styleTablet: t.stylesTablet,
20540
20661
  styleMobile: t.stylesMobile
@@ -20543,13 +20664,13 @@ function Pd(e, t, n, r, i) {
20543
20664
  cid: a,
20544
20665
  cs: o,
20545
20666
  cr: s,
20546
- children: Md(e, t, a, r)
20667
+ children: Ud(e, t, a, r)
20547
20668
  };
20548
20669
  }), u;
20549
20670
  if (l.length === 1) {
20550
20671
  let e = l[0];
20551
20672
  u = $(`${n}-body`, "container", "Content", {
20552
- ...Sd,
20673
+ ...Nd,
20553
20674
  ...e.cs,
20554
20675
  width: "100%"
20555
20676
  }, {
@@ -20557,7 +20678,7 @@ function Pd(e, t, n, r, i) {
20557
20678
  ...e.cr ? { responsive: e.cr } : {}
20558
20679
  });
20559
20680
  } else {
20560
- let e = s.map((e) => Nd(e.width)), t = e.reduce((e, t) => e + t, 0), r = l.map((n, r) => t > 0 && e[r] > 0 ? Math.round(e[r] / t * 1e3) / 10 : 100 / Math.max(1, l.length)).map((e) => `minmax(0, ${e}fr)`).join(" "), i = l.length <= 2 ? r : "minmax(0, 1fr) minmax(0, 1fr)";
20681
+ let e = s.map((e) => Wd(e.width)), t = e.reduce((e, t) => e + t, 0), r = l.map((n, r) => t > 0 && e[r] > 0 ? Math.round(e[r] / t * 1e3) / 10 : 100 / Math.max(1, l.length)).map((e) => `minmax(0, ${e}fr)`).join(" "), i = l.length <= 2 ? r : "minmax(0, 1fr) minmax(0, 1fr)";
20561
20682
  u = $(`${n}-cols`, "columns", "Columns", {
20562
20683
  layoutMode: "grid",
20563
20684
  display: "grid",
@@ -20571,7 +20692,7 @@ function Pd(e, t, n, r, i) {
20571
20692
  mobile: { gridTemplateColumns: "minmax(0, 1fr)" }
20572
20693
  },
20573
20694
  children: l.map((e) => $(e.cid, "column", "Column", {
20574
- ...Sd,
20695
+ ...Nd,
20575
20696
  ...e.cs,
20576
20697
  width: "100%"
20577
20698
  }, {
@@ -20586,15 +20707,15 @@ function Pd(e, t, n, r, i) {
20586
20707
  marginLeft: "auto",
20587
20708
  marginRight: "auto"
20588
20709
  });
20589
- let d = X(t.htmlId).trim(), f = (function e(t) {
20710
+ let d = Z(t.htmlId).trim(), f = (function e(t) {
20590
20711
  for (let n of t) {
20591
20712
  if (n.type === "heading" && n.content) return n.content.split("\n")[0].slice(0, 40);
20592
20713
  let t = n.children ? e(n.children) : "";
20593
20714
  if (t) return t;
20594
20715
  }
20595
20716
  return "";
20596
- })(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = Ct(X(t.htmlClass)), h = {
20597
- ...Sd,
20717
+ })(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = Ct(Z(t.htmlClass)), h = {
20718
+ ...Nd,
20598
20719
  ...a,
20599
20720
  ...m ? { customClasses: m } : {}
20600
20721
  };
@@ -20607,7 +20728,7 @@ function Pd(e, t, n, r, i) {
20607
20728
  ...o ? { responsive: o } : {}
20608
20729
  });
20609
20730
  }
20610
- var Fd = (e, t = {}) => ({
20731
+ var Kd = (e, t = {}) => ({
20611
20732
  id: e.id ?? "v1-page",
20612
20733
  name: e.name ?? "Home",
20613
20734
  slug: e.slug ?? "home",
@@ -20620,7 +20741,7 @@ var Fd = (e, t = {}) => ({
20620
20741
  children: []
20621
20742
  }
20622
20743
  });
20623
- function Id(e, t = {}) {
20744
+ function qd(e, t = {}) {
20624
20745
  let n = {
20625
20746
  warnings: [],
20626
20747
  seen: /* @__PURE__ */ new Set(),
@@ -20630,33 +20751,33 @@ function Id(e, t = {}) {
20630
20751
  capped: !1
20631
20752
  }, r = {};
20632
20753
  try {
20633
- let i = J(e), a = sd(i.body) ? i.body : null;
20754
+ let i = Y(e), a = _d(i.body) ? i.body : null;
20634
20755
  if (!a) return Q(n, "This doesn't look like a design from the old editor, so an empty page was made instead."), {
20635
- page: Fd(t),
20756
+ page: Kd(t),
20636
20757
  warnings: n.warnings,
20637
20758
  fidelity: "partial",
20638
20759
  extras: r
20639
20760
  };
20640
- let o = J(a.style), { styles: s, unmapped: c } = _d(Object.fromEntries(Object.entries(o).filter(([e]) => ![
20761
+ let o = Y(a.style), { styles: s, unmapped: c } = Od(Object.fromEntries(Object.entries(o).filter(([e]) => ![
20641
20762
  "customJs",
20642
20763
  "customCss",
20643
20764
  "favicon",
20644
20765
  "contentMaxWidth"
20645
20766
  ].includes(e))));
20646
20767
  c.length && (n.approx = !0, Q(n, `Some page-wide styling (${c.slice(0, 4).join(", ")}) can't be carried over.`));
20647
- let l = X(o.customJs).trim();
20648
- l && (r.customJs = l), X(o.customCss).trim() && (n.approx = !0, Q(n, "The page's custom CSS can't be carried over; check the page's look.")), X(o.favicon).trim() && (n.approx = !0, Q(n, "Set the site icon again in the site settings."));
20649
- let u = Fd(t, { ...s }), d = X(o.contentMaxWidth).trim();
20768
+ let l = Z(o.customJs).trim();
20769
+ l && (r.customJs = l), Z(o.customCss).trim() && (n.approx = !0, Q(n, "The page's custom CSS can't be carried over; check the page's look.")), Z(o.favicon).trim() && (n.approx = !0, Q(n, "Set the site icon again in the site settings."));
20770
+ let u = Kd(t, { ...s }), d = Z(o.contentMaxWidth).trim();
20650
20771
  u.rootNode.styles.layoutMode = "flow", u.rootNode.styles.display = "flex", u.rootNode.styles.flexDirection = "column";
20651
- let f = Y(a.rows, 200).filter(sd), p = [];
20772
+ let f = X(a.rows, 200).filter(_d), p = [];
20652
20773
  if (f.forEach((e, t) => {
20653
- let r = Pd(n, e, `v1-s${t + 1}`, 0, !0);
20774
+ let r = Gd(n, e, `v1-s${t + 1}`, 0, !0);
20654
20775
  r && p.push(r);
20655
20776
  }), d && d !== "1200px") {
20656
- let e = d.toLowerCase() === "none" ? "100%" : dd(d);
20777
+ let e = d.toLowerCase() === "none" ? "100%" : Sd(d);
20657
20778
  if (e) for (let t of p) for (let n of t.children ?? []) n.styles.maxWidth = e;
20658
20779
  }
20659
- u.rootNode.children = p, Ld(u.rootNode) > 40 && (n.lost = !0, Q(n, "Rows nested too deeply were left out."), u.rootNode.children = p.map((e) => Rd(e, 0)));
20780
+ u.rootNode.children = p, Jd(u.rootNode) > 40 && (n.lost = !0, Q(n, "Rows nested too deeply were left out."), u.rootNode.children = p.map((e) => Yd(e, 0)));
20660
20781
  let m = n.lost ? "partial" : n.approx ? "approximate" : "exact";
20661
20782
  return {
20662
20783
  page: u,
@@ -20666,26 +20787,26 @@ function Id(e, t = {}) {
20666
20787
  };
20667
20788
  } catch {
20668
20789
  return {
20669
- page: Fd(t),
20790
+ page: Kd(t),
20670
20791
  warnings: [...n.warnings, "This design could not be read, so an empty page was made instead."],
20671
20792
  fidelity: "partial",
20672
20793
  extras: r
20673
20794
  };
20674
20795
  }
20675
20796
  }
20676
- function Ld(e) {
20797
+ function Jd(e) {
20677
20798
  let t = 0;
20678
- for (let n of e.children ?? []) t = Math.max(t, Ld(n));
20799
+ for (let n of e.children ?? []) t = Math.max(t, Jd(n));
20679
20800
  return t + 1;
20680
20801
  }
20681
- function Rd(e, t) {
20802
+ function Yd(e, t) {
20682
20803
  return t >= 38 ? {
20683
20804
  ...e,
20684
20805
  children: []
20685
20806
  } : {
20686
20807
  ...e,
20687
- children: e.children?.map((e) => Rd(e, t + 1))
20808
+ children: e.children?.map((e) => Yd(e, t + 1))
20688
20809
  };
20689
20810
  }
20690
20811
  //#endregion
20691
- export { ms as $, sa as $t, _c as A, ge as An, Ma as At, Xs as B, Ji as Bt, ll as C, Me as Cn, Ya as Ct, Rc as D, he as Dn, Ua as Dt, Jc as E, we as En, Ra as Et, hc as F, pe as Fn, Oa as Ft, cc as G, fa as Gt, Ks as H, Fi as Ht, Ts as I, de as In, ba as It, Cs as J, Yi as Jt, ws as K, oa as Kt, Es as L, ue as Ln, da as Lt, yc as M, Se as Mn, wa as Mt, vc as N, _e as Nn, ja as Nt, zc as O, xe as On, Pa as Ot, gc as P, fe as Pn, Ea as Pt, rs as Q, ea as Qt, uc as R, k as Rn, aa as Rt, ul as S, Fe as Sn, ro as St, sl as T, De as Tn, La as Tt, mc as U, ra as Ut, sc as V, la as Vt, dc as W, ia as Wt, Ss as X, ca as Xt, vs as Y, pa as Yt, _s as Z, $i as Zt, Dl as _, ke as _n, to as _t, Gu as a, Oi as an, $o as at, hl as b, je as bn, $a as bt, Wu as c, qt as cn, bo as ct, Gl as d, Lt as dn, mo as dt, na as en, as as et, Kl as f, zt as fn, oo as ft, Ol as g, ut as gn, io as gt, Pl as h, ct as hn, no as ht, Ku as i, V as in, Yo as it, bc as j, ve as jn, Aa as jt, Lc as k, ye as kn, Sa as kt, $l as l, Dt as ln, go as lt, Ml as m, wt as mn, Za as mt, id as n, ha as nn, ns as nt, nd as o, Xt as on, Go as ot, Ul as p, Ot as pn, so as pt, gs as q, ya as qt, Id as r, ki as rn, ts as rt, _u as s, Yt as sn, So as st, rd as t, ta as tn, fs as tt, Jl as u, Rt as un, ho as ut, Tl as v, Ae as vn, lo as vt, cl as w, Pe as wn, co as wt, fl as x, Ie as xn, Ja as xt, ml as y, Le as yn, ao as yt, oc as z, H as zt };
20812
+ export { ws as $, sa as $t, Dc as A, ge as An, Ma as At, oc as B, Ji as Bt, yl as C, Me as Cn, Ya as Ct, Jc as D, he as Dn, Ua as Dt, il as E, we as En, Ra as Et, Tc as F, pe as Fn, Oa as Ft, vc as G, fa as Gt, nc as H, Fi as Ht, Fs as I, de as In, ba as It, Ns as J, Yi as Jt, Ps as K, oa as Kt, Is as L, ue as Ln, da as Lt, kc as M, Se as Mn, wa as Mt, Oc as N, _e as Nn, ja as Nt, Yc as O, xe as On, Pa as Ot, Ec as P, fe as Pn, Ea as Pt, ps as Q, ea as Qt, bc as R, k as Rn, aa as Rt, bl as S, Fe as Sn, ro as St, _l as T, De as Tn, La as Tt, wc as U, ra as Ut, _c as V, la as Vt, xc as W, ia as Wt, Ms as X, ca as Xt, Os as Y, pa as Yt, Ds as Z, $i as Zt, Ll as _, ke as _n, to as _t, td as a, Oi as an, ls as at, Tl as b, je as bn, $a as bt, ed as c, qt as cn, To as ct, tu as d, Lt as dn, go as dt, na as en, hs as et, nu as f, zt as fn, oo as ft, Rl as g, ut as gn, io as gt, Wl as h, ct as hn, no as ht, nd as i, V as in, as as it, Ac as j, ve as jn, Aa as jt, qc as k, ye as kn, Sa as kt, lu as l, Dt as ln, vo as lt, Hl as m, wt as mn, Za as mt, md as n, ha as nn, fs as nt, fd as o, Xt as on, ts as ot, $l as p, Ot as pn, so as pt, Es as q, ya as qt, qd as r, ki as rn, ds as rt, Du as s, Yt as sn, Do as st, pd as t, ta as tn, Ss as tt, iu as u, Rt as un, _o as ut, Fl as v, Ae as vn, lo as vt, vl as w, Pe as wn, co as wt, Sl as x, Ie as xn, Ja as xt, wl as y, Le as yn, ao as yt, gc as z, H as zt };