@factorialco/f0-react 1.225.1 → 1.227.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/f0.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as g, L as pe, c as ge, P as G, a as b, f as ve, b as be, A as xe, B as Ce, d as ye, e as we, g as Ne, V as Le, h as H, i as U, j as Pe, k as W, S as J, l as M, m as Y, n as Se, O as Fe, o as X, p as De, q as ke, F as K, r as Me, s as Te, t as Ie, D as Re, u as Be, v as Oe, w as $e, x as Q, y as w, U as Z, z as Ee, E as _e, G as z, H as je, I as ee, J as ze, K as Ve, M as Ae, N as qe, Q as Ge, R as He, X as Ue, T as We, W as Je, Y as Ye, Z as Xe, _ as Ke } from "./hooks-CsJn4oSG.js";
2
- import { az as Ja, $ as Ya, aB as Xa, aK as Ka, a0 as Qa, a1 as Za, a2 as er, a3 as ar, a4 as rr, a5 as sr, a6 as tr, a7 as lr, a9 as or, aa as nr, ab as ir, ac as dr, aG as cr, ae as ur, af as fr, ag as mr, ah as hr, ak as pr, al as gr, am as vr, an as br, ap as xr, ad as Cr, ao as yr, aj as wr, aH as Nr, aA as Lr, au as Pr, ax as Sr, at as Fr, aL as Dr, as as kr, ar as Mr, a8 as Tr, ai as Ir, aq as Rr, av as Br, aC as Or, aD as $r, aE as Er, aM as _r, aw as jr, aF as zr, aJ as Vr, ay as Ar, aI as qr } from "./hooks-CsJn4oSG.js";
1
+ import { C as g, L as pe, c as ge, P as G, a as b, f as ve, b as be, A as xe, B as Ce, d as ye, e as we, g as Ne, V as Le, h as M, i as H, j as U, k as Pe, l as W, S as J, m as Y, n as Se, O as Fe, o as X, p as De, q as ke, F as K, r as Me, s as Te, t as Ie, D as Re, u as Be, v as Oe, w as $e, x as Q, y as w, U as Z, z as Ee, E as _e, G as z, H as je, I as ee, J as ze, K as Ve, M as Ae, N as qe, Q as Ge, R as He, X as Ue, T as We, W as Je, Y as Ye, Z as Xe, _ as Ke } from "./hooks-D8oWmrY7.js";
2
+ import { az as Ja, $ as Ya, aB as Xa, aK as Ka, a0 as Qa, a1 as Za, a2 as er, a3 as ar, a4 as rr, a5 as sr, a6 as tr, a7 as lr, a9 as or, aa as nr, ab as ir, ac as dr, aG as cr, ae as ur, af as fr, ag as mr, ah as hr, ak as pr, al as gr, am as vr, an as br, ap as xr, ad as Cr, ao as yr, aj as wr, aH as Nr, aA as Lr, au as Pr, ax as Sr, at as Fr, aL as Dr, as as kr, ar as Mr, a8 as Tr, ai as Ir, aq as Rr, av as Br, aC as Or, aD as $r, aE as Er, aM as _r, aw as jr, aF as zr, aJ as Vr, ay as Ar, aI as qr } from "./hooks-D8oWmrY7.js";
3
3
  import { jsx as e, jsxs as c, Fragment as $ } from "react/jsx-runtime";
4
4
  import * as E from "react";
5
5
  import Qe, { useState as v, forwardRef as I, useRef as ae, useImperativeHandle as Ze, Children as ea, useEffect as re, createContext as aa } from "react";
@@ -201,13 +201,10 @@ const Fa = {
201
201
  noResults: "No results found",
202
202
  loadingMore: "Loading..."
203
203
  }
204
- }, Da = g(
205
- {
206
- name: "Link",
207
- type: "info"
208
- },
209
- pe
210
- ), ka = [
204
+ }, Da = g({
205
+ name: "Link",
206
+ type: "info"
207
+ }, pe), ka = [
211
208
  "person",
212
209
  "team",
213
210
  "company",
@@ -288,34 +285,27 @@ function na(a, r) {
288
285
  Defaulting to \`null\`.`;
289
286
  }
290
287
  var ne = se, ia = le;
291
- const ie = E.forwardRef(({ className: a, value: r, ...s }, o) => /* @__PURE__ */ e(
292
- ne,
293
- {
294
- ref: o,
295
- className: b(
296
- "relative h-2 w-full overflow-hidden rounded-full bg-f1-background-secondary",
297
- a
298
- ),
299
- ...s,
300
- children: /* @__PURE__ */ e(
301
- ia,
302
- {
303
- className: "h-full w-full flex-1 transition-all",
304
- style: {
305
- backgroundColor: s.color,
306
- transform: `translateX(-${100 - (r || 0)}%)`
307
- }
308
- }
309
- )
310
- }
311
- ));
288
+ const ie = E.forwardRef(({ className: a, value: r, ...s }, o) => e(ne, {
289
+ ref: o,
290
+ className: b("relative h-2 w-full overflow-hidden rounded-full bg-f1-background-secondary", a),
291
+ ...s,
292
+ children: e(ia, {
293
+ className: "h-full w-full flex-1 transition-all",
294
+ style: {
295
+ backgroundColor: s.color,
296
+ transform: `translateX(-${100 - (r || 0)}%)`
297
+ }
298
+ })
299
+ }));
312
300
  ie.displayName = ne.displayName;
313
301
  const da = ({ value: a, max: r = 100, label: s, color: o }, t) => {
314
302
  const i = o || be(0), n = a / r * 100;
315
- return /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", "aria-live": "polite", children: [
316
- /* @__PURE__ */ e("div", { className: "flex-grow", children: /* @__PURE__ */ e(
317
- ie,
318
- {
303
+ return c("div", {
304
+ className: "flex items-center space-x-2",
305
+ "aria-live": "polite",
306
+ children: [e("div", {
307
+ className: "flex-grow",
308
+ children: e(ie, {
319
309
  color: i,
320
310
  value: n,
321
311
  className: "w-full",
@@ -323,10 +313,12 @@ const da = ({ value: a, max: r = 100, label: s, color: o }, t) => {
323
313
  "aria-valuemax": r,
324
314
  "aria-valuenow": a,
325
315
  "aria-label": `${n.toFixed(1)}%`
326
- }
327
- ) }),
328
- s && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sm font-medium", children: s })
329
- ] });
316
+ })
317
+ }), s && e("div", {
318
+ className: "flex-shrink-0 text-sm font-medium",
319
+ children: s
320
+ })]
321
+ });
330
322
  }, ca = ve(da), Ta = g(
331
323
  {
332
324
  name: "AreaChart",
@@ -370,78 +362,66 @@ const da = ({ value: a, max: r = 100, label: s, color: o }, t) => {
370
362
  },
371
363
  ca
372
364
  ), O = ({ count: a, list: r }) => {
373
- const [s, o] = v(!1), t = /* @__PURE__ */ e(M, { label: `+${a}` });
374
- return r != null && r.length ? /* @__PURE__ */ c(H, { open: s, onOpenChange: o, children: [
375
- /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e("button", { className: Pe("inline-flex flex-shrink-0 items-center"), children: t }) }),
376
- /* @__PURE__ */ e(
377
- W,
378
- {
379
- className: "rounded-md border border-solid border-f1-border-secondary p-1 shadow-md",
380
- align: "end",
381
- children: /* @__PURE__ */ c(J, { className: "[*[data-state=visible]_div]:bg-f1-background flex max-h-[172px] flex-col", children: [
382
- r.map((i, n) => /* @__PURE__ */ e(
383
- "div",
384
- {
385
- className: "flex w-[220px] min-w-0 items-center gap-1.5 px-2 py-1 [&:first-child]:pt-2 [&:last-child]:pb-2",
386
- children: /* @__PURE__ */ e(M, { ...i })
387
- },
388
- n
389
- )),
390
- /* @__PURE__ */ e(
391
- Y,
392
- {
393
- orientation: "vertical",
394
- className: "[&_div]:bg-f1-background"
395
- }
396
- )
397
- ] })
398
- }
399
- )
400
- ] }) : t;
365
+ const [s, o] = v(!1), t = e(M, {
366
+ label: `+${a}`
367
+ });
368
+ return r != null && r.length ? c(H, {
369
+ open: s,
370
+ onOpenChange: o,
371
+ children: [e(U, {
372
+ asChild: !0,
373
+ children: e("button", {
374
+ className: Pe("inline-flex flex-shrink-0 items-center"),
375
+ children: t
376
+ })
377
+ }), e(W, {
378
+ className: "rounded-md border border-solid border-f1-border-secondary p-1 shadow-md",
379
+ align: "end",
380
+ children: c(J, {
381
+ className: "[*[data-state=visible]_div]:bg-f1-background flex max-h-[172px] flex-col",
382
+ children: [r.map((i, n) => e("div", {
383
+ className: "flex w-[220px] min-w-0 items-center gap-1.5 px-2 py-1 [&:first-child]:pt-2 [&:last-child]:pb-2",
384
+ children: e(M, {
385
+ ...i
386
+ })
387
+ }, n)), e(Y, {
388
+ orientation: "vertical",
389
+ className: "[&_div]:bg-f1-background"
390
+ })]
391
+ })
392
+ })]
393
+ }) : t;
401
394
  };
402
395
  O.displayName = "ChipCounter";
403
- const de = ({
404
- chips: a,
405
- max: r = 4,
406
- remainingCount: s,
407
- layout: o = "compact"
408
- }) => {
396
+ const de = ({ chips: a, max: r = 4, remainingCount: s, layout: o = "compact" }) => {
409
397
  if (o === "fill")
410
- return /* @__PURE__ */ e(
411
- Fe,
412
- {
413
- items: a,
414
- renderListItem: (l) => /* @__PURE__ */ e(M, { ...l }),
415
- renderDropdownItem: () => null,
416
- forceShowingOverflowIndicator: s !== void 0,
417
- renderOverflowIndicator: (l) => /* @__PURE__ */ e(
418
- O,
419
- {
420
- count: (s ?? 0) + l,
421
- list: s ? void 0 : a.slice(a.length - l)
422
- }
423
- ),
424
- overflowIndicatorWithPopover: !1,
425
- className: "flex-1"
426
- }
427
- );
398
+ return e(Fe, {
399
+ items: a,
400
+ renderListItem: (l) => e(M, {
401
+ ...l
402
+ }),
403
+ renderDropdownItem: () => null,
404
+ forceShowingOverflowIndicator: s !== void 0,
405
+ renderOverflowIndicator: (l) => e(O, {
406
+ count: (s ?? 0) + l,
407
+ list: s ? void 0 : a.slice(a.length - l)
408
+ }),
409
+ overflowIndicatorWithPopover: !1,
410
+ className: "flex-1"
411
+ });
428
412
  const t = a.slice(0, r), i = a.slice(r), n = s ?? a.length - r, d = n > 0;
429
- return /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
430
- t.map((l, f) => /* @__PURE__ */ e(M, { ...l }, f)),
431
- d && /* @__PURE__ */ e(
432
- O,
433
- {
434
- count: n,
435
- list: s ? void 0 : i
436
- }
437
- )
438
- ] });
413
+ return c("div", {
414
+ className: "flex items-center gap-2",
415
+ children: [t.map((l, f) => e(M, {
416
+ ...l
417
+ }, f)), d && e(O, {
418
+ count: n,
419
+ list: s ? void 0 : i
420
+ })]
421
+ });
439
422
  };
440
423
  de.displayName = "F0ChipList";
441
- const _a = Se(
442
- "F0ChipList",
443
- de
444
- ), ua = {
424
+ const _a = Se("F0ChipList", de), ua = {
445
425
  xs: 1,
446
426
  sm: 2,
447
427
  md: 2,
@@ -449,225 +429,186 @@ const _a = Se(
449
429
  }, fa = I(function({ widgets: r, children: s }, o) {
450
430
  const t = ae(null);
451
431
  Ze(o, () => t.current);
452
- const i = ea.toArray(r).filter((n) => !!n).map((n, d) => /* @__PURE__ */ e("div", { className: "h-full @5xl:h-auto [&>div]:h-full", children: n }, d));
453
- return /* @__PURE__ */ e(X, { layout: "home", children: /* @__PURE__ */ c("div", { ref: t, className: "@container", children: [
454
- /* @__PURE__ */ c("div", { className: "flex flex-col gap-6 px-5 pt-4 @md:pt-2 @5xl:hidden", children: [
455
- /* @__PURE__ */ e(De, { columns: ua, showArrows: !1, children: i }),
456
- /* @__PURE__ */ e("main", { children: s })
457
- ] }),
458
- /* @__PURE__ */ c("div", { className: "hidden grid-cols-3 gap-5 px-6 pb-6 pt-2 @5xl:grid", children: [
459
- /* @__PURE__ */ e("div", { className: "col-span-3 flex flex-row gap-5 *:flex-1", children: i.slice(0, 3) }),
460
- /* @__PURE__ */ e("main", { className: "col-span-2", children: s }),
461
- /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col gap-5", children: i.slice(3) })
462
- ] })
463
- ] }) });
464
- }), ma = I(
465
- function({
466
- children: r,
467
- sideContent: s,
468
- mainColumnPosition: o = "left",
469
- sticky: t = !1
470
- }, i) {
471
- return /* @__PURE__ */ e("div", { ref: i, className: "h-full", children: /* @__PURE__ */ c(
472
- "div",
473
- {
474
- className: b(
475
- "flex h-full max-w-full overflow-auto text-f1-foreground md:flex-row",
476
- "flex-col",
477
- "overflow-y-auto",
478
- t && "md:sticky md:top-0 md:max-h-full"
479
- ),
480
- children: [
481
- /* @__PURE__ */ e(
482
- "main",
483
- {
484
- className: b(
485
- "sm:min-h-xs order-2 h-fit border-0 px-4 py-5 sm:flex-1 sm:border-solid md:order-2 md:px-6",
486
- t ? "md:h-full md:max-h-full md:overflow-y-auto" : "min-h-full",
487
- o === "right" ? "sm:border-l sm:border-l-f1-border-secondary" : "sm:border-r sm:border-r-f1-border-secondary",
488
- "border-t border-solid border-t-f1-border-secondary sm:border-t-0"
489
- ),
490
- children: r
491
- }
492
- ),
493
- /* @__PURE__ */ e(
494
- ha,
495
- {
496
- sticky: t,
497
- className: b(
498
- "order-1",
499
- o === "right" ? "md:order-1" : "md:order-3"
500
- ),
501
- children: s
502
- }
503
- )
504
- ]
505
- }
506
- ) });
507
- }
508
- ), ha = ({
509
- children: a,
510
- className: r
511
- }) => /* @__PURE__ */ e(
512
- "aside",
513
- {
514
- className: b(
515
- "min-w-30 py-5 pl-4 pr-4 sm:basis-1/4 sm:pb-6 md:max-w-80 md:pl-2",
516
- r
517
- ),
518
- children: a
519
- }
520
- ), pa = ke({
432
+ const i = ea.toArray(r).filter((n) => !!n).map((n, d) => e("div", {
433
+ className: "h-full @5xl:h-auto [&>div]:h-full",
434
+ children: n
435
+ }, d));
436
+ return e(X, {
437
+ layout: "home",
438
+ children: c("div", {
439
+ ref: t,
440
+ className: "@container",
441
+ children: [c("div", {
442
+ className: "flex flex-col gap-6 px-5 pt-4 @md:pt-2 @5xl:hidden",
443
+ children: [e(De, {
444
+ columns: ua,
445
+ showArrows: !1,
446
+ children: i
447
+ }), e("main", {
448
+ children: s
449
+ })]
450
+ }), c("div", {
451
+ className: "hidden grid-cols-3 gap-5 px-6 pb-6 pt-2 @5xl:grid",
452
+ children: [e("div", {
453
+ className: "col-span-3 flex flex-row gap-5 *:flex-1",
454
+ children: i.slice(0, 3)
455
+ }), e("main", {
456
+ className: "col-span-2",
457
+ children: s
458
+ }), e("div", {
459
+ className: "flex flex-1 flex-col gap-5",
460
+ children: i.slice(3)
461
+ })]
462
+ })]
463
+ })
464
+ });
465
+ }), ma = I(function({ children: r, sideContent: s, mainColumnPosition: o = "left", sticky: t = !1 }, i) {
466
+ return e("div", {
467
+ ref: i,
468
+ className: "h-full",
469
+ children: c("div", {
470
+ className: b("flex h-full max-w-full overflow-auto text-f1-foreground md:flex-row", "flex-col", "overflow-y-auto", t && "md:sticky md:top-0 md:max-h-full"),
471
+ children: [e("main", {
472
+ className: b("sm:min-h-xs order-2 h-fit border-0 px-4 py-5 sm:flex-1 sm:border-solid md:order-2 md:px-6", t ? "md:h-full md:max-h-full md:overflow-y-auto" : "min-h-full", o === "right" ? "sm:border-l sm:border-l-f1-border-secondary" : "sm:border-r sm:border-r-f1-border-secondary", "border-t border-solid border-t-f1-border-secondary sm:border-t-0"),
473
+ children: r
474
+ }), e(ha, {
475
+ sticky: t,
476
+ className: b("order-1", o === "right" ? "md:order-1" : "md:order-3"),
477
+ children: s
478
+ })]
479
+ })
480
+ });
481
+ }), ha = ({ children: a, className: r }) => e("aside", {
482
+ className: b("min-w-30 py-5 pl-4 pr-4 sm:basis-1/4 sm:pb-6 md:max-w-80 md:pl-2", r),
483
+ children: a
484
+ }), pa = ke({
521
485
  base: "relative flex min-h-full w-full flex-1 flex-col gap-4 place-self-center overflow-y-auto px-6 py-5",
522
486
  variants: {
523
487
  variant: {
524
488
  narrow: "max-w-screen-lg"
525
489
  }
526
490
  }
527
- }), ce = Qe.forwardRef(({ children: a, variant: r, className: s, ...o }, t) => /* @__PURE__ */ e(X, { layout: "standard", children: /* @__PURE__ */ e(
528
- "section",
529
- {
491
+ }), ce = Qe.forwardRef(({ children: a, variant: r, className: s, ...o }, t) => e(X, {
492
+ layout: "standard",
493
+ children: e("section", {
530
494
  ref: t,
531
495
  className: b("relative flex-1 overflow-auto", s),
532
496
  ...o,
533
- children: /* @__PURE__ */ e("div", { className: b(pa({ variant: r })), children: a })
534
- }
535
- ) }));
497
+ children: e("div", {
498
+ className: b(pa({
499
+ variant: r
500
+ })),
501
+ children: a
502
+ })
503
+ })
504
+ }));
536
505
  ce.displayName = "StandardLayout";
537
- const ja = g(
538
- {
539
- name: "StandardLayout",
540
- type: "layout"
541
- },
542
- ce
543
- ), za = g(
544
- {
545
- name: "TwoColumnLayout",
546
- type: "layout"
547
- },
548
- ma
549
- ), Va = g(
550
- {
551
- name: "HomeLayout",
552
- type: "layout"
553
- },
554
- fa
555
- ), ga = ({ benefits: a }) => /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: a.map((r, s) => /* @__PURE__ */ e(va, { text: r }, s)) }), va = ({ text: a }) => /* @__PURE__ */ c("div", { className: "flex flex-row items-start gap-2", children: [
556
- /* @__PURE__ */ e(Te, { icon: Ie, size: "md", className: "text-f1-icon-positive" }),
557
- /* @__PURE__ */ e("span", { children: a })
558
- ] }), ue = I(
559
- ({
560
- title: a,
561
- image: r,
562
- benefits: s,
563
- actions: o,
564
- withShadow: t = !0,
565
- module: i,
566
- moduleName: n,
567
- tag: d
568
- }, l) => /* @__PURE__ */ c(
569
- "div",
570
- {
571
- ref: l,
572
- className: b(
573
- "bg-white flex flex-row rounded-xl border border-f1-border-secondary",
574
- t && "shadow-md"
575
- ),
576
- children: [
577
- /* @__PURE__ */ e("div", { className: "aspect-auto flex-shrink-0 overflow-hidden rounded-xl py-1 pl-1", children: /* @__PURE__ */ e(
578
- "img",
579
- {
580
- src: r,
581
- alt: "",
582
- className: "h-full w-full rounded-lg object-cover"
583
- }
584
- ) }),
585
- /* @__PURE__ */ c("div", { className: "flex flex-col justify-center gap-8 px-8 py-5", children: [
586
- /* @__PURE__ */ c("div", { className: "flex flex-col gap-5", children: [
587
- /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
588
- /* @__PURE__ */ c("div", { className: "flex flex-row items-center gap-2", children: [
589
- i && /* @__PURE__ */ e(K, { module: i }),
590
- n && /* @__PURE__ */ e("p", { className: "text-base font-medium text-f1-foreground", children: n })
591
- ] }),
592
- d && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ e(Me, { icon: d.icon, text: d.label }) }),
593
- /* @__PURE__ */ e("h2", { className: "font-bold text-xl text-f1-foreground", children: a })
594
- ] }),
595
- /* @__PURE__ */ e(ga, { benefits: s })
596
- ] }),
597
- o && /* @__PURE__ */ e("div", { className: "flex gap-3", children: o })
598
- ] })
599
- ]
600
- }
601
- )
602
- );
506
+ const ja = g({
507
+ name: "StandardLayout",
508
+ type: "layout"
509
+ }, ce), za = g({
510
+ name: "TwoColumnLayout",
511
+ type: "layout"
512
+ }, ma), Va = g({
513
+ name: "HomeLayout",
514
+ type: "layout"
515
+ }, fa), ga = ({ benefits: a }) => e("div", {
516
+ className: "flex flex-col gap-2",
517
+ children: a.map((r, s) => e(va, {
518
+ text: r
519
+ }, s))
520
+ }), va = ({ text: a }) => c("div", {
521
+ className: "flex flex-row items-start gap-2",
522
+ children: [e(Te, {
523
+ icon: Ie,
524
+ size: "md",
525
+ className: "text-f1-icon-positive"
526
+ }), e("span", {
527
+ children: a
528
+ })]
529
+ }), ue = I(({ title: a, image: r, benefits: s, actions: o, withShadow: t = !0, module: i, moduleName: n, tag: d }, l) => c("div", {
530
+ ref: l,
531
+ className: b("bg-white flex flex-row rounded-xl border border-f1-border-secondary", t && "shadow-md"),
532
+ children: [e("div", {
533
+ className: "aspect-auto flex-shrink-0 overflow-hidden rounded-xl py-1 pl-1",
534
+ children: e("img", {
535
+ src: r,
536
+ alt: "",
537
+ className: "h-full w-full rounded-lg object-cover"
538
+ })
539
+ }), c("div", {
540
+ className: "flex flex-col justify-center gap-8 px-8 py-5",
541
+ children: [c("div", {
542
+ className: "flex flex-col gap-5",
543
+ children: [c("div", {
544
+ className: "flex flex-col gap-2",
545
+ children: [c("div", {
546
+ className: "flex flex-row items-center gap-2",
547
+ children: [i && e(K, {
548
+ module: i
549
+ }), n && e("p", {
550
+ className: "text-base font-medium text-f1-foreground",
551
+ children: n
552
+ })]
553
+ }), d && e("div", {
554
+ className: "flex justify-start",
555
+ children: e(Me, {
556
+ icon: d.icon,
557
+ text: d.label
558
+ })
559
+ }), e("h2", {
560
+ className: "font-bold text-xl text-f1-foreground",
561
+ children: a
562
+ })]
563
+ }), e(ga, {
564
+ benefits: s
565
+ })]
566
+ }), o && e("div", {
567
+ className: "flex gap-3",
568
+ children: o
569
+ })]
570
+ })]
571
+ }));
603
572
  ue.displayName = "ProductBlankslate";
604
- function ba({
605
- isOpen: a,
606
- onClose: r,
607
- title: s,
608
- children: o,
609
- module: t,
610
- portalContainer: i
611
- }) {
573
+ function ba({ isOpen: a, onClose: r, title: s, children: o, module: t, portalContainer: i }) {
612
574
  const [n, d] = v(a);
613
575
  return re(() => {
614
576
  d(a);
615
- }, [a]), /* @__PURE__ */ e(Re, { open: n, onOpenChange: (f) => {
616
- d(f), f || r();
617
- }, modal: !0, children: /* @__PURE__ */ c(
618
- Be,
619
- {
577
+ }, [a]), e(Re, {
578
+ open: n,
579
+ onOpenChange: (f) => {
580
+ d(f), f || r();
581
+ },
582
+ modal: !0,
583
+ children: c(Be, {
620
584
  className: "max-h-[620px] w-[760px] overflow-y-auto overflow-x-hidden bg-f1-background",
621
585
  container: i,
622
- children: [
623
- /* @__PURE__ */ c("div", { className: "flex flex-row items-center justify-between px-4 py-4", children: [
624
- /* @__PURE__ */ c(Oe, { className: "flex flex-row items-center gap-2 text-lg font-semibold text-f1-foreground", children: [
625
- t && /* @__PURE__ */ e(K, { module: t, size: "lg" }),
626
- s
627
- ] }),
628
- /* @__PURE__ */ e(
629
- $e,
630
- {
631
- variant: "outline",
632
- icon: Q,
633
- onClick: r,
634
- label: "Close modal",
635
- hideLabel: !0
636
- }
637
- )
638
- ] }),
639
- /* @__PURE__ */ c(J, { className: "[*[data-state=visible]_div]:bg-f1-background flex max-h-[512px] flex-col", children: [
640
- o,
641
- /* @__PURE__ */ e(
642
- Y,
643
- {
644
- orientation: "vertical",
645
- className: "[&_div]:bg-f1-background"
646
- }
647
- )
648
- ] })
649
- ]
650
- }
651
- ) });
586
+ children: [c("div", {
587
+ className: "flex flex-row items-center justify-between px-4 py-4",
588
+ children: [c(Oe, {
589
+ className: "flex flex-row items-center gap-2 text-lg font-semibold text-f1-foreground",
590
+ children: [t && e(K, {
591
+ module: t,
592
+ size: "lg"
593
+ }), s]
594
+ }), e($e, {
595
+ variant: "outline",
596
+ icon: Q,
597
+ onClick: r,
598
+ label: "Close modal",
599
+ hideLabel: !0
600
+ })]
601
+ }), c(J, {
602
+ className: "[*[data-state=visible]_div]:bg-f1-background flex max-h-[512px] flex-col",
603
+ children: [o, e(Y, {
604
+ orientation: "vertical",
605
+ className: "[&_div]:bg-f1-background"
606
+ })]
607
+ })]
608
+ })
609
+ });
652
610
  }
653
- function Aa({
654
- isOpen: a,
655
- onClose: r,
656
- title: s,
657
- image: o,
658
- benefits: t,
659
- errorMessage: i,
660
- successMessage: n,
661
- loadingState: d,
662
- nextSteps: l,
663
- closeLabel: f,
664
- primaryAction: m,
665
- modalTitle: N,
666
- modalModule: L,
667
- secondaryAction: u,
668
- portalContainer: x,
669
- tag: S
670
- }) {
611
+ function Aa({ isOpen: a, onClose: r, title: s, image: o, benefits: t, errorMessage: i, successMessage: n, loadingState: d, nextSteps: l, closeLabel: f, primaryAction: m, modalTitle: N, modalModule: L, secondaryAction: u, portalContainer: x, tag: S }) {
671
612
  const [R, F] = v(a), [C, y] = v(null), [P, h] = v(!1), D = async () => {
672
613
  if (m != null && m.onClick) {
673
614
  h(!0);
@@ -682,78 +623,55 @@ function Aa({
682
623
  }, k = () => {
683
624
  F(!1), r == null || r();
684
625
  }, B = P;
685
- return /* @__PURE__ */ c($, { children: [
686
- /* @__PURE__ */ e(
687
- ba,
688
- {
689
- isOpen: R,
690
- onClose: k,
691
- title: N,
692
- module: L,
693
- portalContainer: x,
694
- children: /* @__PURE__ */ e("div", { className: "pb-4 pl-4", children: /* @__PURE__ */ e(
695
- ue,
696
- {
697
- title: s,
698
- image: o,
699
- benefits: t,
700
- withShadow: !1,
701
- tag: S,
702
- actions: /* @__PURE__ */ c("div", { className: "flex gap-3", children: [
703
- m && /* @__PURE__ */ e(
704
- w,
705
- {
706
- variant: m.variant,
707
- label: B ? d.label : m.label,
708
- icon: m.icon || void 0,
709
- onClick: D,
710
- loading: m.loading,
711
- size: m.size
712
- }
713
- ),
714
- u && /* @__PURE__ */ e(
715
- w,
716
- {
717
- onClick: u.onClick,
718
- label: u.label,
719
- variant: u.variant,
720
- size: u.size,
721
- icon: u.icon
722
- }
723
- )
724
- ] })
725
- }
726
- ) })
727
- }
728
- ),
729
- C && /* @__PURE__ */ e(
730
- Z,
731
- {
732
- open: !0,
733
- onClose: () => {
734
- k(), y(null);
735
- },
736
- success: C === "success",
737
- errorMessage: i,
738
- successMessage: n,
739
- nextSteps: l,
740
- closeLabel: f,
741
- portalContainer: x
742
- }
743
- )
744
- ] });
626
+ return c($, {
627
+ children: [e(ba, {
628
+ isOpen: R,
629
+ onClose: k,
630
+ title: N,
631
+ module: L,
632
+ portalContainer: x,
633
+ children: e("div", {
634
+ className: "pb-4 pl-4",
635
+ children: e(ue, {
636
+ title: s,
637
+ image: o,
638
+ benefits: t,
639
+ withShadow: !1,
640
+ tag: S,
641
+ actions: c("div", {
642
+ className: "flex gap-3",
643
+ children: [m && e(w, {
644
+ variant: m.variant,
645
+ label: B ? d.label : m.label,
646
+ icon: m.icon || void 0,
647
+ onClick: D,
648
+ loading: m.loading,
649
+ size: m.size
650
+ }), u && e(w, {
651
+ onClick: u.onClick,
652
+ label: u.label,
653
+ variant: u.variant,
654
+ size: u.size,
655
+ icon: u.icon
656
+ })]
657
+ })
658
+ })
659
+ })
660
+ }), C && e(Z, {
661
+ open: !0,
662
+ onClose: () => {
663
+ k(), y(null);
664
+ },
665
+ success: C === "success",
666
+ errorMessage: i,
667
+ successMessage: n,
668
+ nextSteps: l,
669
+ closeLabel: f,
670
+ portalContainer: x
671
+ })]
672
+ });
745
673
  }
746
- function xa({
747
- mediaUrl: a,
748
- title: r,
749
- description: s,
750
- onClose: o,
751
- dismissible: t,
752
- width: i,
753
- trackVisibility: n,
754
- actions: d,
755
- showConfirmation: l = !0
756
- }) {
674
+ function xa({ mediaUrl: a, title: r, description: s, onClose: o, dismissible: t, width: i, trackVisibility: n, actions: d, showConfirmation: l = !0 }) {
757
675
  const [f, m] = v(!1), N = () => {
758
676
  m(!0), o && o();
759
677
  };
@@ -761,48 +679,51 @@ function xa({
761
679
  n && n(!f);
762
680
  }, [n, f]);
763
681
  const L = a == null ? void 0 : a.includes(".mp4");
764
- return /* @__PURE__ */ e($, { children: f ? null : /* @__PURE__ */ c(Ee, { style: { width: i }, className: "relative bg-f1-background p-1", children: [
765
- /* @__PURE__ */ c(_e, { children: [
766
- t && /* @__PURE__ */ e("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ e(
767
- w,
768
- {
769
- variant: "ghost",
770
- icon: Q,
771
- size: "sm",
772
- hideLabel: !0,
773
- onClick: N,
774
- label: "Close"
775
- }
776
- ) }),
777
- /* @__PURE__ */ c("div", { children: [
778
- /* @__PURE__ */ e("div", { children: a && (L ? /* @__PURE__ */ e(
779
- "video",
780
- {
781
- src: a,
782
- autoPlay: !0,
783
- muted: !0,
784
- loop: !0,
785
- playsInline: !0,
786
- className: "h-full w-full rounded-md"
787
- }
788
- ) : /* @__PURE__ */ e(
789
- "img",
790
- {
791
- src: a,
792
- alt: r,
793
- className: "h-full w-full rounded-md"
794
- }
795
- )) }),
796
- /* @__PURE__ */ c("div", { className: "flex flex-col gap-[2px] p-3", children: [
797
- /* @__PURE__ */ e(z, { className: "text-lg font-medium", children: r }),
798
- /* @__PURE__ */ e(z, { className: "line-clamp-3 text-base font-normal text-f1-foreground-secondary", children: s })
799
- ] })
800
- ] })
801
- ] }),
802
- d && /* @__PURE__ */ e(je, { className: "p-3", children: d.map(
803
- (u) => u.type === "upsell" ? /* @__PURE__ */ e(
804
- ee,
805
- {
682
+ return e($, {
683
+ children: f ? null : c(Ee, {
684
+ style: {
685
+ width: i
686
+ },
687
+ className: "relative bg-f1-background p-1",
688
+ children: [c(_e, {
689
+ children: [t && e("div", {
690
+ className: "absolute right-2 top-2 z-10",
691
+ children: e(w, {
692
+ variant: "ghost",
693
+ icon: Q,
694
+ size: "sm",
695
+ hideLabel: !0,
696
+ onClick: N,
697
+ label: "Close"
698
+ })
699
+ }), c("div", {
700
+ children: [e("div", {
701
+ children: a && (L ? e("video", {
702
+ src: a,
703
+ autoPlay: !0,
704
+ muted: !0,
705
+ loop: !0,
706
+ playsInline: !0,
707
+ className: "h-full w-full rounded-md"
708
+ }) : e("img", {
709
+ src: a,
710
+ alt: r,
711
+ className: "h-full w-full rounded-md"
712
+ }))
713
+ }), c("div", {
714
+ className: "flex flex-col gap-[2px] p-3",
715
+ children: [e(z, {
716
+ className: "text-lg font-medium",
717
+ children: r
718
+ }), e(z, {
719
+ className: "line-clamp-3 text-base font-normal text-f1-foreground-secondary",
720
+ children: s
721
+ })]
722
+ })]
723
+ })]
724
+ }), d && e(je, {
725
+ className: "p-3",
726
+ children: d.map((u) => u.type === "upsell" ? e(ee, {
806
727
  label: u.label,
807
728
  onRequest: u.onClick,
808
729
  errorMessage: u.errorMessage,
@@ -812,83 +733,46 @@ function xa({
812
733
  closeLabel: u.closeLabel,
813
734
  showConfirmation: l && u.showConfirmation,
814
735
  variant: u.variant
815
- },
816
- u.label
817
- ) : /* @__PURE__ */ e(
818
- w,
819
- {
736
+ }, u.label) : e(w, {
820
737
  label: u.label,
821
738
  onClick: u.onClick,
822
739
  variant: u.variant
823
- },
824
- u.label
825
- )
826
- ) })
827
- ] }) });
740
+ }, u.label))
741
+ })]
742
+ })
743
+ });
828
744
  }
829
- const Ca = I(
830
- function({ primaryAction: r, secondaryAction: s, ...o }, t) {
831
- const i = (l) => l.variant === "promote" ? /* @__PURE__ */ e(
832
- ee,
833
- {
834
- label: l.label,
835
- onRequest: async () => {
836
- await l.onClick();
837
- },
838
- errorMessage: l.errorMessage,
839
- successMessage: l.successMessage,
840
- loadingState: l.loadingState,
841
- nextSteps: l.nextSteps,
842
- closeLabel: l.closeLabel,
843
- showIcon: l.showIcon,
844
- showConfirmation: l.showConfirmation,
845
- variant: l.variant
846
- }
847
- ) : /* @__PURE__ */ e(
848
- w,
849
- {
850
- onClick: l.onClick,
851
- label: l.label,
852
- variant: l.variant || "default",
853
- size: "md",
854
- icon: l.icon
855
- }
856
- ), n = (r == null ? void 0 : r.variant) !== "promote" ? r : void 0, d = (s == null ? void 0 : s.variant) !== "promote" ? s : void 0;
857
- return /* @__PURE__ */ c(
858
- ze,
859
- {
860
- ref: t,
861
- ...o,
862
- primaryAction: n,
863
- secondaryAction: d,
864
- children: [
865
- (r == null ? void 0 : r.variant) === "promote" && i(r),
866
- (s == null ? void 0 : s.variant) === "promote" && i(s)
867
- ]
868
- }
869
- );
870
- }
871
- );
745
+ const Ca = I(function({ primaryAction: r, secondaryAction: s, ...o }, t) {
746
+ const i = (l) => l.variant === "promote" ? e(ee, {
747
+ label: l.label,
748
+ onRequest: async () => {
749
+ await l.onClick();
750
+ },
751
+ errorMessage: l.errorMessage,
752
+ successMessage: l.successMessage,
753
+ loadingState: l.loadingState,
754
+ nextSteps: l.nextSteps,
755
+ closeLabel: l.closeLabel,
756
+ showIcon: l.showIcon,
757
+ showConfirmation: l.showConfirmation,
758
+ variant: l.variant
759
+ }) : e(w, {
760
+ onClick: l.onClick,
761
+ label: l.label,
762
+ variant: l.variant || "default",
763
+ size: "md",
764
+ icon: l.icon
765
+ }), n = (r == null ? void 0 : r.variant) !== "promote" ? r : void 0, d = (s == null ? void 0 : s.variant) !== "promote" ? s : void 0;
766
+ return c(ze, {
767
+ ref: t,
768
+ ...o,
769
+ primaryAction: n,
770
+ secondaryAction: d,
771
+ children: [(r == null ? void 0 : r.variant) === "promote" && i(r), (s == null ? void 0 : s.variant) === "promote" && i(s)]
772
+ });
773
+ });
872
774
  Ca.displayName = "UpsellingBanner";
873
- function qa({
874
- isOpen: a,
875
- setIsOpen: r,
876
- label: s,
877
- variant: o = "promote",
878
- size: t = "md",
879
- showIcon: i = !0,
880
- side: n = "right",
881
- align: d = "center",
882
- icon: l = Ve,
883
- mediaUrl: f,
884
- title: m,
885
- description: N,
886
- width: L = "300px",
887
- trackVisibility: u,
888
- actions: x,
889
- onClick: S,
890
- hideLabel: R = !1
891
- }) {
775
+ function qa({ isOpen: a, setIsOpen: r, label: s, variant: o = "promote", size: t = "md", showIcon: i = !0, side: n = "right", align: d = "center", icon: l = Ve, mediaUrl: f, title: m, description: N, width: L = "300px", trackVisibility: u, actions: x, onClick: S, hideLabel: R = !1 }) {
892
776
  const [F, C] = v(!1), [y, P] = v(null), [h, D] = v(null), k = (p) => {
893
777
  r(p), S && S();
894
778
  }, B = async (p) => {
@@ -906,107 +790,98 @@ function qa({
906
790
  ...p,
907
791
  onClick: () => B(p)
908
792
  } : p);
909
- return /* @__PURE__ */ c($, { children: [
910
- /* @__PURE__ */ c(H, { open: me, onOpenChange: k, children: [
911
- /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e(
912
- w,
913
- {
793
+ return c($, {
794
+ children: [c(H, {
795
+ open: me,
796
+ onOpenChange: k,
797
+ children: [e(U, {
798
+ asChild: !0,
799
+ children: e(w, {
914
800
  variant: o,
915
801
  label: s,
916
802
  size: t,
917
803
  icon: i ? l : void 0,
918
804
  onClick: () => r(a),
919
805
  hideLabel: R
920
- }
921
- ) }),
922
- /* @__PURE__ */ e(
923
- W,
924
- {
925
- side: n,
926
- align: d,
927
- className: "w-fit border-none bg-transparent p-2 shadow-none",
928
- children: /* @__PURE__ */ e(
929
- xa,
930
- {
931
- mediaUrl: f,
932
- title: m,
933
- description: N,
934
- onClose: () => r(!1),
935
- dismissible: !1,
936
- width: L,
937
- trackVisibility: u,
938
- actions: he,
939
- showConfirmation: !1
940
- }
941
- )
942
- }
943
- )
944
- ] }),
945
- (h == null ? void 0 : h.type) === "upsell" && h.showConfirmation && y && /* @__PURE__ */ e(
946
- Z,
947
- {
948
- open: !0,
949
- onClose: fe,
950
- success: y === "success",
951
- errorMessage: h.errorMessage,
952
- successMessage: h.successMessage,
953
- nextSteps: h.nextSteps,
954
- closeLabel: h.closeLabel,
955
- portalContainer: null
956
- }
957
- )
958
- ] });
806
+ })
807
+ }), e(W, {
808
+ side: n,
809
+ align: d,
810
+ className: "w-fit border-none bg-transparent p-2 shadow-none",
811
+ children: e(xa, {
812
+ mediaUrl: f,
813
+ title: m,
814
+ description: N,
815
+ onClose: () => r(!1),
816
+ dismissible: !1,
817
+ width: L,
818
+ trackVisibility: u,
819
+ actions: he,
820
+ showConfirmation: !1
821
+ })
822
+ })]
823
+ }), (h == null ? void 0 : h.type) === "upsell" && h.showConfirmation && y && e(Z, {
824
+ open: !0,
825
+ onClose: fe,
826
+ success: y === "success",
827
+ errorMessage: h.errorMessage,
828
+ successMessage: h.successMessage,
829
+ nextSteps: h.nextSteps,
830
+ closeLabel: h.closeLabel,
831
+ portalContainer: null
832
+ })]
833
+ });
959
834
  }
960
- const ya = aa(
961
- null
962
- ), wa = ({ children: a, fullScreen: r = !0 }) => {
835
+ const ya = aa(null), wa = ({ children: a, fullScreen: r = !0 }) => {
963
836
  const s = ae(null), [o, t] = v(s.current);
964
837
  return Ke(() => {
965
838
  t(s.current);
966
- }, []), /* @__PURE__ */ e(ya.Provider, { value: { element: o }, children: /* @__PURE__ */ e(
967
- "div",
968
- {
839
+ }, []), e(ya.Provider, {
840
+ value: {
841
+ element: o
842
+ },
843
+ children: e("div", {
969
844
  ref: s,
970
845
  id: "f0-layout",
971
846
  className: b({
972
847
  "flex h-screen w-screen flex-col bg-[#F5F6F8] dark:bg-[#0D1625]": r
973
848
  }),
974
849
  children: a
975
- }
976
- ) });
977
- }, Na = ({
850
+ })
851
+ });
852
+ }, Na = ({ children: a }) => e(Xe, {
853
+ reducedMotion: "user",
978
854
  children: a
979
- }) => /* @__PURE__ */ e(Xe, { reducedMotion: "user", children: a }), Ga = ({
980
- children: a,
981
- layout: r,
982
- link: s,
983
- privacyModeInitiallyEnabled: o,
984
- image: t,
985
- i18n: i,
986
- l10n: n,
987
- isDev: d = !1,
988
- dataCollectionStorageHandler: l,
989
- showExperimentalWarnings: f = !1
990
- }) => /* @__PURE__ */ e(Na, { children: /* @__PURE__ */ e(
991
- Ae,
992
- {
855
+ }), Ga = ({ children: a, layout: r, link: s, privacyModeInitiallyEnabled: o, image: t, i18n: i, l10n: n, isDev: d = !1, dataCollectionStorageHandler: l, showExperimentalWarnings: f = !1 }) => e(Na, {
856
+ children: e(Ae, {
993
857
  isDev: d,
994
858
  showExperimentalWarnings: f,
995
- children: /* @__PURE__ */ e(qe, { ...n, children: /* @__PURE__ */ e(Ge, { ...i, children: /* @__PURE__ */ e(He, { ...s, children: /* @__PURE__ */ e(wa, { ...r, children: /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e(
996
- We,
997
- {
998
- initiallyEnabled: o,
999
- children: /* @__PURE__ */ e(Je, { ...t, children: /* @__PURE__ */ e(
1000
- Ye,
1001
- {
1002
- handler: l,
1003
- children: a
1004
- }
1005
- ) })
1006
- }
1007
- ) }) }) }) }) })
1008
- }
1009
- ) }), q = (a) => `datacollection-${a}`, Ha = {
859
+ children: e(qe, {
860
+ ...n,
861
+ children: e(Ge, {
862
+ ...i,
863
+ children: e(He, {
864
+ ...s,
865
+ children: e(wa, {
866
+ ...r,
867
+ children: e(Ue, {
868
+ children: e(We, {
869
+ initiallyEnabled: o,
870
+ children: e(Je, {
871
+ ...t,
872
+ children: e(Ye, {
873
+ handler: l,
874
+ children: a
875
+ })
876
+ })
877
+ })
878
+ })
879
+ })
880
+ })
881
+ })
882
+ })
883
+ })
884
+ }), q = (a) => `datacollection-${a}`, Ha = {
1010
885
  get: async (a) => JSON.parse(
1011
886
  localStorage.getItem(q(a)) ?? "{}"
1012
887
  ),