@base44/vite-plugin 1.0.15 → 1.0.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"page-height-bridge.d.ts","sourceRoot":"","sources":["../../src/injections/page-height-bridge.ts"],"names":[],"mappings":"AA2BA,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAYF;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,IAAI,CAuClD;AAED,wBAAgB,gCAAgC,IAAI,0BAA0B,CAyC7E"}
1
+ {"version":3,"file":"page-height-bridge.d.ts","sourceRoot":"","sources":["../../src/injections/page-height-bridge.ts"],"names":[],"mappings":"AA4BA,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAyBF;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,IAAI,CAuClD;AAED,wBAAgB,gCAAgC,IAAI,0BAA0B,CA2F7E"}
@@ -3,10 +3,11 @@
3
3
  // fire on their own.
4
4
  //
5
5
  // parent → child { type: "freeze-vh-units", referenceVhBase?: number }
6
- // Rewrites every `vh` in <style> + CSSOM to a CSS variable-backed
7
- // expression (kills the vh auto-resize feedback loop). Repeated calls
8
- // update the variable, so callers can rebase without recovering raw CSS.
9
- // Idempotent; covers HMR-added styles too. Fire-and-forget.
6
+ // Rewrites every viewport-height unit (`vh`/`dvh`/`svh`/`lvh`) in
7
+ // <style> + CSSOM to a CSS variable-backed expression (kills the
8
+ // vh auto-resize feedback loop). Repeated calls update the variable,
9
+ // so callers can rebase without recovering raw CSS. Idempotent; covers
10
+ // HMR-added styles too. Fire-and-forget.
10
11
  //
11
12
  // parent → child { type: "measure-page-height", settleMs?: number }
12
13
  // After `settleMs` (default 2000) posts the page's measured content height
@@ -15,6 +16,19 @@ const FALLBACK_VHBASE = 900;
15
16
  const MIN_VHBASE = 400;
16
17
  const DEFAULT_SETTLE_MS = 2000;
17
18
  const NEUTRALIZE_DEBOUNCE_MS = 16;
19
+ // Three consecutive same-height samples ≈ ~50ms of "no change". Three is
20
+ // enough to filter single-frame jitter from layout passes but short enough
21
+ // that responses arrive promptly when the DOM is already settled.
22
+ const STABILITY_SAMPLES = 3;
23
+ // Interval between stability samples. ~1 frame at 60Hz; chosen as a plain
24
+ // setTimeout (not rAF) because jsdom rAFs are unreliably timed for tests and
25
+ // in real browsers a 16ms tick is post-layout for any layout work that fits
26
+ // inside one frame.
27
+ const STABILITY_TICK_MS = 16;
28
+ // Hard cap on the stability poll past settleMs. Pages that genuinely never
29
+ // stabilize (looping height-animating content) reply with their last sample
30
+ // rather than hanging the parent's resize logic.
31
+ const STABILITY_MAX_WAIT_MS = 1500;
18
32
  const REFERENCE_VH_BASE_VAR = "--base44-reference-vh-base";
19
33
  const noop = () => { };
20
34
  let started = false;
@@ -65,8 +79,19 @@ export function setupPageHeightBridge() {
65
79
  export function createPageHeightBridgeController() {
66
80
  let vhCleanups = null;
67
81
  let vhForceRun = null;
68
- let pendingResponse;
82
+ let pendingSettle;
83
+ let pendingTick;
69
84
  let pendingOrigin = "*";
85
+ const cancelPending = () => {
86
+ if (pendingSettle !== undefined) {
87
+ window.clearTimeout(pendingSettle);
88
+ pendingSettle = undefined;
89
+ }
90
+ if (pendingTick !== undefined) {
91
+ window.clearTimeout(pendingTick);
92
+ pendingTick = undefined;
93
+ }
94
+ };
70
95
  return {
71
96
  freezeVhUnits: (override) => {
72
97
  const referenceVhBase = resolveReferenceVhBase(override);
@@ -81,15 +106,48 @@ export function createPageHeightBridgeController() {
81
106
  // Target the requester's origin so the height isn't broadcast to anyone
82
107
  // who happens to embed us. Falls back to "*" when origin is unavailable
83
108
  // (jsdom default, sandboxed iframes with `null` origin).
109
+ //
110
+ // Stability-wait response: after `settleMs`, poll measureContentHeight at
111
+ // STABILITY_TICK_MS intervals until it's unchanged for STABILITY_SAMPLES
112
+ // consecutive ticks, then send exactly one reply. Catches late React
113
+ // mounts (sticky-positioned sections committing after settleMs), debounced
114
+ // neutralizer mutations not yet flushed, image/font-driven layout shifts.
115
+ // STABILITY_MAX_WAIT_MS caps the poll so a page that genuinely never
116
+ // settles still replies eventually.
84
117
  measurePageHeight: (origin, settleMs = DEFAULT_SETTLE_MS) => {
85
118
  pendingOrigin = origin;
86
- if (pendingResponse !== undefined)
87
- window.clearTimeout(pendingResponse);
88
- pendingResponse = window.setTimeout(() => {
89
- requestAnimationFrame(() => {
90
- const height = measureContentHeight();
119
+ cancelPending();
120
+ pendingSettle = window.setTimeout(() => {
121
+ pendingSettle = undefined;
122
+ // Flush any debounced unscroll / inline-vh rewrites NOW so the first
123
+ // sample sees a DOM that reflects every mutation triggered during the
124
+ // settle window. Without this, an `overflow-y: scroll` container that
125
+ // mounted mid-settle can still be hiding its children at sample time.
126
+ vhForceRun?.();
127
+ const deadline = nowMs() + STABILITY_MAX_WAIT_MS;
128
+ let lastHeight = -1;
129
+ let stableSamples = 0;
130
+ const respond = (height) => {
131
+ pendingTick = undefined;
91
132
  window.parent.postMessage({ type: "page-height-measured", height }, pendingOrigin);
92
- });
133
+ };
134
+ const tick = () => {
135
+ pendingTick = undefined;
136
+ const height = measureContentHeight();
137
+ if (height === lastHeight) {
138
+ stableSamples++;
139
+ }
140
+ else {
141
+ stableSamples = 1;
142
+ lastHeight = height;
143
+ }
144
+ if (stableSamples >= STABILITY_SAMPLES || nowMs() >= deadline) {
145
+ respond(height);
146
+ return;
147
+ }
148
+ pendingTick = window.setTimeout(tick, STABILITY_TICK_MS);
149
+ };
150
+ tick();
93
151
  }, settleMs);
94
152
  },
95
153
  teardown: () => {
@@ -99,11 +157,16 @@ export function createPageHeightBridgeController() {
99
157
  vhCleanups = null;
100
158
  vhForceRun = null;
101
159
  }
102
- if (pendingResponse !== undefined)
103
- window.clearTimeout(pendingResponse);
160
+ cancelPending();
104
161
  },
105
162
  };
106
163
  }
164
+ function nowMs() {
165
+ if (typeof performance !== "undefined" && typeof performance.now === "function") {
166
+ return performance.now();
167
+ }
168
+ return Date.now();
169
+ }
107
170
  function resolveReferenceVhBase(override) {
108
171
  if (override !== undefined)
109
172
  return override;
@@ -119,13 +182,62 @@ function setReferenceVhBase(referenceVhBase) {
119
182
  // parent requests (idempotent — already-rewritten text is skipped via the
120
183
  // processed sets).
121
184
  function startVhNeutralizer(cleanups) {
122
- const VH_RE = /(\d+(?:\.\d+)?)vh\b/g;
185
+ // Match vh + the dynamic/small/large variants. Tailwind v4 emits `h-screen`
186
+ // as `100dvh`; all four collapse to the same frozen `referenceVhBase`.
187
+ const VH_RE = /(\d+(?:\.\d+)?)(?:d|s|l)?vh\b/g;
123
188
  const processedStyles = new WeakSet();
124
189
  const processedSheets = new WeakMap();
125
190
  const watchedStyles = new WeakSet();
126
191
  const styleObservers = new Set();
192
+ const unscrolled = new WeakSet();
193
+ const rewrite = (input) => input.replace(VH_RE, (_match, n) => `calc(var(${REFERENCE_VH_BASE_VAR}) * ${formatVhFactor(n)})`);
194
+ // Defeats internal vertical scrollers. The canvas wants the whole page laid
195
+ // out top-to-bottom, but `<div class="overflow-y-auto" style={{height:
196
+ // "100vh"}}>` hides its children behind an internal scrollbar — only the
197
+ // first child appears in the preview. Forcing `overflow-y: visible` lets
198
+ // children paint outside the parent's box; block flow positions them at
199
+ // their natural offsets so document.body extends to include them. `auto`
200
+ // and `scroll` only — `hidden` and `clip` express intentional clipping (UI
201
+ // chrome, rounded-corner masks) we shouldn't undo.
202
+ const unscrollY = (el) => {
203
+ if (unscrolled.has(el))
204
+ return;
205
+ const computedStyle = window.getComputedStyle(el);
206
+ const ovY = computedStyle.overflowY;
207
+ if (ovY !== "auto" && ovY !== "scroll")
208
+ return;
209
+ unscrolled.add(el);
210
+ el.style.setProperty("overflow-y", "visible", "important");
211
+ };
212
+ const unscrollSubtree = (root) => {
213
+ unscrollY(root);
214
+ root.querySelectorAll("*").forEach(unscrollY);
215
+ };
216
+ // Rewrites vh-bearing properties on a single element's inline style. Covers
217
+ // React's `style={{ height: "100vh" }}` and imperative `el.style.h = ".vh"`
218
+ // — both bypass <style> tags and CSSOM. Per-property setProperty preserves
219
+ // `!important`. Snapshotting prop names first guards against iteration-time
220
+ // mutation of `style.length`.
221
+ const rewriteInlineStyle = (el) => {
222
+ const style = el.style;
223
+ if (!style || style.length === 0)
224
+ return;
225
+ const props = [];
226
+ for (let i = 0; i < style.length; i++) {
227
+ const prop = style[i];
228
+ if (prop)
229
+ props.push(prop);
230
+ }
231
+ for (const prop of props) {
232
+ const value = style.getPropertyValue(prop);
233
+ if (!value || value.indexOf("vh") === -1)
234
+ continue;
235
+ const next = rewrite(value);
236
+ if (next !== value)
237
+ style.setProperty(prop, next, style.getPropertyPriority(prop));
238
+ }
239
+ };
127
240
  const neutralize = () => {
128
- const rewrite = (input) => input.replace(VH_RE, (_match, n) => `calc(var(${REFERENCE_VH_BASE_VAR}) * ${formatVhFactor(n)})`);
129
241
  document.querySelectorAll("style").forEach((el) => {
130
242
  watchStyleEl(el);
131
243
  if (processedStyles.has(el))
@@ -154,6 +266,14 @@ function startVhNeutralizer(cleanups) {
154
266
  rewriteVhInRules(rules, rewrite);
155
267
  processedSheets.set(sheet, rules.length);
156
268
  }
269
+ // Initial sweep of inline `style="...vh..."` attributes already in the DOM
270
+ // at freeze time. Future inline-style mutations (React commits, motion
271
+ // libraries, imperative assignments) are picked up by inlineStyleObserver.
272
+ document.querySelectorAll('[style*="vh"]').forEach(rewriteInlineStyle);
273
+ // Defeat internal scrollers — same dual coverage (initial sweep here,
274
+ // subtree additions in inlineStyleObserver).
275
+ if (document.body)
276
+ unscrollSubtree(document.body);
157
277
  };
158
278
  const debouncer = createDebouncer(neutralize, NEUTRALIZE_DEBOUNCE_MS);
159
279
  const debouncedNeutralize = debouncer.trigger;
@@ -201,6 +321,61 @@ function startVhNeutralizer(cleanups) {
201
321
  document.addEventListener("DOMContentLoaded", attachHeadObserver);
202
322
  cleanups.push(() => document.removeEventListener("DOMContentLoaded", attachHeadObserver));
203
323
  }
324
+ // Pass 3: inline `style` attributes. One global observer covers every
325
+ // element — past, present, and future — without per-node tracking. Two
326
+ // mutation kinds matter:
327
+ // • attributes: React/JS sets `style` on an element already in the tree
328
+ // (`el.style.h = "..vh"`, re-render diff). After rewrite the value has
329
+ // no "vh", so the next mutation gates out — single-tick convergence.
330
+ // • childList: a node is mounted with its `style` attribute already set
331
+ // off-tree (React's initial mount path uses createElement+setAttribute
332
+ // BEFORE appendChild, so attribute mutations never fire for them). Scan
333
+ // the added subtree for `[style*="vh"]` and rewrite.
334
+ // Microtask delivery means rewrites land before layout, so no flash.
335
+ const scanSubtreeForInlineVh = (node) => {
336
+ if (!(node instanceof Element))
337
+ return;
338
+ const attr = node.getAttribute("style");
339
+ if (attr && attr.indexOf("vh") !== -1)
340
+ rewriteInlineStyle(node);
341
+ node.querySelectorAll('[style*="vh"]').forEach(rewriteInlineStyle);
342
+ // New subtrees may introduce overflow-y: auto|scroll containers (route
343
+ // changes, conditional UI). Catch them here too.
344
+ unscrollSubtree(node);
345
+ };
346
+ const inlineStyleObserver = new MutationObserver((mutations) => {
347
+ for (const m of mutations) {
348
+ if (m.type === "attributes") {
349
+ const target = m.target;
350
+ if (!(target instanceof Element))
351
+ continue;
352
+ const attr = target.getAttribute("style");
353
+ if (!attr || attr.indexOf("vh") === -1)
354
+ continue;
355
+ rewriteInlineStyle(target);
356
+ }
357
+ else if (m.type === "childList") {
358
+ for (let i = 0; i < m.addedNodes.length; i++) {
359
+ const node = m.addedNodes[i];
360
+ if (node)
361
+ scanSubtreeForInlineVh(node);
362
+ }
363
+ }
364
+ }
365
+ });
366
+ cleanups.push(() => inlineStyleObserver.disconnect());
367
+ const attachInlineStyleObserver = () => {
368
+ const root = document.documentElement;
369
+ if (!root)
370
+ return;
371
+ inlineStyleObserver.observe(root, {
372
+ attributes: true,
373
+ attributeFilter: ["style"],
374
+ childList: true,
375
+ subtree: true,
376
+ });
377
+ };
378
+ attachInlineStyleObserver();
204
379
  return debouncedNeutralize;
205
380
  }
206
381
  function formatVhFactor(value) {
@@ -239,9 +414,13 @@ function containsStylesheetNode(nodes) {
239
414
  }
240
415
  function measureContentHeight() {
241
416
  const scrollHeight = Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight ?? 0);
242
- const viewportHeight = Math.max(window.innerHeight || 0, document.documentElement.clientHeight, document.body?.clientHeight ?? 0);
243
- const contentBottom = measureElementContentBottom(viewportHeight);
244
417
  const referenceVhBase = readReferenceVhBase();
418
+ // Excludes `body.clientHeight`: it grows with content, which makes
419
+ // viewportBottom land at the document bottom and trips the stretched-
420
+ // container heuristic on the last section. `referenceVhBase` keeps the
421
+ // h-screen-wrapper case covered when the iframe is shorter than 100vh.
422
+ const viewportHeight = Math.max(window.innerHeight || 0, document.documentElement.clientHeight, referenceVhBase);
423
+ const contentBottom = measureElementContentBottom(viewportHeight);
245
424
  if (contentBottom > 0)
246
425
  return Math.ceil(Math.max(contentBottom, referenceVhBase));
247
426
  return Math.ceil(Math.max(scrollHeight, referenceVhBase));
@@ -262,10 +441,10 @@ function measureElementContentBottom(viewportHeight) {
262
441
  if (!el)
263
442
  continue;
264
443
  const childContentBottom = readChildrenContentBottom(el, contentBottoms);
265
- const rawBottom = readElementBottom(el);
266
- const selfBottom = isViewportStretchedContainer(rawBottom, childContentBottom, viewportBottom)
444
+ const metrics = readElementMetrics(el);
445
+ const selfBottom = isViewportStretchedContainer(metrics, childContentBottom, viewportHeight, viewportBottom)
267
446
  ? 0
268
- : rawBottom;
447
+ : metrics.bottom;
269
448
  contentBottoms.set(el, Math.max(childContentBottom, selfBottom));
270
449
  }
271
450
  return contentBottoms.get(document.body) ?? 0;
@@ -280,14 +459,17 @@ function readChildrenContentBottom(el, contentBottoms) {
280
459
  }
281
460
  return childContentBottom;
282
461
  }
283
- function readElementBottom(el) {
462
+ function readElementMetrics(el) {
284
463
  const computedStyle = window.getComputedStyle(el);
285
464
  if (isOutOfFlowDecoration(computedStyle))
286
- return 0;
465
+ return { bottom: 0, height: 0 };
287
466
  const rect = el.getBoundingClientRect();
288
467
  if (rect.width === 0 && rect.height === 0)
289
- return 0;
290
- return rect.bottom + window.scrollY + readMarginBottom(computedStyle);
468
+ return { bottom: 0, height: 0 };
469
+ return {
470
+ bottom: rect.bottom + window.scrollY + readMarginBottom(computedStyle),
471
+ height: rect.height,
472
+ };
291
473
  }
292
474
  function readMarginBottom(computedStyle) {
293
475
  const marginBottom = parseFloat(computedStyle.marginBottom);
@@ -298,10 +480,16 @@ function isOutOfFlowDecoration(computedStyle) {
298
480
  return true;
299
481
  return computedStyle.position === "absolute" && computedStyle.pointerEvents === "none";
300
482
  }
301
- function isViewportStretchedContainer(elementBottom, childBottom, viewportBottom) {
483
+ // A "stretched container" spans the full viewport top-to-bottom. Requires
484
+ // BOTH `bottom ≈ viewportBottom` AND `height ≈ viewportHeight` — otherwise an
485
+ // in-flow section that just happens to end at viewportBottom (e.g. when the
486
+ // iframe has been content-sized to the previous measurement) gets falsely
487
+ // filtered, undermeasuring the page.
488
+ function isViewportStretchedContainer(metrics, childBottom, viewportHeight, viewportBottom) {
302
489
  return (childBottom > 0 &&
303
- Math.abs(elementBottom - viewportBottom) <= 1 &&
304
- elementBottom - childBottom > 8);
490
+ Math.abs(metrics.bottom - viewportBottom) <= 1 &&
491
+ Math.abs(metrics.height - viewportHeight) <= 1 &&
492
+ metrics.bottom - childBottom > 8);
305
493
  }
306
494
  function createDebouncer(fn, delayMs) {
307
495
  let timer;
@@ -1 +1 @@
1
- {"version":3,"file":"page-height-bridge.js","sourceRoot":"","sources":["../../src/injections/page-height-bridge.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,qBAAqB;AACrB,EAAE;AACF,0EAA0E;AAC1E,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,gEAAgE;AAChE,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,sEAAsE;AAqBtE,MAAM,eAAe,GAAW,GAAG,CAAC;AACpC,MAAM,UAAU,GAAW,GAAG,CAAC;AAC/B,MAAM,iBAAiB,GAAW,IAAI,CAAC;AACvC,MAAM,sBAAsB,GAAW,EAAE,CAAC;AAC1C,MAAM,qBAAqB,GAAW,4BAA4B,CAAC;AAEnE,MAAM,IAAI,GAAe,GAAS,EAAE,GAAE,CAAC,CAAC;AAExC,IAAI,OAAO,GAAY,KAAK,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,OAAO;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,GAAG,IAAI,CAAC;IAEf,MAAM,UAAU,GAA+B,gCAAgC,EAAE,CAAC;IAElF,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAQ,EAAE;QAC9C,MAAM,IAAI,GAA2B,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAA2B,CAAC;QACpF,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO;QAC9C,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,iBAAiB,CAAC,CAAC,CAAC;gBACvB,MAAM,QAAQ,GACZ,OAAO,IAAI,CAAC,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AAS,4BAA4B,CACnC,OAAuB,EACvB,WAAmB,EACnB,cAAsB,EACtB,cAAsB;IAEtB,OAAO,CACL,WAAW,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC;QAC9C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC;QAC9C,OAAO,CAAC,MAAM,GAAG,WAAW,GAAG,CAAC,CACjC,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,EAAc,EAAE,OAAe;IACtD,IAAI,KAAyB,CAAC;IAC9B,OAAO;QACL,OAAO,EAAE,GAAS,EAAE;YAClB,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACpD,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,EAAE,GAAS,EAAE;YACjB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,SAAS,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,16 +1,16 @@
1
- function ae(e,t){let n=t.top<27,i=t.height>=54,l=t.width>=window.innerWidth-4,d=l?"8px":"-2px",m=l?"8px":"4px";n&&i?(e.style.top="2px",e.style.left=m):n?(e.style.top=`${t.height+2}px`,e.style.left=d):(e.style.top="-27px",e.style.left=d)}function z(e){let t=e;return!!(t.dataset?.sourceLocation||t.dataset?.visualSelectorId)}function S(e){let t=e;return t.dataset?.sourceLocation||t.dataset?.visualSelectorId||null}var U=["src"],T="data-vite-plugin-element";function C(e){if(!e)return[];let t=Array.from(document.querySelectorAll(`[data-source-location="${e}"]`));return t.length>0?t:Array.from(document.querySelectorAll(`[data-visual-selector-id="${e}"]`))}function de(e,t){e.forEach(n=>{n.setAttribute("class",t)})}function ce(e,t,n){U.includes(t)&&e.forEach(i=>{i.setAttribute(t,n)})}function ue(e,t){let n={};for(let i of t){let l=e.getAttribute(i);l!==null&&(n[i]=l)}return n}function me(){if(document.getElementById("freeze-animations"))return;document.documentElement.setAttribute("data-visual-edit-active","");let e=document.createElement("style");e.id="freeze-animations",e.textContent=`
2
- [data-visual-edit-active] *:not([${T}]):not([${T}] *),
3
- [data-visual-edit-active] *:not([${T}]):not([${T}] *)::before,
4
- [data-visual-edit-active] *:not([${T}]):not([${T}] *)::after {
1
+ function ce(e,t){let n=t.top<27,i=t.height>=54,a=t.width>=window.innerWidth-4,c=a?"8px":"-2px",u=a?"8px":"4px";n&&i?(e.style.top="2px",e.style.left=u):n?(e.style.top=`${t.height+2}px`,e.style.left=c):(e.style.top="-27px",e.style.left=c)}function U(e){let t=e;return!!(t.dataset?.sourceLocation||t.dataset?.visualSelectorId)}function x(e){let t=e;return t.dataset?.sourceLocation||t.dataset?.visualSelectorId||null}var G=["src"],M="data-vite-plugin-element";function H(e){if(!e)return[];let t=Array.from(document.querySelectorAll(`[data-source-location="${e}"]`));return t.length>0?t:Array.from(document.querySelectorAll(`[data-visual-selector-id="${e}"]`))}function ue(e,t){e.forEach(n=>{n.setAttribute("class",t)})}function me(e,t,n){G.includes(t)&&e.forEach(i=>{i.setAttribute(t,n)})}function fe(e,t){let n={};for(let i of t){let a=e.getAttribute(i);a!==null&&(n[i]=a)}return n}function pe(){if(document.getElementById("freeze-animations"))return;document.documentElement.setAttribute("data-visual-edit-active","");let e=document.createElement("style");e.id="freeze-animations",e.textContent=`
2
+ [data-visual-edit-active] *:not([${M}]):not([${M}] *),
3
+ [data-visual-edit-active] *:not([${M}]):not([${M}] *)::before,
4
+ [data-visual-edit-active] *:not([${M}]):not([${M}] *)::after {
5
5
  animation-play-state: paused !important;
6
6
  transition: none !important;
7
7
  }
8
8
  `;let t=document.createElement("style");t.id="freeze-pointer-events",t.textContent=`
9
9
  [data-visual-edit-active] * { pointer-events: none !important; }
10
- [${T}], [${T}] * { pointer-events: auto !important; }
11
- `;let n=document.head||document.documentElement;n.appendChild(e),n.appendChild(t),document.getAnimations().forEach(i=>{let l=i.effect?.target;if(!(l instanceof Element&&l.closest(`[${T}]`)))try{i.finish()}catch{i.pause()}})}function fe(){let e=document.getElementById("freeze-animations");e&&(e.remove(),document.getElementById("freeze-pointer-events")?.remove(),document.documentElement.removeAttribute("data-visual-edit-active"),document.getAnimations().forEach(t=>{if(t.playState==="paused")try{t.play()}catch{}}))}function X(e,t){let n=document.getElementById("freeze-pointer-events");n&&(n.disabled=!0);let i=document.elementFromPoint(e,t);return n&&(n.disabled=!1),i?.closest("[data-source-location], [data-visual-selector-id]")??null}function pe(e,t,n){let i=X(e,t);if(!i)return null;let l=S(i);return l===n?null:l}var Ee={position:"absolute",backgroundColor:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",fontSize:"12px",minWidth:"120px",maxHeight:"200px",overflowY:"auto",zIndex:"10001",padding:"4px 0",pointerEvents:"auto"},ge={padding:"4px 12px",cursor:"pointer",color:"#334155",backgroundColor:"transparent",whiteSpace:"nowrap",lineHeight:"1.5",fontWeight:"400"},P="#526cff",he="#DBEAFE",ve="600",Y="#f1f5f9",ye=10,G='<svg width="12" height="12" viewBox="0 0 24 24" style="vertical-align:middle;margin-left:4px"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" fill="none"/></svg>',be='<svg width="12" height="12" viewBox="0 0 24 24" style="vertical-align:middle;margin-left:4px"><path d="M18 15l-6-6-6 6" stroke="currentColor" stroke-width="2" fill="none"/></svg>',_="data-chevron",Le=12,O="data-layer-dropdown",we=2,Te=2;function q(e,t){for(let n of Object.keys(t))e.style.setProperty(n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`),t[n])}function Ie(e){return e.tagName}function K(e,t){let n={element:e,tagName:e.tagName.toLowerCase(),selectorId:S(e)};return t!==void 0&&(n.depth=t),n}function Se(e,t,n){let i=[];function l(d,m){if(!(m>t))for(let c=0;c<d.children.length;c++){let f=d.children[c];if(z(f)){let h={element:f,tagName:f.tagName.toLowerCase(),selectorId:S(f)};n!==void 0&&(h.depth=n+m-1),i.push(h),l(f,m+1)}else l(f,m)}}return l(e,1),i}function Qe(e){let t=[],n=e.parentElement;for(;n&&n!==document.documentElement&&n!==document.body&&t.length<we;)z(n)&&t.push(K(n)),n=n.parentElement;return t.reverse(),t}function et(e,t){return t.forEach((n,i)=>{e.push({...n,depth:i})}),t.length}function Ce(e,t,n){e.push(K(t,n));let i=Se(t,Te,n+1);e.push(...i)}function tt(e){return e.at(-1)?.element??null}function nt(e,t){let n=Se(e,1);return n.some(i=>i.element===t)||n.push(K(t)),n}function ot(e,t,n,i){let l=S(n),d=new Set;for(let m of t)if(m.element===n)Ce(e,n,i),l&&d.add(l);else{let c=m.selectorId;if(c!=null){if(c===l||d.has(c))continue;d.add(c)}e.push({...m,depth:i})}}function Me(e){let t=Qe(e),n=[],i=et(n,t),l=tt(t);if(l){let d=nt(l,e);ot(n,d,e,i)}else Ce(n,e,i);return n}var H=null,j=null,N=null,B=null,R=null;function rt(e,t,{onSelect:n,onHover:i,onHoverEnd:l}){let d=document.createElement("div");d.textContent=Ie(e),q(d,ge);let m=e.depth??0;return m>0&&(d.style.paddingLeft=`${Le+m*ye}px`),t&&(d.style.color=P,d.style.backgroundColor=he,d.style.fontWeight=ve),d.addEventListener("mouseenter",()=>{t||(d.style.backgroundColor=Y),i&&i(e)}),d.addEventListener("mouseleave",()=>{t||(d.style.backgroundColor="transparent"),l&&l()}),d.addEventListener("click",c=>{c.stopPropagation(),c.preventDefault(),n(e)}),d}function it(e,t,n){let i=document.createElement("div");return i.setAttribute(O,"true"),i.setAttribute(T,"true"),q(i,Ee),e.forEach(l=>{let d=l.element===t;i.appendChild(rt(l,d,n))}),i}function De(e){if(e.querySelector(`[${_}]`))return;let t=document.createElement("span");t.setAttribute(_,"true"),t.style.display="inline-flex",t.innerHTML=G,e.appendChild(t),e.style.display="inline-flex",e.style.alignItems="center",e.style.cursor="pointer",e.style.userSelect="none",e.style.whiteSpace="nowrap",e.style.pointerEvents="auto",e.setAttribute(O,"true"),e.setAttribute(T,"true")}function st(e,t,n,{onSelect:i,onHover:l,onHoverEnd:d}){let m=Array.from(e.children),c=t.findIndex(h=>h.element===n),f=h=>{if(c>=0&&c<m.length){let w=m[c];w.style.color!==P&&(w.style.backgroundColor="transparent")}if(c=h,c>=0&&c<m.length){let w=m[c];w.style.color!==P&&(w.style.backgroundColor=Y),w.scrollIntoView({block:"nearest"}),l&&c>=0&&c<t.length&&l(t[c])}};R=h=>{h.key==="ArrowDown"?(h.preventDefault(),h.stopPropagation(),f(c<m.length-1?c+1:0)):h.key==="ArrowUp"?(h.preventDefault(),h.stopPropagation(),f(c>0?c-1:m.length-1)):h.key==="Enter"&&c>=0&&c<t.length&&(h.preventDefault(),h.stopPropagation(),d&&d(),i(t[c]),M())},document.addEventListener("keydown",R,!0)}function lt(e,t){let n=!0;N=i=>{if(n){n=!1;return}let l=i.target;!e.contains(l)&&l!==t&&M()},document.addEventListener("mousedown",N,!0)}function xe(e,t,n,i){M();let l=it(t,n,{...i,onSelect:c=>{i.onHoverEnd&&i.onHoverEnd(),i.onSelect(c),M()}}),d=e.parentElement;if(!d)return;l.style.top=`${e.offsetTop+e.offsetHeight+2}px`,l.style.left=`${e.offsetLeft}px`,d.appendChild(l),H=l,j=e;let m=e.querySelector(`[${_}]`);m&&(m.innerHTML=be),B=i.onHoverEnd??null,st(l,t,n,i),lt(l,e)}function M(){let e=j?.querySelector(`[${_}]`);e&&(e.innerHTML=G),j=null,B&&(B(),B=null),H&&H.parentNode&&H.remove(),H=null,N&&(document.removeEventListener("mousedown",N,!0),N=null),R&&(document.removeEventListener("keydown",R,!0),R=null)}function Ae(){return H!==null}function He(e){let t=null,n=null,i=null,l=()=>{t&&t.parentNode&&t.remove(),t=null},d=y=>{l(),S(y.element)!==e.getSelectedElementId()&&(t=e.createPreviewOverlay(y.element))},m=y=>{l(),M(),n&&(document.removeEventListener("keydown",n,!0),n=null),i=null;let r=e.selectElement(y.element);h(r,y.element)},c=()=>{n&&(document.removeEventListener("keydown",n,!0),n=null),i&&(m(i),i=null)},f=(y,r,u,v,b)=>{y.stopPropagation(),y.preventDefault(),Ae()?(M(),c()):(i={element:u,tagName:u.tagName.toLowerCase(),selectorId:b},e.onDeselect(),n=L=>{L.key==="Escape"&&(L.stopPropagation(),M(),c())},document.addEventListener("keydown",n,!0),xe(r,v,u,{onSelect:m,onHover:d,onHoverEnd:l}))},h=(y,r)=>{if(!y)return;let u=y.querySelector("div");if(!u)return;let v=Me(r);if(v.length<=1)return;let b=S(r);De(u),u.addEventListener("click",L=>{f(L,u,r,v,b)})};return{attachToOverlay:h,cleanup:()=>{l(),M()}}}var Z="visual-edit-focus-styles",at=["div","p","h1","h2","h3","h4","h5","h6","span","li","td","a","button","label"],J=e=>!!e.dataset.arrField,dt=e=>!(!at.includes(e.tagName.toLowerCase())||!e.textContent?.trim()||e.querySelector("img, video, canvas, svg")||e.children?.length>0),_e=()=>{if(document.getElementById(Z))return;let e=document.createElement("style");e.id=Z,e.textContent=`
10
+ [${M}], [${M}] * { pointer-events: auto !important; }
11
+ `;let n=document.head||document.documentElement;n.appendChild(e),n.appendChild(t),document.getAnimations().forEach(i=>{let a=i.effect?.target;if(!(a instanceof Element&&a.closest(`[${M}]`)))try{i.finish()}catch{i.pause()}})}function Ee(){let e=document.getElementById("freeze-animations");e&&(e.remove(),document.getElementById("freeze-pointer-events")?.remove(),document.documentElement.removeAttribute("data-visual-edit-active"),document.getAnimations().forEach(t=>{if(t.playState==="paused")try{t.play()}catch{}}))}function q(e,t){let n=document.getElementById("freeze-pointer-events");n&&(n.disabled=!0);let i=document.elementFromPoint(e,t);return n&&(n.disabled=!1),i?.closest("[data-source-location], [data-visual-selector-id]")??null}function ge(e,t,n){let i=q(e,t);if(!i)return null;let a=x(i);return a===n?null:a}var he={position:"absolute",backgroundColor:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",fontSize:"12px",minWidth:"120px",maxHeight:"200px",overflowY:"auto",zIndex:"10001",padding:"4px 0",pointerEvents:"auto"},ve={padding:"4px 12px",cursor:"pointer",color:"#334155",backgroundColor:"transparent",whiteSpace:"nowrap",lineHeight:"1.5",fontWeight:"400"},Y="#526cff",ye="#DBEAFE",be="600",K="#f1f5f9",Le=10,j='<svg width="12" height="12" viewBox="0 0 24 24" style="vertical-align:middle;margin-left:4px"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" fill="none"/></svg>',Se='<svg width="12" height="12" viewBox="0 0 24 24" style="vertical-align:middle;margin-left:4px"><path d="M18 15l-6-6-6 6" stroke="currentColor" stroke-width="2" fill="none"/></svg>',k="data-chevron",Te=12,V="data-layer-dropdown",we=2,Ie=2;function Z(e,t){for(let n of Object.keys(t))e.style.setProperty(n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`),t[n])}function Me(e){return e.tagName}function J(e,t){let n={element:e,tagName:e.tagName.toLowerCase(),selectorId:x(e)};return t!==void 0&&(n.depth=t),n}function Ce(e,t,n){let i=[];function a(c,u){if(!(u>t))for(let d=0;d<c.children.length;d++){let p=c.children[d];if(U(p)){let h={element:p,tagName:p.tagName.toLowerCase(),selectorId:x(p)};n!==void 0&&(h.depth=n+u-1),i.push(h),a(p,u+1)}else a(p,u)}}return a(e,1),i}function et(e){let t=[],n=e.parentElement;for(;n&&n!==document.documentElement&&n!==document.body&&t.length<we;)U(n)&&t.push(J(n)),n=n.parentElement;return t.reverse(),t}function tt(e,t){return t.forEach((n,i)=>{e.push({...n,depth:i})}),t.length}function Ae(e,t,n){e.push(J(t,n));let i=Ce(t,Ie,n+1);e.push(...i)}function nt(e){return e.at(-1)?.element??null}function ot(e,t){let n=Ce(e,1);return n.some(i=>i.element===t)||n.push(J(t)),n}function rt(e,t,n,i){let a=x(n),c=new Set;for(let u of t)if(u.element===n)Ae(e,n,i),a&&c.add(a);else{let d=u.selectorId;if(d!=null){if(d===a||c.has(d))continue;c.add(d)}e.push({...u,depth:i})}}function xe(e){let t=et(e),n=[],i=tt(n,t),a=nt(t);if(a){let c=ot(a,e);rt(n,c,e,i)}else Ae(n,e,i);return n}var P=null,Q=null,W=null,$=null,F=null;function it(e,t,{onSelect:n,onHover:i,onHoverEnd:a}){let c=document.createElement("div");c.textContent=Me(e),Z(c,ve);let u=e.depth??0;return u>0&&(c.style.paddingLeft=`${Te+u*Le}px`),t&&(c.style.color=Y,c.style.backgroundColor=ye,c.style.fontWeight=be),c.addEventListener("mouseenter",()=>{t||(c.style.backgroundColor=K),i&&i(e)}),c.addEventListener("mouseleave",()=>{t||(c.style.backgroundColor="transparent"),a&&a()}),c.addEventListener("click",d=>{d.stopPropagation(),d.preventDefault(),n(e)}),c}function st(e,t,n){let i=document.createElement("div");return i.setAttribute(V,"true"),i.setAttribute(M,"true"),Z(i,he),e.forEach(a=>{let c=a.element===t;i.appendChild(it(a,c,n))}),i}function De(e){if(e.querySelector(`[${k}]`))return;let t=document.createElement("span");t.setAttribute(k,"true"),t.style.display="inline-flex",t.innerHTML=j,e.appendChild(t),e.style.display="inline-flex",e.style.alignItems="center",e.style.cursor="pointer",e.style.userSelect="none",e.style.whiteSpace="nowrap",e.style.pointerEvents="auto",e.setAttribute(V,"true"),e.setAttribute(M,"true")}function lt(e,t,n,{onSelect:i,onHover:a,onHoverEnd:c}){let u=Array.from(e.children),d=t.findIndex(h=>h.element===n),p=h=>{if(d>=0&&d<u.length){let T=u[d];T.style.color!==Y&&(T.style.backgroundColor="transparent")}if(d=h,d>=0&&d<u.length){let T=u[d];T.style.color!==Y&&(T.style.backgroundColor=K),T.scrollIntoView({block:"nearest"}),a&&d>=0&&d<t.length&&a(t[d])}};F=h=>{h.key==="ArrowDown"?(h.preventDefault(),h.stopPropagation(),p(d<u.length-1?d+1:0)):h.key==="ArrowUp"?(h.preventDefault(),h.stopPropagation(),p(d>0?d-1:u.length-1)):h.key==="Enter"&&d>=0&&d<t.length&&(h.preventDefault(),h.stopPropagation(),c&&c(),i(t[d]),_())},document.addEventListener("keydown",F,!0)}function at(e,t){let n=!0;W=i=>{if(n){n=!1;return}let a=i.target;!e.contains(a)&&a!==t&&_()},document.addEventListener("mousedown",W,!0)}function He(e,t,n,i){_();let a=st(t,n,{...i,onSelect:d=>{i.onHoverEnd&&i.onHoverEnd(),i.onSelect(d),_()}}),c=e.parentElement;if(!c)return;a.style.top=`${e.offsetTop+e.offsetHeight+2}px`,a.style.left=`${e.offsetLeft}px`,c.appendChild(a),P=a,Q=e;let u=e.querySelector(`[${k}]`);u&&(u.innerHTML=Se),$=i.onHoverEnd??null,lt(a,t,n,i),at(a,e)}function _(){let e=Q?.querySelector(`[${k}]`);e&&(e.innerHTML=j),Q=null,$&&($(),$=null),P&&P.parentNode&&P.remove(),P=null,W&&(document.removeEventListener("mousedown",W,!0),W=null),F&&(document.removeEventListener("keydown",F,!0),F=null)}function _e(){return P!==null}function Oe(e){let t=null,n=null,i=null,a=()=>{t&&t.parentNode&&t.remove(),t=null},c=b=>{a(),x(b.element)!==e.getSelectedElementId()&&(t=e.createPreviewOverlay(b.element))},u=b=>{a(),_(),n&&(document.removeEventListener("keydown",n,!0),n=null),i=null;let r=e.selectElement(b.element);h(r,b.element)},d=()=>{n&&(document.removeEventListener("keydown",n,!0),n=null),i&&(u(i),i=null)},p=(b,r,m,w,C)=>{b.stopPropagation(),b.preventDefault(),_e()?(_(),d()):(i={element:m,tagName:m.tagName.toLowerCase(),selectorId:C},e.onDeselect(),n=S=>{S.key==="Escape"&&(S.stopPropagation(),_(),d())},document.addEventListener("keydown",n,!0),He(r,w,m,{onSelect:u,onHover:c,onHoverEnd:a}))},h=(b,r)=>{if(!b)return;let m=b.querySelector("div");if(!m)return;let w=xe(r);if(w.length<=1)return;let C=x(r);De(m),m.addEventListener("click",S=>{p(S,m,r,w,C)})};return{attachToOverlay:h,cleanup:()=>{a(),_()}}}var ee="visual-edit-focus-styles",dt=["div","p","h1","h2","h3","h4","h5","h6","span","li","td","a","button","label"],te=e=>!!e.dataset.arrField,ct=e=>!(!dt.includes(e.tagName.toLowerCase())||!e.textContent?.trim()||e.querySelector("img, video, canvas, svg")||e.children?.length>0),Ne=()=>{if(document.getElementById(ee))return;let e=document.createElement("style");e.id=ee,e.textContent=`
12
12
  [data-selected="true"][contenteditable="true"]:focus {
13
13
  outline: none !important;
14
14
  }
15
- `,document.head.appendChild(e)},Oe=()=>{document.getElementById(Z)?.remove()},Ne=e=>{let t=document.createRange();t.selectNodeContents(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)},ct=e=>!(e instanceof HTMLElement)||!dt(e)?!1:J(e)?!0:e.dataset.dynamicContent!=="true",Q=e=>!(e instanceof HTMLElement)||e.dataset.selected!=="true"?!1:ct(e);var ut=500;function ee(e){let t=null,n=null,i=!1,l=new WeakMap,d=()=>{let r=e.getSelectedElementId();if(!r)return;let u=e.findElementsById(r);e.getSelectedOverlays().forEach((b,L)=>{L<u.length&&u[L]&&e.positionOverlay(b,u[L])})},m=r=>{let u=r.dataset.originalTextContent,v=r.textContent,b=r,L=r.getBoundingClientRect(),D={type:"inline-edit",elementInfo:{tagName:r.tagName,classes:b.className?.baseVal||r.className||"",visualSelectorId:e.getSelectedElementId(),content:v,dataSourceLocation:r.dataset.sourceLocation,isDynamicContent:r.dataset.dynamicContent==="true",linenumber:r.dataset.linenumber,filename:r.dataset.filename,position:{top:L.top,left:L.left,right:L.right,bottom:L.bottom,width:L.width,height:L.height,centerX:L.left+L.width/2,centerY:L.top+L.height/2}},originalContent:u,newContent:v};J(r)&&(D.arrIndex=r.dataset.arrIndex,D.arrVariableName=r.dataset.arrVariableName,D.arrField=r.dataset.arrField),window.parent.postMessage(D,"*"),r.dataset.originalTextContent=v||""},c=r=>{n&&clearTimeout(n),n=setTimeout(()=>m(r),ut)},f=r=>{d(),c(r)},h=function(){f(this)},w=r=>{_e(),r.dataset.originalTextContent=r.textContent||"",r.dataset.originalCursor=r.style.cursor,r.contentEditable="true",r.setAttribute(T,"true");let u=new AbortController;l.set(r,u),r.addEventListener("input",h,{signal:u.signal}),r.style.cursor="text",Ne(r),setTimeout(()=>{r.isConnected&&r.focus()},0)},y=r=>{let u=l.get(r);u&&(u.abort(),l.delete(r)),r.isConnected&&(Oe(),r.contentEditable="false",r.removeAttribute(T),delete r.dataset.originalTextContent,r.dataset.originalCursor!==void 0&&(r.style.cursor=r.dataset.originalCursor,delete r.dataset.originalCursor))};return{get enabled(){return i},set enabled(r){i=r},isEditing(){return t!==null},getCurrentElement(){return t},canEdit(r){return Q(r)},startEditing(r){t=r,e.getSelectedOverlays().forEach(u=>{u.style.display="none"}),w(r),window.parent.postMessage({type:"content-editing-started",visualSelectorId:e.getSelectedElementId()},"*")},stopEditing(){if(!t)return;n&&(clearTimeout(n),n=null),y(t),e.getSelectedOverlays().forEach(u=>{u.style.display=""}),d(),window.parent.postMessage({type:"content-editing-ended",visualSelectorId:e.getSelectedElementId()},"*"),t=null},markElementsSelected(r){r.forEach(u=>{u instanceof HTMLElement&&(u.dataset.selected="true")})},clearSelectedMarks(r){r&&e.findElementsById(r).forEach(u=>{u instanceof HTMLElement&&delete u.dataset.selected})},handleToggleMessage(r){if(!i)return;let u=e.findElementsById(r.dataSourceLocation);if(u.length===0||!(u[0]instanceof HTMLElement))return;let v=u[0];if(r.inlineEditingMode){if(!Q(v))return;e.getSelectedElementId()!==r.dataSourceLocation&&(this.stopEditing(),e.clearSelection(),this.markElementsSelected(u),e.createSelectionOverlays(u,r.dataSourceLocation)),this.startEditing(v)}else t===v&&this.stopEditing()},cleanup(){this.stopEditing()}}}var te="__theme-font-preview";function Re(){let e=t=>{!t.ctrlKey&&!t.metaKey||(t.preventDefault(),window.parent.postMessage({type:"canvas-wheel-zoom",data:{deltaY:t.deltaY,deltaMode:t.deltaMode,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey}},"*"))};return{enable:()=>{window.addEventListener("wheel",e,{capture:!0,passive:!1})},teardown:()=>{window.removeEventListener("wheel",e,!0)}}}var ne="--base44-reference-vh-base";function Be(){let e=null,t=null,n,i="*";return{freezeVhUnits:l=>{let d=mt(l);if(ft(d),e){t?.();return}e=[],t=pt(e)},measurePageHeight:(l,d=2e3)=>{i=l,n!==void 0&&window.clearTimeout(n),n=window.setTimeout(()=>{requestAnimationFrame(()=>{let m=gt();window.parent.postMessage({type:"page-height-measured",height:m},i)})},d)},teardown:()=>{if(e){for(let l of e)l();e=null,t=null}n!==void 0&&window.clearTimeout(n)}}}function mt(e){if(e!==void 0)return e;let t=window.innerHeight||0;return t>=400?t:900}function ft(e){document.documentElement.style.setProperty(ne,`${e}px`)}function pt(e){let t=/(\d+(?:\.\d+)?)vh\b/g,n=new WeakSet,i=new WeakMap,l=new WeakSet,d=new Set,c=It(()=>{let r=u=>u.replace(t,(v,b)=>`calc(var(${ne}) * ${Et(b)})`);document.querySelectorAll("style").forEach(u=>{if(h(u),n.has(u))return;n.add(u);let v=u.textContent;if(!v||v.indexOf("vh")===-1)return;let b=r(v);b!==v&&(u.textContent=b)});for(let u=0;u<document.styleSheets.length;u++){let v=document.styleSheets[u];if(!v)continue;let b;try{b=v.cssRules}catch{continue}i.get(v)!==b.length&&(ke(b,r),i.set(v,b.length))}},16),f=c.trigger;e.push(c.cancel);let h=r=>{if(l.has(r))return;l.add(r);let u=new MutationObserver(()=>{n.delete(r),f()});u.observe(r,{characterData:!0,childList:!0,subtree:!0}),d.add(u)};e.push(()=>{for(let r of d)r.disconnect();d.clear()}),f(),document.readyState==="loading"&&(document.addEventListener("DOMContentLoaded",f),e.push(()=>document.removeEventListener("DOMContentLoaded",f))),window.addEventListener("load",f),e.push(()=>window.removeEventListener("load",f));let w=new MutationObserver(r=>{for(let u of r)if(Pe(u.addedNodes)||Pe(u.removedNodes)){f();return}});e.push(()=>w.disconnect());let y=()=>{document.head&&w.observe(document.head,{childList:!0,subtree:!1})};return document.head?y():(document.addEventListener("DOMContentLoaded",y),e.push(()=>document.removeEventListener("DOMContentLoaded",y))),f}function Et(e){return String(Number((parseFloat(e)/100).toFixed(6)))}function ke(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(!i)continue;i.cssRules&&ke(i.cssRules,t);let l=i.style;if(l)for(let d=0;d<l.length;d++){let m=l[d];if(!m)continue;let c=l.getPropertyValue(m);if(!c||c.indexOf("vh")===-1)continue;let f=t(c);f!==c&&l.setProperty(m,f,l.getPropertyPriority(m))}}}function Pe(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof HTMLStyleElement||n instanceof HTMLLinkElement)return!0}return!1}function gt(){let e=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0),t=Math.max(window.innerHeight||0,document.documentElement.clientHeight,document.body?.clientHeight??0),n=vt(t),i=ht();return n>0?Math.ceil(Math.max(n,i)):Math.ceil(Math.max(e,i))}function ht(){let e=document.documentElement.style.getPropertyValue(ne),t=parseFloat(e);return Number.isFinite(t)?t:0}function vt(e){if(!document.body)return 0;let t=[document.body,...Array.from(document.body.querySelectorAll("*"))],n=new WeakMap,i=window.scrollY+e;for(let l=t.length-1;l>=0;l--){let d=t[l];if(!d)continue;let m=yt(d,n),c=bt(d),f=Tt(c,m,i)?0:c;n.set(d,Math.max(m,f))}return n.get(document.body)??0}function yt(e,t){let n=0;for(let i=0;i<e.children.length;i++){let l=e.children[i];l&&(n=Math.max(n,t.get(l)??0))}return n}function bt(e){let t=window.getComputedStyle(e);if(wt(t))return 0;let n=e.getBoundingClientRect();return n.width===0&&n.height===0?0:n.bottom+window.scrollY+Lt(t)}function Lt(e){let t=parseFloat(e.marginBottom);return Number.isFinite(t)?t:0}function wt(e){return e.position==="fixed"?!0:e.position==="absolute"&&e.pointerEvents==="none"}function Tt(e,t,n){return t>0&&Math.abs(e-n)<=1&&e-t>8}function It(e,t){let n;return{trigger:()=>{n!==void 0&&window.clearTimeout(n),n=window.setTimeout(e,t)},cancel:()=>{n!==void 0&&(window.clearTimeout(n),n=void 0)}}}var k=50;function St(){let e=Re(),t=Be(),n=!1,i=!1,l=!1,d=[],m=[],c=[],f=null,h=null,w=(s=!1)=>{let o=document.createElement("div");return o.style.position="absolute",o.style.pointerEvents="none",o.style.transition="all 0.1s ease-in-out",o.style.zIndex="9999",s?o.style.border="2px solid #2563EB":(o.style.border="2px solid #95a5fc",o.style.backgroundColor="rgba(99, 102, 241, 0.05)"),o},y=(s,o,a=!1)=>{if(!o||!n)return;o.offsetWidth;let E=o.getBoundingClientRect();s.style.top=`${E.top+window.scrollY}px`,s.style.left=`${E.left+window.scrollX}px`,s.style.width=`${E.width}px`,s.style.height=`${E.height}px`;let g=s.querySelector("div");g||(g=document.createElement("div"),g.textContent=o.tagName.toLowerCase(),g.style.position="absolute",g.style.left="-2px",g.style.padding="2px 8px",g.style.fontSize="11px",g.style.fontWeight=a?"500":"400",g.style.color=a?"#ffffff":"#526cff",g.style.backgroundColor=a?"#2563EB":"#DBEAFE",g.style.borderRadius="3px",g.style.minWidth="24px",g.style.textAlign="center",s.appendChild(g)),ae(g,E)},r=ee({findElementsById:C,getSelectedElementId:()=>f,getSelectedOverlays:()=>m,positionOverlay:y,clearSelection:()=>{r.clearSelectedMarks(f),b(),f=null,h=null},createSelectionOverlays:(s,o)=>{s.forEach(a=>{let p=w(!0);document.body.appendChild(p),m.push(p),y(p,a,!0)}),f=o}}),u=()=>{r.clearSelectedMarks(f),b(),f=null,h=null},v=()=>{d.forEach(s=>{s&&s.parentNode&&s.remove()}),d=[],c=[]},b=()=>{m.forEach(s=>{s&&s.parentNode&&s.remove()}),m=[]},L=["p","h1","h2","h3","h4","h5","h6","span","a","label"],D=s=>{let o=s,a=s.getBoundingClientRect(),p=s,E=L.includes(s.tagName?.toLowerCase()),g=o.closest("[data-arr-variable-name]"),I=g?.dataset?.arrVariableName||null,A=g?.dataset?.arrIndex,qe=A!=null?parseInt(A,10):null,Ke=o.dataset?.arrField||null,je=o.closest("[data-collection-id]"),Ze=o.closest("[data-collection-item-field]"),Je=o.closest("[data-collection-item-id]");window.parent.postMessage({type:"element-selected",tagName:s.tagName,classes:p.className?.baseVal||s.className||"",visualSelectorId:S(s),content:E?o.innerText:void 0,dataSourceLocation:o.dataset.sourceLocation,isDynamicContent:o.dataset.dynamicContent==="true",linenumber:o.dataset.linenumber,filename:o.dataset.filename,position:{top:a.top,left:a.left,right:a.right,bottom:a.bottom,width:a.width,height:a.height,centerX:a.left+a.width/2,centerY:a.top+a.height/2},attributes:ue(s,U),isTextElement:E,staticArrayName:I,staticArrayIndex:qe,staticArrayField:Ke,collectionId:je?.dataset?.collectionId||null,collectionItemField:Ze?.dataset?.collectionItemField||null,collectionItemId:Je?.dataset?.collectionItemId||null},"*")},oe=s=>{let o=S(s);return b(),C(o||null).forEach(p=>{let E=w(!0);document.body.appendChild(E),m.push(E),y(E,p,!0)}),f=o||null,h=s,v(),D(s),m[0]},Ve=()=>{f=null,window.parent.postMessage({type:"unselect-element"},"*")},V=null,x=null,W=()=>{v(),V=null},We=s=>{let o=C(s);v(),o.forEach(a=>{let p=w(!1);document.body.appendChild(p),d.push(p),y(p,a)}),c=o,V=s},re=s=>{!n||i||r.isEditing()||x===null&&(x=requestAnimationFrame(()=>{if(x=null,l){W();return}let o=pe(s.clientX,s.clientY,f);if(!o){W();return}V!==o&&We(o)}))},F=()=>{x!==null&&(cancelAnimationFrame(x),x=null),W()},ie=s=>{if(!n)return;let o=s.target;if(o.closest(`[${O}]`)||r.enabled&&o instanceof HTMLElement&&o.contentEditable==="true")return;if(r.isEditing()){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),r.stopEditing();return}if(l){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),window.parent.postMessage({type:"close-dropdowns"},"*");return}s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation();let a=X(s.clientX,s.clientY);if(!a)return;let p=a,E=S(a);if(f===E&&p.dataset.selected==="true"&&r.enabled&&r.canEdit(p)){r.startEditing(p);return}r.stopEditing(),r.enabled&&r.markElementsSelected(C(E));let I=oe(a);se.attachToOverlay(I,a)},Fe=()=>{r.stopEditing(),u()},$e=(s,o)=>{let a=C(s);a.length!==0&&(de(a,o),setTimeout(()=>{f===s&&m.forEach((p,E)=>{E<a.length&&y(p,a[E])}),c.length>0&&c[0]?.dataset?.visualSelectorId===s&&d.forEach((g,I)=>{I<c.length&&y(g,c[I])})},k))},ze=(s,o,a)=>{let p=C(s);p.length!==0&&(ce(p,o,a),setTimeout(()=>{f===s&&m.forEach((E,g)=>{g<p.length&&y(E,p[g])})},k))},Ue=(s,o,a)=>{let p=C(s);p.length!==0&&(a!=null&&(p=p.filter(E=>E.dataset.arrIndex===String(a))),p.forEach(E=>{E.innerText=o}),setTimeout(()=>{f===s&&m.forEach((E,g)=>{g<p.length&&y(E,p[g])})},k))},se=He({createPreviewOverlay:s=>{let o=w(!1);return o.style.zIndex="9998",document.body.appendChild(o),y(o,s),o},getSelectedElementId:()=>f,selectElement:oe,onDeselect:Ve}),Xe=s=>{n=s,s?(document.body.style.cursor="crosshair",me(),document.addEventListener("mousemove",re),document.addEventListener("mouseleave",F),document.addEventListener("click",ie,!0)):(fe(),r.stopEditing(),u(),se.cleanup(),F(),document.body.style.cursor="default",document.removeEventListener("mousemove",re),document.removeEventListener("mouseleave",F),document.removeEventListener("click",ie,!0))},le=()=>{if(f){let s=h;if(s&&s.isConnected){let o=s.getBoundingClientRect(),a=window.innerHeight,p=window.innerWidth,E=o.top<a&&o.bottom>0&&o.left<p&&o.right>0,g={top:o.top,left:o.left,right:o.right,bottom:o.bottom,width:o.width,height:o.height,centerX:o.left+o.width/2,centerY:o.top+o.height/2};window.parent.postMessage({type:"element-position-update",position:g,isInViewport:E,visualSelectorId:f},"*")}}},Ye=s=>{let o=s.data;switch(o.type){case"toggle-visual-edit-mode":Xe(o.data.enabled),o.data.specs?.newInlineEditEnabled!==void 0&&(r.enabled=o.data.specs.newInlineEditEnabled);break;case"update-classes":o.data&&o.data.classes!==void 0?$e(o.data.visualSelectorId,o.data.classes):console.warn("[VisualEditAgent] Invalid update-classes message:",o);break;case"update-attribute":o.data&&o.data.visualSelectorId&&o.data.attribute!==void 0&&o.data.value!==void 0?ze(o.data.visualSelectorId,o.data.attribute,o.data.value):console.warn("[VisualEditAgent] Invalid update-attribute message:",o);break;case"unselect-element":Fe();break;case"refresh-page":window.location.reload();break;case"update-content":o.data&&o.data.content!==void 0?Ue(o.data.visualSelectorId,o.data.content,o.data.arrIndex):console.warn("[VisualEditAgent] Invalid update-content message:",o);break;case"request-element-position":if(f&&h&&h.isConnected){let a=h.getBoundingClientRect(),p=window.innerHeight,E=window.innerWidth,g=a.top<p&&a.bottom>0&&a.left<E&&a.right>0,I={top:a.top,left:a.left,right:a.right,bottom:a.bottom,width:a.width,height:a.height,centerX:a.left+a.width/2,centerY:a.top+a.height/2};window.parent.postMessage({type:"element-position-update",position:I,isInViewport:g,visualSelectorId:f},"*")}break;case"popover-drag-state":o.data&&o.data.isDragging!==void 0&&(i=o.data.isDragging,o.data.isDragging&&v());break;case"dropdown-state":o.data&&o.data.isOpen!==void 0&&(l=o.data.isOpen,o.data.isOpen&&v());break;case"update-theme-variables":if(o.data?.variables){let a=o.data.mode==="dark"?document.querySelector(".dark"):document.documentElement;if(a)for(let[p,E]of Object.entries(o.data.variables))a.style.setProperty(p,E)}break;case"inject-font-import":if(o.data?.fontUrl){let a=document.getElementById(te);a||(a=document.createElement("style"),a.id=te,document.head.appendChild(a)),a.textContent=`@import url('${o.data.fontUrl}');`}break;case"toggle-inline-edit-mode":o.data&&r.handleToggleMessage(o.data);break;case"freeze-vh-units":t.freezeVhUnits(typeof o.referenceVhBase=="number"?o.referenceVhBase:void 0);break;case"measure-page-height":t.measurePageHeight(s.origin&&s.origin!=="null"?s.origin:"*",typeof o.settleMs=="number"?o.settleMs:void 0);break;case"toggle-canvas-wheel-zoom-bridge":e.enable();break;default:break}},$=()=>{if(f){let s=C(f);m.forEach((o,a)=>{a<s.length&&y(o,s[a])})}c.length>0&&d.forEach((s,o)=>{o<c.length&&y(s,c[o])})};document.querySelectorAll("[data-linenumber]:not([data-visual-selector-id])").forEach((s,o)=>{let a=s,p=`visual-id-${a.dataset.filename}-${a.dataset.linenumber}-${o}`;a.dataset.visualSelectorId=p});let Ge=new MutationObserver(s=>{s.some(a=>{let p=g=>{if(g.nodeType===Node.ELEMENT_NODE){let I=g;if(I.dataset&&I.dataset.visualSelectorId)return!0;for(let A=0;A<I.children.length;A++)if(p(I.children[A]))return!0}return!1};return a.type==="attributes"&&(a.attributeName==="style"||a.attributeName==="class"||a.attributeName==="width"||a.attributeName==="height")&&p(a.target)})&&setTimeout($,k)});window.addEventListener("message",Ye),window.addEventListener("scroll",le,!0),document.addEventListener("scroll",le,!0),window.addEventListener("resize",$),window.addEventListener("scroll",$),Ge.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["style","class","width","height"]}),window.parent.postMessage({type:"visual-edit-agent-ready"},"*")}export{St as setupVisualEditAgent};
15
+ `,document.head.appendChild(e)},Re=()=>{document.getElementById(ee)?.remove()},Pe=e=>{let t=document.createRange();t.selectNodeContents(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)},ut=e=>!(e instanceof HTMLElement)||!ct(e)?!1:te(e)?!0:e.dataset.dynamicContent!=="true",ne=e=>!(e instanceof HTMLElement)||e.dataset.selected!=="true"?!1:ut(e);var mt=500;function oe(e){let t=null,n=null,i=!1,a=new WeakMap,c=()=>{let r=e.getSelectedElementId();if(!r)return;let m=e.findElementsById(r);e.getSelectedOverlays().forEach((C,S)=>{S<m.length&&m[S]&&e.positionOverlay(C,m[S])})},u=r=>{let m=r.dataset.originalTextContent,w=r.textContent,C=r,S=r.getBoundingClientRect(),O={type:"inline-edit",elementInfo:{tagName:r.tagName,classes:C.className?.baseVal||r.className||"",visualSelectorId:e.getSelectedElementId(),content:w,dataSourceLocation:r.dataset.sourceLocation,isDynamicContent:r.dataset.dynamicContent==="true",linenumber:r.dataset.linenumber,filename:r.dataset.filename,position:{top:S.top,left:S.left,right:S.right,bottom:S.bottom,width:S.width,height:S.height,centerX:S.left+S.width/2,centerY:S.top+S.height/2}},originalContent:m,newContent:w};te(r)&&(O.arrIndex=r.dataset.arrIndex,O.arrVariableName=r.dataset.arrVariableName,O.arrField=r.dataset.arrField),window.parent.postMessage(O,"*"),r.dataset.originalTextContent=w||""},d=r=>{n&&clearTimeout(n),n=setTimeout(()=>u(r),mt)},p=r=>{c(),d(r)},h=function(){p(this)},T=r=>{Ne(),r.dataset.originalTextContent=r.textContent||"",r.dataset.originalCursor=r.style.cursor,r.contentEditable="true",r.setAttribute(M,"true");let m=new AbortController;a.set(r,m),r.addEventListener("input",h,{signal:m.signal}),r.style.cursor="text",Pe(r),setTimeout(()=>{r.isConnected&&r.focus()},0)},b=r=>{let m=a.get(r);m&&(m.abort(),a.delete(r)),r.isConnected&&(Re(),r.contentEditable="false",r.removeAttribute(M),delete r.dataset.originalTextContent,r.dataset.originalCursor!==void 0&&(r.style.cursor=r.dataset.originalCursor,delete r.dataset.originalCursor))};return{get enabled(){return i},set enabled(r){i=r},isEditing(){return t!==null},getCurrentElement(){return t},canEdit(r){return ne(r)},startEditing(r){t=r,e.getSelectedOverlays().forEach(m=>{m.style.display="none"}),T(r),window.parent.postMessage({type:"content-editing-started",visualSelectorId:e.getSelectedElementId()},"*")},stopEditing(){if(!t)return;n&&(clearTimeout(n),n=null),b(t),e.getSelectedOverlays().forEach(m=>{m.style.display=""}),c(),window.parent.postMessage({type:"content-editing-ended",visualSelectorId:e.getSelectedElementId()},"*"),t=null},markElementsSelected(r){r.forEach(m=>{m instanceof HTMLElement&&(m.dataset.selected="true")})},clearSelectedMarks(r){r&&e.findElementsById(r).forEach(m=>{m instanceof HTMLElement&&delete m.dataset.selected})},handleToggleMessage(r){if(!i)return;let m=e.findElementsById(r.dataSourceLocation);if(m.length===0||!(m[0]instanceof HTMLElement))return;let w=m[0];if(r.inlineEditingMode){if(!ne(w))return;e.getSelectedElementId()!==r.dataSourceLocation&&(this.stopEditing(),e.clearSelection(),this.markElementsSelected(m),e.createSelectionOverlays(m,r.dataSourceLocation)),this.startEditing(w)}else t===w&&this.stopEditing()},cleanup(){this.stopEditing()}}}var re="__theme-font-preview";function Be(){let e=t=>{!t.ctrlKey&&!t.metaKey||(t.preventDefault(),window.parent.postMessage({type:"canvas-wheel-zoom",data:{deltaY:t.deltaY,deltaMode:t.deltaMode,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey}},"*"))};return{enable:()=>{window.addEventListener("wheel",e,{capture:!0,passive:!1})},teardown:()=>{window.removeEventListener("wheel",e,!0)}}}var ie="--base44-reference-vh-base";function We(){let e=null,t=null,n,i,a="*",c=()=>{n!==void 0&&(window.clearTimeout(n),n=void 0),i!==void 0&&(window.clearTimeout(i),i=void 0)};return{freezeVhUnits:u=>{let d=ft(u);if(pt(d),e){t?.();return}e=[],t=Et(e)},measurePageHeight:(u,d=2e3)=>{a=u,c(),n=window.setTimeout(()=>{n=void 0,t?.();let p=ke()+1500,h=-1,T=0,b=m=>{i=void 0,window.parent.postMessage({type:"page-height-measured",height:m},a)},r=()=>{i=void 0;let m=ht();if(m===h?T++:(T=1,h=m),T>=3||ke()>=p){b(m);return}i=window.setTimeout(r,16)};r()},d)},teardown:()=>{if(e){for(let u of e)u();e=null,t=null}c()}}}function ke(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function ft(e){if(e!==void 0)return e;let t=window.innerHeight||0;return t>=400?t:900}function pt(e){document.documentElement.style.setProperty(ie,`${e}px`)}function Et(e){let t=/(\d+(?:\.\d+)?)(?:d|s|l)?vh\b/g,n=new WeakSet,i=new WeakMap,a=new WeakSet,c=new Set,u=new WeakSet,d=f=>f.replace(t,(g,L)=>`calc(var(${ie}) * ${gt(L)})`),p=f=>{if(u.has(f))return;let L=window.getComputedStyle(f).overflowY;L!=="auto"&&L!=="scroll"||(u.add(f),f.style.setProperty("overflow-y","visible","important"))},h=f=>{p(f),f.querySelectorAll("*").forEach(p)},T=f=>{let g=f.style;if(!g||g.length===0)return;let L=[];for(let I=0;I<g.length;I++){let D=g[I];D&&L.push(D)}for(let I of L){let D=g.getPropertyValue(I);if(!D||D.indexOf("vh")===-1)continue;let N=d(D);N!==D&&g.setProperty(I,N,g.getPropertyPriority(I))}},r=It(()=>{document.querySelectorAll("style").forEach(f=>{if(w(f),n.has(f))return;n.add(f);let g=f.textContent;if(!g||g.indexOf("vh")===-1)return;let L=d(g);L!==g&&(f.textContent=L)});for(let f=0;f<document.styleSheets.length;f++){let g=document.styleSheets[f];if(!g)continue;let L;try{L=g.cssRules}catch{continue}i.get(g)!==L.length&&(Fe(L,d),i.set(g,L.length))}document.querySelectorAll('[style*="vh"]').forEach(T),document.body&&h(document.body)},16),m=r.trigger;e.push(r.cancel);let w=f=>{if(a.has(f))return;a.add(f);let g=new MutationObserver(()=>{n.delete(f),m()});g.observe(f,{characterData:!0,childList:!0,subtree:!0}),c.add(g)};e.push(()=>{for(let f of c)f.disconnect();c.clear()}),m(),document.readyState==="loading"&&(document.addEventListener("DOMContentLoaded",m),e.push(()=>document.removeEventListener("DOMContentLoaded",m))),window.addEventListener("load",m),e.push(()=>window.removeEventListener("load",m));let C=new MutationObserver(f=>{for(let g of f)if(Ve(g.addedNodes)||Ve(g.removedNodes)){m();return}});e.push(()=>C.disconnect());let S=()=>{document.head&&C.observe(document.head,{childList:!0,subtree:!1})};document.head?S():(document.addEventListener("DOMContentLoaded",S),e.push(()=>document.removeEventListener("DOMContentLoaded",S)));let O=f=>{if(!(f instanceof Element))return;let g=f.getAttribute("style");g&&g.indexOf("vh")!==-1&&T(f),f.querySelectorAll('[style*="vh"]').forEach(T),h(f)},B=new MutationObserver(f=>{for(let g of f)if(g.type==="attributes"){let L=g.target;if(!(L instanceof Element))continue;let I=L.getAttribute("style");if(!I||I.indexOf("vh")===-1)continue;T(L)}else if(g.type==="childList")for(let L=0;L<g.addedNodes.length;L++){let I=g.addedNodes[L];I&&O(I)}});return e.push(()=>B.disconnect()),(()=>{let f=document.documentElement;f&&B.observe(f,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0})})(),m}function gt(e){return String(Number((parseFloat(e)/100).toFixed(6)))}function Fe(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(!i)continue;i.cssRules&&Fe(i.cssRules,t);let a=i.style;if(a)for(let c=0;c<a.length;c++){let u=a[c];if(!u)continue;let d=a.getPropertyValue(u);if(!d||d.indexOf("vh")===-1)continue;let p=t(d);p!==d&&a.setProperty(u,p,a.getPropertyPriority(u))}}}function Ve(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof HTMLStyleElement||n instanceof HTMLLinkElement)return!0}return!1}function ht(){let e=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0),t=vt(),n=Math.max(window.innerHeight||0,document.documentElement.clientHeight,t),i=yt(n);return i>0?Math.ceil(Math.max(i,t)):Math.ceil(Math.max(e,t))}function vt(){let e=document.documentElement.style.getPropertyValue(ie),t=parseFloat(e);return Number.isFinite(t)?t:0}function yt(e){if(!document.body)return 0;let t=[document.body,...Array.from(document.body.querySelectorAll("*"))],n=new WeakMap,i=window.scrollY+e;for(let a=t.length-1;a>=0;a--){let c=t[a];if(!c)continue;let u=bt(c,n),d=Lt(c),p=wt(d,u,e,i)?0:d.bottom;n.set(c,Math.max(u,p))}return n.get(document.body)??0}function bt(e,t){let n=0;for(let i=0;i<e.children.length;i++){let a=e.children[i];a&&(n=Math.max(n,t.get(a)??0))}return n}function Lt(e){let t=window.getComputedStyle(e);if(Tt(t))return{bottom:0,height:0};let n=e.getBoundingClientRect();return n.width===0&&n.height===0?{bottom:0,height:0}:{bottom:n.bottom+window.scrollY+St(t),height:n.height}}function St(e){let t=parseFloat(e.marginBottom);return Number.isFinite(t)?t:0}function Tt(e){return e.position==="fixed"?!0:e.position==="absolute"&&e.pointerEvents==="none"}function wt(e,t,n,i){return t>0&&Math.abs(e.bottom-i)<=1&&Math.abs(e.height-n)<=1&&e.bottom-t>8}function It(e,t){let n;return{trigger:()=>{n!==void 0&&window.clearTimeout(n),n=window.setTimeout(e,t)},cancel:()=>{n!==void 0&&(window.clearTimeout(n),n=void 0)}}}var X=50;function Mt(){let e=Be(),t=We(),n=!1,i=!1,a=!1,c=[],u=[],d=[],p=null,h=null,T=(s=!1)=>{let o=document.createElement("div");return o.style.position="absolute",o.style.pointerEvents="none",o.style.transition="all 0.1s ease-in-out",o.style.zIndex="9999",s?o.style.border="2px solid #2563EB":(o.style.border="2px solid #95a5fc",o.style.backgroundColor="rgba(99, 102, 241, 0.05)"),o},b=(s,o,l=!1)=>{if(!o||!n)return;o.offsetWidth;let v=o.getBoundingClientRect();s.style.top=`${v.top+window.scrollY}px`,s.style.left=`${v.left+window.scrollX}px`,s.style.width=`${v.width}px`,s.style.height=`${v.height}px`;let y=s.querySelector("div");y||(y=document.createElement("div"),y.textContent=o.tagName.toLowerCase(),y.style.position="absolute",y.style.left="-2px",y.style.padding="2px 8px",y.style.fontSize="11px",y.style.fontWeight=l?"500":"400",y.style.color=l?"#ffffff":"#526cff",y.style.backgroundColor=l?"#2563EB":"#DBEAFE",y.style.borderRadius="3px",y.style.minWidth="24px",y.style.textAlign="center",s.appendChild(y)),ce(y,v)},r=oe({findElementsById:H,getSelectedElementId:()=>p,getSelectedOverlays:()=>u,positionOverlay:b,clearSelection:()=>{r.clearSelectedMarks(p),C(),p=null,h=null},createSelectionOverlays:(s,o)=>{s.forEach(l=>{let E=T(!0);document.body.appendChild(E),u.push(E),b(E,l,!0)}),p=o}}),m=()=>{r.clearSelectedMarks(p),C(),p=null,h=null},w=()=>{c.forEach(s=>{s&&s.parentNode&&s.remove()}),c=[],d=[]},C=()=>{u.forEach(s=>{s&&s.parentNode&&s.remove()}),u=[]},S=["p","h1","h2","h3","h4","h5","h6","span","a","label"],O=s=>{let o=s,l=s.getBoundingClientRect(),E=s,v=S.includes(s.tagName?.toLowerCase()),y=o.closest("[data-arr-variable-name]"),A=y?.dataset?.arrVariableName||null,R=y?.dataset?.arrIndex,Ke=R!=null?parseInt(R,10):null,je=o.dataset?.arrField||null,Ze=o.closest("[data-collection-id]"),Je=o.closest("[data-collection-item-field]"),Qe=o.closest("[data-collection-item-id]");window.parent.postMessage({type:"element-selected",tagName:s.tagName,classes:E.className?.baseVal||s.className||"",visualSelectorId:x(s),content:v?o.innerText:void 0,dataSourceLocation:o.dataset.sourceLocation,isDynamicContent:o.dataset.dynamicContent==="true",linenumber:o.dataset.linenumber,filename:o.dataset.filename,position:{top:l.top,left:l.left,right:l.right,bottom:l.bottom,width:l.width,height:l.height,centerX:l.left+l.width/2,centerY:l.top+l.height/2},attributes:fe(s,G),isTextElement:v,staticArrayName:A,staticArrayIndex:Ke,staticArrayField:je,collectionId:Ze?.dataset?.collectionId||null,collectionItemField:Je?.dataset?.collectionItemField||null,collectionItemId:Qe?.dataset?.collectionItemId||null},"*")},B=s=>{let o=x(s);return C(),H(o||null).forEach(E=>{let v=T(!0);document.body.appendChild(v),u.push(v),b(v,E,!0)}),p=o||null,h=s,w(),O(s),u[0]},se=()=>{p=null,window.parent.postMessage({type:"unselect-element"},"*")},f=null,g=null,L=()=>{w(),f=null},I=s=>{let o=H(s);w(),o.forEach(l=>{let E=T(!1);document.body.appendChild(E),c.push(E),b(E,l)}),d=o,f=s},D=s=>{!n||i||r.isEditing()||g===null&&(g=requestAnimationFrame(()=>{if(g=null,a){L();return}let o=ge(s.clientX,s.clientY,p);if(!o){L();return}f!==o&&I(o)}))},N=()=>{g!==null&&(cancelAnimationFrame(g),g=null),L()},le=s=>{if(!n)return;let o=s.target;if(o.closest(`[${V}]`)||r.enabled&&o instanceof HTMLElement&&o.contentEditable==="true")return;if(r.isEditing()){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),r.stopEditing();return}if(a){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),window.parent.postMessage({type:"close-dropdowns"},"*");return}s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation();let l=q(s.clientX,s.clientY);if(!l)return;let E=l,v=x(l);if(p===v&&E.dataset.selected==="true"&&r.enabled&&r.canEdit(E)){r.startEditing(E);return}r.stopEditing(),r.enabled&&r.markElementsSelected(H(v));let A=B(l);ae.attachToOverlay(A,l)},Ye=()=>{r.stopEditing(),m()},$e=(s,o)=>{let l=H(s);l.length!==0&&(ue(l,o),setTimeout(()=>{p===s&&u.forEach((E,v)=>{v<l.length&&b(E,l[v])}),d.length>0&&d[0]?.dataset?.visualSelectorId===s&&c.forEach((y,A)=>{A<d.length&&b(y,d[A])})},X))},Xe=(s,o,l)=>{let E=H(s);E.length!==0&&(me(E,o,l),setTimeout(()=>{p===s&&u.forEach((v,y)=>{y<E.length&&b(v,E[y])})},X))},ze=(s,o,l)=>{let E=H(s);E.length!==0&&(l!=null&&(E=E.filter(v=>v.dataset.arrIndex===String(l))),E.forEach(v=>{v.innerText=o}),setTimeout(()=>{p===s&&u.forEach((v,y)=>{y<E.length&&b(v,E[y])})},X))},ae=Oe({createPreviewOverlay:s=>{let o=T(!1);return o.style.zIndex="9998",document.body.appendChild(o),b(o,s),o},getSelectedElementId:()=>p,selectElement:B,onDeselect:se}),Ue=s=>{n=s,s?(document.body.style.cursor="crosshair",pe(),document.addEventListener("mousemove",D),document.addEventListener("mouseleave",N),document.addEventListener("click",le,!0)):(Ee(),r.stopEditing(),m(),ae.cleanup(),N(),document.body.style.cursor="default",document.removeEventListener("mousemove",D),document.removeEventListener("mouseleave",N),document.removeEventListener("click",le,!0))},de=()=>{if(p){let s=h;if(s&&s.isConnected){let o=s.getBoundingClientRect(),l=window.innerHeight,E=window.innerWidth,v=o.top<l&&o.bottom>0&&o.left<E&&o.right>0,y={top:o.top,left:o.left,right:o.right,bottom:o.bottom,width:o.width,height:o.height,centerX:o.left+o.width/2,centerY:o.top+o.height/2};window.parent.postMessage({type:"element-position-update",position:y,isInViewport:v,visualSelectorId:p},"*")}}},Ge=s=>{let o=s.data;switch(o.type){case"toggle-visual-edit-mode":Ue(o.data.enabled),o.data.specs?.newInlineEditEnabled!==void 0&&(r.enabled=o.data.specs.newInlineEditEnabled);break;case"update-classes":o.data&&o.data.classes!==void 0?$e(o.data.visualSelectorId,o.data.classes):console.warn("[VisualEditAgent] Invalid update-classes message:",o);break;case"update-attribute":o.data&&o.data.visualSelectorId&&o.data.attribute!==void 0&&o.data.value!==void 0?Xe(o.data.visualSelectorId,o.data.attribute,o.data.value):console.warn("[VisualEditAgent] Invalid update-attribute message:",o);break;case"unselect-element":Ye();break;case"refresh-page":window.location.reload();break;case"update-content":o.data&&o.data.content!==void 0?ze(o.data.visualSelectorId,o.data.content,o.data.arrIndex):console.warn("[VisualEditAgent] Invalid update-content message:",o);break;case"request-element-position":if(p&&h&&h.isConnected){let l=h.getBoundingClientRect(),E=window.innerHeight,v=window.innerWidth,y=l.top<E&&l.bottom>0&&l.left<v&&l.right>0,A={top:l.top,left:l.left,right:l.right,bottom:l.bottom,width:l.width,height:l.height,centerX:l.left+l.width/2,centerY:l.top+l.height/2};window.parent.postMessage({type:"element-position-update",position:A,isInViewport:y,visualSelectorId:p},"*")}break;case"popover-drag-state":o.data&&o.data.isDragging!==void 0&&(i=o.data.isDragging,o.data.isDragging&&w());break;case"dropdown-state":o.data&&o.data.isOpen!==void 0&&(a=o.data.isOpen,o.data.isOpen&&w());break;case"update-theme-variables":if(o.data?.variables){let l=o.data.mode==="dark"?document.querySelector(".dark"):document.documentElement;if(l)for(let[E,v]of Object.entries(o.data.variables))l.style.setProperty(E,v)}break;case"inject-font-import":if(o.data?.fontUrl){let l=document.getElementById(re);l||(l=document.createElement("style"),l.id=re,document.head.appendChild(l)),l.textContent=`@import url('${o.data.fontUrl}');`}break;case"toggle-inline-edit-mode":o.data&&r.handleToggleMessage(o.data);break;case"freeze-vh-units":t.freezeVhUnits(typeof o.referenceVhBase=="number"?o.referenceVhBase:void 0);break;case"measure-page-height":t.measurePageHeight(s.origin&&s.origin!=="null"?s.origin:"*",typeof o.settleMs=="number"?o.settleMs:void 0);break;case"toggle-canvas-wheel-zoom-bridge":e.enable();break;default:break}},z=()=>{if(p){let s=H(p);u.forEach((o,l)=>{l<s.length&&b(o,s[l])})}d.length>0&&c.forEach((s,o)=>{o<d.length&&b(s,d[o])})};document.querySelectorAll("[data-linenumber]:not([data-visual-selector-id])").forEach((s,o)=>{let l=s,E=`visual-id-${l.dataset.filename}-${l.dataset.linenumber}-${o}`;l.dataset.visualSelectorId=E});let qe=new MutationObserver(s=>{s.some(l=>{let E=y=>{if(y.nodeType===Node.ELEMENT_NODE){let A=y;if(A.dataset&&A.dataset.visualSelectorId)return!0;for(let R=0;R<A.children.length;R++)if(E(A.children[R]))return!0}return!1};return l.type==="attributes"&&(l.attributeName==="style"||l.attributeName==="class"||l.attributeName==="width"||l.attributeName==="height")&&E(l.target)})&&setTimeout(z,X)});window.addEventListener("message",Ge),window.addEventListener("scroll",de,!0),document.addEventListener("scroll",de,!0),window.addEventListener("resize",z),window.addEventListener("scroll",z),qe.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["style","class","width","height"]}),window.parent.postMessage({type:"visual-edit-agent-ready"},"*")}export{Mt as setupVisualEditAgent};
16
16
  //# sourceMappingURL=index.mjs.map