@tesouro/embedded-components-react 0.8.1 → 0.8.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.
Files changed (98) hide show
  1. package/dist/index.css +21 -120
  2. package/dist/index.d.ts +1 -3
  3. package/dist/lib/ProductsWidget.d.ts +1 -3
  4. package/dist/lib/ReceivablesWidget.d.ts +1 -3
  5. package/dist/lib/monite-sdk.d.ts +6 -59
  6. package/dist/lib/monite-sdk.js +9 -13
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +10 -14
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index112.js +2 -12
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index113.js +19 -26
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index151.js +4 -78
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index17.js +4 -23
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index187.js +24 -1
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index188.js +73 -35
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index189.js +19 -1
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index190.js +19 -16
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index191.js +5 -17
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index192.js +8 -4
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index193.js +11 -16
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index194.js +129 -20
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index195.js +5 -21
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index196.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +5 -8
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index198.js +218 -13
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index199.js +31 -17
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index200.js +14 -9
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index201.js +33 -24
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index202.js +19 -12
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index203.js +73 -8
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index204.js +180 -23
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index205.js +13 -13
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index206.js +203 -80
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index207.js +100 -14
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js +61 -97
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js +53 -42
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js +89 -25
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js +43 -1
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js +75 -102
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index213.js +82 -34
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index214.js +12 -171
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index215.js +24 -12
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index216.js +17 -4
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index217.js +4 -69
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index218.js +20 -23
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index219.js +1 -212
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index220.js +17 -92
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index221.js +30 -20
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index222.js +4 -1
  48. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +21 -17
  49. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index224.js +15 -157
  50. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index225.js +28 -99
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index226.js +28 -43
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index227.js +2 -4
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +1 -2
  55. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +1 -1
  56. package/dist/packages/shared-ui-shadcn/dist/index.js +19 -21
  57. package/package.json +1 -3
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index228.js +0 -24
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index229.js +0 -77
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index230.js +0 -19
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index231.js +0 -22
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index232.js +0 -8
  63. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index233.js +0 -12
  64. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index234.js +0 -13
  65. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index235.js +0 -133
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index236.js +0 -8
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index237.js +0 -8
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index238.js +0 -5
  69. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index239.js +0 -222
  70. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index240.js +0 -34
  71. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index241.js +0 -14
  72. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index242.js +0 -36
  73. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index243.js +0 -22
  74. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index244.js +0 -76
  75. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index245.js +0 -184
  76. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index246.js +0 -16
  77. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +0 -206
  78. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index248.js +0 -102
  79. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index249.js +0 -66
  80. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index250.js +0 -57
  81. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index251.js +0 -94
  82. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index252.js +0 -43
  83. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index253.js +0 -79
  84. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index254.js +0 -87
  85. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index255.js +0 -14
  86. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index256.js +0 -26
  87. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index257.js +0 -17
  88. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index258.js +0 -5
  89. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index259.js +0 -24
  90. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index260.js +0 -1
  91. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index261.js +0 -22
  92. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index262.js +0 -32
  93. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index263.js +0 -4
  94. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index264.js +0 -23
  95. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index265.js +0 -18
  96. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index266.js +0 -33
  97. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index267.js +0 -31
  98. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index268.js +0 -2
@@ -1,20 +1,20 @@
1
1
  import { cn as e } from "./index49.js";
2
2
  import { Button as t } from "./index110.js";
3
3
  import { Input as n } from "./index111.js";
4
- import { Textarea as r } from "./index112.js";
4
+ import "./index112.js";
5
5
  import "react";
6
- import { jsx as i } from "@emotion/react/jsx-runtime";
7
- import { cva as a } from "class-variance-authority";
6
+ import { jsx as r } from "@emotion/react/jsx-runtime";
7
+ import { cva as i } from "class-variance-authority";
8
8
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index113.js
9
- function o({ className: t, ...n }) {
10
- return /* @__PURE__ */ i("div", {
9
+ function a({ className: t, ...n }) {
10
+ return /* @__PURE__ */ r("div", {
11
11
  "data-slot": "input-group",
12
12
  role: "group",
13
13
  className: e("ttw:group/input-group ttw:relative ttw:flex ttw:w-full ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:transition-[color,box-shadow] ttw:outline-none ttw:dark:bg-input/30", "ttw:h-9 ttw:min-w-0 ttw:has-[>textarea]:h-auto", "ttw:has-[>[data-align=inline-start]]:[&>input]:pl-2", "ttw:has-[>[data-align=inline-end]]:[&>input]:pr-2", "ttw:has-[>[data-align=block-start]]:h-auto ttw:has-[>[data-align=block-start]]:flex-col ttw:has-[>[data-align=block-start]]:[&>input]:pb-3", "ttw:has-[>[data-align=block-end]]:h-auto ttw:has-[>[data-align=block-end]]:flex-col ttw:has-[>[data-align=block-end]]:[&>input]:pt-3", "ttw:has-[[data-slot=input-group-control]:focus-visible]:border-ring ttw:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] ttw:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "ttw:has-[[data-slot][aria-invalid=true]]:border-destructive ttw:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ttw:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", t),
14
14
  ...n
15
15
  });
16
16
  }
17
- var s = a("ttw:flex ttw:h-auto ttw:cursor-text ttw:items-center ttw:justify-center ttw:gap-2 ttw:py-1.5 ttw:text-sm ttw:font-medium ttw:text-muted-foreground ttw:select-none ttw:group-data-[disabled=true]/input-group:opacity-50 ttw:[&>kbd]:rounded-[calc(var(--radius)-5px)] ttw:[&>svg:not([class*=size-])]:size-4", {
17
+ var o = i("ttw:flex ttw:h-auto ttw:cursor-text ttw:items-center ttw:justify-center ttw:gap-2 ttw:py-1.5 ttw:text-sm ttw:font-medium ttw:text-muted-foreground ttw:select-none ttw:group-data-[disabled=true]/input-group:opacity-50 ttw:[&>kbd]:rounded-[calc(var(--radius)-5px)] ttw:[&>svg:not([class*=size-])]:size-4", {
18
18
  variants: { align: {
19
19
  "inline-start": "ttw:order-first ttw:pl-3 ttw:has-[>button]:ml-[-0.45rem] ttw:has-[>kbd]:ml-[-0.35rem]",
20
20
  "inline-end": "ttw:order-last ttw:pr-3 ttw:has-[>button]:mr-[-0.45rem] ttw:has-[>kbd]:mr-[-0.35rem]",
@@ -23,19 +23,19 @@ var s = a("ttw:flex ttw:h-auto ttw:cursor-text ttw:items-center ttw:justify-cent
23
23
  } },
24
24
  defaultVariants: { align: "inline-start" }
25
25
  });
26
- function c({ className: t, align: n = "inline-start", ...r }) {
27
- return /* @__PURE__ */ i("div", {
26
+ function s({ className: t, align: n = "inline-start", ...i }) {
27
+ return /* @__PURE__ */ r("div", {
28
28
  role: "group",
29
29
  "data-slot": "input-group-addon",
30
30
  "data-align": n,
31
- className: e(s({ align: n }), t),
31
+ className: e(o({ align: n }), t),
32
32
  onClick: (e) => {
33
33
  e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
34
34
  },
35
- ...r
35
+ ...i
36
36
  });
37
37
  }
38
- var l = a("ttw:flex ttw:items-center ttw:gap-2 ttw:text-sm ttw:shadow-none", {
38
+ var c = i("ttw:flex ttw:items-center ttw:gap-2 ttw:text-sm ttw:shadow-none", {
39
39
  variants: { size: {
40
40
  xs: "ttw:h-6 ttw:gap-1 ttw:rounded-[calc(var(--radius)-5px)] ttw:px-2 ttw:has-[>svg]:px-2 ttw:[&>svg:not([class*=size-])]:size-3.5",
41
41
  sm: "ttw:h-8 ttw:gap-1.5 ttw:rounded-md ttw:px-2.5 ttw:has-[>svg]:px-2.5",
@@ -44,28 +44,21 @@ var l = a("ttw:flex ttw:items-center ttw:gap-2 ttw:text-sm ttw:shadow-none", {
44
44
  } },
45
45
  defaultVariants: { size: "xs" }
46
46
  });
47
- function u({ className: n, type: r = "button", variant: a = "ghost", size: o = "xs", ...s }) {
48
- return /* @__PURE__ */ i(t, {
49
- type: r,
47
+ function l({ className: n, type: i = "button", variant: a = "ghost", size: o = "xs", ...s }) {
48
+ return /* @__PURE__ */ r(t, {
49
+ type: i,
50
50
  "data-size": o,
51
51
  variant: a,
52
- className: e(l({ size: o }), n),
52
+ className: e(c({ size: o }), n),
53
53
  ...s
54
54
  });
55
55
  }
56
- function d({ className: t, ...r }) {
57
- return /* @__PURE__ */ i(n, {
56
+ function u({ className: t, ...i }) {
57
+ return /* @__PURE__ */ r(n, {
58
58
  "data-slot": "input-group-control",
59
59
  className: e("ttw:flex-1 ttw:rounded-none ttw:border-0 ttw:bg-transparent ttw:shadow-none ttw:focus-visible:ring-0 ttw:dark:bg-transparent", t),
60
- ...r
61
- });
62
- }
63
- function f({ className: t, ...n }) {
64
- return /* @__PURE__ */ i(r, {
65
- "data-slot": "input-group-control",
66
- className: e("ttw:flex-1 ttw:resize-none ttw:rounded-none ttw:border-0 ttw:bg-transparent ttw:py-3 ttw:shadow-none ttw:focus-visible:ring-0 ttw:dark:bg-transparent", t),
67
- ...n
60
+ ...i
68
61
  });
69
62
  }
70
63
  //#endregion
71
- export { o as InputGroup, c as InputGroupAddon, u as InputGroupButton, d as InputGroupInput, f as InputGroupTextarea };
64
+ export { a as InputGroup, s as InputGroupAddon, l as InputGroupButton, u as InputGroupInput };
@@ -1,80 +1,6 @@
1
- import { useRootElements as e } from "./index63.js";
2
1
  import "./index64.js";
3
- import { cn as t } from "./index49.js";
2
+ import "./index49.js";
4
3
  import "react";
5
- import { XIcon as n } from "lucide-react";
6
- import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
7
- import * as a from "@radix-ui/react-dialog";
8
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index151.js
9
- function o({ ...e }) {
10
- return /* @__PURE__ */ r(a.Root, {
11
- "data-slot": "dialog",
12
- ...e
13
- });
14
- }
15
- function s({ ...e }) {
16
- return /* @__PURE__ */ r(a.Portal, {
17
- "data-slot": "dialog-portal",
18
- ...e
19
- });
20
- }
21
- function c({ className: e, ...n }) {
22
- return /* @__PURE__ */ r(a.Overlay, {
23
- "data-slot": "dialog-overlay",
24
- className: t("ttw:data-[state=open]:animate-in ttw:data-[state=closed]:animate-out ttw:data-[state=closed]:fade-out-0 ttw:data-[state=open]:fade-in-0 ttw:fixed ttw:inset-0 ttw:z-1300 ttw:bg-black/50", e),
25
- ...n
26
- });
27
- }
28
- function l({ className: o, children: l, showCloseButton: u = !0, fullScreen: d = !1, container: f, ...p }) {
29
- let { root: m } = e();
30
- return /* @__PURE__ */ i(s, {
31
- container: f ?? m,
32
- "data-slot": "dialog-portal",
33
- children: [/* @__PURE__ */ r(c, {}), /* @__PURE__ */ i(a.Content, {
34
- "data-slot": "dialog-content",
35
- className: t("ttw:bg-background ttw:data-[state=open]:animate-in ttw:data-[state=closed]:animate-out ttw:data-[state=closed]:fade-out-0 ttw:data-[state=open]:fade-in-0 ttw:data-[state=closed]:zoom-out-95 ttw:data-[state=open]:zoom-in-95 ttw:fixed ttw:top-[50%] ttw:left-[50%] ttw:z-1300 ttw:grid ttw:w-full ttw:max-w-[calc(100%-2rem)] ttw:translate-x-[-50%] ttw:translate-y-[-50%] ttw:gap-4 ttw:rounded-lg ttw:border ttw:p-6 ttw:shadow-lg ttw:duration-200 ttw:sm:max-w-lg", d && "ttw:border-none ttw:rounded-none ttw:h-screen ttw:max-w-screen ttw:sm:max-w-screen", o),
36
- ...p,
37
- onCloseAutoFocus: (e) => {
38
- e.preventDefault(), (f ?? document.body).style.pointerEvents = "";
39
- },
40
- children: [l, u && /* @__PURE__ */ i(a.Close, {
41
- "data-slot": "dialog-close",
42
- className: "ttw:ring-offset-background ttw:focus:ring-ring ttw:data-[state=open]:bg-accent ttw:data-[state=open]:text-muted-foreground ttw:absolute ttw:top-4 ttw:right-4 ttw:rounded-xs ttw:opacity-70 ttw:transition-opacity ttw:hover:opacity-100 ttw:focus:ring-2 ttw:focus:ring-offset-2 ttw:focus:outline-hidden ttw:disabled:pointer-events-none ttw:[&_svg]:pointer-events-none ttw:[&_svg]:shrink-0 ttw:[&_svg:not([class*=size-])]:size-4",
43
- children: [/* @__PURE__ */ r(n, {}), /* @__PURE__ */ r("span", {
44
- className: "ttw:sr-only",
45
- children: "Close"
46
- })]
47
- })]
48
- })]
49
- });
50
- }
51
- function u({ className: e, ...n }) {
52
- return /* @__PURE__ */ r("div", {
53
- "data-slot": "dialog-header",
54
- className: t("ttw:flex ttw:flex-col ttw:gap-2 ttw:text-center ttw:sm:text-left", e),
55
- ...n
56
- });
57
- }
58
- function d({ className: e, ...n }) {
59
- return /* @__PURE__ */ r("div", {
60
- "data-slot": "dialog-footer",
61
- className: t("ttw:flex ttw:flex-col-reverse ttw:gap-2 ttw:sm:flex-row ttw:sm:justify-end", e),
62
- ...n
63
- });
64
- }
65
- function f({ className: e, ...n }) {
66
- return /* @__PURE__ */ r(a.Title, {
67
- "data-slot": "dialog-title",
68
- className: t("ttw:text-lg ttw:leading-none ttw:font-semibold", e),
69
- ...n
70
- });
71
- }
72
- function p({ className: e, ...n }) {
73
- return /* @__PURE__ */ r(a.Description, {
74
- "data-slot": "dialog-description",
75
- className: t("ttw:text-muted-foreground ttw:text-sm", e),
76
- ...n
77
- });
78
- }
79
- //#endregion
80
- export { o as Dialog, l as DialogContent, p as DialogDescription, d as DialogFooter, u as DialogHeader, c as DialogOverlay, s as DialogPortal, f as DialogTitle };
4
+ import "lucide-react";
5
+ import "@emotion/react/jsx-runtime";
6
+ import "@radix-ui/react-dialog";
@@ -31,34 +31,15 @@ function s(t, { irrelevantVariants: n = [] } = {}) {
31
31
  }
32
32
  return r;
33
33
  }
34
- var c = (e) => e.split(".").some(t), l = (e) => e.split(".").map((e) => t(e) ? "*" : e).join("."), u = (e, n) => {
35
- let r = n.split(".").filter(t), i = 0;
36
- return e.split(".").map((e) => e === "*" ? r[i++] ?? e : e).join(".");
37
- };
38
- function d(e, t, { fieldMap: n, normalizePath: r }) {
39
- let i = [], a = /* @__PURE__ */ new Map();
40
- for (let { path: e, msg: o } of t) {
41
- if (!e) continue;
42
- let t = r ? r(e) : e, s = n[l(t)];
43
- if (!s) continue;
44
- let c = u(s, t);
45
- a.has(c) || i.push(c), a.set(c, o);
46
- }
47
- let o = [...i].sort((e, t) => Number(c(t)) - Number(c(e)));
48
- for (let t of o) e(t, {
49
- type: "server",
50
- message: a.get(t)
51
- });
52
- }
53
- var f = 3;
54
- function p(e, t) {
34
+ var c = 3;
35
+ function l(e, t) {
55
36
  let n = [...new Set(t.map(({ msg: e }) => e))];
56
37
  if (!n.length) return "";
57
- let r = n.slice(0, f).join("; "), i = n.length - f;
38
+ let r = n.slice(0, c).join("; "), i = n.length - c;
58
39
  return i > 0 ? e._("{message} (+{count} more)", {
59
40
  message: r,
60
41
  count: i
61
42
  }) : r;
62
43
  }
63
44
  //#endregion
64
- export { d as applyAPIValidationErrors, e as isHTTPValidationError, s as parseAPIValidationErrors, p as summarizeAPIValidationErrors };
45
+ export { e as isHTTPValidationError, s as parseAPIValidationErrors, l as summarizeAPIValidationErrors };
@@ -1 +1,24 @@
1
- import "./index52.js";
1
+ import { jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { Box as t, useTheme as n } from "@mui/material";
3
+ //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index187.js
4
+ var r = ({ children: r, shouldApplyFinanceStyles: i = !1 }) => {
5
+ let a = n();
6
+ return /* @__PURE__ */ e(t, {
7
+ sx: {
8
+ background: `linear-gradient(180deg, ${a.palette.primary.light} 0%, ${a.palette.background.paper} 100%)`,
9
+ display: "flex",
10
+ flexDirection: "column",
11
+ gap: 1,
12
+ px: 3,
13
+ py: i ? 3 : 2.5,
14
+ width: "100%",
15
+ minHeight: "auto",
16
+ borderRadius: "16px",
17
+ boxShadow: "0 16px 24px 0 rgba(0, 0, 0, 0.02)",
18
+ border: i ? "none" : `1px solid ${a.palette.divider}`
19
+ },
20
+ children: r
21
+ });
22
+ };
23
+ //#endregion
24
+ export { r as FinanceBannerWrapper };
@@ -1,39 +1,77 @@
1
- import { Button as e } from "./index110.js";
2
- import { LoadingSpinner as t } from "./index52.js";
3
- import { Dialog as n, DialogContent as r, DialogDescription as i, DialogFooter as a, DialogHeader as o, DialogTitle as s } from "./index151.js";
4
- import "./index187.js";
5
- import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
- import { useLingui as u } from "@lingui/react";
1
+ import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
2
+ import { Box as n, Link as r, Typography as i } from "@mui/material";
3
+ import { useLingui as a } from "@lingui/react";
7
4
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index188.js
8
- var d = ({ open: d, title: f, message: p, children: m, confirmLabel: h, cancelLabel: g, onClose: _, onConfirm: v, container: y, isLoading: b = !1 }) => {
9
- let { i18n: x } = u();
10
- return /* @__PURE__ */ c(n, {
11
- open: d,
12
- onOpenChange: _,
13
- "aria-label": x._("Confirmation dialog"),
14
- children: /* @__PURE__ */ l(r, {
15
- container: y,
16
- showCloseButton: !1,
17
- children: [
18
- /* @__PURE__ */ c(o, { children: /* @__PURE__ */ c(s, { children: f }) }),
19
- /* @__PURE__ */ c(i, { children: p || m }),
20
- /* @__PURE__ */ l(a, { children: [/* @__PURE__ */ c(e, {
21
- onClick: (e) => {
22
- e.stopPropagation(), _();
23
- },
24
- variant: "outline",
25
- children: g
26
- }), /* @__PURE__ */ l(e, {
27
- onClick: (e) => {
28
- e.stopPropagation(), v();
29
- },
30
- disabled: b,
31
- variant: "destructive",
32
- children: [b && /* @__PURE__ */ c(t, { className: "ttw:w-5 ttw:h-5 ttw:border-inherit ttw:border-t-transparent" }), h]
33
- })] })
34
- ]
35
- })
5
+ var o = [
6
+ {
7
+ id: 1,
8
+ question: "Does enrolling in the program affect my credit score?",
9
+ answer: "Nope! During the onboarding process we will only conduct a soft pull on your credit report, which will not affect your personal credit score."
10
+ },
11
+ {
12
+ id: 2,
13
+ question: "Why do I need to provide my bank connection details?",
14
+ answer: "Securely connecting your business bank account allows us to review your cashflow and determine your best loan offers."
15
+ },
16
+ {
17
+ id: 3,
18
+ question: "When should I expect to receive a loan offer?",
19
+ answer: "Once you are enrolled into the program, we will be actively analyzing your financials and creating pre-approved offers that work best for your business needs. We do this to help you avoid debt trap. Loan offers are usually provided within less than 48 hours."
20
+ },
21
+ {
22
+ id: 4,
23
+ question: "How do I repay the loan?",
24
+ answer: "At the moment we support monthly loan repayment once you agree to the loan payment schedule. A fixed amount will be automatically deducted from the bank you linked during the onboarding.In the near future, you can also choose to pay back the loan as a fixed percentage of your daily sales until the loan is fully repaid."
25
+ }
26
+ ], s = () => {
27
+ let { i18n: s } = a();
28
+ return /* @__PURE__ */ t(n, {
29
+ p: 4,
30
+ children: [
31
+ /* @__PURE__ */ t(n, { children: [/* @__PURE__ */ e(i, {
32
+ variant: "h3",
33
+ children: s._("Simplified, fast funding for your growing business")
34
+ }), /* @__PURE__ */ e(i, {
35
+ variant: "subtitle2",
36
+ mt: 2,
37
+ children: s._("Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available.")
38
+ })] }),
39
+ /* @__PURE__ */ t(n, {
40
+ mt: 5,
41
+ children: [/* @__PURE__ */ e(i, {
42
+ mb: 1,
43
+ variant: "h3",
44
+ children: s._("FAQ")
45
+ }), o.map((r) => /* @__PURE__ */ t(n, {
46
+ mt: 3,
47
+ children: [/* @__PURE__ */ e(i, {
48
+ variant: "subtitle2",
49
+ children: s._("{faqQuestion}", { faqQuestion: r.question })
50
+ }), /* @__PURE__ */ e(i, {
51
+ variant: "body1",
52
+ mt: 1,
53
+ children: s._("{faqAnswer}", { faqAnswer: r.answer })
54
+ })]
55
+ }, r.id))]
56
+ }),
57
+ /* @__PURE__ */ e(n, {
58
+ mt: 5,
59
+ children: /* @__PURE__ */ t(i, {
60
+ variant: "body2",
61
+ children: [
62
+ s._("All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon"),
63
+ " ",
64
+ /* @__PURE__ */ e(r, {
65
+ target: "_blank",
66
+ rel: "noopener noreferrer",
67
+ href: "https://kanmon.com",
68
+ children: s._("here.")
69
+ })
70
+ ]
71
+ })
72
+ })
73
+ ]
36
74
  });
37
75
  };
38
76
  //#endregion
39
- export { d as ConfirmationModal };
77
+ export { s as FinanceFaqDetails };
@@ -1 +1,19 @@
1
- import "./index188.js";
1
+ import { Dialog as e } from "./index117.js";
2
+ import "./index118.js";
3
+ import { FinanceFaqDetails as t } from "./index188.js";
4
+ import { useState as n } from "react";
5
+ import { Fragment as r, jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
6
+ //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index189.js
7
+ var o = ({ children: o }) => {
8
+ let [s, c] = n(!1);
9
+ return /* @__PURE__ */ a(r, { children: [o({ openModal: () => {
10
+ c(!0);
11
+ } }), /* @__PURE__ */ i(e, {
12
+ open: s,
13
+ onClose: () => c(!1),
14
+ alignDialog: "right",
15
+ children: /* @__PURE__ */ i(t, {})
16
+ })] });
17
+ };
18
+ //#endregion
19
+ export { o as FinanceFaqWrapper };
@@ -1,19 +1,22 @@
1
- import { Fragment as e } from "react";
2
- import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
1
+ import { jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { Box as t, useTheme as n } from "@mui/material";
3
3
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index190.js
4
- function r(r, i) {
5
- let a = r.split("\0");
6
- return a.length === 1 ? /* @__PURE__ */ t("span", { children: r }) : /* @__PURE__ */ t("span", {
7
- className: "ttw:flex ttw:min-w-0",
8
- children: a.map((r, o) => /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
9
- className: "ttw:whitespace-pre-wrap",
10
- children: r
11
- }), o < a.length - 1 && /* @__PURE__ */ t("span", {
12
- className: "ttw:min-w-[4ch] ttw:shrink-[9999] ttw:truncate",
13
- title: i,
14
- children: i
15
- })] }, o))
4
+ var r = ({ progress: r }) => {
5
+ let i = n();
6
+ return /* @__PURE__ */ e(t, {
7
+ sx: {
8
+ backgroundColor: i.palette.divider,
9
+ width: "100%",
10
+ height: "6px",
11
+ borderRadius: .5
12
+ },
13
+ children: /* @__PURE__ */ e(t, { sx: {
14
+ backgroundColor: i.palette.primary.main,
15
+ width: `${r}%`,
16
+ height: "6px",
17
+ borderRadius: .5
18
+ } })
16
19
  });
17
- }
20
+ };
18
21
  //#endregion
19
- export { r as messageWithTruncatedName };
22
+ export { r as FinanceProgressBar };
@@ -1,20 +1,8 @@
1
- import { getAPIErrorMessage as e } from "./index18.js";
2
- import { useMoniteContext as t } from "./index36.js";
3
- import { messageWithTruncatedName as n } from "./index190.js";
4
- import { toast as r } from "react-hot-toast";
5
- import { useLingui as i } from "@lingui/react";
1
+ import { useMoniteContext as e } from "./index36.js";
6
2
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index191.js
7
- var a = (a) => {
8
- let { api: o, queryClient: s } = t(), { i18n: c } = i();
9
- return o.finops.postProducts.useMutation(void 0, {
10
- onSuccess: async (e) => {
11
- a?.(e), await o.finops.getProducts.invalidateQueries(s), r.success(n(c._("{name} has been added to the list.", { name: "\0" }), e.name));
12
- },
13
- onError: (t) => {
14
- let n = e(c, t, { defaultMessage: "" });
15
- r.error(n ? c._("Failed to create: {reason}", { reason: n }) : c._("Failed to create"));
16
- }
17
- });
3
+ var t = () => {
4
+ let { api: t } = e();
5
+ return t.finops.getFinancingOffers.useQuery();
18
6
  };
19
7
  //#endregion
20
- export { a as useCreateProduct };
8
+ export { t as useGetFinanceOffers };
@@ -1,8 +1,12 @@
1
1
  import { useMoniteContext as e } from "./index36.js";
2
+ import { toast as t } from "react-hot-toast";
3
+ import { useLingui as n } from "@lingui/react";
2
4
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index192.js
3
- var t = () => {
4
- let { api: t } = e();
5
- return t.finops.getMeasureUnits.useQuery();
5
+ var r = () => {
6
+ let { api: r } = e(), { i18n: i } = n();
7
+ return r.finops.postFinancingTokens.useMutation({}, { onError: () => {
8
+ t.error(i._("The financing service is currently unavailable. Please reload the page or try again later."));
9
+ } });
6
10
  };
7
11
  //#endregion
8
- export { t as useGetMeasureUnits };
12
+ export { r as useGetFinancingConnectToken };
@@ -1,18 +1,13 @@
1
- import { useMoniteContext as e } from "./index36.js";
2
- import { messageWithTruncatedName as t } from "./index190.js";
3
- import { toast as n } from "react-hot-toast";
4
- import { useLingui as r } from "@lingui/react";
1
+ import "./index143.js";
2
+ import { createContext as e, useContext as t } from "react";
3
+ import "@emotion/react/jsx-runtime";
4
+ import "@lingui/react";
5
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index193.js
6
- var i = (i) => {
7
- let { api: a, queryClient: o } = e(), { i18n: s } = r();
8
- return a.finops.deleteMeasureUnitsId.useMutation(void 0, {
9
- onSuccess: async () => {
10
- i && (await a.finops.getMeasureUnits.invalidateQueries(o), n.success(t(s._("Unit {name} was deleted from the list.", { name: "\0" }), i)));
11
- },
12
- onError: (e) => {
13
- console.error(e), n.error(s._("Failed to delete Unit."));
14
- }
15
- });
16
- };
6
+ var n = e(null);
7
+ function r() {
8
+ let e = t(n);
9
+ if (!e) throw Error("Could not find KanmonContext. Make sure that you are using \"MoniteProvider\" component before calling this hook.");
10
+ return e;
11
+ }
17
12
  //#endregion
18
- export { i as useDeleteMeasureUnit };
13
+ export { n as KanmonContext, r as useKanmonContext };
@@ -1,24 +1,133 @@
1
- import { getAPIErrorMessage as e } from "./index18.js";
2
- import { useMoniteContext as t } from "./index36.js";
3
- import { messageWithTruncatedName as n } from "./index190.js";
4
- import { toast as r } from "react-hot-toast";
5
- import { useLingui as i } from "@lingui/react";
1
+ import { useMoniteContext as e } from "./index36.js";
2
+ import { useMyEntity as t } from "./index45.js";
3
+ import "./index48.js";
4
+ import { useComponentSettings as n } from "./index71.js";
5
+ import "./index73.js";
6
+ import { useKanmonContext as r } from "./index193.js";
7
+ import { useGetFinanceOffers as i } from "./index191.js";
8
+ import { useGetFinancingConnectToken as a } from "./index192.js";
9
+ import { useEffect as o, useState as s } from "react";
10
+ import { useLingui as c } from "@lingui/react";
11
+ import l from "react-script-hook";
6
12
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index194.js
7
- var a = (a, o) => {
8
- let { api: s, queryClient: c } = t(), { i18n: l } = i();
9
- return s.finops.postMeasureUnits.useMutation({}, {
10
- onSuccess: async (e) => {
11
- await s.finops.getMeasureUnits.invalidateQueries(c), r.success(n(l._("Unit {name} was added to the list", { name: "\0" }), e.name)), a?.();
12
- },
13
- onError: async (t) => {
14
- let n = e(l, t);
15
- if (n.includes("already exists")) {
16
- o?.(n);
17
- return;
18
- }
19
- r.error(n);
13
+ var u = "https://cdn.sandbox.kanmon.dev/scripts/v2/kanmon-connect.js", d = "https://cdn.kanmon.dev/scripts/v2/kanmon-connect.js", f = {
14
+ INIT: "init",
15
+ IN_PROGRESS: "in_progress",
16
+ PENDING_APPROVAL: "pending_approval",
17
+ NO_OFFERS_AVAILABLE: "no_offers",
18
+ SERVICING: "servicing",
19
+ APPROVED: "approved",
20
+ OFFER_ACCEPTED: "offer_accepted",
21
+ OFFERS_EXPIRED: "offers_expired"
22
+ }, p = () => {
23
+ let { apiUrl: p, api: m, queryClient: h, entityId: g } = e(), { isKanmonInitialized: _, toggleKanmon: v, handleButtonText: y, buttonText: b } = r(), { onboardingCallbacks: x } = n(), { i18n: S } = c(), C = a(), { data: w } = i(), { isUSEntity: T } = t(), E = (() => {
24
+ switch (w?.business_status) {
25
+ case "NEW":
26
+ default: return f.INIT;
27
+ case "INPUT_REQUIRED": return f.IN_PROGRESS;
28
+ case "ONBOARDED": return w?.offers?.length === 0 ? f.PENDING_APPROVAL : w?.offers?.[0]?.status === "NEW" ? f.APPROVED : w?.offers?.[0]?.status === "EXPIRED" ? f.OFFERS_EXPIRED : w?.offers?.[0]?.status === "ACCEPTED" ? f.OFFER_ACCEPTED : f.SERVICING;
29
+ }
30
+ })(), D = (() => {
31
+ try {
32
+ let e = new URL(p);
33
+ return !["api.dev.monite.com", "api.sandbox.monite.com"].includes(e.hostname);
34
+ } catch {
35
+ return !0;
20
36
  }
21
- });
37
+ })() ? d : u, [O] = l({ src: D }), [k, A] = s(!1), j = (e) => {
38
+ let t = {
39
+ type: "receivable",
40
+ status: "NEW",
41
+ invoice_id: e?.platformInvoiceId,
42
+ document_id: e?.platformInvoiceNumber,
43
+ due_date: e?.invoiceDueDate,
44
+ issue_date: e?.invoiceIssuedDate,
45
+ total_amount: e?.invoiceAmountCents,
46
+ currency: "USD",
47
+ payer_type: e?.payorType,
48
+ payer_business_name: e?.payorBusinessName,
49
+ payer_first_name: e?.payorFirstName,
50
+ payer_last_name: e?.payorLastName,
51
+ requested_amount: e?.amountRequestedForFinancingCents,
52
+ principal_amount: e?.principalAmountCents,
53
+ repayment_amount: e?.repaymentAmountCents,
54
+ advance_amount: e?.invoiceAdvanceAmountCents,
55
+ advance_rate_percentage: e?.advanceRatePercentage * 100,
56
+ fee_amount: e?.feeAmountCents,
57
+ fee_percentage: e?.transactionFeePercentage * 100,
58
+ repayment_schedule: {
59
+ repayment_date: e?.repaymentSchedule?.schedule?.[0]?.repaymentDate,
60
+ repayment_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentAmountCents,
61
+ repayment_fee_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentFeeAmountCents,
62
+ repayment_principal_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentPrincipalAmountCents
63
+ }
64
+ };
65
+ m.finops.getFinancingInvoices.setQueryData(m.finops.getFinancingInvoices.getQueryKey({ query: {
66
+ type: "receivable",
67
+ invoice_id: e?.platformInvoiceId
68
+ } }), (e) => ({
69
+ ...e,
70
+ data: [t]
71
+ }), h), m.finops.getFinancingInvoices.setQueryData(m.finops.getFinancingInvoices.getQueryKey({ query: {} }), (e) => {
72
+ let n = e?.data ? e.data : [];
73
+ return {
74
+ ...e,
75
+ data: [t, ...n]
76
+ };
77
+ }, h);
78
+ }, M = ({ connectToken: e }) => {
79
+ window?.KANMON_CONNECT?.start({
80
+ connectToken: e,
81
+ onEvent: (e) => {
82
+ if (e.eventType === "USER_STATE_CHANGED" || e.eventType === "USER_CONFIRMED_INVOICE") {
83
+ if (e.eventType === "USER_CONFIRMED_INVOICE") j(e.data.invoice);
84
+ else {
85
+ switch (e.data.userState) {
86
+ case "START_FLOW":
87
+ y(S._("Apply for financing"));
88
+ break;
89
+ case "USER_INPUT_REQUIRED":
90
+ e.data.section === "OFFER" ? y(S._("Review terms and sign")) : y(S._("Resume application"));
91
+ break;
92
+ case "WAITING_FOR_OFFERS":
93
+ y(""), (w?.business_status === "INPUT_REQUIRED" || w?.business_status === "NEW") && x.onWorkingCapitalOnboardingComplete?.(g);
94
+ break;
95
+ case "OFFERS_EXPIRED":
96
+ case "NO_OFFERS_EXTENDED":
97
+ y("");
98
+ break;
99
+ case "SERVICING":
100
+ y(S._("Financing menu")), w?.business_status === "ONBOARDED" && w?.offers?.[0]?.status === "NEW" && window.localStorage.setItem("isFinanceTabNew", "true");
101
+ break;
102
+ case "VIEW_OFFERS":
103
+ case "OFFER_ACCEPTED": y(S._("Review terms and sign"));
104
+ }
105
+ m.finops.getFinancingOffers.invalidateQueries(h);
106
+ }
107
+ }
108
+ }
109
+ });
110
+ };
111
+ o(() => {
112
+ !_ && !O && T && (async () => {
113
+ A(!0);
114
+ try {
115
+ let e = await C.mutateAsync();
116
+ M({ connectToken: e.connect_token }), v(!0);
117
+ } catch {} finally {
118
+ A(!1);
119
+ }
120
+ })();
121
+ }, [O, T]);
122
+ let N = O || k, P = T, F = w?.business_status === "ONBOARDED" && w?.offers?.[0]?.status === "CURRENT";
123
+ return {
124
+ buttonText: b,
125
+ applicationState: E,
126
+ offer: w?.offers?.[0],
127
+ isLoading: N,
128
+ isEnabled: P,
129
+ isServicing: F
130
+ };
22
131
  };
23
132
  //#endregion
24
- export { a as useCreateMeasureUnit };
133
+ export { f as FinancialApplicationState, p as useFinancing };