@frybynite/image-cloud 0.8.1 → 0.8.2

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.
@@ -51,18 +51,20 @@ const mt = Object.freeze({
51
51
  shadow: "none"
52
52
  })
53
53
  }), Ht = Object.freeze({
54
+ tightness: 1
55
+ }), Nt = Object.freeze({
54
56
  rows: 1,
55
57
  amplitude: 100,
56
58
  frequency: 2,
57
59
  phaseShift: 0,
58
60
  synchronization: "offset"
59
61
  // Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
60
- }), Nt = Object.freeze({
61
- spacing: 0
62
62
  }), jt = Object.freeze({
63
+ spacing: 0
64
+ }), kt = Object.freeze({
63
65
  mobile: Object.freeze({ maxWidth: 767 }),
64
66
  tablet: Object.freeze({ maxWidth: 1199 })
65
- }), kt = Object.freeze({
67
+ }), Wt = Object.freeze({
66
68
  mode: "adaptive",
67
69
  // Default to adaptive sizing
68
70
  minSize: 50,
@@ -74,15 +76,15 @@ const mt = Object.freeze({
74
76
  // No variance by default
75
77
  max: 1
76
78
  })
77
- }), Wt = Object.freeze({
79
+ }), Gt = Object.freeze({
78
80
  mode: "none",
79
81
  range: Object.freeze({
80
82
  min: -15,
81
83
  max: 15
82
84
  })
83
85
  }), Ot = Object.freeze({
84
- sizing: kt,
85
- rotation: Wt
86
+ sizing: Wt,
87
+ rotation: Gt
86
88
  }), Dt = Object.freeze({
87
89
  validateUrls: !0,
88
90
  validationTimeout: 5e3,
@@ -92,7 +94,7 @@ const mt = Object.freeze({
92
94
  enabled: !1,
93
95
  centers: !1,
94
96
  loaders: !1
95
- }), x = Object.freeze({
97
+ }), E = Object.freeze({
96
98
  // Loader configuration (always an array, composite behavior is implicit)
97
99
  loaders: [],
98
100
  // Shared loader settings and debug config
@@ -107,7 +109,7 @@ const mt = Object.freeze({
107
109
  algorithm: "radial",
108
110
  scaleDecay: 0,
109
111
  // No decay by default (0-1 for radial/spiral)
110
- responsive: jt,
112
+ responsive: kt,
111
113
  targetCoverage: 0.6,
112
114
  // Target 60% of container area
113
115
  densityFactor: 1,
@@ -218,7 +220,7 @@ function Z(n, t) {
218
220
  const i = { ...n };
219
221
  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;
220
222
  }
221
- function Gt(n, t) {
223
+ function qt(n, t) {
222
224
  if (!t) return { ...n };
223
225
  const i = Z(n.default, t.default), e = Z(
224
226
  Z(i, n.hover),
@@ -233,7 +235,7 @@ function Gt(n, t) {
233
235
  focused: o
234
236
  };
235
237
  }
236
- function qt(n, t) {
238
+ function Xt(n, t) {
237
239
  if (!t) return { ...n };
238
240
  const i = { ...n };
239
241
  if (t.sizing !== void 0 && (i.sizing = {
@@ -252,7 +254,7 @@ function qt(n, t) {
252
254
  }
253
255
  return i;
254
256
  }
255
- function Xt(n) {
257
+ function Yt(n) {
256
258
  const t = n.layout?.rotation;
257
259
  if (t && "enabled" in t)
258
260
  return {
@@ -262,7 +264,7 @@ function Xt(n) {
262
264
  }
263
265
  };
264
266
  }
265
- function Yt(n) {
267
+ function Bt(n) {
266
268
  const t = n.layout?.sizing?.variance;
267
269
  if (t)
268
270
  return {
@@ -273,8 +275,8 @@ function Yt(n) {
273
275
  }
274
276
  };
275
277
  }
276
- function Bt(n = {}) {
277
- const t = Xt(n), i = Yt(n);
278
+ function Jt(n = {}) {
279
+ const t = Yt(n), i = Bt(n);
278
280
  let e = n.image;
279
281
  (t || i) && (e = {
280
282
  ...i || {},
@@ -298,69 +300,69 @@ function Bt(n = {}) {
298
300
  }, s = {
299
301
  loaders: o,
300
302
  config: r,
301
- image: qt(Ot, e),
302
- layout: { ...x.layout },
303
- animation: { ...x.animation },
304
- interaction: { ...x.interaction },
305
- rendering: { ...x.rendering },
306
- styling: Gt(zt, n.styling)
303
+ image: Xt(Ot, e),
304
+ layout: { ...E.layout },
305
+ animation: { ...E.animation },
306
+ interaction: { ...E.interaction },
307
+ rendering: { ...E.rendering },
308
+ styling: qt(zt, n.styling)
307
309
  };
308
310
  if (n.layout && (s.layout = {
309
- ...x.layout,
311
+ ...E.layout,
310
312
  ...n.layout
311
313
  }, n.layout.responsive && (s.layout.responsive = {
312
- ...x.layout.responsive,
313
- mobile: n.layout.responsive.mobile ? { ...x.layout.responsive.mobile, ...n.layout.responsive.mobile } : x.layout.responsive.mobile,
314
- tablet: n.layout.responsive.tablet ? { ...x.layout.responsive.tablet, ...n.layout.responsive.tablet } : x.layout.responsive.tablet
314
+ ...E.layout.responsive,
315
+ mobile: n.layout.responsive.mobile ? { ...E.layout.responsive.mobile, ...n.layout.responsive.mobile } : E.layout.responsive.mobile,
316
+ tablet: n.layout.responsive.tablet ? { ...E.layout.responsive.tablet, ...n.layout.responsive.tablet } : E.layout.responsive.tablet
315
317
  }), n.layout.spacing && (s.layout.spacing = {
316
- ...x.layout.spacing,
318
+ ...E.layout.spacing,
317
319
  ...n.layout.spacing
318
320
  })), n.animation && (s.animation = {
319
- ...x.animation,
321
+ ...E.animation,
320
322
  ...n.animation
321
323
  }, n.animation.easing && (s.animation.easing = {
322
- ...x.animation.easing,
324
+ ...E.animation.easing,
323
325
  ...n.animation.easing
324
326
  }), n.animation.queue && (s.animation.queue = {
325
- ...x.animation.queue,
327
+ ...E.animation.queue,
326
328
  ...n.animation.queue
327
329
  }), n.animation.performance && (s.animation.performance = {
328
- ...x.animation.performance,
330
+ ...E.animation.performance,
329
331
  ...n.animation.performance
330
332
  }), n.animation.entry && (s.animation.entry = {
331
- ...x.animation.entry,
333
+ ...E.animation.entry,
332
334
  ...n.animation.entry,
333
335
  start: n.animation.entry.start ? {
334
- ...x.animation.entry.start,
336
+ ...E.animation.entry.start,
335
337
  ...n.animation.entry.start,
336
- circular: n.animation.entry.start.circular ? { ...x.animation.entry.start.circular, ...n.animation.entry.start.circular } : x.animation.entry.start.circular
337
- } : x.animation.entry.start,
338
- timing: n.animation.entry.timing ? { ...x.animation.entry.timing, ...n.animation.entry.timing } : x.animation.entry.timing,
339
- path: n.animation.entry.path ? { ...vt, ...n.animation.entry.path } : x.animation.entry.path,
340
- rotation: n.animation.entry.rotation ? { ...wt, ...n.animation.entry.rotation } : x.animation.entry.rotation,
341
- scale: n.animation.entry.scale ? { ...xt, ...n.animation.entry.scale } : x.animation.entry.scale
338
+ circular: n.animation.entry.start.circular ? { ...E.animation.entry.start.circular, ...n.animation.entry.start.circular } : E.animation.entry.start.circular
339
+ } : E.animation.entry.start,
340
+ timing: n.animation.entry.timing ? { ...E.animation.entry.timing, ...n.animation.entry.timing } : E.animation.entry.timing,
341
+ path: n.animation.entry.path ? { ...vt, ...n.animation.entry.path } : E.animation.entry.path,
342
+ rotation: n.animation.entry.rotation ? { ...wt, ...n.animation.entry.rotation } : E.animation.entry.rotation,
343
+ scale: n.animation.entry.scale ? { ...xt, ...n.animation.entry.scale } : E.animation.entry.scale
342
344
  })), n.interaction && (s.interaction = {
343
- ...x.interaction,
345
+ ...E.interaction,
344
346
  ...n.interaction
345
347
  }, n.interaction.focus && (s.interaction.focus = {
346
- ...x.interaction.focus,
348
+ ...E.interaction.focus,
347
349
  ...n.interaction.focus
348
350
  }), n.interaction.navigation && (s.interaction.navigation = {
349
- ...x.interaction.navigation,
351
+ ...E.interaction.navigation,
350
352
  ...n.interaction.navigation
351
353
  }), n.interaction.gestures && (s.interaction.gestures = {
352
- ...x.interaction.gestures,
354
+ ...E.interaction.gestures,
353
355
  ...n.interaction.gestures
354
356
  })), n.rendering && (s.rendering = {
355
- ...x.rendering,
357
+ ...E.rendering,
356
358
  ...n.rendering
357
359
  }, n.rendering.responsive && (s.rendering.responsive = {
358
- ...x.rendering.responsive,
360
+ ...E.rendering.responsive,
359
361
  ...n.rendering.responsive,
360
- breakpoints: n.rendering.responsive.breakpoints ? { ...x.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : x.rendering.responsive.breakpoints,
361
- mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : x.rendering.responsive.mobileDetection
362
+ breakpoints: n.rendering.responsive.breakpoints ? { ...E.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : E.rendering.responsive.breakpoints,
363
+ mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : E.rendering.responsive.mobileDetection
362
364
  }), n.rendering.ui && (s.rendering.ui = {
363
- ...x.rendering.ui,
365
+ ...E.rendering.ui,
364
366
  ...n.rendering.ui
365
367
  })), s.config.debug = {
366
368
  ...$t,
@@ -376,16 +378,16 @@ function Bt(n = {}) {
376
378
  }
377
379
  return s;
378
380
  }
379
- function Jt(n, t) {
381
+ function Vt(n, t) {
380
382
  return { ...n ? Tt[n] : Tt.playful, ...t };
381
383
  }
382
- function Vt(n, t) {
384
+ function Kt(n, t) {
383
385
  return { ...n ? At[n] : At.gentle, ...t };
384
386
  }
385
- function Kt(n, t) {
387
+ function Zt(n, t) {
386
388
  return { ...n ? Ct[n] : Ct.gentle, ...t };
387
389
  }
388
- class Zt {
390
+ class Qt {
389
391
  constructor(t) {
390
392
  this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
391
393
  }
@@ -544,31 +546,31 @@ class Zt {
544
546
  function V(n, t, i) {
545
547
  return n + (t - n) * i;
546
548
  }
547
- function Qt(n, t, i, e) {
548
- const { overshoot: o, bounces: a, decayRatio: r } = e, s = i.x - t.x, c = i.y - t.y, l = te(a, r);
549
- let u = 0, h = 0, d = 1, g = o, b = !1;
550
- for (let f = 0; f < l.length; f++)
551
- if (n <= l[f].time) {
552
- h = f === 0 ? 0 : l[f - 1].time, d = l[f].time, g = l[f].overshoot, b = l[f].isOvershoot;
549
+ function te(n, t, i, e) {
550
+ const { overshoot: o, bounces: a, decayRatio: r } = e, s = i.x - t.x, c = i.y - t.y, l = ee(a, r);
551
+ let u = 0, h = 0, d = 1, f = o, b = !1;
552
+ for (let g = 0; g < l.length; g++)
553
+ if (n <= l[g].time) {
554
+ h = g === 0 ? 0 : l[g - 1].time, d = l[g].time, f = l[g].overshoot, b = l[g].isOvershoot;
553
555
  break;
554
556
  }
555
- const m = (n - h) / (d - h);
557
+ const p = (n - h) / (d - h);
556
558
  if (b)
557
- u = 1 + g * ot(m);
559
+ u = 1 + f * ot(p);
558
560
  else if (h === 0)
559
- u = ot(m);
561
+ u = ot(p);
560
562
  else {
561
- const p = 1 + (l.find(
562
- (y, v) => y.time > h && v > 0 && l[v - 1].isOvershoot
563
- )?.overshoot || g);
564
- u = V(p, 1, ot(m));
563
+ const m = 1 + (l.find(
564
+ (y, w) => y.time > h && w > 0 && l[w - 1].isOvershoot
565
+ )?.overshoot || f);
566
+ u = V(m, 1, ot(p));
565
567
  }
566
568
  return {
567
569
  x: t.x + s * u,
568
570
  y: t.y + c * u
569
571
  };
570
572
  }
571
- function te(n, t) {
573
+ function ee(n, t) {
572
574
  const i = [];
573
575
  let e = 0.6;
574
576
  i.push({ time: e, overshoot: 0, isOvershoot: !1 });
@@ -578,12 +580,12 @@ function te(n, t) {
578
580
  e += r, i.push({ time: e, overshoot: o, isOvershoot: !0 }), e += r, i.push({ time: e, overshoot: o * t, isOvershoot: !1 }), o *= t;
579
581
  return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
580
582
  }
581
- function ee(n, t, i, e) {
583
+ function ie(n, t, i, e) {
582
584
  const { stiffness: o, damping: a, mass: r, oscillations: s } = e, c = i.x - t.x, l = i.y - t.y, u = Math.sqrt(o / r), h = a / (2 * Math.sqrt(o * r));
583
585
  let d;
584
586
  if (h < 1) {
585
- const g = u * Math.sqrt(1 - h * h), b = Math.exp(-h * u * n * 3), m = Math.cos(g * n * s * Math.PI);
586
- d = 1 - b * m;
587
+ const f = u * Math.sqrt(1 - h * h), b = Math.exp(-h * u * n * 3), p = Math.cos(f * n * s * Math.PI);
588
+ d = 1 - b * p;
587
589
  } else
588
590
  d = 1 - Math.exp(-u * n * 3);
589
591
  return d = Math.max(0, Math.min(d, 1.3)), {
@@ -591,44 +593,44 @@ function ee(n, t, i, e) {
591
593
  y: t.y + l * d
592
594
  };
593
595
  }
594
- function ie(n, t, i, e) {
595
- const { amplitude: o, frequency: a, decay: r, decayRate: s, 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, b = a * Math.PI * 2 * n + c, m = r ? Math.pow(1 - n, s) : 1, f = o * Math.sin(b) * m, p = ne(n);
596
+ function ne(n, t, i, e) {
597
+ const { amplitude: o, frequency: a, decay: r, decayRate: s, 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, f = h > 0 ? l / h : 1, b = a * Math.PI * 2 * n + c, p = r ? Math.pow(1 - n, s) : 1, g = o * Math.sin(b) * p, m = oe(n);
596
598
  return {
597
- x: V(t.x, i.x, p) + f * d,
598
- y: V(t.y, i.y, p) + f * g
599
+ x: V(t.x, i.x, m) + g * d,
600
+ y: V(t.y, i.y, m) + g * f
599
601
  };
600
602
  }
601
603
  function ot(n) {
602
604
  return 1 - (1 - n) * (1 - n);
603
605
  }
604
- function ne(n) {
606
+ function oe(n) {
605
607
  return 1 - Math.pow(1 - n, 3);
606
608
  }
607
- function oe(n, t, i) {
609
+ function se(n, t, i) {
608
610
  const { amplitude: e, frequency: o, decay: a } = i, r = Math.sin(n * o * Math.PI * 2), s = a ? Math.pow(1 - n, 2) : 1, c = e * r * s;
609
611
  return t + c;
610
612
  }
611
- function se(n, t, i) {
613
+ function ae(n, t, i) {
612
614
  const { overshoot: e, bounces: o } = i, a = [];
613
615
  a.push({ time: 0.5, scale: e });
614
616
  let r = e;
615
617
  const s = 0.5, l = 0.5 / (o * 2);
616
618
  let u = 0.5;
617
619
  for (let d = 0; d < o; d++) {
618
- const g = 1 - (r - 1) * s;
619
- u += l, a.push({ time: u, scale: g }), r = 1 + (r - 1) * s * s, u += l, d < o - 1 && a.push({ time: u, scale: r });
620
+ const f = 1 - (r - 1) * s;
621
+ u += l, a.push({ time: u, scale: f }), r = 1 + (r - 1) * s * s, u += l, d < o - 1 && a.push({ time: u, scale: r });
620
622
  }
621
623
  a.push({ time: 1, scale: 1 });
622
624
  let h = 1;
623
625
  for (let d = 0; d < a.length; d++)
624
626
  if (n <= a[d].time) {
625
- const g = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, m = (n - g) / (a[d].time - g), f = ot(m);
626
- h = b + (a[d].scale - b) * f;
627
+ const f = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, p = (n - f) / (a[d].time - f), g = ot(p);
628
+ h = b + (a[d].scale - b) * g;
627
629
  break;
628
630
  }
629
631
  return h * t;
630
632
  }
631
- function ae(n) {
633
+ function re(n) {
632
634
  const {
633
635
  element: t,
634
636
  startPosition: i,
@@ -642,60 +644,60 @@ function ae(n) {
642
644
  onComplete: u,
643
645
  rotationConfig: h,
644
646
  startRotation: d,
645
- scaleConfig: g,
647
+ scaleConfig: f,
646
648
  startScale: b
647
- } = n, m = o.type, f = d !== void 0 && d !== c, p = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = f || p, w = b !== void 0 && b !== l, S = g?.mode === "pop", E = g?.pop || { overshoot: 1.2, bounces: 1 };
648
- if ((m === "linear" || m === "arc") && !v && !(w || S)) {
649
+ } = n, p = o.type, g = d !== void 0 && d !== c, m = h?.mode === "wobble", y = h?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, w = g || m, v = b !== void 0 && b !== l, R = f?.mode === "pop", x = f?.pop || { overshoot: 1.2, bounces: 1 };
650
+ if ((p === "linear" || p === "arc") && !w && !(v || R)) {
649
651
  u && u();
650
652
  return;
651
653
  }
652
- const M = performance.now(), F = -r / 2, _ = -s / 2;
653
- function U(X) {
654
- const N = X - M, T = Math.min(N / a, 1);
655
- let O;
656
- switch (m) {
654
+ const z = performance.now(), L = -r / 2, _ = -s / 2;
655
+ function O(H) {
656
+ const N = H - z, T = Math.min(N / a, 1);
657
+ let D;
658
+ switch (p) {
657
659
  case "bounce": {
658
- const D = Jt(
660
+ const j = Vt(
659
661
  o.bouncePreset,
660
662
  o.bounce
661
663
  );
662
- O = Qt(T, i, e, D);
664
+ D = te(T, i, e, j);
663
665
  break;
664
666
  }
665
667
  case "elastic": {
666
- const D = Vt(
668
+ const j = Kt(
667
669
  o.elasticPreset,
668
670
  o.elastic
669
671
  );
670
- O = ee(T, i, e, D);
672
+ D = ie(T, i, e, j);
671
673
  break;
672
674
  }
673
675
  case "wave": {
674
- const D = Kt(
676
+ const j = Zt(
675
677
  o.wavePreset,
676
678
  o.wave
677
679
  );
678
- O = ie(T, i, e, D);
680
+ D = ne(T, i, e, j);
679
681
  break;
680
682
  }
681
683
  default:
682
- O = {
684
+ D = {
683
685
  x: V(i.x, e.x, T),
684
686
  y: V(i.y, e.y, T)
685
687
  };
686
688
  }
687
- const k = O.x - e.x, H = O.y - e.y;
688
- let C;
689
- p ? C = oe(T, c, y) : f ? C = V(d, c, T) : C = c;
689
+ const G = D.x - e.x, U = D.y - e.y;
690
+ let M;
691
+ m ? M = se(T, c, y) : g ? M = V(d, c, T) : M = c;
690
692
  let A;
691
- S ? A = se(T, l, E) : w ? A = V(b, l, T) : A = l, t.style.transform = `translate(${F}px, ${_}px) translate(${k}px, ${H}px) rotate(${C}deg) scale(${A})`, T < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${F}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
693
+ R ? A = ae(T, l, x) : v ? A = V(b, l, T) : A = l, t.style.transform = `translate(${L}px, ${_}px) translate(${G}px, ${U}px) rotate(${M}deg) scale(${A})`, T < 1 ? requestAnimationFrame(O) : (t.style.transform = `translate(${L}px, ${_}px) rotate(${c}deg) scale(${l})`, u && u());
692
694
  }
693
- requestAnimationFrame(U);
695
+ requestAnimationFrame(O);
694
696
  }
695
- function re(n) {
697
+ function ce(n) {
696
698
  return n === "bounce" || n === "elastic" || n === "wave";
697
699
  }
698
- const ce = {
700
+ const le = {
699
701
  radial: "center",
700
702
  spiral: "center",
701
703
  grid: "top",
@@ -704,7 +706,7 @@ const ce = {
704
706
  wave: "left",
705
707
  honeycomb: "center"
706
708
  };
707
- class le {
709
+ class he {
708
710
  constructor(t, i) {
709
711
  this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || vt, this.rotationConfig = t.rotation || wt, this.scaleConfig = t.scale || xt;
710
712
  }
@@ -712,7 +714,7 @@ class le {
712
714
  * Get the effective start position, considering layout-aware defaults
713
715
  */
714
716
  resolveStartPosition() {
715
- return this.config.start.position ? this.config.start.position : ce[this.layoutAlgorithm] || "nearest-edge";
717
+ return this.config.start.position ? this.config.start.position : le[this.layoutAlgorithm] || "nearest-edge";
716
718
  }
717
719
  /**
718
720
  * Calculate the starting position for an image's entry animation
@@ -751,8 +753,8 @@ class le {
751
753
  */
752
754
  calculateNearestEdge(t, i, e, o) {
753
755
  const a = t.x, r = t.y, s = a, c = e.width - a, l = r, u = e.height - r, h = Math.min(s, c, l, u);
754
- let d = t.x, g = t.y;
755
- return h === s ? d = -(i.width + o) : h === c ? d = e.width + o : h === l ? g = -(i.height + o) : g = e.height + o, { x: d, y: g };
756
+ let d = t.x, f = t.y;
757
+ return h === s ? d = -(i.width + o) : h === c ? d = e.width + o : h === l ? f = -(i.height + o) : f = e.height + o, { x: d, y: f };
756
758
  }
757
759
  /**
758
760
  * Calculate start position from a specific edge
@@ -802,16 +804,16 @@ class le {
802
804
  let c;
803
805
  const l = r.radius || "120%";
804
806
  if (typeof l == "string" && l.endsWith("%")) {
805
- const m = parseFloat(l) / 100;
807
+ const p = parseFloat(l) / 100;
806
808
  c = Math.sqrt(
807
809
  e.width ** 2 + e.height ** 2
808
- ) * m / 2;
810
+ ) * p / 2;
809
811
  } else
810
812
  c = typeof l == "number" ? l : 500;
811
813
  let u;
812
814
  s === "even" ? u = o / a * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
813
- const h = e.width / 2, d = e.height / 2, g = h + Math.cos(u) * c, b = d + Math.sin(u) * c;
814
- return { x: g, y: b };
815
+ const h = e.width / 2, d = e.height / 2, f = h + Math.cos(u) * c, b = d + Math.sin(u) * c;
816
+ return { x: f, y: b };
815
817
  }
816
818
  /**
817
819
  * Get animation parameters for an image
@@ -831,8 +833,8 @@ class le {
831
833
  * Uses pixel-based centering offset for reliable cross-browser behavior
832
834
  */
833
835
  buildStartTransform(t, i, e, o, a, r, s, c) {
834
- const l = t.x - i.x, u = t.y - i.y, h = s !== void 0 ? s : e, d = c !== void 0 ? c : o, g = a !== void 0 ? -a / 2 : 0, b = r !== void 0 ? -r / 2 : 0, m = a !== void 0 ? `translate(${g}px, ${b}px)` : "translate(-50%, -50%)";
835
- return t.useScale ? `${m} translate(${l}px, ${u}px) rotate(${h}deg) scale(0)` : `${m} translate(${l}px, ${u}px) rotate(${h}deg) scale(${d})`;
836
+ const l = t.x - i.x, u = t.y - i.y, h = s !== void 0 ? s : e, d = c !== void 0 ? c : o, f = a !== void 0 ? -a / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = a !== void 0 ? `translate(${f}px, ${b}px)` : "translate(-50%, -50%)";
837
+ return t.useScale ? `${p} translate(${l}px, ${u}px) rotate(${h}deg) scale(0)` : `${p} translate(${l}px, ${u}px) rotate(${h}deg) scale(${d})`;
836
838
  }
837
839
  /**
838
840
  * Build the final CSS transform string
@@ -857,7 +859,7 @@ class le {
857
859
  * Check if the current path type requires JavaScript animation
858
860
  */
859
861
  requiresJSAnimation() {
860
- return re(this.pathConfig.type);
862
+ return ce(this.pathConfig.type);
861
863
  }
862
864
  /**
863
865
  * Get the path configuration
@@ -1048,7 +1050,7 @@ class le {
1048
1050
  return 1 - (1 - t) * (1 - t);
1049
1051
  }
1050
1052
  }
1051
- class he {
1053
+ class de {
1052
1054
  constructor(t, i = {}) {
1053
1055
  this.config = t, this.imageConfig = i;
1054
1056
  }
@@ -1060,17 +1062,17 @@ class he {
1060
1062
  * @returns Array of layout objects with position, rotation, scale
1061
1063
  */
1062
1064
  generate(t, i, e = {}) {
1063
- const o = [], { width: a, height: r } = i, s = 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, b = d !== 1 || g !== 1, f = c * 1.5 / 2, p = c / 2, y = a - s - f, v = r - s - p, w = s + f, S = s + p;
1064
- for (let E = 0; E < t; E++) {
1065
- const I = this.random(w, y), M = this.random(S, v), F = l === "random" ? this.random(u, h) : 0, _ = b ? this.random(d, g) : 1, U = c * _, X = {
1066
- id: E,
1065
+ const o = [], { width: a, height: r } = i, s = 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, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, g = c * 1.5 / 2, m = c / 2, y = a - s - g, w = r - s - m, v = s + g, R = s + m;
1066
+ for (let x = 0; x < t; x++) {
1067
+ const I = this.random(v, y), z = this.random(R, w), L = l === "random" ? this.random(u, h) : 0, _ = b ? this.random(d, f) : 1, O = c * _, H = {
1068
+ id: x,
1067
1069
  x: I,
1068
- y: M,
1069
- rotation: F,
1070
+ y: z,
1071
+ rotation: L,
1070
1072
  scale: _,
1071
- baseSize: U
1073
+ baseSize: O
1072
1074
  };
1073
- o.push(X);
1075
+ o.push(H);
1074
1076
  }
1075
1077
  return o;
1076
1078
  }
@@ -1084,7 +1086,7 @@ class he {
1084
1086
  return Math.random() * (i - t) + t;
1085
1087
  }
1086
1088
  }
1087
- class de {
1089
+ class ue {
1088
1090
  constructor(t, i = {}) {
1089
1091
  this.config = t, this.imageConfig = i;
1090
1092
  }
@@ -1096,47 +1098,53 @@ class de {
1096
1098
  * @returns Array of layout objects with position, rotation, scale
1097
1099
  */
1098
1100
  generate(t, i, e = {}) {
1099
- const o = [], { width: a, height: r } = i, s = 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, b = this.config.scaleDecay ?? 0, m = e.fixedHeight ?? s, f = a / 2, p = r / 2, y = Math.ceil(Math.sqrt(t));
1101
+ const o = [], { width: a, height: r } = i, s = 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, f = h !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = {
1102
+ ...Ht,
1103
+ ...this.config.radial
1104
+ }, g = e.fixedHeight ?? s, m = a / 2, y = r / 2, w = Math.ceil(Math.sqrt(t)), v = this.config.spacing.padding ?? 50, R = Math.max(g * 0.8, Math.min(
1105
+ m - v - g / 2,
1106
+ y - v - g / 2
1107
+ ));
1100
1108
  if (t > 0) {
1101
- const S = g ? this.random(h, d) : 1, E = m * S;
1109
+ const z = f ? this.random(h, d) : 1, L = g * z;
1102
1110
  o.push({
1103
1111
  id: 0,
1104
- x: f,
1105
- y: p,
1112
+ x: m,
1113
+ y,
1106
1114
  rotation: c === "random" ? this.random(l * 0.33, u * 0.33) : 0,
1107
1115
  // Less rotation for center
1108
- scale: S,
1109
- baseSize: E,
1116
+ scale: z,
1117
+ baseSize: L,
1110
1118
  zIndex: 100
1111
1119
  // Center image is highest
1112
1120
  });
1113
1121
  }
1114
- let v = 1, w = 1;
1115
- for (; v < t; ) {
1116
- const S = w / y, E = b > 0 ? 1 - S * b * 0.5 : 1, I = w * (m * 0.8), M = I * 1.5, F = Math.PI * (3 * (M + I) - Math.sqrt((3 * M + I) * (M + 3 * I))), _ = this.estimateWidth(m), U = Math.floor(F / (_ * 0.7));
1117
- if (U === 0) {
1118
- w++;
1122
+ let x = 1, I = 1;
1123
+ for (; x < t; ) {
1124
+ const z = I / w, L = b > 0 ? 1 - z * b * 0.5 : 1, _ = Math.max(g * 0.8, R / w * 1.5 / p.tightness), O = I * _, H = O * 1.5, N = Math.PI * (3 * (H + O) - Math.sqrt((3 * H + O) * (H + 3 * O))), T = this.estimateWidth(g), D = Math.floor(N / (T * 0.7));
1125
+ if (D === 0) {
1126
+ I++;
1119
1127
  continue;
1120
1128
  }
1121
- const X = 2 * Math.PI / U, N = w * (20 * Math.PI / 180);
1122
- for (let T = 0; T < U && v < t; T++) {
1123
- const O = T * X + N, k = g ? this.random(h, d) : 1, H = E * k, C = m * H;
1124
- let A = f + Math.cos(O) * M, D = p + Math.sin(O) * I;
1125
- const $ = this.config.spacing.padding ?? 50, P = C * 1.5 / 2, L = C / 2;
1126
- A - P < $ ? A = $ + P : A + P > a - $ && (A = a - $ - P), D - L < $ ? D = $ + L : D + L > r - $ && (D = r - $ - L);
1127
- const W = c === "random" ? this.random(l, u) : 0;
1129
+ const G = 2 * Math.PI / D, U = I * (20 * Math.PI / 180);
1130
+ for (let M = 0; M < D && x < t; M++) {
1131
+ const A = M * G + U, j = f ? this.random(h, d) : 1, X = L * j, C = g * X;
1132
+ let $ = m + Math.cos(A) * H, F = y + Math.sin(A) * O;
1133
+ const P = C * 1.5 / 2, k = C / 2;
1134
+ $ - P < v ? $ = v + P : $ + P > a - v && ($ = a - v - P), F - k < v ? F = v + k : F + k > r - v && (F = r - v - k);
1135
+ const B = c === "random" ? this.random(l, u) : 0;
1128
1136
  o.push({
1129
- id: v,
1130
- x: A,
1131
- y: D,
1132
- rotation: W,
1133
- scale: H,
1137
+ id: x,
1138
+ x: $,
1139
+ y: F,
1140
+ rotation: B,
1141
+ scale: X,
1134
1142
  baseSize: C,
1135
- zIndex: Math.max(1, 100 - w)
1143
+ zIndex: Math.max(1, 100 - I)
1136
1144
  // Outer rings have lower z-index
1137
- }), v++;
1145
+ }), x++;
1138
1146
  }
1139
- w++;
1147
+ I++;
1140
1148
  }
1141
1149
  return o;
1142
1150
  }
@@ -1159,7 +1167,7 @@ class de {
1159
1167
  return Math.random() * (i - t) + t;
1160
1168
  }
1161
1169
  }
1162
- const ue = {
1170
+ const ge = {
1163
1171
  columns: "auto",
1164
1172
  rows: "auto",
1165
1173
  stagger: "none",
@@ -1187,7 +1195,7 @@ const ue = {
1187
1195
  { x: 0, y: 1 }
1188
1196
  // down
1189
1197
  ];
1190
- class ge {
1198
+ class fe {
1191
1199
  constructor(t, i = {}) {
1192
1200
  this.config = t, this.imageConfig = i;
1193
1201
  }
@@ -1199,59 +1207,59 @@ class ge {
1199
1207
  * @returns Array of layout objects with position, rotation, scale
1200
1208
  */
1201
1209
  generate(t, i, e = {}) {
1202
- const o = [], { width: a, height: r } = i, s = { ...ue, ...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, b = a - 2 * c, m = r - 2 * c, { columns: f, rows: p } = this.calculateGridDimensions(
1210
+ const o = [], { width: a, height: r } = i, s = { ...ge, ...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, f = h !== 1 || d !== 1, b = a - 2 * c, p = r - 2 * c, { columns: g, rows: m } = this.calculateGridDimensions(
1203
1211
  t,
1204
1212
  b,
1205
- m,
1213
+ p,
1206
1214
  l,
1207
1215
  s
1208
- ), y = s.stagger === "row", v = s.stagger === "column", w = y ? f + 0.5 : f, S = v ? p + 0.5 : p, E = (b - s.gap * (f - 1)) / w, I = (m - s.gap * (p - 1)) / S, M = y ? E / 2 : 0, F = v ? I / 2 : 0, _ = 1 + s.overlap, U = Math.min(E, I) * _, X = e.fixedHeight ? Math.min(e.fixedHeight, U) : U, N = f * E + (f - 1) * s.gap + M, T = p * I + (p - 1) * s.gap + F, O = c + (b - N) / 2, k = c + (m - T) / 2, H = f * p, C = s.columns !== "auto" && s.rows !== "auto", A = C && t > H;
1216
+ ), y = s.stagger === "row", w = s.stagger === "column", v = y ? g + 0.5 : g, R = w ? m + 0.5 : m, x = (b - s.gap * (g - 1)) / v, I = (p - s.gap * (m - 1)) / R, z = y ? x / 2 : 0, L = w ? I / 2 : 0, _ = 1 + s.overlap, O = Math.min(x, I) * _, H = e.fixedHeight ? Math.min(e.fixedHeight, O) : O, N = g * x + (g - 1) * s.gap + z, T = m * I + (m - 1) * s.gap + L, D = c + (b - N) / 2, G = c + (p - T) / 2, U = g * m, M = s.columns !== "auto" && s.rows !== "auto", A = M && t > U;
1209
1217
  typeof window < "u" && (window.__gridOverflowDebug = {
1210
1218
  gridConfigColumns: s.columns,
1211
1219
  gridConfigRows: s.rows,
1212
- columns: f,
1213
- rows: p,
1214
- cellCount: H,
1215
- hasFixedGrid: C,
1220
+ columns: g,
1221
+ rows: m,
1222
+ cellCount: U,
1223
+ hasFixedGrid: M,
1216
1224
  imageCount: t,
1217
1225
  isOverflowMode: A
1218
1226
  });
1219
- const D = A ? new Array(H).fill(0) : [], $ = Math.min(E, I) * s.overflowOffset;
1220
- for (let z = 0; z < t; z++) {
1221
- let P, L, W = 0;
1222
- if (A && z >= H) {
1223
- const q = z - H, j = q % H;
1224
- W = Math.floor(q / H) + 1, D[j]++, s.fillDirection === "row" ? (P = j % f, L = Math.floor(j / f)) : (L = j % p, P = Math.floor(j / p));
1227
+ const j = A ? new Array(U).fill(0) : [], X = Math.min(x, I) * s.overflowOffset;
1228
+ for (let C = 0; C < t; C++) {
1229
+ let $, F, Y = 0;
1230
+ if (A && C >= U) {
1231
+ const q = C - U, W = q % U;
1232
+ Y = Math.floor(q / U) + 1, j[W]++, s.fillDirection === "row" ? ($ = W % g, F = Math.floor(W / g)) : (F = W % m, $ = Math.floor(W / m));
1225
1233
  } else
1226
- s.fillDirection === "row" ? (P = z % f, L = Math.floor(z / f)) : (L = z % p, P = Math.floor(z / p));
1227
- let G = O + P * (E + s.gap) + E / 2, Y = k + L * (I + s.gap) + I / 2;
1228
- if (s.stagger === "row" && L % 2 === 1 ? G += E / 2 : s.stagger === "column" && P % 2 === 1 && (Y += I / 2), W > 0) {
1229
- const q = (W - 1) % Lt.length, j = Lt[q];
1230
- G += j.x * $, Y += j.y * $;
1234
+ s.fillDirection === "row" ? ($ = C % g, F = Math.floor(C / g)) : (F = C % m, $ = Math.floor(C / m));
1235
+ let P = D + $ * (x + s.gap) + x / 2, k = G + F * (I + s.gap) + I / 2;
1236
+ if (s.stagger === "row" && F % 2 === 1 ? P += x / 2 : s.stagger === "column" && $ % 2 === 1 && (k += I / 2), Y > 0) {
1237
+ const q = (Y - 1) % Lt.length, W = Lt[q];
1238
+ P += W.x * X, k += W.y * X;
1231
1239
  }
1232
1240
  if (s.jitter > 0) {
1233
- const q = E / 2 * s.jitter, j = I / 2 * s.jitter;
1234
- G += this.random(-q, q), Y += this.random(-j, j);
1241
+ const q = x / 2 * s.jitter, W = I / 2 * s.jitter;
1242
+ P += this.random(-q, q), k += this.random(-W, W);
1235
1243
  }
1236
- let B = G, J = Y;
1244
+ let B = P, J = k;
1237
1245
  if (!A && s.fillDirection === "row") {
1238
- const q = t % f || f;
1239
- if (L === Math.floor((t - 1) / f) && q < f) {
1240
- const It = q * E + (q - 1) * s.gap;
1246
+ const q = t % g || g;
1247
+ if (F === Math.floor((t - 1) / g) && q < g) {
1248
+ const It = q * x + (q - 1) * s.gap;
1241
1249
  let gt = 0;
1242
1250
  s.alignment === "center" ? gt = (N - It) / 2 : s.alignment === "end" && (gt = N - It), B += gt;
1243
1251
  }
1244
1252
  }
1245
- const rt = g ? this.random(h, d) : 1, K = X * rt, it = K * 1.5 / 2, nt = K / 2, lt = c + it, ht = a - c - it, _t = c + nt, Ut = r - c - nt;
1253
+ const rt = f ? this.random(h, d) : 1, K = H * rt, it = K * 1.5 / 2, nt = K / 2, lt = c + it, ht = a - c - it, _t = c + nt, Ut = r - c - nt;
1246
1254
  B = Math.max(lt, Math.min(B, ht)), J = Math.max(_t, Math.min(J, Ut));
1247
1255
  let dt = 0;
1248
1256
  if (u === "random") {
1249
- const q = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
1250
- s.jitter > 0 ? dt = this.random(q * s.jitter, j * s.jitter) : dt = this.random(q, j);
1257
+ const q = this.imageConfig.rotation?.range?.min ?? -15, W = this.imageConfig.rotation?.range?.max ?? 15;
1258
+ s.jitter > 0 ? dt = this.random(q * s.jitter, W * s.jitter) : dt = this.random(q, W);
1251
1259
  }
1252
1260
  let ut;
1253
- A && W > 0 ? ut = 50 - W : ut = A ? 100 + z : z + 1, o.push({
1254
- id: z,
1261
+ A && Y > 0 ? ut = 50 - Y : ut = A ? 100 + C : C + 1, o.push({
1262
+ id: C,
1255
1263
  x: B,
1256
1264
  y: J,
1257
1265
  rotation: dt,
@@ -1287,14 +1295,14 @@ class ge {
1287
1295
  return Math.random() * (i - t) + t;
1288
1296
  }
1289
1297
  }
1290
- const fe = Math.PI * (3 - Math.sqrt(5)), me = {
1298
+ const me = Math.PI * (3 - Math.sqrt(5)), pe = {
1291
1299
  spiralType: "golden",
1292
1300
  direction: "counterclockwise",
1293
1301
  tightness: 1,
1294
1302
  scaleDecay: 0,
1295
1303
  startAngle: 0
1296
1304
  };
1297
- class pe {
1305
+ class be {
1298
1306
  constructor(t, i = {}) {
1299
1307
  this.config = t, this.imageConfig = i;
1300
1308
  }
@@ -1306,36 +1314,36 @@ class pe {
1306
1314
  * @returns Array of layout objects with position, rotation, scale
1307
1315
  */
1308
1316
  generate(t, i, e = {}) {
1309
- const o = [], { width: a, height: r } = i, s = { ...me, ...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, b = this.imageConfig.sizing?.variance?.max ?? 1, m = g !== 1 || b !== 1, f = this.config.scaleDecay ?? s.scaleDecay, p = a / 2, y = r / 2, v = Math.min(
1310
- p - c - l / 2,
1317
+ const o = [], { width: a, height: r } = i, s = { ...pe, ...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, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.config.scaleDecay ?? s.scaleDecay, m = a / 2, y = r / 2, w = Math.min(
1318
+ m - c - l / 2,
1311
1319
  y - c - l / 2
1312
- ), w = s.direction === "clockwise" ? -1 : 1;
1313
- for (let S = 0; S < t; S++) {
1314
- let E, I;
1320
+ ), v = s.direction === "clockwise" ? -1 : 1;
1321
+ for (let R = 0; R < t; R++) {
1322
+ let x, I;
1315
1323
  if (s.spiralType === "golden")
1316
- E = S * fe * w + s.startAngle, I = this.calculateGoldenRadius(S, t, v, s.tightness);
1324
+ x = R * me * v + s.startAngle, I = this.calculateGoldenRadius(R, t, w, s.tightness);
1317
1325
  else if (s.spiralType === "archimedean") {
1318
- const G = S * 0.5 * s.tightness;
1319
- E = G * w + s.startAngle, I = this.calculateArchimedeanRadius(G, t, v, s.tightness);
1326
+ const P = R * 0.5 * s.tightness;
1327
+ x = P * v + s.startAngle, I = this.calculateArchimedeanRadius(P, t, w, s.tightness);
1320
1328
  } else {
1321
- const G = S * 0.3 * s.tightness;
1322
- E = G * w + s.startAngle, I = this.calculateLogarithmicRadius(G, t, v, s.tightness);
1329
+ const P = R * 0.3 * s.tightness;
1330
+ x = P * v + s.startAngle, I = this.calculateLogarithmicRadius(P, t, w, s.tightness);
1323
1331
  }
1324
- const M = p + Math.cos(E) * I, F = y + Math.sin(E) * I, _ = I / v, U = f > 0 ? 1 - _ * f * 0.5 : 1, X = m ? this.random(g, b) : 1, N = U * X, T = l * N, k = T * 1.5 / 2, H = T / 2, C = c + k, A = a - c - k, D = c + H, $ = r - c - H, z = Math.max(C, Math.min(M, A)), P = Math.max(D, Math.min(F, $));
1325
- let L = 0;
1332
+ const z = m + Math.cos(x) * I, L = y + Math.sin(x) * I, _ = I / w, O = g > 0 ? 1 - _ * g * 0.5 : 1, H = p ? this.random(f, b) : 1, N = O * H, T = l * N, G = T * 1.5 / 2, U = T / 2, M = c + G, A = a - c - G, j = c + U, X = r - c - U, C = Math.max(M, Math.min(z, A)), $ = Math.max(j, Math.min(L, X));
1333
+ let F = 0;
1326
1334
  if (u === "random") {
1327
- const G = E * 180 / Math.PI % 360, Y = this.random(h, d);
1328
- L = s.spiralType === "golden" ? Y : G * 0.1 + Y * 0.9;
1329
- } else u === "tangent" && (L = this.calculateSpiralTangent(E, I, s));
1330
- const W = t - S;
1335
+ const P = x * 180 / Math.PI % 360, k = this.random(h, d);
1336
+ F = s.spiralType === "golden" ? k : P * 0.1 + k * 0.9;
1337
+ } else u === "tangent" && (F = this.calculateSpiralTangent(x, I, s));
1338
+ const Y = t - R;
1331
1339
  o.push({
1332
- id: S,
1333
- x: z,
1334
- y: P,
1335
- rotation: L,
1340
+ id: R,
1341
+ x: C,
1342
+ y: $,
1343
+ rotation: F,
1336
1344
  scale: N,
1337
1345
  baseSize: T,
1338
- zIndex: W
1346
+ zIndex: Y
1339
1347
  });
1340
1348
  }
1341
1349
  return o;
@@ -1388,7 +1396,7 @@ class pe {
1388
1396
  return Math.random() * (i - t) + t;
1389
1397
  }
1390
1398
  }
1391
- const be = {
1399
+ const ye = {
1392
1400
  clusterCount: "auto",
1393
1401
  clusterSpread: 150,
1394
1402
  clusterSpacing: 200,
@@ -1396,7 +1404,7 @@ const be = {
1396
1404
  overlap: 0.3,
1397
1405
  distribution: "gaussian"
1398
1406
  };
1399
- class ye {
1407
+ class ve {
1400
1408
  constructor(t, i = {}) {
1401
1409
  this.config = t, this.imageConfig = i;
1402
1410
  }
@@ -1408,48 +1416,48 @@ class ye {
1408
1416
  * @returns Array of layout objects with position, rotation, scale
1409
1417
  */
1410
1418
  generate(t, i, e = {}) {
1411
- const o = [], { width: a, height: r } = i, s = { ...be, ...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, b = this.imageConfig.sizing?.variance?.max ?? 1, m = g !== 1 || b !== 1, f = this.calculateClusterCount(
1419
+ const o = [], { width: a, height: r } = i, s = { ...ye, ...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, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.calculateClusterCount(
1412
1420
  t,
1413
1421
  s.clusterCount,
1414
1422
  a,
1415
1423
  r,
1416
1424
  s.clusterSpacing
1417
- ), p = this.generateClusterCenters(
1418
- f,
1425
+ ), m = this.generateClusterCenters(
1426
+ g,
1419
1427
  a,
1420
1428
  r,
1421
1429
  c,
1422
1430
  s
1423
- ), y = new Array(f).fill(0);
1424
- for (let w = 0; w < t; w++)
1425
- y[w % f]++;
1426
- let v = 0;
1427
- for (let w = 0; w < f; w++) {
1428
- const S = p[w], E = y[w];
1429
- for (let I = 0; I < E; I++) {
1430
- let M, F;
1431
+ ), y = new Array(g).fill(0);
1432
+ for (let v = 0; v < t; v++)
1433
+ y[v % g]++;
1434
+ let w = 0;
1435
+ for (let v = 0; v < g; v++) {
1436
+ const R = m[v], x = y[v];
1437
+ for (let I = 0; I < x; I++) {
1438
+ let z, L;
1431
1439
  if (s.distribution === "gaussian")
1432
- M = this.gaussianRandom() * S.spread, F = this.gaussianRandom() * S.spread;
1440
+ z = this.gaussianRandom() * R.spread, L = this.gaussianRandom() * R.spread;
1433
1441
  else {
1434
- const L = this.random(0, Math.PI * 2), W = this.random(0, S.spread);
1435
- M = Math.cos(L) * W, F = Math.sin(L) * W;
1442
+ const F = this.random(0, Math.PI * 2), Y = this.random(0, R.spread);
1443
+ z = Math.cos(F) * Y, L = Math.sin(F) * Y;
1436
1444
  }
1437
- const _ = 1 + s.overlap * 0.5, U = 1 + s.overlap * 0.3;
1438
- M /= _, F /= _;
1439
- const X = m ? this.random(g, b) : 1, N = U * X, T = l * N;
1440
- let O = S.x + M, k = S.y + F;
1441
- const C = T * 1.5 / 2, A = T / 2;
1442
- O = Math.max(c + C, Math.min(O, a - c - C)), k = Math.max(c + A, Math.min(k, r - c - A));
1443
- const D = u === "random" ? this.random(h, d) : 0, z = Math.sqrt(M * M + F * F) / S.spread, P = Math.round((1 - z) * 50) + 1;
1445
+ const _ = 1 + s.overlap * 0.5, O = 1 + s.overlap * 0.3;
1446
+ z /= _, L /= _;
1447
+ const H = p ? this.random(f, b) : 1, N = O * H, T = l * N;
1448
+ let D = R.x + z, G = R.y + L;
1449
+ const M = T * 1.5 / 2, A = T / 2;
1450
+ D = Math.max(c + M, Math.min(D, a - c - M)), G = Math.max(c + A, Math.min(G, r - c - A));
1451
+ const j = u === "random" ? this.random(h, d) : 0, C = Math.sqrt(z * z + L * L) / R.spread, $ = Math.round((1 - C) * 50) + 1;
1444
1452
  o.push({
1445
- id: v,
1446
- x: O,
1447
- y: k,
1448
- rotation: D,
1453
+ id: w,
1454
+ x: D,
1455
+ y: G,
1456
+ rotation: j,
1449
1457
  scale: N,
1450
1458
  baseSize: T,
1451
- zIndex: P
1452
- }), v++;
1459
+ zIndex: $
1460
+ }), w++;
1453
1461
  }
1454
1462
  }
1455
1463
  return o;
@@ -1471,22 +1479,22 @@ class ye {
1471
1479
  generateClusterCenters(t, i, e, o, a) {
1472
1480
  const r = [], c = o + a.clusterSpread, l = i - o - a.clusterSpread, u = o + a.clusterSpread, h = e - o - a.clusterSpread;
1473
1481
  for (let d = 0; d < t; d++) {
1474
- let g = null, b = -1;
1475
- for (let m = 0; m < 100; m++) {
1476
- const f = {
1482
+ let f = null, b = -1;
1483
+ for (let p = 0; p < 100; p++) {
1484
+ const g = {
1477
1485
  x: this.random(c, l),
1478
1486
  y: this.random(u, h),
1479
1487
  spread: this.calculateClusterSpread(a)
1480
1488
  };
1481
- let p = 1 / 0;
1489
+ let m = 1 / 0;
1482
1490
  for (const y of r) {
1483
- const v = f.x - y.x, w = f.y - y.y, S = Math.sqrt(v * v + w * w);
1484
- p = Math.min(p, S);
1491
+ const w = g.x - y.x, v = g.y - y.y, R = Math.sqrt(w * w + v * v);
1492
+ m = Math.min(m, R);
1485
1493
  }
1486
- if ((r.length === 0 || p > b) && (g = f, b = p), p >= a.clusterSpacing)
1494
+ if ((r.length === 0 || m > b) && (f = g, b = m), m >= a.clusterSpacing)
1487
1495
  break;
1488
1496
  }
1489
- g && r.push(g);
1497
+ f && r.push(f);
1490
1498
  }
1491
1499
  return r;
1492
1500
  }
@@ -1514,7 +1522,7 @@ class ye {
1514
1522
  return Math.random() * (i - t) + t;
1515
1523
  }
1516
1524
  }
1517
- class ve {
1525
+ class we {
1518
1526
  constructor(t, i = {}) {
1519
1527
  this.config = t, this.imageConfig = i;
1520
1528
  }
@@ -1526,29 +1534,29 @@ class ve {
1526
1534
  * @returns Array of layout objects with position, rotation, scale
1527
1535
  */
1528
1536
  generate(t, i, e = {}) {
1529
- const o = [], { width: a, height: r } = i, s = 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, b = d !== 1 || g !== 1, m = e.fixedHeight ?? s, f = {
1530
- ...Ht,
1537
+ const o = [], { width: a, height: r } = i, s = 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, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = e.fixedHeight ?? s, g = {
1538
+ ...Nt,
1531
1539
  ...this.config.wave
1532
- }, { rows: p, amplitude: y, frequency: v, phaseShift: w, synchronization: S } = f, E = Math.ceil(t / p), F = m * 1.5 / 2, _ = c + F, U = a - c - F, X = U - _, N = E > 1 ? X / (E - 1) : 0, T = c + y + m / 2, O = r - c - y - m / 2, k = O - T, H = p > 1 ? k / (p - 1) : 0;
1533
- let C = 0;
1534
- for (let A = 0; A < p && C < t; A++) {
1535
- const D = p === 1 ? (T + O) / 2 : T + A * H;
1536
- let $ = 0;
1537
- S === "offset" ? $ = A * w : S === "alternating" && ($ = A * Math.PI);
1538
- for (let z = 0; z < E && C < t; z++) {
1539
- const P = E === 1 ? (_ + U) / 2 : _ + z * N, L = this.calculateWaveY(P, a, y, v, $), W = P, G = D + L, Y = b ? this.random(d, g) : 1, B = m * Y;
1540
+ }, { rows: m, amplitude: y, frequency: w, phaseShift: v, synchronization: R } = g, x = Math.ceil(t / m), L = p * 1.5 / 2, _ = c + L, O = a - c - L, H = O - _, N = x > 1 ? H / (x - 1) : 0, T = c + y + p / 2, D = r - c - y - p / 2, G = D - T, U = m > 1 ? G / (m - 1) : 0;
1541
+ let M = 0;
1542
+ for (let A = 0; A < m && M < t; A++) {
1543
+ const j = m === 1 ? (T + D) / 2 : T + A * U;
1544
+ let X = 0;
1545
+ R === "offset" ? X = A * v : R === "alternating" && (X = A * Math.PI);
1546
+ for (let C = 0; C < x && M < t; C++) {
1547
+ const $ = x === 1 ? (_ + O) / 2 : _ + C * N, F = this.calculateWaveY($, a, y, w, X), Y = $, P = j + F, k = b ? this.random(d, f) : 1, B = p * k;
1540
1548
  let J = 0;
1541
- l === "tangent" ? J = this.calculateRotation(P, a, y, v, $) : l === "random" && (J = this.random(u, h));
1549
+ l === "tangent" ? J = this.calculateRotation($, a, y, w, X) : l === "random" && (J = this.random(u, h));
1542
1550
  const K = B * 1.5 / 2, ct = B / 2, it = c + K, nt = a - c - K, lt = c + ct, ht = r - c - ct;
1543
1551
  o.push({
1544
- id: C,
1545
- x: Math.max(it, Math.min(W, nt)),
1546
- y: Math.max(lt, Math.min(G, ht)),
1552
+ id: M,
1553
+ x: Math.max(it, Math.min(Y, nt)),
1554
+ y: Math.max(lt, Math.min(P, ht)),
1547
1555
  rotation: J,
1548
- scale: Y,
1556
+ scale: k,
1549
1557
  baseSize: B,
1550
- zIndex: C + 1
1551
- }), C++;
1558
+ zIndex: M + 1
1559
+ }), M++;
1552
1560
  }
1553
1561
  }
1554
1562
  return o;
@@ -1604,21 +1612,21 @@ const Et = 100, Q = 100 / Math.sqrt(3), St = [
1604
1612
  // lower-left
1605
1613
  [0, 50]
1606
1614
  // left
1607
- ], we = St[1][0] / Et, xe = St[2][1] / Et;
1608
- function Ee(n) {
1615
+ ], xe = St[1][0] / Et, Ee = St[2][1] / Et;
1616
+ function Se(n) {
1609
1617
  return {
1610
- colStep: we * n,
1611
- rowOffset: xe * n
1618
+ colStep: xe * n,
1619
+ rowOffset: Ee * n
1612
1620
  };
1613
1621
  }
1614
- function Se(n, t, i, e, o, a) {
1615
- const { colStep: r } = Ee(a);
1622
+ function Re(n, t, i, e, o, a) {
1623
+ const { colStep: r } = Se(a);
1616
1624
  return {
1617
1625
  px: e + r * n,
1618
1626
  py: o + a * (t + n / 2)
1619
1627
  };
1620
1628
  }
1621
- const Re = [
1629
+ const Ie = [
1622
1630
  [1, 0, -1],
1623
1631
  [0, 1, -1],
1624
1632
  [-1, 1, 0],
@@ -1626,16 +1634,16 @@ const Re = [
1626
1634
  [0, -1, 1],
1627
1635
  [1, -1, 0]
1628
1636
  ];
1629
- function Ie(n) {
1637
+ function Te(n) {
1630
1638
  if (n === 0) return [[0, 0, 0]];
1631
1639
  const t = [];
1632
1640
  let [i, e, o] = [0, -n, n];
1633
- for (const [a, r, s] of Re)
1641
+ for (const [a, r, s] of Ie)
1634
1642
  for (let c = 0; c < n; c++)
1635
1643
  t.push([i, e, o]), i += a, e += r, o += s;
1636
1644
  return t;
1637
1645
  }
1638
- class Te {
1646
+ class Ae {
1639
1647
  // imageConfig intentionally not stored — honeycomb forces uniform sizing (rotation/variance
1640
1648
  // would break hex tiling). Kept as parameter for interface compatibility.
1641
1649
  constructor(t, i = {}) {
@@ -1643,32 +1651,32 @@ class Te {
1643
1651
  }
1644
1652
  generate(t, i, e = {}) {
1645
1653
  const o = [], { width: a, height: r } = i, s = a / 2, c = r / 2, l = e.fixedHeight ?? 200, h = {
1646
- ...Nt,
1654
+ ...jt,
1647
1655
  ...this.config.honeycomb
1648
1656
  }.spacing ?? 0, d = l + h;
1649
- let g = 0, b = 0;
1650
- for (; g < t; ) {
1651
- const m = Ie(b);
1652
- for (const [f, p, y] of m) {
1653
- if (g >= t) break;
1654
- const { px: v, py: w } = Se(f, p, y, s, c, d);
1657
+ let f = 0, b = 0;
1658
+ for (; f < t; ) {
1659
+ const p = Te(b);
1660
+ for (const [g, m, y] of p) {
1661
+ if (f >= t) break;
1662
+ const { px: w, py: v } = Re(g, m, y, s, c, d);
1655
1663
  o.push({
1656
- id: g,
1657
- x: v,
1658
- y: w,
1664
+ id: f,
1665
+ x: w,
1666
+ y: v,
1659
1667
  rotation: 0,
1660
1668
  scale: 1,
1661
1669
  baseSize: l,
1662
1670
  // Inner rings render above outer rings
1663
1671
  zIndex: Math.max(1, 100 - b)
1664
- }), g++;
1672
+ }), f++;
1665
1673
  }
1666
1674
  b++;
1667
1675
  }
1668
1676
  return o;
1669
1677
  }
1670
1678
  }
1671
- class Ae {
1679
+ class Ce {
1672
1680
  constructor(t) {
1673
1681
  this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
1674
1682
  }
@@ -1679,19 +1687,19 @@ class Ae {
1679
1687
  initLayout() {
1680
1688
  switch (this.config.algorithm) {
1681
1689
  case "radial":
1682
- return new de(this.config, this.imageConfig);
1690
+ return new ue(this.config, this.imageConfig);
1683
1691
  case "grid":
1684
- return new ge(this.config, this.imageConfig);
1692
+ return new fe(this.config, this.imageConfig);
1685
1693
  case "spiral":
1686
- return new pe(this.config, this.imageConfig);
1694
+ return new be(this.config, this.imageConfig);
1687
1695
  case "cluster":
1688
- return new ye(this.config, this.imageConfig);
1689
- case "wave":
1690
1696
  return new ve(this.config, this.imageConfig);
1697
+ case "wave":
1698
+ return new we(this.config, this.imageConfig);
1691
1699
  case "honeycomb":
1692
- return new Te(this.config, this.imageConfig);
1700
+ return new Ae(this.config, this.imageConfig);
1693
1701
  default:
1694
- return new he(this.config, this.imageConfig);
1702
+ return new de(this.config, this.imageConfig);
1695
1703
  }
1696
1704
  }
1697
1705
  /**
@@ -1773,13 +1781,13 @@ class Ae {
1773
1781
  const a = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1774
1782
  if (r !== void 0)
1775
1783
  return { height: r };
1776
- const s = a?.minSize ?? 50, c = a?.maxSize ?? 400, l = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: h, height: d } = t, m = h * d * l / i;
1777
- let p = Math.sqrt(m / 1.4);
1778
- p *= u, p = Math.min(p, e);
1779
- let y = this.clamp(p, s, c);
1780
- if (y === s && p < s) {
1781
- const v = Math.max(s * 0.05, 20);
1782
- y = Math.max(v, p);
1784
+ const s = a?.minSize ?? 50, c = a?.maxSize ?? 400, l = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: h, height: d } = t, p = h * d * l / i;
1785
+ let m = Math.sqrt(p / 1.4);
1786
+ m *= u, m = Math.min(m, e);
1787
+ let y = this.clamp(m, s, c);
1788
+ if (y === s && m < s) {
1789
+ const w = Math.max(s * 0.05, 20);
1790
+ y = Math.max(w, m);
1783
1791
  }
1784
1792
  return this.config.algorithm === "honeycomb" && (y = Math.min(y, this.honeycombMaxImageHeight(i, t))), { height: y };
1785
1793
  }
@@ -1803,7 +1811,7 @@ class Ae {
1803
1811
  return Math.max(i, Math.min(e, t));
1804
1812
  }
1805
1813
  }
1806
- var R = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(R || {});
1814
+ var S = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(S || {});
1807
1815
  const Mt = {
1808
1816
  // Geometric shapes - uses percentages for responsive sizing
1809
1817
  circle: "circle(50%)",
@@ -1813,7 +1821,7 @@ const Mt = {
1813
1821
  hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
1814
1822
  octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
1815
1823
  diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
1816
- }, Ce = {
1824
+ }, Le = {
1817
1825
  // Circle - uses radius in pixels (refHeight of 100px = 50px radius)
1818
1826
  circle: {
1819
1827
  refHeight: 100,
@@ -1851,29 +1859,29 @@ const Mt = {
1851
1859
  points: [[50, 0], [100, 50], [50, 100], [0, 50]]
1852
1860
  }
1853
1861
  };
1854
- function Le(n) {
1862
+ function Me(n) {
1855
1863
  if (n)
1856
1864
  return n in Mt ? Mt[n] : n;
1857
1865
  }
1858
- function Me(n, t, i) {
1859
- const e = Ce[n];
1866
+ function Fe(n, t, i) {
1867
+ const e = Le[n];
1860
1868
  if (!e) return "";
1861
1869
  const o = t / e.refHeight;
1862
1870
  if (n === "circle")
1863
1871
  return `circle(${Math.round(50 * o * 100) / 100}px)`;
1864
- const a = e.points.map(([m]) => m), r = e.points.map(([, m]) => m), s = (Math.min(...a) + Math.max(...a)) / 2 * o, c = (Math.min(...r) + Math.max(...r)) / 2 * o, l = (Math.max(...a) - Math.min(...a)) * o, u = (i ?? l) / 2, h = t / 2, d = u - s, g = h - c;
1865
- return `polygon(${e.points.map(([m, f]) => {
1866
- const p = Math.round((m * o + d) * 100) / 100, y = Math.round((f * o + g) * 100) / 100;
1867
- return `${p}px ${y}px`;
1872
+ const a = e.points.map(([p]) => p), r = e.points.map(([, p]) => p), s = (Math.min(...a) + Math.max(...a)) / 2 * o, c = (Math.min(...r) + Math.max(...r)) / 2 * o, l = (Math.max(...a) - Math.min(...a)) * o, u = (i ?? l) / 2, h = t / 2, d = u - s, f = h - c;
1873
+ return `polygon(${e.points.map(([p, g]) => {
1874
+ const m = Math.round((p * o + d) * 100) / 100, y = Math.round((g * o + f) * 100) / 100;
1875
+ return `${m}px ${y}px`;
1868
1876
  }).join(", ")})`;
1869
1877
  }
1870
- function Fe(n) {
1871
- return n in mt;
1872
- }
1873
1878
  function ze(n) {
1874
- return n ? Fe(n) ? mt[n] : n : mt.md;
1879
+ return n in mt;
1875
1880
  }
1876
1881
  function Oe(n) {
1882
+ return n ? ze(n) ? mt[n] : n : mt.md;
1883
+ }
1884
+ function De(n) {
1877
1885
  if (!n) return "";
1878
1886
  const t = [];
1879
1887
  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)
@@ -1902,8 +1910,8 @@ function et(n, t, i) {
1902
1910
  const s = n.border || {}, c = { ...s, ...n.borderTop }, l = { ...s, ...n.borderRight }, u = { ...s, ...n.borderBottom }, h = { ...s, ...n.borderLeft };
1903
1911
  e.borderTop = tt(c), e.borderRight = tt(l), e.borderBottom = tt(u), e.borderLeft = tt(h);
1904
1912
  } else n.border && (e.border = tt(n.border));
1905
- n.shadow !== void 0 && (e.boxShadow = ze(n.shadow));
1906
- const r = Oe(n.filter);
1913
+ n.shadow !== void 0 && (e.boxShadow = Oe(n.shadow));
1914
+ const r = De(n.filter);
1907
1915
  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) {
1908
1916
  const s = n.outline.width ?? 0, c = n.outline.style ?? "solid", l = n.outline.color ?? "#000000";
1909
1917
  e.outline = `${s}px ${c} ${l}`, n.outline.offset !== void 0 && (e.outlineOffset = `${n.outline.offset}px`);
@@ -1912,21 +1920,21 @@ function et(n, t, i) {
1912
1920
  let s;
1913
1921
  const c = typeof n.clipPath == "object" && n.clipPath !== null && "shape" in n.clipPath, l = c ? n.clipPath : void 0;
1914
1922
  if (l?.mode === "height-relative" && t)
1915
- s = Me(l.shape, t, i);
1923
+ s = Fe(l.shape, t, i);
1916
1924
  else {
1917
1925
  const u = c && l ? l.shape : n.clipPath;
1918
- s = Le(u);
1926
+ s = Me(u);
1919
1927
  }
1920
1928
  s && (s === "none" ? e.clipPath = "unset" : (e.clipPath = s, e.overflow = "hidden"));
1921
1929
  }
1922
1930
  return e;
1923
1931
  }
1924
- function De(n, t) {
1932
+ function $e(n, t) {
1925
1933
  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);
1926
1934
  }
1927
1935
  function ft(n, t, i, e) {
1928
1936
  const o = et(t, i, e);
1929
- De(n, o);
1937
+ $e(n, o);
1930
1938
  }
1931
1939
  function Pt(n) {
1932
1940
  return n ? Array.isArray(n) ? n.join(" ") : n : "";
@@ -1947,9 +1955,9 @@ const Ft = {
1947
1955
  UNFOCUSING: 999,
1948
1956
  FOCUSING: 1e3
1949
1957
  };
1950
- class $e {
1958
+ class Pe {
1951
1959
  constructor(t, i, e) {
1952
- this.state = R.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
1960
+ this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
1953
1961
  }
1954
1962
  /**
1955
1963
  * Get current state machine state
@@ -1961,7 +1969,7 @@ class $e {
1961
1969
  * Check if any animation is in progress
1962
1970
  */
1963
1971
  isAnimating() {
1964
- return this.state !== R.IDLE && this.state !== R.FOCUSED;
1972
+ return this.state !== S.IDLE && this.state !== S.FOCUSED;
1965
1973
  }
1966
1974
  /**
1967
1975
  * Normalize scalePercent value
@@ -2080,19 +2088,19 @@ class $e {
2080
2088
  rotation: e.rotation,
2081
2089
  scale: 1
2082
2090
  // No scale - using dimensions
2083
- }, g = a?.width ?? s, b = a?.height ?? c, m = this.animateWithDimensions(
2091
+ }, f = a?.width ?? s, b = a?.height ?? c, p = this.animateWithDimensions(
2084
2092
  t,
2085
2093
  d,
2086
2094
  u,
2087
- g,
2095
+ f,
2088
2096
  b,
2089
2097
  l.width,
2090
2098
  l.height,
2091
2099
  h
2092
- ), f = {
2100
+ ), g = {
2093
2101
  id: `focus-${Date.now()}`,
2094
2102
  element: t,
2095
- animation: m,
2103
+ animation: p,
2096
2104
  fromState: d,
2097
2105
  toState: u,
2098
2106
  startTime: performance.now(),
@@ -2107,10 +2115,10 @@ class $e {
2107
2115
  originalHeight: c,
2108
2116
  focusWidth: l.width,
2109
2117
  focusHeight: l.height
2110
- }, this.startClipPathAnimation(t, f, !0), {
2118
+ }, this.startClipPathAnimation(t, g, !0), {
2111
2119
  element: t,
2112
2120
  originalState: e,
2113
- animationHandle: f,
2121
+ animationHandle: g,
2114
2122
  direction: "in",
2115
2123
  originalWidth: s,
2116
2124
  originalHeight: c
@@ -2140,7 +2148,7 @@ class $e {
2140
2148
  u,
2141
2149
  h,
2142
2150
  a
2143
- ), g = {
2151
+ ), f = {
2144
2152
  id: `unfocus-${Date.now()}`,
2145
2153
  element: t,
2146
2154
  animation: d,
@@ -2149,10 +2157,10 @@ class $e {
2149
2157
  startTime: performance.now(),
2150
2158
  duration: a
2151
2159
  };
2152
- return this.startClipPathAnimation(t, g, !1), {
2160
+ return this.startClipPathAnimation(t, f, !1), {
2153
2161
  element: t,
2154
2162
  originalState: i,
2155
- animationHandle: g,
2163
+ animationHandle: f,
2156
2164
  direction: "out",
2157
2165
  originalWidth: u,
2158
2166
  originalHeight: h
@@ -2201,26 +2209,26 @@ class $e {
2201
2209
  * Implements cross-animation when swapping focus
2202
2210
  */
2203
2211
  async focusImage(t, i, e) {
2204
- if (this.currentFocus === t && this.state === R.FOCUSED)
2212
+ if (this.currentFocus === t && this.state === S.FOCUSED)
2205
2213
  return this.unfocusImage();
2206
- if (this.incoming?.element === t && this.state === R.FOCUSING) {
2214
+ if (this.incoming?.element === t && this.state === S.FOCUSING) {
2207
2215
  const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2208
2216
  this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
2209
2217
  t,
2210
2218
  this.incoming.originalState,
2211
2219
  a,
2212
2220
  r
2213
- ), this.incoming = null, this.state = R.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 = R.IDLE;
2221
+ ), this.incoming = null, this.state = S.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 = S.IDLE;
2214
2222
  return;
2215
2223
  }
2216
2224
  const o = ++this.focusGeneration;
2217
2225
  switch (this.state) {
2218
- case R.IDLE:
2219
- if (this.state = R.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2220
- this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2226
+ case S.IDLE:
2227
+ if (this.state = S.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2228
+ this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2221
2229
  break;
2222
- case R.FOCUSED:
2223
- if (this.state = R.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2230
+ case S.FOCUSED:
2231
+ if (this.state = S.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2224
2232
  this.currentFocus,
2225
2233
  this.focusData.originalState
2226
2234
  )), this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
@@ -2228,9 +2236,9 @@ class $e {
2228
2236
  this.waitForAnimation(this.incoming.animationHandle)
2229
2237
  ]), this.focusGeneration !== o)
2230
2238
  return;
2231
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2239
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2232
2240
  break;
2233
- case R.FOCUSING:
2241
+ case S.FOCUSING:
2234
2242
  if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
2235
2243
  this.incoming.element,
2236
2244
  this.incoming.originalState,
@@ -2238,16 +2246,16 @@ class $e {
2238
2246
  this.focusData?.originalWidth,
2239
2247
  this.focusData?.originalHeight
2240
2248
  ), this.incoming = null), this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2241
- this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2249
+ this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2242
2250
  break;
2243
- case R.UNFOCUSING:
2244
- if (this.state = R.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2251
+ case S.UNFOCUSING:
2252
+ if (this.state = S.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2245
2253
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2246
2254
  this.waitForAnimation(this.incoming.animationHandle)
2247
2255
  ]), this.focusGeneration !== o) return;
2248
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2256
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2249
2257
  break;
2250
- case R.CROSS_ANIMATING:
2258
+ case S.CROSS_ANIMATING:
2251
2259
  if (this.incoming?.element === t)
2252
2260
  return;
2253
2261
  if (this.outgoing?.element === t) {
@@ -2266,7 +2274,7 @@ class $e {
2266
2274
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2267
2275
  this.waitForAnimation(this.incoming.animationHandle)
2268
2276
  ]), this.focusGeneration !== o) return;
2269
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2277
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2270
2278
  return;
2271
2279
  }
2272
2280
  if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
@@ -2288,7 +2296,7 @@ class $e {
2288
2296
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2289
2297
  this.waitForAnimation(this.incoming.animationHandle)
2290
2298
  ]), this.focusGeneration !== o) return;
2291
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2299
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2292
2300
  break;
2293
2301
  }
2294
2302
  }
@@ -2296,23 +2304,23 @@ class $e {
2296
2304
  * Unfocus current image, returning it to original position
2297
2305
  */
2298
2306
  async unfocusImage() {
2299
- if (this.state === R.UNFOCUSING)
2307
+ if (this.state === S.UNFOCUSING)
2300
2308
  return;
2301
2309
  const t = ++this.focusGeneration;
2302
2310
  if (!this.currentFocus || !this.focusData) {
2303
- if (this.incoming && this.state === R.FOCUSING) {
2311
+ if (this.incoming && this.state === S.FOCUSING) {
2304
2312
  const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2305
2313
  if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2306
2314
  this.incoming.element,
2307
2315
  this.incoming.originalState,
2308
2316
  a,
2309
2317
  r
2310
- ), this.incoming = null, this.state = R.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2311
- this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = R.IDLE;
2318
+ ), this.incoming = null, this.state = S.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2319
+ this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = S.IDLE;
2312
2320
  }
2313
2321
  return;
2314
2322
  }
2315
- if (this.state === R.CROSS_ANIMATING && this.incoming) {
2323
+ if (this.state === S.CROSS_ANIMATING && this.incoming) {
2316
2324
  const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2317
2325
  this.animationEngine.cancelAllAnimations(this.incoming.element);
2318
2326
  const s = this.startUnfocusAnimation(
@@ -2325,12 +2333,12 @@ class $e {
2325
2333
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2326
2334
  this.waitForAnimation(s.animationHandle)
2327
2335
  ]), this.focusGeneration !== t) return;
2328
- this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(s.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = R.IDLE;
2336
+ this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(s.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE;
2329
2337
  return;
2330
2338
  }
2331
- this.state = R.UNFOCUSING;
2339
+ this.state = S.UNFOCUSING;
2332
2340
  const i = this.currentFocus, e = this.focusData.originalState, o = this.focusData.originalZIndex;
2333
- 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 = R.IDLE);
2341
+ 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 = S.IDLE);
2334
2342
  }
2335
2343
  /**
2336
2344
  * Swap focus from current image to a new one (alias for focusImage with cross-animation)
@@ -2348,7 +2356,7 @@ class $e {
2348
2356
  * Check if an image is currently focused (stable state)
2349
2357
  */
2350
2358
  isFocused(t) {
2351
- return this.currentFocus === t && this.state === R.FOCUSED;
2359
+ return this.currentFocus === t && this.state === S.FOCUSED;
2352
2360
  }
2353
2361
  /**
2354
2362
  * Check if an image is the target of current focus animation
@@ -2369,7 +2377,7 @@ class $e {
2369
2377
  * Used during swipe gestures for visual feedback
2370
2378
  */
2371
2379
  setDragOffset(t) {
2372
- if (!this.currentFocus || !this.focusData || this.state !== R.FOCUSED) return;
2380
+ if (!this.currentFocus || !this.focusData || this.state !== S.FOCUSED) return;
2373
2381
  const i = this.currentFocus, e = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], a = (e.x ?? 0) + t, r = e.y ?? 0;
2374
2382
  o.push(`translate(${a}px, ${r}px)`), e.rotation !== void 0 && o.push(`rotate(${e.rotation}deg)`), i.style.transition = "none", i.style.transform = o.join(" ");
2375
2383
  }
@@ -2379,7 +2387,7 @@ class $e {
2379
2387
  * @param duration - Animation duration in ms (default 150)
2380
2388
  */
2381
2389
  clearDragOffset(t, i = 150) {
2382
- if (!this.currentFocus || !this.focusData || this.state !== R.FOCUSED) return;
2390
+ if (!this.currentFocus || !this.focusData || this.state !== S.FOCUSED) return;
2383
2391
  const e = this.currentFocus, o = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = o.x ?? 0, s = o.y ?? 0;
2384
2392
  a.push(`translate(${r}px, ${s}px)`), o.rotation !== void 0 && a.push(`rotate(${o.rotation}deg)`);
2385
2393
  const c = a.join(" ");
@@ -2409,10 +2417,10 @@ class $e {
2409
2417
  this.focusData.originalZIndex,
2410
2418
  this.focusData.originalWidth,
2411
2419
  this.focusData.originalHeight
2412
- ), this.state = R.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2420
+ ), this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2413
2421
  }
2414
2422
  }
2415
- const Pe = 50, _e = 0.5, Ue = 20, He = 0.3, Ne = 150, je = 30, at = class at {
2423
+ const _e = 50, Ue = 0.5, He = 20, Ne = 0.3, je = 150, ke = 30, at = class at {
2416
2424
  constructor(t, i) {
2417
2425
  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);
2418
2426
  }
@@ -2459,11 +2467,11 @@ const Pe = 50, _e = 0.5, Ue = 20, He = 0.3, Ne = 150, je = 30, at = class at {
2459
2467
  const i = t.touches[0], e = i.clientX - this.touchState.startX, o = i.clientY - this.touchState.startY;
2460
2468
  if (this.touchState.isHorizontalSwipe === null && Math.sqrt(e * e + o * o) > 10) {
2461
2469
  const s = Math.atan2(Math.abs(o), Math.abs(e)) * (180 / Math.PI);
2462
- this.touchState.isHorizontalSwipe = s <= je;
2470
+ this.touchState.isHorizontalSwipe = s <= ke;
2463
2471
  }
2464
2472
  if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2465
2473
  t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
2466
- const a = e * He;
2474
+ const a = e * Ne;
2467
2475
  this.callbacks.onDragOffset(a);
2468
2476
  }
2469
2477
  }
@@ -2472,7 +2480,7 @@ const Pe = 50, _e = 0.5, Ue = 20, He = 0.3, Ne = 150, je = 30, at = class at {
2472
2480
  this.recentTouchTimestamp = Date.now();
2473
2481
  const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, o = Math.abs(i) / e, a = Math.abs(i);
2474
2482
  let r = !1;
2475
- this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Pe || o >= _e && a >= Ue) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2483
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= _e || o >= Ue && a >= He) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2476
2484
  }
2477
2485
  handleTouchCancel(t) {
2478
2486
  this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
@@ -2480,7 +2488,7 @@ const Pe = 50, _e = 0.5, Ue = 20, He = 0.3, Ne = 150, je = 30, at = class at {
2480
2488
  };
2481
2489
  at.TOUCH_CLICK_DELAY = 300;
2482
2490
  let bt = at;
2483
- class ke {
2491
+ class We {
2484
2492
  constructor(t) {
2485
2493
  if (this._prepared = !1, this._discoveredUrls = [], this.apiKey = t.apiKey ?? "", this.apiEndpoint = t.apiEndpoint ?? "https://www.googleapis.com/drive/v3/files", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
2486
2494
  throw new Error("GoogleDriveLoader requires at least one source to be configured");
@@ -2701,7 +2709,7 @@ class ke {
2701
2709
  this.debugLogging && typeof console < "u" && console.log(...t);
2702
2710
  }
2703
2711
  }
2704
- class We {
2712
+ class Ge {
2705
2713
  constructor(t) {
2706
2714
  if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = t.validateUrls !== !1, this.validationTimeout = t.validationTimeout ?? 5e3, this.validationMethod = t.validationMethod ?? "head", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
2707
2715
  throw new Error("StaticImageLoader requires at least one source to be configured");
@@ -2881,7 +2889,7 @@ class We {
2881
2889
  this.debugLogging && typeof console < "u" && console.log(...t);
2882
2890
  }
2883
2891
  }
2884
- class Ge {
2892
+ class qe {
2885
2893
  constructor(t) {
2886
2894
  if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
2887
2895
  throw new Error("CompositeLoader requires at least one loader to be configured");
@@ -2938,7 +2946,7 @@ class Ge {
2938
2946
  this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
2939
2947
  }
2940
2948
  }
2941
- class qe {
2949
+ class Xe {
2942
2950
  /**
2943
2951
  * Create a new ImageFilter
2944
2952
  * @param extensions - Array of allowed file extensions (without dots)
@@ -2975,7 +2983,7 @@ class qe {
2975
2983
  // isAllowedDate(date: Date): boolean
2976
2984
  // isAllowedDimensions(width: number, height: number): boolean
2977
2985
  }
2978
- const Xe = `
2986
+ const Ye = `
2979
2987
  .fbn-ic-gallery {
2980
2988
  position: relative;
2981
2989
  width: 100%;
@@ -3025,21 +3033,21 @@ const Xe = `
3025
3033
  display: none !important;
3026
3034
  }
3027
3035
  `;
3028
- function Ye() {
3036
+ function Be() {
3029
3037
  if (typeof document > "u") return;
3030
3038
  const n = "fbn-ic-functional-styles";
3031
3039
  if (document.getElementById(n)) return;
3032
3040
  const t = document.createElement("style");
3033
- t.id = n, t.textContent = Xe, document.head.appendChild(t);
3041
+ t.id = n, t.textContent = Ye, document.head.appendChild(t);
3034
3042
  }
3035
- class Be {
3043
+ class Je {
3036
3044
  constructor(t = {}) {
3037
- this.fullConfig = Bt(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.animationEngine = new Zt(this.fullConfig.animation), this.layoutEngine = new Ae({
3045
+ this.fullConfig = Jt(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.animationEngine = new Qt(this.fullConfig.animation), this.layoutEngine = new Ce({
3038
3046
  layout: this.fullConfig.layout,
3039
3047
  image: this.fullConfig.image
3040
- }), this.zoomEngine = new $e(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = et(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
3041
- const i = this.fullConfig.animation.entry || x.animation.entry;
3042
- this.entryAnimationEngine = new le(
3048
+ }), this.zoomEngine = new Pe(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = et(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
3049
+ const i = this.fullConfig.animation.entry || E.animation.entry;
3050
+ this.entryAnimationEngine = new he(
3043
3051
  i,
3044
3052
  this.fullConfig.layout.algorithm
3045
3053
  ), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
@@ -3049,7 +3057,7 @@ class Be {
3049
3057
  */
3050
3058
  createImageFilter() {
3051
3059
  const t = this.fullConfig.config.loaders?.allowedExtensions;
3052
- return new qe(t);
3060
+ return new Xe(t);
3053
3061
  }
3054
3062
  /**
3055
3063
  * Create appropriate image loader based on config
@@ -3060,7 +3068,7 @@ class Be {
3060
3068
  if (!t || t.length === 0)
3061
3069
  throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
3062
3070
  const e = t.map((o) => this.createLoaderFromEntry(o, i));
3063
- return e.length === 1 ? e[0] : new Ge({
3071
+ return e.length === 1 ? e[0] : new qe({
3064
3072
  loaders: e,
3065
3073
  debugLogging: this.fullConfig.config.debug?.loaders
3066
3074
  });
@@ -3078,14 +3086,14 @@ class Be {
3078
3086
  allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
3079
3087
  debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
3080
3088
  };
3081
- return new We(o);
3089
+ return new Ge(o);
3082
3090
  } else if ("googleDrive" in t) {
3083
3091
  const e = t.googleDrive, o = {
3084
3092
  ...e,
3085
3093
  allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
3086
3094
  debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
3087
3095
  };
3088
- return new ke(o);
3096
+ return new We(o);
3089
3097
  } else
3090
3098
  throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
3091
3099
  }
@@ -3094,7 +3102,7 @@ class Be {
3094
3102
  */
3095
3103
  async init() {
3096
3104
  try {
3097
- if (Ye(), this.containerRef)
3105
+ if (Be(), this.containerRef)
3098
3106
  this.containerEl = this.containerRef;
3099
3107
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
3100
3108
  throw new Error(`Container #${this.containerId} not found`);
@@ -3103,7 +3111,7 @@ class Be {
3103
3111
  onPrev: () => this.navigateToPreviousImage(),
3104
3112
  onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
3105
3113
  onDragEnd: (t) => {
3106
- t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Ne);
3114
+ t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, je);
3107
3115
  }
3108
3116
  }), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
3109
3117
  } catch (t) {
@@ -3230,24 +3238,24 @@ class Be {
3230
3238
  const d = {
3231
3239
  x: parseFloat(l.dataset.startX),
3232
3240
  y: parseFloat(l.dataset.startY)
3233
- }, g = {
3241
+ }, f = {
3234
3242
  x: parseFloat(l.dataset.endX),
3235
3243
  y: parseFloat(l.dataset.endY)
3236
- }, b = parseFloat(l.dataset.imageWidth), m = parseFloat(l.dataset.imageHeight), f = parseFloat(l.dataset.rotation), p = parseFloat(l.dataset.scale), y = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : f, v = l.dataset.startScale ? parseFloat(l.dataset.startScale) : p, w = this.entryAnimationEngine.getTiming();
3237
- ae({
3244
+ }, b = parseFloat(l.dataset.imageWidth), p = parseFloat(l.dataset.imageHeight), g = parseFloat(l.dataset.rotation), m = parseFloat(l.dataset.scale), y = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : g, w = l.dataset.startScale ? parseFloat(l.dataset.startScale) : m, v = this.entryAnimationEngine.getTiming();
3245
+ re({
3238
3246
  element: l,
3239
3247
  startPosition: d,
3240
- endPosition: g,
3248
+ endPosition: f,
3241
3249
  pathConfig: this.entryAnimationEngine.getPathConfig(),
3242
- duration: w.duration,
3250
+ duration: v.duration,
3243
3251
  imageWidth: b,
3244
- imageHeight: m,
3245
- rotation: f,
3246
- scale: p,
3252
+ imageHeight: p,
3253
+ rotation: g,
3254
+ scale: m,
3247
3255
  rotationConfig: this.entryAnimationEngine.getRotationConfig(),
3248
3256
  startRotation: y,
3249
3257
  scaleConfig: this.entryAnimationEngine.getScaleConfig(),
3250
- startScale: v
3258
+ startScale: w
3251
3259
  });
3252
3260
  } else {
3253
3261
  const d = l.dataset.finalTransform || "";
@@ -3300,59 +3308,59 @@ class Be {
3300
3308
  this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), a.forEach((l, u) => {
3301
3309
  const h = document.createElement("div");
3302
3310
  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";
3303
- const d = l.x, g = l.y;
3304
- 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);
3311
+ const d = l.x, f = l.y;
3312
+ h.style.left = `${d - 6}px`, h.style.top = `${f - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(h);
3305
3313
  })), t.forEach((l, u) => {
3306
3314
  const h = document.createElement("img");
3307
3315
  h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
3308
3316
  const d = a[u];
3309
3317
  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)), st(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
3310
3318
  if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {
3311
- const g = h.cachedRenderedWidth;
3312
- ft(h, this.fullConfig.styling?.hover, i, g), st(h, this.hoverClassName);
3319
+ const f = h.cachedRenderedWidth;
3320
+ ft(h, this.fullConfig.styling?.hover, i, f), st(h, this.hoverClassName);
3313
3321
  }
3314
3322
  }), h.addEventListener("mouseleave", () => {
3315
3323
  if (this.hoveredImage = null, !this.zoomEngine.isInvolved(h)) {
3316
- const g = h.cachedRenderedWidth;
3317
- ft(h, this.fullConfig.styling?.default, i, g), pt(h, this.hoverClassName), st(h, this.defaultClassName);
3324
+ const f = h.cachedRenderedWidth;
3325
+ ft(h, this.fullConfig.styling?.default, i, f), pt(h, this.hoverClassName), st(h, this.defaultClassName);
3318
3326
  }
3319
- }), h.addEventListener("click", (g) => {
3320
- g.stopPropagation(), this.handleImageClick(h, d);
3327
+ }), h.addEventListener("click", (f) => {
3328
+ f.stopPropagation(), this.handleImageClick(h, d);
3321
3329
  }), h.style.opacity = "0", h.style.transition = this.entryAnimationEngine.getTransitionCSS(), h.onload = () => {
3322
3330
  if (o !== this.loadGeneration)
3323
3331
  return;
3324
- const g = h.naturalWidth / h.naturalHeight, b = i * g;
3325
- h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${b}`), h.style.width = `${b}px`, h.cachedRenderedWidth = b, h.aspectRatio = g, ft(h, this.fullConfig.styling?.default, i, b);
3326
- const m = { x: d.x, y: d.y }, f = { width: b, height: i }, p = this.entryAnimationEngine.calculateStartPosition(
3327
- m,
3328
- f,
3332
+ const f = h.naturalWidth / h.naturalHeight, b = i * f;
3333
+ h.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${u}] Called with imageHeight=${i}, renderedWidth=${b}`), h.style.width = `${b}px`, h.cachedRenderedWidth = b, h.aspectRatio = f, ft(h, this.fullConfig.styling?.default, i, b);
3334
+ const p = { x: d.x, y: d.y }, g = { width: b, height: i }, m = this.entryAnimationEngine.calculateStartPosition(
3335
+ p,
3336
+ g,
3329
3337
  e,
3330
3338
  u,
3331
3339
  t.length
3332
- ), y = this.entryAnimationEngine.calculateStartRotation(d.rotation), v = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
3340
+ ), y = this.entryAnimationEngine.calculateStartRotation(d.rotation), w = this.entryAnimationEngine.calculateStartScale(d.scale), v = this.entryAnimationEngine.buildFinalTransform(
3333
3341
  d.rotation,
3334
3342
  d.scale,
3335
3343
  b,
3336
3344
  i
3337
- ), S = this.entryAnimationEngine.buildStartTransform(
3338
- p,
3345
+ ), R = this.entryAnimationEngine.buildStartTransform(
3339
3346
  m,
3347
+ p,
3340
3348
  d.rotation,
3341
3349
  d.scale,
3342
3350
  b,
3343
3351
  i,
3344
3352
  y,
3345
- v
3353
+ w
3346
3354
  );
3347
3355
  this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
3348
- finalPosition: m,
3349
- imageSize: f,
3356
+ finalPosition: p,
3357
+ imageSize: g,
3350
3358
  left: d.x,
3351
3359
  top: d.y,
3352
- finalTransform: w,
3360
+ finalTransform: v,
3353
3361
  renderedWidth: b,
3354
3362
  renderedHeight: i
3355
- }), h.style.transform = S, h.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation || v !== d.scale) && (h.dataset.startX = String(p.x), h.dataset.startY = String(p.y), h.dataset.endX = String(m.x), h.dataset.endY = String(m.y), h.dataset.imageWidth = String(b), 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(v)), this.displayQueue.push(h);
3363
+ }), h.style.transform = R, h.dataset.finalTransform = v, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || y !== d.rotation || w !== d.scale) && (h.dataset.startX = String(m.x), h.dataset.startY = String(m.y), h.dataset.endX = String(p.x), h.dataset.endY = String(p.y), h.dataset.imageWidth = String(b), 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(w)), this.displayQueue.push(h);
3356
3364
  }, h.onerror = () => r++, h.src = l;
3357
3365
  });
3358
3366
  }
@@ -3439,7 +3447,7 @@ const Rt = class Rt extends HTMLElement {
3439
3447
  if (this._container)
3440
3448
  try {
3441
3449
  const t = this._getOptions();
3442
- this._instance = new Be({
3450
+ this._instance = new Je({
3443
3451
  container: this._container,
3444
3452
  ...t
3445
3453
  }), this._instance.init().then(() => {