@frybynite/image-cloud 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- const Et = Object.freeze({
1
+ const St = Object.freeze({
2
2
  none: "none",
3
3
  sm: "0 2px 4px rgba(0,0,0,0.1)",
4
4
  md: "0 4px 16px rgba(0,0,0,0.4)",
5
5
  lg: "0 8px 32px rgba(0,0,0,0.5)",
6
6
  glow: "0 0 30px rgba(255,255,255,0.6)"
7
- }), Ct = Object.freeze({
7
+ }), Mt = Object.freeze({
8
8
  energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
9
9
  playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
10
10
  subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
@@ -13,17 +13,17 @@ const Et = Object.freeze({
13
13
  bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
14
14
  wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
15
15
  snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
16
- }), zt = Object.freeze({
16
+ }), Ft = Object.freeze({
17
17
  gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
18
18
  playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
19
19
  serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
20
20
  flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
21
21
  }), Tt = Object.freeze({
22
22
  type: "linear"
23
- }), Rt = Object.freeze({
24
- mode: "none"
25
23
  }), At = Object.freeze({
26
24
  mode: "none"
25
+ }), Rt = Object.freeze({
26
+ mode: "none"
27
27
  }), $t = Object.freeze({
28
28
  default: Object.freeze({
29
29
  border: Object.freeze({
@@ -87,7 +87,7 @@ const Et = Object.freeze({
87
87
  failOnAllMissing: !0,
88
88
  allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"],
89
89
  debugLogging: !1
90
- }), S = Object.freeze({
90
+ }), E = Object.freeze({
91
91
  // Loader configuration (always an array, composite behavior is implicit)
92
92
  loaders: [],
93
93
  // Shared loader settings
@@ -162,8 +162,8 @@ const Et = Object.freeze({
162
162
  easing: "cubic-bezier(0.25, 1, 0.5, 1)",
163
163
  // smooth deceleration
164
164
  path: Tt,
165
- rotation: Rt,
166
- scale: At
165
+ rotation: At,
166
+ scale: Rt
167
167
  })
168
168
  }),
169
169
  // Pattern-based interaction configuration
@@ -204,8 +204,7 @@ const Et = Object.freeze({
204
204
  }),
205
205
  ui: Object.freeze({
206
206
  showLoadingSpinner: !1,
207
- showImageCounter: void 0,
208
- // STUB: Not implemented yet
207
+ showImageCounter: !1,
209
208
  showThumbnails: void 0,
210
209
  // STUB: Not implemented yet
211
210
  theme: void 0
@@ -316,83 +315,83 @@ function Jt(o = {}) {
316
315
  loaders: n,
317
316
  config: r,
318
317
  image: Yt(Dt, i),
319
- layout: { ...S.layout },
320
- animation: { ...S.animation },
321
- interaction: { ...S.interaction },
322
- rendering: { ...S.rendering },
318
+ layout: { ...E.layout },
319
+ animation: { ...E.animation },
320
+ interaction: { ...E.interaction },
321
+ rendering: { ...E.rendering },
323
322
  styling: qt($t, o.styling),
324
- debug: S.debug
323
+ debug: E.debug
325
324
  };
326
325
  return o.layout && (s.layout = {
327
- ...S.layout,
326
+ ...E.layout,
328
327
  ...o.layout
329
328
  }, o.layout.responsive && (s.layout.responsive = {
330
- ...S.layout.responsive,
331
- mobile: o.layout.responsive.mobile ? { ...S.layout.responsive.mobile, ...o.layout.responsive.mobile } : S.layout.responsive.mobile,
332
- tablet: o.layout.responsive.tablet ? { ...S.layout.responsive.tablet, ...o.layout.responsive.tablet } : S.layout.responsive.tablet
329
+ ...E.layout.responsive,
330
+ mobile: o.layout.responsive.mobile ? { ...E.layout.responsive.mobile, ...o.layout.responsive.mobile } : E.layout.responsive.mobile,
331
+ tablet: o.layout.responsive.tablet ? { ...E.layout.responsive.tablet, ...o.layout.responsive.tablet } : E.layout.responsive.tablet
333
332
  }), o.layout.spacing && (s.layout.spacing = {
334
- ...S.layout.spacing,
333
+ ...E.layout.spacing,
335
334
  ...o.layout.spacing
336
335
  })), o.animation && (s.animation = {
337
- ...S.animation,
336
+ ...E.animation,
338
337
  ...o.animation
339
338
  }, o.animation.easing && (s.animation.easing = {
340
- ...S.animation.easing,
339
+ ...E.animation.easing,
341
340
  ...o.animation.easing
342
341
  }), o.animation.queue && (s.animation.queue = {
343
- ...S.animation.queue,
342
+ ...E.animation.queue,
344
343
  ...o.animation.queue
345
344
  }), o.animation.performance && (s.animation.performance = {
346
- ...S.animation.performance,
345
+ ...E.animation.performance,
347
346
  ...o.animation.performance
348
347
  }), o.animation.entry && (s.animation.entry = {
349
- ...S.animation.entry,
348
+ ...E.animation.entry,
350
349
  ...o.animation.entry,
351
350
  start: o.animation.entry.start ? {
352
- ...S.animation.entry.start,
351
+ ...E.animation.entry.start,
353
352
  ...o.animation.entry.start,
354
- circular: o.animation.entry.start.circular ? { ...S.animation.entry.start.circular, ...o.animation.entry.start.circular } : S.animation.entry.start.circular
355
- } : S.animation.entry.start,
356
- timing: o.animation.entry.timing ? { ...S.animation.entry.timing, ...o.animation.entry.timing } : S.animation.entry.timing,
357
- path: o.animation.entry.path ? { ...Tt, ...o.animation.entry.path } : S.animation.entry.path,
358
- rotation: o.animation.entry.rotation ? { ...Rt, ...o.animation.entry.rotation } : S.animation.entry.rotation,
359
- scale: o.animation.entry.scale ? { ...At, ...o.animation.entry.scale } : S.animation.entry.scale
353
+ circular: o.animation.entry.start.circular ? { ...E.animation.entry.start.circular, ...o.animation.entry.start.circular } : E.animation.entry.start.circular
354
+ } : E.animation.entry.start,
355
+ timing: o.animation.entry.timing ? { ...E.animation.entry.timing, ...o.animation.entry.timing } : E.animation.entry.timing,
356
+ path: o.animation.entry.path ? { ...Tt, ...o.animation.entry.path } : E.animation.entry.path,
357
+ rotation: o.animation.entry.rotation ? { ...At, ...o.animation.entry.rotation } : E.animation.entry.rotation,
358
+ scale: o.animation.entry.scale ? { ...Rt, ...o.animation.entry.scale } : E.animation.entry.scale
360
359
  })), o.interaction && (s.interaction = {
361
- ...S.interaction,
360
+ ...E.interaction,
362
361
  ...o.interaction
363
362
  }, o.interaction.focus && (s.interaction.focus = {
364
- ...S.interaction.focus,
363
+ ...E.interaction.focus,
365
364
  ...o.interaction.focus
366
365
  }), o.interaction.navigation && (s.interaction.navigation = {
367
- ...S.interaction.navigation,
366
+ ...E.interaction.navigation,
368
367
  ...o.interaction.navigation
369
368
  }), o.interaction.gestures && (s.interaction.gestures = {
370
- ...S.interaction.gestures,
369
+ ...E.interaction.gestures,
371
370
  ...o.interaction.gestures
372
371
  })), o.rendering && (s.rendering = {
373
- ...S.rendering,
372
+ ...E.rendering,
374
373
  ...o.rendering
375
374
  }, o.rendering.responsive && (s.rendering.responsive = {
376
- ...S.rendering.responsive,
375
+ ...E.rendering.responsive,
377
376
  ...o.rendering.responsive,
378
- breakpoints: o.rendering.responsive.breakpoints ? { ...S.rendering.responsive.breakpoints, ...o.rendering.responsive.breakpoints } : S.rendering.responsive.breakpoints,
379
- mobileDetection: o.rendering.responsive.mobileDetection ? o.rendering.responsive.mobileDetection : S.rendering.responsive.mobileDetection
377
+ breakpoints: o.rendering.responsive.breakpoints ? { ...E.rendering.responsive.breakpoints, ...o.rendering.responsive.breakpoints } : E.rendering.responsive.breakpoints,
378
+ mobileDetection: o.rendering.responsive.mobileDetection ? o.rendering.responsive.mobileDetection : E.rendering.responsive.mobileDetection
380
379
  }), o.rendering.ui && (s.rendering.ui = {
381
- ...S.rendering.ui,
380
+ ...E.rendering.ui,
382
381
  ...o.rendering.ui
383
382
  }), o.rendering.performance && (s.rendering.performance = {
384
- ...S.rendering.performance,
383
+ ...E.rendering.performance,
385
384
  ...o.rendering.performance
386
385
  })), o.debug !== void 0 && (s.debug = o.debug), s;
387
386
  }
388
387
  function Vt(o, t) {
389
- return { ...o ? Ct[o] : Ct.playful, ...t };
388
+ return { ...o ? Mt[o] : Mt.playful, ...t };
390
389
  }
391
390
  function Kt(o, t) {
392
391
  return { ...o ? Lt[o] : Lt.gentle, ...t };
393
392
  }
394
393
  function Zt(o, t) {
395
- return { ...o ? zt[o] : zt.gentle, ...t };
394
+ return { ...o ? Ft[o] : Ft.gentle, ...t };
396
395
  }
397
396
  class Qt {
398
397
  constructor(t) {
@@ -653,22 +652,22 @@ function re(o) {
653
652
  startRotation: d,
654
653
  scaleConfig: m,
655
654
  startScale: b
656
- } = o, p = n.type, g = d !== void 0 && d !== h, f = (c == null ? void 0 : c.mode) === "wobble", y = (c == null ? void 0 : c.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, v = g || f, I = b !== void 0 && b !== l, R = (m == null ? void 0 : m.mode) === "pop", w = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
657
- if ((p === "linear" || p === "arc") && !v && !(I || R)) {
655
+ } = o, p = n.type, g = d !== void 0 && d !== h, f = (c == null ? void 0 : c.mode) === "wobble", y = (c == null ? void 0 : c.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, v = g || f, I = b !== void 0 && b !== l, A = (m == null ? void 0 : m.mode) === "pop", w = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
656
+ if ((p === "linear" || p === "arc") && !v && !(I || A)) {
658
657
  u && u();
659
658
  return;
660
659
  }
661
660
  const N = performance.now(), P = -r / 2, D = -s / 2;
662
661
  function U(j) {
663
662
  const L = j - N, x = Math.min(L / a, 1);
664
- let A;
663
+ let R;
665
664
  switch (p) {
666
665
  case "bounce": {
667
666
  const H = Vt(
668
667
  n.bouncePreset,
669
668
  n.bounce
670
669
  );
671
- A = te(x, e, i, H);
670
+ R = te(x, e, i, H);
672
671
  break;
673
672
  }
674
673
  case "elastic": {
@@ -676,7 +675,7 @@ function re(o) {
676
675
  n.elasticPreset,
677
676
  n.elastic
678
677
  );
679
- A = ie(x, e, i, H);
678
+ R = ie(x, e, i, H);
680
679
  break;
681
680
  }
682
681
  case "wave": {
@@ -684,20 +683,20 @@ function re(o) {
684
683
  n.wavePreset,
685
684
  n.wave
686
685
  );
687
- A = ne(x, e, i, H);
686
+ R = ne(x, e, i, H);
688
687
  break;
689
688
  }
690
689
  default:
691
- A = {
690
+ R = {
692
691
  x: st(e.x, i.x, x),
693
692
  y: st(e.y, i.y, x)
694
693
  };
695
694
  }
696
- const O = A.x - i.x, C = A.y - i.y;
695
+ const O = R.x - i.x, M = R.y - i.y;
697
696
  let T;
698
697
  f ? T = se(x, h, y) : g ? T = st(d, h, x) : T = h;
699
- let M;
700
- R ? M = ae(x, l, w) : I ? M = st(b, l, x) : M = l, t.style.transform = `translate(${P}px, ${D}px) translate(${O}px, ${C}px) rotate(${T}deg) scale(${M})`, x < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${P}px, ${D}px) rotate(${h}deg) scale(${l})`, u && u());
698
+ let C;
699
+ A ? C = ae(x, l, w) : I ? C = st(b, l, x) : C = l, t.style.transform = `translate(${P}px, ${D}px) translate(${O}px, ${M}px) rotate(${T}deg) scale(${C})`, x < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${P}px, ${D}px) rotate(${h}deg) scale(${l})`, u && u());
701
700
  }
702
701
  requestAnimationFrame(U);
703
702
  }
@@ -714,7 +713,7 @@ const le = {
714
713
  };
715
714
  class he {
716
715
  constructor(t, e) {
717
- this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || Tt, this.rotationConfig = t.rotation || Rt, this.scaleConfig = t.scale || At;
716
+ this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || Tt, this.rotationConfig = t.rotation || At, this.scaleConfig = t.scale || Rt;
718
717
  }
719
718
  /**
720
719
  * Get the effective start position, considering layout-aware defaults
@@ -1068,15 +1067,15 @@ class de {
1068
1067
  * @returns Array of layout objects with position, rotation, scale
1069
1068
  */
1070
1069
  generate(t, e, i = {}) {
1071
- var w, F, N, P, D, U, j, L, x;
1072
- const n = [], { width: a, height: r } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? 200, l = ((w = this.imageConfig.rotation) == null ? void 0 : w.mode) ?? "none", u = ((N = (F = this.imageConfig.rotation) == null ? void 0 : F.range) == null ? void 0 : N.min) ?? -15, c = ((D = (P = this.imageConfig.rotation) == null ? void 0 : P.range) == null ? void 0 : D.max) ?? 15, d = ((j = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : j.min) ?? 1, m = ((x = (L = this.imageConfig.sizing) == null ? void 0 : L.variance) == null ? void 0 : x.max) ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, y = a - s - g, v = r - s - f, I = s + g, R = s + f;
1073
- for (let A = 0; A < t; A++) {
1074
- const O = this.random(I, y), C = this.random(R, v), T = l === "random" ? this.random(u, c) : 0, M = b ? this.random(d, m) : 1, H = h * M, K = {
1075
- id: A,
1070
+ var w, z, N, P, D, U, j, L, x;
1071
+ const n = [], { width: a, height: r } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? 200, l = ((w = this.imageConfig.rotation) == null ? void 0 : w.mode) ?? "none", u = ((N = (z = this.imageConfig.rotation) == null ? void 0 : z.range) == null ? void 0 : N.min) ?? -15, c = ((D = (P = this.imageConfig.rotation) == null ? void 0 : P.range) == null ? void 0 : D.max) ?? 15, d = ((j = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : j.min) ?? 1, m = ((x = (L = this.imageConfig.sizing) == null ? void 0 : L.variance) == null ? void 0 : x.max) ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, y = a - s - g, v = r - s - f, I = s + g, A = s + f;
1072
+ for (let R = 0; R < t; R++) {
1073
+ const O = this.random(I, y), M = this.random(A, v), T = l === "random" ? this.random(u, c) : 0, C = b ? this.random(d, m) : 1, H = h * C, K = {
1074
+ id: R,
1076
1075
  x: O,
1077
- y: C,
1076
+ y: M,
1078
1077
  rotation: T,
1079
- scale: M,
1078
+ scale: C,
1080
1079
  baseSize: H
1081
1080
  };
1082
1081
  n.push(K);
@@ -1105,10 +1104,10 @@ class ue {
1105
1104
  * @returns Array of layout objects with position, rotation, scale
1106
1105
  */
1107
1106
  generate(t, e, i = {}) {
1108
- var F, N, P, D, U, j, L, x, A;
1109
- const n = [], { width: a, height: r } = e, { debugRadials: s } = this.config, h = i.fixedHeight ?? 200, l = ((F = this.imageConfig.rotation) == null ? void 0 : F.mode) ?? "none", u = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.min) ?? -15, c = ((U = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : U.max) ?? 15, d = ((L = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : L.min) ?? 1, m = ((A = (x = this.imageConfig.sizing) == null ? void 0 : x.variance) == null ? void 0 : A.max) ?? 1, b = d !== 1 || m !== 1, p = this.config.scaleDecay ?? 0, g = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, y = a / 2, v = r / 2, I = Math.ceil(Math.sqrt(t));
1107
+ var z, N, P, D, U, j, L, x, R;
1108
+ const n = [], { width: a, height: r } = e, { debugRadials: s } = this.config, h = i.fixedHeight ?? 200, l = ((z = this.imageConfig.rotation) == null ? void 0 : z.mode) ?? "none", u = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.min) ?? -15, c = ((U = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : U.max) ?? 15, d = ((L = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : L.min) ?? 1, m = ((R = (x = this.imageConfig.sizing) == null ? void 0 : x.variance) == null ? void 0 : R.max) ?? 1, b = d !== 1 || m !== 1, p = this.config.scaleDecay ?? 0, g = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, y = a / 2, v = r / 2, I = Math.ceil(Math.sqrt(t));
1110
1109
  if (t > 0) {
1111
- const O = b ? this.random(d, m) : 1, C = f * O;
1110
+ const O = b ? this.random(d, m) : 1, M = f * O;
1112
1111
  n.push({
1113
1112
  id: 0,
1114
1113
  x: y,
@@ -1116,37 +1115,37 @@ class ue {
1116
1115
  rotation: l === "random" ? this.random(u * 0.33, c * 0.33) : 0,
1117
1116
  // Less rotation for center
1118
1117
  scale: O,
1119
- baseSize: C,
1118
+ baseSize: M,
1120
1119
  zIndex: 100,
1121
1120
  // Center image is highest
1122
1121
  borderColor: s ? "cyan" : void 0
1123
1122
  });
1124
1123
  }
1125
- let R = 1, w = 1;
1126
- for (; R < t; ) {
1127
- const O = w / I, C = p > 0 ? 1 - O * p * 0.5 : 1, T = w * (f * 0.8), M = T * 1.5, H = Math.PI * (3 * (M + T) - Math.sqrt((3 * M + T) * (M + 3 * T))), K = this.estimateWidth(f), X = Math.floor(H / (K * 0.7));
1124
+ let A = 1, w = 1;
1125
+ for (; A < t; ) {
1126
+ const O = w / I, M = p > 0 ? 1 - O * p * 0.5 : 1, T = w * (f * 0.8), C = T * 1.5, H = Math.PI * (3 * (C + T) - Math.sqrt((3 * C + T) * (C + 3 * T))), K = this.estimateWidth(f), X = Math.floor(H / (K * 0.7));
1128
1127
  if (X === 0) {
1129
1128
  w++;
1130
1129
  continue;
1131
1130
  }
1132
1131
  const B = 2 * Math.PI / X, Z = w * (20 * Math.PI / 180);
1133
- for (let W = 0; W < X && R < t; W++) {
1134
- const Q = W * B + Z, tt = b ? this.random(d, m) : 1, q = C * tt, et = f * q;
1135
- let Y = y + Math.cos(Q) * M, z = v + Math.sin(Q) * T;
1132
+ for (let W = 0; W < X && A < t; W++) {
1133
+ const Q = W * B + Z, tt = b ? this.random(d, m) : 1, q = M * tt, et = f * q;
1134
+ let Y = y + Math.cos(Q) * C, F = v + Math.sin(Q) * T;
1136
1135
  const $ = this.config.spacing.padding ?? 50, G = et * 1.5 / 2, _ = et / 2;
1137
- Y - G < $ ? Y = $ + G : Y + G > a - $ && (Y = a - $ - G), z - _ < $ ? z = $ + _ : z + _ > r - $ && (z = r - $ - _);
1136
+ Y - G < $ ? Y = $ + G : Y + G > a - $ && (Y = a - $ - G), F - _ < $ ? F = $ + _ : F + _ > r - $ && (F = r - $ - _);
1138
1137
  const it = l === "random" ? this.random(u, c) : 0;
1139
1138
  n.push({
1140
- id: R,
1139
+ id: A,
1141
1140
  x: Y,
1142
- y: z,
1141
+ y: F,
1143
1142
  rotation: it,
1144
1143
  scale: q,
1145
1144
  baseSize: et,
1146
1145
  zIndex: Math.max(1, 100 - w),
1147
1146
  // Outer rings have lower z-index
1148
1147
  borderColor: s ? g[(w - 1) % g.length] : void 0
1149
- }), R++;
1148
+ }), A++;
1150
1149
  }
1151
1150
  w++;
1152
1151
  }
@@ -1181,7 +1180,7 @@ const ge = {
1181
1180
  alignment: "center",
1182
1181
  gap: 10,
1183
1182
  overflowOffset: 0.25
1184
- }, Ft = [
1183
+ }, zt = [
1185
1184
  { x: 1, y: 1 },
1186
1185
  // bottom-right
1187
1186
  { x: -1, y: -1 },
@@ -1218,41 +1217,41 @@ class fe {
1218
1217
  p,
1219
1218
  l,
1220
1219
  s
1221
- ), y = s.stagger === "row", v = s.stagger === "column", I = y ? g + 0.5 : g, R = v ? f + 0.5 : f, w = (b - s.gap * (g - 1)) / I, F = (p - s.gap * (f - 1)) / R, N = y ? w / 2 : 0, P = v ? F / 2 : 0, D = 1 + s.overlap, U = Math.min(w, F) * D, j = i.fixedHeight ? Math.min(i.fixedHeight, U) : U, L = g * w + (g - 1) * s.gap + N, x = f * F + (f - 1) * s.gap + P, A = h + (b - L) / 2, O = h + (p - x) / 2, C = g * f, T = s.columns !== "auto" && s.rows !== "auto", M = T && t > C;
1220
+ ), y = s.stagger === "row", v = s.stagger === "column", I = y ? g + 0.5 : g, A = v ? f + 0.5 : f, w = (b - s.gap * (g - 1)) / I, z = (p - s.gap * (f - 1)) / A, N = y ? w / 2 : 0, P = v ? z / 2 : 0, D = 1 + s.overlap, U = Math.min(w, z) * D, j = i.fixedHeight ? Math.min(i.fixedHeight, U) : U, L = g * w + (g - 1) * s.gap + N, x = f * z + (f - 1) * s.gap + P, R = h + (b - L) / 2, O = h + (p - x) / 2, M = g * f, T = s.columns !== "auto" && s.rows !== "auto", C = T && t > M;
1222
1221
  typeof window < "u" && (window.__gridOverflowDebug = {
1223
1222
  gridConfigColumns: s.columns,
1224
1223
  gridConfigRows: s.rows,
1225
1224
  columns: g,
1226
1225
  rows: f,
1227
- cellCount: C,
1226
+ cellCount: M,
1228
1227
  hasFixedGrid: T,
1229
1228
  imageCount: t,
1230
- isOverflowMode: M
1229
+ isOverflowMode: C
1231
1230
  });
1232
- const H = M ? new Array(C).fill(0) : [], K = Math.min(w, F) * s.overflowOffset;
1233
- for (let z = 0; z < t; z++) {
1231
+ const H = C ? new Array(M).fill(0) : [], K = Math.min(w, z) * s.overflowOffset;
1232
+ for (let F = 0; F < t; F++) {
1234
1233
  let $, k, G = 0;
1235
- if (M && z >= C) {
1236
- const V = z - C, J = V % C;
1237
- G = Math.floor(V / C) + 1, H[J]++, s.fillDirection === "row" ? ($ = J % g, k = Math.floor(J / g)) : (k = J % f, $ = Math.floor(J / f));
1234
+ if (C && F >= M) {
1235
+ const V = F - M, J = V % M;
1236
+ G = Math.floor(V / M) + 1, H[J]++, s.fillDirection === "row" ? ($ = J % g, k = Math.floor(J / g)) : (k = J % f, $ = Math.floor(J / f));
1238
1237
  } else
1239
- s.fillDirection === "row" ? ($ = z % g, k = Math.floor(z / g)) : (k = z % f, $ = Math.floor(z / f));
1240
- let _ = A + $ * (w + s.gap) + w / 2, it = O + k * (F + s.gap) + F / 2;
1241
- if (s.stagger === "row" && k % 2 === 1 ? _ += w / 2 : s.stagger === "column" && $ % 2 === 1 && (it += F / 2), G > 0) {
1242
- const V = (G - 1) % Ft.length, J = Ft[V];
1238
+ s.fillDirection === "row" ? ($ = F % g, k = Math.floor(F / g)) : (k = F % f, $ = Math.floor(F / f));
1239
+ let _ = R + $ * (w + s.gap) + w / 2, it = O + k * (z + s.gap) + z / 2;
1240
+ if (s.stagger === "row" && k % 2 === 1 ? _ += w / 2 : s.stagger === "column" && $ % 2 === 1 && (it += z / 2), G > 0) {
1241
+ const V = (G - 1) % zt.length, J = zt[V];
1243
1242
  _ += J.x * K, it += J.y * K;
1244
1243
  }
1245
1244
  if (s.jitter > 0) {
1246
- const V = w / 2 * s.jitter, J = F / 2 * s.jitter;
1245
+ const V = w / 2 * s.jitter, J = z / 2 * s.jitter;
1247
1246
  _ += this.random(-V, V), it += this.random(-J, J);
1248
1247
  }
1249
1248
  let nt = _, ot = it;
1250
- if (!M && s.fillDirection === "row") {
1249
+ if (!C && s.fillDirection === "row") {
1251
1250
  const V = t % g || g;
1252
1251
  if (k === Math.floor((t - 1) / g) && V < g) {
1253
- const Mt = V * w + (V - 1) * s.gap;
1254
- let St = 0;
1255
- s.alignment === "center" ? St = (L - Mt) / 2 : s.alignment === "end" && (St = L - Mt), nt += St;
1252
+ const Ct = V * w + (V - 1) * s.gap;
1253
+ let Et = 0;
1254
+ s.alignment === "center" ? Et = (L - Ct) / 2 : s.alignment === "end" && (Et = L - Ct), nt += Et;
1256
1255
  }
1257
1256
  }
1258
1257
  const pt = m ? this.random(c, d) : 1, at = j * pt, dt = at * 1.5 / 2, ut = at / 2, yt = h + dt, vt = a - h - dt, Ht = h + ut, Nt = r - h - ut;
@@ -1263,8 +1262,8 @@ class fe {
1263
1262
  s.jitter > 0 ? wt = this.random(V * s.jitter, J * s.jitter) : wt = this.random(V, J);
1264
1263
  }
1265
1264
  let xt;
1266
- M && G > 0 ? xt = 50 - G : xt = M ? 100 + z : z + 1, n.push({
1267
- id: z,
1265
+ C && G > 0 ? xt = 50 - G : xt = C ? 100 + F : F + 1, n.push({
1266
+ id: F,
1268
1267
  x: nt,
1269
1268
  y: ot,
1270
1269
  rotation: wt,
@@ -1319,32 +1318,32 @@ class be {
1319
1318
  * @returns Array of layout objects with position, rotation, scale
1320
1319
  */
1321
1320
  generate(t, e, i = {}) {
1322
- var R, w, F, N, P, D, U, j, L;
1323
- const n = [], { width: a, height: r } = e, s = { ...pe, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((R = this.imageConfig.rotation) == null ? void 0 : R.mode) ?? "none", c = ((F = (w = this.imageConfig.rotation) == null ? void 0 : w.range) == null ? void 0 : F.min) ?? -15, d = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.max) ?? 15, m = ((U = (D = this.imageConfig.sizing) == null ? void 0 : D.variance) == null ? void 0 : U.min) ?? 1, b = ((L = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : L.max) ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? s.scaleDecay, f = a / 2, y = r / 2, v = Math.min(
1321
+ var A, w, z, N, P, D, U, j, L;
1322
+ const n = [], { width: a, height: r } = e, s = { ...pe, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((A = this.imageConfig.rotation) == null ? void 0 : A.mode) ?? "none", c = ((z = (w = this.imageConfig.rotation) == null ? void 0 : w.range) == null ? void 0 : z.min) ?? -15, d = ((P = (N = this.imageConfig.rotation) == null ? void 0 : N.range) == null ? void 0 : P.max) ?? 15, m = ((U = (D = this.imageConfig.sizing) == null ? void 0 : D.variance) == null ? void 0 : U.min) ?? 1, b = ((L = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : L.max) ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? s.scaleDecay, f = a / 2, y = r / 2, v = Math.min(
1324
1323
  f - h - l / 2,
1325
1324
  y - h - l / 2
1326
1325
  ), I = s.direction === "clockwise" ? -1 : 1;
1327
1326
  for (let x = 0; x < t; x++) {
1328
- let A, O;
1327
+ let R, O;
1329
1328
  if (s.spiralType === "golden")
1330
- A = x * me * I + s.startAngle, O = this.calculateGoldenRadius(x, t, v, s.tightness);
1329
+ R = x * me * I + s.startAngle, O = this.calculateGoldenRadius(x, t, v, s.tightness);
1331
1330
  else if (s.spiralType === "archimedean") {
1332
1331
  const _ = x * 0.5 * s.tightness;
1333
- A = _ * I + s.startAngle, O = this.calculateArchimedeanRadius(_, t, v, s.tightness);
1332
+ R = _ * I + s.startAngle, O = this.calculateArchimedeanRadius(_, t, v, s.tightness);
1334
1333
  } else {
1335
1334
  const _ = x * 0.3 * s.tightness;
1336
- A = _ * I + s.startAngle, O = this.calculateLogarithmicRadius(_, t, v, s.tightness);
1335
+ R = _ * I + s.startAngle, O = this.calculateLogarithmicRadius(_, t, v, s.tightness);
1337
1336
  }
1338
- const C = f + Math.cos(A) * O, T = y + Math.sin(A) * O, M = O / v, H = g > 0 ? 1 - M * g * 0.5 : 1, K = p ? this.random(m, b) : 1, X = H * K, B = l * X, W = B * 1.5 / 2, Q = B / 2, tt = h + W, q = a - h - W, et = h + Q, Y = r - h - Q, z = Math.max(tt, Math.min(C, q)), $ = Math.max(et, Math.min(T, Y));
1337
+ const M = f + Math.cos(R) * O, T = y + Math.sin(R) * O, C = O / v, H = g > 0 ? 1 - C * g * 0.5 : 1, K = p ? this.random(m, b) : 1, X = H * K, B = l * X, W = B * 1.5 / 2, Q = B / 2, tt = h + W, q = a - h - W, et = h + Q, Y = r - h - Q, F = Math.max(tt, Math.min(M, q)), $ = Math.max(et, Math.min(T, Y));
1339
1338
  let k = 0;
1340
1339
  if (u === "random") {
1341
- const _ = A * 180 / Math.PI % 360, it = this.random(c, d);
1340
+ const _ = R * 180 / Math.PI % 360, it = this.random(c, d);
1342
1341
  k = s.spiralType === "golden" ? it : _ * 0.1 + it * 0.9;
1343
- } else u === "tangent" && (k = this.calculateSpiralTangent(A, O, s));
1342
+ } else u === "tangent" && (k = this.calculateSpiralTangent(R, O, s));
1344
1343
  const G = t - x;
1345
1344
  n.push({
1346
1345
  id: x,
1347
- x: z,
1346
+ x: F,
1348
1347
  y: $,
1349
1348
  rotation: k,
1350
1349
  scale: X,
@@ -1422,8 +1421,8 @@ class ve {
1422
1421
  * @returns Array of layout objects with position, rotation, scale
1423
1422
  */
1424
1423
  generate(t, e, i = {}) {
1425
- var I, R, w, F, N, P, D, U, j;
1426
- const n = [], { width: a, height: r } = e, s = { ...ye, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((I = this.imageConfig.rotation) == null ? void 0 : I.mode) ?? "none", c = ((w = (R = this.imageConfig.rotation) == null ? void 0 : R.range) == null ? void 0 : w.min) ?? -15, d = ((N = (F = this.imageConfig.rotation) == null ? void 0 : F.range) == null ? void 0 : N.max) ?? 15, m = ((D = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : D.min) ?? 1, b = ((j = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : j.max) ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
1424
+ var I, A, w, z, N, P, D, U, j;
1425
+ const n = [], { width: a, height: r } = e, s = { ...ye, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((I = this.imageConfig.rotation) == null ? void 0 : I.mode) ?? "none", c = ((w = (A = this.imageConfig.rotation) == null ? void 0 : A.range) == null ? void 0 : w.min) ?? -15, d = ((N = (z = this.imageConfig.rotation) == null ? void 0 : z.range) == null ? void 0 : N.max) ?? 15, m = ((D = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : D.min) ?? 1, b = ((j = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : j.max) ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
1427
1426
  t,
1428
1427
  s.clusterCount,
1429
1428
  a,
@@ -1440,22 +1439,22 @@ class ve {
1440
1439
  y[L % g]++;
1441
1440
  let v = 0;
1442
1441
  for (let L = 0; L < g; L++) {
1443
- const x = f[L], A = y[L];
1444
- for (let O = 0; O < A; O++) {
1445
- let C, T;
1442
+ const x = f[L], R = y[L];
1443
+ for (let O = 0; O < R; O++) {
1444
+ let M, T;
1446
1445
  if (s.distribution === "gaussian")
1447
- C = this.gaussianRandom() * x.spread, T = this.gaussianRandom() * x.spread;
1446
+ M = this.gaussianRandom() * x.spread, T = this.gaussianRandom() * x.spread;
1448
1447
  else {
1449
1448
  const k = this.random(0, Math.PI * 2), G = this.random(0, x.spread);
1450
- C = Math.cos(k) * G, T = Math.sin(k) * G;
1449
+ M = Math.cos(k) * G, T = Math.sin(k) * G;
1451
1450
  }
1452
- const M = 1 + s.overlap * 0.5, H = 1 + s.overlap * 0.3;
1453
- C /= M, T /= M;
1451
+ const C = 1 + s.overlap * 0.5, H = 1 + s.overlap * 0.3;
1452
+ M /= C, T /= C;
1454
1453
  const K = p ? this.random(m, b) : 1, X = H * K, B = l * X;
1455
- let Z = x.x + C, W = x.y + T;
1454
+ let Z = x.x + M, W = x.y + T;
1456
1455
  const tt = B * 1.5 / 2, q = B / 2;
1457
1456
  Z = Math.max(h + tt, Math.min(Z, a - h - tt)), W = Math.max(h + q, Math.min(W, r - h - q));
1458
- const et = u === "random" ? this.random(c, d) : 0, z = Math.sqrt(C * C + T * T) / x.spread, $ = Math.round((1 - z) * 50) + 1;
1457
+ const et = u === "random" ? this.random(c, d) : 0, F = Math.sqrt(M * M + T * T) / x.spread, $ = Math.round((1 - F) * 50) + 1;
1459
1458
  n.push({
1460
1459
  id: v,
1461
1460
  x: Z,
@@ -1495,8 +1494,8 @@ class ve {
1495
1494
  };
1496
1495
  let f = 1 / 0;
1497
1496
  for (const y of r) {
1498
- const v = g.x - y.x, I = g.y - y.y, R = Math.sqrt(v * v + I * I);
1499
- f = Math.min(f, R);
1497
+ const v = g.x - y.x, I = g.y - y.y, A = Math.sqrt(v * v + I * I);
1498
+ f = Math.min(f, A);
1500
1499
  }
1501
1500
  if ((r.length === 0 || f > b) && (m = g, b = f), f >= a.clusterSpacing)
1502
1501
  break;
@@ -1541,18 +1540,18 @@ class we {
1541
1540
  * @returns Array of layout objects with position, rotation, scale
1542
1541
  */
1543
1542
  generate(t, e, i = {}) {
1544
- var M, H, K, X, B, Z, W, Q, tt;
1545
- const n = [], { width: a, height: r } = e, s = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, l = ((M = this.imageConfig.rotation) == null ? void 0 : M.mode) ?? "none", u = ((K = (H = this.imageConfig.rotation) == null ? void 0 : H.range) == null ? void 0 : K.min) ?? -15, c = ((B = (X = this.imageConfig.rotation) == null ? void 0 : X.range) == null ? void 0 : B.max) ?? 15, d = ((W = (Z = this.imageConfig.sizing) == null ? void 0 : Z.variance) == null ? void 0 : W.min) ?? 1, m = ((tt = (Q = this.imageConfig.sizing) == null ? void 0 : Q.variance) == null ? void 0 : tt.max) ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? s, g = {
1543
+ var C, H, K, X, B, Z, W, Q, tt;
1544
+ const n = [], { width: a, height: r } = e, s = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, l = ((C = this.imageConfig.rotation) == null ? void 0 : C.mode) ?? "none", u = ((K = (H = this.imageConfig.rotation) == null ? void 0 : H.range) == null ? void 0 : K.min) ?? -15, c = ((B = (X = this.imageConfig.rotation) == null ? void 0 : X.range) == null ? void 0 : B.max) ?? 15, d = ((W = (Z = this.imageConfig.sizing) == null ? void 0 : Z.variance) == null ? void 0 : W.min) ?? 1, m = ((tt = (Q = this.imageConfig.sizing) == null ? void 0 : Q.variance) == null ? void 0 : tt.max) ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? s, g = {
1546
1545
  ...jt,
1547
1546
  ...this.config.wave
1548
- }, { rows: f, amplitude: y, frequency: v, phaseShift: I, synchronization: R } = g, w = Math.ceil(t / f), P = p * 1.5 / 2, D = h + P, U = a - h - P, j = U - D, L = w > 1 ? j / (w - 1) : 0, x = h + y + p / 2, A = r - h - y - p / 2, O = A - x, C = f > 1 ? O / (f - 1) : 0;
1547
+ }, { rows: f, amplitude: y, frequency: v, phaseShift: I, synchronization: A } = g, w = Math.ceil(t / f), P = p * 1.5 / 2, D = h + P, U = a - h - P, j = U - D, L = w > 1 ? j / (w - 1) : 0, x = h + y + p / 2, R = r - h - y - p / 2, O = R - x, M = f > 1 ? O / (f - 1) : 0;
1549
1548
  let T = 0;
1550
1549
  for (let q = 0; q < f && T < t; q++) {
1551
- const et = f === 1 ? (x + A) / 2 : x + q * C;
1550
+ const et = f === 1 ? (x + R) / 2 : x + q * M;
1552
1551
  let Y = 0;
1553
- R === "offset" ? Y = q * I : R === "alternating" && (Y = q * Math.PI);
1554
- for (let z = 0; z < w && T < t; z++) {
1555
- const $ = w === 1 ? (D + U) / 2 : D + z * L, k = this.calculateWaveY($, a, y, v, Y), G = $, _ = et + k, it = b ? this.random(d, m) : 1, nt = p * it;
1552
+ A === "offset" ? Y = q * I : A === "alternating" && (Y = q * Math.PI);
1553
+ for (let F = 0; F < w && T < t; F++) {
1554
+ const $ = w === 1 ? (D + U) / 2 : D + F * L, k = this.calculateWaveY($, a, y, v, Y), G = $, _ = et + k, it = b ? this.random(d, m) : 1, nt = p * it;
1556
1555
  let ot = 0;
1557
1556
  l === "tangent" ? ot = this.calculateRotation($, a, y, v, Y) : l === "random" && (ot = this.random(u, c));
1558
1557
  const at = nt * 1.5 / 2, bt = nt / 2, dt = h + at, ut = a - h - at, yt = h + bt, vt = r - h - bt;
@@ -1728,12 +1727,12 @@ class xe {
1728
1727
  return Math.max(e, Math.min(i, t));
1729
1728
  }
1730
1729
  }
1731
- var E = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(E || {});
1732
- function Se(o) {
1733
- return o in Et;
1734
- }
1730
+ var S = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(S || {});
1735
1731
  function Ee(o) {
1736
- return o ? Se(o) ? Et[o] : o : Et.md;
1732
+ return o in St;
1733
+ }
1734
+ function Se(o) {
1735
+ return o ? Ee(o) ? St[o] : o : St.md;
1737
1736
  }
1738
1737
  function Ie(o) {
1739
1738
  if (!o) return "";
@@ -1765,7 +1764,7 @@ function ft(o) {
1765
1764
  const s = o.border || {}, h = { ...s, ...o.borderTop }, l = { ...s, ...o.borderRight }, u = { ...s, ...o.borderBottom }, c = { ...s, ...o.borderLeft };
1766
1765
  t.borderTop = ct(h), t.borderRight = ct(l), t.borderBottom = ct(u), t.borderLeft = ct(c);
1767
1766
  } else o.border && (t.border = ct(o.border));
1768
- o.shadow !== void 0 && (t.boxShadow = Ee(o.shadow));
1767
+ o.shadow !== void 0 && (t.boxShadow = Se(o.shadow));
1769
1768
  const n = Ie(o.filter);
1770
1769
  if (t.filter = n || "none", o.opacity !== void 0 && (t.opacity = String(o.opacity)), o.cursor !== void 0 && (t.cursor = o.cursor), o.outline && o.outline.style !== "none" && (o.outline.width ?? 0) > 0) {
1771
1770
  const s = o.outline.width ?? 0, h = o.outline.style ?? "solid", l = o.outline.color ?? "#000000";
@@ -1798,7 +1797,7 @@ const Ot = {
1798
1797
  class Te {
1799
1798
  constructor(t, e, i) {
1800
1799
  var n, a;
1801
- this.state = E.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = ft(i == null ? void 0 : i.default), this.focusedStyles = ft(i == null ? void 0 : i.focused), this.defaultClassName = (n = i == null ? void 0 : i.default) == null ? void 0 : n.className, this.focusedClassName = (a = i == null ? void 0 : i.focused) == null ? void 0 : a.className;
1800
+ this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = ft(i == null ? void 0 : i.default), this.focusedStyles = ft(i == null ? void 0 : i.focused), this.defaultClassName = (n = i == null ? void 0 : i.default) == null ? void 0 : n.className, this.focusedClassName = (a = i == null ? void 0 : i.focused) == null ? void 0 : a.className;
1802
1801
  }
1803
1802
  /**
1804
1803
  * Get current state machine state
@@ -1810,7 +1809,7 @@ class Te {
1810
1809
  * Check if any animation is in progress
1811
1810
  */
1812
1811
  isAnimating() {
1813
- return this.state !== E.IDLE && this.state !== E.FOCUSED;
1812
+ return this.state !== S.IDLE && this.state !== S.FOCUSED;
1814
1813
  }
1815
1814
  /**
1816
1815
  * Normalize scalePercent value
@@ -2006,9 +2005,9 @@ class Te {
2006
2005
  */
2007
2006
  async focusImage(t, e, i) {
2008
2007
  var a, r, s, h, l, u, c, d, m, b, p, g;
2009
- if (this.currentFocus === t && this.state === E.FOCUSED)
2008
+ if (this.currentFocus === t && this.state === S.FOCUSED)
2010
2009
  return this.unfocusImage();
2011
- if (((a = this.incoming) == null ? void 0 : a.element) === t && this.state === E.FOCUSING) {
2010
+ if (((a = this.incoming) == null ? void 0 : a.element) === t && this.state === S.FOCUSING) {
2012
2011
  const f = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), y = {
2013
2012
  x: f.x,
2014
2013
  y: f.y,
@@ -2024,17 +2023,17 @@ class Te {
2024
2023
  this.incoming.originalState,
2025
2024
  y,
2026
2025
  v
2027
- ), this.incoming = null, this.state = E.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, ((r = this.focusData) == null ? void 0 : r.originalZIndex) || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = E.IDLE;
2026
+ ), this.incoming = null, this.state = S.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, ((r = this.focusData) == null ? void 0 : r.originalZIndex) || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE;
2028
2027
  return;
2029
2028
  }
2030
2029
  const n = ++this.focusGeneration;
2031
2030
  switch (this.state) {
2032
- case E.IDLE:
2033
- if (this.state = E.FOCUSING, this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2034
- this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
2031
+ case S.IDLE:
2032
+ if (this.state = S.FOCUSING, this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2033
+ this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2035
2034
  break;
2036
- case E.FOCUSED:
2037
- if (this.state = E.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2035
+ case S.FOCUSED:
2036
+ if (this.state = S.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2038
2037
  this.currentFocus,
2039
2038
  this.focusData.originalState
2040
2039
  )), this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
@@ -2042,9 +2041,9 @@ class Te {
2042
2041
  this.waitForAnimation(this.incoming.animationHandle)
2043
2042
  ]), this.focusGeneration !== n)
2044
2043
  return;
2045
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((s = this.outgoing.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
2044
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((s = this.outgoing.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2046
2045
  break;
2047
- case E.FOCUSING:
2046
+ case S.FOCUSING:
2048
2047
  if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
2049
2048
  this.incoming.element,
2050
2049
  this.incoming.originalState,
@@ -2052,16 +2051,16 @@ class Te {
2052
2051
  (l = this.focusData) == null ? void 0 : l.originalWidth,
2053
2052
  (u = this.focusData) == null ? void 0 : u.originalHeight
2054
2053
  ), this.incoming = null), this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2055
- this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
2054
+ this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2056
2055
  break;
2057
- case E.UNFOCUSING:
2058
- if (this.state = E.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2056
+ case S.UNFOCUSING:
2057
+ if (this.state = S.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2059
2058
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2060
2059
  this.waitForAnimation(this.incoming.animationHandle)
2061
2060
  ]), this.focusGeneration !== n) return;
2062
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((c = this.outgoing.originalState.zIndex) == null ? void 0 : c.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
2061
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((c = this.outgoing.originalState.zIndex) == null ? void 0 : c.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2063
2062
  break;
2064
- case E.CROSS_ANIMATING:
2063
+ case S.CROSS_ANIMATING:
2065
2064
  if (((d = this.incoming) == null ? void 0 : d.element) === t)
2066
2065
  return;
2067
2066
  if (((m = this.outgoing) == null ? void 0 : m.element) === t) {
@@ -2076,7 +2075,7 @@ class Te {
2076
2075
  height: t.offsetHeight
2077
2076
  };
2078
2077
  if (this.incoming) {
2079
- const I = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), R = {
2078
+ const I = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), A = {
2080
2079
  x: I.x,
2081
2080
  y: I.y,
2082
2081
  rotation: I.rotation,
@@ -2089,7 +2088,7 @@ class Te {
2089
2088
  this.outgoing = this.startUnfocusAnimation(
2090
2089
  this.incoming.element,
2091
2090
  this.incoming.originalState,
2092
- R,
2091
+ A,
2093
2092
  w
2094
2093
  );
2095
2094
  } else
@@ -2098,7 +2097,7 @@ class Te {
2098
2097
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2099
2098
  this.waitForAnimation(this.incoming.animationHandle)
2100
2099
  ]), this.focusGeneration !== n) return;
2101
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((b = this.outgoing.originalState.zIndex) == null ? void 0 : b.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
2100
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((b = this.outgoing.originalState.zIndex) == null ? void 0 : b.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2102
2101
  return;
2103
2102
  }
2104
2103
  if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
@@ -2129,7 +2128,7 @@ class Te {
2129
2128
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2130
2129
  this.waitForAnimation(this.incoming.animationHandle)
2131
2130
  ]), this.focusGeneration !== n) return;
2132
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((g = this.outgoing.originalState.zIndex) == null ? void 0 : g.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = E.FOCUSED;
2131
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((g = this.outgoing.originalState.zIndex) == null ? void 0 : g.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = S.FOCUSED;
2133
2132
  break;
2134
2133
  }
2135
2134
  }
@@ -2140,7 +2139,7 @@ class Te {
2140
2139
  var a, r, s;
2141
2140
  const t = ++this.focusGeneration;
2142
2141
  if (!this.currentFocus || !this.focusData) {
2143
- if (this.incoming && this.state === E.FOCUSING) {
2142
+ if (this.incoming && this.state === S.FOCUSING) {
2144
2143
  const h = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), l = {
2145
2144
  x: h.x,
2146
2145
  y: h.y,
@@ -2156,12 +2155,12 @@ class Te {
2156
2155
  this.incoming.originalState,
2157
2156
  l,
2158
2157
  u
2159
- ), this.incoming = null, this.state = E.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2160
- this.removeFocusedStyling(this.outgoing.element, ((a = this.focusData) == null ? void 0 : a.originalZIndex) || ""), this.outgoing = null, this.focusData = null, this.state = E.IDLE;
2158
+ ), this.incoming = null, this.state = S.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2159
+ this.removeFocusedStyling(this.outgoing.element, ((a = this.focusData) == null ? void 0 : a.originalZIndex) || ""), this.outgoing = null, this.focusData = null, this.state = S.IDLE;
2161
2160
  }
2162
2161
  return;
2163
2162
  }
2164
- if (this.state === E.CROSS_ANIMATING && this.incoming) {
2163
+ if (this.state === S.CROSS_ANIMATING && this.incoming) {
2165
2164
  const h = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), l = {
2166
2165
  x: h.x,
2167
2166
  y: h.y,
@@ -2181,12 +2180,12 @@ class Te {
2181
2180
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2182
2181
  this.waitForAnimation(c.animationHandle)
2183
2182
  ]), this.focusGeneration !== t) return;
2184
- this.outgoing && this.removeFocusedStyling(this.outgoing.element, ((r = this.outgoing.originalState.zIndex) == null ? void 0 : r.toString()) || ""), this.removeFocusedStyling(c.element, ((s = this.incoming.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = E.IDLE;
2183
+ this.outgoing && this.removeFocusedStyling(this.outgoing.element, ((r = this.outgoing.originalState.zIndex) == null ? void 0 : r.toString()) || ""), this.removeFocusedStyling(c.element, ((s = this.incoming.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE;
2185
2184
  return;
2186
2185
  }
2187
- this.state = E.UNFOCUSING;
2186
+ this.state = S.UNFOCUSING;
2188
2187
  const e = this.currentFocus, i = this.focusData.originalState, n = this.focusData.originalZIndex;
2189
- this.outgoing = this.startUnfocusAnimation(e, i), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(e, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = E.IDLE);
2188
+ this.outgoing = this.startUnfocusAnimation(e, i), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(e, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = S.IDLE);
2190
2189
  }
2191
2190
  /**
2192
2191
  * Swap focus from current image to a new one (alias for focusImage with cross-animation)
@@ -2204,7 +2203,7 @@ class Te {
2204
2203
  * Check if an image is currently focused (stable state)
2205
2204
  */
2206
2205
  isFocused(t) {
2207
- return this.currentFocus === t && this.state === E.FOCUSED;
2206
+ return this.currentFocus === t && this.state === S.FOCUSED;
2208
2207
  }
2209
2208
  /**
2210
2209
  * Check if an image is the target of current focus animation
@@ -2227,7 +2226,7 @@ class Te {
2227
2226
  * Used during swipe gestures for visual feedback
2228
2227
  */
2229
2228
  setDragOffset(t) {
2230
- if (!this.currentFocus || !this.focusData || this.state !== E.FOCUSED) return;
2229
+ if (!this.currentFocus || !this.focusData || this.state !== S.FOCUSED) return;
2231
2230
  const e = this.currentFocus, i = this.focusData.focusTransform, n = ["translate(-50%, -50%)"], a = (i.x ?? 0) + t, r = i.y ?? 0;
2232
2231
  n.push(`translate(${a}px, ${r}px)`), i.rotation !== void 0 && n.push(`rotate(${i.rotation}deg)`), e.style.transition = "none", e.style.transform = n.join(" ");
2233
2232
  }
@@ -2237,7 +2236,7 @@ class Te {
2237
2236
  * @param duration - Animation duration in ms (default 150)
2238
2237
  */
2239
2238
  clearDragOffset(t, e = 150) {
2240
- if (!this.currentFocus || !this.focusData || this.state !== E.FOCUSED) return;
2239
+ if (!this.currentFocus || !this.focusData || this.state !== S.FOCUSED) return;
2241
2240
  const i = this.currentFocus, n = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = n.x ?? 0, s = n.y ?? 0;
2242
2241
  a.push(`translate(${r}px, ${s}px)`), n.rotation !== void 0 && a.push(`rotate(${n.rotation}deg)`);
2243
2242
  const h = a.join(" ");
@@ -2268,10 +2267,10 @@ class Te {
2268
2267
  this.focusData.originalZIndex,
2269
2268
  this.focusData.originalWidth,
2270
2269
  this.focusData.originalHeight
2271
- ), this.state = E.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2270
+ ), this.state = S.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2272
2271
  }
2273
2272
  }
2274
- const Re = 50, Ae = 0.5, Me = 20, Ce = 0.3, Le = 150, ze = 30, mt = class mt {
2273
+ const Ae = 50, Re = 0.5, Ce = 20, Me = 0.3, Le = 150, Fe = 30, mt = class mt {
2275
2274
  constructor(t, e) {
2276
2275
  this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = e, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
2277
2276
  }
@@ -2319,11 +2318,11 @@ const Re = 50, Ae = 0.5, Me = 20, Ce = 0.3, Le = 150, ze = 30, mt = class mt {
2319
2318
  const e = t.touches[0], i = e.clientX - this.touchState.startX, n = e.clientY - this.touchState.startY;
2320
2319
  if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + n * n) > 10) {
2321
2320
  const s = Math.atan2(Math.abs(n), Math.abs(i)) * (180 / Math.PI);
2322
- this.touchState.isHorizontalSwipe = s <= ze;
2321
+ this.touchState.isHorizontalSwipe = s <= Fe;
2323
2322
  }
2324
2323
  if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2325
2324
  t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
2326
- const a = i * Ce;
2325
+ const a = i * Me;
2327
2326
  this.callbacks.onDragOffset(a);
2328
2327
  }
2329
2328
  }
@@ -2332,7 +2331,7 @@ const Re = 50, Ae = 0.5, Me = 20, Ce = 0.3, Le = 150, ze = 30, mt = class mt {
2332
2331
  this.recentTouchTimestamp = Date.now();
2333
2332
  const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, n = Math.abs(e) / i, a = Math.abs(e);
2334
2333
  let r = !1;
2335
- this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Re || n >= Ae && a >= Me) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2334
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Ae || n >= Re && a >= Ce) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2336
2335
  }
2337
2336
  handleTouchCancel(t) {
2338
2337
  var e;
@@ -2341,7 +2340,7 @@ const Re = 50, Ae = 0.5, Me = 20, Ce = 0.3, Le = 150, ze = 30, mt = class mt {
2341
2340
  };
2342
2341
  mt.TOUCH_CLICK_DELAY = 300;
2343
2342
  let It = mt;
2344
- class Fe {
2343
+ class ze {
2345
2344
  constructor(t) {
2346
2345
  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)
2347
2346
  throw new Error("GoogleDriveLoader requires at least one source to be configured");
@@ -2874,6 +2873,15 @@ const Ue = `
2874
2873
  will-change: auto;
2875
2874
  }
2876
2875
 
2876
+ .fbn-ic-counter {
2877
+ position: fixed;
2878
+ bottom: 24px;
2879
+ left: 50%;
2880
+ transform: translateX(-50%);
2881
+ z-index: 10001;
2882
+ pointer-events: none;
2883
+ }
2884
+
2877
2885
  .fbn-ic-hidden {
2878
2886
  display: none !important;
2879
2887
  }
@@ -2888,11 +2896,11 @@ function Pe() {
2888
2896
  class _e {
2889
2897
  constructor(t = {}) {
2890
2898
  var i, n, a, r, s, h;
2891
- 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.animationEngine = new Qt(this.fullConfig.animation), this.layoutEngine = new xe({
2899
+ 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 xe({
2892
2900
  layout: this.fullConfig.layout,
2893
2901
  image: this.fullConfig.image
2894
2902
  }), this.zoomEngine = new Te(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = ft((i = this.fullConfig.styling) == null ? void 0 : i.default), this.hoverStyles = ft((n = this.fullConfig.styling) == null ? void 0 : n.hover), this.defaultClassName = (r = (a = this.fullConfig.styling) == null ? void 0 : a.default) == null ? void 0 : r.className, this.hoverClassName = (h = (s = this.fullConfig.styling) == null ? void 0 : s.hover) == null ? void 0 : h.className;
2895
- const e = this.fullConfig.animation.entry || S.animation.entry;
2903
+ const e = this.fullConfig.animation.entry || E.animation.entry;
2896
2904
  this.entryAnimationEngine = new he(
2897
2905
  e,
2898
2906
  this.fullConfig.layout.algorithm
@@ -2941,7 +2949,7 @@ class _e {
2941
2949
  allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2942
2950
  debugLogging: i.debugLogging ?? e.debugLogging
2943
2951
  };
2944
- return new Fe(n);
2952
+ return new ze(n);
2945
2953
  } else
2946
2954
  throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
2947
2955
  }
@@ -2968,7 +2976,7 @@ class _e {
2968
2976
  }
2969
2977
  setupUI() {
2970
2978
  const t = this.fullConfig.rendering.ui;
2971
- t.showLoadingSpinner && (t.loadingElement ? (this.loadingEl = this.resolveElement(t.loadingElement), this.loadingElAutoCreated = !1) : (this.loadingEl = this.createDefaultLoadingElement(), this.loadingElAutoCreated = !0)), t.errorElement ? (this.errorEl = this.resolveElement(t.errorElement), this.errorElAutoCreated = !1) : (this.errorEl = this.createDefaultErrorElement(), this.errorElAutoCreated = !0);
2979
+ t.showLoadingSpinner && (t.loadingElement ? (this.loadingEl = this.resolveElement(t.loadingElement), this.loadingElAutoCreated = !1) : (this.loadingEl = this.createDefaultLoadingElement(), this.loadingElAutoCreated = !0)), t.errorElement ? (this.errorEl = this.resolveElement(t.errorElement), this.errorElAutoCreated = !1) : (this.errorEl = this.createDefaultErrorElement(), this.errorElAutoCreated = !0), t.showImageCounter && (t.counterElement ? (this.counterEl = this.resolveElement(t.counterElement), this.counterElAutoCreated = !1) : (this.counterEl = this.createDefaultCounterElement(), this.counterElAutoCreated = !0));
2972
2980
  }
2973
2981
  resolveElement(t) {
2974
2982
  return t instanceof HTMLElement ? t : document.getElementById(t);
@@ -2985,13 +2993,17 @@ class _e {
2985
2993
  const t = document.createElement("div");
2986
2994
  return t.className = "fbn-ic-error fbn-ic-hidden", this.containerEl.appendChild(t), t;
2987
2995
  }
2996
+ createDefaultCounterElement() {
2997
+ const t = document.createElement("div");
2998
+ return t.className = "fbn-ic-counter fbn-ic-hidden", this.containerEl.appendChild(t), t;
2999
+ }
2988
3000
  setupEventListeners() {
2989
3001
  document.addEventListener("keydown", (t) => {
2990
3002
  var e;
2991
- t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (e = this.swipeEngine) == null || e.disable()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
3003
+ t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (e = this.swipeEngine) == null || e.disable(), this.hideCounter()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
2992
3004
  }), document.addEventListener("click", (t) => {
2993
3005
  var e, i;
2994
- (e = this.swipeEngine) != null && e.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (i = this.swipeEngine) == null || i.disable());
3006
+ (e = this.swipeEngine) != null && e.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (i = this.swipeEngine) == null || i.disable(), this.hideCounter());
2995
3007
  }), window.addEventListener("resize", () => this.handleResize());
2996
3008
  }
2997
3009
  /**
@@ -3000,7 +3012,7 @@ class _e {
3000
3012
  navigateToNextImage() {
3001
3013
  if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
3002
3014
  const t = (this.currentFocusIndex + 1) % this.imageElements.length;
3003
- this.navigateToImage(t);
3015
+ this.navigateToImage(t), this.updateCounter(t);
3004
3016
  }
3005
3017
  /**
3006
3018
  * Navigate to the previous image (Left arrow)
@@ -3008,7 +3020,7 @@ class _e {
3008
3020
  navigateToPreviousImage() {
3009
3021
  if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
3010
3022
  const t = (this.currentFocusIndex - 1 + this.imageElements.length) % this.imageElements.length;
3011
- this.navigateToImage(t);
3023
+ this.navigateToImage(t), this.updateCounter(t);
3012
3024
  }
3013
3025
  /**
3014
3026
  * Navigate to a specific image by index
@@ -3175,12 +3187,12 @@ class _e {
3175
3187
  i,
3176
3188
  u,
3177
3189
  t.length
3178
- ), I = this.entryAnimationEngine.calculateStartRotation(d.rotation), R = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
3190
+ ), I = this.entryAnimationEngine.calculateStartRotation(d.rotation), A = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
3179
3191
  d.rotation,
3180
3192
  d.scale,
3181
3193
  g,
3182
3194
  e
3183
- ), F = this.entryAnimationEngine.buildStartTransform(
3195
+ ), z = this.entryAnimationEngine.buildStartTransform(
3184
3196
  v,
3185
3197
  f,
3186
3198
  d.rotation,
@@ -3188,7 +3200,7 @@ class _e {
3188
3200
  g,
3189
3201
  e,
3190
3202
  I,
3191
- R
3203
+ A
3192
3204
  );
3193
3205
  this.fullConfig.debug && u < 3 && console.log(`Image ${u}:`, {
3194
3206
  finalPosition: f,
@@ -3198,7 +3210,7 @@ class _e {
3198
3210
  finalTransform: w,
3199
3211
  renderedWidth: g,
3200
3212
  renderedHeight: e
3201
- }), c.style.transform = F, c.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || I !== d.rotation || R !== d.scale) && (c.dataset.startX = String(v.x), c.dataset.startY = String(v.y), c.dataset.endX = String(f.x), c.dataset.endY = String(f.y), c.dataset.imageWidth = String(g), c.dataset.imageHeight = String(e), c.dataset.rotation = String(d.rotation), c.dataset.scale = String(d.scale), c.dataset.startRotation = String(I), c.dataset.startScale = String(R)), this.displayQueue.push(c);
3213
+ }), c.style.transform = z, c.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || I !== d.rotation || A !== d.scale) && (c.dataset.startX = String(v.x), c.dataset.startY = String(v.y), c.dataset.endX = String(f.x), c.dataset.endY = String(f.y), c.dataset.imageWidth = String(g), c.dataset.imageHeight = String(e), c.dataset.rotation = String(d.rotation), c.dataset.scale = String(d.scale), c.dataset.startRotation = String(I), c.dataset.startScale = String(A)), this.displayQueue.push(c);
3202
3214
  }, c.onerror = () => r++, c.src = l;
3203
3215
  });
3204
3216
  }
@@ -3210,10 +3222,10 @@ class _e {
3210
3222
  height: this.containerEl.offsetHeight
3211
3223
  };
3212
3224
  if (i)
3213
- await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (a = this.swipeEngine) == null || a.disable();
3225
+ await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (a = this.swipeEngine) == null || a.disable(), this.hideCounter();
3214
3226
  else {
3215
3227
  const s = t.dataset.imageId;
3216
- this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, (r = this.swipeEngine) == null || r.enable(), await this.zoomEngine.focusImage(t, n, e);
3228
+ this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, (r = this.swipeEngine) == null || r.enable(), await this.zoomEngine.focusImage(t, n, e), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
3217
3229
  }
3218
3230
  }
3219
3231
  /**
@@ -3231,25 +3243,31 @@ class _e {
3231
3243
  hideError() {
3232
3244
  this.errorEl && this.errorEl.classList.add("fbn-ic-hidden");
3233
3245
  }
3246
+ updateCounter(t) {
3247
+ !this.fullConfig.rendering.ui.showImageCounter || !this.counterEl || (this.counterEl.textContent = `${t + 1} of ${this.imageElements.length}`, this.counterEl.classList.remove("fbn-ic-hidden"));
3248
+ }
3249
+ hideCounter() {
3250
+ this.counterEl && this.counterEl.classList.add("fbn-ic-hidden");
3251
+ }
3234
3252
  /**
3235
3253
  * Destroy the gallery and clean up resources
3236
3254
  */
3237
3255
  destroy() {
3238
3256
  var t;
3239
- this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), (t = this.swipeEngine) == null || t.destroy();
3257
+ this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), (t = this.swipeEngine) == null || t.destroy();
3240
3258
  }
3241
3259
  }
3242
3260
  export {
3243
3261
  Qt as AnimationEngine,
3244
- Ct as BOUNCE_PRESETS,
3262
+ Mt as BOUNCE_PRESETS,
3245
3263
  ve as ClusterPlacementGenerator,
3246
3264
  $e as CompositeLoader,
3247
- S as DEFAULT_CONFIG,
3265
+ E as DEFAULT_CONFIG,
3248
3266
  Ut as DEFAULT_SHARED_LOADER_CONFIG,
3249
3267
  Lt as ELASTIC_PRESETS,
3250
3268
  he as EntryAnimationEngine,
3251
3269
  Ue as FUNCTIONAL_CSS,
3252
- Fe as GoogleDriveLoader,
3270
+ ze as GoogleDriveLoader,
3253
3271
  fe as GridPlacementGenerator,
3254
3272
  _e as ImageCloud,
3255
3273
  De as ImageFilter,
@@ -3259,7 +3277,7 @@ export {
3259
3277
  de as RandomPlacementGenerator,
3260
3278
  be as SpiralPlacementGenerator,
3261
3279
  Oe as StaticImageLoader,
3262
- zt as WAVE_PATH_PRESETS,
3280
+ Ft as WAVE_PATH_PRESETS,
3263
3281
  Te as ZoomEngine,
3264
3282
  re as animatePath,
3265
3283
  Pe as injectFunctionalStyles,