@frybynite/image-cloud 0.1.1 → 0.1.3

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.
@@ -8,12 +8,12 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
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 })
11
- }), Mt = Object.freeze({
11
+ }), Tt = Object.freeze({
12
12
  gentle: Object.freeze({ stiffness: 150, damping: 30, mass: 1, oscillations: 2 }),
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
- }), Tt = Object.freeze({
16
+ }), Mt = 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 }),
@@ -410,10 +410,10 @@ function Xt(n, t) {
410
410
  return { ...n ? zt[n] : zt.playful, ...t };
411
411
  }
412
412
  function Bt(n, t) {
413
- return { ...n ? Mt[n] : Mt.gentle, ...t };
413
+ return { ...n ? Tt[n] : Tt.gentle, ...t };
414
414
  }
415
415
  function Vt(n, t) {
416
- return { ...n ? Tt[n] : Tt.gentle, ...t };
416
+ return { ...n ? Mt[n] : Mt.gentle, ...t };
417
417
  }
418
418
  class Jt {
419
419
  constructor(t) {
@@ -674,13 +674,13 @@ function oe(n) {
674
674
  startRotation: d,
675
675
  scaleConfig: m,
676
676
  startScale: b
677
- } = n, p = o.type, u = d !== void 0 && d !== h, f = (r == null ? void 0 : r.mode) === "wobble", w = (r == null ? void 0 : r.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, v = u || f, R = b !== void 0 && b !== l, T = (m == null ? void 0 : m.mode) === "pop", x = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
678
- if ((p === "linear" || p === "arc") && !v && !(R || T)) {
677
+ } = n, p = o.type, u = d !== void 0 && d !== h, f = (r == null ? void 0 : r.mode) === "wobble", w = (r == null ? void 0 : r.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, v = u || f, R = b !== void 0 && b !== l, z = (m == null ? void 0 : m.mode) === "pop", x = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
678
+ if ((p === "linear" || p === "arc") && !v && !(R || z)) {
679
679
  g && g();
680
680
  return;
681
681
  }
682
- const _ = performance.now(), j = -c / 2, P = -s / 2;
683
- function U(G) {
682
+ const _ = performance.now(), j = -c / 2, U = -s / 2;
683
+ function P(G) {
684
684
  const F = G - _, I = Math.min(F / a, 1);
685
685
  let A;
686
686
  switch (p) {
@@ -715,12 +715,12 @@ function oe(n) {
715
715
  };
716
716
  }
717
717
  const O = A.x - i.x, S = A.y - i.y;
718
- let z;
719
- f ? z = ie(I, h, w) : u ? z = st(d, h, I) : z = h;
718
+ let T;
719
+ f ? T = ie(I, h, w) : u ? T = st(d, h, I) : T = h;
720
720
  let M;
721
- T ? M = ne(I, l, x) : R ? M = st(b, l, I) : M = l, t.style.transform = `translate(${j}px, ${P}px) translate(${O}px, ${S}px) rotate(${z}deg) scale(${M})`, I < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${j}px, ${P}px) rotate(${h}deg) scale(${l})`, g && g());
721
+ z ? M = ne(I, l, x) : R ? M = st(b, l, I) : M = l, t.style.transform = `translate(${j}px, ${U}px) translate(${O}px, ${S}px) rotate(${T}deg) scale(${M})`, I < 1 ? requestAnimationFrame(P) : (t.style.transform = `translate(${j}px, ${U}px) rotate(${h}deg) scale(${l})`, g && g());
722
722
  }
723
- requestAnimationFrame(U);
723
+ requestAnimationFrame(P);
724
724
  }
725
725
  function se(n) {
726
726
  return n === "bounce" || n === "elastic" || n === "wave";
@@ -1089,14 +1089,14 @@ class ce {
1089
1089
  * @returns Array of layout objects with position, rotation, scale
1090
1090
  */
1091
1091
  generate(t, e, i = {}) {
1092
- var x, L, _, j, P, U, G, F, I;
1093
- const o = [], { width: a, height: c } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? this.config.sizing.base, l = ((x = this.imageConfig.rotation) == null ? void 0 : x.mode) ?? "none", g = ((_ = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : _.min) ?? -15, r = ((P = (j = this.imageConfig.rotation) == null ? void 0 : j.range) == null ? void 0 : P.max) ?? 15, d = ((G = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : G.min) ?? 1, m = ((I = (F = this.imageConfig.sizing) == null ? void 0 : F.variance) == null ? void 0 : I.max) ?? 1, b = d !== 1 || m !== 1, u = h * 1.5 / 2, f = h / 2, w = a - s - u, v = c - s - f, R = s + u, T = s + f;
1092
+ var x, L, _, j, U, P, G, F, I;
1093
+ const o = [], { width: a, height: c } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? this.config.sizing.base, l = ((x = this.imageConfig.rotation) == null ? void 0 : x.mode) ?? "none", g = ((_ = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : _.min) ?? -15, r = ((U = (j = this.imageConfig.rotation) == null ? void 0 : j.range) == null ? void 0 : U.max) ?? 15, d = ((G = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : G.min) ?? 1, m = ((I = (F = this.imageConfig.sizing) == null ? void 0 : F.variance) == null ? void 0 : I.max) ?? 1, b = d !== 1 || m !== 1, u = h * 1.5 / 2, f = h / 2, w = a - s - u, v = c - s - f, R = s + u, z = s + f;
1094
1094
  for (let A = 0; A < t; A++) {
1095
- const O = this.random(R, w), S = this.random(T, v), z = l === "random" ? this.random(g, r) : 0, M = b ? this.random(d, m) : 1, D = h * M, Z = {
1095
+ const O = this.random(R, w), S = this.random(z, v), T = l === "random" ? this.random(g, r) : 0, M = b ? this.random(d, m) : 1, D = h * M, Z = {
1096
1096
  id: A,
1097
1097
  x: O,
1098
1098
  y: S,
1099
- rotation: z,
1099
+ rotation: T,
1100
1100
  scale: M,
1101
1101
  baseSize: D
1102
1102
  };
@@ -1126,10 +1126,10 @@ class le {
1126
1126
  * @returns Array of layout objects with position, rotation, scale
1127
1127
  */
1128
1128
  generate(t, e, i = {}) {
1129
- var L, _, j, P, U, G, F, I, A, O;
1130
- const o = [], { width: a, height: c } = e, { debugRadials: s } = this.config, h = this.config.sizing.base, l = ((L = this.imageConfig.rotation) == null ? void 0 : L.mode) ?? "none", g = ((j = (_ = this.imageConfig.rotation) == null ? void 0 : _.range) == null ? void 0 : j.min) ?? -15, r = ((U = (P = this.imageConfig.rotation) == null ? void 0 : P.range) == null ? void 0 : U.max) ?? 15, d = ((F = (G = this.imageConfig.sizing) == null ? void 0 : G.variance) == null ? void 0 : F.min) ?? 1, m = ((A = (I = this.imageConfig.sizing) == null ? void 0 : I.variance) == null ? void 0 : A.max) ?? 1, b = d !== 1 || m !== 1, p = ((O = this.imageConfig.sizing) == null ? void 0 : O.scaleDecay) ?? 0, u = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, w = a / 2, v = c / 2, R = Math.ceil(Math.sqrt(t));
1129
+ var L, _, j, U, P, G, F, I, A, O;
1130
+ const o = [], { width: a, height: c } = e, { debugRadials: s } = this.config, h = this.config.sizing.base, l = ((L = this.imageConfig.rotation) == null ? void 0 : L.mode) ?? "none", g = ((j = (_ = this.imageConfig.rotation) == null ? void 0 : _.range) == null ? void 0 : j.min) ?? -15, r = ((P = (U = this.imageConfig.rotation) == null ? void 0 : U.range) == null ? void 0 : P.max) ?? 15, d = ((F = (G = this.imageConfig.sizing) == null ? void 0 : G.variance) == null ? void 0 : F.min) ?? 1, m = ((A = (I = this.imageConfig.sizing) == null ? void 0 : I.variance) == null ? void 0 : A.max) ?? 1, b = d !== 1 || m !== 1, p = ((O = this.imageConfig.sizing) == null ? void 0 : O.scaleDecay) ?? 0, u = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, w = a / 2, v = c / 2, R = Math.ceil(Math.sqrt(t));
1131
1131
  if (t > 0) {
1132
- const S = b ? this.random(d, m) : 1, z = f * S;
1132
+ const S = b ? this.random(d, m) : 1, T = f * S;
1133
1133
  o.push({
1134
1134
  id: 0,
1135
1135
  x: w,
@@ -1137,28 +1137,28 @@ class le {
1137
1137
  rotation: l === "random" ? this.random(g * 0.33, r * 0.33) : 0,
1138
1138
  // Less rotation for center
1139
1139
  scale: S,
1140
- baseSize: z,
1140
+ baseSize: T,
1141
1141
  zIndex: 100,
1142
1142
  // Center image is highest
1143
1143
  borderColor: s ? "cyan" : void 0
1144
1144
  });
1145
1145
  }
1146
- let T = 1, x = 1;
1147
- for (; T < t; ) {
1148
- const S = x / R, z = p > 0 ? 1 - S * p * 0.5 : 1, M = x * (f * 0.8), D = M * 1.5, Z = Math.PI * (3 * (D + M) - Math.sqrt((3 * D + M) * (D + 3 * M))), et = this.estimateWidth(f), W = Math.floor(Z / (et * 0.7));
1146
+ let z = 1, x = 1;
1147
+ for (; z < t; ) {
1148
+ const S = x / R, T = p > 0 ? 1 - S * p * 0.5 : 1, M = x * (f * 0.8), D = M * 1.5, Z = Math.PI * (3 * (D + M) - Math.sqrt((3 * D + M) * (D + 3 * M))), et = this.estimateWidth(f), W = Math.floor(Z / (et * 0.7));
1149
1149
  if (W === 0) {
1150
1150
  x++;
1151
1151
  continue;
1152
1152
  }
1153
1153
  const N = 2 * Math.PI / W, it = x * (20 * Math.PI / 180);
1154
- for (let Q = 0; Q < W && T < t; Q++) {
1155
- const B = Q * N + it, q = b ? this.random(d, m) : 1, nt = z * q, V = f * nt;
1154
+ for (let Q = 0; Q < W && z < t; Q++) {
1155
+ const B = Q * N + it, q = b ? this.random(d, m) : 1, nt = T * q, V = f * nt;
1156
1156
  let C = w + Math.cos(B) * D, H = v + Math.sin(B) * M;
1157
1157
  const $ = this.config.spacing.padding ?? 50, K = V * 1.5 / 2, k = V / 2;
1158
1158
  C - K < $ ? C = $ + K : C + K > a - $ && (C = a - $ - K), H - k < $ ? H = $ + k : H + k > c - $ && (H = c - $ - k);
1159
1159
  const tt = l === "random" ? this.random(g, r) : 0;
1160
1160
  o.push({
1161
- id: T,
1161
+ id: z,
1162
1162
  x: C,
1163
1163
  y: H,
1164
1164
  rotation: tt,
@@ -1167,7 +1167,7 @@ class le {
1167
1167
  zIndex: Math.max(1, 100 - x),
1168
1168
  // Outer rings have lower z-index
1169
1169
  borderColor: s ? u[(x - 1) % u.length] : void 0
1170
- }), T++;
1170
+ }), z++;
1171
1171
  }
1172
1172
  x++;
1173
1173
  }
@@ -1192,7 +1192,6 @@ class le {
1192
1192
  return Math.random() * (e - t) + t;
1193
1193
  }
1194
1194
  }
1195
- console.log("[GridPlacementGenerator] Module loaded");
1196
1195
  const he = {
1197
1196
  columns: "auto",
1198
1197
  rows: "auto",
@@ -1240,14 +1239,14 @@ class de {
1240
1239
  p,
1241
1240
  l,
1242
1241
  s
1243
- ), w = s.stagger === "row", v = s.stagger === "column", R = w ? u + 0.5 : u, T = v ? f + 0.5 : f, x = (b - s.gap * (u - 1)) / R, L = (p - s.gap * (f - 1)) / T, _ = w ? x / 2 : 0, j = v ? L / 2 : 0, P = 1 + s.overlap, U = Math.min(x, L) * P, G = i.fixedHeight ? Math.min(i.fixedHeight, U) : U, F = u * x + (u - 1) * s.gap + _, I = f * L + (f - 1) * s.gap + j, A = h + (b - F) / 2, O = h + (p - I) / 2, S = u * f, z = s.columns !== "auto" && s.rows !== "auto", M = z && t > S;
1244
- console.log("[GridGen] generate called, imageCount:", t, "gridConfig:", JSON.stringify({ columns: s.columns, rows: s.rows })), console.log("[GridGen] cellCount:", S, "hasFixedGrid:", z, "isOverflowMode:", M), typeof window < "u" && (window.__gridOverflowDebug = {
1242
+ ), w = s.stagger === "row", v = s.stagger === "column", R = w ? u + 0.5 : u, z = v ? f + 0.5 : f, x = (b - s.gap * (u - 1)) / R, L = (p - s.gap * (f - 1)) / z, _ = w ? x / 2 : 0, j = v ? L / 2 : 0, U = 1 + s.overlap, P = Math.min(x, L) * U, G = i.fixedHeight ? Math.min(i.fixedHeight, P) : P, F = u * x + (u - 1) * s.gap + _, I = f * L + (f - 1) * s.gap + j, A = h + (b - F) / 2, O = h + (p - I) / 2, S = u * f, T = s.columns !== "auto" && s.rows !== "auto", M = T && t > S;
1243
+ typeof window < "u" && (window.__gridOverflowDebug = {
1245
1244
  gridConfigColumns: s.columns,
1246
1245
  gridConfigRows: s.rows,
1247
1246
  columns: u,
1248
1247
  rows: f,
1249
1248
  cellCount: S,
1250
- hasFixedGrid: z,
1249
+ hasFixedGrid: T,
1251
1250
  imageCount: t,
1252
1251
  isOverflowMode: M
1253
1252
  });
@@ -1277,8 +1276,8 @@ class de {
1277
1276
  s.alignment === "center" ? xt = (F - At) / 2 : s.alignment === "end" && (xt = F - At), tt += xt;
1278
1277
  }
1279
1278
  }
1280
- const mt = m ? this.random(r, d) : 1, at = G * mt, dt = at * 1.5 / 2, gt = at / 2, bt = h + dt, yt = a - h - dt, Pt = h + gt, Ut = c - h - gt;
1281
- tt = Math.max(bt, Math.min(tt, yt)), ot = Math.max(Pt, Math.min(ot, Ut));
1279
+ const mt = m ? this.random(r, d) : 1, at = G * mt, dt = at * 1.5 / 2, gt = at / 2, bt = h + dt, yt = a - h - dt, Ut = h + gt, Pt = c - h - gt;
1280
+ tt = Math.max(bt, Math.min(tt, yt)), ot = Math.max(Ut, Math.min(ot, Pt));
1282
1281
  let vt = 0;
1283
1282
  if (g === "random") {
1284
1283
  const J = ((q = (B = this.imageConfig.rotation) == null ? void 0 : B.range) == null ? void 0 : q.min) ?? -15, X = ((V = (nt = this.imageConfig.rotation) == null ? void 0 : nt.range) == null ? void 0 : V.max) ?? 15;
@@ -1341,8 +1340,8 @@ class fe {
1341
1340
  * @returns Array of layout objects with position, rotation, scale
1342
1341
  */
1343
1342
  generate(t, e, i = {}) {
1344
- var T, x, L, _, j, P, U, G, F, I;
1345
- const o = [], { width: a, height: c } = e, s = { ...ue, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? this.config.sizing.base, g = ((T = this.imageConfig.rotation) == null ? void 0 : T.mode) ?? "none", r = ((L = (x = this.imageConfig.rotation) == null ? void 0 : x.range) == null ? void 0 : L.min) ?? -15, d = ((j = (_ = this.imageConfig.rotation) == null ? void 0 : _.range) == null ? void 0 : j.max) ?? 15, m = ((U = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : U.min) ?? 1, b = ((F = (G = this.imageConfig.sizing) == null ? void 0 : G.variance) == null ? void 0 : F.max) ?? 1, p = m !== 1 || b !== 1, u = ((I = this.imageConfig.sizing) == null ? void 0 : I.scaleDecay) ?? s.scaleDecay, f = a / 2, w = c / 2, v = Math.min(
1343
+ var z, x, L, _, j, U, P, G, F, I;
1344
+ const o = [], { width: a, height: c } = e, s = { ...ue, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? this.config.sizing.base, g = ((z = this.imageConfig.rotation) == null ? void 0 : z.mode) ?? "none", r = ((L = (x = this.imageConfig.rotation) == null ? void 0 : x.range) == null ? void 0 : L.min) ?? -15, d = ((j = (_ = this.imageConfig.rotation) == null ? void 0 : _.range) == null ? void 0 : j.max) ?? 15, m = ((P = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : P.min) ?? 1, b = ((F = (G = this.imageConfig.sizing) == null ? void 0 : G.variance) == null ? void 0 : F.max) ?? 1, p = m !== 1 || b !== 1, u = ((I = this.imageConfig.sizing) == null ? void 0 : I.scaleDecay) ?? s.scaleDecay, f = a / 2, w = c / 2, v = Math.min(
1346
1345
  f - h - l / 2,
1347
1346
  w - h - l / 2
1348
1347
  ), R = s.direction === "clockwise" ? -1 : 1;
@@ -1357,7 +1356,7 @@ class fe {
1357
1356
  const k = A * 0.3 * s.tightness;
1358
1357
  O = k * R + s.startAngle, S = this.calculateLogarithmicRadius(k, t, v, s.tightness);
1359
1358
  }
1360
- const z = f + Math.cos(O) * S, M = w + Math.sin(O) * S, D = S / v, Z = u > 0 ? 1 - D * u * 0.5 : 1, et = p ? this.random(m, b) : 1, W = Z * et, N = l * W, Q = N * 1.5 / 2, B = N / 2, q = h + Q, nt = a - h - Q, V = h + B, C = c - h - B, H = Math.max(q, Math.min(z, nt)), $ = Math.max(V, Math.min(M, C));
1359
+ const T = f + Math.cos(O) * S, M = w + Math.sin(O) * S, D = S / v, Z = u > 0 ? 1 - D * u * 0.5 : 1, et = p ? this.random(m, b) : 1, W = Z * et, N = l * W, Q = N * 1.5 / 2, B = N / 2, q = h + Q, nt = a - h - Q, V = h + B, C = c - h - B, H = Math.max(q, Math.min(T, nt)), $ = Math.max(V, Math.min(M, C));
1361
1360
  let Y = 0;
1362
1361
  if (g === "random") {
1363
1362
  const k = O * 180 / Math.PI % 360, tt = this.random(r, d);
@@ -1444,8 +1443,8 @@ class pe {
1444
1443
  * @returns Array of layout objects with position, rotation, scale
1445
1444
  */
1446
1445
  generate(t, e, i = {}) {
1447
- var R, T, x, L, _, j, P, U, G;
1448
- const o = [], { width: a, height: c } = e, s = { ...me, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? this.config.sizing.base, g = ((R = this.imageConfig.rotation) == null ? void 0 : R.mode) ?? "none", r = ((x = (T = this.imageConfig.rotation) == null ? void 0 : T.range) == null ? void 0 : x.min) ?? -15, d = ((_ = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : _.max) ?? 15, m = ((P = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : P.min) ?? 1, b = ((G = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : G.max) ?? 1, p = m !== 1 || b !== 1, u = this.calculateClusterCount(
1446
+ var R, z, x, L, _, j, U, P, G;
1447
+ const o = [], { width: a, height: c } = e, s = { ...me, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? this.config.sizing.base, g = ((R = this.imageConfig.rotation) == null ? void 0 : R.mode) ?? "none", r = ((x = (z = this.imageConfig.rotation) == null ? void 0 : z.range) == null ? void 0 : x.min) ?? -15, d = ((_ = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : _.max) ?? 15, m = ((U = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : U.min) ?? 1, b = ((G = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : G.max) ?? 1, p = m !== 1 || b !== 1, u = this.calculateClusterCount(
1449
1448
  t,
1450
1449
  s.clusterCount,
1451
1450
  a,
@@ -1464,20 +1463,20 @@ class pe {
1464
1463
  for (let F = 0; F < u; F++) {
1465
1464
  const I = f[F], A = w[F];
1466
1465
  for (let O = 0; O < A; O++) {
1467
- let S, z;
1466
+ let S, T;
1468
1467
  if (s.distribution === "gaussian")
1469
- S = this.gaussianRandom() * I.spread, z = this.gaussianRandom() * I.spread;
1468
+ S = this.gaussianRandom() * I.spread, T = this.gaussianRandom() * I.spread;
1470
1469
  else {
1471
1470
  const $ = this.random(0, Math.PI * 2), Y = this.random(0, I.spread);
1472
- S = Math.cos($) * Y, z = Math.sin($) * Y;
1471
+ S = Math.cos($) * Y, T = Math.sin($) * Y;
1473
1472
  }
1474
1473
  const M = 1 + s.overlap * 0.5, D = 1 + s.overlap * 0.3;
1475
- S /= M, z /= M;
1474
+ S /= M, T /= M;
1476
1475
  const Z = p ? this.random(m, b) : 1, et = D * Z, W = l * et;
1477
- let N = I.x + S, it = I.y + z;
1476
+ let N = I.x + S, it = I.y + T;
1478
1477
  const B = W * 1.5 / 2, q = W / 2;
1479
1478
  N = Math.max(h + B, Math.min(N, a - h - B)), it = Math.max(h + q, Math.min(it, c - h - q));
1480
- const nt = g === "random" ? this.random(r, d) : 0, C = Math.sqrt(S * S + z * z) / I.spread, H = Math.round((1 - C) * 50) + 1;
1479
+ const nt = g === "random" ? this.random(r, d) : 0, C = Math.sqrt(S * S + T * T) / I.spread, H = Math.round((1 - C) * 50) + 1;
1481
1480
  o.push({
1482
1481
  id: v,
1483
1482
  x: N,
@@ -1517,8 +1516,8 @@ class pe {
1517
1516
  };
1518
1517
  let f = 1 / 0;
1519
1518
  for (const w of c) {
1520
- const v = u.x - w.x, R = u.y - w.y, T = Math.sqrt(v * v + R * R);
1521
- f = Math.min(f, T);
1519
+ const v = u.x - w.x, R = u.y - w.y, z = Math.sqrt(v * v + R * R);
1520
+ f = Math.min(f, z);
1522
1521
  }
1523
1522
  if ((c.length === 0 || f > b) && (m = u, b = f), f >= a.clusterSpacing)
1524
1523
  break;
@@ -1567,26 +1566,26 @@ class be {
1567
1566
  const o = [], { width: a, height: c } = e, s = this.config.sizing.base, h = this.config.spacing.padding ?? 50, l = ((M = this.imageConfig.rotation) == null ? void 0 : M.mode) ?? "none", g = ((Z = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : Z.min) ?? -15, r = ((W = (et = this.imageConfig.rotation) == null ? void 0 : et.range) == null ? void 0 : W.max) ?? 15, d = ((it = (N = this.imageConfig.sizing) == null ? void 0 : N.variance) == null ? void 0 : it.min) ?? 1, m = ((B = (Q = this.imageConfig.sizing) == null ? void 0 : Q.variance) == null ? void 0 : B.max) ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? s, u = {
1568
1567
  ...kt,
1569
1568
  ...this.config.wave
1570
- }, { rows: f, amplitude: w, frequency: v, phaseShift: R, synchronization: T } = u, x = Math.ceil(t / f), j = p * 1.5 / 2, P = h + j, U = a - h - j, G = U - P, F = x > 1 ? G / (x - 1) : 0, I = h + w + p / 2, A = c - h - w - p / 2, O = A - I, S = f > 1 ? O / (f - 1) : 0;
1571
- let z = 0;
1572
- for (let q = 0; q < f && z < t; q++) {
1569
+ }, { rows: f, amplitude: w, frequency: v, phaseShift: R, synchronization: z } = u, x = Math.ceil(t / f), j = p * 1.5 / 2, U = h + j, P = a - h - j, G = P - U, F = x > 1 ? G / (x - 1) : 0, I = h + w + p / 2, A = c - h - w - p / 2, O = A - I, S = f > 1 ? O / (f - 1) : 0;
1570
+ let T = 0;
1571
+ for (let q = 0; q < f && T < t; q++) {
1573
1572
  const nt = f === 1 ? (I + A) / 2 : I + q * S;
1574
1573
  let V = 0;
1575
- T === "offset" ? V = q * R : T === "alternating" && (V = q * Math.PI);
1576
- for (let C = 0; C < x && z < t; C++) {
1577
- const H = x === 1 ? (P + U) / 2 : P + C * F, $ = this.calculateWaveY(H, a, w, v, V), Y = H, K = nt + $, k = b ? this.random(d, m) : 1, tt = p * k;
1574
+ z === "offset" ? V = q * R : z === "alternating" && (V = q * Math.PI);
1575
+ for (let C = 0; C < x && T < t; C++) {
1576
+ const H = x === 1 ? (U + P) / 2 : U + C * F, $ = this.calculateWaveY(H, a, w, v, V), Y = H, K = nt + $, k = b ? this.random(d, m) : 1, tt = p * k;
1578
1577
  let ot = 0;
1579
1578
  l === "tangent" ? ot = this.calculateRotation(H, a, w, v, V) : l === "random" && (ot = this.random(g, r));
1580
1579
  const at = tt * 1.5 / 2, pt = tt / 2, dt = h + at, gt = a - h - at, bt = h + pt, yt = c - h - pt;
1581
1580
  o.push({
1582
- id: z,
1581
+ id: T,
1583
1582
  x: Math.max(dt, Math.min(Y, gt)),
1584
1583
  y: Math.max(bt, Math.min(K, yt)),
1585
1584
  rotation: ot,
1586
1585
  scale: k,
1587
1586
  baseSize: tt,
1588
- zIndex: z + 1
1589
- }), z++;
1587
+ zIndex: T + 1
1588
+ }), T++;
1590
1589
  }
1591
1590
  }
1592
1591
  return o;
@@ -2084,7 +2083,7 @@ class Se {
2084
2083
  height: t.offsetHeight
2085
2084
  };
2086
2085
  if (this.incoming) {
2087
- const R = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), T = {
2086
+ const R = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), z = {
2088
2087
  x: R.x,
2089
2088
  y: R.y,
2090
2089
  rotation: R.rotation,
@@ -2097,7 +2096,7 @@ class Se {
2097
2096
  this.outgoing = this.startUnfocusAnimation(
2098
2097
  this.incoming.element,
2099
2098
  this.incoming.originalState,
2100
- T,
2099
+ z,
2101
2100
  x
2102
2101
  );
2103
2102
  } else
@@ -2990,7 +2989,7 @@ class ze {
2990
2989
  i,
2991
2990
  g,
2992
2991
  t.length
2993
- ), R = this.entryAnimationEngine.calculateStartRotation(d.rotation), T = this.entryAnimationEngine.calculateStartScale(d.scale), x = this.entryAnimationEngine.buildFinalTransform(
2992
+ ), R = this.entryAnimationEngine.calculateStartRotation(d.rotation), z = this.entryAnimationEngine.calculateStartScale(d.scale), x = this.entryAnimationEngine.buildFinalTransform(
2994
2993
  d.rotation,
2995
2994
  d.scale,
2996
2995
  u,
@@ -3003,7 +3002,7 @@ class ze {
3003
3002
  u,
3004
3003
  e,
3005
3004
  R,
3006
- T
3005
+ z
3007
3006
  );
3008
3007
  this.fullConfig.debug && g < 3 && console.log(`Image ${g}:`, {
3009
3008
  finalPosition: f,
@@ -3013,7 +3012,7 @@ class ze {
3013
3012
  finalTransform: x,
3014
3013
  renderedWidth: u,
3015
3014
  renderedHeight: e
3016
- }), r.style.transform = L, r.dataset.finalTransform = x, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || R !== d.rotation || T !== d.scale) && (r.dataset.startX = String(v.x), r.dataset.startY = String(v.y), r.dataset.endX = String(f.x), r.dataset.endY = String(f.y), r.dataset.imageWidth = String(u), r.dataset.imageHeight = String(e), r.dataset.rotation = String(d.rotation), r.dataset.scale = String(d.scale), r.dataset.startRotation = String(R), r.dataset.startScale = String(T)), this.displayQueue.push(r);
3015
+ }), r.style.transform = L, r.dataset.finalTransform = x, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || R !== d.rotation || z !== d.scale) && (r.dataset.startX = String(v.x), r.dataset.startY = String(v.y), r.dataset.endX = String(f.x), r.dataset.endY = String(f.y), r.dataset.imageWidth = String(u), r.dataset.imageHeight = String(e), r.dataset.rotation = String(d.rotation), r.dataset.scale = String(d.scale), r.dataset.startRotation = String(R), r.dataset.startScale = String(z)), this.displayQueue.push(r);
3017
3016
  }, r.onerror = () => c++, r.src = l;
3018
3017
  });
3019
3018
  }
@@ -3052,15 +3051,15 @@ class ze {
3052
3051
  this.clearImageCloud(), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout);
3053
3052
  }
3054
3053
  }
3055
- function Me() {
3054
+ function Te() {
3056
3055
  if (typeof document > "u") return;
3057
3056
  const n = "fbn-ic-styles";
3058
3057
  if (document.getElementById(n)) return;
3059
3058
  const t = document.createElement("style");
3060
3059
  t.id = n, t.textContent = Ht, document.head.appendChild(t);
3061
3060
  }
3062
- Me();
3063
- function Te() {
3061
+ Te();
3062
+ function Me() {
3064
3063
  if (typeof document > "u") {
3065
3064
  console.warn("ImageCloud: Document not available (not in browser environment)");
3066
3065
  return;
@@ -3097,10 +3096,10 @@ function Te() {
3097
3096
  };
3098
3097
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", n) : n();
3099
3098
  }
3100
- Te();
3099
+ Me();
3101
3100
  export {
3102
3101
  ze as ImageCloud,
3103
3102
  ze as ImageGallery,
3104
- Te as autoInitialize
3103
+ Me as autoInitialize
3105
3104
  };
3106
3105
  //# sourceMappingURL=image-cloud-auto-init.js.map