@frybynite/image-cloud 0.10.3 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as Ht, ref as It, onMounted as Nt, onUnmounted as kt, watch as Bt, h as jt } from "vue";
1
+ import { defineComponent as kt, ref as St, onMounted as Ht, onUnmounted as Nt, watch as Bt, h as jt } from "vue";
2
2
  const mt = Object.freeze({
3
3
  none: "none",
4
4
  sm: "0 2px 4px rgba(0,0,0,0.1)",
@@ -9,12 +9,12 @@ const mt = Object.freeze({
9
9
  energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
10
10
  playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
11
11
  subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
12
- }), At = Object.freeze({
12
+ }), Rt = Object.freeze({
13
13
  gentle: Object.freeze({ stiffness: 150, damping: 30, mass: 1, oscillations: 2 }),
14
14
  bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
15
15
  wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
16
16
  snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
17
- }), Rt = Object.freeze({
17
+ }), Tt = Object.freeze({
18
18
  gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
19
19
  playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
20
20
  serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
@@ -23,9 +23,9 @@ const mt = Object.freeze({
23
23
  type: "linear"
24
24
  }), vt = Object.freeze({
25
25
  mode: "none"
26
- }), Et = Object.freeze({
26
+ }), xt = Object.freeze({
27
27
  mode: "none"
28
- }), Ft = Object.freeze({
28
+ }), Mt = Object.freeze({
29
29
  default: Object.freeze({
30
30
  border: Object.freeze({
31
31
  width: 0,
@@ -62,10 +62,10 @@ const mt = Object.freeze({
62
62
  // Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
63
63
  }), qt = Object.freeze({
64
64
  spacing: 0
65
- }), Xt = Object.freeze({
65
+ }), Yt = Object.freeze({
66
66
  mobile: Object.freeze({ maxWidth: 767 }),
67
67
  tablet: Object.freeze({ maxWidth: 1199 })
68
- }), Yt = Object.freeze({
68
+ }), Xt = Object.freeze({
69
69
  mode: "adaptive",
70
70
  // Default to adaptive sizing
71
71
  minSize: 50,
@@ -77,15 +77,15 @@ const mt = Object.freeze({
77
77
  // No variance by default
78
78
  max: 1
79
79
  })
80
- }), Jt = Object.freeze({
80
+ }), Vt = Object.freeze({
81
81
  mode: "none",
82
82
  range: Object.freeze({
83
83
  min: -15,
84
84
  max: 15
85
85
  })
86
86
  }), Ot = Object.freeze({
87
- sizing: Yt,
88
- rotation: Jt
87
+ sizing: Xt,
88
+ rotation: Vt
89
89
  }), zt = Object.freeze({
90
90
  validateUrls: !0,
91
91
  validationTimeout: 5e3,
@@ -95,7 +95,7 @@ const mt = Object.freeze({
95
95
  enabled: !1,
96
96
  centers: !1,
97
97
  loaders: !1
98
- }), Vt = Object.freeze({ maxAngle: 5, speed: 2e3, sync: "random" }), Kt = Object.freeze({ minScale: 0.95, maxScale: 1.05, speed: 2400, sync: "random" }), Zt = Object.freeze({ onRatio: 0.7, speed: 3e3, style: "snap" }), Qt = Object.freeze({ speed: 4e3, direction: "clockwise" }), $t = Object.freeze({ type: "none" }), C = Object.freeze({
98
+ }), Jt = Object.freeze({ maxAngle: 5, speed: 2e3, sync: "random" }), Kt = Object.freeze({ minScale: 0.95, maxScale: 1.05, speed: 2400, sync: "random" }), Zt = Object.freeze({ onRatio: 0.7, speed: 3e3, style: "snap" }), Qt = Object.freeze({ speed: 4e3, direction: "clockwise" }), $t = Object.freeze({ type: "none" }), L = Object.freeze({
99
99
  // Loader configuration (always an array, composite behavior is implicit)
100
100
  loaders: [],
101
101
  // Shared loader settings and debug config
@@ -110,7 +110,7 @@ const mt = Object.freeze({
110
110
  algorithm: "radial",
111
111
  scaleDecay: 0,
112
112
  // No decay by default (0-1 for radial/spiral)
113
- responsive: Xt,
113
+ responsive: Yt,
114
114
  targetCoverage: 0.6,
115
115
  // Target 60% of container area
116
116
  densityFactor: 1,
@@ -158,7 +158,7 @@ const mt = Object.freeze({
158
158
  // smooth deceleration
159
159
  path: yt,
160
160
  rotation: vt,
161
- scale: Et
161
+ scale: xt
162
162
  }),
163
163
  idle: $t
164
164
  }),
@@ -185,119 +185,119 @@ const mt = Object.freeze({
185
185
  showFocusOutline: !1
186
186
  }),
187
187
  // Image styling
188
- styling: Ft
188
+ styling: Mt
189
189
  });
190
- function Z(o, t) {
191
- if (!o) return t || {};
192
- if (!t) return { ...o };
193
- const i = { ...o };
194
- return t.border !== void 0 && (i.border = { ...o.border, ...t.border }), t.borderTop !== void 0 && (i.borderTop = { ...o.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (i.borderRight = { ...o.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (i.borderBottom = { ...o.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (i.borderLeft = { ...o.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (i.filter = { ...o.filter, ...t.filter }), t.outline !== void 0 && (i.outline = { ...o.outline, ...t.outline }), t.shadow !== void 0 && (i.shadow = t.shadow), t.clipPath !== void 0 && (i.clipPath = t.clipPath), t.opacity !== void 0 && (i.opacity = t.opacity), t.cursor !== void 0 && (i.cursor = t.cursor), t.className !== void 0 && (i.className = t.className), t.objectFit !== void 0 && (i.objectFit = t.objectFit), t.aspectRatio !== void 0 && (i.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (i.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (i.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (i.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (i.borderRadiusBottomLeft = t.borderRadiusBottomLeft), i;
190
+ function Z(n, t) {
191
+ if (!n) return t || {};
192
+ if (!t) return { ...n };
193
+ const i = { ...n };
194
+ return t.border !== void 0 && (i.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (i.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (i.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (i.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (i.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (i.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (i.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (i.shadow = t.shadow), t.clipPath !== void 0 && (i.clipPath = t.clipPath), t.opacity !== void 0 && (i.opacity = t.opacity), t.cursor !== void 0 && (i.cursor = t.cursor), t.className !== void 0 && (i.className = t.className), t.objectFit !== void 0 && (i.objectFit = t.objectFit), t.aspectRatio !== void 0 && (i.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (i.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (i.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (i.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (i.borderRadiusBottomLeft = t.borderRadiusBottomLeft), i;
195
195
  }
196
- function te(o, t) {
197
- if (!t) return { ...o };
198
- const i = Z(o.default, t.default), e = Z(
199
- Z(i, o.hover),
196
+ function te(n, t) {
197
+ if (!t) return { ...n };
198
+ const i = Z(n.default, t.default), e = Z(
199
+ Z(i, n.hover),
200
200
  t.hover
201
- ), n = Z(
202
- Z(i, o.focused),
201
+ ), o = Z(
202
+ Z(i, n.focused),
203
203
  t.focused
204
204
  );
205
205
  return {
206
206
  default: i,
207
207
  hover: e,
208
- focused: n
208
+ focused: o
209
209
  };
210
210
  }
211
- function ee(o, t) {
212
- if (!t) return { ...o };
213
- const i = { ...o };
211
+ function ee(n, t) {
212
+ if (!t) return { ...n };
213
+ const i = { ...n };
214
214
  if (t.sizing !== void 0 && (i.sizing = {
215
- ...o.sizing,
215
+ ...n.sizing,
216
216
  ...t.sizing
217
217
  }, t.sizing.variance)) {
218
- const e = t.sizing.variance, n = e.min !== void 0 && e.min >= 0.25 && e.min <= 1 ? e.min : o.sizing?.variance?.min ?? 1, s = e.max !== void 0 && e.max >= 1 && e.max <= 1.75 ? e.max : o.sizing?.variance?.max ?? 1;
219
- i.sizing.variance = { min: n, max: s };
218
+ const e = t.sizing.variance, o = e.min !== void 0 && e.min >= 0.25 && e.min <= 1 ? e.min : n.sizing?.variance?.min ?? 1, s = e.max !== void 0 && e.max >= 1 && e.max <= 1.75 ? e.max : n.sizing?.variance?.max ?? 1;
219
+ i.sizing.variance = { min: o, max: s };
220
220
  }
221
221
  if (t.rotation !== void 0 && (i.rotation = {
222
- ...o.rotation,
222
+ ...n.rotation,
223
223
  ...t.rotation
224
224
  }, t.rotation.range)) {
225
- const e = t.rotation.range, n = e.min !== void 0 && e.min >= -180 && e.min <= 0 ? e.min : o.rotation?.range?.min ?? -15, s = e.max !== void 0 && e.max >= 0 && e.max <= 180 ? e.max : o.rotation?.range?.max ?? 15;
226
- i.rotation.range = { min: n, max: s };
225
+ const e = t.rotation.range, o = e.min !== void 0 && e.min >= -180 && e.min <= 0 ? e.min : n.rotation?.range?.min ?? -15, s = e.max !== void 0 && e.max >= 0 && e.max <= 180 ? e.max : n.rotation?.range?.max ?? 15;
226
+ i.rotation.range = { min: o, max: s };
227
227
  }
228
228
  return i;
229
229
  }
230
- function ie(o = {}) {
231
- const t = o.image, i = [...o.loaders ?? []];
232
- o.images && o.images.length > 0 && i.unshift({
230
+ function ie(n = {}) {
231
+ const t = n.image, i = [...n.loaders ?? []];
232
+ n.images && n.images.length > 0 && i.unshift({
233
233
  static: {
234
- sources: [{ urls: o.images }]
234
+ sources: [{ urls: n.images }]
235
235
  }
236
236
  });
237
- const n = {
237
+ const o = {
238
238
  loaders: {
239
239
  ...zt,
240
- ...o.config?.loaders ?? {}
240
+ ...n.config?.loaders ?? {}
241
241
  }
242
242
  }, s = {
243
243
  loaders: i,
244
- config: n,
244
+ config: o,
245
245
  image: ee(Ot, t),
246
- layout: { ...C.layout },
247
- animation: { ...C.animation },
248
- interaction: { ...C.interaction },
249
- ui: { ...C.ui },
250
- styling: te(Ft, o.styling)
246
+ layout: { ...L.layout },
247
+ animation: { ...L.animation },
248
+ interaction: { ...L.interaction },
249
+ ui: { ...L.ui },
250
+ styling: te(Mt, n.styling)
251
251
  };
252
- if (o.layout && (s.layout = {
253
- ...C.layout,
254
- ...o.layout
255
- }, o.layout.responsive && (s.layout.responsive = {
256
- ...C.layout.responsive,
257
- mobile: o.layout.responsive.mobile ? { ...C.layout.responsive.mobile, ...o.layout.responsive.mobile } : C.layout.responsive.mobile,
258
- tablet: o.layout.responsive.tablet ? { ...C.layout.responsive.tablet, ...o.layout.responsive.tablet } : C.layout.responsive.tablet
259
- }), o.layout.spacing && (s.layout.spacing = {
260
- ...C.layout.spacing,
261
- ...o.layout.spacing
262
- })), o.animation && (s.animation = {
263
- ...C.animation,
264
- ...o.animation
265
- }, o.animation.easing && (s.animation.easing = {
266
- ...C.animation.easing,
267
- ...o.animation.easing
268
- }), o.animation.queue && (s.animation.queue = {
269
- ...C.animation.queue,
270
- ...o.animation.queue
271
- }), o.animation.entry && (s.animation.entry = {
272
- ...C.animation.entry,
273
- ...o.animation.entry,
274
- start: o.animation.entry.start ? {
275
- ...C.animation.entry.start,
276
- ...o.animation.entry.start,
277
- circular: o.animation.entry.start.circular ? { ...C.animation.entry.start.circular, ...o.animation.entry.start.circular } : C.animation.entry.start.circular
278
- } : C.animation.entry.start,
279
- timing: o.animation.entry.timing ? { ...C.animation.entry.timing, ...o.animation.entry.timing } : C.animation.entry.timing,
280
- path: o.animation.entry.path ? { ...yt, ...o.animation.entry.path } : C.animation.entry.path,
281
- rotation: o.animation.entry.rotation ? { ...vt, ...o.animation.entry.rotation } : C.animation.entry.rotation,
282
- scale: o.animation.entry.scale ? { ...Et, ...o.animation.entry.scale } : C.animation.entry.scale
283
- }), o.animation.idle && (s.animation.idle = {
252
+ if (n.layout && (s.layout = {
253
+ ...L.layout,
254
+ ...n.layout
255
+ }, n.layout.responsive && (s.layout.responsive = {
256
+ ...L.layout.responsive,
257
+ mobile: n.layout.responsive.mobile ? { ...L.layout.responsive.mobile, ...n.layout.responsive.mobile } : L.layout.responsive.mobile,
258
+ tablet: n.layout.responsive.tablet ? { ...L.layout.responsive.tablet, ...n.layout.responsive.tablet } : L.layout.responsive.tablet
259
+ }), n.layout.spacing && (s.layout.spacing = {
260
+ ...L.layout.spacing,
261
+ ...n.layout.spacing
262
+ })), n.animation && (s.animation = {
263
+ ...L.animation,
264
+ ...n.animation
265
+ }, n.animation.easing && (s.animation.easing = {
266
+ ...L.animation.easing,
267
+ ...n.animation.easing
268
+ }), n.animation.queue && (s.animation.queue = {
269
+ ...L.animation.queue,
270
+ ...n.animation.queue
271
+ }), n.animation.entry && (s.animation.entry = {
272
+ ...L.animation.entry,
273
+ ...n.animation.entry,
274
+ start: n.animation.entry.start ? {
275
+ ...L.animation.entry.start,
276
+ ...n.animation.entry.start,
277
+ circular: n.animation.entry.start.circular ? { ...L.animation.entry.start.circular, ...n.animation.entry.start.circular } : L.animation.entry.start.circular
278
+ } : L.animation.entry.start,
279
+ timing: n.animation.entry.timing ? { ...L.animation.entry.timing, ...n.animation.entry.timing } : L.animation.entry.timing,
280
+ path: n.animation.entry.path ? { ...yt, ...n.animation.entry.path } : L.animation.entry.path,
281
+ rotation: n.animation.entry.rotation ? { ...vt, ...n.animation.entry.rotation } : L.animation.entry.rotation,
282
+ scale: n.animation.entry.scale ? { ...xt, ...n.animation.entry.scale } : L.animation.entry.scale
283
+ }), n.animation.idle && (s.animation.idle = {
284
284
  ...$t,
285
- ...o.animation.idle
286
- })), o.interaction && (s.interaction = {
287
- ...C.interaction,
288
- ...o.interaction
289
- }, o.interaction.focus && (s.interaction.focus = {
290
- ...C.interaction.focus,
291
- ...o.interaction.focus
292
- }), o.interaction.navigation && (s.interaction.navigation = {
293
- ...C.interaction.navigation,
294
- ...o.interaction.navigation
285
+ ...n.animation.idle
286
+ })), n.interaction && (s.interaction = {
287
+ ...L.interaction,
288
+ ...n.interaction
289
+ }, n.interaction.focus && (s.interaction.focus = {
290
+ ...L.interaction.focus,
291
+ ...n.interaction.focus
292
+ }), n.interaction.navigation && (s.interaction.navigation = {
293
+ ...L.interaction.navigation,
294
+ ...n.interaction.navigation
295
295
  })), s.ui = {
296
- ...C.ui,
297
- ...o.ui
296
+ ...L.ui,
297
+ ...n.ui
298
298
  }, s.config.debug = {
299
299
  ...Dt,
300
- ...o.config?.debug ?? {}
300
+ ...n.config?.debug ?? {}
301
301
  }, s.layout.algorithm === "honeycomb" && s.styling) {
302
302
  const r = { shape: "hexagon", mode: "height-relative" };
303
303
  s.styling = {
@@ -309,14 +309,14 @@ function ie(o = {}) {
309
309
  }
310
310
  return s;
311
311
  }
312
- function ne(o, t) {
313
- return { ...o ? Ct[o] : Ct.playful, ...t };
312
+ function oe(n, t) {
313
+ return { ...n ? Ct[n] : Ct.playful, ...t };
314
314
  }
315
- function oe(o, t) {
316
- return { ...o ? At[o] : At.gentle, ...t };
315
+ function ne(n, t) {
316
+ return { ...n ? Rt[n] : Rt.gentle, ...t };
317
317
  }
318
- function se(o, t) {
319
- return { ...o ? Rt[o] : Rt.gentle, ...t };
318
+ function se(n, t) {
319
+ return { ...n ? Tt[n] : Tt.gentle, ...t };
320
320
  }
321
321
  class ae {
322
322
  constructor(t) {
@@ -329,8 +329,8 @@ class ae {
329
329
  buildTransformString(t) {
330
330
  const i = ["translate(-50%, -50%)"];
331
331
  if (t.x !== void 0 || t.y !== void 0) {
332
- const e = t.x ?? 0, n = t.y ?? 0;
333
- i.push(`translate(${e}px, ${n}px)`);
332
+ const e = t.x ?? 0, o = t.y ?? 0;
333
+ i.push(`translate(${e}px, ${o}px)`);
334
334
  }
335
335
  return t.rotation !== void 0 && i.push(`rotate(${t.rotation}deg)`), t.scale !== void 0 && i.push(`scale(${t.scale})`), i.join(" ");
336
336
  }
@@ -343,14 +343,14 @@ class ae {
343
343
  * @param easing - CSS easing function (optional)
344
344
  * @returns AnimationHandle that can be used to cancel or query the animation
345
345
  */
346
- animateTransformCancellable(t, i, e, n = null, s = null) {
346
+ animateTransformCancellable(t, i, e, o = null, s = null) {
347
347
  this.cancelAllAnimations(t);
348
- const r = n ?? this.config.duration, a = s ?? this.config.easing.default, c = this.buildTransformString(i), l = this.buildTransformString(e);
348
+ const r = o ?? this.config.duration, a = s ?? this.config.easing.default, c = this.buildTransformString(i), d = this.buildTransformString(e);
349
349
  t.style.transition = "none";
350
350
  const u = t.animate(
351
351
  [
352
352
  { transform: c },
353
- { transform: l }
353
+ { transform: d }
354
354
  ],
355
355
  {
356
356
  duration: r,
@@ -358,7 +358,7 @@ class ae {
358
358
  fill: "forwards"
359
359
  // Keep final state after animation
360
360
  }
361
- ), h = {
361
+ ), f = {
362
362
  id: `anim-${++this.animationIdCounter}`,
363
363
  element: t,
364
364
  animation: u,
@@ -367,11 +367,11 @@ class ae {
367
367
  startTime: performance.now(),
368
368
  duration: r
369
369
  };
370
- return this.activeAnimations.set(t, h), u.finished.then(() => {
371
- t.style.transform = l, this.activeAnimations.delete(t);
370
+ return this.activeAnimations.set(t, f), u.finished.then(() => {
371
+ t.style.transform = d, this.activeAnimations.delete(t);
372
372
  }).catch(() => {
373
373
  this.activeAnimations.delete(t);
374
- }), h;
374
+ }), f;
375
375
  }
376
376
  /**
377
377
  * Cancel an active animation
@@ -382,13 +382,13 @@ class ae {
382
382
  cancelAnimation(t, i = !0) {
383
383
  const e = this.getCurrentTransform(t.element);
384
384
  if (t.animation.cancel(), i) {
385
- const n = this.buildTransformString({
385
+ const o = this.buildTransformString({
386
386
  x: e.x,
387
387
  y: e.y,
388
388
  rotation: e.rotation,
389
389
  scale: e.scale
390
390
  });
391
- t.element.style.transform = n;
391
+ t.element.style.transform = o;
392
392
  }
393
393
  return this.activeAnimations.delete(t.element), e;
394
394
  }
@@ -401,8 +401,8 @@ class ae {
401
401
  const i = this.activeAnimations.get(t);
402
402
  i && this.cancelAnimation(i, !1);
403
403
  const e = t.getAnimations();
404
- for (const n of e)
405
- n.cancel();
404
+ for (const o of e)
405
+ o.cancel();
406
406
  }
407
407
  /**
408
408
  * Get current transform state of an element (works mid-animation)
@@ -414,7 +414,7 @@ class ae {
414
414
  const e = getComputedStyle(t).transform;
415
415
  if (e === "none" || !e)
416
416
  return { x: 0, y: 0, rotation: 0, scale: 1 };
417
- const n = new DOMMatrix(e), s = Math.sqrt(n.a * n.a + n.b * n.b), r = Math.atan2(n.b, n.a) * (180 / Math.PI), a = n.e, c = n.f;
417
+ const o = new DOMMatrix(e), s = Math.sqrt(o.a * o.a + o.b * o.b), r = Math.atan2(o.b, o.a) * (180 / Math.PI), a = o.e, c = o.f;
418
418
  return { x: a, y: c, rotation: r, scale: s };
419
419
  }
420
420
  /**
@@ -441,9 +441,9 @@ class ae {
441
441
  * @param easing - CSS easing function (optional)
442
442
  * @returns Promise that resolves when animation completes
443
443
  */
444
- animateTransform(t, i, e = null, n = null) {
444
+ animateTransform(t, i, e = null, o = null) {
445
445
  return new Promise((s) => {
446
- const r = e ?? this.config.duration, a = n ?? this.config.easing.default;
446
+ const r = e ?? this.config.duration, a = o ?? this.config.easing.default;
447
447
  t.style.transition = `transform ${r}ms ${a}, box-shadow ${r}ms ${a}`, t.style.transform = this.buildTransformString(i), setTimeout(() => {
448
448
  s();
449
449
  }, r);
@@ -474,159 +474,165 @@ class ae {
474
474
  return new Promise((i) => setTimeout(i, t));
475
475
  }
476
476
  }
477
- function V(o, t, i) {
478
- return o + (t - o) * i;
477
+ function J(n, t, i) {
478
+ return n + (t - n) * i;
479
479
  }
480
- function re(o, t, i, e) {
481
- const { overshoot: n, bounces: s, decayRatio: r } = e, a = i.x - t.x, c = i.y - t.y, l = ce(s, r);
482
- let u = 0, h = 0, d = 1, g = n, p = !1;
483
- for (let f = 0; f < l.length; f++)
484
- if (o <= l[f].time) {
485
- h = f === 0 ? 0 : l[f - 1].time, d = l[f].time, g = l[f].overshoot, p = l[f].isOvershoot;
480
+ function re(n, t, i, e) {
481
+ const { overshoot: o, bounces: s, decayRatio: r } = e, a = i.x - t.x, c = i.y - t.y, d = ce(s, r);
482
+ let u = 0, f = 0, m = 1, p = o, w = !1;
483
+ for (let l = 0; l < d.length; l++)
484
+ if (n <= d[l].time) {
485
+ f = l === 0 ? 0 : d[l - 1].time, m = d[l].time, p = d[l].overshoot, w = d[l].isOvershoot;
486
486
  break;
487
487
  }
488
- const b = (o - h) / (d - h);
489
- if (p)
490
- u = 1 + g * at(b);
491
- else if (h === 0)
492
- u = at(b);
488
+ const v = (n - f) / (m - f);
489
+ if (w)
490
+ u = 1 + p * at(v);
491
+ else if (f === 0)
492
+ u = at(v);
493
493
  else {
494
- const m = 1 + (l.find(
495
- (y, E) => y.time > h && E > 0 && l[E - 1].isOvershoot
496
- )?.overshoot || g);
497
- u = V(m, 1, at(b));
494
+ const g = 1 + (d.find(
495
+ (h, b) => h.time > f && b > 0 && d[b - 1].isOvershoot
496
+ )?.overshoot || p);
497
+ u = J(g, 1, at(v));
498
498
  }
499
499
  return {
500
500
  x: t.x + a * u,
501
501
  y: t.y + c * u
502
502
  };
503
503
  }
504
- function ce(o, t) {
504
+ function ce(n, t) {
505
505
  const i = [];
506
506
  let e = 0.6;
507
507
  i.push({ time: e, overshoot: 0, isOvershoot: !1 });
508
- let n = 0.15;
509
- const r = 0.4 / (o * 2);
510
- for (let a = 0; a < o; a++)
511
- e += r, i.push({ time: e, overshoot: n, isOvershoot: !0 }), e += r, i.push({ time: e, overshoot: n * t, isOvershoot: !1 }), n *= t;
508
+ let o = 0.15;
509
+ const r = 0.4 / (n * 2);
510
+ for (let a = 0; a < n; a++)
511
+ e += r, i.push({ time: e, overshoot: o, isOvershoot: !0 }), e += r, i.push({ time: e, overshoot: o * t, isOvershoot: !1 }), o *= t;
512
512
  return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
513
513
  }
514
- function le(o, t, i, e) {
515
- const { stiffness: n, damping: s, mass: r, oscillations: a } = e, c = i.x - t.x, l = i.y - t.y, u = Math.sqrt(n / r), h = s / (2 * Math.sqrt(n * r));
516
- let d;
517
- if (h < 1) {
518
- const g = u * Math.sqrt(1 - h * h), p = Math.exp(-h * u * o * 3), b = Math.cos(g * o * a * Math.PI);
519
- d = 1 - p * b;
514
+ function le(n, t, i, e) {
515
+ const { stiffness: o, damping: s, mass: r, oscillations: a } = e, c = i.x - t.x, d = i.y - t.y, u = Math.sqrt(o / r), f = s / (2 * Math.sqrt(o * r));
516
+ let m;
517
+ if (f < 1) {
518
+ const p = u * Math.sqrt(1 - f * f), w = Math.exp(-f * u * n * 3), v = Math.cos(p * n * a * Math.PI);
519
+ m = 1 - w * v;
520
520
  } else
521
- d = 1 - Math.exp(-u * o * 3);
522
- return d = Math.max(0, Math.min(d, 1.3)), {
523
- x: t.x + c * d,
524
- y: t.y + l * d
521
+ m = 1 - Math.exp(-u * n * 3);
522
+ return m = Math.max(0, Math.min(m, 1.3)), {
523
+ x: t.x + c * m,
524
+ y: t.y + d * m
525
525
  };
526
526
  }
527
- function he(o, t, i, e) {
528
- const { amplitude: n, frequency: s, decay: r, decayRate: a, phase: c } = e, l = i.x - t.x, u = i.y - t.y, h = Math.sqrt(l * l + u * u), d = h > 0 ? -u / h : 0, g = h > 0 ? l / h : 1, p = s * Math.PI * 2 * o + c, b = r ? Math.pow(1 - o, a) : 1, f = n * Math.sin(p) * b, m = de(o);
527
+ function he(n, t, i, e) {
528
+ const { amplitude: o, frequency: s, decay: r, decayRate: a, phase: c } = e, d = i.x - t.x, u = i.y - t.y, f = Math.sqrt(d * d + u * u), m = f > 0 ? -u / f : 0, p = f > 0 ? d / f : 1, w = s * Math.PI * 2 * n + c, v = r ? Math.pow(1 - n, a) : 1, l = o * Math.sin(w) * v, g = de(n);
529
529
  return {
530
- x: V(t.x, i.x, m) + f * d,
531
- y: V(t.y, i.y, m) + f * g
530
+ x: J(t.x, i.x, g) + l * m,
531
+ y: J(t.y, i.y, g) + l * p
532
532
  };
533
533
  }
534
- function at(o) {
535
- return 1 - (1 - o) * (1 - o);
534
+ function at(n) {
535
+ return 1 - (1 - n) * (1 - n);
536
536
  }
537
- function de(o) {
538
- return 1 - Math.pow(1 - o, 3);
537
+ function de(n) {
538
+ return 1 - Math.pow(1 - n, 3);
539
539
  }
540
- function ue(o, t, i) {
541
- const { amplitude: e, frequency: n, decay: s } = i, r = Math.sin(o * n * Math.PI * 2), a = s ? Math.pow(1 - o, 2) : 1, c = e * r * a;
540
+ function ue(n, t, i) {
541
+ const { amplitude: e, frequency: o, decay: s } = i, r = Math.sin(n * o * Math.PI * 2), a = s ? Math.pow(1 - n, 2) : 1, c = e * r * a;
542
542
  return t + c;
543
543
  }
544
- function fe(o, t, i) {
545
- const { overshoot: e, bounces: n } = i, s = [];
544
+ function fe(n, t, i) {
545
+ const { overshoot: e, bounces: o } = i, s = [];
546
546
  s.push({ time: 0.5, scale: e });
547
547
  let r = e;
548
- const a = 0.5, l = 0.5 / (n * 2);
548
+ const a = 0.5, d = 0.5 / (o * 2);
549
549
  let u = 0.5;
550
- for (let d = 0; d < n; d++) {
551
- const g = 1 - (r - 1) * a;
552
- u += l, s.push({ time: u, scale: g }), r = 1 + (r - 1) * a * a, u += l, d < n - 1 && s.push({ time: u, scale: r });
550
+ for (let m = 0; m < o; m++) {
551
+ const p = 1 - (r - 1) * a;
552
+ u += d, s.push({ time: u, scale: p }), r = 1 + (r - 1) * a * a, u += d, m < o - 1 && s.push({ time: u, scale: r });
553
553
  }
554
554
  s.push({ time: 1, scale: 1 });
555
- let h = 1;
556
- for (let d = 0; d < s.length; d++)
557
- if (o <= s[d].time) {
558
- const g = d === 0 ? 0 : s[d - 1].time, p = d === 0 ? 1 : s[d - 1].scale, b = (o - g) / (s[d].time - g), f = at(b);
559
- h = p + (s[d].scale - p) * f;
555
+ let f = 1;
556
+ for (let m = 0; m < s.length; m++)
557
+ if (n <= s[m].time) {
558
+ const p = m === 0 ? 0 : s[m - 1].time, w = m === 0 ? 1 : s[m - 1].scale, v = (n - p) / (s[m].time - p), l = at(v);
559
+ f = w + (s[m].scale - w) * l;
560
560
  break;
561
561
  }
562
- return h * t;
562
+ return f * t;
563
563
  }
564
- function ge(o) {
564
+ function ge(n) {
565
565
  const {
566
566
  element: t,
567
567
  startPosition: i,
568
568
  endPosition: e,
569
- pathConfig: n,
569
+ pathConfig: o,
570
570
  duration: s,
571
571
  imageWidth: r,
572
572
  imageHeight: a,
573
573
  rotation: c,
574
- scale: l,
574
+ scale: d,
575
575
  onComplete: u,
576
- rotationConfig: h,
577
- startRotation: d,
578
- scaleConfig: g,
579
- startScale: p
580
- } = o, b = n.type, f = d !== void 0 && d !== c, m = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, E = f || m, v = p !== void 0 && p !== l, S = g?.mode === "pop", w = g?.pop || { overshoot: 1.2, bounces: 1 };
581
- if (b === "linear" && !E && !(v || S)) {
576
+ onProgress: f,
577
+ rotationConfig: m,
578
+ startRotation: p,
579
+ scaleConfig: w,
580
+ startScale: v
581
+ } = n, l = o.type, g = p !== void 0 && p !== c, h = m?.mode === "wobble", b = m?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, I = g || h, y = v !== void 0 && v !== d, x = w?.mode === "pop", E = w?.pop || { overshoot: 1.2, bounces: 1 };
582
+ if (l === "linear" && !I && !(y || x)) {
582
583
  u && u();
583
584
  return;
584
585
  }
585
- const O = performance.now(), L = -r / 2, _ = -a / 2;
586
- function z(H) {
587
- const N = H - O, A = Math.min(N / s, 1);
588
- let D;
589
- switch (b) {
586
+ const R = performance.now(), M = -r / 2, T = -a / 2;
587
+ function z(k) {
588
+ const D = k - R, O = Math.min(D / s, 1);
589
+ let S;
590
+ switch (l) {
590
591
  case "bounce": {
591
- const k = ne(
592
- n.bouncePreset,
593
- n.bounce
592
+ const N = oe(
593
+ o.bouncePreset,
594
+ o.bounce
594
595
  );
595
- D = re(A, i, e, k);
596
+ S = re(O, i, e, N);
596
597
  break;
597
598
  }
598
599
  case "elastic": {
599
- const k = oe(
600
- n.elasticPreset,
601
- n.elastic
600
+ const N = ne(
601
+ o.elasticPreset,
602
+ o.elastic
602
603
  );
603
- D = le(A, i, e, k);
604
+ S = le(O, i, e, N);
604
605
  break;
605
606
  }
606
607
  case "wave": {
607
- const k = se(
608
- n.wavePreset,
609
- n.wave
608
+ const N = se(
609
+ o.wavePreset,
610
+ o.wave
610
611
  );
611
- D = he(A, i, e, k);
612
+ S = he(O, i, e, N);
612
613
  break;
613
614
  }
614
615
  default:
615
- D = {
616
- x: V(i.x, e.x, A),
617
- y: V(i.y, e.y, A)
616
+ S = {
617
+ x: J(i.x, e.x, O),
618
+ y: J(i.y, e.y, O)
618
619
  };
619
620
  }
620
- const W = D.x - e.x, U = D.y - e.y;
621
- let M;
622
- m ? M = ue(A, c, y) : f ? M = V(d, c, A) : M = c;
623
- let R;
624
- S ? R = fe(A, l, w) : v ? R = V(p, l, A) : R = l, t.style.transform = `translate(${L}px, ${_}px) translate(${W}px, ${U}px) rotate(${M}deg) scale(${R})`, A < 1 ? requestAnimationFrame(z) : (t.style.transform = `translate(${L}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
621
+ const _ = S.x - e.x, $ = S.y - e.y;
622
+ let A;
623
+ h ? A = ue(O, c, b) : g ? A = J(p, c, O) : A = c;
624
+ let j;
625
+ x ? j = fe(O, d, E) : y ? j = J(v, d, O) : j = d, t.style.transform = `translate(${M}px, ${T}px) translate(${_}px, ${$}px) rotate(${A}deg) scale(${j})`, f && O < 1 && f(O, D, {
626
+ x: S.x,
627
+ y: S.y,
628
+ rotation: A,
629
+ scale: j
630
+ }), O < 1 ? requestAnimationFrame(z) : (t.style.transform = `translate(${M}px, ${T}px) rotate(${c}deg) scale(${d})`, u && u());
625
631
  }
626
632
  requestAnimationFrame(z);
627
633
  }
628
- function me(o) {
629
- return o === "bounce" || o === "elastic" || o === "wave";
634
+ function me(n) {
635
+ return n === "bounce" || n === "elastic" || n === "wave";
630
636
  }
631
637
  const pe = {
632
638
  radial: "center",
@@ -639,7 +645,7 @@ const pe = {
639
645
  };
640
646
  class be {
641
647
  constructor(t, i) {
642
- this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || yt, this.rotationConfig = t.rotation || vt, this.scaleConfig = t.scale || Et;
648
+ this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || yt, this.rotationConfig = t.rotation || vt, this.scaleConfig = t.scale || xt;
643
649
  }
644
650
  /**
645
651
  * Get the effective start position, considering layout-aware defaults
@@ -650,7 +656,7 @@ class be {
650
656
  /**
651
657
  * Calculate the starting position for an image's entry animation
652
658
  */
653
- calculateStartPosition(t, i, e, n, s) {
659
+ calculateStartPosition(t, i, e, o, s) {
654
660
  const r = this.resolvedStartPosition, a = this.config.start.offset ?? 100;
655
661
  switch (r) {
656
662
  case "nearest-edge":
@@ -672,7 +678,7 @@ class be {
672
678
  t,
673
679
  i,
674
680
  e,
675
- n,
681
+ o,
676
682
  s
677
683
  );
678
684
  default:
@@ -682,28 +688,28 @@ class be {
682
688
  /**
683
689
  * Calculate start position from the nearest edge (current default behavior)
684
690
  */
685
- calculateNearestEdge(t, i, e, n) {
686
- const s = t.x, r = t.y, a = s, c = e.width - s, l = r, u = e.height - r, h = Math.min(a, c, l, u);
687
- let d = t.x, g = t.y;
688
- return h === a ? d = -(i.width + n) : h === c ? d = e.width + n : h === l ? g = -(i.height + n) : g = e.height + n, { x: d, y: g };
691
+ calculateNearestEdge(t, i, e, o) {
692
+ const s = t.x, r = t.y, a = s, c = e.width - s, d = r, u = e.height - r, f = Math.min(a, c, d, u);
693
+ let m = t.x, p = t.y;
694
+ return f === a ? m = -(i.width + o) : f === c ? m = e.width + o : f === d ? p = -(i.height + o) : p = e.height + o, { x: m, y: p };
689
695
  }
690
696
  /**
691
697
  * Calculate start position from a specific edge
692
698
  */
693
- calculateEdgePosition(t, i, e, n, s) {
699
+ calculateEdgePosition(t, i, e, o, s) {
694
700
  let r = i.x, a = i.y;
695
701
  switch (t) {
696
702
  case "top":
697
703
  a = -(e.height + s);
698
704
  break;
699
705
  case "bottom":
700
- a = n.height + s;
706
+ a = o.height + s;
701
707
  break;
702
708
  case "left":
703
709
  r = -(e.width + s);
704
710
  break;
705
711
  case "right":
706
- r = n.width + s;
712
+ r = o.width + s;
707
713
  break;
708
714
  }
709
715
  return { x: r, y: a };
@@ -712,9 +718,9 @@ class be {
712
718
  * Calculate start position from center with scale animation
713
719
  */
714
720
  calculateCenterPosition(t, i, e) {
715
- const n = t.width / 2, s = t.height / 2;
721
+ const o = t.width / 2, s = t.height / 2;
716
722
  return {
717
- x: n,
723
+ x: o,
718
724
  y: s,
719
725
  useScale: !0
720
726
  // Signal to use scale animation from 0
@@ -723,28 +729,28 @@ class be {
723
729
  /**
724
730
  * Calculate start position from a random edge
725
731
  */
726
- calculateRandomEdge(t, i, e, n) {
732
+ calculateRandomEdge(t, i, e, o) {
727
733
  const s = ["top", "bottom", "left", "right"], r = s[Math.floor(Math.random() * s.length)];
728
- return this.calculateEdgePosition(r, t, i, e, n);
734
+ return this.calculateEdgePosition(r, t, i, e, o);
729
735
  }
730
736
  /**
731
737
  * Calculate start position on a circle around the container
732
738
  */
733
- calculateCircularPosition(t, i, e, n, s) {
739
+ calculateCircularPosition(t, i, e, o, s) {
734
740
  const r = this.config.start.circular || {}, a = r.distribution || "even";
735
741
  let c;
736
- const l = r.radius || "120%";
737
- if (typeof l == "string" && l.endsWith("%")) {
738
- const b = parseFloat(l) / 100;
742
+ const d = r.radius || "120%";
743
+ if (typeof d == "string" && d.endsWith("%")) {
744
+ const v = parseFloat(d) / 100;
739
745
  c = Math.sqrt(
740
746
  e.width ** 2 + e.height ** 2
741
- ) * b / 2;
747
+ ) * v / 2;
742
748
  } else
743
- c = typeof l == "number" ? l : 500;
749
+ c = typeof d == "number" ? d : 500;
744
750
  let u;
745
- a === "even" ? u = n / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
746
- const h = e.width / 2, d = e.height / 2, g = h + Math.cos(u) * c, p = d + Math.sin(u) * c;
747
- return { x: g, y: p };
751
+ a === "even" ? u = o / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
752
+ const f = e.width / 2, m = e.height / 2, p = f + Math.cos(u) * c, w = m + Math.sin(u) * c;
753
+ return { x: p, y: w };
748
754
  }
749
755
  /**
750
756
  * Get animation parameters for an image
@@ -763,17 +769,17 @@ class be {
763
769
  * Build a CSS transform string for the start position
764
770
  * Uses pixel-based centering offset for reliable cross-browser behavior
765
771
  */
766
- buildStartTransform(t, i, e, n, s, r, a, c) {
767
- const l = t.x - i.x, u = t.y - i.y, h = a !== void 0 ? a : e, d = c !== void 0 ? c : n, g = s !== void 0 ? -s / 2 : 0, p = r !== void 0 ? -r / 2 : 0, b = s !== void 0 ? `translate(${g}px, ${p}px)` : "translate(-50%, -50%)";
768
- return t.useScale ? `${b} translate(${l}px, ${u}px) rotate(${h}deg) scale(0)` : `${b} translate(${l}px, ${u}px) rotate(${h}deg) scale(${d})`;
772
+ buildStartTransform(t, i, e, o, s, r, a, c) {
773
+ const d = t.x - i.x, u = t.y - i.y, f = a !== void 0 ? a : e, m = c !== void 0 ? c : o, p = s !== void 0 ? -s / 2 : 0, w = r !== void 0 ? -r / 2 : 0, v = s !== void 0 ? `translate(${p}px, ${w}px)` : "translate(-50%, -50%)";
774
+ return t.useScale ? `${v} translate(${d}px, ${u}px) rotate(${f}deg) scale(0)` : `${v} translate(${d}px, ${u}px) rotate(${f}deg) scale(${m})`;
769
775
  }
770
776
  /**
771
777
  * Build the final CSS transform string
772
778
  * Uses pixel-based centering offset for reliable cross-browser behavior
773
779
  */
774
- buildFinalTransform(t, i, e, n) {
775
- if (e !== void 0 && n !== void 0) {
776
- const s = -e / 2, r = -n / 2;
780
+ buildFinalTransform(t, i, e, o) {
781
+ if (e !== void 0 && o !== void 0) {
782
+ const s = -e / 2, r = -o / 2;
777
783
  return `translate(${s}px, ${r}px) rotate(${t}deg) scale(${i})`;
778
784
  }
779
785
  return `translate(-50%, -50%) rotate(${t}deg) scale(${i})`;
@@ -839,12 +845,12 @@ class be {
839
845
  return t + (Math.random() - 0.5) * 60;
840
846
  if (typeof e == "number")
841
847
  return e;
842
- const n = e.max - e.min;
843
- return e.min + Math.random() * n;
848
+ const o = e.max - e.min;
849
+ return e.min + Math.random() * o;
844
850
  }
845
851
  case "spin": {
846
- const e = this.rotationConfig.spinCount ?? 1, n = this.resolveSpinDirection(t);
847
- return t + e * 360 * n;
852
+ const e = this.rotationConfig.spinCount ?? 1, o = this.resolveSpinDirection(t);
853
+ return t + e * 360 * o;
848
854
  }
849
855
  case "random":
850
856
  return t + (Math.random() - 0.5) * 60;
@@ -892,8 +898,8 @@ class be {
892
898
  amplitude: 15,
893
899
  frequency: 3,
894
900
  decay: !0
895
- }, { amplitude: n, frequency: s, decay: r } = e, a = Math.sin(t * s * Math.PI * 2), c = r ? Math.pow(1 - t, 2) : 1, l = n * a * c;
896
- return i + l;
901
+ }, { amplitude: o, frequency: s, decay: r } = e, a = Math.sin(t * s * Math.PI * 2), c = r ? Math.pow(1 - t, 2) : 1, d = o * a * c;
902
+ return i + d;
897
903
  }
898
904
  /**
899
905
  * Get the scale configuration
@@ -949,12 +955,12 @@ class be {
949
955
  const e = this.scaleConfig.pop || {
950
956
  overshoot: 1.2,
951
957
  bounces: 1
952
- }, { overshoot: n, bounces: s } = e, r = this.generateScaleBounceKeyframes(s, n);
958
+ }, { overshoot: o, bounces: s } = e, r = this.generateScaleBounceKeyframes(s, o);
953
959
  let a = i;
954
960
  for (let c = 0; c < r.length; c++)
955
961
  if (t <= r[c].time) {
956
- const l = c === 0 ? 0 : r[c - 1].time, u = c === 0 ? i : r[c - 1].scale, h = (t - l) / (r[c].time - l), d = this.easeOutQuad(h);
957
- a = u + (r[c].scale - u) * d;
962
+ const d = c === 0 ? 0 : r[c - 1].time, u = c === 0 ? i : r[c - 1].scale, f = (t - d) / (r[c].time - d), m = this.easeOutQuad(f);
963
+ a = u + (r[c].scale - u) * m;
958
964
  break;
959
965
  }
960
966
  return a * i;
@@ -965,12 +971,12 @@ class be {
965
971
  generateScaleBounceKeyframes(t, i) {
966
972
  const e = [];
967
973
  e.push({ time: 0.5, scale: i });
968
- let n = i;
974
+ let o = i;
969
975
  const s = 0.5, a = 0.5 / (t * 2);
970
976
  let c = 0.5;
971
- for (let l = 0; l < t; l++) {
972
- const u = 1 - (n - 1) * s;
973
- c += a, e.push({ time: c, scale: u }), n = 1 + (n - 1) * s * s, c += a, l < t - 1 && e.push({ time: c, scale: n });
977
+ for (let d = 0; d < t; d++) {
978
+ const u = 1 - (o - 1) * s;
979
+ c += a, e.push({ time: c, scale: u }), o = 1 + (o - 1) * s * s, c += a, d < t - 1 && e.push({ time: c, scale: o });
974
980
  }
975
981
  return e.push({ time: 1, scale: 1 }), e;
976
982
  }
@@ -989,9 +995,9 @@ class ye {
989
995
  * Register an image element for idle animation.
990
996
  * Starts animation after entry duration completes.
991
997
  */
992
- register(t, i, e, n) {
998
+ register(t, i, e, o) {
993
999
  if (this.entries.has(t)) return;
994
- const s = n ?? this.entryDurationMs, r = this.config.startDelay ?? s, a = {
1000
+ const s = o ?? this.entryDurationMs, r = this.config.startDelay ?? s, a = {
995
1001
  element: t,
996
1002
  index: i,
997
1003
  totalImages: e,
@@ -1066,7 +1072,7 @@ class ye {
1066
1072
  }
1067
1073
  }
1068
1074
  _startWiggle(t) {
1069
- const i = { ...Vt, ...this.config.wiggle }, e = [
1075
+ const i = { ...Jt, ...this.config.wiggle }, e = [
1070
1076
  { transform: "rotate(0deg)", offset: 0 },
1071
1077
  { transform: `rotate(${i.maxAngle}deg)`, offset: 0.25 },
1072
1078
  { transform: "rotate(0deg)", offset: 0.5 },
@@ -1106,23 +1112,23 @@ class ye {
1106
1112
  });
1107
1113
  }
1108
1114
  _startBlink(t) {
1109
- const i = { ...Zt, ...this.config.blink }, e = -(Math.random() * i.speed), n = parseFloat(getComputedStyle(t.element).opacity) || 1;
1115
+ const i = { ...Zt, ...this.config.blink }, e = -(Math.random() * i.speed), o = parseFloat(getComputedStyle(t.element).opacity) || 1;
1110
1116
  let s, r;
1111
1117
  i.style === "fade" ? (s = [
1112
- { opacity: n, offset: 0 },
1118
+ { opacity: o, offset: 0 },
1113
1119
  { opacity: 0, offset: 0.5 },
1114
- { opacity: n, offset: 1 }
1120
+ { opacity: o, offset: 1 }
1115
1121
  ], r = {
1116
1122
  duration: i.speed,
1117
1123
  delay: e,
1118
1124
  iterations: 1 / 0,
1119
1125
  easing: "ease-in-out"
1120
1126
  }) : (s = [
1121
- { opacity: n, offset: 0 },
1122
- { opacity: n, offset: i.onRatio },
1127
+ { opacity: o, offset: 0 },
1128
+ { opacity: o, offset: i.onRatio },
1123
1129
  { opacity: 0, offset: Math.min(i.onRatio + 0.01, 0.99) },
1124
1130
  { opacity: 0, offset: 0.99 },
1125
- { opacity: n, offset: 1 }
1131
+ { opacity: o, offset: 1 }
1126
1132
  ], r = {
1127
1133
  duration: i.speed,
1128
1134
  delay: e,
@@ -1151,8 +1157,8 @@ class ye {
1151
1157
  if (this.togetherSpeed = t, this.togetherRafId !== null) return;
1152
1158
  const i = () => {
1153
1159
  const e = performance.now() % this.togetherSpeed;
1154
- for (const n of this.entries.values())
1155
- !n.stopped && !n.paused && n.animation && (n.animation.currentTime = e);
1160
+ for (const o of this.entries.values())
1161
+ !o.stopped && !o.paused && o.animation && (o.animation.currentTime = e);
1156
1162
  this.togetherRafId = requestAnimationFrame(i);
1157
1163
  };
1158
1164
  this.togetherRafId = requestAnimationFrame(i);
@@ -1179,19 +1185,19 @@ class ve {
1179
1185
  * @returns Array of layout objects with position, rotation, scale
1180
1186
  */
1181
1187
  generate(t, i, e = {}) {
1182
- const n = [], { width: s, height: r } = i, a = this.config.spacing.padding, c = e.fixedHeight ?? 200, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, p = d !== 1 || g !== 1, f = c * 1.5 / 2, m = c / 2, y = s - a - f, E = r - a - m, v = a + f, S = a + m;
1183
- for (let w = 0; w < t; w++) {
1184
- const I = this.random(v, y), O = this.random(S, E), L = l === "random" ? this.random(u, h) : 0, _ = p ? this.random(d, g) : 1, z = c * _, H = {
1185
- id: w,
1186
- x: I,
1187
- y: O,
1188
- rotation: L,
1189
- scale: _,
1190
- baseSize: z
1188
+ const o = [], { width: s, height: r } = i, a = this.config.spacing.padding, c = e.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, f = this.imageConfig.rotation?.range?.max ?? 15, m = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, w = m !== 1 || p !== 1, l = c * 1.5 / 2, g = c / 2, h = s - a - l, b = r - a - g, I = a + l, y = a + g;
1189
+ for (let x = 0; x < t; x++) {
1190
+ const E = this.random(I, h), F = this.random(y, b), R = d === "random" ? this.random(u, f) : 0, M = w ? this.random(m, p) : 1, T = c * M, z = {
1191
+ id: x,
1192
+ x: E,
1193
+ y: F,
1194
+ rotation: R,
1195
+ scale: M,
1196
+ baseSize: T
1191
1197
  };
1192
- n.push(H);
1198
+ o.push(z);
1193
1199
  }
1194
- return n;
1200
+ return o;
1195
1201
  }
1196
1202
  /**
1197
1203
  * Utility: Generate random number between min and max
@@ -1203,7 +1209,7 @@ class ve {
1203
1209
  return Math.random() * (i - t) + t;
1204
1210
  }
1205
1211
  }
1206
- class Ee {
1212
+ class xe {
1207
1213
  constructor(t, i = {}) {
1208
1214
  this.config = t, this.imageConfig = i;
1209
1215
  }
@@ -1215,55 +1221,55 @@ class Ee {
1215
1221
  * @returns Array of layout objects with position, rotation, scale
1216
1222
  */
1217
1223
  generate(t, i, e = {}) {
1218
- const n = [], { width: s, height: r } = i, a = e.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, g = h !== 1 || d !== 1, p = this.config.scaleDecay ?? 0, b = {
1224
+ const o = [], { width: s, height: r } = i, a = e.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", d = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, m = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || m !== 1, w = this.config.scaleDecay ?? 0, v = {
1219
1225
  ...Wt,
1220
1226
  ...this.config.radial
1221
- }, f = e.fixedHeight ?? a, m = s / 2, y = r / 2, E = Math.ceil(Math.sqrt(t)), v = this.config.spacing.padding ?? 50, S = Math.max(f * 0.8, Math.min(
1222
- m - v - f / 2,
1223
- y - v - f / 2
1227
+ }, l = e.fixedHeight ?? a, g = s / 2, h = r / 2, b = Math.ceil(Math.sqrt(t)), I = this.config.spacing.padding ?? 50, y = Math.max(l * 0.8, Math.min(
1228
+ g - I - l / 2,
1229
+ h - I - l / 2
1224
1230
  ));
1225
1231
  if (t > 0) {
1226
- const O = g ? this.random(h, d) : 1, L = f * O;
1227
- n.push({
1232
+ const F = p ? this.random(f, m) : 1, R = l * F;
1233
+ o.push({
1228
1234
  id: 0,
1229
- x: m,
1230
- y,
1231
- rotation: c === "random" ? this.random(l * 0.33, u * 0.33) : 0,
1235
+ x: g,
1236
+ y: h,
1237
+ rotation: c === "random" ? this.random(d * 0.33, u * 0.33) : 0,
1232
1238
  // Less rotation for center
1233
- scale: O,
1234
- baseSize: L,
1239
+ scale: F,
1240
+ baseSize: R,
1235
1241
  zIndex: 100
1236
1242
  // Center image is highest
1237
1243
  });
1238
1244
  }
1239
- let w = 1, I = 1;
1240
- for (; w < t; ) {
1241
- const O = I / E, L = p > 0 ? 1 - O * p * 0.5 : 1, _ = Math.max(f * 0.8, S / E * 1.5 / b.tightness), z = I * _, H = z * 1.5, N = Math.PI * (3 * (H + z) - Math.sqrt((3 * H + z) * (H + 3 * z))), A = this.estimateWidth(f), D = Math.floor(N / (A * 0.7));
1242
- if (D === 0) {
1243
- I++;
1245
+ let x = 1, E = 1;
1246
+ for (; x < t; ) {
1247
+ const F = E / b, R = w > 0 ? 1 - F * w * 0.5 : 1, M = Math.max(l * 0.8, y / b * 1.5 / v.tightness), T = E * M, z = T * 1.5, k = Math.PI * (3 * (z + T) - Math.sqrt((3 * z + T) * (z + 3 * T))), D = this.estimateWidth(l), O = Math.floor(k / (D * 0.7));
1248
+ if (O === 0) {
1249
+ E++;
1244
1250
  continue;
1245
1251
  }
1246
- const W = 2 * Math.PI / D, U = I * (20 * Math.PI / 180);
1247
- for (let M = 0; M < D && w < t; M++) {
1248
- const R = M * W + U, k = g ? this.random(h, d) : 1, q = L * k, T = f * q;
1249
- let $ = m + Math.cos(R) * H, F = y + Math.sin(R) * z;
1250
- const P = T * 1.5 / 2, B = T / 2;
1251
- $ - P < v ? $ = v + P : $ + P > s - v && ($ = s - v - P), F - B < v ? F = v + B : F + B > r - v && (F = r - v - B);
1252
- const Y = c === "random" ? this.random(l, u) : 0;
1253
- n.push({
1254
- id: w,
1255
- x: $,
1256
- y: F,
1257
- rotation: Y,
1258
- scale: q,
1259
- baseSize: T,
1260
- zIndex: Math.max(1, 100 - I)
1252
+ const S = 2 * Math.PI / O, _ = E * (20 * Math.PI / 180);
1253
+ for (let $ = 0; $ < O && x < t; $++) {
1254
+ const A = $ * S + _, j = p ? this.random(f, m) : 1, N = R * j, P = l * N;
1255
+ let H = g + Math.cos(A) * z, U = h + Math.sin(A) * T;
1256
+ const B = P * 1.5 / 2, W = P / 2;
1257
+ H - B < I ? H = I + B : H + B > s - I && (H = s - I - B), U - W < I ? U = I + W : U + W > r - I && (U = r - I - W);
1258
+ const X = c === "random" ? this.random(d, u) : 0;
1259
+ o.push({
1260
+ id: x,
1261
+ x: H,
1262
+ y: U,
1263
+ rotation: X,
1264
+ scale: N,
1265
+ baseSize: P,
1266
+ zIndex: Math.max(1, 100 - E)
1261
1267
  // Outer rings have lower z-index
1262
- }), w++;
1268
+ }), x++;
1263
1269
  }
1264
- I++;
1270
+ E++;
1265
1271
  }
1266
- return n;
1272
+ return o;
1267
1273
  }
1268
1274
  /**
1269
1275
  * Estimate image width based on height
@@ -1284,7 +1290,7 @@ class Ee {
1284
1290
  return Math.random() * (i - t) + t;
1285
1291
  }
1286
1292
  }
1287
- const we = {
1293
+ const Ee = {
1288
1294
  columns: "auto",
1289
1295
  rows: "auto",
1290
1296
  stagger: "none",
@@ -1294,7 +1300,7 @@ const we = {
1294
1300
  alignment: "center",
1295
1301
  gap: 10,
1296
1302
  overflowOffset: 0.25
1297
- }, Tt = [
1303
+ }, At = [
1298
1304
  { x: 1, y: 1 },
1299
1305
  // bottom-right
1300
1306
  { x: -1, y: -1 },
@@ -1312,7 +1318,7 @@ const we = {
1312
1318
  { x: 0, y: 1 }
1313
1319
  // down
1314
1320
  ];
1315
- class xe {
1321
+ class we {
1316
1322
  constructor(t, i = {}) {
1317
1323
  this.config = t, this.imageConfig = i;
1318
1324
  }
@@ -1324,73 +1330,73 @@ class xe {
1324
1330
  * @returns Array of layout objects with position, rotation, scale
1325
1331
  */
1326
1332
  generate(t, i, e = {}) {
1327
- const n = [], { width: s, height: r } = i, a = { ...we, ...this.config.grid }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, g = h !== 1 || d !== 1, p = s - 2 * c, b = r - 2 * c, { columns: f, rows: m } = this.calculateGridDimensions(
1333
+ const o = [], { width: s, height: r } = i, a = { ...Ee, ...this.config.grid }, c = this.config.spacing.padding, d = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", f = this.imageConfig.sizing?.variance?.min ?? 1, m = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || m !== 1, w = s - 2 * c, v = r - 2 * c, { columns: l, rows: g } = this.calculateGridDimensions(
1328
1334
  t,
1329
- p,
1330
- b,
1331
- l,
1335
+ w,
1336
+ v,
1337
+ d,
1332
1338
  a
1333
- ), y = a.stagger === "row", E = a.stagger === "column", v = y ? f + 0.5 : f, S = E ? m + 0.5 : m, w = (p - a.gap * (f - 1)) / v, I = (b - a.gap * (m - 1)) / S, O = y ? w / 2 : 0, L = E ? I / 2 : 0, _ = 1 + a.overlap, z = Math.min(w, I) * _, H = e.fixedHeight ? Math.min(e.fixedHeight, z) : z, N = f * w + (f - 1) * a.gap + O, A = m * I + (m - 1) * a.gap + L, D = c + (p - N) / 2, W = c + (b - A) / 2, U = f * m, M = a.columns !== "auto" && a.rows !== "auto", R = M && t > U;
1339
+ ), h = a.stagger === "row", b = a.stagger === "column", I = h ? l + 0.5 : l, y = b ? g + 0.5 : g, x = (w - a.gap * (l - 1)) / I, E = (v - a.gap * (g - 1)) / y, F = h ? x / 2 : 0, R = b ? E / 2 : 0, M = 1 + a.overlap, T = Math.min(x, E) * M, z = e.fixedHeight ? Math.min(e.fixedHeight, T) : T, k = l * x + (l - 1) * a.gap + F, D = g * E + (g - 1) * a.gap + R, O = c + (w - k) / 2, S = c + (v - D) / 2, _ = l * g, $ = a.columns !== "auto" && a.rows !== "auto", A = $ && t > _;
1334
1340
  typeof window < "u" && (window.__gridOverflowDebug = {
1335
1341
  gridConfigColumns: a.columns,
1336
1342
  gridConfigRows: a.rows,
1337
- columns: f,
1338
- rows: m,
1339
- cellCount: U,
1340
- hasFixedGrid: M,
1343
+ columns: l,
1344
+ rows: g,
1345
+ cellCount: _,
1346
+ hasFixedGrid: $,
1341
1347
  imageCount: t,
1342
- isOverflowMode: R
1348
+ isOverflowMode: A
1343
1349
  });
1344
- const k = R ? new Array(U).fill(0) : [], q = Math.min(w, I) * a.overflowOffset;
1345
- for (let T = 0; T < t; T++) {
1346
- let $, F, X = 0;
1347
- if (R && T >= U) {
1348
- const G = T - U, j = G % U;
1349
- X = Math.floor(G / U) + 1, k[j]++, a.fillDirection === "row" ? ($ = j % f, F = Math.floor(j / f)) : (F = j % m, $ = Math.floor(j / m));
1350
+ const j = A ? new Array(_).fill(0) : [], N = Math.min(x, E) * a.overflowOffset;
1351
+ for (let P = 0; P < t; P++) {
1352
+ let H, U, Y = 0;
1353
+ if (A && P >= _) {
1354
+ const q = P - _, G = q % _;
1355
+ Y = Math.floor(q / _) + 1, j[G]++, a.fillDirection === "row" ? (H = G % l, U = Math.floor(G / l)) : (U = G % g, H = Math.floor(G / g));
1350
1356
  } else
1351
- a.fillDirection === "row" ? ($ = T % f, F = Math.floor(T / f)) : (F = T % m, $ = Math.floor(T / m));
1352
- let P = D + $ * (w + a.gap) + w / 2, B = W + F * (I + a.gap) + I / 2;
1353
- if (a.stagger === "row" && F % 2 === 1 ? P += w / 2 : a.stagger === "column" && $ % 2 === 1 && (B += I / 2), X > 0) {
1354
- const G = (X - 1) % Tt.length, j = Tt[G];
1355
- P += j.x * q, B += j.y * q;
1357
+ a.fillDirection === "row" ? (H = P % l, U = Math.floor(P / l)) : (U = P % g, H = Math.floor(P / g));
1358
+ let B = O + H * (x + a.gap) + x / 2, W = S + U * (E + a.gap) + E / 2;
1359
+ if (a.stagger === "row" && U % 2 === 1 ? B += x / 2 : a.stagger === "column" && H % 2 === 1 && (W += E / 2), Y > 0) {
1360
+ const q = (Y - 1) % At.length, G = At[q];
1361
+ B += G.x * N, W += G.y * N;
1356
1362
  }
1357
1363
  if (a.jitter > 0) {
1358
- const G = w / 2 * a.jitter, j = I / 2 * a.jitter;
1359
- P += this.random(-G, G), B += this.random(-j, j);
1364
+ const q = x / 2 * a.jitter, G = E / 2 * a.jitter;
1365
+ B += this.random(-q, q), W += this.random(-G, G);
1360
1366
  }
1361
- let Y = P, J = B;
1362
- if (!R && a.fillDirection === "row") {
1363
- const G = t % f || f;
1364
- if (F === Math.floor((t - 1) / f) && G < f) {
1365
- const St = G * w + (G - 1) * a.gap;
1367
+ let X = B, V = W;
1368
+ if (!A && a.fillDirection === "row") {
1369
+ const q = t % l || l;
1370
+ if (U === Math.floor((t - 1) / l) && q < l) {
1371
+ const It = q * x + (q - 1) * a.gap;
1366
1372
  let gt = 0;
1367
- a.alignment === "center" ? gt = (N - St) / 2 : a.alignment === "end" && (gt = N - St), Y += gt;
1373
+ a.alignment === "center" ? gt = (k - It) / 2 : a.alignment === "end" && (gt = k - It), X += gt;
1368
1374
  }
1369
1375
  }
1370
- const ct = g ? this.random(h, d) : 1, K = H * ct, nt = K * 1.5 / 2, ot = K / 2, ht = c + nt, dt = s - c - nt, _t = c + ot, Ut = r - c - ot;
1371
- Y = Math.max(ht, Math.min(Y, dt)), J = Math.max(_t, Math.min(J, Ut));
1376
+ const ct = p ? this.random(f, m) : 1, K = z * ct, ot = K * 1.5 / 2, nt = K / 2, ht = c + ot, dt = s - c - ot, _t = c + nt, Ut = r - c - nt;
1377
+ X = Math.max(ht, Math.min(X, dt)), V = Math.max(_t, Math.min(V, Ut));
1372
1378
  let ut = 0;
1373
1379
  if (u === "random") {
1374
- const G = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
1375
- a.jitter > 0 ? ut = this.random(G * a.jitter, j * a.jitter) : ut = this.random(G, j);
1380
+ const q = this.imageConfig.rotation?.range?.min ?? -15, G = this.imageConfig.rotation?.range?.max ?? 15;
1381
+ a.jitter > 0 ? ut = this.random(q * a.jitter, G * a.jitter) : ut = this.random(q, G);
1376
1382
  }
1377
1383
  let ft;
1378
- R && X > 0 ? ft = 50 - X : ft = R ? 100 + T : T + 1, n.push({
1379
- id: T,
1380
- x: Y,
1381
- y: J,
1384
+ A && Y > 0 ? ft = 50 - Y : ft = A ? 100 + P : P + 1, o.push({
1385
+ id: P,
1386
+ x: X,
1387
+ y: V,
1382
1388
  rotation: ut,
1383
1389
  scale: ct,
1384
1390
  baseSize: K,
1385
1391
  zIndex: ft
1386
1392
  });
1387
1393
  }
1388
- return n;
1394
+ return o;
1389
1395
  }
1390
1396
  /**
1391
1397
  * Calculate optimal grid dimensions based on image count and container
1392
1398
  */
1393
- calculateGridDimensions(t, i, e, n, s) {
1399
+ calculateGridDimensions(t, i, e, o, s) {
1394
1400
  let r, a;
1395
1401
  if (s.columns !== "auto" && s.rows !== "auto")
1396
1402
  r = s.columns, a = s.rows;
@@ -1412,7 +1418,7 @@ class xe {
1412
1418
  return Math.random() * (i - t) + t;
1413
1419
  }
1414
1420
  }
1415
- const Se = Math.PI * (3 - Math.sqrt(5)), Ie = {
1421
+ const Ie = Math.PI * (3 - Math.sqrt(5)), Se = {
1416
1422
  spiralType: "golden",
1417
1423
  direction: "counterclockwise",
1418
1424
  tightness: 1,
@@ -1431,80 +1437,80 @@ class Ce {
1431
1437
  * @returns Array of layout objects with position, rotation, scale
1432
1438
  */
1433
1439
  generate(t, i, e = {}) {
1434
- const n = [], { width: s, height: r } = i, a = { ...Ie, ...this.config.spiral }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, b = g !== 1 || p !== 1, f = this.config.scaleDecay ?? a.scaleDecay, m = s / 2, y = r / 2, E = Math.min(
1435
- m - c - l / 2,
1436
- y - c - l / 2
1437
- ), v = a.direction === "clockwise" ? -1 : 1;
1438
- for (let S = 0; S < t; S++) {
1439
- let w, I;
1440
+ const o = [], { width: s, height: r } = i, a = { ...Se, ...this.config.spiral }, c = this.config.spacing.padding, d = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", f = this.imageConfig.rotation?.range?.min ?? -15, m = this.imageConfig.rotation?.range?.max ?? 15, p = this.imageConfig.sizing?.variance?.min ?? 1, w = this.imageConfig.sizing?.variance?.max ?? 1, v = p !== 1 || w !== 1, l = this.config.scaleDecay ?? a.scaleDecay, g = s / 2, h = r / 2, b = Math.min(
1441
+ g - c - d / 2,
1442
+ h - c - d / 2
1443
+ ), I = a.direction === "clockwise" ? -1 : 1;
1444
+ for (let y = 0; y < t; y++) {
1445
+ let x, E;
1440
1446
  if (a.spiralType === "golden")
1441
- w = S * Se * v + a.startAngle, I = this.calculateGoldenRadius(S, t, E, a.tightness);
1447
+ x = y * Ie * I + a.startAngle, E = this.calculateGoldenRadius(y, t, b, a.tightness);
1442
1448
  else if (a.spiralType === "archimedean") {
1443
- const P = S * 0.5 * a.tightness;
1444
- w = P * v + a.startAngle, I = this.calculateArchimedeanRadius(P, t, E, a.tightness);
1449
+ const B = y * 0.5 * a.tightness;
1450
+ x = B * I + a.startAngle, E = this.calculateArchimedeanRadius(B, t, b, a.tightness);
1445
1451
  } else {
1446
- const P = S * 0.3 * a.tightness;
1447
- w = P * v + a.startAngle, I = this.calculateLogarithmicRadius(P, t, E, a.tightness);
1452
+ const B = y * 0.3 * a.tightness;
1453
+ x = B * I + a.startAngle, E = this.calculateLogarithmicRadius(B, t, b, a.tightness);
1448
1454
  }
1449
- const O = m + Math.cos(w) * I, L = y + Math.sin(w) * I, _ = I / E, z = f > 0 ? 1 - _ * f * 0.5 : 1, H = b ? this.random(g, p) : 1, N = z * H, A = l * N, W = A * 1.5 / 2, U = A / 2, M = c + W, R = s - c - W, k = c + U, q = r - c - U, T = Math.max(M, Math.min(O, R)), $ = Math.max(k, Math.min(L, q));
1450
- let F = 0;
1455
+ const F = g + Math.cos(x) * E, R = h + Math.sin(x) * E, M = E / b, T = l > 0 ? 1 - M * l * 0.5 : 1, z = v ? this.random(p, w) : 1, k = T * z, D = d * k, S = D * 1.5 / 2, _ = D / 2, $ = c + S, A = s - c - S, j = c + _, N = r - c - _, P = Math.max($, Math.min(F, A)), H = Math.max(j, Math.min(R, N));
1456
+ let U = 0;
1451
1457
  if (u === "random") {
1452
- const P = w * 180 / Math.PI % 360, B = this.random(h, d);
1453
- F = a.spiralType === "golden" ? B : P * 0.1 + B * 0.9;
1454
- } else u === "tangent" && (F = this.calculateSpiralTangent(w, I, a));
1455
- const X = t - S;
1456
- n.push({
1457
- id: S,
1458
- x: T,
1459
- y: $,
1460
- rotation: F,
1461
- scale: N,
1462
- baseSize: A,
1463
- zIndex: X
1458
+ const B = x * 180 / Math.PI % 360, W = this.random(f, m);
1459
+ U = a.spiralType === "golden" ? W : B * 0.1 + W * 0.9;
1460
+ } else u === "tangent" && (U = this.calculateSpiralTangent(x, E, a));
1461
+ const Y = t - y;
1462
+ o.push({
1463
+ id: y,
1464
+ x: P,
1465
+ y: H,
1466
+ rotation: U,
1467
+ scale: k,
1468
+ baseSize: D,
1469
+ zIndex: Y
1464
1470
  });
1465
1471
  }
1466
- return n;
1472
+ return o;
1467
1473
  }
1468
1474
  /**
1469
1475
  * Calculate tangent angle for spiral curve at given position
1470
1476
  * This aligns the image along the spiral's direction of travel
1471
1477
  */
1472
1478
  calculateSpiralTangent(t, i, e) {
1473
- let n;
1479
+ let o;
1474
1480
  if (e.spiralType === "golden")
1475
- n = t + Math.PI / 2;
1481
+ o = t + Math.PI / 2;
1476
1482
  else if (e.spiralType === "archimedean") {
1477
1483
  const r = 1 / e.tightness, a = Math.atan(i / r);
1478
- n = t + a;
1484
+ o = t + a;
1479
1485
  } else {
1480
1486
  const r = 0.15 / e.tightness, a = Math.atan(1 / r);
1481
- n = t + a;
1487
+ o = t + a;
1482
1488
  }
1483
- return n * 180 / Math.PI % 360 - 90;
1489
+ return o * 180 / Math.PI % 360 - 90;
1484
1490
  }
1485
1491
  /**
1486
1492
  * Calculate radius for golden spiral (Vogel's model)
1487
1493
  * Creates even distribution like sunflower seeds
1488
1494
  */
1489
- calculateGoldenRadius(t, i, e, n) {
1490
- const r = e / Math.sqrt(i) * Math.sqrt(t) / n;
1495
+ calculateGoldenRadius(t, i, e, o) {
1496
+ const r = e / Math.sqrt(i) * Math.sqrt(t) / o;
1491
1497
  return Math.min(r, e);
1492
1498
  }
1493
1499
  /**
1494
1500
  * Calculate radius for Archimedean spiral
1495
1501
  * r = a + b*θ (constant spacing between arms)
1496
1502
  */
1497
- calculateArchimedeanRadius(t, i, e, n) {
1498
- const s = i * 0.5 * n;
1503
+ calculateArchimedeanRadius(t, i, e, o) {
1504
+ const s = i * 0.5 * o;
1499
1505
  return t / s * e;
1500
1506
  }
1501
1507
  /**
1502
1508
  * Calculate radius for logarithmic (equiangular) spiral
1503
1509
  * r = a * e^(b*θ)
1504
1510
  */
1505
- calculateLogarithmicRadius(t, i, e, n) {
1506
- const s = e * 0.05, r = 0.15 / n, a = s * Math.exp(r * t), c = i * 0.3 * n, l = s * Math.exp(r * c);
1507
- return a / l * e;
1511
+ calculateLogarithmicRadius(t, i, e, o) {
1512
+ const s = e * 0.05, r = 0.15 / o, a = s * Math.exp(r * t), c = i * 0.3 * o, d = s * Math.exp(r * c);
1513
+ return a / d * e;
1508
1514
  }
1509
1515
  /**
1510
1516
  * Utility: Generate random number between min and max
@@ -1513,7 +1519,7 @@ class Ce {
1513
1519
  return Math.random() * (i - t) + t;
1514
1520
  }
1515
1521
  }
1516
- const Ae = {
1522
+ const Re = {
1517
1523
  clusterCount: "auto",
1518
1524
  clusterSpread: 150,
1519
1525
  clusterSpacing: 200,
@@ -1521,7 +1527,7 @@ const Ae = {
1521
1527
  overlap: 0.3,
1522
1528
  distribution: "gaussian"
1523
1529
  };
1524
- class Re {
1530
+ class Te {
1525
1531
  constructor(t, i = {}) {
1526
1532
  this.config = t, this.imageConfig = i;
1527
1533
  }
@@ -1533,85 +1539,85 @@ class Re {
1533
1539
  * @returns Array of layout objects with position, rotation, scale
1534
1540
  */
1535
1541
  generate(t, i, e = {}) {
1536
- const n = [], { width: s, height: r } = i, a = { ...Ae, ...this.config.cluster }, c = this.config.spacing.padding, l = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", h = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, b = g !== 1 || p !== 1, f = this.calculateClusterCount(
1542
+ const o = [], { width: s, height: r } = i, a = { ...Re, ...this.config.cluster }, c = this.config.spacing.padding, d = e.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", f = this.imageConfig.rotation?.range?.min ?? -15, m = this.imageConfig.rotation?.range?.max ?? 15, p = this.imageConfig.sizing?.variance?.min ?? 1, w = this.imageConfig.sizing?.variance?.max ?? 1, v = p !== 1 || w !== 1, l = this.calculateClusterCount(
1537
1543
  t,
1538
1544
  a.clusterCount,
1539
1545
  s,
1540
1546
  r,
1541
1547
  a.clusterSpacing
1542
- ), m = this.generateClusterCenters(
1543
- f,
1548
+ ), g = this.generateClusterCenters(
1549
+ l,
1544
1550
  s,
1545
1551
  r,
1546
1552
  c,
1547
1553
  a
1548
- ), y = new Array(f).fill(0);
1549
- for (let v = 0; v < t; v++)
1550
- y[v % f]++;
1551
- let E = 0;
1552
- for (let v = 0; v < f; v++) {
1553
- const S = m[v], w = y[v];
1554
- for (let I = 0; I < w; I++) {
1555
- let O, L;
1554
+ ), h = new Array(l).fill(0);
1555
+ for (let I = 0; I < t; I++)
1556
+ h[I % l]++;
1557
+ let b = 0;
1558
+ for (let I = 0; I < l; I++) {
1559
+ const y = g[I], x = h[I];
1560
+ for (let E = 0; E < x; E++) {
1561
+ let F, R;
1556
1562
  if (a.distribution === "gaussian")
1557
- O = this.gaussianRandom() * S.spread, L = this.gaussianRandom() * S.spread;
1563
+ F = this.gaussianRandom() * y.spread, R = this.gaussianRandom() * y.spread;
1558
1564
  else {
1559
- const F = this.random(0, Math.PI * 2), X = this.random(0, S.spread);
1560
- O = Math.cos(F) * X, L = Math.sin(F) * X;
1565
+ const U = this.random(0, Math.PI * 2), Y = this.random(0, y.spread);
1566
+ F = Math.cos(U) * Y, R = Math.sin(U) * Y;
1561
1567
  }
1562
- const _ = 1 + a.overlap * 0.5, z = 1 + a.overlap * 0.3;
1563
- O /= _, L /= _;
1564
- const H = b ? this.random(g, p) : 1, N = z * H, A = l * N;
1565
- let D = S.x + O, W = S.y + L;
1566
- const M = A * 1.5 / 2, R = A / 2;
1567
- D = Math.max(c + M, Math.min(D, s - c - M)), W = Math.max(c + R, Math.min(W, r - c - R));
1568
- const k = u === "random" ? this.random(h, d) : 0, T = Math.sqrt(O * O + L * L) / S.spread, $ = Math.round((1 - T) * 50) + 1;
1569
- n.push({
1570
- id: E,
1571
- x: D,
1572
- y: W,
1573
- rotation: k,
1574
- scale: N,
1575
- baseSize: A,
1576
- zIndex: $
1577
- }), E++;
1568
+ const M = 1 + a.overlap * 0.5, T = 1 + a.overlap * 0.3;
1569
+ F /= M, R /= M;
1570
+ const z = v ? this.random(p, w) : 1, k = T * z, D = d * k;
1571
+ let O = y.x + F, S = y.y + R;
1572
+ const $ = D * 1.5 / 2, A = D / 2;
1573
+ O = Math.max(c + $, Math.min(O, s - c - $)), S = Math.max(c + A, Math.min(S, r - c - A));
1574
+ const j = u === "random" ? this.random(f, m) : 0, P = Math.sqrt(F * F + R * R) / y.spread, H = Math.round((1 - P) * 50) + 1;
1575
+ o.push({
1576
+ id: b,
1577
+ x: O,
1578
+ y: S,
1579
+ rotation: j,
1580
+ scale: k,
1581
+ baseSize: D,
1582
+ zIndex: H
1583
+ }), b++;
1578
1584
  }
1579
1585
  }
1580
- return n;
1586
+ return o;
1581
1587
  }
1582
1588
  /**
1583
1589
  * Calculate optimal number of clusters based on image count and container
1584
1590
  */
1585
- calculateClusterCount(t, i, e, n, s) {
1591
+ calculateClusterCount(t, i, e, o, s) {
1586
1592
  if (i !== "auto")
1587
1593
  return Math.max(1, Math.min(i, t));
1588
1594
  const a = Math.max(1, Math.ceil(t / 8)), c = Math.floor(
1589
- e / s * (n / s) * 0.6
1595
+ e / s * (o / s) * 0.6
1590
1596
  );
1591
1597
  return Math.max(1, Math.min(a, c, 10));
1592
1598
  }
1593
1599
  /**
1594
1600
  * Generate cluster center positions with spacing constraints
1595
1601
  */
1596
- generateClusterCenters(t, i, e, n, s) {
1597
- const r = [], c = n + s.clusterSpread, l = i - n - s.clusterSpread, u = n + s.clusterSpread, h = e - n - s.clusterSpread;
1598
- for (let d = 0; d < t; d++) {
1599
- let g = null, p = -1;
1600
- for (let b = 0; b < 100; b++) {
1601
- const f = {
1602
- x: this.random(c, l),
1603
- y: this.random(u, h),
1602
+ generateClusterCenters(t, i, e, o, s) {
1603
+ const r = [], c = o + s.clusterSpread, d = i - o - s.clusterSpread, u = o + s.clusterSpread, f = e - o - s.clusterSpread;
1604
+ for (let m = 0; m < t; m++) {
1605
+ let p = null, w = -1;
1606
+ for (let v = 0; v < 100; v++) {
1607
+ const l = {
1608
+ x: this.random(c, d),
1609
+ y: this.random(u, f),
1604
1610
  spread: this.calculateClusterSpread(s)
1605
1611
  };
1606
- let m = 1 / 0;
1607
- for (const y of r) {
1608
- const E = f.x - y.x, v = f.y - y.y, S = Math.sqrt(E * E + v * v);
1609
- m = Math.min(m, S);
1612
+ let g = 1 / 0;
1613
+ for (const h of r) {
1614
+ const b = l.x - h.x, I = l.y - h.y, y = Math.sqrt(b * b + I * I);
1615
+ g = Math.min(g, y);
1610
1616
  }
1611
- if ((r.length === 0 || m > p) && (g = f, p = m), m >= s.clusterSpacing)
1617
+ if ((r.length === 0 || g > w) && (p = l, w = g), g >= s.clusterSpacing)
1612
1618
  break;
1613
1619
  }
1614
- g && r.push(g);
1620
+ p && r.push(p);
1615
1621
  }
1616
1622
  return r;
1617
1623
  }
@@ -1639,7 +1645,7 @@ class Re {
1639
1645
  return Math.random() * (i - t) + t;
1640
1646
  }
1641
1647
  }
1642
- class Te {
1648
+ class Ae {
1643
1649
  constructor(t, i = {}) {
1644
1650
  this.config = t, this.imageConfig = i;
1645
1651
  }
@@ -1651,32 +1657,32 @@ class Te {
1651
1657
  * @returns Array of layout objects with position, rotation, scale
1652
1658
  */
1653
1659
  generate(t, i, e = {}) {
1654
- const n = [], { width: s, height: r } = i, a = e.fixedHeight ?? 200, c = this.config.spacing.padding ?? 50, l = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, h = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, p = d !== 1 || g !== 1, b = e.fixedHeight ?? a, f = {
1660
+ const o = [], { width: s, height: r } = i, a = e.fixedHeight ?? 200, c = this.config.spacing.padding ?? 50, d = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, f = this.imageConfig.rotation?.range?.max ?? 15, m = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, w = m !== 1 || p !== 1, v = e.fixedHeight ?? a, l = {
1655
1661
  ...Gt,
1656
1662
  ...this.config.wave
1657
- }, { rows: m, amplitude: y, frequency: E, phaseShift: v, synchronization: S } = f, w = Math.ceil(t / m), L = b * 1.5 / 2, _ = c + L, z = s - c - L, H = z - _, N = w > 1 ? H / (w - 1) : 0, A = c + y + b / 2, D = r - c - y - b / 2, W = D - A, U = m > 1 ? W / (m - 1) : 0;
1658
- let M = 0;
1659
- for (let R = 0; R < m && M < t; R++) {
1660
- const k = m === 1 ? (A + D) / 2 : A + R * U;
1661
- let q = 0;
1662
- S === "offset" ? q = R * v : S === "alternating" && (q = R * Math.PI);
1663
- for (let T = 0; T < w && M < t; T++) {
1664
- const $ = w === 1 ? (_ + z) / 2 : _ + T * N, F = this.calculateWaveY($, s, y, E, q), X = $, P = k + F, B = p ? this.random(d, g) : 1, Y = b * B;
1665
- let J = 0;
1666
- l === "tangent" ? J = this.calculateRotation($, s, y, E, q) : l === "random" && (J = this.random(u, h));
1667
- const K = Y * 1.5 / 2, lt = Y / 2, nt = c + K, ot = s - c - K, ht = c + lt, dt = r - c - lt;
1668
- n.push({
1669
- id: M,
1670
- x: Math.max(nt, Math.min(X, ot)),
1671
- y: Math.max(ht, Math.min(P, dt)),
1672
- rotation: J,
1673
- scale: B,
1674
- baseSize: Y,
1675
- zIndex: M + 1
1676
- }), M++;
1663
+ }, { rows: g, amplitude: h, frequency: b, phaseShift: I, synchronization: y } = l, x = Math.ceil(t / g), R = v * 1.5 / 2, M = c + R, T = s - c - R, z = T - M, k = x > 1 ? z / (x - 1) : 0, D = c + h + v / 2, O = r - c - h - v / 2, S = O - D, _ = g > 1 ? S / (g - 1) : 0;
1664
+ let $ = 0;
1665
+ for (let A = 0; A < g && $ < t; A++) {
1666
+ const j = g === 1 ? (D + O) / 2 : D + A * _;
1667
+ let N = 0;
1668
+ y === "offset" ? N = A * I : y === "alternating" && (N = A * Math.PI);
1669
+ for (let P = 0; P < x && $ < t; P++) {
1670
+ const H = x === 1 ? (M + T) / 2 : M + P * k, U = this.calculateWaveY(H, s, h, b, N), Y = H, B = j + U, W = w ? this.random(m, p) : 1, X = v * W;
1671
+ let V = 0;
1672
+ d === "tangent" ? V = this.calculateRotation(H, s, h, b, N) : d === "random" && (V = this.random(u, f));
1673
+ const K = X * 1.5 / 2, lt = X / 2, ot = c + K, nt = s - c - K, ht = c + lt, dt = r - c - lt;
1674
+ o.push({
1675
+ id: $,
1676
+ x: Math.max(ot, Math.min(Y, nt)),
1677
+ y: Math.max(ht, Math.min(B, dt)),
1678
+ rotation: V,
1679
+ scale: W,
1680
+ baseSize: X,
1681
+ zIndex: $ + 1
1682
+ }), $++;
1677
1683
  }
1678
1684
  }
1679
- return n;
1685
+ return o;
1680
1686
  }
1681
1687
  /**
1682
1688
  * Calculate Y position displacement on wave curve
@@ -1687,9 +1693,9 @@ class Te {
1687
1693
  * @param phase - Phase offset
1688
1694
  * @returns Y displacement from baseline
1689
1695
  */
1690
- calculateWaveY(t, i, e, n, s) {
1696
+ calculateWaveY(t, i, e, o, s) {
1691
1697
  const r = t / i;
1692
- return e * Math.sin(n * r * 2 * Math.PI + s);
1698
+ return e * Math.sin(o * r * 2 * Math.PI + s);
1693
1699
  }
1694
1700
  /**
1695
1701
  * Calculate rotation based on wave tangent
@@ -1700,8 +1706,8 @@ class Te {
1700
1706
  * @param phase - Phase offset
1701
1707
  * @returns Rotation angle in degrees
1702
1708
  */
1703
- calculateRotation(t, i, e, n, s) {
1704
- const r = t / i, a = e * n * 2 * Math.PI * Math.cos(n * r * 2 * Math.PI + s) / i;
1709
+ calculateRotation(t, i, e, o, s) {
1710
+ const r = t / i, a = e * o * 2 * Math.PI * Math.cos(o * r * 2 * Math.PI + s) / i;
1705
1711
  return Math.atan(a) * (180 / Math.PI);
1706
1712
  }
1707
1713
  /**
@@ -1716,7 +1722,7 @@ class Te {
1716
1722
  return Math.random() * (i - t) + t;
1717
1723
  }
1718
1724
  }
1719
- const wt = 100, Q = 100 / Math.sqrt(3), xt = [
1725
+ const Et = 100, Q = 100 / Math.sqrt(3), wt = [
1720
1726
  [Q / 2, 0],
1721
1727
  // upper-left
1722
1728
  [3 * Q / 2, 0],
@@ -1729,18 +1735,18 @@ const wt = 100, Q = 100 / Math.sqrt(3), xt = [
1729
1735
  // lower-left
1730
1736
  [0, 50]
1731
1737
  // left
1732
- ], Le = xt[1][0] / wt, Me = xt[2][1] / wt;
1733
- function Fe(o) {
1738
+ ], Le = wt[1][0] / Et, Fe = wt[2][1] / Et;
1739
+ function Me(n) {
1734
1740
  return {
1735
- colStep: Le * o,
1736
- rowOffset: Me * o
1741
+ colStep: Le * n,
1742
+ rowOffset: Fe * n
1737
1743
  };
1738
1744
  }
1739
- function Oe(o, t, i, e, n, s) {
1740
- const { colStep: r } = Fe(s);
1745
+ function Oe(n, t, i, e, o, s) {
1746
+ const { colStep: r } = Me(s);
1741
1747
  return {
1742
- px: e + r * o,
1743
- py: n + s * (t + o / 2)
1748
+ px: e + r * n,
1749
+ py: o + s * (t + n / 2)
1744
1750
  };
1745
1751
  }
1746
1752
  const ze = [
@@ -1751,13 +1757,13 @@ const ze = [
1751
1757
  [0, -1, 1],
1752
1758
  [1, -1, 0]
1753
1759
  ];
1754
- function De(o) {
1755
- if (o === 0) return [[0, 0, 0]];
1760
+ function De(n) {
1761
+ if (n === 0) return [[0, 0, 0]];
1756
1762
  const t = [];
1757
- let [i, e, n] = [0, -o, o];
1763
+ let [i, e, o] = [0, -n, n];
1758
1764
  for (const [s, r, a] of ze)
1759
- for (let c = 0; c < o; c++)
1760
- t.push([i, e, n]), i += s, e += r, n += a;
1765
+ for (let c = 0; c < n; c++)
1766
+ t.push([i, e, o]), i += s, e += r, o += a;
1761
1767
  return t;
1762
1768
  }
1763
1769
  class $e {
@@ -1767,30 +1773,30 @@ class $e {
1767
1773
  this.config = t;
1768
1774
  }
1769
1775
  generate(t, i, e = {}) {
1770
- const n = [], { width: s, height: r } = i, a = s / 2, c = r / 2, l = e.fixedHeight ?? 200, h = {
1776
+ const o = [], { width: s, height: r } = i, a = s / 2, c = r / 2, d = e.fixedHeight ?? 200, f = {
1771
1777
  ...qt,
1772
1778
  ...this.config.honeycomb
1773
- }.spacing ?? 0, d = l + h;
1774
- let g = 0, p = 0;
1775
- for (; g < t; ) {
1776
- const b = De(p);
1777
- for (const [f, m, y] of b) {
1778
- if (g >= t) break;
1779
- const { px: E, py: v } = Oe(f, m, y, a, c, d);
1780
- n.push({
1781
- id: g,
1782
- x: E,
1783
- y: v,
1779
+ }.spacing ?? 0, m = d + f;
1780
+ let p = 0, w = 0;
1781
+ for (; p < t; ) {
1782
+ const v = De(w);
1783
+ for (const [l, g, h] of v) {
1784
+ if (p >= t) break;
1785
+ const { px: b, py: I } = Oe(l, g, h, a, c, m);
1786
+ o.push({
1787
+ id: p,
1788
+ x: b,
1789
+ y: I,
1784
1790
  rotation: 0,
1785
1791
  scale: 1,
1786
- baseSize: l,
1792
+ baseSize: d,
1787
1793
  // Inner rings render above outer rings
1788
- zIndex: Math.max(1, 100 - p)
1789
- }), g++;
1794
+ zIndex: Math.max(1, 100 - w)
1795
+ }), p++;
1790
1796
  }
1791
- p++;
1797
+ w++;
1792
1798
  }
1793
- return n;
1799
+ return o;
1794
1800
  }
1795
1801
  }
1796
1802
  class Pe {
@@ -1804,15 +1810,15 @@ class Pe {
1804
1810
  initLayout() {
1805
1811
  switch (this.config.algorithm) {
1806
1812
  case "radial":
1807
- return new Ee(this.config, this.imageConfig);
1808
- case "grid":
1809
1813
  return new xe(this.config, this.imageConfig);
1814
+ case "grid":
1815
+ return new we(this.config, this.imageConfig);
1810
1816
  case "spiral":
1811
1817
  return new Ce(this.config, this.imageConfig);
1812
1818
  case "cluster":
1813
- return new Re(this.config, this.imageConfig);
1814
- case "wave":
1815
1819
  return new Te(this.config, this.imageConfig);
1820
+ case "wave":
1821
+ return new Ae(this.config, this.imageConfig);
1816
1822
  case "honeycomb":
1817
1823
  return new $e(this.config, this.imageConfig);
1818
1824
  default:
@@ -1827,10 +1833,10 @@ class Pe {
1827
1833
  * @returns Array of layout objects with position, rotation, scale
1828
1834
  */
1829
1835
  generateLayout(t, i, e = {}) {
1830
- const n = this.placementLayout.generate(t, i, e);
1831
- return n.forEach((s) => {
1836
+ const o = this.placementLayout.generate(t, i, e);
1837
+ return o.forEach((s) => {
1832
1838
  this.layouts.set(s.id, s);
1833
- }), n;
1839
+ }), o;
1834
1840
  }
1835
1841
  /**
1836
1842
  * Get the original layout state for an image
@@ -1883,8 +1889,8 @@ class Pe {
1883
1889
  return;
1884
1890
  if (typeof e == "number")
1885
1891
  return e;
1886
- const n = e, s = this.resolveBreakpoint(t);
1887
- return s === "mobile" ? n.mobile ?? n.tablet ?? n.screen : s === "tablet" ? n.tablet ?? n.screen ?? n.mobile : n.screen ?? n.tablet ?? n.mobile;
1892
+ const o = e, s = this.resolveBreakpoint(t);
1893
+ return s === "mobile" ? o.mobile ?? o.tablet ?? o.screen : s === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1888
1894
  }
1889
1895
  /**
1890
1896
  * Calculate adaptive image size based on container dimensions and image count
@@ -1894,19 +1900,19 @@ class Pe {
1894
1900
  * @param viewportWidth - Current viewport width for baseHeight resolution
1895
1901
  * @returns Calculated sizing result with height
1896
1902
  */
1897
- calculateAdaptiveSize(t, i, e, n) {
1898
- const s = this.imageConfig.sizing, r = this.resolveBaseHeight(n);
1903
+ calculateAdaptiveSize(t, i, e, o) {
1904
+ const s = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1899
1905
  if (r !== void 0)
1900
1906
  return { height: r };
1901
- const a = s?.minSize ?? 50, c = s?.maxSize ?? 400, l = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: h, height: d } = t, b = h * d * l / i;
1902
- let m = Math.sqrt(b / 1.4);
1903
- m *= u, m = Math.min(m, e);
1904
- let y = this.clamp(m, a, c);
1905
- if (y === a && m < a) {
1906
- const E = Math.max(a * 0.05, 20);
1907
- y = Math.max(E, m);
1907
+ const a = s?.minSize ?? 50, c = s?.maxSize ?? 400, d = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: f, height: m } = t, v = f * m * d / i;
1908
+ let g = Math.sqrt(v / 1.4);
1909
+ g *= u, g = Math.min(g, e);
1910
+ let h = this.clamp(g, a, c);
1911
+ if (h === a && g < a) {
1912
+ const b = Math.max(a * 0.05, 20);
1913
+ h = Math.max(b, g);
1908
1914
  }
1909
- return this.config.algorithm === "honeycomb" && (y = Math.min(y, this.honeycombMaxImageHeight(i, t))), { height: y };
1915
+ return this.config.algorithm === "honeycomb" && (h = Math.min(h, this.honeycombMaxImageHeight(i, t))), { height: h };
1910
1916
  }
1911
1917
  /**
1912
1918
  * Returns the largest image height at which all honeycomb rings fit within the container.
@@ -1915,11 +1921,11 @@ class Pe {
1915
1921
  */
1916
1922
  honeycombMaxImageHeight(t, i) {
1917
1923
  if (t <= 1) return 1 / 0;
1918
- let e = 0, n = 1;
1919
- for (; n < t; )
1920
- e++, n += 6 * e;
1921
- const s = this.config.spacing?.padding ?? 50, r = this.config.honeycomb?.spacing ?? 0, a = i.width / 2, c = i.height / 2, l = Math.sqrt(3) / 2, u = 1 / Math.sqrt(3), h = (c - s - r * e) / (e + 0.5), d = (a - s - l * r * e) / (l * e + u);
1922
- return Math.max(10, Math.min(h, d));
1924
+ let e = 0, o = 1;
1925
+ for (; o < t; )
1926
+ e++, o += 6 * e;
1927
+ const s = this.config.spacing?.padding ?? 50, r = this.config.honeycomb?.spacing ?? 0, a = i.width / 2, c = i.height / 2, d = Math.sqrt(3) / 2, u = 1 / Math.sqrt(3), f = (c - s - r * e) / (e + 0.5), m = (a - s - d * r * e) / (d * e + u);
1928
+ return Math.max(10, Math.min(f, m));
1923
1929
  }
1924
1930
  /**
1925
1931
  * Utility: Clamp a value between min and max
@@ -1928,7 +1934,7 @@ class Pe {
1928
1934
  return Math.max(i, Math.min(e, t));
1929
1935
  }
1930
1936
  }
1931
- var x = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(x || {});
1937
+ var C = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(C || {});
1932
1938
  const Lt = {
1933
1939
  // Geometric shapes - uses percentages for responsive sizing
1934
1940
  circle: "circle(50%)",
@@ -1962,8 +1968,8 @@ const Lt = {
1962
1968
  },
1963
1969
  // Hexagon - regular hexagon (reference points imported from hexagonGeometry)
1964
1970
  hexagon: {
1965
- refHeight: wt,
1966
- points: xt
1971
+ refHeight: Et,
1972
+ points: wt
1967
1973
  },
1968
1974
  // Octagon - regular octagon
1969
1975
  octagon: {
@@ -1976,105 +1982,105 @@ const Lt = {
1976
1982
  points: [[50, 0], [100, 50], [50, 100], [0, 50]]
1977
1983
  }
1978
1984
  };
1979
- function Ue(o) {
1980
- if (o)
1981
- return o in Lt ? Lt[o] : o;
1985
+ function Ue(n) {
1986
+ if (n)
1987
+ return n in Lt ? Lt[n] : n;
1982
1988
  }
1983
- function He(o, t, i) {
1984
- const e = _e[o];
1989
+ function ke(n, t, i) {
1990
+ const e = _e[n];
1985
1991
  if (!e) return "";
1986
- const n = t / e.refHeight;
1987
- if (o === "circle")
1988
- return `circle(${Math.round(50 * n * 100) / 100}px)`;
1989
- const s = e.points.map(([b]) => b), r = e.points.map(([, b]) => b), a = (Math.min(...s) + Math.max(...s)) / 2 * n, c = (Math.min(...r) + Math.max(...r)) / 2 * n, l = (Math.max(...s) - Math.min(...s)) * n, u = (i ?? l) / 2, h = t / 2, d = u - a, g = h - c;
1990
- return `polygon(${e.points.map(([b, f]) => {
1991
- const m = Math.round((b * n + d) * 100) / 100, y = Math.round((f * n + g) * 100) / 100;
1992
- return `${m}px ${y}px`;
1992
+ const o = t / e.refHeight;
1993
+ if (n === "circle")
1994
+ return `circle(${Math.round(50 * o * 100) / 100}px)`;
1995
+ const s = e.points.map(([v]) => v), r = e.points.map(([, v]) => v), a = (Math.min(...s) + Math.max(...s)) / 2 * o, c = (Math.min(...r) + Math.max(...r)) / 2 * o, d = (Math.max(...s) - Math.min(...s)) * o, u = (i ?? d) / 2, f = t / 2, m = u - a, p = f - c;
1996
+ return `polygon(${e.points.map(([v, l]) => {
1997
+ const g = Math.round((v * o + m) * 100) / 100, h = Math.round((l * o + p) * 100) / 100;
1998
+ return `${g}px ${h}px`;
1993
1999
  }).join(", ")})`;
1994
2000
  }
1995
- function Ne(o) {
1996
- return o in mt;
2001
+ function He(n) {
2002
+ return n in mt;
1997
2003
  }
1998
- function ke(o) {
1999
- return o ? Ne(o) ? mt[o] : o : mt.md;
2004
+ function Ne(n) {
2005
+ return n ? He(n) ? mt[n] : n : mt.md;
2000
2006
  }
2001
- function Be(o) {
2002
- if (!o) return "";
2007
+ function Be(n) {
2008
+ if (!n) return "";
2003
2009
  const t = [];
2004
- if (o.grayscale !== void 0 && t.push(`grayscale(${o.grayscale})`), o.blur !== void 0 && t.push(`blur(${o.blur}px)`), o.brightness !== void 0 && t.push(`brightness(${o.brightness})`), o.contrast !== void 0 && t.push(`contrast(${o.contrast})`), o.saturate !== void 0 && t.push(`saturate(${o.saturate})`), o.opacity !== void 0 && t.push(`opacity(${o.opacity})`), o.sepia !== void 0 && t.push(`sepia(${o.sepia})`), o.hueRotate !== void 0 && t.push(`hue-rotate(${o.hueRotate}deg)`), o.invert !== void 0 && t.push(`invert(${o.invert})`), o.dropShadow !== void 0)
2005
- if (typeof o.dropShadow == "string")
2006
- t.push(`drop-shadow(${o.dropShadow})`);
2010
+ if (n.grayscale !== void 0 && t.push(`grayscale(${n.grayscale})`), n.blur !== void 0 && t.push(`blur(${n.blur}px)`), n.brightness !== void 0 && t.push(`brightness(${n.brightness})`), n.contrast !== void 0 && t.push(`contrast(${n.contrast})`), n.saturate !== void 0 && t.push(`saturate(${n.saturate})`), n.opacity !== void 0 && t.push(`opacity(${n.opacity})`), n.sepia !== void 0 && t.push(`sepia(${n.sepia})`), n.hueRotate !== void 0 && t.push(`hue-rotate(${n.hueRotate}deg)`), n.invert !== void 0 && t.push(`invert(${n.invert})`), n.dropShadow !== void 0)
2011
+ if (typeof n.dropShadow == "string")
2012
+ t.push(`drop-shadow(${n.dropShadow})`);
2007
2013
  else {
2008
- const i = o.dropShadow;
2014
+ const i = n.dropShadow;
2009
2015
  t.push(`drop-shadow(${i.x}px ${i.y}px ${i.blur}px ${i.color})`);
2010
2016
  }
2011
2017
  return t.join(" ");
2012
2018
  }
2013
- function tt(o) {
2014
- if (!o || o.style === "none" || o.width === 0)
2019
+ function tt(n) {
2020
+ if (!n || n.style === "none" || n.width === 0)
2015
2021
  return "none";
2016
- const t = o.width ?? 0, i = o.style ?? "solid", e = o.color ?? "#000000";
2022
+ const t = n.width ?? 0, i = n.style ?? "solid", e = n.color ?? "#000000";
2017
2023
  return `${t}px ${i} ${e}`;
2018
2024
  }
2019
- function it(o, t, i) {
2020
- if (!o) return {};
2025
+ function it(n, t, i) {
2026
+ if (!n) return {};
2021
2027
  const e = {};
2022
- if (o.borderRadiusTopLeft !== void 0 || o.borderRadiusTopRight !== void 0 || o.borderRadiusBottomRight !== void 0 || o.borderRadiusBottomLeft !== void 0) {
2023
- const a = o.border?.radius ?? 0;
2024
- o.borderRadiusTopLeft !== void 0 ? e.borderTopLeftRadius = `${o.borderRadiusTopLeft}px` : a && (e.borderTopLeftRadius = `${a}px`), o.borderRadiusTopRight !== void 0 ? e.borderTopRightRadius = `${o.borderRadiusTopRight}px` : a && (e.borderTopRightRadius = `${a}px`), o.borderRadiusBottomRight !== void 0 ? e.borderBottomRightRadius = `${o.borderRadiusBottomRight}px` : a && (e.borderBottomRightRadius = `${a}px`), o.borderRadiusBottomLeft !== void 0 ? e.borderBottomLeftRadius = `${o.borderRadiusBottomLeft}px` : a && (e.borderBottomLeftRadius = `${a}px`);
2025
- } else o.border?.radius !== void 0 && (e.borderRadius = `${o.border.radius}px`);
2026
- if (o.borderTop || o.borderRight || o.borderBottom || o.borderLeft) {
2027
- const a = o.border || {}, c = { ...a, ...o.borderTop }, l = { ...a, ...o.borderRight }, u = { ...a, ...o.borderBottom }, h = { ...a, ...o.borderLeft };
2028
- e.borderTop = tt(c), e.borderRight = tt(l), e.borderBottom = tt(u), e.borderLeft = tt(h);
2029
- } else o.border && (e.border = tt(o.border));
2030
- o.shadow !== void 0 && (e.boxShadow = ke(o.shadow));
2031
- const r = Be(o.filter);
2032
- if (e.filter = r || "none", o.opacity !== void 0 && (e.opacity = String(o.opacity)), o.cursor !== void 0 && (e.cursor = o.cursor), o.outline && o.outline.style !== "none" && (o.outline.width ?? 0) > 0) {
2033
- const a = o.outline.width ?? 0, c = o.outline.style ?? "solid", l = o.outline.color ?? "#000000";
2034
- e.outline = `${a}px ${c} ${l}`, o.outline.offset !== void 0 && (e.outlineOffset = `${o.outline.offset}px`);
2035
- }
2036
- if (o.objectFit !== void 0 && (e.objectFit = o.objectFit), o.aspectRatio !== void 0 && (e.aspectRatio = o.aspectRatio), o.clipPath !== void 0) {
2028
+ if (n.borderRadiusTopLeft !== void 0 || n.borderRadiusTopRight !== void 0 || n.borderRadiusBottomRight !== void 0 || n.borderRadiusBottomLeft !== void 0) {
2029
+ const a = n.border?.radius ?? 0;
2030
+ n.borderRadiusTopLeft !== void 0 ? e.borderTopLeftRadius = `${n.borderRadiusTopLeft}px` : a && (e.borderTopLeftRadius = `${a}px`), n.borderRadiusTopRight !== void 0 ? e.borderTopRightRadius = `${n.borderRadiusTopRight}px` : a && (e.borderTopRightRadius = `${a}px`), n.borderRadiusBottomRight !== void 0 ? e.borderBottomRightRadius = `${n.borderRadiusBottomRight}px` : a && (e.borderBottomRightRadius = `${a}px`), n.borderRadiusBottomLeft !== void 0 ? e.borderBottomLeftRadius = `${n.borderRadiusBottomLeft}px` : a && (e.borderBottomLeftRadius = `${a}px`);
2031
+ } else n.border?.radius !== void 0 && (e.borderRadius = `${n.border.radius}px`);
2032
+ if (n.borderTop || n.borderRight || n.borderBottom || n.borderLeft) {
2033
+ const a = n.border || {}, c = { ...a, ...n.borderTop }, d = { ...a, ...n.borderRight }, u = { ...a, ...n.borderBottom }, f = { ...a, ...n.borderLeft };
2034
+ e.borderTop = tt(c), e.borderRight = tt(d), e.borderBottom = tt(u), e.borderLeft = tt(f);
2035
+ } else n.border && (e.border = tt(n.border));
2036
+ n.shadow !== void 0 && (e.boxShadow = Ne(n.shadow));
2037
+ const r = Be(n.filter);
2038
+ if (e.filter = r || "none", n.opacity !== void 0 && (e.opacity = String(n.opacity)), n.cursor !== void 0 && (e.cursor = n.cursor), n.outline && n.outline.style !== "none" && (n.outline.width ?? 0) > 0) {
2039
+ const a = n.outline.width ?? 0, c = n.outline.style ?? "solid", d = n.outline.color ?? "#000000";
2040
+ e.outline = `${a}px ${c} ${d}`, n.outline.offset !== void 0 && (e.outlineOffset = `${n.outline.offset}px`);
2041
+ }
2042
+ if (n.objectFit !== void 0 && (e.objectFit = n.objectFit), n.aspectRatio !== void 0 && (e.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
2037
2043
  let a;
2038
- const c = typeof o.clipPath == "object" && o.clipPath !== null && "shape" in o.clipPath, l = c ? o.clipPath : void 0;
2039
- if (l?.mode === "height-relative" && t)
2040
- a = He(l.shape, t, i);
2044
+ const c = typeof n.clipPath == "object" && n.clipPath !== null && "shape" in n.clipPath, d = c ? n.clipPath : void 0;
2045
+ if (d?.mode === "height-relative" && t)
2046
+ a = ke(d.shape, t, i);
2041
2047
  else {
2042
- const u = c && l ? l.shape : o.clipPath;
2048
+ const u = c && d ? d.shape : n.clipPath;
2043
2049
  a = Ue(u);
2044
2050
  }
2045
2051
  a && (a === "none" ? e.clipPath = "unset" : (e.clipPath = a, e.overflow = "hidden"));
2046
2052
  }
2047
2053
  return e;
2048
2054
  }
2049
- function je(o, t) {
2050
- t.borderRadius !== void 0 && (o.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (o.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (o.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (o.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (o.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (o.style.border = t.border), t.borderTop !== void 0 && (o.style.borderTop = t.borderTop), t.borderRight !== void 0 && (o.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (o.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (o.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (o.style.boxShadow = t.boxShadow), t.filter !== void 0 && (o.style.filter = t.filter), t.opacity !== void 0 && (o.style.opacity = t.opacity), t.cursor !== void 0 && (o.style.cursor = t.cursor), t.outline !== void 0 && (o.style.outline = t.outline), t.outlineOffset !== void 0 && (o.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (o.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (o.style.aspectRatio = t.aspectRatio), t.clipPath !== void 0 && (o.style.clipPath = t.clipPath), t.overflow !== void 0 && (o.style.overflow = t.overflow);
2055
+ function je(n, t) {
2056
+ t.borderRadius !== void 0 && (n.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (n.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (n.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (n.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (n.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (n.style.border = t.border), t.borderTop !== void 0 && (n.style.borderTop = t.borderTop), t.borderRight !== void 0 && (n.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (n.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (n.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (n.style.boxShadow = t.boxShadow), t.filter !== void 0 && (n.style.filter = t.filter), t.opacity !== void 0 && (n.style.opacity = t.opacity), t.cursor !== void 0 && (n.style.cursor = t.cursor), t.outline !== void 0 && (n.style.outline = t.outline), t.outlineOffset !== void 0 && (n.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (n.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (n.style.aspectRatio = t.aspectRatio), t.clipPath !== void 0 && (n.style.clipPath = t.clipPath), t.overflow !== void 0 && (n.style.overflow = t.overflow);
2051
2057
  }
2052
- function st(o, t, i, e) {
2053
- const n = it(t, i, e);
2054
- je(o, n);
2058
+ function st(n, t, i, e) {
2059
+ const o = it(t, i, e);
2060
+ je(n, o);
2055
2061
  }
2056
- function Pt(o) {
2057
- return o ? Array.isArray(o) ? o.join(" ") : o : "";
2062
+ function Pt(n) {
2063
+ return n ? Array.isArray(n) ? n.join(" ") : n : "";
2058
2064
  }
2059
- function et(o, t) {
2065
+ function et(n, t) {
2060
2066
  const i = Pt(t);
2061
2067
  i && i.split(" ").forEach((e) => {
2062
- e.trim() && o.classList.add(e.trim());
2068
+ e.trim() && n.classList.add(e.trim());
2063
2069
  });
2064
2070
  }
2065
- function pt(o, t) {
2071
+ function pt(n, t) {
2066
2072
  const i = Pt(t);
2067
2073
  i && i.split(" ").forEach((e) => {
2068
- e.trim() && o.classList.remove(e.trim());
2074
+ e.trim() && n.classList.remove(e.trim());
2069
2075
  });
2070
2076
  }
2071
- const Mt = {
2077
+ const Ft = {
2072
2078
  UNFOCUSING: 999,
2073
2079
  FOCUSING: 1e3
2074
2080
  };
2075
2081
  class We {
2076
2082
  constructor(t, i, e) {
2077
- this.state = x.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.onUnfocusComplete = null, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
2083
+ this.state = C.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.onUnfocusComplete = null, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
2078
2084
  }
2079
2085
  /**
2080
2086
  * Set callback to be fired when an unfocus animation fully completes.
@@ -2092,7 +2098,7 @@ class We {
2092
2098
  * Check if any animation is in progress
2093
2099
  */
2094
2100
  isAnimating() {
2095
- return this.state !== x.IDLE && this.state !== x.FOCUSED;
2101
+ return this.state !== C.IDLE && this.state !== C.FOCUSED;
2096
2102
  }
2097
2103
  /**
2098
2104
  * Normalize scalePercent value
@@ -2105,17 +2111,17 @@ class We {
2105
2111
  * Returns actual pixel dimensions instead of scale factor for sharper rendering
2106
2112
  */
2107
2113
  calculateFocusDimensions(t, i, e) {
2108
- const n = this.normalizeScalePercent(this.config.scalePercent), s = e.height * n, r = t / i;
2114
+ const o = this.normalizeScalePercent(this.config.scalePercent), s = e.height * o, r = t / i;
2109
2115
  let a = s, c = a * r;
2110
- const l = e.width * n;
2111
- return c > l && (c = l, a = c / r), { width: c, height: a };
2116
+ const d = e.width * o;
2117
+ return c > d && (c = d, a = c / r), { width: c, height: a };
2112
2118
  }
2113
2119
  /**
2114
2120
  * Calculate the transform needed to center an image (position only, no scale)
2115
2121
  * Scale is handled by animating actual dimensions for sharper rendering
2116
2122
  */
2117
2123
  calculateFocusTransform(t, i) {
2118
- const e = t.width / 2, n = t.height / 2, s = e - i.x, r = n - i.y;
2124
+ const e = t.width / 2, o = t.height / 2, s = e - i.x, r = o - i.y;
2119
2125
  return {
2120
2126
  x: s,
2121
2127
  y: r,
@@ -2130,8 +2136,8 @@ class We {
2130
2136
  buildDimensionZoomTransform(t) {
2131
2137
  const i = ["translate(-50%, -50%)"];
2132
2138
  if (t.x !== void 0 || t.y !== void 0) {
2133
- const e = t.x ?? 0, n = t.y ?? 0;
2134
- i.push(`translate(${e}px, ${n}px)`);
2139
+ const e = t.x ?? 0, o = t.y ?? 0;
2140
+ i.push(`translate(${e}px, ${o}px)`);
2135
2141
  }
2136
2142
  return t.rotation !== void 0 && i.push(`rotate(${t.rotation}deg)`), i.join(" ");
2137
2143
  }
@@ -2139,13 +2145,13 @@ class We {
2139
2145
  * Create a Web Animation that animates both transform (position) and dimensions
2140
2146
  * This provides sharper zoom by re-rendering at target size instead of scaling pixels
2141
2147
  */
2142
- animateWithDimensions(t, i, e, n, s, r, a, c) {
2143
- const l = this.buildDimensionZoomTransform(i), u = this.buildDimensionZoomTransform(e);
2148
+ animateWithDimensions(t, i, e, o, s, r, a, c) {
2149
+ const d = this.buildDimensionZoomTransform(i), u = this.buildDimensionZoomTransform(e);
2144
2150
  return t.style.transition = "none", t.animate(
2145
2151
  [
2146
2152
  {
2147
- transform: l,
2148
- width: `${n}px`,
2153
+ transform: d,
2154
+ width: `${o}px`,
2149
2155
  height: `${s}px`
2150
2156
  },
2151
2157
  {
@@ -2186,10 +2192,10 @@ class We {
2186
2192
  * This ensures clip-path changes smoothly as width/height animate
2187
2193
  */
2188
2194
  startClipPathAnimation(t, i, e) {
2189
- let n = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
2190
- e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (n = { ...n, clipPath: void 0 });
2195
+ let o = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
2196
+ e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (o = { ...o, clipPath: void 0 });
2191
2197
  const s = () => {
2192
- const r = t.offsetHeight, a = t.offsetWidth, c = it(n, r, a);
2198
+ const r = t.offsetHeight, a = t.offsetWidth, c = it(o, r, a);
2193
2199
  c.clipPath !== void 0 ? t.style.clipPath = c.clipPath : t.style.clipPath = "unset", c.overflow !== void 0 && (t.style.overflow = c.overflow), i.animation.playState === "running" && requestAnimationFrame(s);
2194
2200
  };
2195
2201
  requestAnimationFrame(s);
@@ -2200,34 +2206,34 @@ class We {
2200
2206
  * @param fromTransform - Optional starting transform (for mid-animation reversals)
2201
2207
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
2202
2208
  */
2203
- startFocusAnimation(t, i, e, n, s) {
2204
- const r = t.style.zIndex || "", a = t.offsetWidth, c = t.offsetHeight, l = this.calculateFocusDimensions(a, c, i), u = this.calculateFocusTransform(i, e);
2209
+ startFocusAnimation(t, i, e, o, s) {
2210
+ const r = t.style.zIndex || "", a = t.offsetWidth, c = t.offsetHeight, d = this.calculateFocusDimensions(a, c, i), u = this.calculateFocusTransform(i, e);
2205
2211
  this.animationEngine.cancelAllAnimations(t);
2206
- const h = this.config.animationDuration ?? 600;
2207
- this.applyFocusedStyling(t, Mt.FOCUSING);
2208
- const d = n ?? {
2212
+ const f = this.config.animationDuration ?? 600;
2213
+ this.applyFocusedStyling(t, Ft.FOCUSING);
2214
+ const m = o ?? {
2209
2215
  x: 0,
2210
2216
  y: 0,
2211
2217
  rotation: e.rotation,
2212
2218
  scale: 1
2213
2219
  // No scale - using dimensions
2214
- }, g = s?.width ?? a, p = s?.height ?? c, b = this.animateWithDimensions(
2220
+ }, p = s?.width ?? a, w = s?.height ?? c, v = this.animateWithDimensions(
2215
2221
  t,
2216
- d,
2222
+ m,
2217
2223
  u,
2218
- g,
2219
2224
  p,
2220
- l.width,
2221
- l.height,
2222
- h
2223
- ), f = {
2225
+ w,
2226
+ d.width,
2227
+ d.height,
2228
+ f
2229
+ ), l = {
2224
2230
  id: `focus-${Date.now()}`,
2225
2231
  element: t,
2226
- animation: b,
2227
- fromState: d,
2232
+ animation: v,
2233
+ fromState: m,
2228
2234
  toState: u,
2229
2235
  startTime: performance.now(),
2230
- duration: h
2236
+ duration: f
2231
2237
  };
2232
2238
  return this.focusData = {
2233
2239
  element: t,
@@ -2236,12 +2242,12 @@ class We {
2236
2242
  originalZIndex: r,
2237
2243
  originalWidth: a,
2238
2244
  originalHeight: c,
2239
- focusWidth: l.width,
2240
- focusHeight: l.height
2241
- }, this.startClipPathAnimation(t, f, !0), {
2245
+ focusWidth: d.width,
2246
+ focusHeight: d.height
2247
+ }, this.startClipPathAnimation(t, l, !0), {
2242
2248
  element: t,
2243
2249
  originalState: e,
2244
- animationHandle: f,
2250
+ animationHandle: l,
2245
2251
  direction: "in",
2246
2252
  originalWidth: a,
2247
2253
  originalHeight: c
@@ -2252,41 +2258,41 @@ class We {
2252
2258
  * Animates back to original dimensions for consistent behavior
2253
2259
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
2254
2260
  */
2255
- startUnfocusAnimation(t, i, e, n) {
2256
- t.style.zIndex = String(Mt.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
2261
+ startUnfocusAnimation(t, i, e, o) {
2262
+ t.style.zIndex = String(Ft.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
2257
2263
  const s = this.config.animationDuration ?? 600;
2258
2264
  t.classList.remove("fbn-ic-focused"), pt(t, this.focusedClassName);
2259
- const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, a = n?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, c = n?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, l = {
2265
+ const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, a = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, c = o?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, d = {
2260
2266
  x: 0,
2261
2267
  y: 0,
2262
2268
  rotation: i.rotation,
2263
2269
  scale: 1
2264
2270
  // No scale - using dimensions
2265
- }, u = this.focusData?.originalWidth ?? t.offsetWidth, h = this.focusData?.originalHeight ?? t.offsetHeight, d = this.animateWithDimensions(
2271
+ }, u = this.focusData?.originalWidth ?? t.offsetWidth, f = this.focusData?.originalHeight ?? t.offsetHeight, m = this.animateWithDimensions(
2266
2272
  t,
2267
2273
  r,
2268
- l,
2274
+ d,
2269
2275
  a,
2270
2276
  c,
2271
2277
  u,
2272
- h,
2278
+ f,
2273
2279
  s
2274
- ), g = {
2280
+ ), p = {
2275
2281
  id: `unfocus-${Date.now()}`,
2276
2282
  element: t,
2277
- animation: d,
2283
+ animation: m,
2278
2284
  fromState: r,
2279
- toState: l,
2285
+ toState: d,
2280
2286
  startTime: performance.now(),
2281
2287
  duration: s
2282
2288
  };
2283
- return this.startClipPathAnimation(t, g, !1), {
2289
+ return this.startClipPathAnimation(t, p, !1), {
2284
2290
  element: t,
2285
2291
  originalState: i,
2286
- animationHandle: g,
2292
+ animationHandle: p,
2287
2293
  direction: "out",
2288
2294
  originalWidth: u,
2289
- originalHeight: h
2295
+ originalHeight: f
2290
2296
  };
2291
2297
  }
2292
2298
  /**
@@ -2304,10 +2310,10 @@ class We {
2304
2310
  * Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
2305
2311
  */
2306
2312
  captureMidAnimationState(t) {
2307
- const i = getComputedStyle(t), e = new DOMMatrix(i.transform), n = t.offsetWidth, s = t.offsetHeight, r = e.e + n * 0.5, a = e.f + s * 0.5, c = Math.atan2(e.b, e.a) * (180 / Math.PI);
2308
- return t.style.width = `${n}px`, t.style.height = `${s}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${a}px) rotate(${c}deg)`, t.style.transition = "none", {
2313
+ const i = getComputedStyle(t), e = new DOMMatrix(i.transform), o = t.offsetWidth, s = t.offsetHeight, r = e.e + o * 0.5, a = e.f + s * 0.5, c = Math.atan2(e.b, e.a) * (180 / Math.PI);
2314
+ return t.style.width = `${o}px`, t.style.height = `${s}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${a}px) rotate(${c}deg)`, t.style.transition = "none", {
2309
2315
  transform: { x: r, y: a, rotation: c, scale: 1 },
2310
- dimensions: { width: n, height: s }
2316
+ dimensions: { width: o, height: s }
2311
2317
  };
2312
2318
  }
2313
2319
  /**
@@ -2322,71 +2328,71 @@ class We {
2322
2328
  /**
2323
2329
  * Reset an element instantly to its original position and dimensions (no animation)
2324
2330
  */
2325
- resetElementInstantly(t, i, e, n, s) {
2331
+ resetElementInstantly(t, i, e, o, s) {
2326
2332
  this.animationEngine.cancelAllAnimations(t);
2327
2333
  const r = ["translate(-50%, -50%)"];
2328
- r.push("translate(0px, 0px)"), r.push(`rotate(${i.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), n !== void 0 && s !== void 0 && (t.style.width = `${n}px`, t.style.height = `${s}px`), this.removeFocusedStyling(t, e);
2334
+ r.push("translate(0px, 0px)"), r.push(`rotate(${i.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), o !== void 0 && s !== void 0 && (t.style.width = `${o}px`, t.style.height = `${s}px`), this.removeFocusedStyling(t, e);
2329
2335
  }
2330
2336
  /**
2331
2337
  * Focus (zoom) an image to center of container
2332
2338
  * Implements cross-animation when swapping focus
2333
2339
  */
2334
2340
  async focusImage(t, i, e) {
2335
- if (this.currentFocus === t && this.state === x.FOCUSED)
2341
+ if (this.currentFocus === t && this.state === C.FOCUSED)
2336
2342
  return this.unfocusImage();
2337
- if (this.incoming?.element === t && this.state === x.FOCUSING) {
2343
+ if (this.incoming?.element === t && this.state === C.FOCUSING) {
2338
2344
  const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2339
2345
  this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
2340
2346
  t,
2341
2347
  this.incoming.originalState,
2342
2348
  s,
2343
2349
  r
2344
- ), this.incoming = null, this.state = x.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = x.IDLE;
2350
+ ), this.incoming = null, this.state = C.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = C.IDLE;
2345
2351
  return;
2346
2352
  }
2347
- const n = ++this.focusGeneration;
2353
+ const o = ++this.focusGeneration;
2348
2354
  switch (this.state) {
2349
- case x.IDLE:
2350
- if (this.state = x.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2351
- this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
2355
+ case C.IDLE:
2356
+ if (this.state = C.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2357
+ this.currentFocus = t, this.incoming = null, this.state = C.FOCUSED;
2352
2358
  break;
2353
- case x.FOCUSED:
2354
- if (this.state = x.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2359
+ case C.FOCUSED:
2360
+ if (this.state = C.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2355
2361
  this.currentFocus,
2356
2362
  this.focusData.originalState
2357
2363
  )), this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2358
2364
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2359
2365
  this.waitForAnimation(this.incoming.animationHandle)
2360
- ]), this.focusGeneration !== n)
2366
+ ]), this.focusGeneration !== o)
2361
2367
  return;
2362
2368
  if (this.outgoing) {
2363
2369
  const s = this.outgoing.element;
2364
2370
  this.removeFocusedStyling(s, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(s);
2365
2371
  }
2366
- this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
2372
+ this.currentFocus = t, this.incoming = null, this.state = C.FOCUSED;
2367
2373
  break;
2368
- case x.FOCUSING:
2374
+ case C.FOCUSING:
2369
2375
  if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
2370
2376
  this.incoming.element,
2371
2377
  this.incoming.originalState,
2372
2378
  this.focusData?.originalZIndex || "",
2373
2379
  this.focusData?.originalWidth,
2374
2380
  this.focusData?.originalHeight
2375
- ), this.incoming = null), this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2376
- this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
2381
+ ), this.incoming = null), this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2382
+ this.currentFocus = t, this.incoming = null, this.state = C.FOCUSED;
2377
2383
  break;
2378
- case x.UNFOCUSING:
2379
- if (this.state = x.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2384
+ case C.UNFOCUSING:
2385
+ if (this.state = C.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2380
2386
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2381
2387
  this.waitForAnimation(this.incoming.animationHandle)
2382
- ]), this.focusGeneration !== n) return;
2388
+ ]), this.focusGeneration !== o) return;
2383
2389
  if (this.outgoing) {
2384
2390
  const s = this.outgoing.element;
2385
2391
  this.removeFocusedStyling(s, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(s);
2386
2392
  }
2387
- this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
2393
+ this.currentFocus = t, this.incoming = null, this.state = C.FOCUSED;
2388
2394
  break;
2389
- case x.CROSS_ANIMATING:
2395
+ case C.CROSS_ANIMATING:
2390
2396
  if (this.incoming?.element === t)
2391
2397
  return;
2392
2398
  if (this.outgoing?.element === t) {
@@ -2404,12 +2410,12 @@ class We {
2404
2410
  if (this.incoming = this.startFocusAnimation(t, i, e, s, r), await Promise.all([
2405
2411
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2406
2412
  this.waitForAnimation(this.incoming.animationHandle)
2407
- ]), this.focusGeneration !== n) return;
2413
+ ]), this.focusGeneration !== o) return;
2408
2414
  if (this.outgoing) {
2409
2415
  const a = this.outgoing.element;
2410
2416
  this.removeFocusedStyling(a, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(a);
2411
2417
  }
2412
- this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
2418
+ this.currentFocus = t, this.incoming = null, this.state = C.FOCUSED;
2413
2419
  return;
2414
2420
  }
2415
2421
  if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
@@ -2430,12 +2436,12 @@ class We {
2430
2436
  if (this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2431
2437
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2432
2438
  this.waitForAnimation(this.incoming.animationHandle)
2433
- ]), this.focusGeneration !== n) return;
2439
+ ]), this.focusGeneration !== o) return;
2434
2440
  if (this.outgoing) {
2435
2441
  const s = this.outgoing.element;
2436
2442
  this.removeFocusedStyling(s, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null, this.onUnfocusComplete?.(s);
2437
2443
  }
2438
- this.currentFocus = t, this.incoming = null, this.state = x.FOCUSED;
2444
+ this.currentFocus = t, this.incoming = null, this.state = C.FOCUSED;
2439
2445
  break;
2440
2446
  }
2441
2447
  }
@@ -2443,24 +2449,24 @@ class We {
2443
2449
  * Unfocus current image, returning it to original position
2444
2450
  */
2445
2451
  async unfocusImage() {
2446
- if (this.state === x.UNFOCUSING)
2452
+ if (this.state === C.UNFOCUSING)
2447
2453
  return;
2448
2454
  const t = ++this.focusGeneration;
2449
2455
  if (!this.currentFocus || !this.focusData) {
2450
- if (this.incoming && this.state === x.FOCUSING) {
2456
+ if (this.incoming && this.state === C.FOCUSING) {
2451
2457
  const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2452
2458
  if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2453
2459
  this.incoming.element,
2454
2460
  this.incoming.originalState,
2455
2461
  s,
2456
2462
  r
2457
- ), this.incoming = null, this.state = x.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2463
+ ), this.incoming = null, this.state = C.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2458
2464
  const a = this.outgoing.element;
2459
- this.removeFocusedStyling(a, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = x.IDLE, this.onUnfocusComplete?.(a);
2465
+ this.removeFocusedStyling(a, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = C.IDLE, this.onUnfocusComplete?.(a);
2460
2466
  }
2461
2467
  return;
2462
2468
  }
2463
- if (this.state === x.CROSS_ANIMATING && this.incoming) {
2469
+ if (this.state === C.CROSS_ANIMATING && this.incoming) {
2464
2470
  const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2465
2471
  this.animationEngine.cancelAllAnimations(this.incoming.element);
2466
2472
  const a = this.startUnfocusAnimation(
@@ -2475,13 +2481,13 @@ class We {
2475
2481
  ]), this.focusGeneration !== t) return;
2476
2482
  let c = null;
2477
2483
  this.outgoing && (c = this.outgoing.element, this.removeFocusedStyling(c, this.outgoing.originalState.zIndex?.toString() || ""));
2478
- const l = a.element;
2479
- this.removeFocusedStyling(l, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = x.IDLE, c && this.onUnfocusComplete?.(c), this.onUnfocusComplete?.(l);
2484
+ const d = a.element;
2485
+ this.removeFocusedStyling(d, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = C.IDLE, c && this.onUnfocusComplete?.(c), this.onUnfocusComplete?.(d);
2480
2486
  return;
2481
2487
  }
2482
- this.state = x.UNFOCUSING;
2483
- const i = this.currentFocus, e = this.focusData.originalState, n = this.focusData.originalZIndex;
2484
- this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = x.IDLE, this.onUnfocusComplete?.(i));
2488
+ this.state = C.UNFOCUSING;
2489
+ const i = this.currentFocus, e = this.focusData.originalState, o = this.focusData.originalZIndex;
2490
+ this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, o), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = C.IDLE, this.onUnfocusComplete?.(i));
2485
2491
  }
2486
2492
  /**
2487
2493
  * Swap focus from current image to a new one (alias for focusImage with cross-animation)
@@ -2499,7 +2505,7 @@ class We {
2499
2505
  * Check if an image is currently focused (stable state)
2500
2506
  */
2501
2507
  isFocused(t) {
2502
- return this.currentFocus === t && this.state === x.FOCUSED;
2508
+ return this.currentFocus === t && this.state === C.FOCUSED;
2503
2509
  }
2504
2510
  /**
2505
2511
  * Check if an image is the target of current focus animation
@@ -2520,9 +2526,9 @@ class We {
2520
2526
  * Used during swipe gestures for visual feedback
2521
2527
  */
2522
2528
  setDragOffset(t) {
2523
- if (!this.currentFocus || !this.focusData || this.state !== x.FOCUSED) return;
2524
- const i = this.currentFocus, e = this.focusData.focusTransform, n = ["translate(-50%, -50%)"], s = (e.x ?? 0) + t, r = e.y ?? 0;
2525
- n.push(`translate(${s}px, ${r}px)`), e.rotation !== void 0 && n.push(`rotate(${e.rotation}deg)`), i.style.transition = "none", i.style.transform = n.join(" ");
2529
+ if (!this.currentFocus || !this.focusData || this.state !== C.FOCUSED) return;
2530
+ const i = this.currentFocus, e = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], s = (e.x ?? 0) + t, r = e.y ?? 0;
2531
+ o.push(`translate(${s}px, ${r}px)`), e.rotation !== void 0 && o.push(`rotate(${e.rotation}deg)`), i.style.transition = "none", i.style.transform = o.join(" ");
2526
2532
  }
2527
2533
  /**
2528
2534
  * Clear the drag offset, optionally animating back to center
@@ -2530,9 +2536,9 @@ class We {
2530
2536
  * @param duration - Animation duration in ms (default 150)
2531
2537
  */
2532
2538
  clearDragOffset(t, i = 150) {
2533
- if (!this.currentFocus || !this.focusData || this.state !== x.FOCUSED) return;
2534
- const e = this.currentFocus, n = this.focusData.focusTransform, s = ["translate(-50%, -50%)"], r = n.x ?? 0, a = n.y ?? 0;
2535
- s.push(`translate(${r}px, ${a}px)`), n.rotation !== void 0 && s.push(`rotate(${n.rotation}deg)`);
2539
+ if (!this.currentFocus || !this.focusData || this.state !== C.FOCUSED) return;
2540
+ const e = this.currentFocus, o = this.focusData.focusTransform, s = ["translate(-50%, -50%)"], r = o.x ?? 0, a = o.y ?? 0;
2541
+ s.push(`translate(${r}px, ${a}px)`), o.rotation !== void 0 && s.push(`rotate(${o.rotation}deg)`);
2536
2542
  const c = s.join(" ");
2537
2543
  t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform = c, setTimeout(() => {
2538
2544
  this.currentFocus === e && (e.style.transition = "none");
@@ -2560,10 +2566,10 @@ class We {
2560
2566
  this.focusData.originalZIndex,
2561
2567
  this.focusData.originalWidth,
2562
2568
  this.focusData.originalHeight
2563
- ), this.state = x.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2569
+ ), this.state = C.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2564
2570
  }
2565
2571
  }
2566
- const Ge = 50, qe = 0.5, Xe = 20, Ye = 0.3, Je = 150, Ve = 30, rt = class rt {
2572
+ const Ge = 50, qe = 0.5, Ye = 20, Xe = 0.3, Ve = 150, Je = 30, rt = class rt {
2567
2573
  constructor(t, i) {
2568
2574
  this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = i, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
2569
2575
  }
@@ -2607,23 +2613,23 @@ const Ge = 50, qe = 0.5, Xe = 20, Ye = 0.3, Je = 150, Ve = 30, rt = class rt {
2607
2613
  }
2608
2614
  handleTouchMove(t) {
2609
2615
  if (!this.touchState || t.touches.length !== 1) return;
2610
- const i = t.touches[0], e = i.clientX - this.touchState.startX, n = i.clientY - this.touchState.startY;
2611
- if (this.touchState.isHorizontalSwipe === null && Math.sqrt(e * e + n * n) > 10) {
2612
- const a = Math.atan2(Math.abs(n), Math.abs(e)) * (180 / Math.PI);
2613
- this.touchState.isHorizontalSwipe = a <= Ve;
2616
+ const i = t.touches[0], e = i.clientX - this.touchState.startX, o = i.clientY - this.touchState.startY;
2617
+ if (this.touchState.isHorizontalSwipe === null && Math.sqrt(e * e + o * o) > 10) {
2618
+ const a = Math.atan2(Math.abs(o), Math.abs(e)) * (180 / Math.PI);
2619
+ this.touchState.isHorizontalSwipe = a <= Je;
2614
2620
  }
2615
2621
  if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2616
2622
  t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
2617
- const s = e * Ye;
2623
+ const s = e * Xe;
2618
2624
  this.callbacks.onDragOffset(s);
2619
2625
  }
2620
2626
  }
2621
2627
  handleTouchEnd(t) {
2622
2628
  if (!this.touchState) return;
2623
2629
  this.recentTouchTimestamp = Date.now();
2624
- const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, n = Math.abs(i) / e, s = Math.abs(i);
2630
+ const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, o = Math.abs(i) / e, s = Math.abs(i);
2625
2631
  let r = !1;
2626
- this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Ge || n >= qe && s >= Xe) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2632
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Ge || o >= qe && s >= Ye) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2627
2633
  }
2628
2634
  handleTouchCancel(t) {
2629
2635
  this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
@@ -2645,7 +2651,7 @@ class Ke {
2645
2651
  for (const i of this.sources)
2646
2652
  if ("folders" in i)
2647
2653
  for (const e of i.folders) {
2648
- const n = i.recursive !== void 0 ? i.recursive : !0, s = await this.loadFromFolder(e, t, n);
2654
+ const o = i.recursive !== void 0 ? i.recursive : !0, s = await this.loadFromFolder(e, t, o);
2649
2655
  this._discoveredUrls.push(...s);
2650
2656
  }
2651
2657
  else if ("files" in i) {
@@ -2691,9 +2697,9 @@ class Ke {
2691
2697
  // Alternative format
2692
2698
  ];
2693
2699
  for (const e of i) {
2694
- const n = t.match(e);
2695
- if (n && n[1])
2696
- return n[1];
2700
+ const o = t.match(e);
2701
+ if (o && o[1])
2702
+ return o[1];
2697
2703
  }
2698
2704
  return null;
2699
2705
  }
@@ -2705,15 +2711,15 @@ class Ke {
2705
2711
  * @returns Promise resolving to array of image URLs
2706
2712
  */
2707
2713
  async loadFromFolder(t, i, e = !0) {
2708
- const n = this.extractFolderId(t);
2709
- if (!n)
2714
+ const o = this.extractFolderId(t);
2715
+ if (!o)
2710
2716
  throw new Error("Invalid Google Drive folder URL. Please check the URL format.");
2711
2717
  if (!this.apiKey || this.apiKey === "YOUR_API_KEY_HERE")
2712
- return this.loadImagesDirectly(n, i);
2718
+ return this.loadImagesDirectly(o, i);
2713
2719
  try {
2714
- return e ? await this.loadImagesRecursively(n, i) : await this.loadImagesFromSingleFolder(n, i);
2720
+ return e ? await this.loadImagesRecursively(o, i) : await this.loadImagesFromSingleFolder(o, i);
2715
2721
  } catch (s) {
2716
- return console.error("Error loading from Google Drive API:", s), this.loadImagesDirectly(n, i);
2722
+ return console.error("Error loading from Google Drive API:", s), this.loadImagesDirectly(o, i);
2717
2723
  }
2718
2724
  }
2719
2725
  /**
@@ -2723,13 +2729,13 @@ class Ke {
2723
2729
  * @returns Promise resolving to array of image URLs
2724
2730
  */
2725
2731
  async loadImagesFromSingleFolder(t, i) {
2726
- const e = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2732
+ const e = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2727
2733
  if (!a.ok)
2728
2734
  throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2729
- const l = (await a.json()).files.filter(
2735
+ const d = (await a.json()).files.filter(
2730
2736
  (u) => u.mimeType.startsWith("image/") && i.isAllowed(u.name)
2731
2737
  );
2732
- return this.log(`Found ${l.length} images in folder ${t} (non-recursive)`), l.forEach((u) => {
2738
+ return this.log(`Found ${d.length} images in folder ${t} (non-recursive)`), d.forEach((u) => {
2733
2739
  e.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
2734
2740
  }), e;
2735
2741
  }
@@ -2741,10 +2747,10 @@ class Ke {
2741
2747
  */
2742
2748
  async loadFiles(t, i) {
2743
2749
  const e = [];
2744
- for (const n of t) {
2745
- const s = this.extractFileId(n);
2750
+ for (const o of t) {
2751
+ const s = this.extractFileId(o);
2746
2752
  if (!s) {
2747
- this.log(`Skipping invalid file URL: ${n}`);
2753
+ this.log(`Skipping invalid file URL: ${o}`);
2748
2754
  continue;
2749
2755
  }
2750
2756
  if (this.apiKey && this.apiKey !== "YOUR_API_KEY_HERE")
@@ -2780,9 +2786,9 @@ class Ke {
2780
2786
  // Generic id parameter
2781
2787
  ];
2782
2788
  for (const e of i) {
2783
- const n = t.match(e);
2784
- if (n && n[1])
2785
- return n[1];
2789
+ const o = t.match(e);
2790
+ if (o && o[1])
2791
+ return o[1];
2786
2792
  }
2787
2793
  return null;
2788
2794
  }
@@ -2793,21 +2799,21 @@ class Ke {
2793
2799
  * @returns Promise resolving to array of image URLs
2794
2800
  */
2795
2801
  async loadImagesRecursively(t, i) {
2796
- const e = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2802
+ const e = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2797
2803
  if (!a.ok)
2798
2804
  throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2799
- const c = await a.json(), l = c.files.filter(
2800
- (h) => h.mimeType.startsWith("image/") && i.isAllowed(h.name)
2805
+ const c = await a.json(), d = c.files.filter(
2806
+ (f) => f.mimeType.startsWith("image/") && i.isAllowed(f.name)
2801
2807
  ), u = c.files.filter(
2802
- (h) => h.mimeType === "application/vnd.google-apps.folder"
2808
+ (f) => f.mimeType === "application/vnd.google-apps.folder"
2803
2809
  );
2804
- this.log(`Found ${c.files.length} total items in folder ${t}`), c.files.forEach((h) => this.log(` - File: ${h.name} (${h.mimeType})`)), this.log(`- ${l.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), l.forEach((h) => {
2805
- e.push(`https://lh3.googleusercontent.com/d/${h.id}=s1600`), this.log(`Added file: ${h.name}`);
2810
+ this.log(`Found ${c.files.length} total items in folder ${t}`), c.files.forEach((f) => this.log(` - File: ${f.name} (${f.mimeType})`)), this.log(`- ${d.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), d.forEach((f) => {
2811
+ e.push(`https://lh3.googleusercontent.com/d/${f.id}=s1600`), this.log(`Added file: ${f.name}`);
2806
2812
  });
2807
- for (const h of u) {
2808
- this.log(`Loading images from subfolder: ${h.name}`);
2809
- const d = await this.loadImagesRecursively(h.id, i);
2810
- e.push(...d);
2813
+ for (const f of u) {
2814
+ this.log(`Loading images from subfolder: ${f.name}`);
2815
+ const m = await this.loadImagesRecursively(f.id, i);
2816
+ e.push(...m);
2811
2817
  }
2812
2818
  return e;
2813
2819
  }
@@ -2820,10 +2826,10 @@ class Ke {
2820
2826
  */
2821
2827
  async loadImagesDirectly(t, i) {
2822
2828
  try {
2823
- const e = `https://drive.google.com/embeddedfolderview?id=${t}`, n = await fetch(e, { mode: "cors" });
2824
- if (!n.ok)
2829
+ const e = `https://drive.google.com/embeddedfolderview?id=${t}`, o = await fetch(e, { mode: "cors" });
2830
+ if (!o.ok)
2825
2831
  throw new Error("Cannot access folder directly (CORS or permissions issue)");
2826
- const s = await n.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...s.matchAll(r)];
2832
+ const s = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...s.matchAll(r)];
2827
2833
  return [...new Set(a.map((u) => u[1]))].map(
2828
2834
  (u) => `https://drive.google.com/uc?export=view&id=${u}`
2829
2835
  );
@@ -2916,13 +2922,13 @@ class Ze {
2916
2922
  if (!Array.isArray(t))
2917
2923
  return console.warn("URLs must be an array:", t), [];
2918
2924
  const e = [];
2919
- for (const n of t) {
2920
- const s = n.split("/").pop() || n;
2925
+ for (const o of t) {
2926
+ const s = o.split("/").pop() || o;
2921
2927
  if (!i.isAllowed(s)) {
2922
- this.log(`Skipping filtered URL: ${n}`);
2928
+ this.log(`Skipping filtered URL: ${o}`);
2923
2929
  continue;
2924
2930
  }
2925
- this.validateUrls ? await this.validateUrl(n) ? e.push(n) : console.warn(`Skipping invalid/missing URL: ${n}`) : e.push(n);
2931
+ this.validateUrls ? await this.validateUrl(o) ? e.push(o) : console.warn(`Skipping invalid/missing URL: ${o}`) : e.push(o);
2926
2932
  }
2927
2933
  return e;
2928
2934
  }
@@ -2936,16 +2942,16 @@ class Ze {
2936
2942
  async processPath(t, i, e) {
2937
2943
  if (!Array.isArray(i))
2938
2944
  return console.warn("files must be an array:", i), [];
2939
- const n = [];
2945
+ const o = [];
2940
2946
  for (const s of i) {
2941
2947
  if (!e.isAllowed(s)) {
2942
2948
  this.log(`Skipping filtered file: ${s}`);
2943
2949
  continue;
2944
2950
  }
2945
2951
  const r = this.constructUrl(t, s);
2946
- this.validateUrls ? await this.validateUrl(r) ? n.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : n.push(r);
2952
+ this.validateUrls ? await this.validateUrl(r) ? o.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : o.push(r);
2947
2953
  }
2948
- return n;
2954
+ return o;
2949
2955
  }
2950
2956
  /**
2951
2957
  * Process a JSON endpoint source
@@ -2956,17 +2962,17 @@ class Ze {
2956
2962
  */
2957
2963
  async processJson(t, i) {
2958
2964
  this.log(`Fetching JSON endpoint: ${t}`);
2959
- const e = new AbortController(), n = setTimeout(() => e.abort(), 1e4);
2965
+ const e = new AbortController(), o = setTimeout(() => e.abort(), 1e4);
2960
2966
  try {
2961
2967
  const s = await fetch(t, { signal: e.signal });
2962
- if (clearTimeout(n), !s.ok)
2968
+ if (clearTimeout(o), !s.ok)
2963
2969
  throw new Error(`HTTP ${s.status} fetching ${t}`);
2964
2970
  const r = await s.json();
2965
2971
  if (!r || !Array.isArray(r.images))
2966
2972
  throw new Error('JSON source must return JSON with shape { "images": ["url1", "url2", ...] }');
2967
2973
  return this.log(`JSON endpoint returned ${r.images.length} image(s)`), await this.processUrls(r.images, i);
2968
2974
  } catch (s) {
2969
- throw clearTimeout(n), s instanceof Error && s.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : s;
2975
+ throw clearTimeout(o), s instanceof Error && s.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : s;
2970
2976
  }
2971
2977
  }
2972
2978
  /**
@@ -2988,11 +2994,11 @@ class Ze {
2988
2994
  if (!(t.startsWith(window.location.origin) || t.startsWith("/")))
2989
2995
  return this.log(`Skipping validation for cross-origin URL: ${t}`), !0;
2990
2996
  try {
2991
- const e = new AbortController(), n = setTimeout(() => e.abort(), this.validationTimeout), s = await fetch(t, {
2997
+ const e = new AbortController(), o = setTimeout(() => e.abort(), this.validationTimeout), s = await fetch(t, {
2992
2998
  method: "HEAD",
2993
2999
  signal: e.signal
2994
3000
  });
2995
- return clearTimeout(n), s.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${s.status}`), !1);
3001
+ return clearTimeout(o), s.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${s.status}`), !1);
2996
3002
  } catch (e) {
2997
3003
  return e instanceof Error && (e.name === "AbortError" ? this.log(`Validation timeout for ${t}`) : this.log(`Validation failed for ${t}:`, e.message)), !1;
2998
3004
  }
@@ -3009,8 +3015,8 @@ class Ze {
3009
3015
  return `${e}/${i}`;
3010
3016
  if (typeof window > "u")
3011
3017
  return `${e}/${i}`;
3012
- const n = window.location.origin, r = (t.startsWith("/") ? t : "/" + t).replace(/\/$/, "");
3013
- return `${n}${r}/${i}`;
3018
+ const o = window.location.origin, r = (t.startsWith("/") ? t : "/" + t).replace(/\/$/, "");
3019
+ return `${o}${r}/${i}`;
3014
3020
  }
3015
3021
  /**
3016
3022
  * Check if URL is absolute (contains protocol)
@@ -3044,16 +3050,16 @@ class Qe {
3044
3050
  */
3045
3051
  async prepare(t) {
3046
3052
  this._discoveredUrls = [], this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);
3047
- const i = this.loaders.map((e, n) => e.prepare(t).then(() => {
3048
- this.log(`Loader ${n} prepared with ${e.imagesLength()} images`);
3053
+ const i = this.loaders.map((e, o) => e.prepare(t).then(() => {
3054
+ this.log(`Loader ${o} prepared with ${e.imagesLength()} images`);
3049
3055
  }).catch((s) => {
3050
- console.warn(`Loader ${n} failed to prepare:`, s);
3056
+ console.warn(`Loader ${o} failed to prepare:`, s);
3051
3057
  }));
3052
3058
  await Promise.all(i);
3053
3059
  for (const e of this.loaders)
3054
3060
  if (e.isPrepared()) {
3055
- const n = e.imageURLs();
3056
- this._discoveredUrls.push(...n);
3061
+ const o = e.imageURLs();
3062
+ this._discoveredUrls.push(...o);
3057
3063
  }
3058
3064
  this._prepared = !0, this.log(`CompositeLoader prepared with ${this._discoveredUrls.length} total images`);
3059
3065
  }
@@ -3209,18 +3215,18 @@ const ei = `
3209
3215
  `;
3210
3216
  function ii() {
3211
3217
  if (typeof document > "u") return;
3212
- const o = "fbn-ic-functional-styles";
3213
- if (document.getElementById(o)) return;
3218
+ const n = "fbn-ic-functional-styles";
3219
+ if (document.getElementById(n)) return;
3214
3220
  const t = document.createElement("style");
3215
- t.id = o, t.textContent = ei, document.head.appendChild(t);
3221
+ t.id = n, t.textContent = ei, document.head.appendChild(t);
3216
3222
  }
3217
- let ni = class {
3223
+ let oi = class {
3218
3224
  constructor(t = {}) {
3219
- this.fullConfig = ie(t), t.container instanceof HTMLElement ? (this.containerRef = t.container, this.containerId = null) : (this.containerRef = null, this.containerId = t.container || "imageCloud"), this.imagesLoaded = !1, this.imageElements = [], this.imageLayouts = [], this.currentImageHeight = 225, this.currentFocusIndex = null, this.hoveredImage = null, this.resizeTimeout = null, this.displayQueue = [], this.queueInterval = null, this.loadGeneration = 0, this.loadingElAutoCreated = !1, this.errorElAutoCreated = !1, this.counterEl = null, this.counterElAutoCreated = !1, this.prevButtonEl = null, this.nextButtonEl = null, this.prevButtonElAutoCreated = !1, this.nextButtonElAutoCreated = !1, this.animationEngine = new ae(this.fullConfig.animation), this.layoutEngine = new Pe({
3225
+ this.fullConfig = ie(t), t.container instanceof HTMLElement ? (this.containerRef = t.container, this.containerId = null) : (this.containerRef = null, this.containerId = t.container || "imageCloud"), this.callbacks = t.on ?? {}, this.imagesLoaded = !1, this.imageElements = [], this.imageLayouts = [], this.currentImageHeight = 225, this.currentFocusIndex = null, this.hoveredImage = null, this.resizeTimeout = null, this.displayQueue = [], this.queueInterval = null, this.loadGeneration = 0, this.loadingElAutoCreated = !1, this.errorElAutoCreated = !1, this.counterEl = null, this.counterElAutoCreated = !1, this.prevButtonEl = null, this.nextButtonEl = null, this.prevButtonElAutoCreated = !1, this.nextButtonElAutoCreated = !1, this.animationEngine = new ae(this.fullConfig.animation), this.layoutEngine = new Pe({
3220
3226
  layout: this.fullConfig.layout,
3221
3227
  image: this.fullConfig.image
3222
3228
  }), this.zoomEngine = new We(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = it(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
3223
- const i = this.fullConfig.animation.entry || C.animation.entry;
3229
+ const i = this.fullConfig.animation.entry || L.animation.entry;
3224
3230
  this.entryAnimationEngine = new be(
3225
3231
  i,
3226
3232
  this.fullConfig.layout.algorithm
@@ -3229,15 +3235,24 @@ let ni = class {
3229
3235
  e && e.type !== "none" ? this.idleAnimationEngine = new ye(
3230
3236
  e,
3231
3237
  i.timing?.duration ?? 600
3232
- ) : this.idleAnimationEngine = null, this.zoomEngine.setOnUnfocusCompleteCallback((n) => {
3233
- this.idleAnimationEngine?.resumeForImage(n);
3234
- const s = n;
3238
+ ) : this.idleAnimationEngine = null, this.zoomEngine.setOnUnfocusCompleteCallback((o) => {
3239
+ this.idleAnimationEngine?.resumeForImage(o);
3240
+ const s = o, r = this.imageElements.indexOf(s);
3241
+ if (this.callbacks.onImageUnfocus && r !== -1) {
3242
+ const a = this.imageLoader.imageURLs(), c = {
3243
+ element: s,
3244
+ index: r,
3245
+ url: a[r] ?? "",
3246
+ layout: this.imageLayouts[r]
3247
+ };
3248
+ this.callbacks.onImageUnfocus(c);
3249
+ }
3235
3250
  requestAnimationFrame(() => {
3236
3251
  if (s.matches(":hover") && this.fullConfig.styling?.hover) {
3237
- const r = this.imageElements.indexOf(s);
3238
- if (r !== -1) {
3239
- const a = s.offsetHeight, c = s.cachedRenderedWidth;
3240
- st(s, this.fullConfig.styling.hover, a, c), et(s, this.hoverClassName), this.hoveredImage = { element: s, layout: this.imageLayouts[r] };
3252
+ const a = this.imageElements.indexOf(s);
3253
+ if (a !== -1) {
3254
+ const c = s.offsetHeight, d = s.cachedRenderedWidth;
3255
+ st(s, this.fullConfig.styling.hover, c, d), et(s, this.hoverClassName), this.hoveredImage = { element: s, layout: this.imageLayouts[a] };
3241
3256
  }
3242
3257
  }
3243
3258
  });
@@ -3258,7 +3273,7 @@ let ni = class {
3258
3273
  const t = this.fullConfig.loaders, i = this.fullConfig.config.loaders ?? {};
3259
3274
  if (!t || t.length === 0)
3260
3275
  throw new Error("No loaders configured. Provide `images`, `loaders`, or both.\n Example: imageCloud({ container: 'id', images: ['https://...'] })");
3261
- const e = t.map((n) => this.createLoaderFromEntry(n, i));
3276
+ const e = t.map((o) => this.createLoaderFromEntry(o, i));
3262
3277
  return e.length === 1 ? e[0] : new Qe({
3263
3278
  loaders: e,
3264
3279
  debugLogging: this.fullConfig.config.debug?.loaders
@@ -3269,7 +3284,7 @@ let ni = class {
3269
3284
  */
3270
3285
  createLoaderFromEntry(t, i) {
3271
3286
  if ("static" in t) {
3272
- const e = t.static, n = {
3287
+ const e = t.static, o = {
3273
3288
  ...e,
3274
3289
  validateUrls: e.validateUrls ?? i.validateUrls,
3275
3290
  validationTimeout: e.validationTimeout ?? i.validationTimeout,
@@ -3277,14 +3292,14 @@ let ni = class {
3277
3292
  allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
3278
3293
  debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
3279
3294
  };
3280
- return new Ze(n);
3295
+ return new Ze(o);
3281
3296
  } else if ("googleDrive" in t) {
3282
- const e = t.googleDrive, n = {
3297
+ const e = t.googleDrive, o = {
3283
3298
  ...e,
3284
3299
  allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
3285
3300
  debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
3286
3301
  };
3287
- return new Ke(n);
3302
+ return new Ke(o);
3288
3303
  } else
3289
3304
  throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
3290
3305
  }
@@ -3302,7 +3317,7 @@ let ni = class {
3302
3317
  onPrev: () => this.navigateToPreviousImage(),
3303
3318
  onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
3304
3319
  onDragEnd: (t) => {
3305
- t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Je);
3320
+ t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Ve);
3306
3321
  }
3307
3322
  })), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
3308
3323
  } catch (t) {
@@ -3357,7 +3372,7 @@ let ni = class {
3357
3372
  navigateToNextImage() {
3358
3373
  if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
3359
3374
  const t = (this.currentFocusIndex + 1) % this.imageLayouts.length, i = this.imageElements.find(
3360
- (n) => n.dataset.imageId === String(t)
3375
+ (o) => o.dataset.imageId === String(t)
3361
3376
  );
3362
3377
  if (!i) return;
3363
3378
  const e = this.imageLayouts[t];
@@ -3369,7 +3384,7 @@ let ni = class {
3369
3384
  navigateToPreviousImage() {
3370
3385
  if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
3371
3386
  const t = (this.currentFocusIndex - 1 + this.imageLayouts.length) % this.imageLayouts.length, i = this.imageElements.find(
3372
- (n) => n.dataset.imageId === String(t)
3387
+ (o) => o.dataset.imageId === String(t)
3373
3388
  );
3374
3389
  if (!i) return;
3375
3390
  const e = this.imageLayouts[t];
@@ -3385,8 +3400,8 @@ let ni = class {
3385
3400
  }, 500));
3386
3401
  }
3387
3402
  getImageHeight() {
3388
- const t = window.innerWidth, i = this.fullConfig.layout.responsive, n = this.fullConfig.image.sizing?.maxSize ?? 400;
3389
- return i ? t <= i.mobile.maxWidth ? Math.min(100, n) : t <= i.tablet.maxWidth ? Math.min(180, n) : Math.min(225, n) : t <= 767 ? Math.min(100, n) : t <= 1199 ? Math.min(180, n) : Math.min(225, n);
3403
+ const t = window.innerWidth, i = this.fullConfig.layout.responsive, o = this.fullConfig.image.sizing?.maxSize ?? 400;
3404
+ return i ? t <= i.mobile.maxWidth ? Math.min(100, o) : t <= i.tablet.maxWidth ? Math.min(180, o) : Math.min(225, o) : t <= 767 ? Math.min(100, o) : t <= 1199 ? Math.min(180, o) : Math.min(225, o);
3390
3405
  }
3391
3406
  /**
3392
3407
  * Get container bounds for layout calculations
@@ -3409,12 +3424,12 @@ let ni = class {
3409
3424
  this.showError("No images found."), this.showLoading(!1);
3410
3425
  return;
3411
3426
  }
3412
- const e = this.getContainerBounds(), n = this.getImageHeight(), s = window.innerWidth;
3413
- this.logDebug(`Adaptive sizing input: container=${e.width}x${e.height}px, images=${t}, responsiveMax=${n}px`);
3427
+ const e = this.getContainerBounds(), o = this.getImageHeight(), s = window.innerWidth;
3428
+ this.logDebug(`Adaptive sizing input: container=${e.width}x${e.height}px, images=${t}, responsiveMax=${o}px`);
3414
3429
  const r = this.layoutEngine.calculateAdaptiveSize(
3415
3430
  e,
3416
3431
  t,
3417
- n,
3432
+ o,
3418
3433
  s
3419
3434
  );
3420
3435
  this.logDebug(`Adaptive sizing result: height=${r.height}px`), await this.createImageCloud(i, r.height), this.showLoading(!1), this.imagesLoaded = !0;
@@ -3432,148 +3447,288 @@ let ni = class {
3432
3447
  if (!this.containerEl) return;
3433
3448
  const e = this.getContainerBounds();
3434
3449
  this.currentImageHeight = i;
3435
- const n = this.loadGeneration, s = this.layoutEngine.generateLayout(t.length, e, { fixedHeight: i });
3436
- this.imageLayouts = s, this.displayQueue = [];
3437
- let r = 0;
3438
- const a = (l) => {
3439
- this.containerEl && (this.containerEl.appendChild(l), this.imageElements.push(l), requestAnimationFrame(() => {
3440
- if (l.offsetWidth, l.style.opacity = this.defaultStyles.opacity ?? "1", l.dataset.startX && (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || l.dataset.startRotation !== l.dataset.rotation || l.dataset.startScale !== l.dataset.scale)) {
3441
- const d = {
3442
- x: parseFloat(l.dataset.startX),
3443
- y: parseFloat(l.dataset.startY)
3444
- }, g = {
3445
- x: parseFloat(l.dataset.endX),
3446
- y: parseFloat(l.dataset.endY)
3447
- }, p = parseFloat(l.dataset.imageWidth), b = parseFloat(l.dataset.imageHeight), f = parseFloat(l.dataset.rotation), m = parseFloat(l.dataset.scale), y = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : f, E = l.dataset.startScale ? parseFloat(l.dataset.startScale) : m, v = this.entryAnimationEngine.getTiming();
3450
+ const o = this.loadGeneration, s = this.layoutEngine.generateLayout(t.length, e, { fixedHeight: i });
3451
+ if (this.imageLayouts = s, this.callbacks.onLayoutComplete) {
3452
+ const l = {
3453
+ layouts: [...s],
3454
+ // shallow copy caller should not mutate
3455
+ containerBounds: { ...e },
3456
+ algorithm: this.fullConfig.layout.algorithm,
3457
+ imageCount: t.length
3458
+ };
3459
+ this.callbacks.onLayoutComplete(l);
3460
+ }
3461
+ this.displayQueue = [];
3462
+ let r = 0, a = 0, c = 0, d = 0, u = !1;
3463
+ const f = /* @__PURE__ */ new Map(), m = () => {
3464
+ if (u || o !== this.loadGeneration || !this.callbacks.onGalleryReady) return;
3465
+ u = !0;
3466
+ const l = {
3467
+ totalImages: t.length,
3468
+ failedImages: c,
3469
+ loadDuration: d > 0 ? performance.now() - d : 0
3470
+ };
3471
+ this.callbacks.onGalleryReady(l);
3472
+ }, p = () => {
3473
+ r >= t.length && this.displayQueue.length === 0 && m();
3474
+ }, w = (l) => {
3475
+ this.containerEl && (this.containerEl.appendChild(l), this.imageElements.push(l), requestAnimationFrame(async () => {
3476
+ l.offsetWidth, l.style.opacity = this.defaultStyles.opacity ?? "1";
3477
+ const g = parseInt(l.dataset.imageId || "0"), h = this.imageLayouts[g], b = this.entryAnimationEngine.getTiming(), I = performance.now(), y = parseFloat(l.dataset.startX || "0"), x = parseFloat(l.dataset.startY || "0"), E = parseFloat(l.dataset.endX || "0"), F = parseFloat(l.dataset.endY || "0"), R = parseFloat(l.dataset.rotation || "0"), M = parseFloat(l.dataset.scale || "1"), T = parseFloat(l.dataset.startRotation || l.dataset.rotation || "0"), z = parseFloat(l.dataset.startScale || l.dataset.scale || "1"), k = parseFloat(l.dataset.imageWidth || "0"), D = parseFloat(l.dataset.imageHeight || "0");
3478
+ if (this.callbacks.onEntryStart && h) {
3479
+ const S = {
3480
+ element: l,
3481
+ index: g,
3482
+ totalImages: this.imageLayouts.length,
3483
+ layout: h,
3484
+ from: { x: y, y: x, rotation: T, scale: z },
3485
+ to: { x: E, y: F, rotation: R, scale: M },
3486
+ startTime: I,
3487
+ duration: b.duration
3488
+ };
3489
+ this.callbacks.onEntryStart(S);
3490
+ }
3491
+ if (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || l.dataset.startRotation !== l.dataset.rotation || l.dataset.startScale !== l.dataset.scale)
3448
3492
  ge({
3449
3493
  element: l,
3450
- startPosition: d,
3451
- endPosition: g,
3494
+ startPosition: { x: y, y: x },
3495
+ endPosition: { x: E, y: F },
3452
3496
  pathConfig: this.entryAnimationEngine.getPathConfig(),
3453
- duration: v.duration,
3454
- imageWidth: p,
3455
- imageHeight: b,
3456
- rotation: f,
3457
- scale: m,
3497
+ duration: b.duration,
3498
+ imageWidth: k,
3499
+ imageHeight: D,
3500
+ rotation: R,
3501
+ scale: M,
3458
3502
  rotationConfig: this.entryAnimationEngine.getRotationConfig(),
3459
- startRotation: y,
3503
+ startRotation: T,
3460
3504
  scaleConfig: this.entryAnimationEngine.getScaleConfig(),
3461
- startScale: E
3505
+ startScale: z,
3506
+ onProgress: this.callbacks.onEntryProgress && h ? (S, _, $) => {
3507
+ const A = {
3508
+ element: l,
3509
+ index: g,
3510
+ totalImages: this.imageLayouts.length,
3511
+ layout: h,
3512
+ from: { x: y, y: x, rotation: T, scale: z },
3513
+ to: { x: E, y: F, rotation: R, scale: M },
3514
+ startTime: I,
3515
+ duration: b.duration,
3516
+ progress: S,
3517
+ rawProgress: S,
3518
+ elapsed: _,
3519
+ current: $
3520
+ };
3521
+ this.callbacks.onEntryProgress(A);
3522
+ } : void 0,
3523
+ onComplete: h ? () => {
3524
+ if (this.callbacks.onEntryComplete) {
3525
+ const S = {
3526
+ element: l,
3527
+ index: g,
3528
+ layout: h,
3529
+ startTime: I,
3530
+ endTime: performance.now(),
3531
+ duration: b.duration
3532
+ };
3533
+ this.callbacks.onEntryComplete(S);
3534
+ }
3535
+ } : void 0
3462
3536
  });
3463
- } else {
3464
- const d = l.dataset.finalTransform || "";
3465
- l.style.transform = d;
3537
+ else {
3538
+ const S = l.dataset.finalTransform || "";
3539
+ if (l.style.transform = S, this.callbacks.onEntryComplete && h) {
3540
+ const _ = ($) => {
3541
+ if ($.propertyName !== "transform") return;
3542
+ l.removeEventListener("transitionend", _);
3543
+ const A = {
3544
+ element: l,
3545
+ index: g,
3546
+ layout: h,
3547
+ startTime: I,
3548
+ endTime: performance.now(),
3549
+ duration: b.duration
3550
+ };
3551
+ this.callbacks.onEntryComplete(A);
3552
+ };
3553
+ l.addEventListener("transitionend", _);
3554
+ }
3466
3555
  }
3467
- const h = parseInt(l.dataset.imageId || "0");
3468
- if (this.fullConfig.config.debug?.enabled && h < 3) {
3469
- const d = l.dataset.finalTransform || "";
3470
- console.log(`Image ${h} final state:`, {
3556
+ if (this.fullConfig.config.debug?.enabled && g < 3) {
3557
+ const S = l.dataset.finalTransform || "";
3558
+ console.log(`Image ${g} final state:`, {
3471
3559
  left: l.style.left,
3472
3560
  top: l.style.top,
3473
3561
  width: l.style.width,
3474
3562
  height: l.style.height,
3475
3563
  computedWidth: l.offsetWidth,
3476
3564
  computedHeight: l.offsetHeight,
3477
- transform: d,
3565
+ transform: S,
3478
3566
  pathType: this.entryAnimationEngine.getPathType()
3479
3567
  });
3480
3568
  }
3481
3569
  if (this.idleAnimationEngine) {
3482
- const d = this.entryAnimationEngine.getTiming().duration;
3483
- this.idleAnimationEngine.register(l, h, this.imageElements.length, d);
3570
+ const S = this.entryAnimationEngine.getTiming().duration;
3571
+ this.idleAnimationEngine.register(l, g, this.imageElements.length, S);
3484
3572
  }
3485
- }), r++);
3486
- }, c = () => {
3573
+ }), r++, p());
3574
+ }, v = () => {
3487
3575
  if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
3488
3576
  for (; this.displayQueue.length > 0; ) {
3489
3577
  const l = this.displayQueue.shift();
3490
- l && a(l);
3578
+ l && w(l);
3491
3579
  }
3492
3580
  return;
3493
3581
  }
3494
3582
  this.queueInterval !== null && clearInterval(this.queueInterval), this.queueInterval = window.setInterval(() => {
3495
- if (n !== this.loadGeneration) {
3583
+ if (o !== this.loadGeneration) {
3496
3584
  this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3497
3585
  return;
3498
3586
  }
3499
3587
  if (this.displayQueue.length > 0) {
3500
3588
  const l = this.displayQueue.shift();
3501
- l && a(l);
3589
+ l && w(l);
3502
3590
  }
3503
- r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3591
+ r >= t.length && this.displayQueue.length === 0 && (this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null), m());
3504
3592
  }, this.fullConfig.animation.queue.interval);
3505
3593
  };
3506
3594
  if ("IntersectionObserver" in window && this.containerEl) {
3507
- const l = new IntersectionObserver((u) => {
3508
- u.forEach((h) => {
3509
- h.isIntersecting && (c(), l.disconnect());
3595
+ const l = new IntersectionObserver((g) => {
3596
+ g.forEach((h) => {
3597
+ h.isIntersecting && (v(), l.disconnect());
3510
3598
  });
3511
3599
  }, { threshold: 0.1, rootMargin: "50px" });
3512
3600
  l.observe(this.containerEl);
3513
3601
  } else
3514
- c();
3515
- this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), s.forEach((l, u) => {
3602
+ v();
3603
+ this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), s.forEach((l, g) => {
3516
3604
  const h = document.createElement("div");
3517
3605
  h.className = "fbn-ic-debug-center", h.style.position = "absolute", h.style.width = "12px", h.style.height = "12px", h.style.borderRadius = "50%", h.style.backgroundColor = "red", h.style.border = "2px solid yellow", h.style.zIndex = "9999", h.style.pointerEvents = "none";
3518
- const d = l.x, g = l.y;
3519
- h.style.left = `${d - 6}px`, h.style.top = `${g - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(g)})`, this.containerEl.appendChild(h);
3520
- })), t.forEach((l, u) => {
3606
+ const b = l.x, I = l.y;
3607
+ h.style.left = `${b - 6}px`, h.style.top = `${I - 6}px`, h.title = `Image ${g}: center (${Math.round(b)}, ${Math.round(I)})`, this.containerEl.appendChild(h);
3608
+ })), t.forEach((l, g) => {
3521
3609
  const h = document.createElement("img");
3522
- h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.dragging === !1 && (h.draggable = !1), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
3523
- const d = s[u];
3524
- h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, d.zIndex && (h.style.zIndex = String(d.zIndex)), et(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
3525
- if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
3526
- const g = h.cachedRenderedWidth;
3527
- st(h, this.fullConfig.styling?.hover, i, g), et(h, this.hoverClassName);
3610
+ h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.dragging === !1 && (h.draggable = !1), h.dataset.imageId = String(g), h.dataset.createdFlag = "true";
3611
+ const b = s[g];
3612
+ h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${b.x}px`, h.style.top = `${b.y}px`, b.zIndex && (h.style.zIndex = String(b.zIndex)), et(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
3613
+ if (this.hoveredImage = { element: h, layout: b }, !this.zoomEngine.isInvolved(h)) {
3614
+ const y = h.cachedRenderedWidth;
3615
+ st(h, this.fullConfig.styling?.hover, i, y), et(h, this.hoverClassName);
3616
+ }
3617
+ if (this.callbacks.onImageHover) {
3618
+ const y = { element: h, index: g, url: l, layout: b };
3619
+ this.callbacks.onImageHover(y);
3528
3620
  }
3529
3621
  }), h.addEventListener("mouseleave", () => {
3530
3622
  if (this.hoveredImage = null, !this.zoomEngine.isInvolved(h)) {
3531
- const g = h.cachedRenderedWidth;
3532
- st(h, this.fullConfig.styling?.default, i, g), pt(h, this.hoverClassName), et(h, this.defaultClassName);
3623
+ const y = h.cachedRenderedWidth;
3624
+ st(h, this.fullConfig.styling?.default, i, y), pt(h, this.hoverClassName), et(h, this.defaultClassName);
3625
+ }
3626
+ if (this.callbacks.onImageUnhover) {
3627
+ const y = { element: h, index: g, url: l, layout: b };
3628
+ this.callbacks.onImageUnhover(y);
3533
3629
  }
3534
- }), h.addEventListener("click", (g) => {
3535
- g.stopPropagation(), this.handleImageClick(h, d);
3630
+ }), h.addEventListener("click", (y) => {
3631
+ y.stopPropagation(), this.handleImageClick(h, b);
3536
3632
  }), h.style.opacity = "0", h.style.transition = this.entryAnimationEngine.getTransitionCSS(), h.onload = () => {
3537
- if (n !== this.loadGeneration)
3633
+ if (o !== this.loadGeneration)
3538
3634
  return;
3539
- const g = h.naturalWidth / h.naturalHeight, p = i * g;
3540
- h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${p}`), h.style.width = `${p}px`, h.cachedRenderedWidth = p, h.aspectRatio = g, st(h, this.fullConfig.styling?.default, i, p);
3541
- const b = { x: d.x, y: d.y }, f = { width: p, height: i }, m = this.entryAnimationEngine.calculateStartPosition(
3542
- b,
3543
- f,
3635
+ const y = h.naturalWidth / h.naturalHeight, x = i * y;
3636
+ h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${g}] Called with imageHeight=${i}, renderedWidth=${x}`), h.style.width = `${x}px`, h.cachedRenderedWidth = x, h.aspectRatio = y, st(h, this.fullConfig.styling?.default, i, x);
3637
+ const E = { x: b.x, y: b.y }, F = { width: x, height: i }, R = this.entryAnimationEngine.calculateStartPosition(
3638
+ E,
3639
+ F,
3544
3640
  e,
3545
- u,
3641
+ g,
3546
3642
  t.length
3547
- ), y = this.entryAnimationEngine.calculateStartRotation(d.rotation), E = this.entryAnimationEngine.calculateStartScale(d.scale), v = this.entryAnimationEngine.buildFinalTransform(
3548
- d.rotation,
3549
- d.scale,
3550
- p,
3643
+ ), M = this.entryAnimationEngine.calculateStartRotation(b.rotation), T = this.entryAnimationEngine.calculateStartScale(b.scale), z = this.entryAnimationEngine.buildFinalTransform(
3644
+ b.rotation,
3645
+ b.scale,
3646
+ x,
3551
3647
  i
3552
- ), S = this.entryAnimationEngine.buildStartTransform(
3553
- m,
3554
- b,
3555
- d.rotation,
3556
- d.scale,
3557
- p,
3648
+ ), k = this.entryAnimationEngine.buildStartTransform(
3649
+ R,
3650
+ E,
3651
+ b.rotation,
3652
+ b.scale,
3653
+ x,
3558
3654
  i,
3559
- y,
3560
- E
3655
+ M,
3656
+ T
3561
3657
  );
3562
- this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
3563
- finalPosition: b,
3564
- imageSize: f,
3565
- left: d.x,
3566
- top: d.y,
3567
- finalTransform: v,
3568
- renderedWidth: p,
3658
+ if (this.fullConfig.config.debug?.enabled && g < 3 && console.log(`Image ${g}:`, {
3659
+ finalPosition: E,
3660
+ imageSize: F,
3661
+ left: b.x,
3662
+ top: b.y,
3663
+ finalTransform: z,
3664
+ renderedWidth: x,
3569
3665
  renderedHeight: i
3570
- }), h.style.transform = S, h.dataset.finalTransform = v, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation || E !== d.scale) && (h.dataset.startX = String(m.x), h.dataset.startY = String(m.y), h.dataset.endX = String(b.x), h.dataset.endY = String(b.y), h.dataset.imageWidth = String(p), h.dataset.imageHeight = String(i), h.dataset.rotation = String(d.rotation), h.dataset.scale = String(d.scale), h.dataset.startRotation = String(y), h.dataset.startScale = String(E)), this.displayQueue.push(h);
3571
- }, h.onerror = () => r++, h.src = l;
3666
+ }), h.style.transform = k, h.dataset.finalTransform = z, h.dataset.startX = String(R.x), h.dataset.startY = String(R.y), h.dataset.endX = String(E.x), h.dataset.endY = String(E.y), h.dataset.imageWidth = String(x), h.dataset.imageHeight = String(i), h.dataset.rotation = String(b.rotation), h.dataset.scale = String(b.scale), h.dataset.startRotation = String(M), h.dataset.startScale = String(T), a++, this.callbacks.onImageLoaded) {
3667
+ const D = {
3668
+ element: h,
3669
+ url: l,
3670
+ index: g,
3671
+ totalImages: t.length,
3672
+ loadTime: performance.now() - (f.get(g) ?? performance.now())
3673
+ };
3674
+ this.callbacks.onImageLoaded(D);
3675
+ }
3676
+ if (this.callbacks.onLoadProgress) {
3677
+ const D = {
3678
+ loaded: a,
3679
+ failed: c,
3680
+ total: t.length,
3681
+ percent: (a + c) / t.length * 100
3682
+ };
3683
+ this.callbacks.onLoadProgress(D);
3684
+ }
3685
+ this.displayQueue.push(h);
3686
+ };
3687
+ const I = () => {
3688
+ if (o === this.loadGeneration) {
3689
+ if (c++, this.callbacks.onImageError) {
3690
+ const y = { url: l, index: g, totalImages: t.length };
3691
+ this.callbacks.onImageError(y);
3692
+ }
3693
+ if (this.callbacks.onLoadProgress) {
3694
+ const y = {
3695
+ loaded: a,
3696
+ failed: c,
3697
+ total: t.length,
3698
+ percent: (a + c) / t.length * 100
3699
+ };
3700
+ this.callbacks.onLoadProgress(y);
3701
+ }
3702
+ r++, p();
3703
+ }
3704
+ };
3705
+ h.onerror = () => I(), (async () => {
3706
+ let y = l;
3707
+ if (this.callbacks.onBeforeImageLoad) {
3708
+ const x = { url: l, index: g, totalImages: t.length }, E = await this.callbacks.onBeforeImageLoad(x);
3709
+ if (E)
3710
+ if (E.fetch !== void 0) {
3711
+ const F = E.url ?? l;
3712
+ try {
3713
+ const M = await (await fetch(F, E.fetch)).blob(), T = URL.createObjectURL(M);
3714
+ y = T;
3715
+ const z = h.onload;
3716
+ h.onload = (k) => {
3717
+ URL.revokeObjectURL(T), z?.call(h, k);
3718
+ };
3719
+ } catch {
3720
+ I();
3721
+ return;
3722
+ }
3723
+ } else E.url && (y = E.url);
3724
+ }
3725
+ d === 0 && (d = performance.now()), f.set(g, performance.now()), h.src = y;
3726
+ })();
3572
3727
  });
3573
3728
  }
3574
3729
  async handleImageClick(t, i) {
3575
3730
  if (!this.containerEl) return;
3576
- const e = this.zoomEngine.isFocused(t), n = {
3731
+ const e = this.zoomEngine.isFocused(t), o = {
3577
3732
  width: this.containerEl.offsetWidth,
3578
3733
  height: this.containerEl.offsetHeight
3579
3734
  };
@@ -3582,7 +3737,15 @@ let ni = class {
3582
3737
  else {
3583
3738
  this.idleAnimationEngine?.pauseForImage(t);
3584
3739
  const s = t.dataset.imageId;
3585
- this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, this.swipeEngine?.enable(), this.containerEl?.focus({ preventScroll: !0 }), await this.zoomEngine.focusImage(t, n, i), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex), this.showNavButtons(), this.showFocusIndicator();
3740
+ if (this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, this.swipeEngine?.enable(), this.containerEl?.focus({ preventScroll: !0 }), await this.zoomEngine.focusImage(t, o, i), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex), this.showNavButtons(), this.showFocusIndicator(), this.callbacks.onImageFocus && this.currentFocusIndex !== null) {
3741
+ const r = this.imageLoader.imageURLs(), a = {
3742
+ element: t,
3743
+ index: this.currentFocusIndex,
3744
+ url: r[this.currentFocusIndex] ?? "",
3745
+ layout: i
3746
+ };
3747
+ this.callbacks.onImageFocus(a);
3748
+ }
3586
3749
  }
3587
3750
  }
3588
3751
  /**
@@ -3625,7 +3788,7 @@ let ni = class {
3625
3788
  this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.prevButtonElAutoCreated && this.prevButtonEl && (this.prevButtonEl.remove(), this.prevButtonEl = null), this.nextButtonElAutoCreated && this.nextButtonEl && (this.nextButtonEl.remove(), this.nextButtonEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy(), this.idleAnimationEngine?.stopAll(), this.idleAnimationEngine = null;
3626
3789
  }
3627
3790
  };
3628
- const ai = Ht({
3791
+ const ai = kt({
3629
3792
  name: "ImageCloud",
3630
3793
  props: {
3631
3794
  options: {
@@ -3633,27 +3796,27 @@ const ai = Ht({
3633
3796
  required: !0
3634
3797
  }
3635
3798
  },
3636
- setup(o, { expose: t }) {
3637
- const i = It(null), e = It(null);
3638
- function n() {
3799
+ setup(n, { expose: t }) {
3800
+ const i = St(null), e = St(null);
3801
+ function o() {
3639
3802
  if (!i.value) return;
3640
3803
  e.value?.destroy();
3641
- const s = new ni({
3804
+ const s = new oi({
3642
3805
  container: i.value,
3643
- ...o.options
3806
+ ...n.options
3644
3807
  });
3645
3808
  e.value = s, s.init().catch((r) => {
3646
3809
  console.error("ImageCloud init failed:", r);
3647
3810
  });
3648
3811
  }
3649
- return Nt(() => {
3650
- n();
3651
- }), kt(() => {
3812
+ return Ht(() => {
3813
+ o();
3814
+ }), Nt(() => {
3652
3815
  e.value?.destroy(), e.value = null;
3653
3816
  }), Bt(
3654
- () => o.options,
3817
+ () => n.options,
3655
3818
  () => {
3656
- n();
3819
+ o();
3657
3820
  },
3658
3821
  { deep: !0 }
3659
3822
  ), t({ instance: e }), () => jt("div", {