@telefonica/mistica 12.12.0 → 12.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,409 +108,427 @@ function _unsupportedIterableToArray(o, minLen) {
108
108
  if (n === "Map" || n === "Set") return Array.from(n);
109
109
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
110
110
  }
111
- import * as a from "react";
112
- import J from "./generated/mistica-icons/icon-chevron-left-regular.js";
113
- import K from "./generated/mistica-icons/icon-chevron-right-regular.js";
114
- import { useScreenSize as Q, useTheme as X, useIsInViewport as de, useIsomorphicLayoutEffect as he } from "./hooks.js";
115
- import me from "./inline.js";
116
- import pe from "./stack.js";
117
- import { BaseTouchable as M } from "./touchable.js";
118
- import G from "classnames";
119
- import { useIsInverseVariant as ge, ThemeVariant as R } from "./theme-variant-context.js";
120
- import { DisableBorderRadiusProvider as ve } from "./image.js";
121
- import { listenResize as Z, getPrefixedDataAttributes as be } from "./utils/dom.js";
122
- import { isAndroid as ee } from "./utils/platform.js";
123
- import { useDocumentVisibility as Ie } from "./utils/document-visibility.js";
124
- import { slideshowContainer as Pe, slideshowPrevArrowButton as xe, slideshow as we, slideshowItem as Le, slideshowNextArrowButton as Se, slideshowBullets as Ne, bulletActiveInverse as Ae, bulletInverse as Ce, bulletActive as Re, bullet as Me, carouselContainer as ke, carouselPrevArrowButton as Be, carousel as Ee, centeredCarousel as ye, carouselWithScroll as Te, vars as C, carouselItem as We, carouselNextArrowButton as De, carouselBullets as Ve } from "./carousel.css-mistica.js";
125
- import { assignInlineVars as ze } from "@vanilla-extract/dynamic";
126
- import { sprinkles as Oe } from "./sprinkles.css-mistica.js";
127
- import { jsx as t, jsxs as q } from "./_virtual/jsx-runtime.js";
128
- var te = function(e, c) {
129
- var l = Ie();
130
- return de(c, !1) && l && !!e;
131
- }, re = function(param) {
132
- var e = param.currentIndex, c = param.numPages, l = param.onPress;
133
- var r = ge(), ref = Q(), d = ref.isDesktopOrBigger, g = function(b) {
134
- var n = b === e;
135
- return r ? n ? Ae : Ce : n ? Re : Me;
111
+ import * as u from "react";
112
+ import Z from "./generated/mistica-icons/icon-chevron-left-regular.js";
113
+ import ee from "./generated/mistica-icons/icon-chevron-right-regular.js";
114
+ import { useScreenSize as te, useTheme as oe, useIsInViewport as ge, useIsomorphicLayoutEffect as ve } from "./hooks.js";
115
+ import be from "./inline.js";
116
+ import Ie from "./stack.js";
117
+ import { BaseTouchable as B } from "./touchable.js";
118
+ import K from "classnames";
119
+ import { useIsInverseVariant as xe, ThemeVariant as R } from "./theme-variant-context.js";
120
+ import { DisableBorderRadiusProvider as Pe } from "./image.js";
121
+ import { listenResize as se, getPrefixedDataAttributes as we } from "./utils/dom.js";
122
+ import { isAndroid as re } from "./utils/platform.js";
123
+ import { useDocumentVisibility as Se } from "./utils/document-visibility.js";
124
+ import { slideshowContainer as ke, slideshowPrevArrowButton as Le, slideshow as Ne, slideshowItem as Ae, slideshowNextArrowButton as Ce, slideshowBullets as Me, bulletActiveInverse as Re, bulletInverse as Be, bulletActive as Ee, bullet as ye, carouselContainer as Te, carouselPrevArrowButton as We, carousel as De, centeredCarousel as Ve, carouselWithScroll as Oe, vars as L, carouselItem as ze, carouselNextArrowButton as je, carouselBullets as _e } from "./carousel.css-mistica.js";
125
+ import { assignInlineVars as Fe } from "@vanilla-extract/dynamic";
126
+ import { sprinkles as Ue } from "./sprinkles.css-mistica.js";
127
+ import { useDesktopContainerType as $e } from "./desktop-container-type-context.js";
128
+ import { jsx as r, jsxs as G } from "./_virtual/jsx-runtime.js";
129
+ var le = function(e, s) {
130
+ var t = Se();
131
+ return ge(s, !1) && t && !!e;
132
+ }, ne = function(param) {
133
+ var e = param.currentIndex, s = param.numPages, t = param.onPress;
134
+ var o = xe(), ref = te(), d = ref.isDesktopOrBigger, p = function(v) {
135
+ var n = v === e;
136
+ return o ? n ? Re : Be : n ? Ee : ye;
136
137
  };
137
- return /* @__PURE__ */ t(me, {
138
+ return /* @__PURE__ */ r(be, {
138
139
  space: d ? 16 : 8,
139
140
  alignItems: "center",
140
141
  dataAttributes: {
141
142
  "component-name": "PageBullets"
142
143
  },
143
144
  children: Array.from({
144
- length: c
145
- }, function(b, n) {
146
- return /* @__PURE__ */ t(M, {
147
- className: Oe({
145
+ length: s
146
+ }, function(v, n) {
147
+ return /* @__PURE__ */ r(B, {
148
+ className: Ue({
148
149
  display: "block",
149
150
  padding: 0,
150
151
  border: "none",
151
152
  background: "transparent"
152
153
  }),
153
154
  maybe: !0,
154
- onPress: d && l ? function() {
155
- return l(n);
155
+ onPress: d && t ? function() {
156
+ return t(n);
156
157
  } : void 0,
157
- children: /* @__PURE__ */ t("div", {
158
- className: g(n)
158
+ children: /* @__PURE__ */ r("div", {
159
+ className: p(n)
159
160
  })
160
161
  }, n);
161
162
  })
162
163
  });
163
- }, je = function(e) {
164
- var c = {
164
+ }, Q = function(e, s, t) {
165
+ return t ? typeof t == "number" ? t : t[e] || s[e] : s[e];
166
+ }, qe = function(e, s) {
167
+ var t = {
165
168
  mobile: 1,
166
- desktop: 3
169
+ tablet: 2,
170
+ desktop: {
171
+ small: 1,
172
+ medium: 2,
173
+ large: 3
174
+ }
175
+ };
176
+ if (!s) return _objectSpreadProps(_objectSpread({}, t), {
177
+ desktop: Q(e, t.desktop)
178
+ });
179
+ if (typeof s == "number") return {
180
+ mobile: s,
181
+ tablet: s,
182
+ desktop: s
167
183
  };
168
- return e ? typeof e == "number" ? {
169
- mobile: e,
170
- desktop: e
171
- } : _objectSpread({}, c, e) : c;
172
- }, _e = function(e) {
184
+ var o = Q(e, t.desktop, s.desktop);
185
+ return _objectSpreadProps(_objectSpread({}, t, s), {
186
+ desktop: o
187
+ });
188
+ }, Ye = function(e) {
173
189
  return typeof e == "number" || e === void 0 ? {
174
190
  next: e,
175
191
  prev: e
176
192
  } : e;
177
- }, H = function(e, c) {
193
+ }, X = function(e, s) {
178
194
  if (e.length === 0) return [];
179
- var l = Math.ceil(e.length / c), r = [];
180
- for(var d = 0; d < e.length; d += l)r.push(e[d]);
181
- return r[r.length - 1] = e[e.length - l], r;
182
- }, Fe = function(e, c) {
183
- var l = [];
184
- for(var r = 0; r < c.length; r++)r === 0 ? l.push(c[0]) : l.push((c[r] + c[r - 1]) / 2);
185
- for(var r1 = l.length - 1; r1 >= 0; r1--)if (e - l[r1] >= -1) return r1;
195
+ var t = Math.ceil(e.length / s), o = [];
196
+ for(var d = 0; d < e.length; d += t)o.push(e[d]);
197
+ return o[o.length - 1] = e[e.length - t], o;
198
+ }, Ge = function(e, s) {
199
+ var t = [];
200
+ for(var o = 0; o < s.length; o++)o === 0 ? t.push(s[0]) : t.push((s[o] + s[o - 1]) / 2);
201
+ for(var o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
186
202
  return 0;
187
- }, oe = 5e3, se = function(param) {
188
- var e = param.items, c = param.itemStyle, l = param.itemClassName, r = param.withBullets, d = param.renderBullets, g = param.initialActiveItem, b = param.itemsPerPage, n = param.itemsToScroll, k = param.mobilePageOffset, P = param.gap, j = param.free, L = param.centered, p = param.autoplay, S = param.onPageChange, _ = param.dataAttributes;
189
- var ref = X(), w = ref.texts, B = ref.platformOverrides, o = je(b), u = _e(k), ref1 = Q(), x = ref1.isDesktopOrBigger, h = a.useRef(null), I = Math.floor(x ? o.desktop : o.mobile), v = Math.ceil(e.length / I), ref2 = _slicedToArray(a.useState({
203
+ }, ce = 5e3, ie = function(param) {
204
+ var e = param.items, s = param.itemStyle, t = param.itemClassName, o = param.withBullets, d = param.renderBullets, p = param.initialActiveItem, v = param.itemsPerPage, n = param.itemsToScroll, E = param.mobilePageOffset, x = param.gap, _ = param.free, N = param.centered, m = param.autoplay, A = param.onPageChange, F = param.dataAttributes;
205
+ var ref = oe(), S = ref.texts, y = ref.platformOverrides, c = $e(), i = qe(c || "large", v), ref1 = te(), P = ref1.isDesktopOrBigger, k = ref1.isMobile, U = k ? i.mobile : i.tablet, g = Math.max(Math.floor(P ? i.desktop : U), 1), b = Ye(E), I = u.useRef(null), w = Math.ceil(e.length / g), ref2 = _slicedToArray(u.useState({
190
206
  scrollLeft: 0,
191
207
  scrollRight: 0
192
- }), 2), ref3 = ref2[0], E = ref3.scrollLeft, F = ref3.scrollRight, le = ref2[1], ref4 = _slicedToArray(a.useState([]), 2), U = ref4[0], ne = ref4[1], y = a.useMemo(function() {
193
- return H(U, v);
208
+ }), 2), ref3 = ref2[0], H = ref3.scrollLeft, $ = ref3.scrollRight, ae = ref2[1], ref4 = _slicedToArray(u.useState([]), 2), q = ref4[0], ue = ref4[1], T = u.useMemo(function() {
209
+ return X(q, w);
194
210
  }, [
195
- U,
196
- v
197
- ]), T = n ? H(U, Math.ceil(e.length / n)) : y, ce = F !== 0, ie = E !== 0;
198
- he(function() {
199
- if (h.current) {
200
- var s = h.current, i = function() {
201
- var V = s.scrollWidth, A = s.clientWidth, z = Math.round(s.scrollLeft), O = Math.round(V - (z + A));
202
- le({
211
+ q,
212
+ w
213
+ ]), W = n ? X(q, Math.ceil(e.length / n)) : T, fe = $ !== 0, de = H !== 0;
214
+ ve(function() {
215
+ if (I.current) {
216
+ var l = I.current, a = function() {
217
+ var O = l.scrollWidth, M = l.clientWidth, z = Math.round(l.scrollLeft), j = Math.round(O - (z + M));
218
+ ae({
203
219
  scrollLeft: z,
204
- scrollRight: O
220
+ scrollRight: j
205
221
  });
206
222
  }, f = function() {
207
- var V = s.scrollWidth - s.clientWidth;
208
- ne(Array.from(s.querySelectorAll("[data-item]")).map(function(A, z) {
209
- if (z === e.length - 1) return V;
210
- var O = A.offsetLeft, ue = parseInt(getComputedStyle(A).scrollMargin), fe = L && !x ? O - A.clientWidth / 2 : O;
211
- return Math.min(fe - ue - s.offsetLeft, V);
223
+ var O = l.scrollWidth - l.clientWidth;
224
+ ue(Array.from(l.querySelectorAll("[data-item]")).map(function(M, z) {
225
+ if (z === e.length - 1) return O;
226
+ var j = M.offsetLeft, me = parseInt(getComputedStyle(M).scrollMargin), pe = N && !P ? j - M.clientWidth / 2 : j;
227
+ return Math.min(pe - me - l.offsetLeft, O);
212
228
  }));
213
229
  };
214
- i(), f(), s.addEventListener("scroll", i);
215
- var m = Z(s, function() {
216
- i(), f();
230
+ a(), f(), l.addEventListener("scroll", a);
231
+ var h = se(l, function() {
232
+ a(), f();
217
233
  });
218
234
  return function() {
219
- s.removeEventListener("scroll", i), m();
235
+ l.removeEventListener("scroll", a), h();
220
236
  };
221
237
  }
222
238
  return function() {};
223
239
  }, [
224
- o.desktop,
225
- o.mobile,
226
- u.next,
227
- u.prev,
228
- v,
229
- P,
230
- L,
240
+ i.desktop,
241
+ i.tablet,
242
+ i.mobile,
243
+ b.next,
244
+ b.prev,
245
+ w,
231
246
  x,
247
+ N,
248
+ P,
232
249
  e.length
233
250
  ]);
234
- var W = a.useCallback(function(s) {
235
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
236
- var f = h.current;
251
+ var D = u.useCallback(function(l) {
252
+ var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
253
+ var f = I.current;
237
254
  if (f) {
238
- var m = y[s];
255
+ var h = T[l];
239
256
  f.scrollTo({
240
- left: m,
241
- behavior: i ? "smooth" : "auto"
257
+ left: h,
258
+ behavior: a ? "smooth" : "auto"
242
259
  });
243
260
  }
244
261
  }, [
245
- y
246
- ]), ae = a.useCallback(function() {
247
- var s = h.current;
248
- if (s) {
249
- var i = s.scrollLeft, f = _toConsumableArray(T).reverse().find(function(m) {
250
- return m - i < -1;
262
+ T
263
+ ]), he = u.useCallback(function() {
264
+ var l = I.current;
265
+ if (l) {
266
+ var a = l.scrollLeft, f = _toConsumableArray(W).reverse().find(function(h) {
267
+ return h - a < -1;
251
268
  });
252
- s.scrollTo({
269
+ l.scrollTo({
253
270
  left: f,
254
271
  behavior: "smooth"
255
272
  });
256
273
  }
257
274
  }, [
258
- T
259
- ]), $ = a.useCallback(function() {
260
- var s = h.current;
261
- if (s) {
262
- var i = s.scrollLeft, f = T.find(function(m) {
263
- return m - i > 1;
275
+ W
276
+ ]), Y = u.useCallback(function() {
277
+ var l = I.current;
278
+ if (l) {
279
+ var a = l.scrollLeft, f = W.find(function(h) {
280
+ return h - a > 1;
264
281
  });
265
- s.scrollTo({
282
+ l.scrollTo({
266
283
  left: f,
267
284
  behavior: "smooth"
268
285
  });
269
286
  }
270
287
  }, [
271
- T
272
- ]), Y = te(!!p, h);
273
- a.useEffect(function() {
274
- g !== void 0 && W(Math.floor(g / I), !1);
288
+ W
289
+ ]), J = le(!!m, I);
290
+ u.useEffect(function() {
291
+ p !== void 0 && D(Math.floor(p / g), !1);
275
292
  }, [
276
- g,
277
- W,
278
- I
279
- ]), a.useEffect(function() {
280
- if (Y && p) {
281
- var s = typeof p == "boolean" ? oe : p.time, i = typeof p == "object" && p.loop, f = setInterval(function() {
282
- var m;
283
- F !== 0 ? $() : i && ((m = h.current) == null || m.scrollTo({
293
+ p,
294
+ D,
295
+ g
296
+ ]), u.useEffect(function() {
297
+ if (J && m) {
298
+ var l = typeof m == "boolean" ? ce : m.time, a = typeof m == "object" && m.loop, f = setInterval(function() {
299
+ var h;
300
+ $ !== 0 ? Y() : a && ((h = I.current) == null || h.scrollTo({
284
301
  left: 0,
285
302
  behavior: "smooth"
286
303
  }));
287
- }, s);
304
+ }, l);
288
305
  return function() {
289
306
  return clearInterval(f);
290
307
  };
291
308
  }
292
309
  }, [
293
- p,
310
+ m,
311
+ Y,
294
312
  $,
295
- F,
296
- Y
313
+ J
297
314
  ]);
298
- var N = Fe(E, y);
299
- a.useEffect(function() {
300
- if (S) {
301
- var s = Math.min((N + 1) * I - 1, e.length - 1), i = [];
302
- for(var f = 0; f < I; f++){
303
- var m = s - f;
304
- m >= 0 && i.unshift(m);
315
+ var C = Ge(H, T);
316
+ u.useEffect(function() {
317
+ if (A) {
318
+ var l = Math.min((C + 1) * g - 1, e.length - 1), a = [];
319
+ for(var f = 0; f < g; f++){
320
+ var h = l - f;
321
+ h >= 0 && a.unshift(h);
305
322
  }
306
- S({
307
- pageIndex: N,
308
- shownItemIndexes: i
323
+ A({
324
+ pageIndex: C,
325
+ shownItemIndexes: a
309
326
  });
310
327
  }
311
328
  }, [
312
- N,
329
+ C,
313
330
  e.length,
314
- I,
315
- S
331
+ g,
332
+ A
316
333
  ]);
317
- var D = null;
334
+ var V = null;
318
335
  var _obj, _obj1;
319
- return d ? D = d({
320
- numPages: v,
321
- currentIndex: N,
322
- onPress: W
323
- }) : r && (D = v > 1 && /* @__PURE__ */ t(re, {
324
- numPages: v,
325
- currentIndex: N,
326
- onPress: W
327
- })), /* @__PURE__ */ q(pe, {
336
+ return d ? V = d({
337
+ numPages: w,
338
+ currentIndex: C,
339
+ onPress: D
340
+ }) : o && (V = w > 1 && /* @__PURE__ */ r(ne, {
341
+ numPages: w,
342
+ currentIndex: C,
343
+ onPress: D
344
+ })), /* @__PURE__ */ G(Ie, {
328
345
  space: 24,
329
346
  dataAttributes: _objectSpread({
330
347
  "component-name": "Carousel"
331
- }, _),
348
+ }, F),
332
349
  children: [
333
- /* @__PURE__ */ q("div", {
334
- className: ke,
350
+ /* @__PURE__ */ G("div", {
351
+ className: Te,
335
352
  children: [
336
- /* @__PURE__ */ t(R, {
353
+ /* @__PURE__ */ r(R, {
337
354
  isInverse: !1,
338
- children: /* @__PURE__ */ t(M, {
339
- className: Be,
340
- "aria-label": w.carouselPrevButton,
341
- onPress: ae,
342
- disabled: !ie,
343
- children: /* @__PURE__ */ t(J, {})
355
+ children: /* @__PURE__ */ r(B, {
356
+ className: We,
357
+ "aria-label": S.carouselPrevButton,
358
+ onPress: he,
359
+ disabled: !de,
360
+ children: /* @__PURE__ */ r(Z, {})
344
361
  })
345
362
  }),
346
- /* @__PURE__ */ t("div", {
347
- className: G(Ee, (_obj = {}, _defineProperty(_obj, ye, L), _defineProperty(_obj, Te, v > 1), _obj)),
348
- style: _objectSpreadProps(_objectSpread({}, ze(_objectSpread((_obj1 = {}, _defineProperty(_obj1, C.itemsPerPageDesktop, String(o.desktop)), _defineProperty(_obj1, C.itemsPerPageMobile, String(o.mobile)), _defineProperty(_obj1, C.mobilePageOffsetNext, u.next ? "".concat(u.next, "px") : ""), _defineProperty(_obj1, C.mobilePageOffsetPrev, u.prev ? "".concat(u.prev, "px") : ""), _obj1), P !== void 0 ? _defineProperty({}, C.gap, String(P)) : {}))), {
349
- scrollSnapType: j ? "initial" : "x mandatory"
363
+ /* @__PURE__ */ r("div", {
364
+ className: K(De, (_obj = {}, _defineProperty(_obj, Ve, N), _defineProperty(_obj, Oe, w > 1), _obj)),
365
+ style: _objectSpreadProps(_objectSpread({}, Fe(_objectSpread((_obj1 = {}, _defineProperty(_obj1, L.itemsPerPageDesktop, String(i.desktop)), _defineProperty(_obj1, L.itemsPerPageTablet, String(i.tablet)), _defineProperty(_obj1, L.itemsPerPageMobile, String(i.mobile)), _defineProperty(_obj1, L.mobilePageOffsetNext, b.next ? "".concat(b.next, "px") : ""), _defineProperty(_obj1, L.mobilePageOffsetPrev, b.prev ? "".concat(b.prev, "px") : ""), _obj1), x !== void 0 ? _defineProperty({}, L.gap, String(x)) : {}))), {
366
+ scrollSnapType: _ ? "initial" : "x mandatory"
350
367
  }),
351
- ref: h,
352
- children: e.map(function(s, i) {
353
- return /* @__PURE__ */ t("div", {
354
- className: G(We, l),
355
- style: _objectSpreadProps(_objectSpread({}, c), {
356
- scrollSnapStop: ee(B) ? "always" : "normal"
368
+ ref: I,
369
+ children: e.map(function(l, a) {
370
+ return /* @__PURE__ */ r("div", {
371
+ className: K(ze, t),
372
+ style: _objectSpreadProps(_objectSpread({}, s), {
373
+ scrollSnapStop: re(y) ? "always" : "normal"
357
374
  }),
358
375
  "data-item": !0,
359
- children: s
360
- }, i);
376
+ children: l
377
+ }, a);
361
378
  })
362
379
  }),
363
- /* @__PURE__ */ t(R, {
380
+ /* @__PURE__ */ r(R, {
364
381
  isInverse: !1,
365
- children: /* @__PURE__ */ t(M, {
366
- className: De,
367
- "aria-label": w.carouselNextButton,
368
- onPress: $,
369
- disabled: !ce,
370
- children: /* @__PURE__ */ t(K, {})
382
+ children: /* @__PURE__ */ r(B, {
383
+ className: je,
384
+ "aria-label": S.carouselNextButton,
385
+ onPress: Y,
386
+ disabled: !fe,
387
+ children: /* @__PURE__ */ r(ee, {})
371
388
  })
372
389
  })
373
390
  ]
374
391
  }),
375
- D && /* @__PURE__ */ t("div", {
376
- className: Ve,
377
- children: D
392
+ V && /* @__PURE__ */ r("div", {
393
+ className: _e,
394
+ children: V
378
395
  })
379
396
  ]
380
397
  });
381
- }, lt = function(e) {
382
- return /* @__PURE__ */ t(se, _objectSpread({}, e));
383
- }, nt = function(param) {
384
- var e = param.items, c = param.itemStyle, l = param.itemClassName, r = param.withBullets, d = param.renderBullets, g = param.initialActiveItem, b = param.onPageChange, n = param.dataAttributes;
385
- return /* @__PURE__ */ t(se, {
398
+ }, ft = function(e) {
399
+ return /* @__PURE__ */ r(ie, _objectSpread({}, e));
400
+ }, dt = function(param) {
401
+ var e = param.items, s = param.itemStyle, t = param.itemClassName, o = param.withBullets, d = param.renderBullets, p = param.initialActiveItem, v = param.onPageChange, n = param.dataAttributes;
402
+ return /* @__PURE__ */ r(ie, {
386
403
  items: e,
387
- itemStyle: c,
388
- itemClassName: l,
404
+ itemStyle: s,
405
+ itemClassName: t,
389
406
  itemsPerPage: {
390
407
  mobile: 1,
408
+ tablet: 1,
391
409
  desktop: 3
392
410
  },
393
411
  centered: !0,
394
412
  itemsToScroll: 1,
395
413
  mobilePageOffset: 0,
396
414
  gap: 0,
397
- withBullets: r,
415
+ withBullets: o,
398
416
  renderBullets: d,
399
- initialActiveItem: g,
400
- onPageChange: b,
417
+ initialActiveItem: p,
418
+ onPageChange: v,
401
419
  dataAttributes: n
402
420
  });
403
- }, ct = function(param) {
404
- var e = param.items, c = param.withBullets, l = param.autoplay, r = param.onPageChange, d = param.dataAttributes;
405
- var ref = X(), g = ref.texts, b = ref.platformOverrides, n = a.useRef(null), ref1 = _slicedToArray(a.useState({
421
+ }, ht = function(param) {
422
+ var e = param.items, s = param.withBullets, t = param.autoplay, o = param.onPageChange, d = param.dataAttributes;
423
+ var ref = oe(), p = ref.texts, v = ref.platformOverrides, n = u.useRef(null), ref1 = _slicedToArray(u.useState({
406
424
  scrollLeft: 0,
407
425
  scrollRight: 0
408
- }), 2), ref2 = ref1[0], k = ref2.scrollLeft, P = ref2.scrollRight, j = ref1[1], L = a.useCallback(function() {
409
- var o = n.current;
410
- o && o.scrollBy({
411
- left: -o.clientWidth,
426
+ }), 2), ref2 = ref1[0], E = ref2.scrollLeft, x = ref2.scrollRight, _ = ref1[1], N = u.useCallback(function() {
427
+ var c = n.current;
428
+ c && c.scrollBy({
429
+ left: -c.clientWidth,
412
430
  behavior: "smooth"
413
431
  });
414
- }, []), p = a.useCallback(function() {
415
- var o = n.current;
416
- o && o.scrollBy({
417
- left: o.clientWidth,
432
+ }, []), m = u.useCallback(function() {
433
+ var c = n.current;
434
+ c && c.scrollBy({
435
+ left: c.clientWidth,
418
436
  behavior: "smooth"
419
437
  });
420
- }, []), S = P !== 0, _ = k !== 0, w = n.current ? Math.floor((k + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
421
- a.useLayoutEffect(function() {
422
- var o = n.current;
423
- if (o) {
424
- var u = function() {
425
- var h = o.scrollWidth, I = o.clientWidth, v = Math.round(o.scrollLeft), E = Math.round(h - (v + I));
426
- j({
427
- scrollLeft: v,
428
- scrollRight: E
438
+ }, []), A = x !== 0, F = E !== 0, S = n.current ? Math.floor((E + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
439
+ u.useLayoutEffect(function() {
440
+ var c = n.current;
441
+ if (c) {
442
+ var i = function() {
443
+ var k = c.scrollWidth, U = c.clientWidth, g = Math.round(c.scrollLeft), b = Math.round(k - (g + U));
444
+ _({
445
+ scrollLeft: g,
446
+ scrollRight: b
429
447
  });
430
448
  };
431
- u(), o.addEventListener("scroll", u);
432
- var x = Z(o, u);
449
+ i(), c.addEventListener("scroll", i);
450
+ var P = se(c, i);
433
451
  return function() {
434
- o.removeEventListener("scroll", u), x();
452
+ c.removeEventListener("scroll", i), P();
435
453
  };
436
454
  }
437
455
  }, [
438
456
  e.length
439
457
  ]);
440
- var B = te(!!l, n);
441
- return a.useEffect(function() {
442
- if (B && l) {
443
- var o = typeof l == "boolean" ? oe : l.time, u = typeof l == "object" && l.loop, x = setInterval(function() {
444
- var h;
445
- P !== 0 ? p() : u && ((h = n.current) == null || h.scrollTo({
458
+ var y = le(!!t, n);
459
+ return u.useEffect(function() {
460
+ if (y && t) {
461
+ var c = typeof t == "boolean" ? ce : t.time, i = typeof t == "object" && t.loop, P = setInterval(function() {
462
+ var k;
463
+ x !== 0 ? m() : i && ((k = n.current) == null || k.scrollTo({
446
464
  left: 0,
447
465
  behavior: "smooth"
448
466
  }));
449
- }, o);
467
+ }, c);
450
468
  return function() {
451
- return clearInterval(x);
469
+ return clearInterval(P);
452
470
  };
453
471
  }
454
472
  }, [
455
- l,
456
- p,
457
- P,
458
- B
459
- ]), a.useEffect(function() {
460
- r && r(w);
473
+ t,
474
+ m,
475
+ x,
476
+ y
477
+ ]), u.useEffect(function() {
478
+ o && o(S);
461
479
  }, [
462
- w,
463
- r
464
- ]), /* @__PURE__ */ q("div", _objectSpreadProps(_objectSpread({
465
- className: Pe
466
- }, be(d, "SlideShow")), {
480
+ S,
481
+ o
482
+ ]), /* @__PURE__ */ G("div", _objectSpreadProps(_objectSpread({
483
+ className: ke
484
+ }, we(d, "SlideShow")), {
467
485
  children: [
468
- /* @__PURE__ */ t(R, {
486
+ /* @__PURE__ */ r(R, {
469
487
  isInverse: !1,
470
- children: /* @__PURE__ */ t(M, {
471
- className: xe,
472
- "aria-label": g.carouselPrevButton,
473
- onPress: L,
474
- disabled: !_,
475
- children: /* @__PURE__ */ t(J, {})
488
+ children: /* @__PURE__ */ r(B, {
489
+ className: Le,
490
+ "aria-label": p.carouselPrevButton,
491
+ onPress: N,
492
+ disabled: !F,
493
+ children: /* @__PURE__ */ r(Z, {})
476
494
  })
477
495
  }),
478
- /* @__PURE__ */ t(ve, {
479
- children: /* @__PURE__ */ t("div", {
480
- className: we,
496
+ /* @__PURE__ */ r(Pe, {
497
+ children: /* @__PURE__ */ r("div", {
498
+ className: Ne,
481
499
  ref: n,
482
- children: e.map(function(o, u) {
483
- return /* @__PURE__ */ t("div", {
484
- className: Le,
500
+ children: e.map(function(c, i) {
501
+ return /* @__PURE__ */ r("div", {
502
+ className: Ae,
485
503
  style: {
486
- scrollSnapStop: ee(b) ? "always" : "normal"
504
+ scrollSnapStop: re(v) ? "always" : "normal"
487
505
  },
488
- children: o
489
- }, u);
506
+ children: c
507
+ }, i);
490
508
  })
491
509
  })
492
510
  }),
493
- /* @__PURE__ */ t(R, {
511
+ /* @__PURE__ */ r(R, {
494
512
  isInverse: !1,
495
- children: /* @__PURE__ */ t(M, {
496
- className: Se,
497
- "aria-label": g.carouselNextButton,
498
- onPress: p,
499
- disabled: !S,
500
- children: /* @__PURE__ */ t(K, {})
513
+ children: /* @__PURE__ */ r(B, {
514
+ className: Ce,
515
+ "aria-label": p.carouselNextButton,
516
+ onPress: m,
517
+ disabled: !A,
518
+ children: /* @__PURE__ */ r(ee, {})
501
519
  })
502
520
  }),
503
- c && e.length > 1 && /* @__PURE__ */ t(R, {
521
+ s && e.length > 1 && /* @__PURE__ */ r(R, {
504
522
  isInverse: !0,
505
- children: /* @__PURE__ */ t("div", {
506
- className: Ne,
507
- children: /* @__PURE__ */ t(re, {
523
+ children: /* @__PURE__ */ r("div", {
524
+ className: Me,
525
+ children: /* @__PURE__ */ r(ne, {
508
526
  numPages: e.length,
509
- currentIndex: w
527
+ currentIndex: S
510
528
  })
511
529
  })
512
530
  })
513
531
  ]
514
532
  }));
515
533
  };
516
- export { lt as Carousel, nt as CenteredCarousel, re as PageBullets, ct as Slideshow };
534
+ export { ft as Carousel, dt as CenteredCarousel, ne as PageBullets, ht as Slideshow };