@ohhwells/bridge 0.1.54-next.151 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -46,7 +46,6 @@ __export(index_exports, {
46
46
  DropdownMenuItem: () => DropdownMenuItem,
47
47
  DropdownMenuSeparator: () => DropdownMenuSeparator,
48
48
  DropdownMenuTrigger: () => DropdownMenuTrigger,
49
- EmptySection: () => EmptySection,
50
49
  ItemActionToolbar: () => ItemActionToolbar,
51
50
  ItemInteractionLayer: () => ItemInteractionLayer,
52
51
  LinkEditorPanel: () => LinkEditorPanel,
@@ -75,7 +74,7 @@ __export(index_exports, {
75
74
  module.exports = __toCommonJS(index_exports);
76
75
 
77
76
  // src/OhhwellsBridge.tsx
78
- var import_react16 = __toESM(require("react"), 1);
77
+ var import_react15 = __toESM(require("react"), 1);
79
78
  var import_client2 = require("react-dom/client");
80
79
  var import_react_dom3 = require("react-dom");
81
80
 
@@ -2027,7 +2026,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
2027
2026
  const autoId = (0, import_react5.useId)();
2028
2027
  const insertAfter = insertAfterProp ?? autoId;
2029
2028
  const [schedule, setSchedule] = (0, import_react5.useState)(null);
2030
- const [loading, setLoading] = (0, import_react5.useState)(initialScheduleId !== null);
2029
+ const [loading, setLoading] = (0, import_react5.useState)(true);
2031
2030
  const [inEditor, setInEditor] = (0, import_react5.useState)(false);
2032
2031
  const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
2033
2032
  const [modalState, setModalState] = (0, import_react5.useState)(null);
@@ -2201,10 +2200,8 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
2201
2200
  "*"
2202
2201
  );
2203
2202
  };
2203
+ if (!inEditor && !loading && !schedule) return null;
2204
2204
  const sectionId = `scheduling-${insertAfter}`;
2205
- if (!inEditor && !loading && !schedule) {
2206
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { "data-ohw-section": sectionId, "data-ohw-scheduling-anchor": insertAfter, style: { display: "none" } });
2207
- }
2208
2205
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2209
2206
  "section",
2210
2207
  {
@@ -10372,329 +10369,6 @@ function deleteFooterColumn(column) {
10372
10369
  };
10373
10370
  }
10374
10371
 
10375
- // src/lib/logo-identity.ts
10376
- var LOGO_TEXT_KEYS = ["nav-logo-text", "footer-logo-text", "logo-text"];
10377
- var LOGO_IMAGE_KEYS = ["nav-logo-image", "footer-logo", "footer-logo-image"];
10378
- var LOGO_HREF_KEYS = ["nav-logo-href", "footer-logo-href", "logo-href"];
10379
- var LOGO_PLACEHOLDER_KEY = "logo-is-placeholder";
10380
- var LOGO_ALT_KEY = "logo-alt";
10381
- var LOGO_IMAGE_URL_KEY = "nav-logo-image";
10382
- var PLACEHOLDER_BUSINESS_NAME = "Business name";
10383
- function resolveLogoDisplayText(text) {
10384
- const trimmed = (text ?? "").trim();
10385
- return trimmed || PLACEHOLDER_BUSINESS_NAME;
10386
- }
10387
- function isFooterLogoRoot(root) {
10388
- return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
10389
- }
10390
- function imageKeyForRoot(root) {
10391
- return isFooterLogoRoot(root) ? "footer-logo" : "nav-logo-image";
10392
- }
10393
- function textKeyForRoot(root) {
10394
- return isFooterLogoRoot(root) ? "footer-logo-text" : "nav-logo-text";
10395
- }
10396
- function ensureLogoHrefKey(root) {
10397
- if (!(root instanceof HTMLAnchorElement)) return;
10398
- if (root.hasAttribute("data-ohw-href-key")) return;
10399
- root.setAttribute("data-ohw-href-key", isFooterLogoRoot(root) ? "footer-logo-href" : "nav-logo-href");
10400
- }
10401
- function applyLogoIdentity(text, isPlaceholder) {
10402
- const display = resolveLogoDisplayText(text);
10403
- const placeholder = isPlaceholder || !text.trim() || display === PLACEHOLDER_BUSINESS_NAME;
10404
- for (const key of LOGO_TEXT_KEYS) {
10405
- document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
10406
- if (el.textContent !== display) el.textContent = display;
10407
- });
10408
- }
10409
- for (const key of LOGO_IMAGE_KEYS) {
10410
- document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
10411
- const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
10412
- if (img) img.alt = display;
10413
- });
10414
- }
10415
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((el) => {
10416
- if (placeholder) el.setAttribute("data-ohw-placeholder", "");
10417
- else el.removeAttribute("data-ohw-placeholder");
10418
- });
10419
- return display;
10420
- }
10421
- function applyLogoImage(url, alt) {
10422
- const displayAlt = resolveLogoDisplayText(alt);
10423
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
10424
- ensureLogoHrefKey(root);
10425
- const imageKey = imageKeyForRoot(root);
10426
- const textKey = textKeyForRoot(root);
10427
- let img = root.querySelector(`img[data-ohw-key="${imageKey}"]`) ?? (root.querySelector(`[data-ohw-key="${imageKey}"]`) instanceof HTMLImageElement ? root.querySelector(`[data-ohw-key="${imageKey}"]`) : null) ?? root.querySelector("img");
10428
- let textEl = root.querySelector(`[data-ohw-key="${textKey}"]`) ?? root.querySelector('[data-ohw-key="logo-text"]');
10429
- if (url) {
10430
- if (!img) {
10431
- img = document.createElement("img");
10432
- img.setAttribute("data-ohw-editable", "image");
10433
- img.setAttribute("data-ohw-key", imageKey);
10434
- img.alt = displayAlt;
10435
- img.style.height = "";
10436
- img.style.maxHeight = "none";
10437
- img.style.width = "auto";
10438
- img.style.display = "block";
10439
- img.style.objectFit = "contain";
10440
- root.insertBefore(img, root.firstChild);
10441
- } else {
10442
- img.setAttribute("data-ohw-editable", "image");
10443
- img.setAttribute("data-ohw-key", imageKey);
10444
- }
10445
- img.removeAttribute("srcset");
10446
- img.removeAttribute("sizes");
10447
- img.src = url;
10448
- img.alt = displayAlt;
10449
- img.style.display = "block";
10450
- if (textEl) textEl.style.display = "none";
10451
- root.removeAttribute("data-ohw-placeholder");
10452
- return;
10453
- }
10454
- if (img) {
10455
- img.removeAttribute("src");
10456
- img.removeAttribute("srcset");
10457
- img.removeAttribute("sizes");
10458
- img.alt = displayAlt;
10459
- img.style.display = "none";
10460
- }
10461
- if (!textEl) {
10462
- textEl = document.createElement("span");
10463
- textEl.setAttribute("data-ohw-editable", "plain");
10464
- textEl.setAttribute("data-ohw-key", textKey);
10465
- root.appendChild(textEl);
10466
- }
10467
- textEl.style.display = "";
10468
- if (textEl.textContent !== displayAlt) textEl.textContent = displayAlt;
10469
- if (!displayAlt.trim() || displayAlt === PLACEHOLDER_BUSINESS_NAME) {
10470
- root.setAttribute("data-ohw-placeholder", "");
10471
- } else {
10472
- root.removeAttribute("data-ohw-placeholder");
10473
- }
10474
- });
10475
- }
10476
- function applyLogoHref(href) {
10477
- const target = href.trim() || "/";
10478
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
10479
- ensureLogoHrefKey(root);
10480
- if (root instanceof HTMLAnchorElement) {
10481
- root.setAttribute("href", target);
10482
- }
10483
- });
10484
- for (const key of LOGO_HREF_KEYS) setStoredLinkHref(key, target);
10485
- }
10486
- function readLogoIdentityFromDom() {
10487
- let imageUrl = null;
10488
- for (const key of LOGO_IMAGE_KEYS) {
10489
- const el = document.querySelector(`[data-ohw-key="${key}"]`);
10490
- const img = el instanceof HTMLImageElement ? el : el?.querySelector("img");
10491
- const attrSrc = img?.getAttribute("src")?.trim() ?? "";
10492
- if (attrSrc && !attrSrc.startsWith("data:") && img && img.style.display !== "none") {
10493
- imageUrl = img.currentSrc || img.src;
10494
- break;
10495
- }
10496
- }
10497
- let text = PLACEHOLDER_BUSINESS_NAME;
10498
- let isPlaceholder = true;
10499
- for (const key of LOGO_TEXT_KEYS) {
10500
- const el = document.querySelector(`[data-ohw-key="${key}"]`);
10501
- if (el?.textContent?.trim()) {
10502
- text = el.textContent.trim();
10503
- const logoRoot2 = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
10504
- isPlaceholder = logoRoot2?.hasAttribute("data-ohw-placeholder") === true || text === PLACEHOLDER_BUSINESS_NAME;
10505
- break;
10506
- }
10507
- }
10508
- if (imageUrl) {
10509
- const logoImg = document.querySelector(
10510
- '[data-ohw-key="nav-logo-image"], [data-ohw-key="footer-logo"]'
10511
- );
10512
- const alt = logoImg?.alt?.trim() || text;
10513
- isPlaceholder = false;
10514
- const hrefEl = document.querySelector(
10515
- 'a[data-ohw-role="logo"], a[data-ohw-logo], [data-ohw-role="logo"]'
10516
- );
10517
- const href2 = (hrefEl instanceof HTMLAnchorElement ? hrefEl.getAttribute("href") : null) || hrefEl?.closest("a")?.getAttribute("href") || "/";
10518
- return { text, isPlaceholder, imageUrl, href: href2, alt };
10519
- }
10520
- const logoRoot = document.querySelector('[data-ohw-role="logo"], [data-ohw-logo]');
10521
- const href = (logoRoot instanceof HTMLAnchorElement ? logoRoot.getAttribute("href") : null) || logoRoot?.closest("a")?.getAttribute("href") || "/";
10522
- return { text, isPlaceholder, imageUrl: null, href, alt: text };
10523
- }
10524
- function applyLogoFromContent(content) {
10525
- const hasLogoIdentity = LOGO_PLACEHOLDER_KEY in content || LOGO_TEXT_KEYS.some((key) => key in content) || LOGO_IMAGE_KEYS.some((key) => key in content) || LOGO_ALT_KEY in content || LOGO_HREF_KEYS.some((key) => key in content);
10526
- if (!hasLogoIdentity) return false;
10527
- const logoText = content[LOGO_TEXT_KEYS[0]] ?? content[LOGO_TEXT_KEYS[1]] ?? readLogoIdentityFromDom().text;
10528
- const logoAlt = content[LOGO_ALT_KEY] ?? logoText;
10529
- const rawLogoImage = content[LOGO_IMAGE_URL_KEY] ?? content["footer-logo"] ?? content["footer-logo-image"] ?? null;
10530
- const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
10531
- const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
10532
- const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
10533
- if (logoImageUrl) {
10534
- applyLogoImage(logoImageUrl, logoAlt);
10535
- } else {
10536
- if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
10537
- applyLogoIdentity(logoText, logoIsPlaceholder);
10538
- }
10539
- const logoHref = content["nav-logo-href"] ?? content["footer-logo-href"] ?? content["logo-href"];
10540
- if (typeof logoHref === "string" && logoHref.trim()) {
10541
- applyLogoHref(logoHref);
10542
- }
10543
- return true;
10544
- }
10545
-
10546
- // src/lib/logo-size.ts
10547
- var LOGO_SIZE_DEFAULTS = {
10548
- navbar: 28,
10549
- footer: 32
10550
- };
10551
- var LOGO_SIZE_MIN = 16;
10552
- var LOGO_SIZE_MAX = 80;
10553
- var LOGO_SIZE_DESKTOP_KEYS = {
10554
- navbar: "nav-logo-size",
10555
- footer: "footer-logo-size"
10556
- };
10557
- var LOGO_SIZE_MOBILE_KEYS = {
10558
- navbar: "nav-logo-size-mobile",
10559
- footer: "footer-logo-size-mobile"
10560
- };
10561
- var LOGO_SIZE_KEYS = [
10562
- LOGO_SIZE_DESKTOP_KEYS.navbar,
10563
- LOGO_SIZE_DESKTOP_KEYS.footer,
10564
- LOGO_SIZE_MOBILE_KEYS.navbar,
10565
- LOGO_SIZE_MOBILE_KEYS.footer
10566
- ];
10567
- function isFooterLogoRoot2(root) {
10568
- return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
10569
- }
10570
- function getLogoPlacement(root) {
10571
- return isFooterLogoRoot2(root) ? "footer" : "navbar";
10572
- }
10573
- function parseLogoSizePx(raw, fallback) {
10574
- if (raw == null || raw === "") return fallback;
10575
- const n = Number.parseFloat(raw);
10576
- if (!Number.isFinite(n)) return fallback;
10577
- return Math.min(LOGO_SIZE_MAX, Math.max(LOGO_SIZE_MIN, Math.round(n)));
10578
- }
10579
- function isMobileLogoSizeFollowing(content, placement) {
10580
- const raw = content[LOGO_SIZE_MOBILE_KEYS[placement]];
10581
- return raw == null || raw.trim() === "";
10582
- }
10583
- function resolveDesktopLogoSize(content, placement) {
10584
- return parseLogoSizePx(content[LOGO_SIZE_DESKTOP_KEYS[placement]], LOGO_SIZE_DEFAULTS[placement]);
10585
- }
10586
- function resolveMobileLogoSize(content, placement) {
10587
- if (isMobileLogoSizeFollowing(content, placement)) {
10588
- return resolveDesktopLogoSize(content, placement);
10589
- }
10590
- return parseLogoSizePx(
10591
- content[LOGO_SIZE_MOBILE_KEYS[placement]],
10592
- resolveDesktopLogoSize(content, placement)
10593
- );
10594
- }
10595
- function setRootSizeVars(root, desktopPx, mobilePx, following) {
10596
- root.style.setProperty("--ohw-logo-size", `${desktopPx}px`);
10597
- if (following) {
10598
- root.style.removeProperty("--ohw-logo-size-mobile");
10599
- } else {
10600
- root.style.setProperty("--ohw-logo-size-mobile", `${mobilePx}px`);
10601
- }
10602
- root.querySelectorAll("img").forEach((img) => {
10603
- img.style.height = "";
10604
- img.style.maxHeight = "none";
10605
- img.style.width = "auto";
10606
- img.style.objectFit = "contain";
10607
- });
10608
- }
10609
- function applyLogoSizes(content) {
10610
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
10611
- const placement = getLogoPlacement(root);
10612
- const desktop = resolveDesktopLogoSize(content, placement);
10613
- const following = isMobileLogoSizeFollowing(content, placement);
10614
- const mobile = following ? desktop : resolveMobileLogoSize(content, placement);
10615
- setRootSizeVars(root, desktop, mobile, following);
10616
- });
10617
- }
10618
- function applyLogoSizeToPlacement(placement, desktopPx, mobilePx, following) {
10619
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
10620
- if (getLogoPlacement(root) !== placement) return;
10621
- setRootSizeVars(root, desktopPx, mobilePx, following);
10622
- });
10623
- }
10624
- function logoHasUploadedImage(logoEl) {
10625
- if (logoEl.hasAttribute("data-ohw-placeholder")) return false;
10626
- const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
10627
- if (!img) return false;
10628
- const src = img.getAttribute("src")?.trim() ?? "";
10629
- if (!src || src.startsWith("data:")) return false;
10630
- if (img.style.display === "none") return false;
10631
- return true;
10632
- }
10633
- function getLogoInteractionRect(logoEl) {
10634
- if (logoHasUploadedImage(logoEl)) {
10635
- const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
10636
- if (img) {
10637
- const r2 = img.getBoundingClientRect();
10638
- if (r2.width > 0 && r2.height > 0) return r2;
10639
- }
10640
- }
10641
- const text = logoEl.querySelector(
10642
- '[data-ohw-key="nav-logo-text"], [data-ohw-key="footer-logo-text"]'
10643
- );
10644
- if (text) {
10645
- const style = window.getComputedStyle(text);
10646
- if (style.display !== "none" && style.visibility !== "hidden") {
10647
- const r2 = text.getBoundingClientRect();
10648
- if (r2.width > 0 && r2.height > 0) return r2;
10649
- }
10650
- }
10651
- return logoEl.getBoundingClientRect();
10652
- }
10653
- function readLogoSizeState(content, placement) {
10654
- const desktopPx = resolveDesktopLogoSize(content, placement);
10655
- const mobileFollowing = isMobileLogoSizeFollowing(content, placement);
10656
- const mobilePx = mobileFollowing ? desktopPx : resolveMobileLogoSize(content, placement);
10657
- return { desktopPx, mobilePx, mobileFollowing };
10658
- }
10659
-
10660
- // src/lib/site-wide-scope.ts
10661
- function getLogoElement(el) {
10662
- const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
10663
- if (marked) return marked;
10664
- if (el.closest('[data-ohw-editable="icon"]')) return null;
10665
- const root = el.closest("nav, [data-ohw-nav-root], footer");
10666
- if (!root) return null;
10667
- const anchor = el.closest("a");
10668
- if (anchor && root.contains(anchor) && !anchor.hasAttribute("data-ohw-href-key") && !anchor.closest("[data-ohw-nav-container]") && Boolean(anchor.querySelector("img") || anchor.matches("img"))) {
10669
- return anchor;
10670
- }
10671
- const img = el.matches("img") ? el : null;
10672
- if (img && !img.closest("[data-ohw-href-key]") && !img.closest("[data-ohw-nav-container]") && (img.closest("footer") || img.closest("nav, [data-ohw-nav-root]"))) {
10673
- return img;
10674
- }
10675
- return null;
10676
- }
10677
- function isInFooter(el) {
10678
- if (!el) return false;
10679
- return Boolean(el.closest("footer") || el.closest('[data-ohw-section="footer"]'));
10680
- }
10681
- function isSiteWideElement(el) {
10682
- if (!el) return false;
10683
- if (getLogoElement(el)) return true;
10684
- if (isInFooter(el)) return true;
10685
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-root")) {
10686
- return true;
10687
- }
10688
- if (el.hasAttribute("data-ohw-href-key") && el.closest("nav, [data-ohw-nav-root], [data-ohw-nav-drawer], aside")) {
10689
- return true;
10690
- }
10691
- if (el.closest('[data-ohw-role="navbar-button"]')) return true;
10692
- return false;
10693
- }
10694
- function isSiteWideScopeActive(args) {
10695
- return isSiteWideElement(args.selected) || isSiteWideElement(args.hoveredItem) || isSiteWideElement(args.hoveredNavContainer) || isSiteWideElement(args.active);
10696
- }
10697
-
10698
10372
  // src/lib/add-footer-column.ts
10699
10373
  function buildFooterColumnEditContentPatch(result) {
10700
10374
  return {
@@ -10727,293 +10401,6 @@ function addFooterColumnWithPersist({
10727
10401
  return result;
10728
10402
  }
10729
10403
 
10730
- // src/ui/FloatingPanel.tsx
10731
- var import_react13 = require("react");
10732
- var import_lucide_react13 = require("lucide-react");
10733
- var import_jsx_runtime26 = require("react/jsx-runtime");
10734
- var PANEL_WIDTH = 256;
10735
- var EDGE_MARGIN = 16;
10736
- function getVisibleClip(parentScroll) {
10737
- const left = 0;
10738
- const right = window.innerWidth;
10739
- if (!parentScroll) {
10740
- return { top: 0, bottom: window.innerHeight, left, right };
10741
- }
10742
- const { iframeOffsetTop, headerH: visibleCanvasTop, canvasH } = parentScroll;
10743
- const top = Math.max(0, visibleCanvasTop - iframeOffsetTop);
10744
- const bottom = Math.min(window.innerHeight, visibleCanvasTop + canvasH - iframeOffsetTop);
10745
- return { top, bottom: Math.max(top, bottom), left, right };
10746
- }
10747
- function defaultFloatingPanelPosition(parentScroll, panelHeight = 280) {
10748
- const clip = getVisibleClip(parentScroll);
10749
- return {
10750
- x: Math.max(EDGE_MARGIN, clip.right - PANEL_WIDTH - EDGE_MARGIN),
10751
- y: Math.min(
10752
- Math.max(clip.top + EDGE_MARGIN, EDGE_MARGIN),
10753
- Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelHeight - EDGE_MARGIN)
10754
- )
10755
- };
10756
- }
10757
- function clampPosition(pos, parentScroll, panelW, panelH) {
10758
- const clip = getVisibleClip(parentScroll);
10759
- const maxX = Math.max(clip.left + EDGE_MARGIN, clip.right - panelW - EDGE_MARGIN);
10760
- const maxY = Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelH - EDGE_MARGIN);
10761
- return {
10762
- x: Math.min(Math.max(pos.x, clip.left + EDGE_MARGIN), maxX),
10763
- y: Math.min(Math.max(pos.y, clip.top + EDGE_MARGIN), maxY)
10764
- };
10765
- }
10766
- function FloatingPanel({
10767
- open,
10768
- title,
10769
- context,
10770
- icon,
10771
- onClose,
10772
- children,
10773
- position,
10774
- onPositionChange,
10775
- parentScroll = null,
10776
- className,
10777
- bodyClassName
10778
- }) {
10779
- const panelRef = (0, import_react13.useRef)(null);
10780
- const [measured, setMeasured] = (0, import_react13.useState)({ w: PANEL_WIDTH, h: 280 });
10781
- const dragRef = (0, import_react13.useRef)(null);
10782
- const resolved = position ?? defaultFloatingPanelPosition(parentScroll, measured.h);
10783
- const clamped = clampPosition(resolved, parentScroll, measured.w, measured.h);
10784
- (0, import_react13.useLayoutEffect)(() => {
10785
- if (!open || !panelRef.current) return;
10786
- const el = panelRef.current;
10787
- const next = { w: el.offsetWidth || PANEL_WIDTH, h: el.offsetHeight || 280 };
10788
- setMeasured((prev) => prev.w === next.w && prev.h === next.h ? prev : next);
10789
- }, [open, children, title, context]);
10790
- (0, import_react13.useEffect)(() => {
10791
- if (!open || !position || !onPositionChange) return;
10792
- const next = clampPosition(position, parentScroll, measured.w, measured.h);
10793
- if (next.x !== position.x || next.y !== position.y) onPositionChange(next);
10794
- }, [open, parentScroll, measured.w, measured.h, position, onPositionChange]);
10795
- const onHeaderPointerDown = (0, import_react13.useCallback)(
10796
- (e) => {
10797
- if (e.button !== 0) return;
10798
- if (e.target.closest("[data-ohw-floating-panel-close]")) return;
10799
- e.preventDefault();
10800
- e.stopPropagation();
10801
- const el = e.currentTarget;
10802
- el.setPointerCapture(e.pointerId);
10803
- dragRef.current = {
10804
- pointerId: e.pointerId,
10805
- startX: e.clientX,
10806
- startY: e.clientY,
10807
- originX: clamped.x,
10808
- originY: clamped.y
10809
- };
10810
- },
10811
- [clamped.x, clamped.y]
10812
- );
10813
- const onHeaderPointerMove = (0, import_react13.useCallback)(
10814
- (e) => {
10815
- const drag = dragRef.current;
10816
- if (!drag || drag.pointerId !== e.pointerId) return;
10817
- e.preventDefault();
10818
- const next = clampPosition(
10819
- {
10820
- x: drag.originX + (e.clientX - drag.startX),
10821
- y: drag.originY + (e.clientY - drag.startY)
10822
- },
10823
- parentScroll,
10824
- measured.w,
10825
- measured.h
10826
- );
10827
- onPositionChange?.(next);
10828
- },
10829
- [measured.h, measured.w, onPositionChange, parentScroll]
10830
- );
10831
- const endDrag = (0, import_react13.useCallback)((e) => {
10832
- const drag = dragRef.current;
10833
- if (!drag || drag.pointerId !== e.pointerId) return;
10834
- dragRef.current = null;
10835
- try {
10836
- e.currentTarget.releasePointerCapture(e.pointerId);
10837
- } catch {
10838
- }
10839
- }, []);
10840
- if (!open) return null;
10841
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
10842
- "div",
10843
- {
10844
- ref: panelRef,
10845
- "data-ohw-floating-panel": "",
10846
- role: "dialog",
10847
- "aria-label": title,
10848
- className: cn(
10849
- // Above MediaOverlay / item chrome (2147483646); link-modal content shares this tier.
10850
- "fixed z-[2147483647] flex w-64 flex-col overflow-hidden rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
10851
- className
10852
- ),
10853
- style: { left: clamped.x, top: clamped.y },
10854
- onMouseDown: (e) => e.stopPropagation(),
10855
- onPointerDown: (e) => e.stopPropagation(),
10856
- onClick: (e) => e.stopPropagation(),
10857
- children: [
10858
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
10859
- "div",
10860
- {
10861
- "data-ohw-floating-panel-header": "",
10862
- className: "relative flex cursor-grab items-start gap-2 border-b border-border py-5 pl-5 pr-11 active:cursor-grabbing",
10863
- onPointerDown: onHeaderPointerDown,
10864
- onPointerMove: onHeaderPointerMove,
10865
- onPointerUp: endDrag,
10866
- onPointerCancel: endDrag,
10867
- children: [
10868
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
10869
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
10870
- icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "shrink-0 text-foreground", children: icon }) : null,
10871
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "min-w-0 flex-1 text-lg font-semibold leading-7 text-foreground", children: title })
10872
- ] }),
10873
- context ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "w-full text-sm leading-5 text-muted-foreground", children: context }) : null
10874
- ] }),
10875
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
10876
- "button",
10877
- {
10878
- type: "button",
10879
- "data-ohw-floating-panel-close": "",
10880
- "aria-label": "Close",
10881
- className: "absolute right-2.5 top-2.5 rounded-sm p-1.5 text-foreground hover:bg-muted/50",
10882
- onClick: (e) => {
10883
- e.stopPropagation();
10884
- onClose();
10885
- },
10886
- onPointerDown: (e) => e.stopPropagation(),
10887
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.X, { size: 16, "aria-hidden": true })
10888
- }
10889
- )
10890
- ]
10891
- }
10892
- ),
10893
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
10894
- "div",
10895
- {
10896
- "data-ohw-floating-panel-body": "",
10897
- className: cn("flex w-full flex-col gap-4 p-5", bodyClassName),
10898
- children
10899
- }
10900
- )
10901
- ]
10902
- }
10903
- );
10904
- }
10905
-
10906
- // src/ui/logo-size-panel.tsx
10907
- var import_lucide_react14 = require("lucide-react");
10908
- var import_jsx_runtime27 = require("react/jsx-runtime");
10909
- function SizeSlider({
10910
- value,
10911
- onChange
10912
- }) {
10913
- const pct = (value - LOGO_SIZE_MIN) / (LOGO_SIZE_MAX - LOGO_SIZE_MIN) * 100;
10914
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
10915
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full items-center gap-2 text-sm font-medium leading-5", children: [
10916
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 flex-1 text-foreground", children: "Size" }),
10917
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: [
10918
- value,
10919
- " px"
10920
- ] })
10921
- ] }),
10922
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative h-2 w-full rounded-full bg-primary-50", children: [
10923
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10924
- "div",
10925
- {
10926
- className: "absolute inset-y-0 left-0 rounded-full bg-primary",
10927
- style: { width: `${pct}%` }
10928
- }
10929
- ),
10930
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10931
- "input",
10932
- {
10933
- type: "range",
10934
- min: LOGO_SIZE_MIN,
10935
- max: LOGO_SIZE_MAX,
10936
- step: 1,
10937
- value,
10938
- "aria-label": "Logo size",
10939
- className: cn(
10940
- "absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent",
10941
- "[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:size-5",
10942
- "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2",
10943
- "[&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background",
10944
- "[&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:rounded-full",
10945
- "[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary",
10946
- "[&::-moz-range-thumb]:bg-background"
10947
- ),
10948
- onChange: (e) => onChange(Number(e.target.value))
10949
- }
10950
- )
10951
- ] })
10952
- ] });
10953
- }
10954
- function LogoSizePanel({
10955
- viewport,
10956
- sizePx,
10957
- mobileFollowing = true,
10958
- onSizeChange,
10959
- onCustomizeMobile,
10960
- onResetMobile,
10961
- onUpdateEverywhere,
10962
- className
10963
- }) {
10964
- const showFollowing = viewport === "mobile" && mobileFollowing;
10965
- const showMobileSlider = viewport === "mobile" && !mobileFollowing;
10966
- const showDesktopSlider = viewport === "desktop";
10967
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex w-full flex-col gap-4", className), children: [
10968
- showFollowing ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full flex-col gap-2", children: [
10969
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-1", children: [
10970
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.Link, { size: 16, className: "mt-0.5 shrink-0 text-foreground", "aria-hidden": true }),
10971
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-semibold leading-5 text-foreground", children: "Following desktop size" })
10972
- ] }),
10973
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", children: "Mobile uses the desktop size until you customize it. Change the desktop size and it follows automatically." }),
10974
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10975
- Button,
10976
- {
10977
- type: "button",
10978
- variant: "outline",
10979
- size: "sm",
10980
- className: "h-9 w-full min-w-0 cursor-pointer",
10981
- onClick: onCustomizeMobile,
10982
- children: "Customize for mobile"
10983
- }
10984
- )
10985
- ] }) : null,
10986
- showDesktopSlider || showMobileSlider ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SizeSlider, { value: sizePx, onChange: onSizeChange }) : null,
10987
- showMobileSlider ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
10988
- Button,
10989
- {
10990
- type: "button",
10991
- variant: "outline",
10992
- size: "sm",
10993
- className: "h-9 w-full min-w-0 cursor-pointer",
10994
- onClick: onResetMobile,
10995
- children: "Reset to desktop size"
10996
- }
10997
- ) : null,
10998
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "h-px w-full bg-border", role: "separator" }),
10999
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
11000
- Button,
11001
- {
11002
- type: "button",
11003
- variant: "outline",
11004
- size: "sm",
11005
- className: "h-9 w-full min-w-0 cursor-pointer gap-1",
11006
- onClick: onUpdateEverywhere,
11007
- children: [
11008
- "Update logo everywhere",
11009
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.ArrowUpRight, { size: 16, "aria-hidden": true })
11010
- ]
11011
- }
11012
- ),
11013
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", children: "Matches the right version to your background." })
11014
- ] });
11015
- }
11016
-
11017
10404
  // src/lib/item-drag-interaction.ts
11018
10405
  function disableNativeHrefDrag(el) {
11019
10406
  if (el.draggable) el.draggable = false;
@@ -11212,7 +10599,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
11212
10599
  }
11213
10600
 
11214
10601
  // src/useNavItemDrag.ts
11215
- var import_react14 = require("react");
10602
+ var import_react13 = require("react");
11216
10603
  function useNavItemDrag({
11217
10604
  isEditMode,
11218
10605
  editContentRef,
@@ -11236,11 +10623,11 @@ function useNavItemDrag({
11236
10623
  getNavigationItemAnchor: getNavigationItemAnchor2,
11237
10624
  isDragHandleDisabled: isDragHandleDisabled2
11238
10625
  }) {
11239
- const navDragRef = (0, import_react14.useRef)(null);
11240
- const [navDropSlots, setNavDropSlots] = (0, import_react14.useState)([]);
11241
- const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react14.useState)(null);
11242
- const navPointerDragRef = (0, import_react14.useRef)(null);
11243
- const clearNavDragVisuals = (0, import_react14.useCallback)(() => {
10626
+ const navDragRef = (0, import_react13.useRef)(null);
10627
+ const [navDropSlots, setNavDropSlots] = (0, import_react13.useState)([]);
10628
+ const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react13.useState)(null);
10629
+ const navPointerDragRef = (0, import_react13.useRef)(null);
10630
+ const clearNavDragVisuals = (0, import_react13.useCallback)(() => {
11244
10631
  const session = navDragRef.current;
11245
10632
  const keepOpenEl = session?.draggedEl?.closest("[data-ohw-nav-children]") != null ? session.draggedEl : null;
11246
10633
  navDragRef.current = null;
@@ -11257,7 +10644,7 @@ function useNavItemDrag({
11257
10644
  document.documentElement.removeAttribute("data-ohw-nav-dragging-root");
11258
10645
  unlockItemDragInteraction();
11259
10646
  }, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
11260
- const refreshNavDragVisuals = (0, import_react14.useCallback)(
10647
+ const refreshNavDragVisuals = (0, import_react13.useCallback)(
11261
10648
  (session, activeSlot, clientX, clientY) => {
11262
10649
  setDraggedItemRect(session.draggedEl.getBoundingClientRect());
11263
10650
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -11275,13 +10662,13 @@ function useNavItemDrag({
11275
10662
  },
11276
10663
  [setDraggedItemRect, setSiblingHintRects]
11277
10664
  );
11278
- const refreshNavDragVisualsRef = (0, import_react14.useRef)(refreshNavDragVisuals);
10665
+ const refreshNavDragVisualsRef = (0, import_react13.useRef)(refreshNavDragVisuals);
11279
10666
  refreshNavDragVisualsRef.current = refreshNavDragVisuals;
11280
- const commitNavDragRef = (0, import_react14.useRef)(() => {
10667
+ const commitNavDragRef = (0, import_react13.useRef)(() => {
11281
10668
  });
11282
- const beginNavDragRef = (0, import_react14.useRef)(() => {
10669
+ const beginNavDragRef = (0, import_react13.useRef)(() => {
11283
10670
  });
11284
- const beginNavDrag = (0, import_react14.useCallback)(
10671
+ const beginNavDrag = (0, import_react13.useCallback)(
11285
10672
  (session) => {
11286
10673
  const rect = session.draggedEl.getBoundingClientRect();
11287
10674
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -11315,7 +10702,7 @@ function useNavItemDrag({
11315
10702
  ]
11316
10703
  );
11317
10704
  beginNavDragRef.current = beginNavDrag;
11318
- const commitNavDrag = (0, import_react14.useCallback)(
10705
+ const commitNavDrag = (0, import_react13.useCallback)(
11319
10706
  (clientX, clientY) => {
11320
10707
  const session = navDragRef.current;
11321
10708
  if (!session) {
@@ -11376,7 +10763,7 @@ function useNavItemDrag({
11376
10763
  [clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
11377
10764
  );
11378
10765
  commitNavDragRef.current = commitNavDrag;
11379
- const startNavLinkDrag = (0, import_react14.useCallback)(
10766
+ const startNavLinkDrag = (0, import_react13.useCallback)(
11380
10767
  (anchor, clientX, clientY, wasSelected) => {
11381
10768
  if (footerDragRef.current) return false;
11382
10769
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
@@ -11394,7 +10781,7 @@ function useNavItemDrag({
11394
10781
  },
11395
10782
  [beginNavDrag, footerDragRef, isDragHandleDisabled2, isCtaButton]
11396
10783
  );
11397
- const onNavDragOver = (0, import_react14.useCallback)(
10784
+ const onNavDragOver = (0, import_react13.useCallback)(
11398
10785
  (e) => {
11399
10786
  const session = navDragRef.current;
11400
10787
  if (!session) return false;
@@ -11406,7 +10793,7 @@ function useNavItemDrag({
11406
10793
  },
11407
10794
  []
11408
10795
  );
11409
- (0, import_react14.useEffect)(() => {
10796
+ (0, import_react13.useEffect)(() => {
11410
10797
  if (!isEditMode) return;
11411
10798
  const THRESHOLD = 10;
11412
10799
  const resolveWasSelected = (el) => {
@@ -11531,7 +10918,7 @@ function useNavItemDrag({
11531
10918
  setLinkPopover,
11532
10919
  suppressNextClickRef
11533
10920
  ]);
11534
- const armNavPressFromChrome = (0, import_react14.useCallback)(
10921
+ const armNavPressFromChrome = (0, import_react13.useCallback)(
11535
10922
  (selected, clientX, clientY, pointerId) => {
11536
10923
  const hrefKey = selected.getAttribute("data-ohw-href-key");
11537
10924
  if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
@@ -11562,8 +10949,8 @@ function useNavItemDrag({
11562
10949
  }
11563
10950
 
11564
10951
  // src/ui/footer-container-chrome.tsx
11565
- var import_lucide_react15 = require("lucide-react");
11566
- var import_jsx_runtime28 = require("react/jsx-runtime");
10952
+ var import_lucide_react13 = require("lucide-react");
10953
+ var import_jsx_runtime26 = require("react/jsx-runtime");
11567
10954
  function FooterContainerChrome({
11568
10955
  rect,
11569
10956
  onAdd,
@@ -11571,7 +10958,7 @@ function FooterContainerChrome({
11571
10958
  }) {
11572
10959
  const chromeGap = 6;
11573
10960
  const buttonMargin = 7;
11574
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
10961
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11575
10962
  "div",
11576
10963
  {
11577
10964
  "data-ohw-footer-container-chrome": "",
@@ -11583,8 +10970,8 @@ function FooterContainerChrome({
11583
10970
  width: rect.width + chromeGap * 2,
11584
10971
  height: rect.height + chromeGap * 2
11585
10972
  },
11586
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
11587
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
10973
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
10974
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11588
10975
  "button",
11589
10976
  {
11590
10977
  type: "button",
@@ -11603,17 +10990,17 @@ function FooterContainerChrome({
11603
10990
  if (addDisabled) return;
11604
10991
  onAdd();
11605
10992
  },
11606
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react15.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
10993
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
11607
10994
  }
11608
10995
  ) }),
11609
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
10996
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
11610
10997
  ] })
11611
10998
  }
11612
10999
  ) });
11613
11000
  }
11614
11001
 
11615
11002
  // src/lib/carousel.ts
11616
- var import_react15 = require("react");
11003
+ var import_react14 = require("react");
11617
11004
  var CAROUSEL_ATTR = "data-ohw-carousel";
11618
11005
  var CAROUSEL_VALUE_ATTR = "data-ohw-carousel-value";
11619
11006
  var CAROUSEL_SLIDE_ATTR = "data-ohw-carousel-slide";
@@ -11675,8 +11062,8 @@ function applyCarouselNode(key, val) {
11675
11062
  return true;
11676
11063
  }
11677
11064
  function useOhwCarousel(key, initial) {
11678
- const [images, setImages] = (0, import_react15.useState)(initial);
11679
- (0, import_react15.useEffect)(() => {
11065
+ const [images, setImages] = (0, import_react14.useState)(initial);
11066
+ (0, import_react14.useEffect)(() => {
11680
11067
  const el = document.querySelector(
11681
11068
  `[${CAROUSEL_ATTR}][data-ohw-key="${CSS.escape(key)}"]`
11682
11069
  );
@@ -11789,18 +11176,6 @@ function collectEditableNodes(extraContent, root = document) {
11789
11176
  }
11790
11177
  if (extraContent && !isScoped) {
11791
11178
  applyNavFooterDeleteOverrides(byKey, extraContent);
11792
- for (const key of LOGO_IMAGE_KEYS) {
11793
- if (!(key in extraContent)) continue;
11794
- byKey.set(key, { key, type: "image", text: extraContent[key] ?? "" });
11795
- }
11796
- for (const key of [LOGO_PLACEHOLDER_KEY, LOGO_ALT_KEY]) {
11797
- if (!(key in extraContent)) continue;
11798
- byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
11799
- }
11800
- for (const key of LOGO_SIZE_KEYS) {
11801
- if (!(key in extraContent)) continue;
11802
- byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
11803
- }
11804
11179
  }
11805
11180
  return Array.from(byKey.values());
11806
11181
  }
@@ -12049,14 +11424,14 @@ function deleteSelectedNavFooterItem(deps) {
12049
11424
  }
12050
11425
 
12051
11426
  // src/ui/navbar-container-chrome.tsx
12052
- var import_lucide_react16 = require("lucide-react");
12053
- var import_jsx_runtime29 = require("react/jsx-runtime");
11427
+ var import_lucide_react14 = require("lucide-react");
11428
+ var import_jsx_runtime27 = require("react/jsx-runtime");
12054
11429
  function NavbarContainerChrome({
12055
11430
  rect,
12056
11431
  onAdd
12057
11432
  }) {
12058
11433
  const chromeGap = 6;
12059
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11434
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12060
11435
  "div",
12061
11436
  {
12062
11437
  "data-ohw-navbar-container-chrome": "",
@@ -12068,7 +11443,7 @@ function NavbarContainerChrome({
12068
11443
  width: rect.width + chromeGap * 2,
12069
11444
  height: rect.height + chromeGap * 2
12070
11445
  },
12071
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
11446
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12072
11447
  "button",
12073
11448
  {
12074
11449
  type: "button",
@@ -12085,7 +11460,7 @@ function NavbarContainerChrome({
12085
11460
  e.stopPropagation();
12086
11461
  onAdd();
12087
11462
  },
12088
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react16.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
11463
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
12089
11464
  }
12090
11465
  )
12091
11466
  }
@@ -12094,7 +11469,7 @@ function NavbarContainerChrome({
12094
11469
 
12095
11470
  // src/ui/drop-indicator.tsx
12096
11471
  var React10 = __toESM(require("react"), 1);
12097
- var import_jsx_runtime30 = require("react/jsx-runtime");
11472
+ var import_jsx_runtime28 = require("react/jsx-runtime");
12098
11473
  var dropIndicatorVariants = cva(
12099
11474
  "ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
12100
11475
  {
@@ -12118,7 +11493,7 @@ var dropIndicatorVariants = cva(
12118
11493
  );
12119
11494
  var DropIndicator = React10.forwardRef(
12120
11495
  ({ className, direction, state, ...props }, ref) => {
12121
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11496
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12122
11497
  "div",
12123
11498
  {
12124
11499
  ref,
@@ -12135,7 +11510,7 @@ var DropIndicator = React10.forwardRef(
12135
11510
  DropIndicator.displayName = "DropIndicator";
12136
11511
 
12137
11512
  // src/ui/badge.tsx
12138
- var import_jsx_runtime31 = require("react/jsx-runtime");
11513
+ var import_jsx_runtime29 = require("react/jsx-runtime");
12139
11514
  var badgeVariants = cva(
12140
11515
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
12141
11516
  {
@@ -12153,12 +11528,12 @@ var badgeVariants = cva(
12153
11528
  }
12154
11529
  );
12155
11530
  function Badge({ className, variant, ...props }) {
12156
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
11531
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
12157
11532
  }
12158
11533
 
12159
11534
  // src/OhhwellsBridge.tsx
12160
- var import_lucide_react17 = require("lucide-react");
12161
- var import_jsx_runtime32 = require("react/jsx-runtime");
11535
+ var import_lucide_react15 = require("lucide-react");
11536
+ var import_jsx_runtime30 = require("react/jsx-runtime");
12162
11537
  var PRIMARY3 = "#0885FE";
12163
11538
  var IMAGE_FADE_MS = 300;
12164
11539
  function runOpacityFade(el, onDone) {
@@ -12252,10 +11627,21 @@ function parseSchedulingInsertAfter(insertAfter) {
12252
11627
  insertBefore: insertAfter.slice(idx + INSERT_BEFORE_MARKER.length)
12253
11628
  };
12254
11629
  }
12255
- function resolveEntryAnchor(entry) {
12256
- if (entry.anchorId !== void 0) return { anchorId: entry.anchorId, beforeId: entry.beforeId ?? null };
12257
- const parsed = parseSchedulingInsertAfter(entry.insertAfter);
12258
- return { anchorId: parsed.anchor, beforeId: parsed.insertBefore };
11630
+ function resolveSchedulingInsert(insertAfter, explicitInsertBefore) {
11631
+ const parsed = parseSchedulingInsertAfter(insertAfter);
11632
+ const insertBefore = explicitInsertBefore ?? parsed.insertBefore;
11633
+ const effectiveInsertAfter = insertBefore && parsed.insertBefore === null ? `${insertAfter}${INSERT_BEFORE_MARKER}${insertBefore}` : insertAfter;
11634
+ return { effectiveInsertAfter, insertBefore };
11635
+ }
11636
+ function getSchedulingMountPoint(insertAfter) {
11637
+ const { anchor } = parseSchedulingInsertAfter(insertAfter);
11638
+ let anchorEl = document.querySelector(`[data-ohw-section="${anchor}"]`);
11639
+ if (!anchorEl && anchor === "scheduling") {
11640
+ const widgets = Array.from(document.querySelectorAll('[data-ohw-section^="scheduling-"]'));
11641
+ anchorEl = widgets.at(-1) ?? null;
11642
+ }
11643
+ if (!anchorEl) return null;
11644
+ return anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
12259
11645
  }
12260
11646
  function schedulingMountDepth(insertAfter) {
12261
11647
  if (!insertAfter.includes(INSERT_BEFORE_MARKER)) return 0;
@@ -12272,7 +11658,8 @@ function getPageSchedulingEntries(raw) {
12272
11658
  }
12273
11659
  }
12274
11660
  function isSchedulingWidgetMissing(entry) {
12275
- return !document.querySelector(`[data-ohw-section="${schedulingSectionId(entry.insertAfter)}"]`);
11661
+ const { effectiveInsertAfter } = resolveSchedulingInsert(entry.insertAfter);
11662
+ return !document.querySelector(`[data-ohw-section="${schedulingSectionId(effectiveInsertAfter)}"]`);
12276
11663
  }
12277
11664
  function hasMissingSchedulingWidgets(entries) {
12278
11665
  return entries.some(isSchedulingWidgetMissing);
@@ -12302,17 +11689,16 @@ function initSectionsFromContent(content, removeExisting = false) {
12302
11689
  } catch {
12303
11690
  }
12304
11691
  }
12305
- function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, beforeId, existingWidgetId) {
12306
- const widgetId = existingWidgetId ?? (beforeId ? `${anchorId}${INSERT_BEFORE_MARKER}${beforeId}` : anchorId);
12307
- const sectionId = schedulingSectionId(widgetId);
11692
+ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId, explicitInsertBefore) {
11693
+ const { effectiveInsertAfter, insertBefore } = resolveSchedulingInsert(insertAfter, explicitInsertBefore);
11694
+ const sectionId = schedulingSectionId(effectiveInsertAfter);
12308
11695
  if (document.querySelector(`[data-ohw-section="${sectionId}"]`)) return false;
12309
- const anchorEl = document.querySelector(`[data-ohw-section="${anchorId}"]`);
12310
- if (!anchorEl) return false;
12311
- const mountPoint = anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
11696
+ const mountPoint = getSchedulingMountPoint(effectiveInsertAfter);
11697
+ if (!mountPoint) return false;
12312
11698
  const container = document.createElement("div");
12313
11699
  container.dataset.ohwSectionContainer = "scheduling";
12314
- if (beforeId) {
12315
- const beforeAnchor = document.querySelector(`[data-ohw-section="${beforeId}"]`);
11700
+ if (insertBefore) {
11701
+ const beforeAnchor = document.querySelector(`[data-ohw-section="${insertBefore}"]`);
12316
11702
  const beforePoint = beforeAnchor?.closest('[data-ohw-section-container="scheduling"]') ?? beforeAnchor;
12317
11703
  if (!beforePoint) return false;
12318
11704
  beforePoint.insertAdjacentElement("beforebegin", container);
@@ -12323,25 +11709,19 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
12323
11709
  }
12324
11710
  tail.insertAdjacentElement("afterend", container);
12325
11711
  }
12326
- try {
12327
- const root = (0, import_client2.createRoot)(container);
12328
- (0, import_react_dom3.flushSync)(() => {
12329
- root.render(
12330
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12331
- SchedulingWidget,
12332
- {
12333
- notifyOnConnect,
12334
- initialScheduleId: scheduleId,
12335
- insertAfter: widgetId
12336
- }
12337
- )
12338
- );
12339
- });
12340
- } catch (err) {
12341
- console.error("[ow:scheduling] render threw", err);
12342
- container.remove();
12343
- return false;
12344
- }
11712
+ const root = (0, import_client2.createRoot)(container);
11713
+ (0, import_react_dom3.flushSync)(() => {
11714
+ root.render(
11715
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11716
+ SchedulingWidget,
11717
+ {
11718
+ notifyOnConnect,
11719
+ initialScheduleId: scheduleId,
11720
+ insertAfter: effectiveInsertAfter
11721
+ }
11722
+ )
11723
+ );
11724
+ });
12345
11725
  const tracker = getSectionsTracker();
12346
11726
  let sections = [];
12347
11727
  try {
@@ -12349,12 +11729,10 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
12349
11729
  } catch {
12350
11730
  }
12351
11731
  const inEditor = typeof window !== "undefined" && window.self !== window.top;
12352
- if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === widgetId)) {
11732
+ if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === effectiveInsertAfter)) {
12353
11733
  sections.push({
12354
11734
  type: "scheduling",
12355
- insertAfter: widgetId,
12356
- anchorId,
12357
- beforeId: beforeId ?? null,
11735
+ insertAfter: effectiveInsertAfter,
12358
11736
  pagePath: window.location.pathname,
12359
11737
  ...scheduleId ? { scheduleId } : {}
12360
11738
  });
@@ -12368,8 +11746,7 @@ function mountSchedulingEntries(entries, notifyOnConnect = false) {
12368
11746
  for (let i = pending.length - 1; i >= 0; i--) {
12369
11747
  const entry = pending[i];
12370
11748
  const shouldNotify = typeof notifyOnConnect === "function" ? notifyOnConnect(entry) : notifyOnConnect;
12371
- const { anchorId, beforeId } = resolveEntryAnchor(entry);
12372
- if (mountSchedulingWidget(anchorId, shouldNotify, entry.scheduleId ?? null, beforeId, entry.insertAfter)) {
11749
+ if (mountSchedulingWidget(entry.insertAfter, shouldNotify, entry.scheduleId)) {
12373
11750
  pending.splice(i, 1);
12374
11751
  }
12375
11752
  }
@@ -12383,17 +11760,6 @@ function applyLinkHref(el, val) {
12383
11760
  const anchor = el instanceof HTMLAnchorElement ? el : el.querySelector("a");
12384
11761
  if (anchor) anchor.setAttribute("href", val);
12385
11762
  }
12386
- function currentIconRef(el) {
12387
- const uploaded = el instanceof HTMLImageElement ? el : el.querySelector("img");
12388
- if (uploaded?.getAttribute("src")) {
12389
- return uploaded.getAttribute("src") ?? "";
12390
- }
12391
- const svg = el instanceof SVGElement ? el : el.querySelector("svg");
12392
- const named = Array.from(svg?.classList ?? []).find(
12393
- (c) => c.startsWith("lucide-") && c !== "lucide-icon"
12394
- );
12395
- return named ? `lucide:${named.slice("lucide-".length)}` : "";
12396
- }
12397
11763
  function getEditMeasureEl(editable) {
12398
11764
  return editable.closest("[data-ohw-href-key]") ?? editable;
12399
11765
  }
@@ -12438,11 +11804,8 @@ function isMediaEditable(el) {
12438
11804
  const t = el.dataset.ohwEditable;
12439
11805
  return t === "image" || t === "bg-image" || t === "video";
12440
11806
  }
12441
- function isIconEditable(el) {
12442
- return el.dataset.ohwEditable === "icon";
12443
- }
12444
11807
  var MEDIA_SELECTOR = '[data-ohw-editable="image"], [data-ohw-editable="bg-image"], [data-ohw-editable="video"]';
12445
- var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"]):not([data-ohw-editable="icon"])';
11808
+ var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"])';
12446
11809
  function getVideoEl2(el) {
12447
11810
  return el instanceof HTMLVideoElement ? el : el.querySelector("video");
12448
11811
  }
@@ -12513,13 +11876,6 @@ function isInsideLinkEditor(target) {
12513
11876
  target.closest("[data-ohw-link-popover-root]") || target.closest("[data-ohw-link-modal-root]") || target.closest("[data-ohw-link-page-dropdown]") || target.closest("[data-ohw-section-picker]") || target.closest("[data-ohw-navbar-container-chrome]") || target.closest("[data-ohw-navbar-add-button]") || target.closest("[data-ohw-footer-container-chrome]") || target.closest("[data-ohw-footer-add-button]") || target.closest("[data-ohw-more-menu]") || target.closest('[data-slot="dropdown-menu-content"]') || target.closest('[data-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
12514
11877
  );
12515
11878
  }
12516
- function isInsideFloatingPanel(target) {
12517
- return Boolean(target.closest("[data-ohw-floating-panel]"));
12518
- }
12519
- function isPointOverFloatingPanel(clientX, clientY) {
12520
- const el = document.elementFromPoint(clientX, clientY);
12521
- return Boolean(el instanceof Element && el.closest("[data-ohw-floating-panel]"));
12522
- }
12523
11879
  function getHrefKeyFromElement(el) {
12524
11880
  if (!el) return null;
12525
11881
  const anchor = el.closest("[data-ohw-href-key]");
@@ -12733,7 +12089,7 @@ function getNavigationSelectionParent(el) {
12733
12089
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
12734
12090
  return getFooterLinksContainer();
12735
12091
  }
12736
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup2(el)) {
12092
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
12737
12093
  return getNavigationRoot(el);
12738
12094
  }
12739
12095
  return null;
@@ -12972,7 +12328,7 @@ function EditGlowChrome({
12972
12328
  hideHandle = false
12973
12329
  }) {
12974
12330
  const GAP = SELECTION_CHROME_GAP2;
12975
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
12331
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
12976
12332
  "div",
12977
12333
  {
12978
12334
  ref: elRef,
@@ -12987,7 +12343,7 @@ function EditGlowChrome({
12987
12343
  zIndex: 2147483646
12988
12344
  },
12989
12345
  children: [
12990
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12346
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
12991
12347
  "div",
12992
12348
  {
12993
12349
  style: {
@@ -13000,7 +12356,7 @@ function EditGlowChrome({
13000
12356
  }
13001
12357
  }
13002
12358
  ),
13003
- reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12359
+ reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13004
12360
  "div",
13005
12361
  {
13006
12362
  "data-ohw-drag-handle-container": "",
@@ -13012,7 +12368,7 @@ function EditGlowChrome({
13012
12368
  transform: "translate(calc(-100% - 7px), -50%)",
13013
12369
  pointerEvents: dragDisabled ? "none" : "auto"
13014
12370
  },
13015
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12371
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13016
12372
  DragHandle,
13017
12373
  {
13018
12374
  "aria-label": `Reorder ${reorderHrefKey}`,
@@ -13195,9 +12551,9 @@ function FloatingToolbar({
13195
12551
  showEditLink,
13196
12552
  onEditLink
13197
12553
  }) {
13198
- const localRef = import_react16.default.useRef(null);
13199
- const [measuredW, setMeasuredW] = import_react16.default.useState(330);
13200
- const setRefs = import_react16.default.useCallback(
12554
+ const localRef = import_react15.default.useRef(null);
12555
+ const [measuredW, setMeasuredW] = import_react15.default.useState(330);
12556
+ const setRefs = import_react15.default.useCallback(
13201
12557
  (node) => {
13202
12558
  localRef.current = node;
13203
12559
  if (typeof elRef === "function") elRef(node);
@@ -13209,7 +12565,7 @@ function FloatingToolbar({
13209
12565
  },
13210
12566
  [elRef]
13211
12567
  );
13212
- import_react16.default.useLayoutEffect(() => {
12568
+ import_react15.default.useLayoutEffect(() => {
13213
12569
  const node = localRef.current;
13214
12570
  if (!node) return;
13215
12571
  const update = () => {
@@ -13222,7 +12578,7 @@ function FloatingToolbar({
13222
12578
  return () => ro.disconnect();
13223
12579
  }, [showEditLink, activeCommands]);
13224
12580
  const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
13225
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12581
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13226
12582
  "div",
13227
12583
  {
13228
12584
  ref: setRefs,
@@ -13234,12 +12590,12 @@ function FloatingToolbar({
13234
12590
  zIndex: 2147483647,
13235
12591
  pointerEvents: "auto"
13236
12592
  },
13237
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(CustomToolbar, { children: [
13238
- TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react16.default.Fragment, { children: [
13239
- gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CustomToolbarDivider, {}),
12593
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CustomToolbar, { children: [
12594
+ TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react15.default.Fragment, { children: [
12595
+ gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CustomToolbarDivider, {}),
13240
12596
  btns.map((btn) => {
13241
12597
  const isActive = activeCommands.has(btn.cmd);
13242
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12598
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13243
12599
  CustomToolbarButton,
13244
12600
  {
13245
12601
  title: btn.title,
@@ -13248,7 +12604,7 @@ function FloatingToolbar({
13248
12604
  e.preventDefault();
13249
12605
  onCommand(btn.cmd);
13250
12606
  },
13251
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12607
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13252
12608
  "svg",
13253
12609
  {
13254
12610
  width: "16",
@@ -13269,7 +12625,7 @@ function FloatingToolbar({
13269
12625
  );
13270
12626
  })
13271
12627
  ] }, gi)),
13272
- showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12628
+ showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13273
12629
  CustomToolbarButton,
13274
12630
  {
13275
12631
  type: "button",
@@ -13283,7 +12639,7 @@ function FloatingToolbar({
13283
12639
  e.preventDefault();
13284
12640
  e.stopPropagation();
13285
12641
  },
13286
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react17.Link, { className: "size-4 shrink-0", "aria-hidden": true })
12642
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.Link, { className: "size-4 shrink-0", "aria-hidden": true })
13287
12643
  }
13288
12644
  ) : null
13289
12645
  ] })
@@ -13300,7 +12656,7 @@ function StateToggle({
13300
12656
  states,
13301
12657
  onStateChange
13302
12658
  }) {
13303
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
12659
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13304
12660
  ToggleGroup,
13305
12661
  {
13306
12662
  "data-ohw-state-toggle": "",
@@ -13314,12 +12670,11 @@ function StateToggle({
13314
12670
  left: rect.right - 8,
13315
12671
  transform: "translateX(-100%)"
13316
12672
  },
13317
- children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
12673
+ children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
13318
12674
  }
13319
12675
  );
13320
12676
  }
13321
12677
  var contentCache = /* @__PURE__ */ new Map();
13322
- var fetchedContentPaths = /* @__PURE__ */ new Set();
13323
12678
  function resolveSubdomain(subdomainFromQuery) {
13324
12679
  if (subdomainFromQuery) return subdomainFromQuery;
13325
12680
  if (typeof window !== "undefined") {
@@ -13342,8 +12697,8 @@ function OhhwellsBridge() {
13342
12697
  const router = (0, import_navigation3.useRouter)();
13343
12698
  const searchParams = (0, import_navigation3.useSearchParams)();
13344
12699
  const isEditMode = isEditSessionActive();
13345
- const [bridgeRoot, setBridgeRoot] = (0, import_react16.useState)(null);
13346
- (0, import_react16.useEffect)(() => {
12700
+ const [bridgeRoot, setBridgeRoot] = (0, import_react15.useState)(null);
12701
+ (0, import_react15.useEffect)(() => {
13347
12702
  const figtreeFontId = "ohw-figtree-font";
13348
12703
  if (!document.getElementById(figtreeFontId)) {
13349
12704
  const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
@@ -13372,134 +12727,110 @@ function OhhwellsBridge() {
13372
12727
  const subdomain = resolveSubdomain(subdomainFromQuery);
13373
12728
  useLinkHrefGuardian(pathname, subdomain, isEditMode);
13374
12729
  useSavedLinkNavigation(isEditMode);
13375
- const postToParent2 = (0, import_react16.useCallback)((data) => {
12730
+ const postToParent2 = (0, import_react15.useCallback)((data) => {
13376
12731
  if (typeof window !== "undefined" && window.parent !== window) {
13377
12732
  window.parent.postMessage(data, "*");
13378
12733
  }
13379
12734
  }, []);
13380
- const [fetchState, setFetchState] = (0, import_react16.useState)("idle");
13381
- const autoSaveTimers = (0, import_react16.useRef)(/* @__PURE__ */ new Map());
13382
- const activeElRef = (0, import_react16.useRef)(null);
13383
- const pointerHeldRef = (0, import_react16.useRef)(false);
13384
- const selectedElRef = (0, import_react16.useRef)(null);
13385
- const selectedHrefKeyRef = (0, import_react16.useRef)(null);
13386
- const selectedFooterColAttrRef = (0, import_react16.useRef)(null);
13387
- const originalContentRef = (0, import_react16.useRef)(null);
13388
- const activeStateElRef = (0, import_react16.useRef)(null);
13389
- const parentScrollRef = (0, import_react16.useRef)(null);
13390
- const visibleViewportRef = (0, import_react16.useRef)(null);
13391
- const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react16.useState)(null);
13392
- const attachVisibleViewport = (0, import_react16.useCallback)((node) => {
12735
+ const [fetchState, setFetchState] = (0, import_react15.useState)("idle");
12736
+ const autoSaveTimers = (0, import_react15.useRef)(/* @__PURE__ */ new Map());
12737
+ const activeElRef = (0, import_react15.useRef)(null);
12738
+ const pointerHeldRef = (0, import_react15.useRef)(false);
12739
+ const selectedElRef = (0, import_react15.useRef)(null);
12740
+ const selectedHrefKeyRef = (0, import_react15.useRef)(null);
12741
+ const selectedFooterColAttrRef = (0, import_react15.useRef)(null);
12742
+ const originalContentRef = (0, import_react15.useRef)(null);
12743
+ const activeStateElRef = (0, import_react15.useRef)(null);
12744
+ const parentScrollRef = (0, import_react15.useRef)(null);
12745
+ const visibleViewportRef = (0, import_react15.useRef)(null);
12746
+ const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react15.useState)(null);
12747
+ const attachVisibleViewport = (0, import_react15.useCallback)((node) => {
13393
12748
  visibleViewportRef.current = node;
13394
12749
  setDialogPortalContainer(node);
13395
12750
  if (node) applyVisibleViewport(node, parentScrollRef.current);
13396
12751
  }, []);
13397
- const toolbarElRef = (0, import_react16.useRef)(null);
13398
- const glowElRef = (0, import_react16.useRef)(null);
13399
- const hoveredImageRef = (0, import_react16.useRef)(null);
13400
- const hoveredImageHasTextOverlapRef = (0, import_react16.useRef)(false);
13401
- const dragOverElRef = (0, import_react16.useRef)(null);
13402
- const [mediaHover, setMediaHover] = (0, import_react16.useState)(null);
13403
- const [carouselHover, setCarouselHover] = (0, import_react16.useState)(null);
13404
- const [uploadingRects, setUploadingRects] = (0, import_react16.useState)({});
13405
- const hoveredGapRef = (0, import_react16.useRef)(null);
13406
- const imageUnhoverTimerRef = (0, import_react16.useRef)(null);
13407
- const imageShowTimerRef = (0, import_react16.useRef)(null);
13408
- const editStylesRef = (0, import_react16.useRef)(null);
13409
- const activateRef = (0, import_react16.useRef)(() => {
12752
+ const toolbarElRef = (0, import_react15.useRef)(null);
12753
+ const glowElRef = (0, import_react15.useRef)(null);
12754
+ const hoveredImageRef = (0, import_react15.useRef)(null);
12755
+ const hoveredImageHasTextOverlapRef = (0, import_react15.useRef)(false);
12756
+ const dragOverElRef = (0, import_react15.useRef)(null);
12757
+ const [mediaHover, setMediaHover] = (0, import_react15.useState)(null);
12758
+ const [carouselHover, setCarouselHover] = (0, import_react15.useState)(null);
12759
+ const [uploadingRects, setUploadingRects] = (0, import_react15.useState)({});
12760
+ const hoveredGapRef = (0, import_react15.useRef)(null);
12761
+ const imageUnhoverTimerRef = (0, import_react15.useRef)(null);
12762
+ const imageShowTimerRef = (0, import_react15.useRef)(null);
12763
+ const editStylesRef = (0, import_react15.useRef)(null);
12764
+ const activateRef = (0, import_react15.useRef)(() => {
13410
12765
  });
13411
- const deactivateRef = (0, import_react16.useRef)(() => {
12766
+ const deactivateRef = (0, import_react15.useRef)(() => {
13412
12767
  });
13413
- const selectRef = (0, import_react16.useRef)(() => {
12768
+ const selectRef = (0, import_react15.useRef)(() => {
13414
12769
  });
13415
- const selectFrameRef = (0, import_react16.useRef)(() => {
12770
+ const selectFrameRef = (0, import_react15.useRef)(() => {
13416
12771
  });
13417
- const selectLogoRef = (0, import_react16.useRef)(() => {
12772
+ const deselectRef = (0, import_react15.useRef)(() => {
13418
12773
  });
13419
- const openLogoSizePanelRef = (0, import_react16.useRef)(() => {
12774
+ const reselectNavigationItemRef = (0, import_react15.useRef)(() => {
13420
12775
  });
13421
- const deselectRef = (0, import_react16.useRef)(() => {
12776
+ const commitNavigationTextEditRef = (0, import_react15.useRef)(() => {
13422
12777
  });
13423
- const closeFloatingPanelOnlyRef = (0, import_react16.useRef)(() => {
12778
+ const handleDeleteSelectedRef = (0, import_react15.useRef)(() => false);
12779
+ const runPendingDeleteUndoRef = (0, import_react15.useRef)(() => false);
12780
+ const isFooterFrameSelectionRef = (0, import_react15.useRef)(false);
12781
+ const refreshActiveCommandsRef = (0, import_react15.useRef)(() => {
13424
12782
  });
13425
- const reselectNavigationItemRef = (0, import_react16.useRef)(() => {
13426
- });
13427
- const commitNavigationTextEditRef = (0, import_react16.useRef)(() => {
13428
- });
13429
- const handleDeleteSelectedRef = (0, import_react16.useRef)(() => false);
13430
- const runPendingDeleteUndoRef = (0, import_react16.useRef)(() => false);
13431
- const isFooterFrameSelectionRef = (0, import_react16.useRef)(false);
13432
- const refreshActiveCommandsRef = (0, import_react16.useRef)(() => {
13433
- });
13434
- const postToParentRef = (0, import_react16.useRef)(postToParent2);
12783
+ const postToParentRef = (0, import_react15.useRef)(postToParent2);
13435
12784
  postToParentRef.current = postToParent2;
13436
- const aiSectionApiRef = (0, import_react16.useRef)(null);
13437
- const sectionsLoadedRef = (0, import_react16.useRef)(false);
13438
- const pendingScheduleConfigRequests = (0, import_react16.useRef)([]);
13439
- const [toolbarRect, setToolbarRect] = (0, import_react16.useState)(null);
13440
- const [toolbarVariant, setToolbarVariant] = (0, import_react16.useState)("none");
13441
- const toolbarVariantRef = (0, import_react16.useRef)("none");
12785
+ const aiSectionApiRef = (0, import_react15.useRef)(null);
12786
+ const sectionsLoadedRef = (0, import_react15.useRef)(false);
12787
+ const pendingScheduleConfigRequests = (0, import_react15.useRef)([]);
12788
+ const [toolbarRect, setToolbarRect] = (0, import_react15.useState)(null);
12789
+ const [toolbarVariant, setToolbarVariant] = (0, import_react15.useState)("none");
12790
+ const toolbarVariantRef = (0, import_react15.useRef)("none");
13442
12791
  toolbarVariantRef.current = toolbarVariant;
13443
- const [selectedIsCta, setSelectedIsCta] = (0, import_react16.useState)(false);
13444
- const [reorderHrefKey, setReorderHrefKey] = (0, import_react16.useState)(null);
13445
- const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react16.useState)(false);
13446
- const [toggleState, setToggleState] = (0, import_react16.useState)(null);
13447
- const [maxBadge, setMaxBadge] = (0, import_react16.useState)(null);
13448
- const [activeCommands, setActiveCommands] = (0, import_react16.useState)(/* @__PURE__ */ new Set());
13449
- const [sectionGap, setSectionGap] = (0, import_react16.useState)(null);
13450
- const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react16.useState)(false);
13451
- const hoveredNavContainerRef = (0, import_react16.useRef)(null);
13452
- const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react16.useState)(null);
13453
- const hoveredItemElRef = (0, import_react16.useRef)(null);
13454
- const [hoveredItemRect, setHoveredItemRect] = (0, import_react16.useState)(null);
13455
- const siblingHintElRef = (0, import_react16.useRef)(null);
13456
- const [siblingHintRect, setSiblingHintRect] = (0, import_react16.useState)(null);
13457
- const [siblingHintRects, setSiblingHintRects] = (0, import_react16.useState)([]);
13458
- const [isItemDragging, setIsItemDragging] = (0, import_react16.useState)(false);
13459
- const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react16.useState)(false);
12792
+ const [selectedIsCta, setSelectedIsCta] = (0, import_react15.useState)(false);
12793
+ const [reorderHrefKey, setReorderHrefKey] = (0, import_react15.useState)(null);
12794
+ const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react15.useState)(false);
12795
+ const [toggleState, setToggleState] = (0, import_react15.useState)(null);
12796
+ const [maxBadge, setMaxBadge] = (0, import_react15.useState)(null);
12797
+ const [activeCommands, setActiveCommands] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
12798
+ const [sectionGap, setSectionGap] = (0, import_react15.useState)(null);
12799
+ const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react15.useState)(false);
12800
+ const hoveredNavContainerRef = (0, import_react15.useRef)(null);
12801
+ const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react15.useState)(null);
12802
+ const hoveredItemElRef = (0, import_react15.useRef)(null);
12803
+ const [hoveredItemRect, setHoveredItemRect] = (0, import_react15.useState)(null);
12804
+ const siblingHintElRef = (0, import_react15.useRef)(null);
12805
+ const [siblingHintRect, setSiblingHintRect] = (0, import_react15.useState)(null);
12806
+ const [siblingHintRects, setSiblingHintRects] = (0, import_react15.useState)([]);
12807
+ const [isItemDragging, setIsItemDragging] = (0, import_react15.useState)(false);
12808
+ const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react15.useState)(false);
13460
12809
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
13461
- const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react16.useState)(null);
13462
- const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react16.useState)(null);
13463
- const footerDragRef = (0, import_react16.useRef)(null);
13464
- const [footerDropSlots, setFooterDropSlots] = (0, import_react16.useState)([]);
13465
- const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react16.useState)(null);
13466
- const [draggedItemRect, setDraggedItemRect] = (0, import_react16.useState)(null);
13467
- const footerPointerDragRef = (0, import_react16.useRef)(null);
13468
- const suppressNextClickRef = (0, import_react16.useRef)(false);
13469
- const suppressClickUntilRef = (0, import_react16.useRef)(0);
13470
- const [linkPopover, setLinkPopover] = (0, import_react16.useState)(null);
13471
- const linkPopoverSessionRef = (0, import_react16.useRef)(null);
13472
- const addNavAfterAnchorRef = (0, import_react16.useRef)(null);
13473
- const editContentRef = (0, import_react16.useRef)({});
13474
- const aiSectionsRef = (0, import_react16.useRef)("");
13475
- const pendingDeleteUndoRef = (0, import_react16.useRef)(null);
13476
- const [floatingPanel, setFloatingPanel] = (0, import_react16.useState)(null);
13477
- const floatingPanelOpenRef = (0, import_react16.useRef)(false);
13478
- const setFloatingPanelRef = (0, import_react16.useRef)(setFloatingPanel);
13479
- const [floatingPanelPos, setFloatingPanelPos] = (0, import_react16.useState)(null);
13480
- const [logoSizeDraft, setLogoSizeDraft] = (0, import_react16.useState)(null);
13481
- const [editorViewport, setEditorViewport] = (0, import_react16.useState)("desktop");
13482
- const [parentScrollSnap, setParentScrollSnap] = (0, import_react16.useState)(null);
13483
- const [sitePages, setSitePages] = (0, import_react16.useState)([]);
13484
- const [sectionsByPath, setSectionsByPath] = (0, import_react16.useState)({});
13485
- const sectionsPrefetchGenRef = (0, import_react16.useRef)(0);
13486
- const setLinkPopoverRef = (0, import_react16.useRef)(setLinkPopover);
13487
- const linkPopoverPanelRef = (0, import_react16.useRef)(null);
13488
- const linkPopoverOpenRef = (0, import_react16.useRef)(false);
13489
- const linkPopoverGraceUntilRef = (0, import_react16.useRef)(0);
12810
+ const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react15.useState)(null);
12811
+ const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react15.useState)(null);
12812
+ const footerDragRef = (0, import_react15.useRef)(null);
12813
+ const [footerDropSlots, setFooterDropSlots] = (0, import_react15.useState)([]);
12814
+ const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react15.useState)(null);
12815
+ const [draggedItemRect, setDraggedItemRect] = (0, import_react15.useState)(null);
12816
+ const footerPointerDragRef = (0, import_react15.useRef)(null);
12817
+ const suppressNextClickRef = (0, import_react15.useRef)(false);
12818
+ const suppressClickUntilRef = (0, import_react15.useRef)(0);
12819
+ const [linkPopover, setLinkPopover] = (0, import_react15.useState)(null);
12820
+ const linkPopoverSessionRef = (0, import_react15.useRef)(null);
12821
+ const addNavAfterAnchorRef = (0, import_react15.useRef)(null);
12822
+ const editContentRef = (0, import_react15.useRef)({});
12823
+ const aiSectionsRef = (0, import_react15.useRef)("");
12824
+ const pendingDeleteUndoRef = (0, import_react15.useRef)(null);
12825
+ const [sitePages, setSitePages] = (0, import_react15.useState)([]);
12826
+ const [sectionsByPath, setSectionsByPath] = (0, import_react15.useState)({});
12827
+ const sectionsPrefetchGenRef = (0, import_react15.useRef)(0);
12828
+ const setLinkPopoverRef = (0, import_react15.useRef)(setLinkPopover);
12829
+ const linkPopoverPanelRef = (0, import_react15.useRef)(null);
12830
+ const linkPopoverOpenRef = (0, import_react15.useRef)(false);
12831
+ const linkPopoverGraceUntilRef = (0, import_react15.useRef)(0);
13490
12832
  setLinkPopoverRef.current = setLinkPopover;
13491
- setFloatingPanelRef.current = setFloatingPanel;
13492
12833
  linkPopoverSessionRef.current = linkPopover;
13493
- floatingPanelOpenRef.current = Boolean(floatingPanel);
13494
- (0, import_react16.useEffect)(() => {
13495
- const syncViewport = () => {
13496
- const next = window.innerWidth <= 480 ? "mobile" : "desktop";
13497
- setEditorViewport((prev) => prev === next ? prev : next);
13498
- };
13499
- syncViewport();
13500
- window.addEventListener("resize", syncViewport);
13501
- return () => window.removeEventListener("resize", syncViewport);
13502
- }, []);
13503
12834
  const {
13504
12835
  navDragRef,
13505
12836
  navDropSlots,
@@ -13535,7 +12866,7 @@ function OhhwellsBridge() {
13535
12866
  const bumpLinkPopoverGrace = () => {
13536
12867
  linkPopoverGraceUntilRef.current = Date.now() + 350;
13537
12868
  };
13538
- const runSectionsPrefetch = (0, import_react16.useCallback)((pages) => {
12869
+ const runSectionsPrefetch = (0, import_react15.useCallback)((pages) => {
13539
12870
  if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
13540
12871
  const gen = ++sectionsPrefetchGenRef.current;
13541
12872
  const paths = pages.map((p) => p.path);
@@ -13554,9 +12885,9 @@ function OhhwellsBridge() {
13554
12885
  );
13555
12886
  });
13556
12887
  }, [isEditMode, pathname]);
13557
- const runSectionsPrefetchRef = (0, import_react16.useRef)(runSectionsPrefetch);
12888
+ const runSectionsPrefetchRef = (0, import_react15.useRef)(runSectionsPrefetch);
13558
12889
  runSectionsPrefetchRef.current = runSectionsPrefetch;
13559
- (0, import_react16.useEffect)(() => {
12890
+ (0, import_react15.useEffect)(() => {
13560
12891
  if (!linkPopover) {
13561
12892
  document.documentElement.removeAttribute("data-ohw-link-popover-open");
13562
12893
  return;
@@ -13584,7 +12915,7 @@ function OhhwellsBridge() {
13584
12915
  document.documentElement.removeAttribute("data-ohw-link-popover-open");
13585
12916
  };
13586
12917
  }, [linkPopover, postToParent2]);
13587
- (0, import_react16.useEffect)(() => {
12918
+ (0, import_react15.useEffect)(() => {
13588
12919
  if (!isEditMode) return;
13589
12920
  const useFixtures = shouldUseDevFixtures();
13590
12921
  if (useFixtures) {
@@ -13608,14 +12939,14 @@ function OhhwellsBridge() {
13608
12939
  if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
13609
12940
  return () => window.removeEventListener("message", onSitePages);
13610
12941
  }, [isEditMode, postToParent2]);
13611
- (0, import_react16.useEffect)(() => {
12942
+ (0, import_react15.useEffect)(() => {
13612
12943
  if (!isEditMode || shouldUseDevFixtures()) return;
13613
12944
  void loadAllSectionsManifest().then((manifest) => {
13614
12945
  if (Object.keys(manifest).length === 0) return;
13615
12946
  setSectionsByPath((prev) => ({ ...manifest, ...prev }));
13616
12947
  });
13617
12948
  }, [isEditMode]);
13618
- (0, import_react16.useEffect)(() => {
12949
+ (0, import_react15.useEffect)(() => {
13619
12950
  const update = () => {
13620
12951
  const el = activeElRef.current ?? selectedElRef.current;
13621
12952
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
@@ -13639,10 +12970,10 @@ function OhhwellsBridge() {
13639
12970
  vvp.removeEventListener("resize", update);
13640
12971
  };
13641
12972
  }, []);
13642
- const refreshStateRules = (0, import_react16.useCallback)(() => {
12973
+ const refreshStateRules = (0, import_react15.useCallback)(() => {
13643
12974
  editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
13644
12975
  }, []);
13645
- const processConfigRequest = (0, import_react16.useCallback)((insertAfterVal) => {
12976
+ const processConfigRequest = (0, import_react15.useCallback)((insertAfterVal) => {
13646
12977
  const tracker = getSectionsTracker();
13647
12978
  let entries = [];
13648
12979
  try {
@@ -13665,7 +12996,7 @@ function OhhwellsBridge() {
13665
12996
  }
13666
12997
  window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
13667
12998
  }, [isEditMode]);
13668
- const deactivate = (0, import_react16.useCallback)(() => {
12999
+ const deactivate = (0, import_react15.useCallback)(() => {
13669
13000
  const el = activeElRef.current;
13670
13001
  if (!el) return;
13671
13002
  const key = el.dataset.ohwKey;
@@ -13698,12 +13029,12 @@ function OhhwellsBridge() {
13698
13029
  setToolbarShowEditLink(false);
13699
13030
  postToParent2({ type: "ow:exit-edit" });
13700
13031
  }, [postToParent2]);
13701
- const clearSelectedAttr = (0, import_react16.useCallback)(() => {
13032
+ const clearSelectedAttr = (0, import_react15.useCallback)(() => {
13702
13033
  document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
13703
13034
  el.removeAttribute("data-ohw-selected");
13704
13035
  });
13705
13036
  }, []);
13706
- const deselect = (0, import_react16.useCallback)(() => {
13037
+ const deselect = (0, import_react15.useCallback)(() => {
13707
13038
  clearSelectedAttr();
13708
13039
  selectedElRef.current = null;
13709
13040
  selectedHrefKeyRef.current = null;
@@ -13720,21 +13051,17 @@ function OhhwellsBridge() {
13720
13051
  setIsItemDragging(false);
13721
13052
  hoveredNavContainerRef.current = null;
13722
13053
  setHoveredNavContainerRect(null);
13723
- hoveredItemElRef.current = null;
13724
- setHoveredItemRect(null);
13725
- setFloatingPanel(null);
13726
- setLogoSizeDraft(null);
13727
13054
  if (!activeElRef.current) {
13728
13055
  setNavGroupForceOpen(null, false);
13729
13056
  setToolbarRect(null);
13730
13057
  setToolbarVariant("none");
13731
13058
  }
13732
13059
  }, [clearSelectedAttr]);
13733
- const markSelected = (0, import_react16.useCallback)((el) => {
13060
+ const markSelected = (0, import_react15.useCallback)((el) => {
13734
13061
  clearSelectedAttr();
13735
13062
  el.setAttribute("data-ohw-selected", "");
13736
13063
  }, [clearSelectedAttr]);
13737
- const resolveHrefKeyElement = (0, import_react16.useCallback)((hrefKey) => {
13064
+ const resolveHrefKeyElement = (0, import_react15.useCallback)((hrefKey) => {
13738
13065
  if (isFooterHrefKey(hrefKey)) {
13739
13066
  return document.querySelector(
13740
13067
  `footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
@@ -13749,7 +13076,7 @@ function OhhwellsBridge() {
13749
13076
  `[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
13750
13077
  );
13751
13078
  }, []);
13752
- const resyncSelectedNavigationItem = (0, import_react16.useCallback)(() => {
13079
+ const resyncSelectedNavigationItem = (0, import_react15.useCallback)(() => {
13753
13080
  const hrefKey = selectedHrefKeyRef.current;
13754
13081
  if (hrefKey) {
13755
13082
  const link = resolveHrefKeyElement(hrefKey);
@@ -13787,7 +13114,7 @@ function OhhwellsBridge() {
13787
13114
  );
13788
13115
  }
13789
13116
  }, [resolveHrefKeyElement]);
13790
- const reselectNavigationItem = (0, import_react16.useCallback)((navAnchor) => {
13117
+ const reselectNavigationItem = (0, import_react15.useCallback)((navAnchor) => {
13791
13118
  selectedElRef.current = navAnchor;
13792
13119
  selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
13793
13120
  selectedFooterColAttrRef.current = null;
@@ -13816,7 +13143,7 @@ function OhhwellsBridge() {
13816
13143
  setToolbarShowEditLink(false);
13817
13144
  setActiveCommands(/* @__PURE__ */ new Set());
13818
13145
  }, [markSelected]);
13819
- const commitNavigationTextEdit = (0, import_react16.useCallback)((navAnchor) => {
13146
+ const commitNavigationTextEdit = (0, import_react15.useCallback)((navAnchor) => {
13820
13147
  const el = activeElRef.current;
13821
13148
  if (!el) return;
13822
13149
  const key = el.dataset.ohwKey;
@@ -13843,7 +13170,7 @@ function OhhwellsBridge() {
13843
13170
  postToParent2({ type: "ow:exit-edit" });
13844
13171
  reselectNavigationItem(navAnchor);
13845
13172
  }, [postToParent2, reselectNavigationItem]);
13846
- const handleAddTopLevelNavItem = (0, import_react16.useCallback)(() => {
13173
+ const handleAddTopLevelNavItem = (0, import_react15.useCallback)(() => {
13847
13174
  const items = listNavbarRootItems();
13848
13175
  addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
13849
13176
  deselectRef.current();
@@ -13855,7 +13182,7 @@ function OhhwellsBridge() {
13855
13182
  intent: "add-nav"
13856
13183
  });
13857
13184
  }, []);
13858
- const maybeWarnNavLinkDropdownConflict = (0, import_react16.useCallback)(
13185
+ const maybeWarnNavLinkDropdownConflict = (0, import_react15.useCallback)(
13859
13186
  (anchor) => {
13860
13187
  if (!isNavbarHrefKey(anchor.getAttribute("data-ohw-href-key"))) return;
13861
13188
  if (!navDropdownsOpenOnClick()) return;
@@ -13868,7 +13195,7 @@ function OhhwellsBridge() {
13868
13195
  },
13869
13196
  [postToParent2]
13870
13197
  );
13871
- const handleNavDropdownOpenChange = (0, import_react16.useCallback)((open) => {
13198
+ const handleNavDropdownOpenChange = (0, import_react15.useCallback)((open) => {
13872
13199
  const selected = selectedElRef.current;
13873
13200
  if (!selected || !isNavigationItem2(selected)) return;
13874
13201
  setNavGroupForceOpen(selected, open);
@@ -13880,7 +13207,7 @@ function OhhwellsBridge() {
13880
13207
  }
13881
13208
  });
13882
13209
  }, []);
13883
- const handleFooterHeadingVisibleChange = (0, import_react16.useCallback)(
13210
+ const handleFooterHeadingVisibleChange = (0, import_react15.useCallback)(
13884
13211
  (visible) => {
13885
13212
  const selected = selectedElRef.current;
13886
13213
  if (!selected || !isFooterFrameSelectionRef.current) return;
@@ -13904,7 +13231,7 @@ function OhhwellsBridge() {
13904
13231
  },
13905
13232
  [postToParent2]
13906
13233
  );
13907
- const enterEditOnNewItem = (0, import_react16.useCallback)((anchor) => {
13234
+ const enterEditOnNewItem = (0, import_react15.useCallback)((anchor) => {
13908
13235
  const label = anchor.querySelector('[data-ohw-editable="text"]');
13909
13236
  if (!label) {
13910
13237
  selectRef.current(anchor);
@@ -13913,7 +13240,7 @@ function OhhwellsBridge() {
13913
13240
  setNavGroupForceOpen(anchor, true);
13914
13241
  activateRef.current(label);
13915
13242
  }, []);
13916
- const handleAddChildItem = (0, import_react16.useCallback)(() => {
13243
+ const handleAddChildItem = (0, import_react15.useCallback)(() => {
13917
13244
  const selected = selectedElRef.current;
13918
13245
  if (!selected) return;
13919
13246
  if (toolbarVariantRef.current === "select-frame" && isFooterFrameSelection) {
@@ -13989,7 +13316,7 @@ function OhhwellsBridge() {
13989
13316
  enterEditOnNewItem(result.anchor);
13990
13317
  });
13991
13318
  }, [enterEditOnNewItem, isFooterFrameSelection, maybeWarnNavLinkDropdownConflict, postToParent2]);
13992
- const handleAddFooterColumn = (0, import_react16.useCallback)(() => {
13319
+ const handleAddFooterColumn = (0, import_react15.useCallback)(() => {
13993
13320
  if (!canAddFooterColumn()) {
13994
13321
  postToParent2({
13995
13322
  type: "ow:toast",
@@ -14010,7 +13337,7 @@ function OhhwellsBridge() {
14010
13337
  selectRef.current(result.firstLink);
14011
13338
  });
14012
13339
  }, [postToParent2]);
14013
- const clearFooterDragVisuals = (0, import_react16.useCallback)(() => {
13340
+ const clearFooterDragVisuals = (0, import_react15.useCallback)(() => {
14014
13341
  footerDragRef.current = null;
14015
13342
  setSiblingHintRects([]);
14016
13343
  setFooterDropSlots([]);
@@ -14019,7 +13346,7 @@ function OhhwellsBridge() {
14019
13346
  setIsItemDragging(false);
14020
13347
  unlockFooterDragInteraction();
14021
13348
  }, []);
14022
- const refreshFooterDragVisuals = (0, import_react16.useCallback)((session, activeSlot, clientX, clientY) => {
13349
+ const refreshFooterDragVisuals = (0, import_react15.useCallback)((session, activeSlot, clientX, clientY) => {
14023
13350
  const dragged = session.draggedEl;
14024
13351
  setDraggedItemRect(dragged.getBoundingClientRect());
14025
13352
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -14044,13 +13371,13 @@ function OhhwellsBridge() {
14044
13371
  const activeIdx = activeSlot ? slots.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
14045
13372
  setActiveFooterDropIndex(activeIdx >= 0 ? activeIdx : null);
14046
13373
  }, []);
14047
- const refreshFooterDragVisualsRef = (0, import_react16.useRef)(refreshFooterDragVisuals);
13374
+ const refreshFooterDragVisualsRef = (0, import_react15.useRef)(refreshFooterDragVisuals);
14048
13375
  refreshFooterDragVisualsRef.current = refreshFooterDragVisuals;
14049
- const commitFooterDragRef = (0, import_react16.useRef)(() => {
13376
+ const commitFooterDragRef = (0, import_react15.useRef)(() => {
14050
13377
  });
14051
- const beginFooterDragRef = (0, import_react16.useRef)(() => {
13378
+ const beginFooterDragRef = (0, import_react15.useRef)(() => {
14052
13379
  });
14053
- const beginFooterDrag = (0, import_react16.useCallback)(
13380
+ const beginFooterDrag = (0, import_react15.useCallback)(
14054
13381
  (session) => {
14055
13382
  const rect = session.draggedEl.getBoundingClientRect();
14056
13383
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -14070,7 +13397,7 @@ function OhhwellsBridge() {
14070
13397
  [refreshFooterDragVisuals]
14071
13398
  );
14072
13399
  beginFooterDragRef.current = beginFooterDrag;
14073
- const commitFooterDrag = (0, import_react16.useCallback)(
13400
+ const commitFooterDrag = (0, import_react15.useCallback)(
14074
13401
  (clientX, clientY) => {
14075
13402
  const session = footerDragRef.current;
14076
13403
  if (!session) {
@@ -14174,7 +13501,7 @@ function OhhwellsBridge() {
14174
13501
  [clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
14175
13502
  );
14176
13503
  commitFooterDragRef.current = commitFooterDrag;
14177
- const startFooterLinkDrag = (0, import_react16.useCallback)(
13504
+ const startFooterLinkDrag = (0, import_react15.useCallback)(
14178
13505
  (anchor, clientX, clientY, wasSelected) => {
14179
13506
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
14180
13507
  if (!hrefKey || !isFooterHrefKey(hrefKey)) return false;
@@ -14195,7 +13522,7 @@ function OhhwellsBridge() {
14195
13522
  },
14196
13523
  [beginFooterDrag]
14197
13524
  );
14198
- const startFooterColumnDrag = (0, import_react16.useCallback)(
13525
+ const startFooterColumnDrag = (0, import_react15.useCallback)(
14199
13526
  (columnEl, clientX, clientY, wasSelected) => {
14200
13527
  const columns = listFooterColumns();
14201
13528
  const idx = columns.indexOf(columnEl);
@@ -14215,7 +13542,7 @@ function OhhwellsBridge() {
14215
13542
  },
14216
13543
  [beginFooterDrag]
14217
13544
  );
14218
- const handleItemDragStart = (0, import_react16.useCallback)(
13545
+ const handleItemDragStart = (0, import_react15.useCallback)(
14219
13546
  (e) => {
14220
13547
  const selected = selectedElRef.current;
14221
13548
  if (!selected) {
@@ -14235,7 +13562,7 @@ function OhhwellsBridge() {
14235
13562
  },
14236
13563
  [startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag]
14237
13564
  );
14238
- const handleItemDragEnd = (0, import_react16.useCallback)(
13565
+ const handleItemDragEnd = (0, import_react15.useCallback)(
14239
13566
  (e) => {
14240
13567
  if (footerDragRef.current) {
14241
13568
  const x = e?.clientX;
@@ -14261,7 +13588,7 @@ function OhhwellsBridge() {
14261
13588
  },
14262
13589
  [commitFooterDrag, commitNavDrag, navDragRef]
14263
13590
  );
14264
- const handleItemChromePointerDown = (0, import_react16.useCallback)((e) => {
13591
+ const handleItemChromePointerDown = (0, import_react15.useCallback)((e) => {
14265
13592
  if (e.button !== 0) return;
14266
13593
  const selected = selectedElRef.current;
14267
13594
  if (!selected) return;
@@ -14292,7 +13619,7 @@ function OhhwellsBridge() {
14292
13619
  }
14293
13620
  if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
14294
13621
  }, [armNavPressFromChrome]);
14295
- const handleItemChromeClick = (0, import_react16.useCallback)((clientX, clientY) => {
13622
+ const handleItemChromeClick = (0, import_react15.useCallback)((clientX, clientY) => {
14296
13623
  if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
14297
13624
  suppressNextClickRef.current = false;
14298
13625
  return;
@@ -14305,7 +13632,7 @@ function OhhwellsBridge() {
14305
13632
  }, []);
14306
13633
  reselectNavigationItemRef.current = reselectNavigationItem;
14307
13634
  commitNavigationTextEditRef.current = commitNavigationTextEdit;
14308
- const select = (0, import_react16.useCallback)((anchor) => {
13635
+ const select = (0, import_react15.useCallback)((anchor) => {
14309
13636
  if (!isNavigationItem2(anchor)) return;
14310
13637
  if (activeElRef.current) deactivate();
14311
13638
  aiSectionApiRef.current?.selectFromElement(anchor);
@@ -14343,10 +13670,8 @@ function OhhwellsBridge() {
14343
13670
  setToolbarRect(anchor.getBoundingClientRect());
14344
13671
  setToolbarShowEditLink(false);
14345
13672
  setActiveCommands(/* @__PURE__ */ new Set());
14346
- setFloatingPanel(null);
14347
- setLogoSizeDraft(null);
14348
13673
  }, [deactivate, markSelected]);
14349
- const selectFrame = (0, import_react16.useCallback)((el) => {
13674
+ const selectFrame = (0, import_react15.useCallback)((el) => {
14350
13675
  if (!isNavigationContainer(el)) return;
14351
13676
  if (activeElRef.current) deactivate();
14352
13677
  aiSectionApiRef.current?.selectFromElement(el);
@@ -14392,99 +13717,8 @@ function OhhwellsBridge() {
14392
13717
  setToolbarRect(el.getBoundingClientRect());
14393
13718
  setToolbarShowEditLink(false);
14394
13719
  setActiveCommands(/* @__PURE__ */ new Set());
14395
- setFloatingPanel(null);
14396
- setLogoSizeDraft(null);
14397
13720
  }, [deactivate, markSelected, postToParent2]);
14398
- const selectLogo = (0, import_react16.useCallback)(
14399
- (logoEl) => {
14400
- if (activeElRef.current) deactivate();
14401
- selectedElRef.current = logoEl;
14402
- selectedHrefKeyRef.current = null;
14403
- selectedFooterColAttrRef.current = null;
14404
- markSelected(logoEl);
14405
- setSelectedIsCta(false);
14406
- clearHrefKeyHover(logoEl);
14407
- hoveredNavContainerRef.current = null;
14408
- setHoveredNavContainerRect(null);
14409
- setHoveredItemRect(null);
14410
- hoveredItemElRef.current = null;
14411
- siblingHintElRef.current = null;
14412
- setSiblingHintRect(null);
14413
- setSiblingHintRects([]);
14414
- setIsItemDragging(false);
14415
- setReorderHrefKey(null);
14416
- setReorderDragDisabled(false);
14417
- setIsFooterFrameSelection(false);
14418
- setToolbarVariant("logo");
14419
- setToolbarRect(getLogoInteractionRect(logoEl));
14420
- setToolbarShowEditLink(false);
14421
- setActiveCommands(/* @__PURE__ */ new Set());
14422
- },
14423
- [deactivate, markSelected]
14424
- );
14425
- const openLogoSizePanel = (0, import_react16.useCallback)((logoEl) => {
14426
- const placement = getLogoPlacement(logoEl);
14427
- const draft = readLogoSizeState(editContentRef.current, placement);
14428
- setLogoSizeDraft(draft);
14429
- setParentScrollSnap(parentScrollRef.current);
14430
- setFloatingPanel({
14431
- key: `logo-size:${placement}`,
14432
- title: "Logo",
14433
- context: placement === "navbar" ? "Navbar" : "Footer",
14434
- kind: "logo-size",
14435
- placement
14436
- });
14437
- }, []);
14438
- const closeFloatingPanelOnly = (0, import_react16.useCallback)(() => {
14439
- setFloatingPanel(null);
14440
- setLogoSizeDraft(null);
14441
- }, []);
14442
- const closeFloatingPanelAndDeselect = (0, import_react16.useCallback)(() => {
14443
- setFloatingPanel(null);
14444
- setLogoSizeDraft(null);
14445
- deselectRef.current();
14446
- }, []);
14447
- const persistLogoSizeDraft = (0, import_react16.useCallback)(
14448
- (placement, draft) => {
14449
- const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
14450
- const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
14451
- const nodes = [
14452
- { key: desktopKey, text: String(draft.desktopPx) }
14453
- ];
14454
- if (draft.mobileFollowing) {
14455
- nodes.push({ key: mobileKey, text: "" });
14456
- } else {
14457
- nodes.push({ key: mobileKey, text: String(draft.mobilePx) });
14458
- }
14459
- editContentRef.current = {
14460
- ...editContentRef.current,
14461
- [desktopKey]: String(draft.desktopPx),
14462
- [mobileKey]: draft.mobileFollowing ? "" : String(draft.mobilePx)
14463
- };
14464
- applyLogoSizeToPlacement(
14465
- placement,
14466
- draft.desktopPx,
14467
- draft.mobileFollowing ? draft.desktopPx : draft.mobilePx,
14468
- draft.mobileFollowing
14469
- );
14470
- postToParent2({ type: "ow:change", nodes });
14471
- requestAnimationFrame(() => {
14472
- const selected = selectedElRef.current;
14473
- if (!selected || toolbarVariantRef.current !== "logo") return;
14474
- const rect = getLogoInteractionRect(selected);
14475
- setToolbarRect(rect);
14476
- if (glowElRef.current) {
14477
- const GAP = SELECTION_CHROME_GAP2;
14478
- glowElRef.current.style.top = `${rect.top - GAP}px`;
14479
- glowElRef.current.style.left = `${rect.left - GAP}px`;
14480
- glowElRef.current.style.width = `${rect.width + GAP * 2}px`;
14481
- glowElRef.current.style.height = `${rect.height + GAP * 2}px`;
14482
- }
14483
- });
14484
- },
14485
- [postToParent2]
14486
- );
14487
- const activate = (0, import_react16.useCallback)((el, options) => {
13721
+ const activate = (0, import_react15.useCallback)((el, options) => {
14488
13722
  if (activeElRef.current === el) return;
14489
13723
  clearSelectedAttr();
14490
13724
  selectedElRef.current = null;
@@ -14560,38 +13794,8 @@ function OhhwellsBridge() {
14560
13794
  deactivateRef.current = deactivate;
14561
13795
  selectRef.current = select;
14562
13796
  selectFrameRef.current = selectFrame;
14563
- selectLogoRef.current = selectLogo;
14564
- openLogoSizePanelRef.current = openLogoSizePanel;
14565
13797
  deselectRef.current = deselect;
14566
- closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
14567
- const lastSiteWideScopeRef = (0, import_react16.useRef)(null);
14568
- (0, import_react16.useEffect)(() => {
14569
- if (!isEditMode) {
14570
- if (lastSiteWideScopeRef.current !== false) {
14571
- lastSiteWideScopeRef.current = false;
14572
- postToParent2({ type: "ow:site-wide-scope", active: false });
14573
- }
14574
- return;
14575
- }
14576
- const active = isSiteWideScopeActive({
14577
- selected: selectedElRef.current,
14578
- hoveredItem: hoveredItemElRef.current,
14579
- hoveredNavContainer: hoveredNavContainerRef.current,
14580
- active: activeElRef.current
14581
- });
14582
- if (lastSiteWideScopeRef.current === active) return;
14583
- lastSiteWideScopeRef.current = active;
14584
- postToParent2({ type: "ow:site-wide-scope", active });
14585
- }, [
14586
- isEditMode,
14587
- hoveredItemRect,
14588
- hoveredNavContainerRect,
14589
- toolbarVariant,
14590
- toolbarRect,
14591
- isFooterFrameSelection,
14592
- postToParent2
14593
- ]);
14594
- (0, import_react16.useLayoutEffect)(() => {
13798
+ (0, import_react15.useLayoutEffect)(() => {
14595
13799
  if (!subdomain || isEditMode) {
14596
13800
  setFetchState("done");
14597
13801
  return;
@@ -14605,8 +13809,6 @@ function OhhwellsBridge() {
14605
13809
  for (const [key, val] of Object.entries(content)) {
14606
13810
  if (key === "__ohw_sections") continue;
14607
13811
  if (key === AI_SECTIONS_KEY) continue;
14608
- if (key === LOGO_PLACEHOLDER_KEY) continue;
14609
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
14610
13812
  if (applyVideoSettingNode(key, val)) continue;
14611
13813
  if (applyCarouselNode(key, val)) continue;
14612
13814
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -14633,16 +13835,12 @@ function OhhwellsBridge() {
14633
13835
  }
14634
13836
  } else if (el.dataset.ohwEditable === "link") {
14635
13837
  applyLinkHref(el, val);
14636
- } else if (el.dataset.ohwEditable === "icon") {
14637
- if (el.innerHTML !== val) el.innerHTML = val;
14638
13838
  } else if (el.innerHTML !== val) {
14639
13839
  el.innerHTML = val;
14640
13840
  }
14641
13841
  });
14642
13842
  applyLinkByKey(key, val);
14643
13843
  }
14644
- applyLogoFromContent(content);
14645
- applyLogoSizes(content);
14646
13844
  reconcileNavbarItemsFromContent(content);
14647
13845
  reconcileFooterOrderFromContent(content);
14648
13846
  enforceLinkHrefs();
@@ -14660,9 +13858,7 @@ function OhhwellsBridge() {
14660
13858
  let cancelled = false;
14661
13859
  setFetchState("loading");
14662
13860
  const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
14663
- const initialPath = pathname;
14664
- fetchedContentPaths.add(`${subdomain}::${initialPath}`);
14665
- fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(initialPath)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
13861
+ fetch(`${apiUrl}/api/public/sites/${subdomain}/content`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
14666
13862
  if (cancelled) return;
14667
13863
  const content = data?.content ?? {};
14668
13864
  contentCache.set(subdomain, content);
@@ -14675,7 +13871,7 @@ function OhhwellsBridge() {
14675
13871
  cancelled = true;
14676
13872
  };
14677
13873
  }, [subdomain, isEditMode]);
14678
- (0, import_react16.useEffect)(() => {
13874
+ (0, import_react15.useEffect)(() => {
14679
13875
  if (!subdomain || isEditMode) return;
14680
13876
  let debounceTimer = null;
14681
13877
  let observer = null;
@@ -14687,8 +13883,6 @@ function OhhwellsBridge() {
14687
13883
  try {
14688
13884
  for (const [key, val] of Object.entries(content)) {
14689
13885
  if (key === "__ohw_sections") continue;
14690
- if (key === LOGO_PLACEHOLDER_KEY) continue;
14691
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
14692
13886
  if (applyVideoSettingNode(key, val)) continue;
14693
13887
  if (applyCarouselNode(key, val)) continue;
14694
13888
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -14709,7 +13903,6 @@ function OhhwellsBridge() {
14709
13903
  });
14710
13904
  applyLinkByKey(key, val);
14711
13905
  }
14712
- applyLogoFromContent(content);
14713
13906
  reconcileNavbarItemsFromContent(content);
14714
13907
  reconcileFooterOrderFromContent(content);
14715
13908
  } finally {
@@ -14722,17 +13915,6 @@ function OhhwellsBridge() {
14722
13915
  debounceTimer = setTimeout(applyFromCache, 150);
14723
13916
  };
14724
13917
  applyFromCache();
14725
- const pathCacheKey = `${subdomain}::${pathname}`;
14726
- if (!fetchedContentPaths.has(pathCacheKey)) {
14727
- fetchedContentPaths.add(pathCacheKey);
14728
- const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
14729
- fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(pathname)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
14730
- if (!data?.content) return;
14731
- contentCache.set(subdomain, data.content);
14732
- applyFromCache();
14733
- }).catch(() => {
14734
- });
14735
- }
14736
13918
  observer = new MutationObserver(scheduleApply);
14737
13919
  observer.observe(document.body, { childList: true, subtree: true });
14738
13920
  return () => {
@@ -14740,16 +13922,16 @@ function OhhwellsBridge() {
14740
13922
  if (debounceTimer) clearTimeout(debounceTimer);
14741
13923
  };
14742
13924
  }, [subdomain, isEditMode, pathname]);
14743
- (0, import_react16.useLayoutEffect)(() => {
13925
+ (0, import_react15.useLayoutEffect)(() => {
14744
13926
  const el = document.getElementById("ohw-loader");
14745
13927
  if (!el) return;
14746
13928
  const visible = Boolean(subdomain) && fetchState !== "done";
14747
13929
  el.style.display = visible ? "flex" : "none";
14748
13930
  }, [subdomain, fetchState]);
14749
- (0, import_react16.useEffect)(() => {
13931
+ (0, import_react15.useEffect)(() => {
14750
13932
  postToParent2({ type: "ow:navigation", path: pathname });
14751
13933
  }, [pathname, postToParent2]);
14752
- (0, import_react16.useEffect)(() => {
13934
+ (0, import_react15.useEffect)(() => {
14753
13935
  if (!isEditMode) return;
14754
13936
  if (linkPopoverSessionRef.current?.intent === "add-nav") return;
14755
13937
  if (document.querySelector("[data-ohw-section-picker]")) return;
@@ -14757,7 +13939,7 @@ function OhhwellsBridge() {
14757
13939
  deselectRef.current();
14758
13940
  deactivateRef.current();
14759
13941
  }, [pathname, isEditMode]);
14760
- (0, import_react16.useEffect)(() => {
13942
+ (0, import_react15.useEffect)(() => {
14761
13943
  const contentForNav = () => {
14762
13944
  if (isEditMode) return editContentRef.current;
14763
13945
  if (!subdomain) return {};
@@ -14822,7 +14004,7 @@ function OhhwellsBridge() {
14822
14004
  observer?.disconnect();
14823
14005
  };
14824
14006
  }, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
14825
- (0, import_react16.useEffect)(() => {
14007
+ (0, import_react15.useEffect)(() => {
14826
14008
  if (!isEditMode) return;
14827
14009
  const measure = () => {
14828
14010
  const h = document.body.scrollHeight;
@@ -14846,7 +14028,7 @@ function OhhwellsBridge() {
14846
14028
  window.removeEventListener("resize", handleResize);
14847
14029
  };
14848
14030
  }, [pathname, isEditMode, postToParent2]);
14849
- (0, import_react16.useEffect)(() => {
14031
+ (0, import_react15.useEffect)(() => {
14850
14032
  if (!subdomainFromQuery || isEditMode) return;
14851
14033
  const handleClick = (e) => {
14852
14034
  const anchor = e.target.closest("a");
@@ -14862,7 +14044,7 @@ function OhhwellsBridge() {
14862
14044
  document.addEventListener("click", handleClick, true);
14863
14045
  return () => document.removeEventListener("click", handleClick, true);
14864
14046
  }, [subdomainFromQuery, isEditMode, router]);
14865
- (0, import_react16.useEffect)(() => {
14047
+ (0, import_react15.useEffect)(() => {
14866
14048
  if (!isEditMode) {
14867
14049
  editStylesRef.current?.base.remove();
14868
14050
  editStylesRef.current?.forceHover.remove();
@@ -14991,7 +14173,6 @@ function OhhwellsBridge() {
14991
14173
  if (target.closest("[data-ohw-state-toggle]")) return;
14992
14174
  if (target.closest("[data-ohw-max-badge]")) return;
14993
14175
  if (isInsideLinkEditor(target)) return;
14994
- if (isInsideFloatingPanel(target)) return;
14995
14176
  if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
14996
14177
  const beneath = document.elementsFromPoint(e.clientX, e.clientY).find(
14997
14178
  (el) => el instanceof HTMLElement && !el.closest("[data-ohw-bridge-root]") && el.closest("[data-ohw-section]") != null
@@ -15055,21 +14236,6 @@ function OhhwellsBridge() {
15055
14236
  return;
15056
14237
  }
15057
14238
  }
15058
- const logoEl = getLogoElement(target);
15059
- if (logoEl) {
15060
- e.preventDefault();
15061
- e.stopPropagation();
15062
- if (!logoHasUploadedImage(logoEl)) {
15063
- deselectRef.current();
15064
- deactivateRef.current();
15065
- const identity = readLogoIdentityFromDom();
15066
- postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
15067
- return;
15068
- }
15069
- selectLogoRef.current(logoEl);
15070
- openLogoSizePanelRef.current(logoEl);
15071
- return;
15072
- }
15073
14239
  const editable = target.closest("[data-ohw-editable]");
15074
14240
  if (editable) {
15075
14241
  if (editable.dataset.ohwEditable === "link") {
@@ -15086,17 +14252,6 @@ function OhhwellsBridge() {
15086
14252
  });
15087
14253
  return;
15088
14254
  }
15089
- if (isIconEditable(editable)) {
15090
- e.preventDefault();
15091
- e.stopPropagation();
15092
- aiSectionApiRef.current?.selectFromElement(editable);
15093
- postToParentRef.current({
15094
- type: "ow:icon-pick",
15095
- key: editable.dataset.ohwKey ?? "",
15096
- current: currentIconRef(editable)
15097
- });
15098
- return;
15099
- }
15100
14255
  if (isMediaEditable(editable)) {
15101
14256
  e.preventDefault();
15102
14257
  e.stopPropagation();
@@ -15213,7 +14368,6 @@ function OhhwellsBridge() {
15213
14368
  if (target.closest("[data-ohw-state-toggle]")) return;
15214
14369
  if (target.closest("[data-ohw-max-badge]")) return;
15215
14370
  if (isInsideLinkEditor(target)) return;
15216
- if (isInsideFloatingPanel(target)) return;
15217
14371
  if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
15218
14372
  return;
15219
14373
  }
@@ -15240,16 +14394,6 @@ function OhhwellsBridge() {
15240
14394
  setHoveredNavContainerRect(null);
15241
14395
  return;
15242
14396
  }
15243
- if (isInsideFloatingPanel(target) || isPointOverFloatingPanel(e.clientX, e.clientY)) {
15244
- hoveredItemElRef.current = null;
15245
- setHoveredItemRect(null);
15246
- hoveredNavContainerRef.current = null;
15247
- setHoveredNavContainerRect(null);
15248
- siblingHintElRef.current = null;
15249
- setSiblingHintRect(null);
15250
- setSiblingHintRects([]);
15251
- return;
15252
- }
15253
14397
  {
15254
14398
  const selected2 = selectedElRef.current;
15255
14399
  const selectedIsFooterColumn = Boolean(selected2) && !isFooterLinksContainer(selected2) && (selected2.hasAttribute("data-ohw-footer-col") || selected2.hasAttribute("data-ohw-footer-column") || Boolean(selected2.closest("footer") && isInferredFooterGroup2(selected2)));
@@ -15257,7 +14401,7 @@ function OhhwellsBridge() {
15257
14401
  const allowFooterLinksHover = toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn;
15258
14402
  if (allowNavContainerHover) {
15259
14403
  const navContainer = target.closest("[data-ohw-nav-container]");
15260
- if (navContainer && !getNavigationItemAnchor(target) && !getLogoElement(target)) {
14404
+ if (navContainer && !getNavigationItemAnchor(target)) {
15261
14405
  hoveredNavContainerRef.current = navContainer;
15262
14406
  setHoveredNavContainerRect(navContainer.getBoundingClientRect());
15263
14407
  hoveredItemElRef.current = null;
@@ -15286,15 +14430,6 @@ function OhhwellsBridge() {
15286
14430
  setHoveredNavContainerRect(null);
15287
14431
  }
15288
14432
  }
15289
- const logoEl = getLogoElement(target);
15290
- if (logoEl) {
15291
- hoveredNavContainerRef.current = null;
15292
- setHoveredNavContainerRect(null);
15293
- if (selectedElRef.current === logoEl) return;
15294
- hoveredItemElRef.current = logoEl;
15295
- setHoveredItemRect(getLogoInteractionRect(logoEl));
15296
- return;
15297
- }
15298
14433
  const navAnchor = getNavigationItemAnchor(target);
15299
14434
  if (navAnchor) {
15300
14435
  hoveredNavContainerRef.current = null;
@@ -15320,11 +14455,6 @@ function OhhwellsBridge() {
15320
14455
  const selected = selectedElRef.current;
15321
14456
  if (selected && (selected === editable || selected.contains(editable))) return;
15322
14457
  if (!isMediaEditable(editable) && !editable.hasAttribute("contenteditable")) {
15323
- if (isIconEditable(editable)) {
15324
- hoveredItemElRef.current = editable;
15325
- setHoveredItemRect(editable.getBoundingClientRect());
15326
- return;
15327
- }
15328
14458
  const hoverTarget = editable.closest("[data-ohw-href-key]") ?? editable;
15329
14459
  if (hoverTarget.hasAttribute("data-ohw-href-key")) {
15330
14460
  clearHrefKeyHover(hoverTarget);
@@ -15332,12 +14462,6 @@ function OhhwellsBridge() {
15332
14462
  setHoveredItemRect(hoverTarget.getBoundingClientRect());
15333
14463
  } else if (!isInsideNavigationItem(editable)) {
15334
14464
  hoverTarget.setAttribute("data-ohw-hovered", "");
15335
- if (editable.closest("footer") || editable.closest('[data-ohw-section="footer"]')) {
15336
- hoveredNavContainerRef.current = null;
15337
- setHoveredNavContainerRect(null);
15338
- hoveredItemElRef.current = editable;
15339
- setHoveredItemRect(editable.getBoundingClientRect());
15340
- }
15341
14465
  }
15342
14466
  }
15343
14467
  };
@@ -15373,30 +14497,11 @@ function OhhwellsBridge() {
15373
14497
  }
15374
14498
  return;
15375
14499
  }
15376
- const logoEl = getLogoElement(target);
15377
- if (logoEl) {
15378
- const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
15379
- if (related2 && (logoEl === related2 || logoEl.contains(related2) || related2.closest?.('[data-ohw-role="logo"], [data-ohw-logo]'))) {
15380
- return;
15381
- }
15382
- if (hoveredItemElRef.current === logoEl) {
15383
- hoveredItemElRef.current = null;
15384
- setHoveredItemRect(null);
15385
- }
15386
- return;
15387
- }
15388
14500
  const editable = target.closest("[data-ohw-editable]");
15389
14501
  if (!editable) return;
15390
14502
  const related = e.relatedTarget instanceof Element ? e.relatedTarget : null;
15391
14503
  if (related?.closest("[data-ohw-drag-handle-container], [data-ohw-item-interaction]")) return;
15392
14504
  if (!isMediaEditable(editable)) {
15393
- if (isIconEditable(editable) && hoveredItemElRef.current === editable) {
15394
- if (!related?.closest("[data-ohw-item-interaction]")) {
15395
- hoveredItemElRef.current = null;
15396
- setHoveredItemRect(null);
15397
- }
15398
- return;
15399
- }
15400
14505
  const hoverTarget = editable.closest("[data-ohw-href-key]") ?? editable;
15401
14506
  if (hoverTarget.hasAttribute("data-ohw-href-key")) {
15402
14507
  if (!related?.closest("[data-ohw-href-key]")) {
@@ -15405,13 +14510,6 @@ function OhhwellsBridge() {
15405
14510
  }
15406
14511
  } else {
15407
14512
  hoverTarget.removeAttribute("data-ohw-hovered");
15408
- if (hoveredItemElRef.current === editable) {
15409
- const stillOnEditable = related instanceof Element && related.closest("[data-ohw-editable]") === editable;
15410
- if (!stillOnEditable) {
15411
- hoveredItemElRef.current = null;
15412
- setHoveredItemRect(null);
15413
- }
15414
- }
15415
14513
  }
15416
14514
  }
15417
14515
  };
@@ -15528,26 +14626,6 @@ function OhhwellsBridge() {
15528
14626
  hoveredNavContainerRef.current = null;
15529
14627
  setHoveredNavContainerRect(null);
15530
14628
  }
15531
- const logoCandidates = [
15532
- ...document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]'),
15533
- ...document.querySelectorAll("nav a:not([data-ohw-href-key]), [data-ohw-nav-root] a:not([data-ohw-href-key])"),
15534
- ...document.querySelectorAll("footer img")
15535
- ];
15536
- const seenLogos = /* @__PURE__ */ new Set();
15537
- for (const candidate of logoCandidates) {
15538
- const logo = getLogoElement(candidate);
15539
- if (!logo || seenLogos.has(logo)) continue;
15540
- seenLogos.add(logo);
15541
- const r2 = logo.getBoundingClientRect();
15542
- if (x < r2.left || x > r2.right || y < r2.top || y > r2.bottom) continue;
15543
- hoveredNavContainerRef.current = null;
15544
- setHoveredNavContainerRect(null);
15545
- if (selectedElRef.current !== logo) {
15546
- hoveredItemElRef.current = logo;
15547
- setHoveredItemRect(getLogoInteractionRect(logo));
15548
- }
15549
- return;
15550
- }
15551
14629
  const navContainers = Array.from(
15552
14630
  document.querySelectorAll("[data-ohw-nav-container]")
15553
14631
  );
@@ -15633,7 +14711,7 @@ function OhhwellsBridge() {
15633
14711
  }
15634
14712
  };
15635
14713
  const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false) => {
15636
- if (linkPopoverOpenRef.current || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
14714
+ if (linkPopoverOpenRef.current) {
15637
14715
  if (hoveredImageRef.current) {
15638
14716
  hoveredImageRef.current = null;
15639
14717
  hoveredImageHasTextOverlapRef.current = false;
@@ -15887,7 +14965,7 @@ function OhhwellsBridge() {
15887
14965
  }
15888
14966
  };
15889
14967
  const probeHoverCardsAt = (clientX, clientY, fromParentViewport = false) => {
15890
- if (linkPopoverOpenRef.current || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY) || document.documentElement.hasAttribute("data-ohw-section-picking")) {
14968
+ if (linkPopoverOpenRef.current || document.documentElement.hasAttribute("data-ohw-section-picking")) {
15891
14969
  if (activeStateElRef.current) {
15892
14970
  activeStateElRef.current.removeAttribute("data-ohw-state-hovered");
15893
14971
  activeStateElRef.current = null;
@@ -15955,19 +15033,6 @@ function OhhwellsBridge() {
15955
15033
  };
15956
15034
  const handleMouseMove = (e) => {
15957
15035
  const { clientX, clientY } = e;
15958
- if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
15959
- hoveredItemElRef.current = null;
15960
- setHoveredItemRect(null);
15961
- hoveredNavContainerRef.current = null;
15962
- setHoveredNavContainerRect(null);
15963
- siblingHintElRef.current = null;
15964
- setSiblingHintRect(null);
15965
- setSiblingHintRects([]);
15966
- dismissImageHover();
15967
- clearImageHover();
15968
- setSectionGap(null);
15969
- return;
15970
- }
15971
15036
  probeSectionGapAt(clientX, clientY);
15972
15037
  probeImageAt(clientX, clientY);
15973
15038
  probeHoverCardsAt(clientX, clientY);
@@ -15976,11 +15041,6 @@ function OhhwellsBridge() {
15976
15041
  if (e.data?.type !== "ow:pointer-sync") return;
15977
15042
  const { clientX, clientY } = e.data;
15978
15043
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
15979
- if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
15980
- dismissImageHover();
15981
- clearImageHover();
15982
- return;
15983
- }
15984
15044
  probeSectionGapAt(clientX, clientY);
15985
15045
  probeImageAt(clientX, clientY);
15986
15046
  probeHoverCardsAt(clientX, clientY);
@@ -16042,19 +15102,6 @@ function OhhwellsBridge() {
16042
15102
  resumeAnimTracks();
16043
15103
  clearImageHover();
16044
15104
  };
16045
- const handleIconMarkup = (e) => {
16046
- if (e.data?.type !== "ow:icon-markup") return;
16047
- const { key, markup } = e.data;
16048
- if (!key || typeof markup !== "string") return;
16049
- const targets = document.querySelectorAll(
16050
- `[data-ohw-key="${key}"][data-ohw-editable="icon"]`
16051
- );
16052
- if (!targets.length) return;
16053
- targets.forEach((el) => {
16054
- el.innerHTML = markup;
16055
- });
16056
- postToParentRef.current({ type: "ow:change", nodes: [{ key, text: markup }] });
16057
- };
16058
15105
  const handleImageUrl = (e) => {
16059
15106
  if (e.data?.type !== "ow:image-url") return;
16060
15107
  const { key, url } = e.data;
@@ -16194,8 +15241,6 @@ function OhhwellsBridge() {
16194
15241
  continue;
16195
15242
  }
16196
15243
  if (key === AI_SECTIONS_KEY) continue;
16197
- if (key === LOGO_PLACEHOLDER_KEY) continue;
16198
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
16199
15244
  if (applyVideoSettingNode(key, val)) continue;
16200
15245
  if (applyCarouselNode(key, val)) continue;
16201
15246
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -16215,8 +15260,6 @@ function OhhwellsBridge() {
16215
15260
  });
16216
15261
  applyLinkByKey(key, val);
16217
15262
  }
16218
- applyLogoFromContent(content);
16219
- applyLogoSizes(content);
16220
15263
  if (sectionsJson) {
16221
15264
  initSectionsFromContent({ __ohw_sections: sectionsJson }, true);
16222
15265
  sectionsLoadedRef.current = true;
@@ -16231,58 +15274,6 @@ function OhhwellsBridge() {
16231
15274
  if (hydratedHeight > 50) postToParentRef.current({ type: "ow:height", height: hydratedHeight });
16232
15275
  postToParentRef.current({ type: "ow:hydrate-done" });
16233
15276
  };
16234
- const handleUpdateLogoIdentity = (e) => {
16235
- if (e.data?.type !== "ow:update-logo-identity") return;
16236
- const rawText = typeof e.data.text === "string" ? e.data.text : "";
16237
- const alt = typeof e.data.alt === "string" ? e.data.alt : rawText;
16238
- const href = typeof e.data.href === "string" ? e.data.href : void 0;
16239
- const imageProvided = "image" in e.data;
16240
- const imageUrl = imageProvided && typeof e.data.image === "string" && e.data.image.trim() ? e.data.image.trim() : imageProvided ? null : void 0;
16241
- let isPlaceholder = e.data.isPlaceholder !== false;
16242
- if (imageUrl) isPlaceholder = false;
16243
- else if (imageProvided && imageUrl === null) {
16244
- isPlaceholder = e.data.isPlaceholder === true || !rawText.trim() || resolveLogoDisplayText(rawText) === PLACEHOLDER_BUSINESS_NAME;
16245
- }
16246
- const display = applyLogoIdentity(rawText, isPlaceholder);
16247
- const displayAlt = resolveLogoDisplayText(alt || display);
16248
- if (imageUrl !== void 0) {
16249
- applyLogoImage(imageUrl, displayAlt);
16250
- } else {
16251
- for (const key of LOGO_IMAGE_KEYS) {
16252
- document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
16253
- const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
16254
- if (img) img.alt = displayAlt;
16255
- });
16256
- }
16257
- }
16258
- if (href !== void 0) {
16259
- applyLogoHref(href);
16260
- applyLinkByKey("nav-logo-href", href);
16261
- applyLinkByKey("footer-logo-href", href);
16262
- applyLinkByKey("logo-href", href);
16263
- }
16264
- const nodes = [
16265
- ...LOGO_TEXT_KEYS.map((key) => ({ key, text: display })),
16266
- { key: LOGO_PLACEHOLDER_KEY, text: isPlaceholder ? "true" : "false" },
16267
- { key: LOGO_ALT_KEY, text: displayAlt }
16268
- ];
16269
- if (imageUrl !== void 0) {
16270
- if (imageUrl) {
16271
- for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: imageUrl });
16272
- } else {
16273
- for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: "" });
16274
- }
16275
- }
16276
- if (href !== void 0) {
16277
- for (const key of LOGO_HREF_KEYS) nodes.push({ key, text: href.trim() || "/" });
16278
- }
16279
- editContentRef.current = {
16280
- ...editContentRef.current,
16281
- ...Object.fromEntries(nodes.map(({ key, text }) => [key, text]))
16282
- };
16283
- applyLogoSizes(editContentRef.current);
16284
- postToParentRef.current({ type: "ow:change", nodes });
16285
- };
16286
15277
  window.addEventListener("message", handleHydrate);
16287
15278
  const postAiSectionsChanged = () => {
16288
15279
  postToParentRef.current({
@@ -16347,12 +15338,6 @@ function OhhwellsBridge() {
16347
15338
  closeLinkPopoverRef.current();
16348
15339
  return;
16349
15340
  }
16350
- if (floatingPanelOpenRef.current) {
16351
- setFloatingPanelRef.current(null);
16352
- deselectRef.current();
16353
- deactivateRef.current();
16354
- return;
16355
- }
16356
15341
  deselectRef.current();
16357
15342
  deactivateRef.current();
16358
15343
  };
@@ -16372,10 +15357,6 @@ function OhhwellsBridge() {
16372
15357
  closeLinkPopoverRef.current();
16373
15358
  return;
16374
15359
  }
16375
- if (floatingPanelOpenRef.current) {
16376
- closeFloatingPanelOnlyRef.current();
16377
- return;
16378
- }
16379
15360
  if (activeElRef.current) {
16380
15361
  const hrefCtx = getHrefKeyFromElement(activeElRef.current);
16381
15362
  const navAnchor = hrefCtx ? getNavigationItemAnchor(hrefCtx.anchor) : null;
@@ -16406,10 +15387,6 @@ function OhhwellsBridge() {
16406
15387
  return;
16407
15388
  }
16408
15389
  if (selectedElRef.current) {
16409
- if (toolbarVariantRef.current === "logo") {
16410
- deselectRef.current();
16411
- return;
16412
- }
16413
15390
  if (toolbarVariantRef.current === "select-frame") {
16414
15391
  const parent2 = getNavigationSelectionParent(selectedElRef.current);
16415
15392
  if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
@@ -16443,16 +15420,7 @@ function OhhwellsBridge() {
16443
15420
  closeLinkPopoverRef.current();
16444
15421
  return;
16445
15422
  }
16446
- if (e.key === "Escape" && floatingPanelOpenRef.current) {
16447
- e.preventDefault();
16448
- closeFloatingPanelOnlyRef.current();
16449
- return;
16450
- }
16451
15423
  if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
16452
- if (toolbarVariantRef.current === "logo") {
16453
- deselectRef.current();
16454
- return;
16455
- }
16456
15424
  if (toolbarVariantRef.current === "select-frame") {
16457
15425
  const parent2 = getNavigationSelectionParent(selectedElRef.current);
16458
15426
  if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
@@ -16530,8 +15498,7 @@ function OhhwellsBridge() {
16530
15498
  const handleScroll = () => {
16531
15499
  const focusEl = activeElRef.current ?? selectedElRef.current;
16532
15500
  if (focusEl) {
16533
- const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : toolbarVariantRef.current === "logo" ? null : focusEl;
16534
- const r2 = measureEl ? measureEl.getBoundingClientRect() : toolbarVariantRef.current === "logo" ? getLogoInteractionRect(focusEl) : focusEl.getBoundingClientRect();
15501
+ const r2 = activeElRef.current ? getEditMeasureEl(activeElRef.current).getBoundingClientRect() : focusEl.getBoundingClientRect();
16535
15502
  applyToolbarPos(r2);
16536
15503
  setToolbarRect(r2);
16537
15504
  setMaxBadge((prev) => prev && activeElRef.current ? { ...prev, rect: r2 } : prev);
@@ -16541,9 +15508,7 @@ function OhhwellsBridge() {
16541
15508
  setToggleState((prev) => prev ? { ...prev, rect } : null);
16542
15509
  }
16543
15510
  if (hoveredItemElRef.current) {
16544
- const hoverEl = hoveredItemElRef.current;
16545
- const logo = getLogoElement(hoverEl);
16546
- setHoveredItemRect(logo ? getLogoInteractionRect(logo) : hoverEl.getBoundingClientRect());
15511
+ setHoveredItemRect(hoveredItemElRef.current.getBoundingClientRect());
16547
15512
  }
16548
15513
  if (hoveredNavContainerRef.current) {
16549
15514
  setHoveredNavContainerRect(hoveredNavContainerRef.current.getBoundingClientRect());
@@ -16597,12 +15562,8 @@ function OhhwellsBridge() {
16597
15562
  if (inserted) {
16598
15563
  const tracker = getSectionsTracker();
16599
15564
  postToParentRef.current({ type: "ow:change", nodes: [{ key: "__ohw_sections", text: tracker.textContent ?? "[]" }] });
16600
- const reportHeight = () => {
16601
- const h = document.body.scrollHeight;
16602
- if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
16603
- };
16604
- reportHeight();
16605
- setTimeout(reportHeight, 500);
15565
+ const h = document.documentElement.scrollHeight;
15566
+ if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
16606
15567
  }
16607
15568
  };
16608
15569
  const handleSwitchSchedule = (e) => {
@@ -16795,17 +15756,13 @@ function OhhwellsBridge() {
16795
15756
  if (e.data?.type !== "ow:parent-scroll") return;
16796
15757
  const { iframeOffsetTop, headerH, canvasH } = e.data;
16797
15758
  parentScrollRef.current = { iframeOffsetTop, headerH, canvasH };
16798
- if (floatingPanelOpenRef.current) {
16799
- setParentScrollSnap({ iframeOffsetTop, headerH, canvasH });
16800
- }
16801
15759
  if (visibleViewportRef.current) {
16802
15760
  applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
16803
15761
  }
16804
15762
  const focusEl = activeElRef.current ?? selectedElRef.current;
16805
15763
  if (focusEl) {
16806
- const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : toolbarVariantRef.current === "logo" ? null : focusEl;
16807
- const r2 = measureEl ? measureEl.getBoundingClientRect() : toolbarVariantRef.current === "logo" ? getLogoInteractionRect(focusEl) : focusEl.getBoundingClientRect();
16808
- applyToolbarPos(r2);
15764
+ const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : focusEl;
15765
+ applyToolbarPos(measureEl.getBoundingClientRect());
16809
15766
  }
16810
15767
  };
16811
15768
  const handleClickAt = (e) => {
@@ -16830,25 +15787,6 @@ function OhhwellsBridge() {
16830
15787
  postToParentRef.current({ type: "ow:image-pick", key: stateCardImage.dataset.ohwKey ?? "", elementType: stateCardImage.dataset.ohwEditable ?? "image" });
16831
15788
  return;
16832
15789
  }
16833
- const logoAtPoint = Array.from(
16834
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]')
16835
- ).map((el) => getLogoElement(el)).find((logo) => {
16836
- if (!logo) return false;
16837
- const r2 = logo.getBoundingClientRect();
16838
- return clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
16839
- });
16840
- if (logoAtPoint) {
16841
- if (!logoHasUploadedImage(logoAtPoint)) {
16842
- deselectRef.current();
16843
- deactivateRef.current();
16844
- const identity = readLogoIdentityFromDom();
16845
- postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
16846
- return;
16847
- }
16848
- selectLogoRef.current(logoAtPoint);
16849
- openLogoSizePanelRef.current(logoAtPoint);
16850
- return;
16851
- }
16852
15790
  const textEditable = Array.from(
16853
15791
  document.querySelectorAll(NON_MEDIA_SELECTOR)
16854
15792
  ).find((el) => {
@@ -16910,7 +15848,6 @@ function OhhwellsBridge() {
16910
15848
  window.addEventListener("message", handleClearSchedulingWidget);
16911
15849
  window.addEventListener("message", handleRemoveSchedulingSection);
16912
15850
  window.addEventListener("message", handleCollectSection);
16913
- window.addEventListener("message", handleIconMarkup);
16914
15851
  window.addEventListener("message", handleImageUrl);
16915
15852
  window.addEventListener("message", handleImageUploading);
16916
15853
  window.addEventListener("message", handleCarouselChange);
@@ -16918,14 +15855,6 @@ function OhhwellsBridge() {
16918
15855
  window.addEventListener("message", handleParentScroll);
16919
15856
  window.addEventListener("message", handlePointerSync);
16920
15857
  window.addEventListener("message", handleClickAt);
16921
- window.addEventListener("message", handleUpdateLogoIdentity);
16922
- const handleViewMode = (e) => {
16923
- if (e.data?.type !== "ow:view-mode") return;
16924
- const mode = e.data.mode === "Mobile" || e.data.mode === "mobile" ? "mobile" : "desktop";
16925
- setEditorViewport(mode);
16926
- applyLogoSizes(editContentRef.current);
16927
- };
16928
- window.addEventListener("message", handleViewMode);
16929
15858
  const handleViewportResize = () => {
16930
15859
  if (visibleViewportRef.current) {
16931
15860
  applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
@@ -16970,7 +15899,6 @@ function OhhwellsBridge() {
16970
15899
  window.removeEventListener("message", handleClearSchedulingWidget);
16971
15900
  window.removeEventListener("message", handleRemoveSchedulingSection);
16972
15901
  window.removeEventListener("message", handleCollectSection);
16973
- window.removeEventListener("message", handleIconMarkup);
16974
15902
  window.removeEventListener("message", handleImageUrl);
16975
15903
  window.removeEventListener("message", handleImageUploading);
16976
15904
  window.removeEventListener("message", handleCarouselChange);
@@ -16979,8 +15907,6 @@ function OhhwellsBridge() {
16979
15907
  window.removeEventListener("resize", handleViewportResize);
16980
15908
  window.removeEventListener("message", handlePointerSync);
16981
15909
  window.removeEventListener("message", handleClickAt);
16982
- window.removeEventListener("message", handleUpdateLogoIdentity);
16983
- window.removeEventListener("message", handleViewMode);
16984
15910
  window.removeEventListener("message", handleHydrate);
16985
15911
  window.removeEventListener("message", handleAiApplyTree);
16986
15912
  window.removeEventListener("message", handleAiDeleteSection);
@@ -16994,7 +15920,7 @@ function OhhwellsBridge() {
16994
15920
  if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
16995
15921
  };
16996
15922
  }, [isEditMode, refreshStateRules]);
16997
- (0, import_react16.useEffect)(() => {
15923
+ (0, import_react15.useEffect)(() => {
16998
15924
  if (!isEditMode) return;
16999
15925
  const THRESHOLD = 10;
17000
15926
  const resolveWasSelected = (el) => {
@@ -17148,7 +16074,7 @@ function OhhwellsBridge() {
17148
16074
  unlockFooterDragInteraction();
17149
16075
  };
17150
16076
  }, [isEditMode]);
17151
- (0, import_react16.useEffect)(() => {
16077
+ (0, import_react15.useEffect)(() => {
17152
16078
  const handler = (e) => {
17153
16079
  if (e.data?.type !== "ow:request-schedule-config") return;
17154
16080
  const insertAfterVal = e.data.insertAfter;
@@ -17164,7 +16090,7 @@ function OhhwellsBridge() {
17164
16090
  window.addEventListener("message", handler);
17165
16091
  return () => window.removeEventListener("message", handler);
17166
16092
  }, [processConfigRequest]);
17167
- (0, import_react16.useEffect)(() => {
16093
+ (0, import_react15.useEffect)(() => {
17168
16094
  if (!isEditMode) return;
17169
16095
  document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
17170
16096
  el.removeAttribute("data-ohw-active-state");
@@ -17200,13 +16126,13 @@ function OhhwellsBridge() {
17200
16126
  clearTimeout(timer);
17201
16127
  };
17202
16128
  }, [pathname, isEditMode, refreshStateRules, postToParent2]);
17203
- (0, import_react16.useEffect)(() => {
16129
+ (0, import_react15.useEffect)(() => {
17204
16130
  scrollToHashSectionWhenReady();
17205
16131
  const onHashChange = () => scrollToHashSectionWhenReady();
17206
16132
  window.addEventListener("hashchange", onHashChange);
17207
16133
  return () => window.removeEventListener("hashchange", onHashChange);
17208
16134
  }, [pathname]);
17209
- const handleCommand = (0, import_react16.useCallback)((cmd) => {
16135
+ const handleCommand = (0, import_react15.useCallback)((cmd) => {
17210
16136
  const el = activeElRef.current;
17211
16137
  const selBefore = window.getSelection();
17212
16138
  let savedOffsets = null;
@@ -17242,7 +16168,7 @@ function OhhwellsBridge() {
17242
16168
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
17243
16169
  refreshActiveCommandsRef.current();
17244
16170
  }, []);
17245
- const handleStateChange = (0, import_react16.useCallback)((state) => {
16171
+ const handleStateChange = (0, import_react15.useCallback)((state) => {
17246
16172
  if (!activeStateElRef.current) return;
17247
16173
  const el = activeStateElRef.current;
17248
16174
  if (state === "Default") {
@@ -17255,7 +16181,7 @@ function OhhwellsBridge() {
17255
16181
  }
17256
16182
  setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
17257
16183
  }, [deactivate]);
17258
- const reselectAfterLinkPopover = (0, import_react16.useCallback)(
16184
+ const reselectAfterLinkPopover = (0, import_react15.useCallback)(
17259
16185
  (hrefKey) => {
17260
16186
  requestAnimationFrame(() => {
17261
16187
  const el = resolveHrefKeyElement(hrefKey);
@@ -17264,7 +16190,7 @@ function OhhwellsBridge() {
17264
16190
  },
17265
16191
  [resolveHrefKeyElement]
17266
16192
  );
17267
- const closeLinkPopover = (0, import_react16.useCallback)(() => {
16193
+ const closeLinkPopover = (0, import_react15.useCallback)(() => {
17268
16194
  const session = linkPopoverSessionRef.current;
17269
16195
  addNavAfterAnchorRef.current = null;
17270
16196
  setLinkPopover(null);
@@ -17272,9 +16198,9 @@ function OhhwellsBridge() {
17272
16198
  reselectAfterLinkPopover(session.key);
17273
16199
  }
17274
16200
  }, [reselectAfterLinkPopover]);
17275
- const closeLinkPopoverRef = (0, import_react16.useRef)(closeLinkPopover);
16201
+ const closeLinkPopoverRef = (0, import_react15.useRef)(closeLinkPopover);
17276
16202
  closeLinkPopoverRef.current = closeLinkPopover;
17277
- const openLinkPopoverForActive = (0, import_react16.useCallback)(() => {
16203
+ const openLinkPopoverForActive = (0, import_react15.useCallback)(() => {
17278
16204
  const hrefCtx = getHrefKeyFromElement(activeElRef.current);
17279
16205
  if (!hrefCtx) return;
17280
16206
  bumpLinkPopoverGrace();
@@ -17285,7 +16211,7 @@ function OhhwellsBridge() {
17285
16211
  });
17286
16212
  deactivate();
17287
16213
  }, [deactivate]);
17288
- const openLinkPopoverForSelected = (0, import_react16.useCallback)(() => {
16214
+ const openLinkPopoverForSelected = (0, import_react15.useCallback)(() => {
17289
16215
  const anchor = selectedElRef.current;
17290
16216
  if (!anchor) return;
17291
16217
  const key = anchor.getAttribute("data-ohw-href-key");
@@ -17298,7 +16224,7 @@ function OhhwellsBridge() {
17298
16224
  });
17299
16225
  deselect();
17300
16226
  }, [deselect]);
17301
- const handleSelectParent = (0, import_react16.useCallback)(() => {
16227
+ const handleSelectParent = (0, import_react15.useCallback)(() => {
17302
16228
  const selected = selectedElRef.current;
17303
16229
  if (!selected) return;
17304
16230
  if (toolbarVariantRef.current === "select-frame") {
@@ -17325,7 +16251,7 @@ function OhhwellsBridge() {
17325
16251
  }
17326
16252
  deselectRef.current();
17327
16253
  }, []);
17328
- const handleDuplicateSelected = (0, import_react16.useCallback)(() => {
16254
+ const handleDuplicateSelected = (0, import_react15.useCallback)(() => {
17329
16255
  const selected = selectedElRef.current;
17330
16256
  if (!selected || !isNavigationItem2(selected)) return;
17331
16257
  const hrefKey = selected.getAttribute("data-ohw-href-key");
@@ -17415,7 +16341,7 @@ function OhhwellsBridge() {
17415
16341
  });
17416
16342
  }
17417
16343
  }, [postToParent2]);
17418
- const runPendingDeleteUndo = (0, import_react16.useCallback)(() => {
16344
+ const runPendingDeleteUndo = (0, import_react15.useCallback)(() => {
17419
16345
  const pending = pendingDeleteUndoRef.current;
17420
16346
  if (!pending) return false;
17421
16347
  pendingDeleteUndoRef.current = null;
@@ -17423,7 +16349,7 @@ function OhhwellsBridge() {
17423
16349
  enforceLinkHrefs();
17424
16350
  return true;
17425
16351
  }, []);
17426
- const handleDeleteSelected = (0, import_react16.useCallback)(() => {
16352
+ const handleDeleteSelected = (0, import_react15.useCallback)(() => {
17427
16353
  const selected = selectedElRef.current;
17428
16354
  if (!selected) return false;
17429
16355
  return deleteSelectedNavFooterItem({
@@ -17444,7 +16370,7 @@ function OhhwellsBridge() {
17444
16370
  }, [postToParent2]);
17445
16371
  handleDeleteSelectedRef.current = handleDeleteSelected;
17446
16372
  runPendingDeleteUndoRef.current = runPendingDeleteUndo;
17447
- const handleLinkPopoverSubmit = (0, import_react16.useCallback)(
16373
+ const handleLinkPopoverSubmit = (0, import_react15.useCallback)(
17448
16374
  (target) => {
17449
16375
  const session = linkPopoverSessionRef.current;
17450
16376
  if (!session) return;
@@ -17510,19 +16436,19 @@ function OhhwellsBridge() {
17510
16436
  const showEditLink = toolbarShowEditLink;
17511
16437
  const currentSections = sectionsByPath[pathname] ?? [];
17512
16438
  linkPopoverOpenRef.current = linkPopover !== null;
17513
- const handleMediaReplace = (0, import_react16.useCallback)(
16439
+ const handleMediaReplace = (0, import_react15.useCallback)(
17514
16440
  (key) => {
17515
16441
  postToParent2({ type: "ow:image-pick", key, elementType: mediaHover?.elementType ?? "image" });
17516
16442
  },
17517
16443
  [postToParent2, mediaHover?.elementType]
17518
16444
  );
17519
- const handleEditCarousel = (0, import_react16.useCallback)(
16445
+ const handleEditCarousel = (0, import_react15.useCallback)(
17520
16446
  (key) => {
17521
16447
  postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
17522
16448
  },
17523
16449
  [postToParent2]
17524
16450
  );
17525
- const handleMediaFadeOutComplete = (0, import_react16.useCallback)((key) => {
16451
+ const handleMediaFadeOutComplete = (0, import_react15.useCallback)((key) => {
17526
16452
  setUploadingRects((prev) => {
17527
16453
  if (!(key in prev)) return prev;
17528
16454
  const next = { ...prev };
@@ -17530,7 +16456,7 @@ function OhhwellsBridge() {
17530
16456
  return next;
17531
16457
  });
17532
16458
  }, []);
17533
- const handleVideoSettingsChange = (0, import_react16.useCallback)(
16459
+ const handleVideoSettingsChange = (0, import_react15.useCallback)(
17534
16460
  (key, settings) => {
17535
16461
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
17536
16462
  const video = getVideoEl2(el);
@@ -17553,10 +16479,10 @@ function OhhwellsBridge() {
17553
16479
  [postToParent2]
17554
16480
  );
17555
16481
  return bridgeRoot ? (0, import_react_dom4.createPortal)(
17556
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
17557
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
17558
- isEditMode && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
17559
- Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16482
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
16483
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
16484
+ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
16485
+ Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17560
16486
  MediaOverlay,
17561
16487
  {
17562
16488
  hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
@@ -17567,7 +16493,7 @@ function OhhwellsBridge() {
17567
16493
  },
17568
16494
  `uploading-${key}`
17569
16495
  )),
17570
- mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16496
+ mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17571
16497
  MediaOverlay,
17572
16498
  {
17573
16499
  hover: mediaHover,
@@ -17576,11 +16502,11 @@ function OhhwellsBridge() {
17576
16502
  onVideoSettingsChange: handleVideoSettingsChange
17577
16503
  }
17578
16504
  ),
17579
- carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
17580
- siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
17581
- siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
17582
- isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
17583
- isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16505
+ carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
16506
+ siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
16507
+ siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
16508
+ isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
16509
+ isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17584
16510
  "div",
17585
16511
  {
17586
16512
  className: "pointer-events-none fixed z-2147483646",
@@ -17590,7 +16516,7 @@ function OhhwellsBridge() {
17590
16516
  width: slot.width,
17591
16517
  height: slot.height
17592
16518
  },
17593
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16519
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17594
16520
  DropIndicator,
17595
16521
  {
17596
16522
  direction: slot.direction,
@@ -17601,7 +16527,7 @@ function OhhwellsBridge() {
17601
16527
  },
17602
16528
  `footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
17603
16529
  )),
17604
- isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16530
+ isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17605
16531
  "div",
17606
16532
  {
17607
16533
  className: "pointer-events-none fixed z-2147483646",
@@ -17611,7 +16537,7 @@ function OhhwellsBridge() {
17611
16537
  width: slot.width,
17612
16538
  height: slot.height
17613
16539
  },
17614
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16540
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17615
16541
  DropIndicator,
17616
16542
  {
17617
16543
  direction: slot.direction,
@@ -17622,10 +16548,10 @@ function OhhwellsBridge() {
17622
16548
  },
17623
16549
  `nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
17624
16550
  )),
17625
- hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
17626
- hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
17627
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
17628
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16551
+ hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
16552
+ hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
16553
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
16554
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17629
16555
  FooterContainerChrome,
17630
16556
  {
17631
16557
  rect: toolbarRect,
@@ -17633,7 +16559,7 @@ function OhhwellsBridge() {
17633
16559
  addDisabled: !canAddFooterColumn()
17634
16560
  }
17635
16561
  ),
17636
- toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16562
+ toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17637
16563
  ItemInteractionLayer,
17638
16564
  {
17639
16565
  rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
@@ -17645,10 +16571,10 @@ function OhhwellsBridge() {
17645
16571
  dragHandleLabel: reorderHrefKey ? `Reorder ${reorderHrefKey}` : "Reorder item",
17646
16572
  onDragHandleDragStart: handleItemDragStart,
17647
16573
  onDragHandleDragEnd: handleItemDragEnd,
17648
- onItemPointerDown: toolbarVariant === "logo" ? void 0 : handleItemChromePointerDown,
17649
- onItemClick: toolbarVariant === "logo" ? void 0 : handleItemChromeClick,
17650
- itemDragSurface: toolbarVariant !== "logo" && !isFooterFrameSelection,
17651
- toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16574
+ onItemPointerDown: handleItemChromePointerDown,
16575
+ onItemClick: handleItemChromeClick,
16576
+ itemDragSurface: !isFooterFrameSelection,
16577
+ toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17652
16578
  ItemActionToolbar,
17653
16579
  {
17654
16580
  onEditLink: openLinkPopoverForSelected,
@@ -17673,8 +16599,8 @@ function OhhwellsBridge() {
17673
16599
  ) : void 0
17674
16600
  }
17675
16601
  ),
17676
- toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
17677
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16602
+ toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
16603
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17678
16604
  EditGlowChrome,
17679
16605
  {
17680
16606
  rect: toolbarRect,
@@ -17684,7 +16610,7 @@ function OhhwellsBridge() {
17684
16610
  hideHandle: isItemDragging
17685
16611
  }
17686
16612
  ),
17687
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16613
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17688
16614
  FloatingToolbar,
17689
16615
  {
17690
16616
  rect: toolbarRect,
@@ -17697,7 +16623,7 @@ function OhhwellsBridge() {
17697
16623
  }
17698
16624
  )
17699
16625
  ] }),
17700
- maxBadge && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
16626
+ maxBadge && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
17701
16627
  "div",
17702
16628
  {
17703
16629
  "data-ohw-max-badge": "",
@@ -17723,7 +16649,7 @@ function OhhwellsBridge() {
17723
16649
  ]
17724
16650
  }
17725
16651
  ),
17726
- toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16652
+ toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17727
16653
  StateToggle,
17728
16654
  {
17729
16655
  rect: toggleState.rect,
@@ -17732,15 +16658,15 @@ function OhhwellsBridge() {
17732
16658
  onStateChange: handleStateChange
17733
16659
  }
17734
16660
  ),
17735
- sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
16661
+ sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
17736
16662
  "div",
17737
16663
  {
17738
16664
  "data-ohw-section-insert-line": "",
17739
16665
  className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
17740
16666
  style: { top: sectionGap.y, transform: "translateY(-50%)" },
17741
16667
  children: [
17742
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
17743
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16668
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
16669
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17744
16670
  Badge,
17745
16671
  {
17746
16672
  className: "px-8 py-1 bg-primary hover:bg-primary text-primary-foreground text-xs font-medium shrink-0 rounded-full cursor-pointer pointer-events-auto",
@@ -17757,11 +16683,11 @@ function OhhwellsBridge() {
17757
16683
  children: "Add Section"
17758
16684
  }
17759
16685
  ),
17760
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
16686
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
17761
16687
  ]
17762
16688
  }
17763
16689
  ),
17764
- linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
16690
+ linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17765
16691
  LinkPopover,
17766
16692
  {
17767
16693
  panelRef: linkPopoverPanelRef,
@@ -17777,115 +16703,11 @@ function OhhwellsBridge() {
17777
16703
  onSubmit: handleLinkPopoverSubmit
17778
16704
  },
17779
16705
  linkPopover.key
17780
- ) : null,
17781
- floatingPanel && floatingPanel.kind === "logo-size" && logoSizeDraft ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17782
- FloatingPanel,
17783
- {
17784
- open: true,
17785
- title: floatingPanel.title,
17786
- context: floatingPanel.context,
17787
- position: floatingPanelPos,
17788
- onPositionChange: setFloatingPanelPos,
17789
- parentScroll: parentScrollSnap ?? parentScrollRef.current,
17790
- onClose: closeFloatingPanelAndDeselect,
17791
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17792
- LogoSizePanel,
17793
- {
17794
- viewport: editorViewport,
17795
- sizePx: editorViewport === "mobile" && !logoSizeDraft.mobileFollowing ? logoSizeDraft.mobilePx : logoSizeDraft.desktopPx,
17796
- mobileFollowing: logoSizeDraft.mobileFollowing,
17797
- onSizeChange: (px) => {
17798
- const next = editorViewport === "mobile" ? { ...logoSizeDraft, mobilePx: px, mobileFollowing: false } : {
17799
- ...logoSizeDraft,
17800
- desktopPx: px,
17801
- mobilePx: logoSizeDraft.mobileFollowing ? px : logoSizeDraft.mobilePx
17802
- };
17803
- setLogoSizeDraft(next);
17804
- persistLogoSizeDraft(floatingPanel.placement, next);
17805
- },
17806
- onCustomizeMobile: () => {
17807
- const next = {
17808
- ...logoSizeDraft,
17809
- mobileFollowing: false,
17810
- mobilePx: logoSizeDraft.desktopPx
17811
- };
17812
- setLogoSizeDraft(next);
17813
- persistLogoSizeDraft(floatingPanel.placement, next);
17814
- },
17815
- onResetMobile: () => {
17816
- const next = {
17817
- ...logoSizeDraft,
17818
- mobileFollowing: true,
17819
- mobilePx: logoSizeDraft.desktopPx
17820
- };
17821
- setLogoSizeDraft(next);
17822
- persistLogoSizeDraft(floatingPanel.placement, next);
17823
- },
17824
- onUpdateEverywhere: () => {
17825
- const identity = readLogoIdentityFromDom();
17826
- postToParent2({ type: "ow:open-logo-settings", ...identity });
17827
- }
17828
- }
17829
- )
17830
- }
17831
16706
  ) : null
17832
16707
  ] }),
17833
16708
  bridgeRoot
17834
16709
  ) : null;
17835
16710
  }
17836
-
17837
- // src/ui/EmptySection.tsx
17838
- var import_link = __toESM(require("next/link"), 1);
17839
- var import_jsx_runtime33 = require("react/jsx-runtime");
17840
- function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
17841
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
17842
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17843
- "p",
17844
- {
17845
- style: {
17846
- fontFamily: "var(--brand-font-body)",
17847
- fontSize: "0.75rem",
17848
- fontWeight: 500,
17849
- letterSpacing: "0.15em",
17850
- textTransform: "uppercase",
17851
- color: "var(--brand-accent)",
17852
- marginBottom: "1.5rem"
17853
- },
17854
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_link.default, { href: homeHref, style: { color: "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { ...eyebrowKey ? { "data-ohw-editable": "text", "data-ohw-key": eyebrowKey } : {}, children: "Home" }) })
17855
- }
17856
- ),
17857
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17858
- "h1",
17859
- {
17860
- style: {
17861
- fontFamily: "var(--brand-font-heading)",
17862
- fontSize: "clamp(2rem, 3.5vw, 2.75rem)",
17863
- lineHeight: 1.1,
17864
- letterSpacing: "-0.025em",
17865
- color: "var(--brand-text)",
17866
- marginBottom: "1rem"
17867
- },
17868
- ...titleKey ? { "data-ohw-editable": "text", "data-ohw-key": titleKey, "data-ohw-max-length": 80 } : {},
17869
- children: title
17870
- }
17871
- ),
17872
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17873
- "p",
17874
- {
17875
- style: {
17876
- fontFamily: "var(--brand-font-body)",
17877
- fontSize: "1rem",
17878
- lineHeight: 1.7,
17879
- fontWeight: 300,
17880
- color: "var(--brand-text-muted)",
17881
- maxWidth: "340px"
17882
- },
17883
- ...subtitleKey ? { "data-ohw-editable": "text", "data-ohw-key": subtitleKey, "data-ohw-max-length": 160 } : {},
17884
- children: "This page doesn't have any content yet."
17885
- }
17886
- )
17887
- ] });
17888
- }
17889
16711
  // Annotate the CommonJS export names for ESM import in node:
17890
16712
  0 && (module.exports = {
17891
16713
  AI_DEFAULT_BRAND,
@@ -17903,7 +16725,6 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
17903
16725
  DropdownMenuItem,
17904
16726
  DropdownMenuSeparator,
17905
16727
  DropdownMenuTrigger,
17906
- EmptySection,
17907
16728
  ItemActionToolbar,
17908
16729
  ItemInteractionLayer,
17909
16730
  LinkEditorPanel,